Solution for Assignment 5 


0. Draw a diagram showing the connection establishment, flow of TCP segments, and connection setup and termination during a TCP session involving the transfer of 20-byte request from client followed by the transfer of 3000 bytes from the server (transferred 1000 bytes at a time).  The server closes the connection after the last segment is acknowledged.  Assume the ISNs for client and server are 100 and 200, respectively.

Solution was done in class.  Review your notes.

1. Are there any circumstances when a virtual circuit service will (or at least should) deliver packets out of order?  Explain.

Yes.  Interrupt signals should skip ahead of data and be delivered out of sequence.  This is similar to URG TCP packet.  A typical example is hitting ESC key to abort telnet session.

2. Give three examples of protocol parameters that might be negotiated when a connection is set up.

The negotiation can be on setting the window size, maximum packet size (MTU or MSS), and timer values.

3. Assuming that all routers and hosts are working properly and that all software in both is free of all errors, is there any chance, however small, that a packet will be delivered to the wrong destination?

Yes.  A large noise burst could garble a packet badly and would be able to undetected using checksum.  With k-bit checksum, there is a probability of 2-k that the error is undetected..  So if destination address or VCI fields go undetected, the packet will be delivered to the wrong destination.

4.  If delays are recorded as 8-bit numbers in a 50-router network, and delay vectors are exchanged twice a second, how much bandwidth per (full-duplex) line is chewed up by the distributed routing algorithm?  Assume that each router has three lines to other routers.

The routing table is 400 bits.  Twice a second this table is written onto each line, so 800 bps are needed on each line in each direction.

5. An IP datagram using the strict source routing option has to be fragmented.  Do you think the option is copied into each fragment, or is it sufficient to just put it in the first fragment?  Explain your answer.

Since the information is needed to route every fragment, the option must appear in every fragment.

6. A class B network on the Internet has a subnet mask of 255.255.240.0.  What is the maximum number of hosts per subnet?

For a class B network, the upper 16 bits form network id, while the lower 16 bits form the host id.  Of the lower bits, the most significant bits are: 1111.  This leaves 12 bits for hosts, so 4096 hosts are possible.  Addresses 0 and -1 are special, so the maximum number of hosts would be 4094.

7. ARP and RARP both map addresses from one space to another.  In this respect, they are similar.  However, their implementations are fundamentally different.  In what major way do they differ?

RARP has a RARP server that answers requests.  ARP does not have this.

8.  Most IP datagram reassembly algorithms have a timer to avoid having a lost fragment tie up reassembly buffers forever.  Suppose a datagram is fragmented into four fragments.  The first threee fragments arrive, but the last one is delayed.  Eventually the timer goes off and the three fragments in the receiver's memory are discarded.  A little later, the last fragment stumbles in.  What should be done with it? 

As far as the receiver is concerned, this is a part of new datagram, since no other parts of it are known.  It will therefore be queued until the rest show up.  If they do not, this one will time out too.

9.  The Protocol  field used in the IPv4 header is not present in the fixed IPv6 header. Why not?

The Protocol   field tells the destination host which protocol handler to give the IP packet to.  Intermediate routers do not need this information, so it is not needed in the main header.  Actually, it is there, but disguised.  The Next header  field of the last (extension) header is used for this purpose.

10. When the IPv6 protocol is introduced, does the ARP protocol have to be changed?  If so, are the changes conceptual or technical?

There are no changes conceptually.  Technically, the IP addresses requested are now bigger, so bigger fields are needed.

11. Discuss the advantages and disadvantages of credits vs. sliding window protocols.

The sliding window is simpler, having only one set of parameters (the window edges) to manage.  However, the credit scheme is more flexible, allowing dynamic management of the buffering, separate from acknowledgements.

12. Datagram fragmentation and reassembly are handled by IP and are invisible to TCP.  Does this mean that TCP does not have to worry about data arriving out of order?

Yes TCP has to worry about reassembling the parts of message properly.

13. A process on host 1 has been assigned port p and a process on host 2 has been assigned port q.  Is it possible for there to be two or more TCP connections between these two ports at the same time?

No. A connection is identified only by its sockets.  Thus (1,p) <-> (2,q) is the only possible connection between those two ports.

14. The maximum payload of a TCP segment is 65,495 bytes.  Why was such a strange number chosen?

Maximum IP packet is 65,535 bytes, out of which 20 is used for IP headers.  TCP header is 20 bytes. So 65,535 - 20 - 20 would be 65,495 bytes.

15. Consider the effect of using slow start on a line with a 10-msec round-trip time and no congestion.  The receive window is 24 KB and theMSS is 2 KB.  How long does it take before the first full window can be sent?

The first bursts contain 2K, 4K, 8K, and 16K bytes, respectively.  The next one is 24 KB and occurs after 40 msec.

16. Suppose that TCP congestion window is set to 18K bytes and a timeout occurs.  How big will the window be if the next four transmission bursts are all successful?  Assume that  the MSS is 1 KB. 

The next transmission will be 1 MSS.  Then 2, 4, and 8.  So after 4 successes, it will be 8 KB.

 17.  If the TCP round-trip time, RTT, is currently 30 msec and the following acknowledgements come in after 26, 32, and 24 msec, respectively, what is the new RTT estimate?  Use a=0.9.

The successive estimates are 29.6, 29.84, 29.256.

18. A TCP machine is sending windows of 65,535 bytes over a 1-Gbps channel that has a 10-msec one-way delay.  What is the maximum throughput achievable?  What is the line efficiency?

One window can be sent every 20 msec.  This gives 50 windows/sec, for a maximum data rate of about 3.3 million bytes/sec.  The line efficiency is then 26.4 Mbps/1000 Mbps or 2.6%.

19. Why does UDP exist?  Would it not have been enought to just let user processes send raw IP packets?

No.  IP packets contain IP addresses, which specify a destination machine.  Once such a packet arrived, how would the network handler know which process to give it to.  UDP packets contain a destination port.  This information is essential so they can be delivered to the correct process.

20. A router using distance vector routing has the following routing table:

Net2 6 A
Net3 4 E
Net4 3 A
Net6 2 D
Net7 1 B

The router receives the following packet from router C:

Net2 4
Net3 5
Net4 2
Net6 3
Net7 2

Show the updated routing table for the router.

The updated routing table would look like:

Net2 5 C
Net3 4 E
Net4 3 A
Net6 2 D
Net7 1 B

21. The value of the HLEN in an IP datagram is seven.  How many option bytes are present?

 Header Length = 7 x 4 = 28

Option Length = 28 – 20 = 8 bytes.

22. When I checked the TCP segment format, I did not find any field in the header to indicate the segment length. And the question is: - How does the IP protocol in the same host know the length of the segment?

 The length is not stored in the header. However, when TCP manufactures a segment, it passes the length (and other information) to IP along with the segment.

23 - Also, how does the TCP protocol in the other side know the length of the segment?

When IP receives a datagram carrying TCP, IP computes the length of the segment (from the IP header length and total datagram length), and then passes the length to TCP along with the segment.

24 - How is MTU Discovery in IPv6 is different than that of IPv4?

Intermediate nodes in IPv6 reply with an ICMP packet indicating "packet too big", while in IPv4 the source has to send a large packet with DF bit set on.