Ques : Describe TCP header

, , No Comments

 1) Source Port Number: This is a 16-bit number which defines the source port

number for a particular application program that is sending the TCP segments.

2) Destination Port Number: This is a 16-bit number which defines the
destination port number for a particular application program that is receiving the
TCP segments.

3) Sequence Number: As the unit of data transfer in TCP is termed as segment,
each segment’s first data byte number denotes the 32-bit sequence number. Since
the sequence number refers to a byte count rather than a segment count, sequence
numbers in contiguous TCP segments are not numbered sequentially. For
example, if a file of 5000 bytes is transferred using TCP connection and the first
byte is numbered as 20002 and data divided into 5 segments each of 1000 bytes,
the sequence numbers assigned to various segments are as under:

Segment 1  sequence number: 20002
Segment 2  sequence number: 21002
Segment 3  sequence number: 22002
Segment 4  sequence number: 23002
Segment 5  sequence number: 24002

4) Acknowledgement Number: This is used by the sender to acknowledge the
received data. This 36-bit field indicates the sequence number of the next byte
expected from the receiver. For example, if host A has sent a segment having
sequence number 2000 to host B, host B would send an acknowledgement with
acknowledgement number field set to 2001 (one plus the sequence number of last
received segment).

5) Header Length: The HLEN field consists of 4 bits. It indicates the length of the
TCP header. The length of the TCP header can be between 20 bytes to 60 bytes
i.e., HLEN field can have binary values ranging from 0101-1111 (5 to 15, 32 bit
words) (5 x 4 =20, 15 x 4 =60).

6) Reserved: This 6 bit field is reserved for future use. The value set in this field
must be zero.

7) Control Flags: This field contains six different control flags that can control
certain aspects of the TCP connection such as connection establishment,
connection termination and flow control. The flags include:

a) Urgent Pointer URG: When set, the ACK indicates that the current segment
contains urgent (or high-priority) data and that the Urgent Pointer field value
is valid.

b) Acknowledgement (ACK): When set, indicates that the value contained in
the Acknowledgement Number field is valid. This bit is usually set, except
during the first message during connection establishment.

c) Push (PSH): PSH is used when the transmitting application wants to force
TCP to immediately transmit the data that is currently buffered to the
application without waiting for the buffer to fill. It is useful for transmitting
small units of data.

d) Reset (RST): When set, RST immediately terminates the end-to-end TCP

e) Synchronize (SYN): SYN is set in the initial segments used to establish a
connection, indicating that the segments carry the initial sequence number.

f) Finish (FIN): FIN is set to request normal termination of the TCP connection
in the direction this segment is travelling. Complete closure of the connection
requires one FIN segment in each direction.

8) Window Size: The window size 16 bits field is used for flow control. It contains
in bytes, the size of the window that the receiver has to maintain i.e., the value of
the receive window size. It is basically the number of transmitted bytes that the
sender of this segment is willing to accept from the receiver.

9) Checksum: This is a 16-bit field that provides bit error detection for the segment
(including the header and data).

10) Urgent Pointer: Urgent data is information that has been marked as high-priority
by a higher layer application. The data sent under high-priority usually bypasses
the normal TCP buffering and is placed in a segment between the header and
normal data. When the URG flag of control flag is set, then the urgent pointer 16-
bit number indicates the position of the first octet of non-priority data in the

11) Options: The option field contains 40 bytes of optional information about
connection establishment. The maximum segment size (MSS) is the most
commonly used option and if absent, defaults to an MSS of 536. Another option
is Selective Acknowledgement (SACK), which allows out-of-sequence segments
to be accepted by a receiver. The further discussion about options is beyond the
scope of this book.

Characteristics of TCP
The basic characteristics of TCP are as follows:
1) It employs a connection-oriented service for communication.
2) It is a reliable source of communication i.e. guarantees delivery of messages.
3) It splits the messages into segments and keeps track of the order (sequence) of
4) It employs the checksums for detecting any errors in data as well as the TCP

0 टिप्पणियाँ:

Post a Comment