Solution to Homework 8


Solution#3.14

The protocol would operate incorrectly. Suppose that 3 bit sequence numbers are in use. Consider the following scenario:
A just sent frame 7.
B gets the frame and sends a piggybacked ack.
A gets the ack and sends frames 0-6, all of which get lost.
B times out and retransmits it's current frame, with the ack 7. Look at the situation at A when the frame with r.ack=7 arrives. The key variables are ackexpected=0, r.ack=7, and nextframetosend=7. The modified between would return true, causing A to think the lost frames were being acknowledged.


Solution#3.16

It would lead to deadlock (livelock) because this is the only place that incoming acks are processed. Without this code, the sender would keep timing out and never make any progress.


Solution#3.19

No. The maximum receiver window size is one. Suppose that it were two. Initially the sender transmits 0-6. All are received and acknowledged, but the ack is lost. The receiver is now preapared to accept 7 and 0. When the retransmission of 0 arrives at the receiver, it will be buffered and 6 acknowledged. When 7 comes in, 7 and 0 will be passed to the host, leading to a protocol failure.


Solution#5.4

The negotiation could set the window size, maximum packet size, and timer values.


Solution#5.7

Pick a route using shortest path. Now remove all the arcs used in the path just found, and run the shortest path algorithm again. The second path will be able to survive the failure of any line in the first path and vice versa. It is conceivable, though, that this heuristic may fail even though two line-disjoint paths exist. To solve it correctly, a max-flow algorithm should be used.