Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
communication across an internet. TCP is equivalent to ISO transport layer protocol. The units of data exchanged between two end systems are called TCP segments. This TCP segment is given to the IP layer. The TCP user (the application layer) can request the TCP to transmit data with a push flag. At the receiving end, TCP will deliver the data in the same manner. This mechanism is known as data stream push. When urgent data is to be transmitted, urgent data signaling is used, which is a means of informing the destination TCP
1
user that urgent data is being transmitted. It is up to the destination user to determine appropriate action. In the TCP segment, there is a field called urgent pointer to indicate that the data is urgent.
Type of service Quality of service Data transfer Connection management Expedited delivery Status reporting
used
for
applications
such
as
telemetry,
real-time
applications such as audio/video communication, and so on. On the Internet, TCP provides connection-oriented service, and UDP provides connectionless service.
Expedited delivery: When some urgent data is to be sent, the interrupt mechanism is used to transfer the urgent data. Status reports: Status reporting of performance
characteristics is also done by this layer. The performance characteristics are delay, throughput, and degradation in quality of service.
Client Start State The CLOSE client cannot D do anythin g until the server has perfor med a passive OPEN and is ready to accept a connect ion. Step #1 CLOSE Transm Action Move to State Start State
The CLOSE server LISTEN perfor D ms a passive OPEN, ready itself for the receipt of a connect ion request (SYN) from a client.
SYN7
The server
it: The client perfor ms an active OPEN, and sending a SYN messag e to the server.
SENT
SYNSENT
The client waits to receive an ACK to the SYN it has sent, as well as the server's SYN.
Step #1 LISTEN Receive SYN, Step RECEIV #2 ED Transm it: The server receives the SYN from the client. It sends
8
a single SYN+A CK messag e back to the client that contain s an ACK for the client's SYN, and the server's own SYN.
SYNSENT
Step ESTABL SYN- The #2 ISHED RECEIV server Receiv waits ED e, Step for an #3 ACK to Trans the SYN mit: it sent
9
The client receives from the server the SYN+A CK containi ng the ACK to the client's SYN, and the SYN from the server. It sends the server an ACK for the server's SYN. The
10
previou sly.
ESTABL The ISHED client is waiting for the server to finish connect ion establis hment so they can operate normall y.
SYN- Step ESTABL RECEIV #3 ISHED Receiv ED e: The server receives the ACK to its SYN and is now done with connect ion establis hment.
11
ESTABL The ISHED client is ready for normal data transfer operati ons.
ESTABL The ISHED server is ready for normal data transfer operati ons.
12
Fig. illustrates how a conventional connection is established between a client and server, showing the three messages sent during the process and how each device transitions from the CLOSED state through intermediate states until the session is ESTABLISHED.
13
Source Port (2 bytes) : The 16-bit port number of the process that originated the TCP segment on the source device. This will normally be client port number for a request sent by a client to a server.
Destination Port (2 bytes): The 16-bit port number of the intended recipient of the message on the destination device.
14
Sequence Number (4 bytes): This field carries the initial sequence number (ISN) of the source TCP segment.
Acknowledgment Number (4 bytes): This field contains a sequence number, the sender of the packet expects to receive.
Data Offset / Header length (4 bits): The length of the TCP header. Reserved (6 bits): Reserved for future use, sent as zero.
Control Bits (6 bits): This field contains variety of control information, including, the SYN & ACK bits used for connection establishment and FIN used for connection
15
termination. URG (1bits): When set to 1, indicates that the priority data transfer feature has been invoked for this segment and the urgent pointer field is valid. ACK (1 bits): When set to 1, indicates that this segment carries an acknowledgement and the acknowledgement number field is valid. PSH (1 bits): The sender using the TCP push feature, requesting that the data in this segment be immediately pushed to the application on the receiving device. RST (1 bits): The sender has encountered a problem and wants to reset the connection. SYN (1 bits) : This segment is a request to synchronize sequence number and establish a connection, the sequence
16
number field contains the initial sequence number of the sender of the segment. FIN (1 bits): The sender of the segment is requesting that the connection be closed. Window (16 bits): This field corresponds to the current size of the buffer allocated to accept data for this connection. This field is, in other words, the current receive window size for the device sending this segment, which is also the send window for the recipient of the segment.
Checksum (16 bits): A 16-bit checksum for data integrity protection, computed over the entire TCP data plus header. It is used to protect the entire TCP segment against errors in transmission.
17
Urgent Pointer (16 bits): This field is used to indicate that the data segment is urgent. The destination has to process this segment even if there are other segments to be processed.
Options (variable): Options may occupy space at the end of the TCP Header. This field is used to negotiate the maximum TCP segment size. The TCP software can indicate the maximum segment size (MSS) in this field. The default segment size is 536 bytes.
Padding (8 bits) : If the Options field is not a multiple of 32 bits in length, enough zeroes are added to pad the header so it is a multiple of 32 bits.
18
TCP Connection Termination A TCP connection is normally terminating using a special procedure where each side independently closes its end of the link. It normally begins with one of the application processes signalling to its TCP layer that the session is no longer needed. That device sends a FIN message to tell the other device that it wants to end the connection, which is acknowledged. When the responding device is ready, it too sends a FIN that is acknowledged; after waiting a period of time for the ACK to be received, the session is closed.
19
Fig. TCP Connection Termination Procedure This diagram shows the conventional termination procedure for a TCP session, with one device initiating termination and
20
the other responding. In this case the client initiates; it sends a FIN which is acknowledged by the server. The server waits for the server process to be ready to close and then sends its FIN, which is acknowledged by the client. The client waits for a period of time to ensure that its ACK is received, before proceeding to the CLOSED state.
User datagram protocol (UDP) is another transport layer protocol that can be run above the IP layer. In the place of TCP, UDP can be used to transport a message from one machine to another machine, using the IP as the underlying protocol. UDP provides an unreliable connectionless
21
delivery service. It is unreliable because packets may be lost, arrive out of sequence or be duplicated. It is the higher layer software that has to take care of these problems. The advantage of UDP is that it has low protocol overhead compared to TCP. A UDP message is called a user datagram.
Fig. UDP datagram format. Source port address (16 bits): Specifies the protocol port address from which data is originating. This is an optional field. If present, this is to indicate the address to which a
22
response has to be sent by the destination port. If absent, the field should contain all zeros. Destination port address (16 bits): Specifies the protocol port address to which data is intended. Message length (16 bits): Specifies the length of the user datagram, including the header and data in octets. Checksum (16 bits): Checksum calculation is optional, and can be avoided by keeping zeros in this field to reduce computational overhead. Data (variable length): The actual data of the user datagram. This user datagram is encapsulated in the IP datagram's
23
data field and then encapsulated in the frame of the datalink layer and sent over the network. Though UDP is unreliable, it reduces the protocol overhead as compared to TCP. Hence UDP is also used for voice/fax/video communication on IP networks to enable real-time transmission.
24
25