Presentation is loading. Please wait.

Presentation is loading. Please wait.

EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.

Similar presentations


Presentation on theme: "EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer."— Presentation transcript:

1 EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbing@ieee.org (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer Networking book)

2 2 Fall Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Outline New deadline for wiki project (undergraduate students only): 11/21 Sliding window protocols CSU IS&T Tour

3 3 Fall Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Reliable Data Transfer characteristics of unreliable channel will determine complexity of reliable data transfer protocol (rdt)

4 4 Fall Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Reliable Data Transfer Basic reliable data transfer mechanisms –Acknowledgement –Retransmission –Sequence numbers

5 5 Fall Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Reliable Data Transfer: Sliding Window Protocols A One-Bit Sliding Window Protocol A Protocol Using Go Back n A Protocol Using Selective Repeat

6 6 Fall Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Sliding Window Protocols Full-duplex: Use same connection for data in both directions (A  B and B  A) Interleave data and ack packets –B piggybacks its ack for A ’ s packet onto B ’ s next packet –Savings of header in separate ack packet If B sends data infrequently, use timeout to determine when B should send ack in separate ack packet

7 7 Fall Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Sliding Window Protocols Each packet contains sequence number in ranges 0..2 n -1 (for n-bit sequence numbers) Sending window – list of consecutive sequence numbers of packets that sender is permitted to send 0 1 2 3 4 5 6 7 1 st outstanding packet Last packet sent 0 1 2 3 4 5 6 7 3 ack 0 1 2 3 4 5 6 7 A new packet sent (if send window allows) Sent window enlarges when more packet is sent 0 1 2 3 4 5 6 7 Sent window shrinks when the ack corresponding to the 1 st outstanding packet Is received

8 8 Fall Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Sliding Window Protocols When new packet arrives from application layer, it is given next highest sequence number, and upper edge of window is incremented When ack arrives from receiver, lower edge of window is incremented Within sending window, packets sent but not acked –Sender must keep those packets for possible retransmission –If max window size = w, need w buffers

9 9 Fall Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Sliding Window Protocols Receiving window – list of consecutive sequence numbers of packets that receiver is permitted to accept When packet with (seq num = lower edge of window) arrives –Packet is passed to higher layer –Ack is generated –Window slid down by 1 (remains same size as was initially) 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 3

10 10 Fall Semester 2007EEC-484/584: Computer NetworksWenbing Zhao One-Bit Sliding Window Protocol A sliding window of size 1, with a 3-bit sequence number Initially After first packet sent After first packet received After first ack received

11 11 Fall Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Sliding Window Protocols: Pipelining Problem of one-bit sliding window protocol: –Sender blocks till receives acks Solution: pipelining –Allow sender to send up to w packets before blocking With pipelining, if packet in middle is lost or damaged, what to do with the packets following it ? Solution: two strategies –Go Back n - all the packets following it are discarded –Selective repeat – nack the lost/damaged packet and retransmit that packet

12 12 Fall Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Pipelining and Error Recovery Go back n: Effective receiver window size is 1 Packets discarded

13 13 Fall Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Pipelining and Error Recovery Selective repeat Can you think of an alternative to go-back-n and selective-repeat? Packets buffered

14 14 Fall Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Go Back n Sender –Stores all packets in output buffer –Must get acks in order in which packets are sent Receiver –Discards all packets following lost or damaged one Works well –If transmission errors rare and few retransmissions –If lot of traffic in both directions

15 15 Fall Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Selective Repeat Receiver accepts and buffers packets following lost or damaged packets Both sender and receiver maintain windows –Sender ’ s window starts at 0, grows to MAX SEQ –Receiver ’ s window fixed at MAX SEQ Receiver has buffer reserved for each seq num in its window 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7

16 16 Fall Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Selective Repeat When packet arrives, receiver checks if seq num in window If so and if not already received, this packet is accepted and stored If all lower numbered packets delivered, this packet is delivered as well 0 1 2 3 4 5 6 7 5 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 3

17 17 Fall Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Non-Sequential Receive Problem New range of valid sequence numbers for receiver can overlap old range Overlap can contain duplicates Example: n = 3-bit seq num (8 possible numbers, 0 through 7, back to 0) 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7

18 18 Fall Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Non-Sequential Receive Problem Sender sends 0,1,2,3,4,5,6 Receiver –Receives 0,1,2,3,4,5,6 –Sends ack but ack gets lost –Expects to receive 7,0,1,2,3,4,5 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0123456 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7

19 19 Fall Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Non-Sequential Receive Problem Sender times out, retransmits 0,1,2,3,4,5,6 Receiver checks 0 is in new window, thinks new 0 because has sent ack for old 6, waits for 7 0123456 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7

20 20 Fall Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Non-Sequential Receive Problem Sender receives ack for 0-6, sends 7 Receiver receives 7, delivers 7 and old 0 (as new 0 !) 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7

21 21 Fall Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Non-Sequential Receive Problem The problem is caused by the overlap of sequence number between the new receiving window and the old receiving window 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0123456 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 Overlap

22 22 Fall Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Non-Sequential Receive Problem Solution: –make sure no overlap when receiver advances its window –Make window size w =1/2 range of seq numbers 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0123 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 No Overlap

23 23 Fall Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Selective Repeat If no reverse traffic before timer goes off, separate ack is sent When receiver suspects error, sends NAK back to sender (request for retransmission) Two circumstances that trigger NAK –Damaged packet arrives –Packet other than expected one arrives, suspect expected one is lost Receiver sends only one NAK for packet expected


Download ppt "EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer."

Similar presentations


Ads by Google