CSE 3711 Lecture-No.6 (Summer 2023)
CSE 3711 Lecture-No.6 (Summer 2023)
CSE 3711 Lecture-No.6 (Summer 2023)
encapsulates datagram
link layer has responsibility of
transferring datagram from one node enterprise
network
to physically adjacent node over a link
Link Layer: 6-4
Link layer: context
datagram transferred by transportation analogy:
different link protocols over trip from Princeton to Lausanne
different links: • limo: Princeton to JFK
• e.g., WiFi on first link, Ethernet • plane: JFK to Geneva
on next link • train: Geneva to Lausanne
combination of hardware,
software, firmware network interface
6-slot 6-slot
frame frame
1 3 4 1 3 4
frequency bands
FDM cable
• polling overhead
• latency
• single point of failure (master) slaves
137.196.7.78
1A-2F-BB-76-09-AD
LAN
(wired or wireless)
137.196.7/24
71-65-F7-2B-08-53 58-23-D7-FA-20-B0
137.196.7.23 137.196.7.14
0C-C4-11-6F-E3-98
137.196.7.88
D
Link Layer: 6-22
ARP protocol in action
example: A wants to send datagram to B
• B’s MAC address not in A’s ARP table, so A uses ARP to find B’s MAC address
C
ARP table in A
IP addr MAC addr TTL
TTL
137.196. 58-23-D7-FA-20-B0 500
A B
7.14
71-65-F7-2B-08-53 58-23-D7-FA-20-B0
137.196.7.23 137.196.7.14
A B
R
111.111.111.111
74-29-9C-E8-FF-55 222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
111.111.111.112 111.111.111.110
CC-49-DE-D0-AB-7D E6-E9-00-17-BB-4B 222.222.222.221
88-B2-2F-54-1A-0F
Link Layer: 6-25
Routing to another subnet: addressing
A creates IP datagram with IP source A, destination B
A creates link-layer frame containing A-to-B IP datagram
• R's MAC address is frame’s destination
MAC src: 74-29-9C-E8-FF-55
MAC dest: E6-E9-00-17-BB-4B
IP src: 111.111.111.111
IP dest: 222.222.222.222
IP
Eth
Phy
A B
R
111.111.111.111
74-29-9C-E8-FF-55 222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
111.111.111.112 111.111.111.110
CC-49-DE-D0-AB-7D E6-E9-00-17-BB-4B 222.222.222.221
88-B2-2F-54-1A-0F
Link Layer: 6-26
Routing to another subnet: addressing
frame sent from A to R
frame received at R, datagram removed, passed up to IP
IP IP
Eth Eth
Phy Phy
A B
R
111.111.111.111
74-29-9C-E8-FF-55 222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
111.111.111.112 111.111.111.110
CC-49-DE-D0-AB-7D E6-E9-00-17-BB-4B 222.222.222.221
88-B2-2F-54-1A-0F
Link Layer: 6-27
Routing to another subnet: addressing
R determines outgoing interface, passes datagram with IP source A, destination B
to link layer
R creates link-layer frame containing A-to-B IP datagram. Frame destination address:
B's MAC address
MAC src: 1A-23-F9-CD-06-9B
MAC dest: 49-BD-D2-C7-56-2A
IP src: 111.111.111.111
IP dest: 222.222.222.222
IP
Eth
Phy
A B
R
111.111.111.111
74-29-9C-E8-FF-55 222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
111.111.111.112 111.111.111.110
CC-49-DE-D0-AB-7D E6-E9-00-17-BB-4B 222.222.222.221
88-B2-2F-54-1A-0F
Link Layer: 6-28
Routing to another subnet: addressing
R determines outgoing interface, passes datagram with IP source A, destination B
to link layer
R creates link-layer frame containing A-to-B IP datagram. Frame destination address:
B's MAC address
MAC src: 1A-23-F9-CD-06-9B
transmits link-layer frame MAC dest: 49-BD-D2-C7-56-2A
IP src: 111.111.111.111
IP dest: 222.222.222.222
IP
IP Eth
Eth Phy
Phy
A B
R
111.111.111.111
74-29-9C-E8-FF-55 222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
111.111.111.112 111.111.111.110
CC-49-DE-D0-AB-7D E6-E9-00-17-BB-4B 222.222.222.221
88-B2-2F-54-1A-0F
Link Layer: 6-29
Routing to another subnet: addressing
B receives frame, extracts IP datagram destination B
B passes datagram up protocol stack to IP
IP src: 111.111.111.111
IP dest: 222.222.222.222
IP
IP Eth
Eth Phy
Phy
A B
R
111.111.111.111
74-29-9C-E8-FF-55 222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
111.111.111.112 111.111.111.110
CC-49-DE-D0-AB-7D E6-E9-00-17-BB-4B 222.222.222.221
88-B2-2F-54-1A-0F
Link Layer: 6-30
Ethernet switch
Switch is a link-layer device: takes an active role
• store, forward Ethernet frames
• examine incoming frame’s MAC address, selectively forward frame
to one-or-more outgoing links when frame is to be forwarded on
segment, uses CSMA/CD to access segment
transparent: hosts unaware of presence of switches
plug-and-play, self-learning
• switches do not need to be configured
B’ C
A’ A A’
Sounds
web server Google’s network
simple!
64.233.169.105 64.233.160.0/19
ARP IP
DNS
ARP query Eth arriving mobile:
Phy ARP client DNS query created, encapsulated in UDP,
encapsulated in IP, encapsulated in Eth. To
send frame to router, need MAC address of
router interface: ARP
ARP ARP query broadcast, received by router, which
Eth
replies with ARP reply giving MAC address of
ARP reply
Phy
router has router interface
ARP server
client now knows MAC address of first hop
router, so can now send frame containing
DNS query
Comcast network
68.80.0.0/13
IP datagram
IP datagram forwarded from campus
containing DNS query
network into Comcast network,
forwarded via LAN
routed (tables created by RIP, OSPF,
switch from client to
IS-IS and/or BGP routing protocols)
1st hop router
to DNS server
Link Layer: 6-42
A day in the life…TCP connection carrying HTTP
HTTP
HTTP to send HTTP request,
SYNACK
SYN TCP
SYNACK
SYN IP client first opens TCP
SYNACK
SYN Eth
Phy Comcast network
socket to web server
68.80.0.0/13
TCP SYN segment (step 1 in TCP
3-way handshake) inter-domain
routed to web server
web server responds with
SYNACK
SYN
SYNACK
SYN
TCP
IP
TCP SYNACK (step 2 in TCP 3-
SYNACK
SYN Eth way handshake)
Phy
Google web server
TCP connection established!
64.233.169.105