0

RFC792:

The internet header plus the first 64 bits of the original datagram's data. This data is used by the host to match the message to the appropriate process. If a higher level protocol uses port numbers, they are assumed to be in the first 64 data bits of the original datagram's data.

RFC1812 4.3.2.3 Original Message Header:

Historically, every ICMP error message has included the Internet header and at least the first 8 data bytes of the datagram that triggered the error. This is no longer adequate, due to the use of IP-in-IP tunneling and other technologies. Therefore, the ICMP datagram SHOULD contain as much of the original datagram as possible without the length of the ICMP datagram exceeding 576 bytes. The returned IP header (and user data) MUST be identical to that which was received, except that the router is not required to undo any modifications to the IP header that are normally performed in forwarding that were performed before the error was detected (e.g., decrementing the TTL, or updating options). Note that the requirements of Section [4.3.3.5] supersede this requirement in some cases (i.e., for a Parameter Problem message, if the problem is in a modified field, the router must undo the modification). See Section [4.3.3.5]).

None of them specified how to handle IP datagram with less than 8 bytes user data.

MAY the implementation discard ICMP error message or pad user data to 8 bytes?

1
  • 1
    As you say, the action isn't specified. Different implementations may do different things.
    – Ron Trunk
    Commented Dec 5, 2022 at 17:28

1 Answer 1

1

I'd venture that such a packet header would be padded with zeros (which is very much the standard procedure).

However, you'd be really hard pressed to create or even run across a practical packet with less than 8 bytes of IP payload: the smallest common protocol headers riding on top of IPv4 are from UDP and ICMP, each with a header size of 8 bytes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.