Link Layer and Lans Chapter 5: The Data Link Layer: Our Goals
Link Layer and Lans Chapter 5: The Data Link Layer: Our Goals
1
Link Layer Services (more) Adaptors Communicating
datagram
link layer protocol rcving
❒ Flow Control: sending node
node
❍ pacing between adjacent sending and receiving nodes frame frame
❒ Error Detection: adapter adapter
errors caused by signal attenuation, noise.
❒ link layer implemented in ❒ receiving side
❍
❍ receiver detects presence of errors:
“adaptor” (aka NIC) ❍ looks for errors, rdt, flow
• signals sender for retransmission or drops frame control, etc
❍ Ethernet card, PCMCI
❒ Error Correction: card, 802.11 card ❍ extracts datagram, passes
Sender: Receiver:
❒ compute checksum of received
❒ treat segment contents
segment
as sequence of 16-bit
❒ check if computed checksum
integers equals checksum field value:
❒ checksum: addition (1’s ❍ NO - error detected
complement sum) of ❍ YES - no error detected. But
segment contents maybe errors nonetheless?
❒ sender puts checksum More later ….
0 0
value into UDP checksum
field
2
Checksumming: Cyclic Redundancy Check CRC Example
❒ view data bits, D, as a binary number Want:
❒ choose r+1 bit pattern (generator), G D.2r XOR R = nG
❒ goal: choose r CRC bits, R, such that
equivalently:
❍ <D,R> exactly divisible by G (modulo 2)
❍ receiver knows G, divides <D,R> by G. If non-zero remainder:
D.2r = nG XOR R
error detected! equivalently:
can detect all burst errors less than r+1 bits
if we divide D.2r by
❍
D.2r
R = remainder[ ]
G
3
Random Access Protocols CSMA (Carrier Sense Multiple Access)
4
“Taking Turns” MAC protocols Summary of MAC protocols
Polling: Token passing:
❒ What do you do with a shared media?
❒ master node ❒ control token passed from
one node to next ❍ Channel Partitioning, by time, frequency or code
“invites” slave nodes
sequentially. • Time Division, Frequency Division
to transmit in turn
token message ❍ Random partitioning (dynamic),
❒ concerns: ❒
• CSMA, CSMA/CD
❍ polling overhead ❒ concerns:
• carrier sensing: easy in some technologies (wire), hard
latency ❍ token overhead
❍
in others (wireless)
single point of ❍ latency
❍
• CSMA/CD used in Ethernet
failure (master) ❍ single point of failure (token)
• CSMA/CA used in 802.11
❍ Taking Turns
• polling from a central site, token passing
network)
❍ 48 bit MAC address (for most LANs)
0C-C4-11-6F-E3-98
burned in the adapter ROM
5
LAN Address (more) ARP: Address Resolution Protocol
❒ MAC address allocation administered by IEEE Question: how to determine ❒ Each IP node (Host,
MAC address of B Router) on LAN has
❒ manufacturer buys portion of MAC address space
knowing B’s IP address? ARP table
(to assure uniqueness)
❒ ARP Table: IP/MAC
❒ Analogy: 237.196.7.78
address mappings for
(a) MAC address: like Social Security Number 1A-2F-BB-76-09-AD
some LAN nodes
(b) IP address: like postal address 237.196.7.23
237.196.7.14 < IP address; MAC address; TTL>
❒ MAC flat address ➜ portability ❍ TTL (Time To Live): time
LAN after which address
❍ can move LAN card from one LAN to another
71-65-F7-2B-08-53 mapping will be forgotten
❒ IP hierarchical address NOT portable
58-23-D7-FA-20-B0
(typically 20 min)
❍ depends on IP subnet to which node is attached
0C-C4-11-6F-E3-98
237.196.7.88
6
Link Layer Ethernet
“dominant” wired LAN technology:
❒ 5.1 Introduction and ❒ 5.6 Hubs and switches ❒ cheap $20 for 100Mbs!
services ❒ 5.7 PPP ❒ first widely used LAN technology
❒ 5.2 Error detection ❒ 5.8 Link Virtualization: ❒ Simpler, cheaper than token LANs and ATM
and correction ATM
❒ Kept up with speed race: 10 Mbps – 10 Gbps
❒ 5.3Multiple access
protocols
❒ 5.4 Link-Layer
Addressing Metcalfe’s Ethernet
sketch
❒ 5.5 Ethernet
7
Hubs
Hubs are essentially physical-layer repeaters:
❍ bits coming from one link go out all other links
❍ at the same rate
❍ no frame buffering
❍ no CSMA/CD at hub: adapters detect collisions
❍ provides net management functionality
twisted pair
hub