Link Selection sub-option for the Relay Agent Information Option for DHCPv4
Extracted elements (15)
The link-selection sub-option was created because the giaddr field in DHCP serves a dual purpose: specifying both the subnet/link on which the client resides and the IP address for communicating with the relay agent. When these two functions need to be separated (e.g., when IP Y is not reachable from the DHCP server due to firewalls or point-to-point links), a new mechanism is required.
The relay agent adds the link-selection sub-option whenever it sets the giaddr value (i.e., on all messages relayed to the DHCP server), ensuring the subnet/link context is always conveyed alongside the giaddr communication address.
The sub-option encodes a subnet address (not a host address) by zeroing the host bits via ANDing with the subnet mask. This uniquely identifies the subnet while allowing the server to consider all related subnets on the same link, consistent with existing giaddr processing in RFC 2131 Section 4.3.1.
Administrative techniques must be used to ensure that any relay agent employing this sub-option is directed to only send packets to a server that supports this sub-option, since a non-supporting server would ignore it and allocate incorrectly.
Support for the link-selection sub-option does not require changes to other DHCP server operations; for example, handling of DHCPDISCOVER for an unknown subnet should continue to operate unchanged.
A relay agent that uses the link-selection sub-option MUST assume the server supports the sub-option and MUST NOT take different actions based on whether this sub-option appears or does not appear in the response packet from the server.
The IP address to which a DHCP server sends a reply MUST be the same as it would choose when the link-selection sub-option is not present; the sub-option does not change the server's reply destination.
When allocating an address and the link-selection sub-option is present, the DHCP server MUST allocate the address on either the subnet specified in the sub-option or a subnet on the same link (network segment) as the specified subnet.
When both a subnet-selection option (RFC 3011) and a link-selection sub-option are present in a packet, the information in the link-selection sub-option MUST be used to control IP address allocation in preference to the subnet-selection option.
When the link-selection sub-option is present and the server supports it, the server MUST NOT offer an address that is not on the requested subnet or the link (network segment) associated with that subnet.
The link-selection sub-option is sub-option 5 within the DHCP Relay Agent Information Option (RFC 3046). It contains a single IP address representing a subnet, computed by ANDing any address on the subnet with its subnet mask, leaving network/subnet bits intact and zeroing host bits.
IANA assigned sub-option code 5 from the DHCP Relay Agent sub-options space (RFC 3046) for the link-selection sub-option defined in this document.
A trusted relay agent supporting the relay-agent-info option MUST discard packets it receives with a zero giaddr and a relay-agent-info option when the packet arrives on an untrusted circuit (per RFC 3046 Section 2.1), providing minor protection against address-pool exhaustion attacks via this sub-option.
The link-selection sub-option allows a malicious DHCP client to perform a more complete address-pool exhaustion attack than without it, since the client is no longer restricted to attacking address pools on its local subnet. This is analogous to the risk introduced by the subnet-selection option (RFC 3011).
The link-selection sub-option wire format consists of a SubOpt field (value 5, 1 octet), a Len field (value 4, 1 octet), and a 4-octet subnet IP address (a1-a4). Total length is 6 octets.