Beruflich Dokumente
Kultur Dokumente
Datagram transferred by
transportation analogy
trip from Princeton to
different link protocols
Lausanne
over different links:
limo: Princeton to JFK
e.g., Ethernet on first link,
plane: JFK to Geneva
frame relay on
intermediate links, 802.11 train: Geneva to Lausanne
on last link tourist = datagram
Each link protocol transport segment =
provides different communication link
services transportation mode =
e.g., may or may not link layer protocol
provide rdt over link
travel agent = routing
algorithm
5: DataLink Layer 5-4
Link Layer Services
Flow Control:
pacing between adjacent sending and receiving nodes
important if large propagation delays
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
Half-duplex and full-duplex
with half duplex, nodes at both ends of link can transmit,
but not at same time 5: DataLink Layer 5-6
Adaptors Communicating
datagram
link layer protocol rcving
sending node
node
frame frame
adapter adapter
0 0
Sender: Receiver:
compute checksum of received
treat segment contents
segment
as sequence of 16-bit
check if computed checksum
integers equals zero:
checksum: addition (1s NO - error detected
complement sum) of YES - no error detected. But
segment contents maybe errors nonetheless?
sender puts checksum
value into UDP checksum
field
1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0
1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
wraparound 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1
sum 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0
checksum 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1
3-12
Checksumming: Cyclic Redundancy Check
view data bits, D, as a binary number
choose r+1 bit pattern (generator), G
goal: choose r CRC bits, R, such that
<D,R> exactly divisible by G (modulo 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 (ATM, HDLC)
D.2r
R = remainder[ ]
G
Taking turns
Nodes take turns, but nodes with more to send can take
longer turns
Assumptions Operation
all frames same size when node obtains fresh
time is divided into frame, it transmits in next
equal size slots, time to slot
transmit 1 frame no collision, node can send
nodes start to transmit new frame in next slot
frames only at if collision, node
beginning of slots retransmits frame in each
nodes are synchronized subsequent slot with prob.
if 2 or more nodes
p until success
transmit in slot, all
nodes detect collision
5: DataLink Layer 5-23
Slotted ALOHA
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 than
only slots in nodes time to transmit packet
need to be in sync clock synchronization (used
in a hub-spoke manner)
simple
5: DataLink Layer 5-24
Slotted Aloha efficiency
Efficiency is the long-run For max efficiency
fraction of successful slots with N nodes, find p*
when there are many nodes, that maximizes
each 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 node 1 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 5-25
Pure (unslotted) ALOHA
= 1/(2e) = .18
Even worse !
collision:
entire packet transmission
time wasted
note:
role of distance & propagation
delay in determining collision
probability
32-bit IP address:
network-layer address
used to get datagram to destination IP subnet
LAN
(wired or = adapter
wireless)
71-65-F7-2B-08-53
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
0C-C4-11-6F-E3-98
137.196.7.88
DHCP offer
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 654
Lifetime: 3600 secs
DHCP request
src: 0.0.0.0, 68
dest:: 255.255.255.255, 67
yiaddrr: 223.1.2.4
transaction ID: 655
time Lifetime: 3600 secs
DHCP ACK
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 655
Lifetime: 3600 secs
R
B
R
B
Metcalfes Ethernet
sketch
hub or
switch
Preamble:
7 bytes with pattern 10101010 followed by one
byte with pattern 10101011
used to synchronize receiver, sender clock rates
Addresses: 6 bytes
if adapter receives frame with matching destination
address, or with broadcast address (eg ARP packet), it
passes data in frame to net-layer protocol
otherwise, adapter discards frame
1
efficiency
1 5t prop / ttrans
For 100Mbps Ethernet, 100m max spacing, about
66% efficiency
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
5: DataLink Layer 5-55
10BaseT and 100BaseT
10/100 Mbps rate; latter called fast ethernet
T stands for Twisted Pair
Nodes connect to a hub: star topology; 100 m
max distance between nodes and hub
twisted pair
hub
twisted pair
hub
Used in 10BaseT
Each bit has a transition
Allows clocks in sending and receiving nodes to
synchronize to each other
no need for a centralized, global clock among nodes!
Hey, this is physical-layer stuff!
5: DataLink Layer 5-58
Part 3: Link Layer
hub
hub
hub hub
hub
hub hub
address interface
switch
A 1
B 1
E 2
hub hub hub G 3
A
I C 1
D F
B C G H
E
switch
collision
domain
hub
hub hub
mail server
to external
network
router web server
switch
IP subnet
hub
hub hub