Lecture 7
Lecture 7
goals:
understand principles behind link
layer services:
error detection, correction
sharing a broadcast channel: multiple
access
link layer addressing
local area networks: Ethernet, VLANs
instantiation, implementation of
various link layer technologies
implements link,
physical layer host
bus
attaches into host’s link
controller (e.g., PCI)
hardware, software,
firmware network adapter
card
datagram datagram
controller controller
frame
otherwise
0 0
sender: receiver:
treat segment compute checksum of
contents as received segment
sequence of 16-bit check if computed
integers checksum equals
checksum: addition checksum field value:
(1’s complement NO - error detected
sum) of segment YES - no error
contents
detected. But
sender puts maybe errors
checksum value into nonetheless?
UDP checksum field
6-slot 6-slot
frame frame
1 3 4 1 3 4
FDM cable
node 2 2 2 2
node 3 3 3 3
C E C S E C E S S
Pros: Cons:
single active node collisions, wasting
can continuously slots
transmit at full rate idle slots
of channel nodes may be able to
highly decentralized: detect collision in less
only slots in nodes than time to transmit
need to be in sync packet
simple clock synchronization
Link Layer 5-23
CSMA (carrier sense multiple
access)
CSMA: listen before transmit:
if channel sensed idle: transmit entire
frame
if channel sensed busy, defer
transmission
data
Link Layer 5-30
Summary of MAC
protocols
channel partitioning, by time, frequency or
code
Time Division, Frequency Division
random access (dynamic),
ALOHA, S-ALOHA, CSMA, CSMA/CD
carrier sensing: easy in some technologies
(wire), hard in others (wireless)
CSMA/CD used in Ethernet
CSMA/CA used in 802.11
taking turns
polling from central site, token passing
bluetooth, FDDI, token ring
1A-2F-BB-76-09-AD
LAN
(wired or adapter
wireless)
71-65-F7-2B-08-53
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
IP
Eth
Phy
A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
IP IP
Eth Eth
Phy Phy
A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
IP
Eth
Phy
A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
school network
68.80.2.0/24
web page
router
ARP query broadcast,
(runs DHCP) received by router, which
replies with ARP reply
giving MAC address of
router interface
client now knows MAC
address of first hop router,
so can now send frame
containing DNS query
Link Layer 5-48
A day in the life… using DNSDNS
DNS UDP DNS server
DNS IP
DNS DNS DNS Eth
DNS UDP DNS Phy
DNS IP
DNS Eth
Phy
DNS
Comsat network
68.80.0.0/13
router
IP datagram forwarded
(runs DHCP) from campus network into
IP datagram containing comsat network, routed
DNS query forwarded (tables created by RIP,
via LAN switch from OSPF, IS-IS and/or BGP
client to 1st hop router routing protocols)
demux’ed to DNS
to DNS server
server
DNS server replies to
client with IP address of
www.google.com
Link Layer 5-49
A day in the life…TCP connection
carrying HTTP
HTTP
HTTP
SYNACK
SYN TCP
SYNACK
SYN IP
SYNACK
SYN Eth
Phy