Professional Documents
Culture Documents
TCP
Exercises
1. Common fields in UDP and TCP header: source port number destination port number checksum Fields present in TCP header that are absent from UDP header: sequence number acknowledgment number header length control bits urgent pointer options and padding (for flow and error control) (for flow and error control) (TCP has variable header length) (flow and error control and connection) (needed for flow and error control) (for better performance)
Fields present in UDP header that are absent from TCP header: total length (actually not needed)
3. The port is not listed in the transmission control block. 5. The maximum size of the TCP header is 60 bytes. The minimum size of the TCP header is 20 bytes.
SECTION
20 or 21
2000 0
9. 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 header length is 5 in hex and 5 in decimal. 5 4 is 20 bytes of header. 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 is 2047 bytes.
11. Every second the counter is incremented by 64,000 2 = 128,000. The sequence number field is 32 bits long and can hold only 2321. So it takes (2321)/(128,000) seconds or 33554 seconds. 13. a. 2171 b. 2172 c. 3172 15. See Figure 12.2. 17. See Figure 12.3.
SECTION
Client SYN Ephemeral port 5 14534 785 0 00 0 10 Checksum Well-known port window size 0 Well-known port window size 0 Well-known port
Server
Client FIN segment Ephemeral port 5 14555 21749 0 10 0 01 Checksum Well-known port
Server
19. The largest number in the sequence number field is 232 1. If we start at 7000, it takes [(232 1) 7000] / 1,000,000 = 4295 seconds.
SECTION
23. a. 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. b. When the client receives an ACK segment from the server, it moves to the FINWAIT-2 state, and waits for the server to send a FIN segment. 25. See Figure 12.5. | 27. Although some implementations reacts to the congestion detection (3ACKs or timeout) only during the congestion avoidance, we assume that the system reacts to the 3-ACK events even during the slows tart as shown in See Figure 12.6.
SECTION
RTO = 6.00
timeout
0:0:00 0:0:05 0:0:06 0:0:07 0:0:20 0:0:22 timeout 0:0:27 0:0:32 0:0:45
Segment 1 Segment 2 Segment 1 ACK 1 and 2 Segment 3 Segment 4 Segment 5 Segment 3 ACK 1 and 2
RTO = 12.00
RTO = 24.00
RTO = 24.00
0:0:65
ACK 3
Time
Time
cwnd 32 30 28 26 24 22 20 18 16 14 12 10 08 06 04 02
Threshold = 32
SS
3-ACKs
MD
Time-out
MD
AI
1 2 3 4 5 6 7 8 9 RTTs
Threshold = 5
10
11
12
13
14
15
16
SECTION