Chapter 6 Part1
Chapter 6 Part1
The Link
Layer
and LANs
Computer
Networking: A Top-
Down Approach
8th edition
Jim Kurose, Keith Ross
Pearson, 2020
Link layer and LANs: our goals
understand principles instantiation,
behind link layer implementation of
services: various link layer
• error detection, correction technologies
• sharing a broadcast
channel: multiple access
• link layer addressing
• local area networks:
Ethernet, VLANs
datacenter networks
in each-and-every host
link layer implemented in
network interface card (NIC)
or on a chip application
transport
cpu memory
network
• Ethernet, WiFi card or chip link
physical
buses physical
combination of hardware,
network interface
software, firmware
row parity
0111000110101011 1
d1,1 ... d1,j d1,j+1
d data d2,1 ... d2,j d2,j+1
bits ... ... ... ...
parity
bit di,1 ... di,j di,j+1
column
parity ...
Even parity: set di+1,1 di+1,j di+1,j+1
parity bit so there
is an even number detected 1 0 1 0 1
no errors: 1 0 1 0 1 1 1
of 1’s and 1 0 1 1 0 parity
11110 0 correctable 0 error
01110 1 single-bit 0 1 1 1 0 1
10101 0 error: 1 0 1 0 1 0
parity
error
Link Layer: 6-12
Internet checksum (review)
Goal: detect errors (i.e., flipped bits) in transmitted segment
sender: receiver:
treat contents of UDP compute checksum of received
segment (including UDP segment
header fields and IP
addresses) as sequence of check if computed checksum
16-bit integers equals checksum field value:
checksum: addition (one’s • not equal - error detected
complement sum) of • equal - no error detected. But
segment content maybe errors nonetheless?
checksum value put into More later ….
UDP checksum field
goal: choose r CRC bits, R, such that <D,R> exactly divisible by G (mod
2)
• receiver knows G, divides <D,R> by G. If non-zero remainder: error detected!
• can detect all burst errors less than r+1 bits
• widely used in practice (Ethernet, 802.11 WiFi)
Link Layer: 6-14
Cyclic Redundancy Check (CRC): example
We want: G 1 0 10 1 1
D.2r XOR R = nG 1 0 0 1 1 0 1 1 1 00 0 0
or equivalently: 1 0 0 1
D.2r = nG XOR R 1 0 1 D*2r
0 0 0
or equivalently: 1 0 1 0
if we divide D.2r by G, want 1 0 0 1
remainder R to satisfy: 1 1 0
0 0 0
D.2r 1 1 0 0
R = remainder [ ] 1 0 0 1
G 1 0 1 0
1 0 0 1
0 1 1
R
* Check out the online interactive exercises for more examples: h ttp://gaia.cs.umass.edu/kurose_ross/interactive/
Link Layer: 6-15
Link layer, LANs: roadmap
introduction
error detection, correction
multiple access protocols
LANs
• addressing, ARP
• Ethernet
• switches
• VLANs
link virtualization: MPLS a day in the life of a
data center networking
web request
frequency bands
FDM cable
node 2 2 2 2 C: collision
S: success
node 3 3 3 3
E: empty
C E C S E C E S S
Pros: Cons:
single active node can collisions, wasting slots
continuously transmit at full idle slots
rate of channel nodes may be able to detect
highly decentralized: only
collision in less than time to
slots in nodes need to be in transmit packet
sync
simple clock synchronization
Link Layer: 6-25
Slotted ALOHA: efficiency
efficiency: long-run fraction of successful slots (many
nodes, all with many frames to send)
suppose: N nodes with many frames to send, each
transmits in slot with probability p
• prob that given node has success in a slot = p(1-p)N-1
• prob that any node has a success = Np(1-p)N-1
• max efficiency: find p* that maximizes Np(1-p)N-1
• for many nodes, take limit of Np*(1-p*)N-1 as N goes to
infinity, gives:
max efficiency = 1/e = .37
at best: channel used for useful transmissions 37% of time!
Link Layer: 6-26
Pure ALOHA
unslotted Aloha: simpler, no synchronization
• when frame first arrives: transmit immediately
collision probability increases with no synchronization:
• frame sent at t0 collides with other frames sent in [t0-
1,t0+1] will overlap will overlap
with start of with end of
i’s frame i’s frame
t0 - 1 t0 t0 + 1
pure Aloha efficiency: 18% !
• polling overhead
• latency
• single point of failure slaves
(master)
cable headend
CMTS
…
splitter cable
cable modem
… modem
ISP termination system
Downstream channel i
CMTS
Upstream channel j
cable headend
t1 t2 Residences with cable modems