1 / 8

TCP Connection Management

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","port number"); server: contacted by client

kalli
Download Presentation

TCP Connection Management

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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","port number"); server: contacted by client Socket connectionSocket = welcomeSocket.accept(); Three way handshake: Step 1:client host sends TCP SYN segment to server specifies initial seq # no data Step 2:server host receives SYN, replies with SYNACK segment server allocates buffers specifies server initial seq. # Step 3: client receives SYNACK, replies with ACK segment, which may contain data TCP Connection Management Transport Layer

  2. 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. client server close FIN ACK close FIN ACK timed wait closed TCP Connection Management (cont.) Transport Layer

  3. 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. TCP Connection Management (cont.) client server closing FIN ACK closing FIN ACK timed wait closed closed Transport Layer

  4. TCP Packets TCP adds “sessions” or “connections” to the bare IP protocol: Flags: Transport Layer

  5. (SYN, C-Seq, 0) (SYN|ACK, S-Seq, C-Seq+1) (ACK, C-Seq+1, S-Seq+1) The 3-way handshake Labels below give (Flags, Seq#, Ack#): • To establish connection, client must prove that it received the SYN|ACK packet! • SYN|ACK packet routed to system with source address from first SYN packet • Since based on routing, only secure back to the subnet of the source Server Client Transport Layer

  6. With fake Src: (SYN, C-Seq, 0) To fake Src: (SYN|ACK, S-Seq, C-Seq+1) (ACK, C-Seq+1, Predict-S-Seq+1) SYN Issues – Predictability • Sequence numbers should be unpredictable • Most systems today select random values that meet some necessary conditions • Otherwise: Client Server Data pretending to come from fake Src Particularly dangerous when “fake Src” is a trusted IP address Transport Layer

  7. Half-open conn S-Seq1 (SYN, C-Seq3, 0) (SYN, C-Seq1, 0) (SYN, C-Seq2, 0) (SYN|ACK, S-Seq3, C-Seq3+1) (SYN|ACK, S-Seq2, C-Seq2+1) (SYN|ACK, S-Seq1, C-Seq1+1) Half-open conn S-Seq2 Half-open conn S-Seq3 . . . . . . SYN Issues – SYN Flooding Server Data Structures • DoS isn’t due to traffic volume but to resource exhaustion (memory) in the server O.S. • Early network stacks had a severely limited number of half-open structures available • Can spoof SRC address with non-existent host Client Server Transport Layer

  8. TCP Limitations • provides strict ordering of information • result: Head of Line Blocking (HOL) problem • what is needed in many cases, is only partial ordering of data • byte oriented nature….inconvenience for telephony signaling • no built-in support for multi-homed IP hosts • vulnerability to SYN flooding attacks Transport Layer

More Related