Chapter2 l2
Chapter2 l2
Application
Layer Application
Layer
Transport
Transport
Layer
Layer
Internet
Internet
Layer
Layer
Network Network
Interface Interface
(a) (b)
3
TCP/IP architecture—transport layer
4
TCP/IP architecture-- Internet layer
Machine Machine B
A Application
Application
Router/Gateway Transport
Transport
Internet Internet Internet
Network Interface
Network Interface Network Interface
Network 1 Network 2
Packet Packet
Packet of network1 Packet
of network2
of network1 of network2
Network 1 Network 2
Figure 2.11
6
The procedure executed at
1.routers
Router receives a frame from one network (e.g., N1) through its
physical layer
2. The data link entity for N1 extracts the IP packet from the frame
and passes the IP packet up to its network entity.
3. The network entity checks destination IP address (finds the packet
is not for itself) and determines the next hop based on
destination IP address (i.e., routing) , this next hop router will
be in another network (e.g. N2)
4. Network entity passes the IP packet down to the data link entity
for N2
5. Data link entity for N2 encapsulates the IP packet in a frame of N2
and passes the frame down to physical layer for transmission to
the next router through network N2.
7
App. HTTP SMTP DNS RTP
IP provides
Internet IP independence
from underlying
networks
9
An internet consisting of an Ethernet LAN and a point-to-point link
(a) (1,1)
(2,1)
router (2,2)
s (1,3) r PPP
Ethernet w
(1,2)
(b)
Ethernet PPP
10
Figure 2.13
(1,1)
(2,1)
router (2,2)
s (1,3) r PPP
Ethernet w
(1,2)
IP IP
(1,2)(1,1) data (1,2)(1,1) data
Ethernet driver Ethernet driver
13
Example 2: server sends a IP datagram to PC
(a) (1,1)
(2,1)
router (2,2)
s (1,3) r PPP
w 1. Server forms IP packet with PC as destination
Ethernet
2. Server sends packet to router first by broadcast
3. Router finds the packet is not for itself, so sends to PC
4. PC finds the IP packet is for it,so pass on to upper layer
(1,2)(1) IP packet is the same all the way, but frames are not
(b) (2) Addresses in frame is different from ones in IP packet
(2) Router has two network interfaces
Server HTTP etc. PC
HTTP etc.
TCP/UDP Router TCP/UDP
IP IP IP
(1,1)(2,2) data (1,1)(2,2) data (1,1)(2,2
Net Interface
Net InterfaceS Net Interface
s,r,IP (1,1)(2,2) data r,pc,IP (1,1)(2,2) data
Ethernet
PPP
14
Figure 2.13
Example2: server sends IP datagram to PC (cont.)
16
Figure 2.14
S sends a packet to R:
1. Find R’s IP address by DNS.
2. Check its routing table for R, if find (next hop), send to it.
3. Otherwise, send to default router
4. Needs to find the physical address of the next hop router.
5. The router checks its routing table for the next hop and send to it.
s
net 3
G
net 1
G
G
G
net 5
net 2 G net 4 G
R
6. continue until the packet reaches the router in the same LAN with R.
7. The router finds R’s physical address and sends to it.
17
Figure 2.8
Big picture: web document
browsing
• Suppose a user on PC clicks a link of a document
contained in the server, and HTTP client passes
a request to TCP layer asking for setting up a
TCP connection, and the TCP connection
between the PC and the server has been
established (How? Discuss later).
• The http client then passes http request
message (such as GET /….) to TCP layer, what
will happen??
18
Big picture: web document browsing—HTTP request is passed down
HTTP Request
c, 80
Header contains source and TCP
destination port numbers
Header
(2,2)(11),TCP
Header contains source and
destination IP addresses; IP
transport protocol type Header
pc,r,IP
Header contains source
and destination physical Frame
ppp Check
addresses; network
protocol type Header Sequence
19
Figure 2.15
Big picture: web document browsing
• The ppp driver (data link entity) in PC forms a PPP
frame and sends the frame to the other end of
the PPP link, i.e., router
• The router extracts IP packet (from the PPP
frame), makes routing decision according on
destination IP address (1,1), forms an Ethernet
frame (encapsulating the IP packet) and
broadcasts it onto Ethernet
• The server NIC captures the frame, extracts the
IP packet and passes it to IP entity, then to TCP
entity and then to HTTP server
• Finally the server retrieves the document and puts
it in HTTP response packet and sends back to PC.
20
Sever processes multiple
requests
• Question: there is one http server, there may be
several http clients which sends http requests to the
http server simultaneously,so there are several
connections at the same with the same destination IP
address, same port number: 80, and the same
protocol type: TCP. How does the server distinguish
these connections and process them separately?
http http
client http server client
http
http client client
21
Sever processes multiple
requests
• Answer: the way to specify the end-to-end process-to-
process connection.
– Socket address: port number + IP address + protocol type
– Sender socket address: sender port number + sender IP
address + protocol type
– Receiver socket address: receiver port number + receiver IP
address + protocol
type.
– Connection = sender socket address + receiver socket address
http http
client c2,m1; s, 80, TCP http server clientm2
m1
cc,m3; s, 80,TCP
http
http client clientm3
c1,m1, s, 80, TCP
22
Apple Talk Protocols
• The Apple Talk Protocol suite includes the
following protocols:
AARP AppleTalk Address Resolution Protocol
DDP Datagram Delivery Protocol
RTMP Routing Table Maintenance Protocol
AEP AppleTalk Echo Protocol
ATP AppleTalk Transaction Protocol
NBP Name-Binding Protocol
ZIP Zone Information Protocol
ASP AppleTalk Session Protocol
PAP Printer Access Protocol
ADSP AppleTalk Data Stream Protocol
AFP AppleTalk Filing Protocol
23
• Apple Computer developed the AppleTalk protocol suite to
implement file transfer, printer sharing, and mail service among Apple
systems using the LocalTalk interface built into Apple hardware.
24
25