You are on page 1of 10

Fayoum University First semester 2018/2019

Faculty of Engineering
Dr. Gihan Naguib
Department of Electrical Engineering
TA/ Muhammad Dakheel
Computer engineering systems ECE 404
Sheet No.3

1. A sender sends a series of packets to the same destination using 5-bit sequence
numbers. If the sequence number starts with 0, what is the sequence number
after sending 100 packets?
Solution:
A five-bit sequence number can create sequence numbers from 0 to 31. The
sequence number in the Nth packet is (N mod 32). This means that the 101th
packet has the sequence number (101 mod 32) or 5.

2. Using 5-bit sequence numbers, what is the maximum size of the send and
receive windows for each of the following protocols?
a) Stop-and-Wait ARQ
send window = 1 ; receive window = 1
b) Go-Back-NARQ
send window = 25 −1 = 31 ; receive window = 1
c) Selective-Repeat ARQ
send window = 24 = 16 ; receive window = 16

3. The timer of a system using the Stop-and-Wait ARQ Protocol has a time-out of
6 ms, Draw the flow diagram for four frames if the round trip delay is 4 ms.
Assume no data frame or control frame is lost or damaged.
Solution:
Since there are no lost or damaged frames and the round trip time is less than
the time-out, each frame is sent only once.

1
4. Repeat Exercise 4 if the first frame (frame 0) is lost.
Solution:
In this case, only the first frame is resent; the acknowledgment for other
frames arrived on time.

5. Byte-stuff the following frame payload in which E is the escape byte, F is the
flag byte, and D is a data byte other than an escape or a flag character.

Solution:

Each escape or flag byte must be pre-stuffed with an escape byte. The following shows
the result. The red bytes show the added ones

6. Bit-stuff the following frame payload:

Solution:

2
The following shows the result. We inserted extra 0 after each group of five
consecutive 1’s.

7. A 1-Mbps system uses the Stop-and-Wait ARQ Protocol. 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 5000 Km and the propagation
speed is 2 x 108 m? Ignore waiting, and processing delays. We assume no data
or control frame is lost or damaged.
Solution:
We need to send 1000 frames. We ignore the overhead due to the header and
trailer.
Data frame Transmission time = 1000 bits / 1,000,000 bits = 1 ms
Data frame trip time = 5000 km / 200,000 km = 25 ms
ACK transmission time = 0 (It is usually negligible)
ACK trip time = 5000 km / 200,000 km = 25 ms
Delay for 1 frame = 1 + 25 + 25 = 51 ms.
Total delay = 1000 × 51 = 51 s

8. Repeat Exercise 7 using the Go-back-N ARQ Protocol with a window size of 7.
Ignore the overhead due to the header and trailer.
Solution:
In the worst case, we send a full window of size 7 and then wait for the
acknowledgment of the whole window. We need to send 1000/7 ≈ 143
windows. We ignore the overhead due to the header and trailer.
Transmission time for one window = 7000 bits / 1,000,000 bits = 7 ms
Data frame trip time = 5000 km / 200,000 km = 25 ms
ACK transmission time = 0 (It is usually negligible)
ACK trip time = 5000 km / 200,000 km = 25 ms
Delay for 1 window = 7 + 25 + 25 = 57 ms.
Total delay = 143 × 57 ms = 8.151 s
9. Computer A uses Stop and Wait ARQ to send packets to computer B. If the
distance between A and B is 30000 km, the packet size is 6000 bytes and the
bandwidth is 10Mbps. Assume that the propagation speed is 2.4x108m/s
a) How long does it take computer A to receive acknowledgment for a packet?
Round trip delay = 2 * propagation time
= 2 * distance / speed
3
= 2 * 30000 * 103 / 2.4 * 108
= 0. 25 s
b) How long does it take for computer A to send out a packet?
Transmission time = message size / Bandwidth
= 6000 * 8 / 10000000
= 0.0048 s
c) For how much time is computer A idle?
Round trip delay - Transmission time = 0. 25 – 0.0048 = 0.245 s

