RFC 3442 and classless static routes

Philip Prindeville philipp_subx at redfish-solutions.com
Sun Apr 8 23:22:08 UTC 2018

It would be nice to have support for RFC-3442, but looking at this section of the specification (below), I can’t think of an easy way to represent an IPv4 address trimmed of trailing octets (i.e. so that only the subnet significant octets are sent).

Therefore, it looks like this couldn’t be done without introducing a new “format code” which would take an IPv4 subnet/prefix pair and mangle them appropriately.

Am I missing anything?



Classless Route Option Format

   The code for this option is 121, and its minimum length is 5 bytes.
   This option can contain one or more static routes, each of which
   consists of a destination descriptor and the IP address of the router
   that should be used to reach that destination.

    Code Len Destination 1    Router 1
   | 121 | n | d1 | ... | dN | r1 | r2 | r3 | r4 |

    Destination 2       Router 2
   | d1 | ... | dN | r1 | r2 | r3 | r4 |

   In the above example, two static routes are specified.

   Destination descriptors describe the IP subnet number and subnet mask
   of a particular destination using a compact encoding.  This encoding
   consists of one octet describing the width of the subnet mask,
   followed by all the significant octets of the subnet number.

   The width of the subnet mask describes the number of one bits in the
   mask, so for example a subnet with a subnet number of and
   a netmask of would have a subnet mask width of 24.

   The significant portion of the subnet number is simply all of the
   octets of the subnet number where the corresponding octet in the
   subnet mask is non-zero.  The number of significant octets is the
   width of the subnet mask divided by eight, rounding up, as shown in
   the following table:

        Width of subnet mask     Number of significant octets
                     0                     0
                  1- 8                     1
                  9-16                     2
                 17-24                     3
                 25-32                     4

   The following table contains some examples of how various subnet
   number/mask combinations can be encoded:

   Subnet number   Subnet mask      Destination descriptor
   0               0                0        8.10      16.10.17

More information about the dhcp-workers mailing list