Professional Documents
Culture Documents
Link Layer
A note on the use of these ppt slides:
Were making these slides freely available to all (faculty, students, readers).
Theyre in PowerPoint form so you see the animations; and can add, modify,
and delete slides (including this one) and slide content to suit your needs.
They obviously represent a lot of work on our part. In return for use, we only
ask the following:
If you use these slides (e.g., in a class) that you mention their source
(after all, wed like people to use our book!)
If you post any slides on a www site, that you note that they are adapted
from (or perhaps identical to) our slides, and note our copyright of this
material.
Thanks and enjoy! JFK/KWR
Computer
Networking: A
Top Down
Approach
6th edition
Jim Kurose, Keith
Ross
Addison-Wesley
March 2012
instantiation, implementation of
various link layer technologies
Link Layer
5-2
addressing, ARP
Ethernet
switches
VLANS
Link Layer
5-3
Link layer:
introduction
terminology:
global ISP
5-4
datagram transferred
by different link
protocols over different
links:
e.g., Ethernet on first
link, frame relay on
intermediate links,
802.11 on last link
each link protocol
provides different
services
e.g., may or may not
provide rdt over link
transportation analogy:
tourist = datagram
transport segment =
communication link
transportation mode =
link layer protocol
travel agent = routing
algorithm
Link Layer
5-5
Link Layer
5-6
flow control:
error detection:
errors caused by signal attenuation, noise.
receiver detects presence of errors:
signals sender for retransmission or drops frame
error correction:
receiver identifies and corrects bit error(s) without
resorting to retransmission
5-7
application
transport
network
link
cpu
memory
controller
link
physical
host
bus
(e.g., PCI)
physical
transmission
network adapter
card
Link Layer
5-8
Adaptors communicating
datagram
datagram
controller
controller
receiving host
sending host
datagram
frame
sending side:
encapsulates datagram
in frame
adds error checking
bits, rdt, flow control,
etc.
receiving side
looks for errors, rdt, flow
control, etc
extracts datagram,
passes to upper layer at
receiving side
Link Layer
5-9
addressing, ARP
Ethernet
switches
VLANS
Link Layer 5-10
Error detection
EDC= Error Detection and Correction bits (redundancy)
D = Data protected by error checking, may include header fields
otherwise
Parity checking
single bit parity:
sender:
treat segment
contents as sequence
of 16-bit integers
checksum: addition
(1s complement
sum) of segment
contents
sender puts
checksum value into
UDP checksum field
receiver:
compute checksum of
received segment
check if computed
checksum equals
checksum field value:
NO - error detected
YES - no error
detected. But maybe
errors nonetheless?
CRC example
want:
D.2r XOR R = nG
equivalently:
D.2r = nG XOR R
equivalently:
if we divide D.2r by
G, want remainder
R to satisfy:
R = remainder[
D.2r
]
G
r=3
G
# of Bits in G -1
101010
1001 101110000
1001
101
000
1010
1001
110
000
1100
1001
R
1010
1001
Actualstreamsent
011
101110011
IfCRCagainR=000
Link Layer 5-15
addressing, ARP
Ethernet
switches
VLANS
Link Layer 5-16
shared RF
(e.g., 802.11 WiFi)
shared RF
(satellite)
humans at a
cocktail party
(shared air, acoustical)
Link Layer 5-17
random access
channel not divided, allow collisions
recover from collisions
taking turns
nodes take turns, but nodes with more to send can
take longer turns
6-slot
frame
1
FDM cable
frequency bands
time
Slotted ALOHA
assumptions:
operation:
Slotted ALOHA
node 1
node 2
node 3
C Collision
E Empty
S - Success
Pros:
Cons:
collisions, wasting
slots
idle slots
nodes may be able to
detect collision in less
than time to transmit
packet
clock synchronization
Link Layer 5-25
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(1p)N-1
prob that any node has a
success = Np(1-p)N-1
See page 452 for details.
at best:
channel
used for useful
transmissions
37%
of time!
= p . (1-p)N-1 . (1-p)N-1
= p . (1-p)2(N-1)
choosing optimum p and then letting n
= 1/(2e) = .18
CSMA collisions
CSMA/CD (collision
detection)
collision detection:
easy in wired LANs: measure signal strengths,
compare transmitted, received signals
difficult in wireless LANs: received signal strength
overwhelmed by local transmission strength
CSMA/CD (collision
detection)
spatial layout of nodes
Ethernet CSMA/CD
algorithm
1. NIC receives datagram
from network layer,
creates frame
2. If NIC senses channel
idle, starts frame
transmission. If NIC
senses channel busy,
waits until channel idle,
then transmits.
3. If NIC transmits entire
frame without
detecting another
transmission, NIC is
done with frame !
CSMA/CD efficiency
efficiency goes to 1
as tprop goes to 0
as ttrans goes to infinity
efficiency
1 5t prop /t trans
master node
invites slave
nodes to transmit
in turn
typically used with
dumb slave
devices
concerns:
polling
overhead
latency
single point of
failure (master)
data
poll
master
data
slaves
control token
passed from one
node to next
sequentially.
token message
concerns:
token overhead
latency
single point of
failure (token)
(nothing
to send)
T
data
Link Layer 5-37
CMTS
cable modem
termination system
ISP
splitter
cable
modem
Downstream channel i
CMTS
Upstream channel j
t1
Minislots containing
minislots request frames
t2
Summary of MAC
protocols
addressing, ARP
Ethernet
switches
VLANS
Link Layer 5-41
32-bit IP address:
network-layer address for interface
used for layer 3 (network layer) forwarding
e.g.:
1A-2F-BB-76-09-AD
(each
number
represents 4 bits)
Link Layer 5-42
LAN
(wired or
wireless)
71-65-F7-2B-08-53
adapter
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
LAN
71-65-F7-2B-08-53
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
137.196.7.88
A wants to send
datagram to B
Bs MAC address not in
As ARP table.
ARP is plug-andplay:
nodes create their
ARP tables without
intervention from net
administrator
Link Layer 5-46
A
111.111.111.111
74-29-9C-E8-FF-55
B
222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
111.111.111.112
CC-49-DE-D0-AB-7D
111.111.111.110
E6-E9-00-17-BB-4B
222.222.222.221
88-B2-2F-54-1A-0F
Link Layer 5-47
IP
Eth
Phy
A
111.111.111.111
74-29-9C-E8-FF-55
B
222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
111.111.111.112
CC-49-DE-D0-AB-7D
111.111.111.110
E6-E9-00-17-BB-4B
222.222.222.221
88-B2-2F-54-1A-0F
Link Layer 5-48
IP
Eth
Phy
A
111.111.111.111
74-29-9C-E8-FF-55
IP
Eth
Phy
B
222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
111.111.111.112
CC-49-DE-D0-AB-7D
111.111.111.110
E6-E9-00-17-BB-4B
222.222.222.221
88-B2-2F-54-1A-0F
Link Layer 5-49
IP
Eth
Phy
A
111.111.111.111
74-29-9C-E8-FF-55
IP
Eth
Phy
B
222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
111.111.111.112
CC-49-DE-D0-AB-7D
111.111.111.110
E6-E9-00-17-BB-4B
222.222.222.221
88-B2-2F-54-1A-0F
Link Layer 5-50
IP
Eth
Phy
A
111.111.111.111
74-29-9C-E8-FF-55
IP
Eth
Phy
B
222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
111.111.111.112
CC-49-DE-D0-AB-7D
111.111.111.110
E6-E9-00-17-BB-4B
222.222.222.221
88-B2-2F-54-1A-0F
Link Layer 5-51
IP
Eth
Phy
A
111.111.111.111
74-29-9C-E8-FF-55
B
222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
111.111.111.112
CC-49-DE-D0-AB-7D
111.111.111.110
E6-E9-00-17-BB-4B
222.222.222.221
88-B2-2F-54-1A-0F
Link Layer 5-52
addressing, ARP
Ethernet
switches
VLANS
Link Layer 5-53
Ethernet
dominant wired LAN technology:
cheap $20 for NIC
first widely used LAN technology
simpler, cheaper than token LANs and ATM
kept up with speed race: 10 Mbps 10 Gbps
switch
star
data
(payload)
CRC
preamble:
7 bytes with pattern 10101010 followed
by one byte with pattern 10101011
used to synchronize receiver, sender
clock rates
Link Layer 5-56
source
preamble address address
data
(payload)
CRC
Ethernet: unreliable,
connectionless
application
transport
network
link
physical
MAC protocol
and frame format
100BASE-TX
100BASE-T2
100BASE-FX
100BASE-T4
100BASE-SX
100BASE-BX
copper (twister
pair) physical layer
addressing, ARP
Ethernet
switches
VLANS
Link Layer 5-60
Ethernet switch
A
B
C
6
2
4
5
B
3
C
A
switch with six interfaces
(1,2,3,4,5,6)
C
1
2
4
5
B
3
C
Switch: self-learning
Source: A
Dest: A
A A
B
C
6
2
4
5
B
3
C
A
interface
TTL
60
Switch table
(initially empty)
Switch: frame
filtering/forwarding
when frame received at switch:
1. record incoming link, MAC address of sending host
2. index switch table using MAC destination address
3. if entry found for destination
then {
if destination on segment from which frame arrived
then drop frame
else forward frame on interface indicated by
entry
}
else flood /* forward on all interfaces except
arriving
interface */
Link Layer 5-65
Self-learning, forwarding:
example
frame destination,
A, locaton unknown:
flood
Source: A
Dest: A
A A
B
destination A
selectively send
location
on just one link known:
A A
4
5
B
3
C
A A
A
MAC addr interface
A
A
1
4
TTL
60
60
switch table
(initially empty)
Interconnecting switches
S3
S2
A
B
D
E
I
G
Self-learning multi-switch
example
S3
S2
A
B
D
E
I
G
Institutional network
mail server
to external
network
router
web server
IP subnet
Switches vs.
routers
both are store-and-forward:
routers: network-layer
devices (examine networklayer headers)
switches: link-layer
devices (examine link-layer
headers)
both have forwarding
tables:
routers: compute tables
using routing algorithms, IP
addresses
switches: learn forwarding
table using flooding,
learning, MAC addresses
datagram
frame
application
transport
network
link
physical
link
frame
physical
switch
network datagram
link
frame
physical
application
transport
network
link
physical
Link Layer 5-70
VLANs: motivation
consider:
Computer
Science
Electrical
Engineering
Computer
Engineering
VLANs
Virtual Local
Area Network
switch(es) supporting
VLAN capabilities can
be configured to
define multiple virtual
LANS over single
physical LAN
infrastructure.
15
10
16
Electrical Engineering
(VLAN ports 1-8)
Computer Science
(VLAN ports 9-15)
15
10
16
Electrical Engineering
(VLAN ports 1-8)
Computer Science
(VLAN ports 9-16)
Link Layer 5-72
Port-based VLAN
router
15
10
16
dynamic membership:
ports can be
dynamically assigned
Electrical Engineering
(VLAN ports 1-8)
among VLANs
forwarding between VLANS:
done via routing (just as with
separate switches)
Computer Science
(VLAN ports 9-15)
15
10
16
Electrical Engineering
(VLAN ports 1-8)
Computer Science
(VLAN ports 9-15)
dest.
address
source
address
data (payload)
CRC
802.1 frame
type
data (payload)
CRC
802.1Q frame
Recomputed
CRC
addressing, ARP
Ethernet
switches
VLANS
Link Layer 5-76
MPLS header
label
20
IP header
Exp S TTL
3
5
Link Layer 5-77
R3
R5
A
R2
IP router
R3
R5
A
R2
IP-only
router
MPLS and
IP router
MPLS signaling
RSVP-TE
R6
D
R4
R5
modified
link state
flooding
10
12
8
out
A
D
A
R6
0
0
1
in
out
label label dest
interface
R4
R5
10
12
R3
in
out
label label dest
interface
out
R2
out
R1
in
out
label label dest
interface
out
0
Link Layer 5-82
addressing, ARP
Ethernet
switches
VLANS
Link Layer 5-83
challenges:
multiple applications, each serving
massive numbers of clients
managing/balancing load, avoiding
processing, networking, data
bottlenecks
Internet
Load
balancer
Access router
Tier-1 switches
B
A
Load
balancer
Tier-2 switches
TOR
switches
Server racks
8
Link Layer 5-85
Tier-1 switches
Tier-2 switches
TOR
switches
Server racks
addressing, ARP
Ethernet
switches
VLANS
Link Layer 5-87
putting-it-all-together: synthesis!
goal: identify, review, understand protocols
(at all layers) involved in seemingly simple
scenario: requesting www page
scenario: student attaches laptop to campus
network, requests/receives www.google.com
browser
Comcast network
68.80.0.0/13
school network
68.80.2.0/24
web page
web server
64.233.169.105
Googles network
64.233.160.0/19
DHCP
DHCP
DHCP
DHCP
Ethernet frame
broadcast (dest:
FFFFFFFFFFFF) on LAN,
received at router
running DHCP server
DHCP
DHCP
DHCP
DHCP
DHCP
DHCP
UDP
IP
Eth
Phy
router
(runs DHCP)
Ethernet demuxed to
IP demuxed, UDP
demuxed to DHCP
DHCP
DHCP
DHCP
DHCP
DHCP
DHCP
DHCP
DHCP
DHCP
DHCP
UDP
IP
Eth
Phy
router
(runs DHCP)
encapsulation at DHCP
server, frame forwarded
(switch learning) through
LAN, demultiplexing at
client
DNS
UDP
IP
ARP
Eth
Phy
ARP
ARP reply
Eth
Phy
router
(runs DHCP)
DNS
DNS
UDP
IP
Eth
Phy
DNS
DNS
DNS
DNS server
Comcast network
68.80.0.0/13
router
(runs DHCP)
UDP
IP
Eth
Phy
IP datagram containing
DNS query forwarded
via LAN switch from
client to 1st hop router
IP datagram forwarded
from campus network into
comcast network, routed
(tables created by RIP,
OSPF, IS-IS and/or BGP
routing protocols)
to DNS
demuxed
to DNS server
server
DNS server replies to
client with IP address of
www.google.com
HTTP
TCP
IP
Eth
Phy
SYNACK
SYN
SYNACK
SYN
SYNACK
SYN
SYNACK
SYN
SYNACK
SYN
SYN
SYNACK
TCP
IP
Eth
Phy
web server
64.233.169.105
router
(runs DHCP)
HTTP
TCP
IP
Eth
Phy
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
TCP
IP
Eth
Phy
web server
64.233.169.105
router
(runs DHCP)
IP datagram containing
HTTP request routed to
www.google.com
Chapter 5: Summary
wireless
multimedia
security
network management
Parity of Parities