assignment4_w2010_solutions
assignment4_w2010_solutions
Assignment # 4
Instructor: Foroohar Foroozan
Review chapter 3 (Section 3.9) and chapter 5 (Section 5.2) Garcia before attempting the assignment.
-3
1. Suppose a transmission channel operates at 3 Mbps and that it has a bit error rate of 10 . Bit errors
occur at random and independent of each other. Suppose that the following code is used. To transmit a 1,
the codeword 111 is sent; To transmit a 0, the codeword 000 is sent. The receiver takes the three received
bits and decides which bit was sent by taking the majority vote of the three bits. Find the probability that
the receiver makes a decoding error.
Solution:
The receiver makes a decoding error if two or more out of the three bits are in error. Therefore,
2 3 -3 2 -3 -3 3 -6
Perror = 3p (1 – p) + p = 3(10 ) (1-10 ) + (10 ) ≈ 3(10 )
2. Suppose a header consists of four 16-bit words: (11111111 11111111, 11111111 00000000, 11110000
11110000, 11000000 11000000). Find the internet checksum for this code.
Solution:
16
b0 = 11111111 11111111 = 2 – 1 = 65535
b1 = 11111111 00000000 = 65280
b2 = 11110000 11110000 = 61680
b3 = 11000000 11000000 = 49344
x = b0 + b1 + b2 + b3 modulo 65535 = 241839 modulo 65535 = 45234
b4 = −x modulo 65535 = 20301
So the internet checksum = 01001111 01001101
1
3
3. Let g(x)=x +x+1. Consider the information sequence 1001.
b. Suppose that the codeword has a transmission error in the first bit. What does the receiver obtain
when it does its error checking?
4. A repetition code is an (n,1) code in which the n − 1 parity bits are repetitions of the information bit. What is the
minimum distance of the code?
The code is a linear code in which: c2 = c1, c3 = c1, …, cn = c1, where c1 is the information bit. This code has two
codewords: (0,0,…,0) and (1,1,…,1) so the minimum distance is dmin = n.
5. In Stop-and-Wait ARQ why should the receiver always send an acknowledgment message each time it
receives a frame with the wrong sequence number?
Solution:
The sender cannot send the next frame until it has received the ACK for the last frame so, if the receiver
gets a frame with the wrong sequence it has to be a retransmission of the previous frame received. This
2
means that the ACK was lost so the receiver has to ACK again to indicate the sender that it has received
the frame.
6. Discuss the factors that should be considered in deciding whether an ARQ protocol should act on a
frame in which errors are detected.
Solution:
If a frame is in error, then all of the information contained in it is unreliable. Hence any action taken as a
result of receiving an erroneous frame should not use the information inside the frame. A viable option
when an erroneous frame is received is to do nothing, and instead to rely on a timeout mechanism to
initiate retransmission. However error recovery will be faster if we use a NACK message to prompt the
sender to retransmit. The inherent tradeoff is between the bandwidth consumed by the NACK message
and the faster recovery.
7. A 64-kilobyte message is to be transmitted from the source to the destination. The network limits packets to a
maximum size of two kilobytes, and each packet has a 32-byte header. The transmission lines in the network have a
bit error rate of 10−6, and Stop-and-Wait ARQ is used in each transmission line. How long does it take on the
average to get the message from the source to the destination? Assume that the signal propagates at a speed of 2 x
105 km/second.
Solution:
Message Size 65536 bytes
Max Packet Size 2048 bytes
Packet Header 32 bytes
Available for info 2016 bytes
# of packets needed 32.51 packets
Total 33 packets
bit error rate 1E-06
bits/packet 16384
Probability of error in packet 0.016251 1 – (1– bit_error_rate) ^ (bits/packet)
Propagation speed 2E+05 Km/s
Distance 1000 Km
Bandwidth 1.5 Mb/s
We assume that the ACK error, the ACK time, and processing time are negligible.
Tprop = distance / propagation speed = 0.0050 s
Tf = packet size / bandwidth = 0.0109 s
T0 = Tprop + Tf = 0.0159 s
Pf = probability of error in packet = 0.016251
E[Ttotal]= T0/ (1 - Pf) = 0.0162
3
The time to send every packet over two links is then the initial packet transmission time + 33 additional
packet times, and so the average time is E[Ttotal] * 34 = 0.522 seconds.
8. A telephone modem is used to connect a personal computer to a host computer. The speed of the
modem is 56 kbps and the one-way propagation delay is 100 ms.
a. Find the efficiency for Stop-and-Wait ARQ if the frame size is 256 bytes; 512 bytes. Assume a bit
error rate of 10−4.
b. Find the efficiency of Go-Back-N if three-bit sequence numbering is used with frame sizes of 256
bytes; 512 bytes. Assume a bit error rate of 10−4.
Given that WS = 7, we can calculate that the window size is:
Since this is greater than the round trip propagation delay, we can calculate the efficiency by using the results in
Equation 5.8.