Docsity

TCP Segment Headers and Sliding Window Protocol in TCP/IP, Slides of Computer Networks

Partial preview of the text

Download TCP Segment Headers and Sliding Window Protocol in TCP/IP and more Slides Computer Networks in PDF only on Docsity!

1

Lecture No. 31

2

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

4

TCP Options โ€“ Existing & Proposed

  • Negotiate maximum segment size

( MSS )

  • Each host suggests a value
  • Minimum of two values is chosen
  • Prevents IP fragmentation over

first/last hops

5

TCP Options โ€“ Existing & Proposed

  • Packet timestamp
    • Allows RTT calculation for retransmitted

packets

  • Extends sequence number space for

identification of stray packets (packets arriving

very late)

  • Negotiate advertised window granularity
    • Allows larger windows
    • Good for routes with large bandwidth-delay

products Docsity.com

7

State Transition Diagram

CLOSED

LISTEN

SYN_RCVD SYN_SENT

ESTABLISHED

CLOSE_WAIT

CLOSING LAST_ACK

TIME_WAIT

FIN_WAIT_

FIN_WAIT_

Passive open Close

Send/SYN SYN/SYN + ACK SYN + ACK/ACK

SYN/SYN + ACK

ACK

Close/FIN

Close/FIN FIN/ACK FIN/ACK

Timeout after two segment lifetimes

FIN/ACK

ACK

ACK

ACK

Close/FIN

Close

CLOSED

Active open/SYN

8

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

10

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

application

TCP

Window max buffer size

11

Sliding Window

  • Receiver side
    • Green: received and ready to be delivered
    • Red: received and buffered
    • Blue: received and discarded

time

NextByteRead NextByteExpected LastByteReceived

application

TCP

Advertised window max buffer size

13

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 โ€ฆ

14

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 be lost
  • Solution: smart sender/dumb receiver
    • Sender periodically sends a 1-byte segment, ignoring advertised window of 0
    • Eventually, window opens
    • Sender learns of opening from next ACK of 1-byte segment