CS2105: Introduction To Computer Networks: L2: Principles of Reliable Data Transfer (Data Link Control)
CS2105: Introduction To Computer Networks: L2: Principles of Reliable Data Transfer (Data Link Control)
Data Transfer between two directly connected nodes. (Hop-toHop communication, Point-to-point communication) Data link layer divided into two functionality-oriented sublayers
47
must be framed into discernible blocks of information. Message/Data is broken up into recoverable chunks that can easily be checked for corruption. Frames have Source and Destination addresses Separates/identifies frames from different sources at the destination.
48
Note:- Shown as Link layer Protocol. It is also applicable for Transport Layer.
49 CS2105/2011-12 Sem 2/AaBee
What happens if the channel is noiseless but the receiver has finite buffer?
Receiver processes data at its own speed. Sender cannot overwhelm the receiver with large amount of data.
51
Stop-and-Wait Protocol
What happens if the channel is noiseless but the Flow Control is required receiver has finite buffer?
Flow control refers to a set of procedures used to restrict the amount of data that a sender can send before waiting for an acknowledgment (ACK).
52
is noisy (errors, losses and delay) with finite buffer. Error Control is required! How?
53
Generally frames have some error detection mechanism (will be discussed in next Lecture) If received frame is in error, receiver requests for retransmission Automatic Repeat Request (ARQ)
54
55
Side effect?
56 CS2105/2011-12 Sem 2/AaBee
Duplicate ACK
57
Sender
maintains a timer for each transmitted frame maintains a copy of each transmitted frame and retransmits when required numbers the frames Numbers the ACKs (next expected frame number)
58
Summary
Stop-and-wait ARQ works, but performance stinks example: 1 Gbps link, 15 ms end-to-end Prop Delay from east coast to west coast of US (RTT=30 ms; approx speed of light), 1KB packet:
Ttransmit = L (packet length in bits) 8kb/pkt = = 8 microsec R (transmission rate, bps) 10**9 b/sec
U sender: utilization of sender or utilization of the channel (time sender busy sending / total time) 1 Gbps link is underutilized
59 CS2105/2011-12 Sem 2/AaBee
RTT
Effect of increasing Distance (or RTT)? Effect of increasing digital BW? == BDP
As BDP increases we need to transmit more bits or frames (before waiting for ACK) to improve the utilisation
60 CS2105/2011-12 Sem 2/AaBee
Pipelined protocols
Pipelining: sender allows multiple, in-flight, yetto-be-acknowledged pkts
range
Analogy:
Current:
Pipe-lined:
An Analogy: Talking on a Cell Phone. Bob says a sentences and waits for ACK (uh huh) before saying next sentence.
Bob is allowed to say N sentences and waits for ACK (uh huh) before saying next sentence.
Questions:
How much is N?
Can N be infinite?
Cumulative ACK
62
How many in-flight packets? N Packets (sliding window of size N on sequence numbers) --- [Flow Control]
Out-of-order packets are discarded. Because of this, Receive window size of GBN is 1 and acknowledgement in GBN is cumulative. Packet losses uses timer; retransmit on timeout
63
64
Eg 1:
Send 1 Packet
65
Eg 2:
Receive ACK 4
66
Eg 3: Cumulative ACK
Receive ACK 6
67
Eg 4:
Full Window
68
Eg 5:
Empty Window
69
Go-back-N ARQ
When a timer expires all frames starting from the frame in error are retransmitted.
Sender Receiver
Example:
Frame 3 Frame 4 Frame 5
Frame 6 Go back and retransmit all frames starting from frame 3! Timer Expired Frame 3 Frame 4 Stop-and-Wait ARQ is a special case of Go-Back-N ARQ in which the size of the send window is 1.
70
Frame 5 Frame 6
CS2105/2011-12 Sem 2/AaBee
71
73
GBN leads to unnecessary retransmission since out of order packets are discarded. SR sender retransmits only the lost (or invalid; error) packets. (Improvement over GBN).
Receiver should buffer out of order packets. Receiver needs a receiver-window of size of size equal to send window.
74
75
Instead NAK one can use Duplicate ACK to tell the expected frame to the sender What happens if NAK 1 is lost?
76 CS2105/2011-12 Sem 2/AaBee
In Selective Repeat ARQ, the size of the sender and receiver window must be at most one-half of 2m.
77
Piggybacking
Sender
Frame 0
1 Frame 0 ACK Frame 1 ACK 1
Communication is generally full-duplex acknowledgement can be piggybacked on data in the opposite direction.
Receiver
Frame 1, ACK 2
Frame 2, ACK 2
78
Summary
Flow control and Error control Simple Protocol (No flow and error control) Stop and Wait (for flow control) Stop and Wait ARQ (adds error control to SW) Pipelined Protocols (improves efficiency of SW-ARQ) GBN : receive window size = 1 SR : receiver window = send window size