IP protocal resides in Network Layer, which provide service to the Transport Layer protocals TCP and UDP.
IP packet structure
bit offset | 0–3 | 4–7 | 8–15 | 16–18 | 19–31 | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | Version | Header length | Differentiated Services | Total Length | ||||||||||||||||||||||||||||
32 | Identification | Flags | Fragment Offset | |||||||||||||||||||||||||||||
64 | Time to Live | Protocol | Header Checksum | |||||||||||||||||||||||||||||
96 | Source Address | |||||||||||||||||||||||||||||||
128 | Destination Address | |||||||||||||||||||||||||||||||
160 | Options | |||||||||||||||||||||||||||||||
160 or 192+ | Data |
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.
Bits | 160-167 | 168-175 | 176-183 | 184-191 |
---|---|---|---|---|
160 | Type | Code | Checksum | |
192 | ID | Sequence |
ICND1 and ICND2 break down
[...] was written by Mike Muuss in December, 1983. It sends a small packet of information containing an ICMP ECHO_REQUEST to a specified computer, which then sends an ECHO_REPLY packet in return. [...]
ReplyDelete