Taiwan Quality Remote Support

Fiberbit Self Study Blog, Shortening Your Learning Curve Regular articles for fiber networks, Networking and Technology.

TCP (Transmission Control Protocol) Segments and Fields

December 25, 2013
admin
Posted in:
Share

TCP is providing data delivery services while being located in Transport layer of OSI and TCP/IP models. TCP requires established connection before the data transmission begin, so it is called connection -oriented subprotocol. TCP is ensuring connection is established before transmission.

 TCP segment

Figure 1. A TCP segment

TCP is providing reliable data delivery with the help of sequencing and checksums. Without TCP data would be send without knowledge if recipient receive it. TCP ensures data is not corrupted and successfully delivered to the destination node.

Another task of TCP is flood control it is controlling that node is not flooded with data. TCP segment is shown in Figure 1. It will be encapsulated by the Network layers IP packet. Explanation of TCP segment parts is in Table 1.

Table 1.Fields in a TCP segment

Field Length Function
Source 16 bits Indicates the port number at the source node. A port number is the address on a host when an application makes itself available to incoming or outgoing data.
Destination Port 16 bits Indicates the port number at the destination node.
Sequence number 32 bits Identifies the data segment’s position in the stream of data segments already sent.
Acknowledgement number (ACK) 32 bits Confirms receipt of the data via a return message to the sender.
TCP header length 4 bits Indicates the length of the TCP header.
Reserved 6 bits A field reserved for later use
Flags 6 bits A collection of six 1-bit fields that signal special conditions through flags. The following flags are available for the sender’s use:
    URG-If set to 1, the Urgent pointer field contains information for the receiver.
    ACK-If set to 1, the Acknowledgment field contains information for the receiver. (If set to 0, the receiver will ignore the Acknowledgment Field.
  PSH-If set to 1, it indicates that data should be sent to an application without buffering.
    RST- If set to 1, the sender is requesting that the connection be reset.
    SYN-If set to 1, the sender is requesting a syn chronization of the sequence numbers between the two nodes. This code is used when TCP requests a connection to set the initial sequence number.
    FIN-IF set to 1, the segment is the last in a sequence and the connection should be closed.
Sliding-

window size(or window)

16 bits Indicates how many bytes the sender can issue to a receiver while acknowledgment for this segment is outstanding. This field performs flow control, preventing the receiver from being deluged with bytes. For example, suppose a server indicates a sliding window size of 4000 bytes. Also suppose the client has already issued 1000 bytes, 250 of which have been received and acknowledged by the server. That means that the server is still buffering 750 bytes. Therefore, the client can only issue 3250 additional bytes before it receives acknowledgment from the server for the 750 bytes.
Checksum 16 bits Allows the receiving node to determine whether the TCP segment became corrupted during transmission.
Urgent pointer 16 bits Indicates a location in the data field where urgent data resides.
Options 0-32 bits Specifies special options, such as the maximum segment size a network can handle.
Padding Variable Contains filler information to ensure that the size of the TCP header is a multiple of 32 bits.
Data Variable Contains data originally sent by the source node. The size of the Data field depends on how much data need to be transmitted, the constraints on the TCP segment size imposed by the network type, and the limitation that the segment must fit within an IP packet.

Computer receives TCP in hexadecimal numbers. As long as TCP/IP standards are follow – it will be recognized by the receiver.

TCP segments are establishing connection between two computers as shown in Figure 2. Three segments are required for successful connection. As shown in Figure 2 these are the three steps:

  • Computer A is sending message to Computer B. This TCP segment has SYN bit set and a random number used for SEQ(A) synchronization.

  • Computer B responds with SYN and ACK bits set. It also adds new information to the message. New SEQ(B) is randomly generated. ACK=SEQ(A)+1 and is used to inform computer B that it is ready to communicate.

  • Computer A confirms communication with the Computer B by sending ACK=SEQ(A) and ACK(B)=SEQ(B)+1

Establishing a TCP connection

Communication continues until FIN bit is set in TCP segment. This bit indicates end of transmission. There is another protocol used for Transport layer that is less complicated – UDP.

Share
Share
Subscribe via RSS

Stay In Touch on Google+ !

Tags

Archives

Recent Posts

Featured Post

INFOGRAPHIC: Differences between FBT and PLC splitters

Why Choose Us?

YouTube