Lab/Tutorial :
SEHH2238 : Computer Networking
Session 9 : ARQ Protocols (Solution)
1. A sender sends a series of frames to the same destination using 5-bit sequence numbers. If the sequence number starts with 0, what is the sequence number after sending 100 frames?
Copyright By PowCoder代写 加微信 powcoder
5 bit sequence No.no. of possibility: 25 = 32
Range of seq. no.: 0 – 31
Nth packet: 1st, 2nd, 3rd, 4th, 31st, 32nd , 33rd , … 101st Seq.no.: 0, 1, 2, 3…… 30, 31, 0, 1,…31,0,… ,??
Seq. no. in Nth packet: (N-1) mod 32
For 101st packet, the sequence no. = (101-1) mod 32 = 4.
2. Using 5-bit sequence numbers, what is the maximum size of the sender and receiver windows for each of the following protocols?
(a) Stop-and-Wait ARQ (b) Go-back-N ARQ and (c) Selective-Repeat ARQ.
Stop-and Wait ARQ Go-back-N ARQ Selective-Repeat ARQ
Sender Window 1
Receiver Window 1
SEHH2238 Computer Networking
Tutorial 9
3. In a network using the Go-Back-N protocol with m=3 and the sending window of size 7, the values of variables are Sf = 62, Sn = 66, and Rn = 64. Assume that the network does not duplicate or reorder the packets.
(a) What are the sequence numbers of data packets in transit?
(b) What are the acknowledgement numbers of ACK packets in transit?
The following figure shows the situation.
62 63 64 65 66 67 68
a. If the receiver expects a packet with sequence number 64 and packets with sequence numbers 62 to 65 are already sent but not acknowledged, it means that two packets with sequence numbers 64 and 65 are in transit from the sender to the receiver.
b. If the sender expects the acknowledgment for packet 62, but the value of Rn = 64, it means that the ACK packets with acknowledgment numbers 63 and 64 are in transit from the receiver to the sender. (The ACK number is the next packet expected. ACK 63 is for acknowledgement of packet 62 and before.)
62 63 64 65 66 67 68
a.In transit data packet seq. no.: 64 and 65. b. In transit ack no.: 63 and 64.
Ack 64 =64
SEHH2238 Computer Networking
Tutorial 9
4. A system uses the Go-Back-N ARQ Protocol with a window size of 7. If each packet carries 1000 bits of data, how long does it take to send 1 million bits of data if the distance between the sender and receiver is 5000Km and the propagation speed is 2 x 108 ms-1? Assume the channel data rate is 1 Mbps and ignore processing delays and ACK transmission time. Further assume that no data or control frame is lost or damaged. Also ignore the overhead due to the header and trailer. You may consider the ideal case scenario.
Assume 1Mbps = 106 bps in Q4 and Q5
.. …..X143 times
No. of frames to be sent = 1 Mbits/ 1000bits = 1000
In a round trip,
Propagation Delay (TP) = 5000 x103 / 2 x 108 = 0.025s Transmission Delay of packets (Tx) = 1000 bit / 1Mbps = 1 ms Transmission Delay of an ack (Tx) = 0 s
Propagation Delay (TP) of Ack = 5000 x103 / 2 x 108 = 0.025s
Delay for one round trip = (0.025 +0.025 + 0.001) = 51ms
No. of repetition = 1000 /7 = 142.9 Therefore 143 rounds are needed Delay for the first 142 rounds = 142 x (0.051) = 7.242s
SEHH2238 Computer Networking Tutorial 9 Page 3
Last Round
.. …..X142 times
In the last round, there are 6000 bits and 6 frames are needed. The sender, after receiving the first ACK, needs to wait 5 ms for the last (6th) ACK
Delay for the last round = 0.025 + 0.025 + 6×0.001 = 0.056s
Total Delay = 7.242 + 0.056 = 7.298s
SEHH2238 Computer Networking Tutorial 9 Page 4
5. Repeat Q4 and consider the scenario that for every 7 ACKs, the first 6 ACK frames are lost but the last ACK frame is successfully received. Further assume that the timeout period is long enough to receive the 7th ACK after sending a data frame. Also assume that the ACK of the last frame will not be lost.
.. …..X143 times
No. of frames to be sent = 1 Mbits/ 1000bits = 1000
In a round trip,
Propagation Delay (TP) = 5000 x103 / 2 x 108 = 0.025s Transmission Delay of packets (Tx) = 7 x 1000 bit / 1Mbps = 7 ms Transmission Delay of an ack (Tx) = 0 s
Propagation Delay (TP) of Ack = 5000 x103 / 2 x 108 = 0.025s
Delay for one round trip = (0.025 +0.025 + 0.007) = 57ms
No. of repetition = 1000 /7 = 142.9 Therefore 143 rounds are needed Delay for the first 142 rounds = 142 x (0.057) = 8.094s
In the last round, there are 6000 bits and 6 frames are needed.
Delay for the last round = (0.025 +0.025 + 0.006) = 56ms
Total Delay = 8.094 + 0.056 = 8.15s
SEHH2238 Computer Networking Tutorial 9 Page 5
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com