Sunteți pe pagina 1din 7

The Higher Institute of Engineering

El-Shorouk City

Electronics, Communication, and Fourth year – 2nd semester


Computer Engineering Dept.
Network - Sheet (8) Dr Ahmed El Kasas

1. Compare the TCP header and the UDP header. List the fields in the TCP
header that are not part of the UDP header. Give the reason for each missing field.
Answer:

Note that the only field that exists in UDP, but is missing in TCP, is the total length field. The
designer of TCP did not feel that this field is needed because the size of the TCP segment can be
determined from the size of the IP datagram that carries it.
2. One ICMP message, reports a destination port unreachable error. How can
TCP detect the error in the destination port?
Answer:
The port is not listed in the transmission control block, which means no process is running
associated to this port.
3. What is the maximum size of the TCP header? What is the minimum size of
the TCP header?
Answer:
a. The maximum size of the TCP header is 60 bytes (20 bytes of header and a maximum 40 bytes
of options).
b. The minimum size of the TCP header is 20 bytes.
4. Show the entries for the header of a TCP segment that carries a message from
an FTP client to an FTP server. Fill the checksum field with 0s. Choose an
appropriate ephemeral port number and the correct well-known port number. The
length of data is 40 bytes.
Answer:

1
5. The following is a dump of a TCP header in hexadecimal format.

a. What is the source port number?


b. What is the destination port number?
c. What the sequence number?
d. What is the acknowledgment number?
e. What is the length of the header?
f. What is the type of the segment?
g. What is the window size?
Answer:
a. The source port number is 0532 in hex and 1330 in decimal.
b. The destination port number is 0017 in hex and 23 in decimal.
c. The sequence number is 00000001 in hex and 1 in decimal.
d. The acknowledgment number is 00000000 in hex and 0 in decimal.
e. The HLEN = 5. The header is 5 × 4 = 20 bytes long.
f. The control field is 002 in hex. This indicates a SYN segment used for connection
establishment.
g. The window size field is 07FF in hex and 2047 in decimal. The window size is 2047 bytes.
6. To make the initial sequence number a random number, most systems start the
counter at 1 during bootstrap and increment the counter by 64,000 every half second.
How long does it take for the counter to wrap around?
Answer:
Every second the counter is increment ed by 64,000 × 2 = 128,000. The sequence number field is
32 bits long and can hold only 232−1. So it takes (232−1)/ (128,000) or 33,554 seconds to wrap
around.
7. In a connection, the value of cwnd is 3000 and the value of rwnd is 5000. The
host has sent 2,000 bytes, which have not been acknowledged. How many more bytes
can be sent?
Answer:
The window size is the smaller (3000, 5000) = 3000. Since 2000 bytes is already sent, only 3000 −
2000 = 1000 more bytes can be sent.
8. A client uses TCP to send data to a server. The data consist of 16 bytes.
Calculate the efficiency of this transmission at the TCP level (ratio of useful bytes to
total bytes). Calculate the efficiency of transmission at the IP level. Assume no
options for the IP header. Calculate the efficiency of transmission at the data link
layer. Assume no options for the IP header and use Ethernet at the data link layer.
Answer:

2
The data section is only 16 bytes. The TCP header is 20 bytes. IP header is 20 bytes. The header
and trailer is 19 bytes (without preamble). We can calculate the efficiency at each layer:

9. A TCP connection is using a window size of 10,000 bytes and the previous
acknowledgment number was 22,001. It receives a segment with acknowledgment
number 24,001 and window size advertisement of 12,000. Draw a diagram to show
the situation of the window before and after.
Answer:

10. A TCP connection is in the ESTABLISHED state. The following events occur one after
another:
a. A FIN segment is received.
b. The application sends a “close” message. What is the state of the connection after each
event? What is the action after each event?
Answer:
a. The server can receive a FIN segment while it is in the ESTABLISHED state. When the FIN
segment is received, the server sends an ACK segment to the client and moves to the CLOSE-
WAIT state.
b. When the “close” message is received from the application, the client TCP sends a FIN
segment; the client goes to the FIN-WAIT-1 state and waits for an ACK.
11. A host has no data to send. It receives the following segments at the times shown
(hour:minute:second:milliseconds after midnight). Show the acknowledgments sent by
the host.
a. Segment 1 received at 0:0:0:000.
b. Segment 2 received at 0:0:0:027.
c. Segment 3 received at 0:0:0:400.
d. Segment 4 received at 0:0:1:200.
e. Segment 5 received at 0:0:1:208.
Answer:
a. No ACK needed at 0:0:0:0:000, according to Rule 2
3
b. No ACK needed at 0:0:0:0:027, according to Rule 2
c. ACK: 4 can be sent at 0:0:0:0:500
d. ACK: 5 can be sent at 0:0:0:1:200
e. No ACK needed at 0:0:0:1:208, according to Rule 2
12. Show the contents of a SACK option to be sent if a host has received bytes 2001 to 3000
in order. Bytes 4001 to 6000 are out of order, and bytes 3501 to 4000 are duplicate.
Answer:

13. Show the transition diagrams (FSMs) for simultaneous-close scenario (See Figure1).

Figure 1Connection establishment using three-way handshaking

Answer:

14. Show the transition diagrams (FSMs) for aborting-a-connection scenario (See Figure2).

4
Figure 2 Aborting a connection

Answer:

15. Draw a figure similar to Figure3 for the following scenario (ignore error control and
congestion control):
a. Time 1: The client sends a SYN segment with seqNo = 301.
b. Time 2: The server sets its buffer size to 2,000 bytes.
c. Time 3: The server acknowledges the SYN segment.
d. Time 4: The client sends a segment of 300 bytes in the SYN + ACK segment.
e. Time 5: The client sends a segment of 400 bytes.
f. Time 6: The server process pulls 400 bytes.
g. Time 7: The server sends an ACK.
h. Time 8: The client sends a segment of 300 bytes.
i. Time 9: The server process pulls 300 bytes.
j. Time 10: The server sends an ACK.

5
Figure 3 An example of flow control

Answer:

6
16. Redraw the time-line diagram of Figure4 that allow the server to delay
acknowledgements and send one ACK for each full cwnd window worth of data.

Figure 4 Slow start, exponential increase

Answer:

S-ar putea să vă placă și