Problems: TCP and UDP
Problems: TCP and UDP
1. The TCP sliding windows are byte-oriented. What does this mean?
2. A TCP connection is using a window size of 10 000 bytes, and the previous acknowledg-
ment number was 22 001. It receives a segment with acknowledgment number 24 001.
Draw a diagram to show the situation of the window before and after.
3. A client uses UDP to send data to a server. The data are 16 bytes. Calculate the efficiency
of this transmission at the UDP level (ratio of useful bytes to total bytes).
5. A client uses TCP to send data to a server. The data are 16 bytes. Calculate the efficiency of
this transmission at the TCP level (ratio of useful bytes to total bytes, assume no options).
6. Redo Exercise 5., calculating the efficiency of transmission at the IP level using
7. Comment on the results in Exercises 3.–6.. Give examples of applications where it is good
to use UDP and TCP respectively.
1
Figure 1: Sliding window of Exercise 2..
4. Data are 16 bytes, length of IP header (no options) + UDP header is 28 bytes, so the ratio
16
is 28+16 = 0.364.
16
5. Data are 16 bytes, length of TCP header (no options) is 20 bytes, so the ratio is 20+16 = 49 .
6. Data are 16 bytes, length of IP header (no options) + TCP header (no options) is 40 bytes,
16
so the ratio is 16+40 = 0.286.
7. UDP is a very simple protocol with minimal overhead. If a process wants to send a
small message and does not care much about reliability, it can use UDP. Sending a small
message using UDP takes much less interaction between sender and receiver than using
TCP. UDP is used in multimedia and multicast applications, such as multiplayer games.
If reliability is wanted on the other hand, TCP should be chosen. FTP and Telnet use TCP
as transport layer protocol.
8. The UDP header has four parts, each of two bytes. That means we get the following
interpretation of the header.