With a neat diagram explain TCP header format.

7. With a neat diagram explain UDP header format.


The TCP Header format:

Every segment begins with a fixed-format, 20-byte header. The fixed header may be followed by header options. After the options, if any, up to 65,535 – 20 – 20 = 65,495 data bytes may follow, where the first 20 refer to the IP header and the second to the TCP header. Segments without any data are legal and are commonly used for acknowledgements and control messages

Fig: The TCP Header
  • Source Port, Destination Port : Identify local end points of the connections
  • Sequence number: Specifies the sequence number of the segment.
  • Acknowledgement Number: Specifies the next byte expected.
  • TCP header length: Tells how many 32-bit words are contained in TCP header
  • URG: It is set to 1 if URGENT pointer is in use, which indicates start of urgent data.
  • ACK: It is set to 1 to indicate that the acknowledgement number is valid.
  • PSH: Indicates pushed data.
  • RST: It is used to reset a connection that has become confused due to reject an invalid segment or refuse an attempt to open a connection.
  • FIN: Used to release a connection. SYN: Used to establish connections.
  • SYN bit: to used to establish connections.
  • FIN bit: used to release a connection.
  • Window size: to tell how many bytes may be sent starting at the byte acknowledged.
  • Checksum: provided for extra reliability.
  • Urgent pointer: used to indicate a byte offset from the current sequence number at which urgent data are to be found.
  • Options:
    – To allow each host to specify the maximum TCP payload it is
    willing to accept
    – Window scale option
    – To use selective repeat instead of go back n protocol

Leave a Reply

Your email address will not be published. Required fields are marked *