TCP Connection Management, State Transition Diagram - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

TCP Connection Management, State Transition Diagram

Description:

... not used) RST, SYN, FIN: connection estab (setup, teardown. commands) ... Socket clientSocket = new Socket('hostname','port number'); server: contacted by client ... – PowerPoint PPT presentation

Number of Views:825
Avg rating:3.0/5.0
Slides: 10
Provided by: JimKurosea175
Category:

less

Transcript and Presenter's Notes

Title: TCP Connection Management, State Transition Diagram


1
TCP Connection Management, State Transition
Diagram
EECS 325/425, Fall 2005 October 5
2
Quiz 1 Information
  • All materials covered (including todays lecture)
  • 3 problems
  • 20 points
  • 10 of final grade

3
Remember the fields in TCP segment?
32 bits
URG urgent data (generally not used)
counting by bytes of data (not segments!)
source port
dest port
sequence number
ACK ACK valid
acknowledgement number
head len
not used
Receive window
F
S
R
P
U
A
PSH push data now (generally not used)
bytes rcvr willing to accept
checksum
Urg data pnter
RST, SYN, FIN connection estab (setup,
teardown commands)
Options (variable length)
application data (variable length)
Internet checksum (as in UDP)
4
TCP Connection Establishment
  • Three way handshaking
  • Step 1 client host sends TCP SYN segment to
    server
  • specifies initial seq
  • no data
  • SYN bit
  • Step 2 server host receives SYN, replies with
    SYNACK segment
  • server allocates buffers
  • specifies server initial seq.
  • SYN bit ACK bit
  • Step 3 client receives SYNACK, replies with ACK
    segment, which may contain data
  • ACK bit
  • Recall TCP sender, receiver establish
    connection before exchanging data segments
  • initialize TCP variables
  • seq. s
  • buffers, flow control info (e.g. RcvWindow)
  • client connection initiator
  • Socket clientSocket new Socket("hostname","p
    ort number")
  • server contacted by client
  • Socket connectionSocket welcomeSocket.accept()

5
TCP Connection Establishment
6
TCP Connection Teardown
  • Closing a connection
  • client closes socket clientSocket.close()
  • Step 1 client end system sends TCP FIN control
    segment to server
  • Step 2 server receives FIN, replies with ACK.
    Closes connection, sends FIN.

closed
7
TCP Connection Teardown
  • Step 3 client receives FIN, replies with ACK.
  • Enters timed wait - will respond with ACK to
    received FINs
  • Step 4 server, receives ACK. Connection closed.
  • Note with small modification, can handle
    simultaneous FINs.

client
server
close
FIN
ACK
close
FIN
ACK
timed wait
closed
closed
8
TCP Connection Typical Lifetime
TCP server lifecycle
TCP client lifecycle
9
TCP State Transition Diagram
  • More complicated than previous slide
  • Different roles (client and server)
  • Need to handle exceptions, losses
  • Timing (which closes first?)
  • etc
  • Let us draw the diagram
Write a Comment
User Comments (0)
About PowerShow.com