Homework 4 Solution

advertisement

EE 5304/EETS7304 Internet Protocols April 19, 2006

Homework #4 Solution

Problem 1. (UDP)

UDP and IP are both unreliable datagram protocols. (a) Can applications access IP directly without using UDP? (b) What useful services does UDP add above IP, if any? (c)

Real-time applications often choose to use UDP instead of TCP; why?

(a) Yes, applications can access IP directly without using UDP or TCP. The TCP/IP protocol reference model is not strictly vertical as the OSI reference model.

(b) UDP doesn’t add much above IP, but it does allow multiplexing/demultiplexing (by use of port numbers) and error checking over the entire UDP datagram plus pseudoheader

(IP checks errors only in the IP header).

(c) TCP incurs a delay in the connection set-up. Also, real-time services such as voice require prompt delivery much more than reliable delivery (slowed down by TCP acknowledgements and retransmissions). Real-time services may not be amenable to

TCP’s flow control either.

Problem 2. (UDP)

SNMP (simple network management protocol) is a widely used method for managing networks. In SNMP, each switch or router records information about its status and performance in a local database, which is accessible by a centralized network management station. Typically, the network management station will take turns polling switches and routers for their status information. The polling is done by sending an

SNMP “get-request” message carried in a UDP datagram, and the requested information is returned by the switch or router in an SNMP “get-response” message in a UDP datagram. Speculate on why UDP is typically used for SNMP messages instead of TCP.

UDP is typically used for SNMP messages instead of TCP because it would be inefficient to go through the trouble of connection set-up and termination in TCP for polling messages. SNMP involves a request-and-response interaction (only a packet in each direction) between a switch and network management station. TCP involves a 3-way handshake to set up a connection before data can be sent, and then another 3-way handshake to terminate the connection.

Problem 3. (TCP timers)

Explain the purpose of these timers in TCP: (a) retransmission timer (b) persist timer (c) keepalive timer (d) 2MSL (maximum segment lifetime) timer.

(a) The retransmission timer is to detect lost packets and resend a duplicate packet after the timer expires.

(b) After the sending window has been closed (with zero credit), a persist timer is used by the source to periodically probe the destination host to see if the window has actually been changed. The purpose is to prevent deadlock situations where a credit to open the window has been lost.

(c) The keepalive timer is an optional feature in some TCP implementations. The keepalive timer initiates polling of the other end of a TCP connection if the connection has been idle for too long, to discover the status of the other host. It might not be a good

1

EE 5304/EETS7304 Internet Protocols April 19, 2006 idea because (1) a good connection can get dropped during transient failures (2) the probe packets consume bandwidth unnecessarily (3) the probe packets might increase usage charges (depending on the billing scheme).

(d) MSL is the maximum segment lifetime or the longest time that a TCP segment can exist in the network before being discarded. After a TCP connection is closed, the hosts maintain a record of the connection for twice the MSL. This allows any late duplicate segments to be detected and discarded, and allows for the final ACKs to be resent if they are lost.

Problem 4. (TCP acknowledgement ambiguity problem)

If you are allowed to change the TCP header, suggest an additional header field to eliminate the ambiguity of acknowledgements (i.e., so that roundtrip times can be measured accurately).

The acknowledgement ambiguity problem arises when a segment is sent twice or more, and it’s not clear if the returned ACK refers to the first segment or duplicate. Various solutions to the problem are possible. For example, an additional field could sequentially number the times that a segment is retransmitted, and this number could be reflected back in the ACK.

Problem 5. (TCP connection set-up)

What is the minimum number of packets required by TCP to open a connection, send data, and close the connection? Sketch a typical exchange of packets in TCP.

TCP requires three TCP segments to open a connection and send data (i.e., three-way handshake), and another three segments to close the connection. (Strictly speaking, closing can take 4 segments or a modified three-way handshake if the other host isn’t ready to close yet).

2

EE 5304/EETS7304 Internet Protocols April 19, 2006

3

Download