What is the structure of a UDP header?
Source port- UDP port of sending host
Destination Port- UDP port of destination host
Message Length- Size of UDP packet
Checksum- Ensures validity of packet
Header size is 8 bytes
What is the structure of a TCP header?
Source and Destination port.
Sequence number- Allows the receiver to rebuild the message correctly and deal with out-of-order packets.
Ack number- The sequence number of the next segment expected from the other host
Data length- length of TCP segment
Flags-Type of content in the segment (ACK, SYN, FIN, and so on).
Window- Amount of data a host is willing to receive before sending another acknowledgement
Checksum- Ensures validity of the segment
Urgent Pointer- If urgent data is being sent, this specifies the end of that data in the segment.
Options- Allows further connection parameters to be configured.
Header size is 20 bytes or more.