Documents

TCP_Summary.pdf

Description
Client_Socket Interfaces (TCP Connection Setup and Release) Client Node Internet Server Node Client Net Server Client App Client Socket Network Server Socket Server App EventHelix.com/EventStudio 1.0 14-Apr-02 20:19 (Page 1) Copyright (c) 2002 EventHelix.com Inc. All Rights Reserved. LEG: About TCP TCP (Transmission Control Protocol) provides a reliable end to end service that delivers packets over the Internet. Packets are delivered in sequence without loss or duplication. create Server Appli
Categories
Published
of 12
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Related Documents
Share
Transcript
  Client_Socket Interfaces (TCP Connection Setup and Release) Client NodeInternetServer NodeClientNetServerClient AppClientSocketNetworkServerSocketServer App EventHelix.com/EventStudio 1.0 14-Apr-02 20:19 (Page 1) Copyright (c) 2002 EventHelix.com Inc. All Rights Reserved. LEG: About TCP TCP (Transmission Control Protocol) provides a reliable end to end service that delivers packets over the Internet. Packetsare delivered in sequence without loss or duplication.createServer Application creates a SocketcreateClient Application creates Socket Closed The socket is created in the Closed state seq_num = 0 Initial sequence number is set to 0Active_OpenApplication wishes to communicate with a destination serverusing a TCP connection. The application opens a socket for theconnection in active mode. In this mode, a TCP connection willbe attempted with the server.Typically, the client will use a well known port number tocommunicate with the remote Server. For example, HTTP usesport 80. LEG: Client initiates TCP connection Client initiated three way handshake to establish a TCP connectionSYN src = Client_Port, dst =Server_Port, seq_num = _0 Client sets the SYN bit in the TCP header to request a TCPconnection. The sequence number field is set to 0. Since theSYN bit is set, this sequence number is used as the initialsequence number SYN Sent Socket transitions to the SYN Sent stateSYN_ACK   src = Server_Port, dst =Client_Port, seq_num =_100, ack_num = _1, window= _65535 Client receives the SYN_ACK TCP segmentACK src = Client_Port, dst =Server_Port, ack_num =_101, window = _5000 Client now acknowledges the first segment, thus completingthe three way handshake. The receive window is set to 5000.Ack sequence number is set to 101, this means that the nextexpected sequence number is 101. Established At this point, the client assumes that the TCP connection hasbeen established LEG: Short data transfer Data transfer phase: Here a short data transfer takes place, thus TCP slow start has little impactData   size = _1024 Client application sends 1024 bytes of data to the socket Split data into TCPsegments This TCP connection limits TCP segments to 512 bytes, thusthe received data is split into 2 TCP segmentsTCP_Segment seq_num = _1, len = _512 The first TCP segment is sent with a sequence number of 1.This is the sequence number for the first byte in the segment.(Note that unlike other protocols, TCP maintains sequencenumbers at byte level. The sequence number field in the TCPheader corresponds to the first byte in the segment.)TCP_Segment seq_num = _513, len = _512 Bytes in the first TCP segment correspond to 1 to 512 sequencenumbers. Thus, the second TCP segment contains data startingwith 513 sequence numberACK ack_num = _1025 TCP_Segment   seq_num = _1, len = _512 TCP_Segment seq_num = _613, len = _188 Client has received both the TCP segments  Client_Socket Interfaces (TCP Connection Setup and Release) Client NodeInternetServer NodeClientNetServerClient AppClientSocketNetworkServerSocketServer App EventHelix.com/EventStudio 1.0 14-Apr-02 20:19 (Page 2)Assemble TCP Segments Data size = _700 Socket passes data to Client applicationACK ack_num = _701 Client sends a TCP ACK with the next expected sequencenumber set to 701 LEG: Client initiates TCP connection close Client initiates TCP connection closeCloseClient application wishes to release the TCP connectionFINClient sends a TCP segment with the FIN bit set in the TCPheader FIN Wait 1 Client changes state to FIN Wait 1 stateACKClient receives the ACK FIN Wait 2 Client changes state to FIN Wait 2. In this state, the TCPconnection from the client to server is closed. Client now waitsclose of TCP connection from the server endFINClient receives FINACKClient sends ACKClose_TimerClient starts a timer to handle scenarios where the last ack hasbeen lost and server resends FIN Time Wait Client waits in Time Wait state to handle a FIN retrydeleteClose_TimerClose timer has expired. Thus the client end connection can beclosed too. Closed delete  Client_Socket Interfaces (TCP Slow Start) Client NodeInternetServer NodeClientNetServerClient AppClientSocketNetworkServerSocketServer App EventHelix.com/EventStudio 1.0 14-Apr-02 20:19 (Page 3) Copyright (c) 2002 EventHelix.com Inc. All Rights Reserved. LEG: About TCP Slow Start TCP is an end to end protocol which operates over the heterogeneous Internet. TCP has no advance knowledge of thenetwork characteristics, thus it has to adjust its behavior according to the current state of the network. TCP has built insupport for congestion control. Congestion control ensures that TCP does not pump data at a rate higher than what thenetwork can handle.In this sequence diagram we will analyse Slow start , an important part of the congestion control mechanisms built rightinto TCP. As the name suggests, Slow Start starts slowly, increasing its window size as it gains confidence about thenetworks throughput.createServer Application creates a SocketcreateClient Application creates Socket Closed The socket is created in the Closed state seq_num = 0 Initial sequence number is set to 0Active_OpenApplication wishes to communicate with a destination serverusing a TCP connection. The application opens a socket for theconnection in active mode. In this mode, a TCP connection willbe attempted with the server.Typically, the client will use a well known port number tocommunicate with the remote Server. For example, HTTP usesport 80. LEG: Client initiates TCP connection Client initiated three way handshake to establish a TCP connectionSYN src = Client_Port, dst =Server_Port, seq_num = _0 Client sets the SYN bit in the TCP header to request a TCPconnection. The sequence number field is set to 0. Since theSYN bit is set, this sequence number is used as the initialsequence number SYN Sent Socket transitions to the SYN Sent stateSYN_ACK   src = Server_Port, dst =Client_Port, seq_num =_100, ack_num = _1, window= _65535 Client receives the SYN_ACK TCP segmentACK src = Client_Port, dst =Server_Port, ack_num =_101, window = _5000 Client now acknowledges the first segment, thus completingthe three way handshake. The receive window is set to 5000.Ack sequence number is set to 101, this means that the nextexpected sequence number is 101. Established At this point, the client assumes that the TCP connection hasbeen established LEG: TCP Slow Start A TCP connection starts in the Slow Start state. In this state, TCP adjusts its transmission rate based on the rate at whichthe acknowledgements are received from the other end.TCP Slow start is implemented using two variables, viz cwnd (Congestion Window)and ssthresh (Slow Start Threshold).cwnd is a self imposed transmit window restriction at the sender end. cwnd will increase as TCP gains more confidence onthe networks ability to handle traffic. ssthresh is the threshold for determining the point at which TCP exits slow start. If cwnd increases beyond ssthresh, the TCP session in that direction is considered to be out of slow start phase cwnd = 512 (1 segment) Client maintains a congestion window (cwnd). Initially thewindow is set to lower of the maximum TCP segment size andreceiver's allowed window size. In most cases the segment sizeis smaller than receiver window, thus cwnd is set to themaximum TCP segment size (512 in this example)Note here that cwnd implements a transmitter end flow control.The receiver advertised window implements a receiverenforced flow control. ssthresh = 65535 TCP connections start with ssthresh set to 64K. This variablewill be used to determine the point at which TCP exits slow  Client_Socket Interfaces (TCP Slow Start) Client NodeInternetServer NodeClientNetServerClient AppClientSocketNetworkServerSocketServer App EventHelix.com/EventStudio 1.0 14-Apr-02 20:19 (Page 4) start Slow Start Client end TCP connection moves to slow start stateData   size = _5120 Client application sends 5120 bytes of data to the socketRoundtrip #1 of data transmissionTCP_Segment seq_num = _1, len = _512 The first TCP segment is sent with a sequence number of 1.This is the sequence number for the first byte in the segment.ACK ack_num = _513 Client receives the acknowledgement for the first TCP datasegment cwnd = 1024 (2segments) As the TCP session is in slow start, receipt of anacknowledgement increments the congestion window by one 1segment.Roundtrip #2 of data transmissionTCP_Segment seq_num = _513, len = _512 Since the congestion window has increased to 2, TCP can nowsend two segments without waiting for an ack TCP_Segment   seq_num = _1025, len = _512 ACK ack_num = _1537cwnd = 1536 (3segments) Receipt for ack again moves the congestion windowRoundtrip #3 of data transmissionTCP_Segment   seq_num = _1537, len = _512 Now three segments can be sent without waiting for an ack TCP_Segment seq_num = _2049, len = _512 TCP_Segment seq_num = _2561, len = _512 ACK ack_num = _2561 The TCP acknowlegements again increment cwnd. This timetwo acks are received, so cwnd will get incremented by 2 cwnd = 2048 (4segments) ACK ack_num = _3073cwnd = 2560 (5segments) TCP_Segment seq_num = _3073, len = _512 Since cwnd has reached 5 segments, TCP is allowed to send 5segments without waiting for the ack Roundtrip #4 of data transmissionTCP_Segment seq_num = _3585, len = _512 TCP_Segment   seq_num = _4097, len = _512 TCP_Segment seq_num = _4609, len = _512 TCP_Segment seq_num = _5121, len = _512 ACK ack_num = _4097 Three acknowledgements will be received for the 5 TCPsegments. Now the cwnd has almost started increasinggeometrically for every round trip between the client and theserver. cwnd = 3072 (6segments)

Para lab 8

Jul 23, 2017
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks
SAVE OUR EARTH

We need your sign to support Project to invent "SMART AND CONTROLLABLE REFLECTIVE BALLOONS" to cover the Sun and Save Our Earth.

More details...

Sign Now!

We are very appreciated for your Prompt Action!

x