
The client initiates the connection and the server either accepts or rejects it. TCP communication works in Server/Client model. Ports numbers can range from 0 – 65535 which are divided as: TCP communication between two remote hosts is done by means of port numbers (TSAPs). If this field contains data less than 32-bit, padding is used to cover the remaining bits to reach 32-bit boundary. Option field is always described in 32-bit words. Options - It facilitates additional options which are not covered by the regular header. Urgent Pointer - It points to the urgent data byte if URG flag is set to 1. how much data is the receiver expecting.Ĭhecksum - This field contains the checksum of Header, Data and Pseudo Headers.
#Tcp client connection windows#
Windows Size - This field is used for flow control between two stations and indicates the amount of buffer (in bytes) the receiver has allocated for a segment, i.e.

Because packets with SYN and FIN flags have sequence numbers, they are processed in correct order. SYN - This flag is used to set up a connection between hosts.įIN - This flag is used to release a connection and no more data is exchanged thereafter.

It is used to refuse an incoming connection. RST - Reset flag has the following features: PSH - When set, it is a request to the receiving station to PUSH data (as soon as it comes) to the receiving application without buffering it. If ACK is cleared to 0, it indicates that packet does not contain any acknowledgement. URG - It indicates that Urgent Pointer field has significant data and should be processed.ĪCK - It indicates that Acknowledgement field has significance. If SYN bit is set to 1, ECE means that the device is ECT capable. If SYN bit is clear to 0, then ECE means that the IP packet has its CE (congestion experience) bit set. NS - Nonce Sum bit is used by Explicit Congestion Notification signaling process.ĬWR - When a host receives packet with ECE bit set, it sets Congestion Windows Reduced to acknowledge that ECE received.

Reserved (3-bits) - Reserved for future use and all are set zero by default. Sequence Number (32-bits) - Sequence number of data bytes of a segment in a session.Īcknowledgement Number (32-bits) - When ACK flag is set, this number contains the next sequence number of the data byte expected and works as acknowledgement of the previous data received.ĭata Offset (4-bits) - This field implies both, the size of TCP header (32-bit words) and the offset of data in current packet in the whole TCP segment. Source Port (16-bits) - It identifies source port of the application process on the sending device.ĭestination Port (16-bits) - It identifies destination port of the application process on the receiving device. The length of TCP header is minimum 20 bytes long and maximum 60 bytes. it can perform roles of both receiver and sender.

TCP operates in Client/Server point-to-point mode. TCP provides flow control and quality of service. TCP provides error-checking and recovery mechanism. TCP requires that connection between two remote points be established before sending actual data. TCP ensures that the data reaches intended destination in the same order it was sent. That is, the receiver always sends either positive or negative acknowledgement about the data packet to the sender, so that the sender always has bright clue about whether the data packet is reached the destination or it needs to resend it. It is most widely used protocol for data transmission in communication network such as internet. */ /* */ /* The message is sent after 5 seconds of wait */ /* */ /* */ /* based on Beej's program - look in the simple TCp client for further doc.The transmission Control Protocol (TCP) is one of the most important protocols of Internet Protocols suite.
