In a Go-Back-N (GBN) protocol, the sender is allowed to transmit multiple packets
(when available) without waiting for an acknowledgment, but is constrained to have no
more than some maximum allowable number, N, of unacknowledged packets in the
pipeline. We describe the GBN protocol in some detail in this section. But before reading
on, you are encouraged to play with the GBN applet (an awesome applet!) at the
companion Web site.
Figure 3.19 shows the sender’s view of the range of sequence numbers in a GBN
protocol. If we define base to be the sequence number of the oldest unacknowledged
packet and nextseqnum to be the smallest unused sequence number (that is, the
sequence number of the next packet to be sent), then four intervals in the range of
sequence numbers can be identified. Sequence numbers in the interval [0,base-1]
correspond to packets that have already been transmitted and acknowledged. The interval
[base,nextseqnum-1] corresponds to packets that have been sent but not yet
acknowledged. Sequence numbers in the interval [nextseqnum,base+N-1] can
be used for packets that can be sent immediately, should data arrive from the upper
layer. Finally, sequence numbers greater than or equal to base+N cannot be used until
an unacknowledged packet currently in the pipeline (specifically, the packet with
sequence number base) has been acknowledged.
As suggested by Figure 3.19, the range of permissible sequence numbers for
transmitted but not yet acknowledged packets can be viewed as a window of size N
over the range of sequence numbers. As the protocol operates, this window slides
forward over the sequence number space. For this reason, N is often referred to as
the window size and the GBN protocol itself as a sliding-window protocol. You
might be wondering why we would even limit the number of outstanding, unacknowledged
packets to a value of N in the first place. Why not allow an unlimited
number of such packets? We’ll see in Section 3.5 that flow control is one reason to
impose a limit on the sender. We’ll examine another reason to do so in Section 3.7,
when we study TCP congestion control.
In practice, a packet’s sequence number is carried in a fixed-length field in the
packet header. If k is the number of bits in the packet sequence number field, the range
of sequence numbers is thus [0,2k – 1]. With a finite range of sequence numbers, all
arithmetic involving sequence numbers must then be done using modulo 2k arithmetic.
(That is, the sequence number space can be thought of as a ring of size 2k, where
sequence number 2k– 1 is immediately followed by sequence number 0.) Recall that
rdt3.0 had a 1-bit sequence number and a range of sequence numbers of [0,1]. Several
of the problems at the end of this chapter explore the consequences of a finite range
of sequence numbers. We will see in Section 3.5 that TCP has a 32-bit sequence number
field, where TCP sequence numbers count bytes in the byte stream rather than packets.
Figures 3.20 and 3.21 give an extended FSM description of the sender and
receiver sides of an ACK-based, NAK-free, GBN protocol. We refer to this FSM
description as an extended FSM because we have added variables (similar to programming-
language variables) for base and nextseqnum, and added operations
on these variables and conditional actions involving these variables. Note that the
extended FSM specification is now beginning to look somewhat like a programminglanguage
specification. [Bochman 1984] provides an excellent survey of additional
extensions to FSM techniques as well as other programming-language-based techniques
for specifying protocols.
220 CHAPTER 3 • TRANSPORT LAYER
base nextseqnum
Window size
N
Key:
Already
ACK’d
Sent, not
yet ACK’d
Usable,
not yet sent
Not usable
Figure 3.19 Sender’s view of sequence numbers in Go-Back-N
ในการไป-Back-N (GBN) โปรโตคอลผู้ส่งจะได้รับอนุญาตในการส่งแพ็คเก็ตหลาย ๆ
(ถ้ามี) โดยไม่ต้องรอการรับรู้ แต่เป็นข้อ จำกัด
จะไม่มีมากกว่าบางจำนวนสูงสุดที่อนุญาต, N, แพ็คเก็ตไม่ถูกยอมรับใน
ท่อ เราอธิบายโปรโตคอล GBN ในรายละเอียดบางในส่วนนี้ แต่ก่อนที่จะอ่านในวันที่คุณได้รับการสนับสนุนที่จะเล่นกับแอปเพล็ GBN (แอปเพล็น่ากลัว!) ที่สหายเว็บไซต์. รูปที่ 3.19 แสดงให้เห็นถึงมุมมองของผู้ส่งในช่วงของหมายเลขลำดับใน GBN โปรโตคอล ถ้าเรากำหนดฐานเป็นหมายเลขลำดับของการไม่ถูกยอมรับที่เก่าแก่ที่สุดในแพ็คเก็ตและ nextseqnum จะเป็นหมายเลขลำดับที่ไม่ได้ใช้ที่เล็กที่สุด (ที่อยู่, หมายเลขลำดับของแพ็กเก็ตต่อไปที่จะถูกส่งไป) จากนั้นสี่ช่วงเวลาที่อยู่ในช่วงของหมายเลขลำดับสามารถ ระบุ หมายเลขลำดับในช่วง [0, ฐาน 1] สอดคล้องกับแพ็คเก็ตที่ได้รับการส่งและได้รับการยอมรับ ช่วง[ฐาน nextseqnum-1] สอดคล้องกับแพ็คเก็ตที่ได้รับการส่งไป แต่ยังไม่ได้รับการยอมรับ หมายเลขลำดับในช่วง [nextseqnum ฐาน + N-1] สามารถนำมาใช้สำหรับแพ็คเก็ตที่สามารถส่งได้ทันทีข้อมูลควรจะมาถึงจากบนชั้น สุดท้ายหมายเลขลำดับที่มากกว่าหรือเท่ากับฐาน + N ไม่สามารถนำมาใช้จนแพ็คเก็ตไม่ถูกยอมรับในปัจจุบันท่อ(เฉพาะแพ็คเก็ตที่มีฐานหมายเลขลำดับ) ได้รับการยอมรับ. ที่แนะนำโดยรูปที่ 3.19 ช่วงของหมายเลขลำดับที่อนุญาตสำหรับส่งแพ็คเก็ตได้รับการยอมรับ แต่ยังไม่สามารถถูกมองว่าเป็นหน้าต่างที่มีขนาดยังไม่มีในช่วงของตัวเลขลำดับ ในฐานะที่เป็นโปรโตคอลดำเนินหน้าต่างนี้เลื่อนไปข้างหน้าพื้นที่หมายเลขลำดับ ด้วยเหตุนี้ยังไม่มีข้อความที่มักจะถูกเรียกว่าขนาดของหน้าต่างและโปรโตคอล GBN ตัวเองเป็นหน้าต่างบานเลื่อนโปรโตคอล คุณอาจสงสัยว่าทำไมเราจะ จำกัด จำนวนของที่โดดเด่นไม่ถูกยอมรับแพ็คเก็ตกับมูลค่าของไม่มีในสถานที่แรก ทำไมไม่ช่วยให้ไม่ จำกัดจำนวนของแพ็กเก็ตดังกล่าวหรือไม่ เราจะเห็นในส่วนที่ 3.5 การควบคุมการไหลที่เป็นหนึ่งในเหตุผลที่จะกำหนดวงเงินในผู้ส่ง เราจะตรวจสอบเหตุผลที่จะทำเช่นนั้นในข้อ 3.7 อีกเมื่อเราศึกษาTCP ควบคุมความแออัด. ในทางปฏิบัติหมายเลขลำดับแพ็คเก็ตที่จะดำเนินการในเขตความยาวคงที่ในส่วนหัวของแพ็คเก็ต ถ้า k เป็นจำนวนบิตในสาขาหมายเลขลำดับแพ็คเก็ตที่ช่วงของหมายเลขลำดับจึง[0,2k - 1] ที่มีช่วง จำกัด ของหมายเลขลำดับทั้งหมดทางคณิตศาสตร์ที่เกี่ยวข้องกับหมายเลขลำดับแล้วจะต้องทำโดยใช้การคำนวณแบบโมดูโล2k. (นั่นคือพื้นที่หมายเลขลำดับอาจจะคิดว่าเป็นแหวนที่มีขนาด 2k ที่หมายเลขลำดับ2k- 1 ตามทันที โดยหมายเลขลำดับ 0) จำได้ว่าrdt3.0 มีหมายเลขลำดับ 1 บิตและช่วงของหมายเลขลำดับของ [0,1] หลายปัญหาในตอนท้ายของบทนี้สำรวจผลกระทบในช่วงที่ จำกัด ของหมายเลขลำดับ เราจะเห็นในมาตรา 3.5 ที่ TCP มีหมายเลขลำดับ 32 บิตสนามที่TCP หมายเลขลำดับนับไบต์ในกระแส byte มากกว่าแพ็คเก็ต. ตัวเลข 3.20 และ 3.21 ให้คำอธิบายขยายเอฟเอสของผู้ส่งและด้านรับของACK- ตาม NAK ฟรี GBN โปรโตคอล เราหมายถึงเอฟเอสนี้คำอธิบายในฐานะที่เป็นเอฟเอสขยายเพราะเราได้เพิ่มตัวแปร(คล้ายกับเขียนโปรแกรมตัวแปรบางภาษา) สำหรับฐานและ nextseqnum และการดำเนินงานที่เพิ่มขึ้นกับตัวแปรเหล่านี้และการดำเนินการที่เกี่ยวข้องกับเงื่อนไขตัวแปรเหล่านี้ โปรดทราบว่าสเปคเอฟเอสขยายตอนนี้เริ่มที่จะมองคล้าย programminglanguage ข้อกำหนด [Bochman 1984] มีการสำรวจเพิ่มเติมที่ดีของการขยายเทคนิคเอฟเอสรวมทั้งอื่นๆ การเขียนโปรแกรมภาษาที่ใช้เทคนิคสำหรับการระบุโปรโตคอล. 220 บทที่ 3 • Transport Layer ฐาน nextseqnum ขนาดหน้าต่างไม่มีข้อความสำคัญ: แล้วACK'd ส่งไม่ยัง ACK 'd ใช้สอย, ยังไม่ส่งไม่สามารถใช้งานได้รูปที่3.19? มุมมองของผู้ส่งของตัวเลขในลำดับไปกลับ-N
การแปล กรุณารอสักครู่..
