Docsity

TCP Segment Header and Sliding Window: Format, Control, and Implementation, Slides of Computer Networks

Partial preview of the text

Download TCP Segment Header and Sliding Window: Format, Control, and Implementation and more Slides Computer Networks in PDF only on Docsity!

2

Lecture No. 31

3

TCP Segment Header

-^ 16-bit advertised window– Space remaining in

receive window

-^ 16-bit checksum– Uses IP checksum algorithm– Computed on

header, data, and pseudo-header

-^ 16-bit urgent data pointer– If URG = 1– Index of last byte of urgent data in segment

5

TCP Options – Existing & Proposed• Negotiate maximum segment size( MSS

) – Each host suggests a value– Minimum of two values is chosen– Prevents IP fragmentation overfirst/last hops

6

TCP Options – Existing & Proposed• Packet timestamp– Allows

RTT^ calculation for retransmittedpackets

  • Extends sequence number space foridentification of stray packets (packets arrivingvery late)• Negotiate advertised window

granularity

  • Allows larger windows– Good for routes with large bandwidth-delayproducts

8

State Transition Diagram

CLOSED LISTEN SYN_RCVD^

SYN_SENT ESTABLISHED

CLOSE_WAITLAST_ACK CLOSING TIME_WAIT FIN_WAIT_1FIN_WAIT_

Passive open^ Close

Send/SYNSYN/SYN + ACKSYN + ACK/ACK SYN/SYN + ACKACK Close/FIN

FIN/ACK Close/FINFIN/ACK

Timeout aftertwo segmentlifetimes FIN/ACK

ACK ACK

Active open/SYNClose Close/FIN ACK CLOSED

9

Think-Pair-Share

-^ Describe the path taken– By a server under normal conditions, and– By a client under normal conditions,– Assuming that the client closes the connection first•^ Consider the

TIME_WAIT

state

  • What purpose does this state serve ?– Prove that

at least one

side of a connection enters this state before returning to CLOSED– Explain how

both^ sides might enter this state

11

Sliding Window

-^ Sender side^ – Green: sent and acknowledged– Red: sent (or can be sent) but not acknowledged– Blue: available but not within send window

time

LastByteAcked

LastByteSent

LastByteWritten

applicationTCP

Window

max buffer size

12

Sliding Window

-^ Receiver side^ – Green: received and ready to be delivered– Red: received and buffered– Blue: received and discarded

time

NextByteRead

NextByteExpected

applicationTCP^ LastByteReceived Advertised window

max buffer size

14

Flow vs Congestion Control

-^ Flow control prevents

buffer overflow

at receiver (only

source and destination are relevant)• Congestion control addresses

bandwidth

interactions

between distinct packet flows• TCP provides both– Flow control based on advertised window– Congestion control will be discussed later …

15

TCP Flow Control Issues

-^ Problem:

slow receiver

application

  • Advertised window goes to 0– Sender cannot send more data– Non-data packets used to update window– Receiver may not spontaneously generate, or update may belost• Solution: smart sender/dumb receiver– Sender periodically sends a 1-byte segment, ignoring advertisedwindow of 0– Eventually, window opens– Sender learns of opening from next ACK of 1-byte segment