The Layer: Links, Access Networks and LANs
UNIT-5
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
By
G. Fayaz Hussain
Assistant Professor
Department of CSE
Ravindra College of Engineering for Women
Kurnool – 518452, Andhra Pradesh, India
Unit 5: Link layer
our goals:
Link Layer
5-2
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
Link layer, LANs: outline
5.1 Introduction, services
5.2 error detection, correction
5.3 multiple access protocols
5.4 LANs
5.5 link virtualization: MPLS
5.6 data center networking
5.7 a day in the life of a web request
Link Layer
5-3
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
Link layer: introduction
terminology:
Link Layer
5-4
data-link layer has responsibility of
transferring datagram from one node
to physically adjacent node over a link
global ISP
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
Link layer: context
transportation analogy:
Link Layer
5-5
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
Link layer services
Link Layer
5-6
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
Link layer services (more)
Link Layer
5-7
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
Where is the link layer implemented?
Link Layer
5-8
controller
physical
transmission
cpu
memory
host
bus
(e.g., PCI)
network adapter
card
application
transport
network
link
link
physical
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
Adaptors communicating
Link Layer
5-9
controller
controller
sending host
receiving host
datagram
datagram
datagram
frame
Link layer, LANs: outline
5.1 introduction, services
5.2 error detection, correction
5.3 multiple access protocols
5.4 LANs
5.5 link virtualization: MPLS
5.6 data center networking
5.7 a day in the life of a web request
Link Layer
5-10
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
Error detection
Link Layer
5-11
EDC= Error Detection and Correction bits (redundancy)
D = Data protected by error checking, may include header fields �
otherwise
Data Link Layer
5-12
Parity checking
Link Layer
5-13
single bit parity:
two-dimensional bit parity:
0
0
Internet checksum (review)
sender:
receiver:
Link Layer
5-14
goal: detect “errors” (e.g., flipped bits) in transmitted packet (note: used at transport layer only)
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
Data Link Layer
5-15
Cyclic redundancy check
Link Layer
5-16
Data Link Layer
5-17
Data Link Layer
5-18
Data Link Layer
5-19
Link layer, LANs: outline
5.1 introduction, services
5.2 error detection, correction
5.3 multiple access protocols
5.4 LANs
5.5 link virtualization: MPLS
5.6 data center networking
5.7 a day in the life of a web request
Link Layer
5-20
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
Multiple access links, protocols
two types of “links”:
Link Layer
5-21
shared wire (e.g.,
cabled Ethernet)
shared RF
(e.g., 802.11 WiFi)
shared RF
(satellite)
humans at a
cocktail party
(shared air, acoustical)
Multiple access protocols
multiple access protocol
Link Layer
5-22
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
An ideal multiple access protocol
given: broadcast channel of rate R bps
desiderata:
1. when one node wants to transmit, it can send at rate R.
2. when M nodes want to transmit, each can send at average rate R/M
3. fully decentralized:
4. simple
Link Layer
5-23
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
MAC protocols: taxonomy
three broad classes:
Link Layer
5-24
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
Channel partitioning MAC protocols: TDMA
TDMA: time division multiple access
Link Layer
5-25
1
3
4
1
3
4
6-slot
frame
6-slot
frame
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
Channel partitioning MAC protocols: FDMA
FDMA: frequency division multiple access
Link Layer
5-26
frequency bands
time
FDM cable
Random access protocols
Link Layer
5-27
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
Slotted ALOHA
assumptions:
operation:
Link Layer
5-28
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
Slotted ALOHA
Pros:
Cons:
Link Layer
5-29
1
1
1
1
2
3
2
2
3
3
node 1
node 2
node 3
C
C
C
S
S
S
E
E
E
Pure (unslotted) ALOHA
Link Layer
5-30
CSMA (carrier sense multiple access)
CSMA: listen before transmit:
if channel sensed idle: transmit entire frame
Link Layer
5-31
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
CSMA collisions
Link Layer
5-32
spatial layout of nodes
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
CSMA/CD (collision detection)
CSMA/CD: carrier sensing, deferral as in CSMA
Link Layer
5-33
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
CSMA/CD (collision detection)
Link Layer
5-34
spatial layout of nodes
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
“Taking turns” MAC protocols
channel partitioning MAC protocols:
random access MAC protocols
“taking turns” protocols
look for best of both worlds!
Link Layer
5-35
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
“Taking turns” MAC protocols
polling:
Link Layer
5-36
master
slaves
poll
data
data
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
“Taking turns” MAC protocols
Link Layer
5-37
token passing:
T
data
(nothing
to send)
T
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
Summary of MAC protocols
Link Layer
5-38
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
Link layer, LANs: outline
5.1 introduction, services
5.2 error detection, correction
5.3 multiple access protocols
5.4 LANs
5.5 link virtualization: MPLS
5.6 data center networking
5.7 a day in the life of a web request
Link Layer
5-39
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
MAC addresses and ARP
Link Layer
5-40
hexadecimal (base 16) notation
(each “number” represents 4 bits)
LAN addresses and ARP
Link Layer
5-41
each adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
(wired or
wireless)
LAN addresses (more)
Link Layer
5-42
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
ARP: address resolution protocol
ARP table: each IP node (host, router) on LAN has table
< IP address; MAC address; TTL>
Link Layer
5-43
Question: how to determine
interface’s MAC address, knowing its IP address?
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137.196.7.23
137.196.7.78
137.196.7.14
137.196.7.88
ARP protocol: same LAN
Link Layer
5-44
Addressing: routing to another LAN
walkthrough: send datagram from A to B via R
Link Layer
5-45
R
1A-23-F9-CD-06-9B
222.222.222.220
111.111.111.110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111.111.111.112
111.111.111.111
74-29-9C-E8-FF-55
A
222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.221
88-B2-2F-54-1A-0F
B
Addressing: routing to another LAN
R
1A-23-F9-CD-06-9B
222.222.222.220
111.111.111.110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111.111.111.112
111.111.111.111
74-29-9C-E8-FF-55
A
222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.221
88-B2-2F-54-1A-0F
B
Link Layer
5-46
IP
Eth
Phy
IP src: 111.111.111.111
IP dest: 222.222.222.222
MAC src: 74-29-9C-E8-FF-55
MAC dest: E6-E9-00-17-BB-4B
Addressing: routing to another LAN
R
1A-23-F9-CD-06-9B
222.222.222.220
111.111.111.110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111.111.111.112
111.111.111.111
74-29-9C-E8-FF-55
A
222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.221
88-B2-2F-54-1A-0F
B
Link Layer
5-47
IP src: 111.111.111.111
IP dest: 222.222.222.222
MAC src: 1A-23-F9-CD-06-9B
MAC dest: 49-BD-D2-C7-56-2A
IP
Eth
Phy
IP
Eth
Phy
Addressing: routing to another LAN
R
1A-23-F9-CD-06-9B
222.222.222.220
111.111.111.110
E6-E9-00-17-BB-4B
CC-49-DE-D0-AB-7D
111.111.111.112
111.111.111.111
74-29-9C-E8-FF-55
A
222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.221
88-B2-2F-54-1A-0F
B
Link Layer
5-48
IP src: 111.111.111.111
IP dest: 222.222.222.222
MAC src: 1A-23-F9-CD-06-9B
MAC dest: 49-BD-D2-C7-56-2A
IP
Eth
Phy
IP
Eth
Phy
Link layer, LANs: outline
5.1 introduction, services
5.2 error detection, correction
5.3 multiple access protocols
5.4 LANs
5.5 link virtualization: MPLS
5.6 data center networking
5.7 a day in the life of a web request
Link Layer
5-49
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
Ethernet
“dominant” wired LAN technology:
Link Layer
5-50
Metcalfe’s Ethernet sketch
Ethernet: physical topology
Link Layer
5-51
switch
bus: coaxial cable
star
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble:
Link Layer
5-52
dest.
address
source
address
data (payload)
CRC
preamble
type
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
Ethernet frame structure (more)
Link Layer
5-53
dest.
address
source
address
data (payload)
CRC
preamble
type
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
Ethernet: unreliable, connectionless
Link Layer
5-54
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
Link layer, LANs: outline
5.1 introduction, services
5.2 error detection, correction
5.3 multiple access protocols
5.4 LANs
5.5 link virtualization: MPLS
5.6 data center networking
5.7 a day in the life of a web request
Link Layer
5-55
Switch: multiple simultaneous transmissions
Link Layer
5-56
switch with six interfaces
(1,2,3,4,5,6)
A
A’
B
B’
C
C’
1
2
3
4
5
6
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
Switch forwarding table
Q: how does switch know A’ reachable via interface 4, B’ reachable via interface 5?
Link Layer
5-57
switch with six interfaces
(1,2,3,4,5,6)
A
A’
B
B’
C
C’
1
2
3
4
5
6
Q: how are entries created, maintained in switch table?
Interconnecting switches
Link Layer
5-58
Q: sending from A to G - how does S1 know to forward frame destined to F via S4 and S3?
A
B
S1
C
D
E
F
S2
S4
S3
H
I
G
Institutional network
Link Layer
5-59
to external
network
router
IP subnet
mail server
web server
Switches vs. routers
both are store-and-forward:
both have forwarding tables:
Link Layer
5-60
application
transport
network
link
physical
network
link
physical
link
physical
switch
datagram
application
transport
network
link
physical
frame
frame
frame
datagram
VLANs
port-based VLAN: switch ports grouped (by switch management software) so that single physical switch ……
Link Layer
5-61
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure.
Virtual Local
Area Network
1
8
9
16
10
2
7
…
Electrical Engineering
(VLAN ports 1-8)
Computer Science
(VLAN ports 9-15)
15
…
Electrical Engineering
(VLAN ports 1-8)
…
1
8
2
7
9
16
10
15
…
Computer Science
(VLAN ports 9-16)
… operates as multiple virtual switches
Port-based VLAN
Link Layer
5-62
1
8
9
16
10
2
7
…
Electrical Engineering
(VLAN ports 1-8)
Computer Science
(VLAN ports 9-15)
15
…
router
Link layer, LANs: outline
5.1 introduction, services
5.2 error detection, correction
5.3 multiple access protocols
5.4 LANs
5.5 link virtualization: MPLS
5.6 data center networking
5.7 a day in the life of a web request
Link Layer
5-63
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
Multiprotocol label switching (MPLS)
Link Layer
5-64
PPP or Ethernet
header
IP header
remainder of link-layer frame
MPLS header
label
Exp
S
TTL
20
3
1
5
MPLS capable routers
Link Layer
5-65
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
MPLS versus IP paths
Link Layer
5-66
R2
D
R3
R5
A
R6
IP router
R4
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
MPLS versus IP paths
Link Layer
5-67
R2
D
R3
R4
R5
A
R6
IP-only
router
MPLS and
IP router
entry router (R4) can use different MPLS routes to A based, e.g., on source address
MPLS signaling
Link Layer
5-68
D
R4
R5
A
R6
modified
link state
flooding
RSVP-TE
MPLS forwarding tables
Link Layer
5-69
R1
R2
D
R3
R4
R5
0
1
0
0
A
R6
in out out
label label dest interface
6 - A 0
in out out
label label dest interface
10 6 A 1
12 9 D 0
in out out
label label dest interface
10 A 0
12 D 0
1
in out out
label label dest interface
8 6 A 0
0
8 A 1
Link layer, LANs: outline
5.1 introduction, services
5.2 error detection, correction
5.3 multiple access protocols
5.4 LANs
5.5 link virtualization: MPLS
5.6 data center networking
5.7 a day in the life of a web request
Link Layer
5-70
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
Data center networks
Link Layer
5-71
Inside a 40-ft Microsoft container,
Chicago data center
Link Layer
5-72
Server racks
TOR switches
Tier-1 switches
Tier-2 switches
Load
balancer
Load
balancer
B
1
2
3
4
5
6
7
8
A
C
Border router
Access router
Internet
Data center networks
load balancer: application-layer routing
Server racks
TOR switches
Tier-1 switches
Tier-2 switches
1
2
3
4
5
6
7
8
Data center networks
Link layer, LANs: outline
5.1 introduction, services
5.2 error detection, correction
5.3 multiple access protocols
5.4 LANs
5.5 link virtualization: MPLS
5.6 data center networking
5.7 a day in the life of a web request
Link Layer
5-74
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
Synthesis: a day in the life of a web request
Link Layer
5-75
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
A day in the life: scenario
Link Layer
5-76
Comcast network
68.80.0.0/13
Google’s network
64.233.160.0/19
64.233.169.105
web server
DNS server
school network
68.80.2.0/24
web page
browser
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL
A day in the life… connecting to the Internet
router
(runs DHCP)
Link Layer
5-77
DHCP
UDP
IP
Eth
Phy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCP
UDP
IP
Eth
Phy
DHCP
DHCP
DHCP
DHCP
DHCP
A day in the life… connecting to the Internet
router
(runs DHCP)
Link Layer
5-78
DHCP
UDP
IP
Eth
Phy
DHCP
DHCP
DHCP
DHCP
DHCP
UDP
IP
Eth
Phy
DHCP
DHCP
DHCP
DHCP
DHCP
Client now has IP address, knows name & addr of DNS
server, IP address of its first-hop router
A day in the life… ARP (before DNS, before HTTP)
router
(runs DHCP)
Link Layer
5-79
DNS
UDP
IP
Eth
Phy
DNS
DNS
DNS
ARP query
Eth
Phy
ARP
ARP
ARP reply
A day in the life… using DNS
router
(runs DHCP)
Link Layer
5-80
DNS
UDP
IP
Eth
Phy
DNS
DNS
DNS
DNS
DNS
Comcast network
68.80.0.0/13
DNS server
DNS
UDP
IP
Eth
Phy
DNS
DNS
DNS
DNS
A day in the life…TCP connection carrying HTTP
router
(runs DHCP)
Link Layer
5-81
HTTP
TCP
IP
Eth
Phy
HTTP
64.233.169.105
web server
SYN
SYN
SYN
SYN
TCP
IP
Eth
Phy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
A day in the life… HTTP request/reply
router
(runs DHCP)
Link Layer
5-82
HTTP
TCP
IP
Eth
Phy
HTTP
64.233.169.105
web server
HTTP
TCP
IP
Eth
Phy
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
Unit 5: Summary
Link Layer
5-83
RCEW, Pasupula (V), Nandikotkur Road,
Near Venkayapalli, KURNOOL