2

I would like to add (or piggyback on an existing not used) a custom option to the IP header. I've full control of the IP stack at both end points, but I've no control on all the hops in the route (could be the public Internet).

Is it standards? Assuming I'm doing everything correctly, that I set IHL field correctly, how would a typical router treat packets with IP header larger than 20 bytes?

1
  • You cannot expand the existing options unless you detach from existing TCP/IP installations in total (and shouldn't call that IP any more), or accept that a stray router removes your options from a packet or rejects it altogether. New options need to be registered with IANA. However, I'd suggest you tell us more on what you're actually trying to accomplish - there's likely a better way to do it.
    – Zac67
    Mar 22, 2022 at 14:47

1 Answer 1

3

IPv4 header options must be implemented by all the gateways (routers) in the path of the packets. RFC 791, Internet Protocol explains all about the options, including:

The options may appear or not in datagrams. They must be implemented by all IP modules (host and gateways).

-and-

The options are optional in each datagram, but required in implementations. That is, the presence or absence of an option is the choice of the sender, but each internet module must be able to parse every option.

-and-

Every internet module must be able to act on every option.

Remember that Internet modules include the network stacks in intermediate devices, e.g. routers. Creating a custom option would require that you modify all the routers in the path to recognize your custom option.

In the modern world, options on IP packets are nearly extinct, but routers deal with packets that have options defined by RFC 791. Some companies will block packets with options.

Your Answer

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

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