Professional Documents
Culture Documents
Th D
The Data
t Li
Link
kLLayer
Chapter 3
Application
Responsible for delivering frames of
Transport
information o
over
er a single link
Network
• Handles transmission errors and
Link
regulates
g the flow of data
Ph i l
Physical
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
• Frames »
• Possible services »
• Framing methods »
• Error control »
• Fl
Flow control
t l»
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Frames
Network
Link
Virtual data p
path
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Possible Services
Unacknowledged
g connectionless service
• Frame is sent with no connection / error recovery
• Ethernet is example
Acknowledged connectionless service
• Frame is sent with retransmissions if needed
• Example is 802.11
Acknowledged connection-oriented
connection oriented service
• Connection is set up; rare
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Framing Methods
• Byte count »
• Flag bytes with byte stuffing »
• Flag bits with bit stuffing »
• Physical layer coding violations
− Use non
non-data
data symbol to indicate frame
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Frame begins
g with a count of the number of bytes
y in it
• Simple, but difficult to resynchronize after an error
Expected
case
Error
case
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Special
p flag
g bytes
y delimit frames;; occurrences of flags
g in
the data must be stuffed (escaped)
• Longer, but easy to resynchronize after error
Frame
format
Need to escape
extra ESCAPE
bytes too!
Stuffing
examples
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Stuffing
g done at the bit level:
• Frame flag has six consecutive 1s (not shown)
• On transmit, after five 1s in the data, a 0 is added
• On receive, a 0 after five 1s is deleted
Data bits
Transmitted bits
with stuffing
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Error Control
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Flow Control
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
(11, 7) Hamming code adds 4 check bits and can correct 1 error
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Operates
p on a stream of bits,, keeping
p g internal state
• Output stream is a function of all preceding input bits
• Bits are decoded with the Viterbi algorithm
…111 … 0 1 1
1 0 1
P
Popular
l NASA binary
bi convolutional
l ti l code
d ((rate
t = ½) used
d iin 802
802.11
11
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Interleaving
g of N p
parity
y bits detects burst errors up
p to N
• Each parity sum is made over non-adjacent bits
• An even burst of up to N errors will not cause it to fail
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Properties:
• Improved
I d error d
detection
t ti over parity
it bit
bits
• Detects bursts up to N errors
• Detects random errors with probability 1-2N
• Vulnerable to systematic errors, e.g., added zeros
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Start by adding
0s to frame
and try dividing
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Commonlyy implemented
p as NICs and OS drivers;;
network layer (IP) is often OS software
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
• Th t’ it,
That’s it no error or flflow control
t l…
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Sender waits to for ack after Receiver sends ack after passing
passing frame to physical layer frame to network layer
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
A sliding
g window advancing
g at the sender and receiver
• Ex: window size is 1, with a 3-bit sequence number.
Sender
Receiver
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Larger
g windows enable ppipelining
p g for efficient link use
• Stop-and-wait (w=1) is inefficient for long links
• Best window (w) depends on bandwidth-delay (BD)
• Want w ≥ 2BD+1 to ensure high link utilization
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
...
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Time
Notation is ((seq,
q ack, frame number).
) Asterisk indicates frame accepted
p by
y network layer
y .
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Go-Back-N (1)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Go-Back-N (2)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
Receiver accepts
p frames anywhere
y in receive window
• Cumulative ack indicates highest in-order frame
• NAK (negative ack) causes sender retransmission of
a missing frame before a timeout resends window
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
PPP (1)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
PPP (2)
A link control p
protocol brings
g the PPP link up/down
p
ADSL (1)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
ADSL (2)
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011
End
Chapter 3
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011