What Is the Difference Between Congestion Control and Flow Control

91.413 Data Communications I

Fall 2007 Midterm Solution

1. Short Answers (27 points, 3 points each problem).

a. Suppose all of the network sources send data at a constant bit rate. Would packet-switching or circuit-switching be more desirable in this case? Why?

Either packet switching or circuit switching would work well here. Both would utilize network resources equally well. Circuit switching would utilize resources well because the traffic is constant rate, and thus a circuit would always be busy carrying traffic.

b. In computer networks, the sources are usually bursty – that they only occasionally have data to send. Would packet-switching or circuit switching be more desirable in this case? Why?

Packet switching is more desirable because it provides statistical multiplexing, and can support more network sources with only a small probability of congestion.

c. What is the difference between transmission delay and propagation delay?

Transmission delay is the amount of time required to push (transmit) the bits of a packet into the link. Propagation delay is the amount of time required for a bit to propagate from one end of the link to the other (which is close to the speed of light).

d. Suppose Alice sends an email to Bob and Bob is on a Personal Computer (PC). Briefly describe the procedures involved, especially the protocols involved.

1) Alice composes the email and the application software sends the email to Alice’s mail server (SMTP).

2) Alice’s mail server forwards the mail to Bob’s mail server (SMTP).

3) When Bob gets online and checks his email, Bob’s mail server transfers him Alice’s mail (POP3, IMAP or HTTP).

The transport layer protocol is TCP.

e. How can persistent HTTP connections reduce the time for a browser to display a web page? How can a web cache (HTTP proxy) reduce the time to display a web page?

Persistent connections reduce the time by eliminating the establishment of a new TCP connection, therefore eliminating one RTT (due to the handshaking of TCP) per object fetched from the server. It also eliminates the need to for each connection to go through the slow start phase of TCP. A web cache reduces the time by eliminating the need to retrieve the object from the server if the object being requested is present in the cache. This will reduce the transmission time of the object requested.

f. What are the advantages of using UDP? Name a few applications that use UDP.

It’s faster than TCP (no three-way hand shake), and the sending rate does not depend on network congection. Applications include DNS, multimedia applications.

g. What is the main functionality of DNS? What transport layer service does DNS use? Why?

DNS provides a directory service that translate hostnames to IP addresses. It uses UDP for the purpose of fast response.

h. In rdt (reliable data transfer) protocols, what mechanisms are introduced to handle bit errors, duplicate packets due to retransmission, and packet loss, respectively?

Checksum is used to detect bit errors. Sequence number is used to differentiate between new and duplicate packets. Timeout is used to handle packet loss.

i. How does a web server distinguish between different connections on the same port (number 80)?

A web server uses source IP address, destination IP address, source port number and destination port number to identify a connection.

2. Delays (12 points).

Consider two hosts, A and B, connected by two links and a router (see Figure). Suppose the lengths of the two links are m1 and m2, and the bandwidth of the two links are R1 and R2, respectively. The propagation speed along the links is s meters/sec. Host A is to send a packet of size L bits to Host B.

a.  Express the propagation delay of the packet on each link, dprop, in terms of m1, m2, and s.

m1/s, m2/s.

b.  Determine the transmission time of the packet on each link, dtrans, in terms of L and R1, R2.

L/R1, L/R2.

c.  Ignore processing and queueing delays, obtain an expression for the packet end-to-end delay.

L/R1+m1/s+L/R2+m2/s.

d.  Consider the first link, suppose the propagation delay of this link is greater than the packet transmission delay on this link. At time t = dtrans, where is the first bit of the packet.

At distance sdtrans = sL/R1 from host A.

e.  Consider the first link, now suppose dprop is smaller than dtrans. At time t = dtrans, where is the first bit of the packet?

Router R.

f.  Suppose host A has a large number of packets to send to host B. If R1 < R2, will there be queue built up at router R? why?

No. Because link 2 processes packets faster than link 1.

3. Messaging Diagrams of Sliding-window protocols (20 points)

For each of these questions use a graph showing the messages that are passed between the sender and the receiver. For all diagrams the sender should be on the left and the receiver should be on the right, with the time axis running down the page. Make sure you indicate sequence numbers and acknowledgement numbers where appropriate.

Consider a sender with a sending window of size 4 and a total of 6 packets of data to send to the receiver. Show the behavior when the second packet sent from the sender is lost and the 5th ACK from the receiver to the sender is lost.

a.  Show the messages if the sender and receiver are using Go-Back-N

b. Show the messages if the sender and receiver are using Selective Repeat.

4. Congestion Control, Flow Control and TCP (31 points)

a)  What are the main purposes of congestion control and flow control? (4 points)

Flow control is used to balance the rate at which bits are produced by the sender with the rate at which bits are consumed by the receiver. This matches the speed of a sender with the capabilities of a receiver. Congestion control is used to regulate the rate at which senders generate traffic in order to avoid the over-utilization of the resources available within network. This prevents network congestion which if pronounced, could lead to a network collapse.

b)  What are the causes and manifestations of network congestion? (4 points)

The main cause of network congestion is too many hosts send too much traffic into the network. The manifestations are packet loss and delay.

c)  Use a time-line diagram to describe the TCP connection establishment process. (2 points)

d) How does TCP sender controls its sending rate?

e ) How does TCP detect a lost packet? What action is taken when loss is detected? (4 points)

TCP can detect loss in two ways. If a timeout occurs, TCP infers that a packet was lost and retransmits the packet for which the timer has expired. It also reduces its window size to one. If the sender receives a triple-duplicate ACK, TCP also infers that a packet was lost and retransmits the subsequent packet to the ACKed sequence number. In this case it reduces its window size by half.

f) What are the two phases of TCP congestion control? When does TCP change from one phase to the other? (3 points)

The two phases are Slow Start and Congestion Avoidance. In slow start TCP increases its window size by 1 packet for every ACK received, resulting in an exponential increase of window size. In Congestion Avoidance, TCP increases its window size by 1 packet every window’s worth of packets, resulting in a linear increase of window size. A threshold variable, which indicates a certain window size, is used to change from one phase to another.

g) How does TCP estimate its RTT? How does TCP set its Timeout value? (2 points)

TCP sender measures RTT samples and uses a weighted average method to estimate its RTT. The timeout value is set to be RTT+4Dev. See book for details.

h) Assuming TCP has a initial threshold value of 8. The TCP sender detects a triple duplicated ACK at the end of transmission round 7 and a timeout at the end of round 12. Draw the window size as a function of RTT round from round 1 to round 14. What is the number of transmission rounds (that is, RTTs) required to transfer 50 data segments? (9 points)

window size total sent

Round 1 1 1

2 2 3

3 4 7

4 8 15

5 9 24

6 10 34

7 11 45

8 12 57

So 8 transmission rounds is requires to send 50 data segments.

Page 1 of 7