Problem 1.18
(a) The effective bandwidth is 100 Mbps; the sender can send data steadily
at this rate and the switches simply stream it along the pipeline. We are
assuming here that no ACKs are sent, and that the switches can keep up
and can buffer at least one packet.
(b) The data packet takes 520 microsecs (3 switches and four links, so
4x120us + 4x10us). The 400 bit ACKs take 4us per link to be sent
back, plus propagation for a total of 4x4 + 4x10 or 56 usec. Thus the
total RTT is 576 us. 12000 bits in 576 us is around 20.8Mbps.
(c) 100x4.7x10^9 bytes/12 hours = 4.7x100 bytes/(12x3600 s) or 10.9
Mega Bytes per second (approximately); this is 87Mbps.
Problem 2.2
Transition in the middle of every 1 bit in the data, no transition with 0s. Start at 0 or 1 is ok.
Problem 2.5
Stuffed bits are marked _0_:
11010111 11_0_01011 111_0_1010 1111 1_0_110
Problem 2.18
(a) We take the message 11100011, append 000 to it, and divide by 1001
according to the method shown in section 2.4.3. The remainder is
1000; what we transmit is the original message with this remainder
appended or 11100011100
(b) Inverting the first bits of the transmission gives 01100011100;
dividing by 1001 gives the remainder of 10; the fact that the
remainder is non-zero tells us an error occurred.
Problem 2.27
For Fig. 2.17(b) with the lost frame, there iare no changes from the
diagram in the text (i.e., sender timeout occurs, and the frame is
retransmitted and received by the receiver, which generates an ACK).
For the case in Fig 2.17(c) in the book with the lost ACK, a timeout
will occur at the sender, causing a retransmission which is ignored by
the receiver. Additional timeout and retransmission occurs (assuming
the receiver timeout is slightly higher than twice the sender timeout)
which is also ignored by the receiver. Finally, the receiver timeout
for the ACK occurs, causing the ACK to be retransmitted.
For this case if the receiver timeout is half the sender timeout, the
ACK is re-sent quickly from the receiver after the first ACK is lost,
causing the sender to cancel its retransmit timeout and send Frame
(N+1). However, another ACK timeout may occur at the receiver before
the Frame (N+1) is received.
Finally, for the case in Figure 2.17(d) in the book (delayed ACK) the
case is similar to the original. The frame (N) is re-sent after the
timeout value at the sender is reached. The ACK for N is received
shortly after the retransmission and Frame(N+1) is transmitted. When
this is received, the timeout for frame(N+1) is cancelled at the
receiver.
Problem 2.46
Here is one possible solution; many are possible.
A attempts to transmit; finds line busy and waits.
B attempts to transmit; finds line busy and waits.
C attempts to transmit; finds line busy and waits.
D finishes; A, B, and C all detect this, and attempt to transmit, and collide.
A chooses kA=1, B chooses kB=1, and C chooses kC=1.
One slot time later A, B, and C all attempt to retransmit, and again collide.
A chooses kA=2, B chooses kB=3, and C chooses kC=1.
One slot time later C attempts to transmit, and succeeds. While it transmits, A and B both attempt to retransmit but discover the line is busy and wait.
C finishes; A and B attempt to retransmit and a third collision occurs. A
and B back off and (since we require a fourth collision) once again happen
to choose the same k < 8.
They collide and pick different backoffs less than 16 such that B goes first. When A's timer expires it finds the line is busy and waits. Once B is done A transmits
and we are done.
Problem 2.21
> 8. (2.21) With 1 parity bit we can detect all 1-bit errors. Show that at
> least one generalization fails, as follows:
> (a) Show that if messagesmare 8 bits long, then there is no error detection
> code e = e(m) of size 2 bits that can detect all 2-bit errors. Hint:
> Consider the setM of all 8-bit messages with a single 1 bit; note that any
> message fromM can be transmuted into any other with a 2-bit error, and show
> that some pair of messages m1 and m2 in M must have the same error code e.
> (b) Find an N (not necessarily minimal) such that no 32-bit error detection
> code applied to N-bit blocks can detect all errors altering up to 8 bits.
Dont worry about this one for the exam. Such problems are ok for
homeworks when you have a lot of time but not a good fit for an exam
setting. Here is the solution anyway.
(a) M has eight elements but there are only four values for e, so
there must be m1 and m2 in M with e(m1) = e(m2). Now if m1 is
transmuted into m2 by a two-bit error, then the error-code e cannot
detect this.
(b) For a crude estimate, let M be the set of N-bit messages with four
1s, and all the rest zeros. The size of M is (N choose 4) = N!/(4!(N-
4)!). Any element of M can be transmuted into any other by an 8-bit
error. If we take N large enough that the size of M is bigger than
2^32, then as in part (a) there must for any 32-bit error code
function e(m) be elements m1 and m2 of M with e(m1) = e(m2). For
sufficiently large N, The size of M > 2^32, making our case possible.
N=600 works. Much smaller estimates are possible if you dont assume
just 4 1's in the message.
Sliding Window Problem:
-----------------------
a)
The sequence number must be at least twice the window size; that is 4
for our window of size 2. If we use only three numbers (i.e., 0, 1
and 2) then the following situation could happen.
Sender sends 0 and 1, waits for acks
Receiver receives 0 and 1 and sends acks. Receiver window moves to
accept the next two packets, packet 2 and then 0 because the sequence
number wraps around.
Now consider two cases. If the ACK for 0 is lost, then the sender
will retransmit 0 (with sequence number 0). However, if it is not
lost, then it will transmit the fourth packet with sequence number 0.
There is no way to tell these two situations apart at the receiver,
and therefore a sequence number space of 3 is not enough.
b) We can only have two packets transmitted every RTT. Each packet is
5Kbits, so we can transmit 2 packets every RTT. It takes
10Kbits/1Mbps (or 10 msec) to transmit 10Kbits. So, RTT should be no
more than that before the sliding window size starts limiting
performance.