IP packet structure
|0||Version||Header length||Differentiated Services||Total Length|
|64||Time to Live||Protocol||Header Checksum|
The header consists of 13 fields, of which 12 are required. The 13th field is optional (red background in table) and aptly named: options.
IP is the primary protocol in the Network Layer (Layer 3) of the OSI Model and has the task of delivering packets from the source host to the destination host solely based on their addresses. IP is considered a best-effort protocol because IP does not provide acknowledgement of the data delivery. Its service can also be characterized as unreliable. In network architectural language it is a connection-less protocol, in contrast to so-called connection-oriented protocols such as TCP and Frame Relay.
ICMP packet structure
The ICMP header starts after bit 160 of the IP header (unless IP options are used). Although ICMP messages are contained within standard IP datagrams, ICMP messages are usually processed as a special case.
ICMP messages are constructed from a normal IP datagram that has generated an ICMP response. IP encapsulates the appropriate ICMP message with a new IP header to get the ICMP message back to the original sending host and transmits the resulting datagram in the usual manner.
ICND1 and ICND2 break down