Professional Documents
Culture Documents
Peer-to-Peer Protocols and Data Link Layer
Peer-to-Peer Protocols and Data Link Layer
1
Peer-to-Peer protocols: many protocols involve the
interaction between two peers
Service Models are discussed & examples given
Detailed discussion of ARQ provides example of
development of peer-to-peer protocols
Flow control, TCP reliable stream, and timing recovery
Data Link Layer
Framing
PPP & HDLC protocols
Statistical multiplexing for link sharing
2
Error control in Data Link Layer
Packets Packets
(a)
Data Link operates
Data link Data link
over wire-like,
layer Frames layer directly-connected
A B systems
Physical Physical
layer layer Frames can be
corrupted or lost, but
arrive in order
(b)
1 1 Data link performs
2 2
12 3 12 3
error-checking &
21 21
Medium retransmission
2 Ensures error-free
A B 1
packet transfer
1 Physical layer entity between two systems
2 Data link layer entity
There is one network layer entity per node
3
3 Network layer entity but one link layer entity per link.
Error Control in Transport Layer
Transport layer protocol (e.g. TCP) sends segments across
network and performs end-to-end error checking &
retransmission
Underlying network is assumed to be unreliable
Messages Messages
4
Network
Segments can experience long delays, can be lost, or
arrive out-of-order because packets can follow different
paths across network
End-to-end error control protocol more difficult
C
1 2 3 2 1
2 2
1 1
End System
α 1 1 End System
1 2
2 2 β
4 3 21 12 3 2 1 1 2 3 2 1 1 2 3 4
Medium
2
A B 1
Network
7
Automatic Repeat Request (ARQ)
Purpose: to ensure a sequence of information
packets is delivered in order and without errors or
duplications despite transmission errors & losses
We will look at:
Stop-and-Wait ARQ
Go-Back N ARQ
Selective Repeat ARQ
Basic elements of ARQ:
Error-detecting code with high error coverage
ACKs (positive acknowledgments
NAKs (negative acknowlegments)
Timeout mechanism
8
Stop-and-Wait ARQ- 1-Bit Sequence
Transmit a frame, wait for ACK
Error-free
Packet
packet
Information frame
Transmitter Receiver F0-0
Timer set after (Process A) (Process B)
F1-1
each frame
transmission Control frame
F2-0
Header
CRC
Information Header
packet CRC
9
10
Sequence Numbers
(c) Premature Time-out
Time-out
Time
A Frame
0 Frame Frame Frame
ACK 0 1 2
ACK
B
Slast Rnext
Timer
16
Applications of Stop-and-Wait
ARQ
IBM Binary Synchronous Communications
protocol (Bisync): character-oriented data link
control
Xmodem: modem file transfer protocol
Trivial File Transfer Protocol (RFC 1350):
simple protocol for file transfer over UDP
17
Performance Issues
Stop and Wait ARQ works well on channels that
have low propagation delay.
Becomes inefficient when the propagation delay is
much greater than the time to transmit a frame.
Suppose we are transmitting 1000 bits long over a
channel that has a speed of 1.5Mbps and the time
that elapses from the beginning of the frame
transmission to the receipt of its acknowledgement
is 40ms.
No. of bits that can be transmitted over the channel in
40ms*1.5Mbps = 60,000bits(Delay Bandwidth Product)
But Stop and wait protocol can transmit only 1000 bits in
this period of time,
Efficiency = 1000/60,000 = 1.6%
Stop-and-Wait Efficiency
Last frame bit ACK
First frame bit enters channel arrives
enters channel Channel idle while transmitter
waits for ACK
A t
B t
19
Stop-and-Wait Model
t0 = total time to transmit 1 frame
A
tproc
B
frame
tprop tproc tack tprop
tf time
Transmission efficiency:
Effect of
n f no no
1 frame overhead
Reff t0 nf
0 .
R R na 2(t prop t proc ) R
1
nf nf
Delay Bw
Effect of Product 21
ACK frame
Example: Impact of Delay-
Bandwidth Product-DBP
nf=1250 bytes = 10000 bits, na=no=25 bytes = 200 bits
Information 1 ms 10 ms 100 ms 1 sec
Rate (R)
200 km 2000 km 20000 km 200000 km
1 Mbps DBP- 104 105 106
103 49% 9% 1%
0 88%
1 Gbps 106 107 108 109
1% 0.1% 0.01% 0.001%
Stop-and-Wait does not work well for very high speeds or long propagation
delays
22
S&W Efficiency in Channel with
Errors
Pf be the probability that a frame has errors and need to
retransmitted.
Let 1 – Pf = probability frame arrives w/o errors
Avg. # of transmissions to first correct arrival is then 1/ (1–Pf )
Avg. total time per frame is then tsw=t0/(1 – Pf)
n f no
t0 no
1
Reff 1 Pf nf
SW (1 Pf )
R R na 2(t prop t proc ) R
1
nf nf
Effect of
frame loss 23
Example: Impact Bit Error Rate
nf=1250 bytes = 10000 bits, na=no=25 bytes = 200 bits
Find efficiency for random bit errors with p=0, 10-6, 10-5, 10-4
nf
1 Pf (1 p ) for large n f and small p
Receiver side
Window expands after sending acknowledgement for
the received frames.
25
Example Sliding Window
Sliding Window Example