EE132B-HW Set #5
UCLA 2014 Fall
Prof. Izhak Rubin
Problem 1 Consider a selective-repeat ARQ in which the window size N is equal to 4 (i.e., the time out duration allows the transmission of four data frames, including itself). Assume that the originating node wishes to transmit 10 data frames which are labeled D1 , D2 , . . . , D10 . In this particular session, frames D3 , D4 , D8 , D10 are retransmitted once, while Frame D2 is retransmitted three times. Other frames do not require retransmission. Draw a simple time diagram demonstrating the correct sequence of events, identifying the timeout threshold used. Ans: In general, an arbitrary window size can be employed in a selective repeat ARQ. In this problem, the windows size is set to 4. The following is a possible sequence of frame transmissions as shown in Figure 2. Sender
Receiver
D1
tto D2 ACK
D3
D1
D4 D5 D2 D3
D5
D4 D3
D6
D4
D2
D6
D7 D8
D7
D9 D2
D9
D10
D2
D8
D8
D10
D10
Figure 1: The network graph with indicated link weights
1
EE132B-HW Set #5
UCLA 2014 Fall
Prof. Izhak Rubin
Problem 2 In a sequence of frame transmissions, data frame D0 has just been positively acknowledged. Four more frames - D1 , D2 , D3 , and D4 - are transmitted. The next returned transmission, received after D4 has been transmitted, is a negative acknowledgement to D2 . Assume that this implicitly acknowledges any previously transmitted but unacknowledged data frames. (a) What action does a go-back-N protocol take? (b) What action does a selective-repeat-N protocol take? Ans: (a) A Go-back-N protocol would transmit D2 , D3 , and D4 , and then proceed to transmit subsequent frames, e.g., D5 , if any are ready. (b) A selective-repeat protocol would retransmit only frame D2 , and then proceed to transmit subsequent frames.
Problem 3 Compute the throughput rate attained across a communications link when using a stop-and-wait ARQ scheme assuming the following parameters: a 64 kbps link, all characters are eight bits long, 200 data characters per frame, six characters for data frame headers and for acknowledgement frames, 10 msec (one way) propagation time and 20 msec turn-around time, and a bit error rate of 10−4 . Ans: Under the conditions given, R = 64000 bps, Npb = (200 + 6) × 8 = 1648 bits (i.e., number of bits in a packet), Nab = Nhb = 6 × 8 = 48 bits (i.e., number of bits in ack and header), tp = 0.010 sec, tta = 0.020 sec, PE = 1 − (1 − 10−4 )1648 = 0.15194, so that throughput rate is equal to: η=
(1 − PE )(Npb − Nhb )R = 15685 bps. Npb + Nab + 2 (tp + tta )
Thus, effective date is slightly over 25% of the line rate of 64 kbps. The major factors causing the low rate are the delays incurred due to propagation and turnaround times. Although these are relatively short, the line rate of 64 kbps is relatively high so that over 2.3 data frames could be transmitted during the total time required for two propagation times and two turnaround times.
2
EE132B-HW Set #5
UCLA 2014 Fall
Prof. Izhak Rubin
Problem 4 A 1 MByte file is to be transmitted over a 1 Mbps communication line that has a bit error rate of p = 10−6 . (a) What is the probability that the entire file is transmitted without errors? Note: For n large and p very small, we have: (1 − p)n ≈ e−np . (b) The file is broken up into N equal-sized blocks that are transmitted separately. What is the probability that all the blocks arrive without error? Was it useful to divide the file into blocks? (c) Suppose that the propagation delay is negligible and the ACK packet size is negligible. Explain how the stop-and-wait ARQ scheme can help deliver the file in an error-free form. On the average, how long does it take to deliver the file if the whole file is transmitted once and the ARQ scheme causes the entire file to be retransmitted if there is error? (d) Now consider breaking up the file into N blocks. (Neglect the overhead for the header and CRC bits.) On the average how long does it take to deliver the file if the ARQ transmits the blocks one at a time? Evaluate your answer for N = 80, 800, and 8000. (e) Explain qualitatively to the impact on the answer to part (d) when frame overhead is taken into account. Ans: (a) The file length (denoted as n) is equal to 8 × 106 bits, the transmission rate R = 1 Mbps and p = 10−6 . The the probability of no error in the entire file (denoted as Ps ) is given by Ps = (1 − p)n ≈ e−np = e−8 = 3.35 × 10−4 . (b) A block of length is equal to is given by
n . N
The probability that it is received without error n
Pss = (1 − p) N . A file has no errors, which implies that all blocks have no errors. Thus, the the probability of no error for the file is given by n
h
Ps = (1 − Pss )N = (1 − p) N which is the same with that under no broking. 3
iN
= (1 − p)n ,
EE132B-HW Set #5
UCLA 2014 Fall
Prof. Izhak Rubin
(c) Since the file size >> header size, and the propagation delay and ACK packet size are negligible, the total transmission time without error is equal to Rn . From problem 4(a), we know that Ps ≈ e−np = 3.35 × 10−4 and, thus, E[NT ] = P1s . As a result, the average total transmission time for a successful reception (denoted as Tp ) is given by E[Tp ] = N [NT ] ×
n 8 = = 23847 sec = 6.62 hours. R 3.34 × 10−4
(d) n
For N blocks, we have Pss = (1 − p) N . The average time to deliver the file given that it is separated into N blocks is given as "n
1 × E [Tp | N ] = N × n R (1 − p) N N
#
np
≈ 8e N .
• N = 80 ⇒ E[Tp ] ≈ 8e0.1 = 8.84 sec. • N = 800 ⇒ E[Tp ] ≈ 8e0.01 = 8.08 sec. • N = 8000 ⇒ E[Tp ] ≈ 8e0.001 = 8.008 sec. (e) As N increases, the effect of overhead becomes more significant because the header constitute a bigger fraction of each block.
4
EE132B-HW Set #5
UCLA 2014 Fall
Prof. Izhak Rubin
Problem 5 Use Dijkstra’s algorithm, showing all steps, to derive the shortest path tree rooted at node A for the network graph with indicated link weights as shown in Figure. 2.
6
12
F
3
7
D
3
A
E 3
4
5
B
C
Figure 2: The network graph with indicated link weights Ans: (a) Method 1: • Step 1: – P = {A}, T = {B, C, D, E, F } – d(A, B) = 5 – d(A, C) = 3 – d(A, D) = ∞ – d(A, E) = ∞ – d(A, F ) = ∞ • Step 2: – i=C – P = {A, C}, T = {B, D, E, F } • Step 3: – d(A, B) = min{5, 3 + ∞} = 5 – d(A, D) = min{∞, 3 + 7} = 10 – d(A, E) = min{∞, 3 + ∞} = ∞ – d(A, F ) = min{∞, 3 + 12} = 15 5
EE132B-HW Set #5
UCLA 2014 Fall
Prof. Izhak Rubin
• Step 2: – i=B – P = {A, B, C}, T = {D, E, F } • Step 3: – d(A, D) = min{10, 5 + 4} = 9 – d(A, E) = min{∞, 5 + 6} = 11 – d(A, F ) = min{15, 5 + ∞} = 15 • Step 2: – i=D – P = {A, B, C, D}, T = {E, F } • Step 3: – d(A, E) = min{11, 9 + 3} = 11 – d(A, F ) = min{15, 9 + ∞} = 15 • Step 2: – i=E – P = {A, B, C, D, E}, T = {F } • Step 3: – d(A, F ) = min{15, 11 + 3} = 14 • Step 2: – i=F – P = {A, B, C, D, E, F }, T = ∅ Method 2: Table 1: Dijkstra’s Algorithm A B C D E F
(A,0) (null, ∞) (null, ∞) (null, ∞) (null, ∞) (null, ∞)
(A,0) (A,5) (A,3) (null,∞) (null,∞) (null,∞)
(A,0) (A,5) (A,3) (C,10) (null,∞) (C,15)
6
(A,0) (A,5) (A,3) (9,B) (B,11) (C,15)
(A,0) (A,5) (A,3) (9,B) (B,11) (C,15)
(0,A) (A,5) (A,3) (B,9) (B,11) (E,14)
EE132B-HW Set #5
UCLA 2014 Fall
Prof. Izhak Rubin
(b) The shortest path tree table and diagram are shown in Table 2 and Fig. 3, respectively. Nodes B C D E F
(Preceding node, Shortest distance) (A, 5) (A, 3) (B, 9) (B, 11) (E, 14)
Table 2: The shortest path tree table
3
Figure 3: The shortest path tree
7