操作的一般描述 连发多帧:发送方收到应答(ACK)之前,可以发送多帧,以便 充分利用链路的能力 窗口:发送方和接收方分别建立缓冲区,称为窗口( window) 用于存储帧数据 窗口滑动:窗口在缓冲区内移动,窗口内包含了待发的若干帧; 编号:需对待发的帧编号,以M(=2~k)为模(0,1,M1.0,1,) 若M=8,则窗口的大小取为M-1=7
16 操作的一般描述 • 连发多帧:发送方收到应答(ACK)之前,可以发送多帧,以便 充分利用链路的能力; • 窗口:发送方和接收方分别建立缓冲区,称为窗口(window), 用于存储帧数据; • 窗口滑动:窗口在缓冲区内移动,窗口内包含了待发的若干帧; • 编号:需对待发的帧编号,以M(=2^k)为模(0,1,…,M-1,0,1,…) 编号; 若M=8,则窗口的大小取为M-1=7
具体说明(略) B receives frames 23 and 4 at one time A maintains a list of sequence numbers that it is allowed to send B maintains a list of sequence number that it is prepared to receive Each of these lists can be thought of as a window of frames The operation is referred to as sliding-window flow control The size of the window: if k bits is used to express the number of the frames, the window size is 2 k. The sequence number is 0 through 2k-1 对图7.3( see next slide)的说明 It assumes the use of 3 bit sequence number. So that frames are numbered sequentially from 0 through 7, and then the same numbers are reused for subsequent frames. The shaded rectangle indicates the frames that may be sent; in this figure, the sender may transmit 5 frames, beginning with frame 0. Each time a frame is sent the shaded window shrinks. each time an acknowledgement is received, the shaded window grows. Frames between the vertical bar and the shaded window have been sent but not yet acknowledged. As we shall see, the sender must buffer these frames in case they need to be retransmitted
17 • 具体说明(略) – B receives frames 2,3,and 4 at one time. – A maintains a list of sequence numbers that it is allowed to send. – B maintains a list of sequence number that it is prepared to receive. – Each of these lists can be thought of as a window of frames. – The operation is referred to as sliding-window flow control. – The size of the window: if k bits is used to express the number of the frames, the window size is 2^k. The sequence number is 0 through 2^k-1. • 对图7.3(see next slide)的说明 – It assumes the use of 3 bit sequence number. So that frames are numbered sequentially from 0 through 7, and then the same numbers are reused for subsequent frames. The shaded rectangle indicates the frames that may be sent; in this figure, the sender may transmit 5 frames, beginning with frame 0. Each time a frame is sent, the shaded window shrinks; each time an acknowledgement is received, the shaded window grows. Frames between the vertical bar and the shaded window have been sent but not yet acknowledged. As we shall see, the sender must buffer these frames in case they need to be retransmitted
Sliding Window Depiction(Figure 7.3) Frames buffered until acknowledged Window of frames Frames already transmitted that may be transmitted 1234s67 34567 Frame Last frame Last frame D Window shrinks from n Window expands sequence from leading edge number acknowledged transmitted trailing edge as frames are sent as ACKs are received (a)Sender's perspective 3 frames already received m usurer Window of frames +that may be accepted 0 23456 17023456… Window shrinks from Last frame Last frame Window expands trailing edge as from leading edge acknowledged received frames are received as A CKs are sent (b) Receiver's perspective Figure 7.3 Sliding-Window Depiction
18 Sliding Window Depiction (Figure 7.3)
发送窗口和接收窗口移动规则 发送窗口 在发送开始时,发送窗口中有M-1帧数据 每发送一帧,发送窗的左端缩进一帧(向右); 日有ACK从接收方来,窗口右端向右扩张,扩展的帧数为 所收到的ACK确认收到的帧数 接收窗口 随着新数据的到来,接收窗口的大小不断缩小(表示在发出 ACK之前,所能接收新数据的帧数的减小) 接收窗口的左端:当接收一帧时,接收窗口的左端向右移动 帧 接收窗口的右端:每发送一个ACK(有时又记为RR, Receive response),接收窗口的右端向右扩张若干帧,扩张的帧数为 次ACK帧的编号与当前ACK帧编号之差值
19 发送窗口和接收窗口移动规则 • 发送窗口 – 在发送开始时,发送窗口中有M-1帧数据; – 每发送一帧,发送窗的左端缩进一帧(向右); – 一旦有ACK从接收方来,窗口右端向右扩张,扩展的帧数为 所收到的ACK确认收到的帧数 • 接收窗口 – 随着新数据的到来,接收窗口的大小不断缩小(表示在发出 ACK之前,所能接收新数据的帧数的减小); – 接收窗口的左端:当接收一帧时,接收窗口的左端向右移动 一帧; – 接收窗口的右端:每发送一个ACK(有时又记为RR,Receive response),接收窗口的右端向右扩张若干帧,扩张的帧数为 上一次ACK帧的编号与当前ACK帧编号之差值
Example1(发送窗) 例1 发送开始时,发送窗中包含7帧: 012 56170 发送窗 发送方已经发送04帧,未收到ACK(或RR)应答。此时,发送窗 口的左端需向右收缩5帧; 12|34567012|3 送窗 发送方收到RR5,表示接收方已经收到04帧,希望接收第5帧,则 发送窗口右端向右扩张5帧 01|2|3456z012 发送窗 0
20 Example 1(发送窗) • 例1 – 发送开始时, 发送窗中包含7帧; – 发送方已经发送0—4帧,未收到ACK(或RR)应答。此时,发送窗 口的左端需向右收缩5帧; – 发送方收到RR5,表示接收方已经收到0—4帧,希望接收第5帧,则 发送窗口右端向右扩张5帧。 0 1 2 3 4 5 6 7 0 1 2 3 发送窗 0 1 2 3 4 5 6 7 0 1 2 3 发送窗 4 5