210 likes | 321 Views
Transport Layer Lecture 8 Imran Ahmed University of Management & Technology. Agenda. Overview of transport layer Connection-less services – UDP Flow control mechanisms Connection-oriented services – TCP TCP congestion control. Flow control.
E N D
Transport Layer Lecture 8 Imran Ahmed University of Management & Technology
Agenda • Overview of transport layer • Connection-less services – UDP • Flow control mechanisms • Connection-oriented services – TCP • TCP congestion control
Flow control • A technique for assuring that a transmitting entity does not over-whelm a receiving entity with data. • Stop-and-wait flow control • Sliding window flow control
Stop-and-wait operation • Sender transmits one packet and waits for receiver’s response. • Receiver receives frame and replies with acknowledgement. • Source waits for ACK before sending next frame. • Receiver can stop flow by not send ACK.
Stop-and-wait operation sender receiver first packet bit transmitted, t = 0 last packet bit transmitted, t = L / R first packet bit arrives RTT last packet bit arrives, send ACK ACK arrives, send next packet, t = RTT + L / R
Pipelining: Sender allows multiple, “in-flight”, yet-to-be-acknowledged packets. range of sequence numbers must be increased buffering at sender and/or receiver Pipelined protocols
Pipelining: increased utilization sender receiver first packet bit transmitted, t = 0 Increase utilization by a factor of 3! last bit transmitted, t = L / R first packet bit arrives RTT last packet bit arrives, send ACK last bit of 2nd packet arrives, send ACK last bit of 3rd packet arrives, send ACK ACK arrives, send next packet, t = RTT + L / R
Sliding Window operation • Allow multiple frames to be in transit. • Receiver has buffer W long. • Sender can send up to W frames without ACK. • Each frame is numbered. • ACK includes number of next frame expected. • Sequence number bounded by size of field (k). • Frames are numbered modulo 2k
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 11 11 11 11 11 11 11 11 11 11 12 12 12 12 12 12 12 12 12 12 13 13 13 13 13 13 13 13 13 13 14 14 14 14 14 14 14 14 14 14 Sliding window example Receiver Sender 0 1 2 A3 3 4 5 6 A4
Error control • It refers to detect and correct errors that occur in the transmission of frames. • Errors can be type of; lost frames or damaged frames. • Automatic Repeat request (the effect of ARQ is to turn an un-reliable transmission into a reliable one): • Error detection • +ve ACK • Retransmission after timeout • -ve ACK & retransmission
Stop-and-wait ARQ • Source transmits single frame & wait for ACK. • If received frame damaged, discard it • Transmitter has timeout • If no ACK within timeout, retransmit • If ACK damaged, transmitter will not recognize it: • Transmitter will retransmit • Receive gets two copies of frame • Use ACK0 and ACK1
Go-back-n ARQ • Based on sliding window. • If no error, ACK as usual with next frame expected. • Use window to control number of outstanding frames. • If error, reply with rejection: • Discard that frame and all future frames until error frame received correctly. • Sender must go back and retransmit that frame and all subsequent frames.
GBN in action window size = 4
Also called selective retransmission. Only rejected frames are retransmitted. Subsequent frames are accepted by the receiver and buffered. Minimizes retransmission but receiver must maintain large enough buffer. More complex as compared to G-back-n. Selective Repeat
Example: seq #’s: 0, 1, 2, 3 window size=3 receiver sees no difference in two scenarios! incorrectly passes duplicate data as new in (a). Q: what relationship between seq # size and window size? Selective Repeat: Ambiguity