You are on page 1of 6

CHAPTER 12

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

7. See Figure 12.1. Figure 12.1 Exercise 7

52001 14532 751 785 5 0 0 40 bytes of data 1 1 0 0 0

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

Figure 12.2 Exercise 15

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

SYN + ACK Ephemeral port 5 21732 785 14535 0 10 0 10 Checksum

ACK Ephemeral port 5 14534 785 21733 0 10 0 00 Checksum

Figure 12.3 Exercise 17

Client FIN segment Ephemeral port 5 14555 21749 0 10 0 01 Checksum Well-known port

Server

FIN + ACK segment Ephemeral port 5 21749 785 14556 0 10 0 01 Checksum

Well-known port window size 0

ACK segment Ephemeral port 5 14534 14555 785 21750 0 10 0 00 Checksum

Well-known port window size 0

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

21. See Figure 12.4. Figure 12.4 Exercise 21


Before 2001 3001 5000

After receiving ACK 2500 3001 6499

After sending 1000 bytes 2500 4001 6499

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

Figure 12.5 Exercise 25


Sender Receiver

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

Figure 12.6 Exercise 27

cwnd 32 30 28 26 24 22 20 18 16 14 12 10 08 06 04 02
Threshold = 32

SS

SS: Slow Start AI: Additive Increase MD: Multiplicative Decrease

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

You might also like