10. Repeat exercise 9 for a system that uses Go-Back-N ARQ protocol and window
size of 31.
Solution:
a) Round trip delay = 2 * propagation time
= 2 * distance / speed
= 2 * 30000 * 103 / 2.4 * 108
= 0. 25 s
b) Transmission time = N* message size / Bandwidth
= 31 * 6000 * 8 / 10000000
= 0.1488 s
c) Round trip delay - Transmission time = 0.25 – 0.1488 = 0.1012 s

11. In the figure shown below, frames are generated at node A and sent to node C
through node B. Calculate the total time needed to transmit a message that is
11700 Bytes between from A to C, based on the following:
- The data rate between A and B is 80 kbps.
- The data rate between B and C is 100 kbps.
- The propagation delay is 10 microsec/ mile for both lines.
- All data frames are 1000 bits long including header.
- Header size is 64 bits.
- ACK frames are separate frames of length 64 bits.
- Between A and B, GO-Back 4 ARQ is used.
- Between B and C, Selective Repeat ARQ with a sending window of 2 is used.
- There are NO errors.

4
Solution:

Each Frame has 936 bits of information data bits

Number of Frames needed is 11700*8/936=1000 frames

ttrans-AB=1000/80kbps=12.5ms ttrans-BC=1000/100kbps=10ms

tack-BA=64/80kbps=0.8ms tack-CB=64/100kbps=0.64ms

tprop-AB=20 ms tprop-BC=5ms

20

33.3 32.5
37.5

42.5
45
48.14 47.5
53.14 50
50
53.3 55

60
62.5
70
73.3 72.5
75

85.8
85
90.8
Every 53.3 C receives 4 packets

Time = 37.5+ 249*53.3+47.5 = 13.357 sec

5
12. Compare Stop-&-Wait, Go-Back-2 and Selective Repeat (Ws=Wr=2) ARQ
Protocols for communication between two stations A and B in each part of the
problem given that:
The message size is 10KB, transmission rate is 1Mbps. The frame has fixed size
1500B (including headers). The header size is 300B. The ACK size is also 300B.
The processing time is 10 μsec in each machine. Assume electrical signals
propagate at a speed of 2x108m/sec. and the distance of the physical channel is
500m.
I. Plot the time diagram and sliding window(s) within first three frames
then find the total time required to deliver all frames assuming error free
channel.
II. The Effective transmission rate (Reff).
III. Assuming error free channel, find the transmission efficiency (ηNo Error).
IV. If the first frame received in error and Tout = 50msec, plot the time
diagram and sliding window(s) within first three frames, then find the
transmission efficiency.

Solution:

Message Size = 10 x 103 B


Channel Rate = 1Mbps
Frame Size (including headers) = 1500B
Header Size = 300B
ACK Size = 300B
Processing Time = 10us
Propagation Speed = 2 x 108 m/s
Distance = 500m

6
7
13. A 48 KILOBYTE message is to be transmitted from the source to the destination
using packet switching through an intermediate switch as shown below. The
stop-and-wait ARQ protocol is used for communication over each
communication link. The size of headers and CRC together is 64 BYTES. The ACK
size is also 64 BYTES. Given that it is required for the efficiency of each
communication link to be at least 0.7675, calculate the time required to
transfer the whole message from the source to the destination. Also plot the
timing diagram. Assume processing time is negligible and speed of light is
3×108 meters/sec.
Switch
10 Km 10 Km
55 Mbps 55 Mbps
Source Destination

8
Solution:
Lh  64  8  512 bits
L a  64  8  512 bits
10000
tprop   3.33  10-5 sec
3  108
L f  Lh
η  0.7675 
L f  L a  2Rtprop
 0.2325L f  Lh  0.7675L a  1.535Rtprop
 L f  15996 bits
 L f  2000 bytes
Therefore the message will be composed of
48x210/2000=24.576≈25 packets
Switch
10 Km 10 Km
t0=2tprop+tf+ta
55 Mbps 55 Mbps
Source Destination

tprop

2tprop+tf

tf+t0

tf+2t0

tf+25t0-ta

9
Tf= 0.291ms, Ta= 0.0093ms, T0= 0.3669ms

Total message delay = 0.291+25*0.3669-0.0093= 9.4542ms

10

You might also like