

After that, there is an acknowledgment number, also 32 bits long, which allows for verification that it is coming from the right machine. This is one of the fault-tolerant aspects of TCP sessions. This is used to reassemble the packets in the right order at the other end, even if they arrive in a different order. The next line contains a sequence number. The port numbers, as mentioned earlier, identify which program the packets need to be directed to on the remote machine and identify the session on the local machine. (It is interesting how all these seemingly arbitrary numbers always have a basis in something.) This is why the port numbers can only go up to 65,535-because the port number field in TCP/IP is a 16-bit binary number and 2 16 power equals 65,536, or 0–65,565. It is usually 20 bytes long and starts with a source port number of 16 bits and a destination port number of 16 bits. The TCP header takes care of establishing a TCP session and higher-level functions. Finally, there are the source and destination IP addresses, and an options field that can be variable length or padded with zeros and any data. The next two lines deal with identification of the packet and a checksum to make sure that it is valid. The last part of this line is the total length of the header, which is normally the same from packet to packet (20 bytes), but can vary for newer protocols like IPv6. Then there are the Header Length and the Type Of Service settings (TOS), which allow for differentiating in the priority of packets. But for now, you will mostly see IPv4 packets.

IPv6 also resolves the security and verification issues with IPv4. This should create enough addresses to solve any foreseeable address space needs. IPv6 is supposed to solve the IP address space problem by allowing up to 128 bits for the address portion. Most networks uses IP version 4 (IPv4), but a newer 128-bit IP system called IP version 6 (IPv6) has been circulating for several years and has been gradually gaining acceptance. The first line contains several switches that identify the IP version. The first part of the header contains various switches and options for the packet. Since each address is 32 bits (4 octets of 8 bits each), the source and destination IP address takes up 8 bytes. The IP protocol header contains the delivery address for the packet and its sender. Let's look at the IP portion first, since this is the lowest layer of the network model. Both header types are at least 20 bytes long and are usually shown in 32-bit (4-byte) sections with the addresses, options, and other settings for the session.
Ip packet sender full#
You can find the full text of these RFCs online at Figure 6.1 is a graphical representation of TCP and IP headers. The layout of the TCP/IP packet is specified in RFC 793 for the TCP portion and RFC 791 for the IP portion. This section describes the contents of a TCP/IP packet header so you can understand what you see in the Tcpdump display.
