Datalink Layer
Datalink Layer
0 0
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 ….
value into UDP checksum
field
D.2r
R = remainder[ ]
G
❒ “Taking turns”
❍ tightly coordinate shared access to avoid collisions
Pros Cons
❒ single active node can ❒ collisions, wasting slots
continuously transmit ❒ idle slots
at full rate 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
5: DataLink Layer 5a-27
Slotted Aloha efficiency
Efficiency is the long-run ❒ For max efficiency
fraction of successful slots with N nodes, find p*
when there’s many nodes, each that maximizes
with many frames to send Np(1-p)N-1
❒ For many nodes, take
❒ Suppose N nodes with limit of Np*(1-p*)N-1
many frames to send, as N goes to infinity,
each transmits in slot gives 1/e = .37
with probability p
❒ prob that 1st node has At best: channel
success in a slot used for useful
= p(1-p)N-1 transmissions 37%
❒ prob that any node has of time!
a success = Np(1-p)N-1
5: DataLink Layer 5a-28
Pure (unslotted) ALOHA
❒ unslotted Aloha: simpler, no synchronization
❒ when frame first arrives
❍ transmit immediately
= 1/(2e) = .18
Even worse !
collision:
entire packet transmission
time wasted
note:
role of distance & propagation
delay in determining collision
probability
223.1.3.1 223.1.3.2
frame source, datagram source,
dest address dest address
datagram
frame
5: DataLink Layer 5a-42
ARP: Address Resolution Protocol
R
B
❒ Two ARP tables in router R, one for each IP
network (LAN)
R
B
Metcalfe’s Ethernet
sketch
Preamble:
❒ 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011
❒ used to synchronize receiver, sender clock rates
1
efficiency =
1 + 5t prop / ttrans
❒ Efficiency goes to 1 as tprop goes to 0
❒ Goes to 1 as ttrans goes to infinity
❒ Much better than ALOHA, but still decentralized,
simple, and cheap
nodes
hub
Recommended !
Shared
optimal no no yes no
routing
cut yes no no yes
through
5: DataLink Layer 5a-79
Chapter 5 outline
❒ 5.1 Introduction and ❒ 5.6 Hubs, bridges, and
services switches
❒ 5.2 Error detection ❒ 5.7 Wireless links and
and correction LANs
❒ 5.3Multiple access ❒ 5.8 PPP
protocols ❒ 5.9 ATM
❒ 5.4 LAN addresses ❒ 5.10 Frame Relay
and ARP
❒ 5.5 Ethernet
❒ Solution:
❍ small reservation packets
❍ nodes track reservation interval with internal
“network allocation vector” (NAV)
❒ up to 721 kbps
address
❒ no error correction/recovery
❒ no flow control
❒ out of order delivery OK
❒ no need to support multipoint links (e.g., polling)
flag byte
pattern
in data
to send
User data
AAL PDU
ATM cell
Cell header
Cell format
TCS Functions:
❍ Header checksum generation: 8 bits CRC
❍ Cell delineation
❍ With “unstructured” PMD sublayer, transmission
of idle cells when no data cells to send
5: DataLink Layer 5a-
111
ATM Physical Layer
Physical Medium Dependent (PMD) sublayer
❒ SONET/SDH: transmission frame structure (like a
container carrying bits);
❍ bit synchronization;
❍ bandwidth partitions (TDM);
❍ several speeds: OC3 = 155.52 Mbps; OC12 = 622.08
Mbps; OC48 = 2.45 Gbps, OC192 = 9.6 Gbps
❒ TI/T3: transmission frame structure (old
telephone hierarchy): 1.5 Mbps/ 45 Mbps
❒ unstructured: just cells (busy/idle)
Ethernet Ethernet
LANs LANs
5: DataLink Layer 5a-
113
IP-Over-ATM
Issues: ATM
❒ IP datagrams into network
ATM AAL5 PDUs
❒ from IP addresses
to ATM addresses
❍ just like IP
addresses to
Ethernet
802.3 MAC
LANs
addresses!
Like ATM:
❒ wide area network technologies
❒ Virtual-circuit oriented
❒ origins in telephony world
❒ can be used to carry IP datagrams
❍ can thus be viewed as link layers by IP
protocol