These features are available in ONOS 1.11.1


Indirect host support for V4

DHCP relay can support hosts which not directly connect to Trellis network. These hosts usually connected to another DHCP relay, the DHCP relay will forward DHCP packet to Trellis network with valid DHCP relay agent option (option 82).

DHCP Relay application checks relay agent option and determine the DHCP packet comes from direct or indirect host.

 

ONOS uses circuit id option in relay agent option with specific format if DHCP packet comes without relay agent option, the format of circuit will be: ConnectPoint:VlanId

For example, the DHCP request/discover packet comes from of:000000000000001/1 with vlan 100, the circuit ONOS put will be of:000000000000001/1:100 and send DHCP packet to DHCP server.

Indirect host won't put into host store, DHCP relay app will put IP address of indirect host to the route store, and use IP address of relay agent as next hop.

Indirect Host support for V6

A packet from Client side is checked against  

DHCP relay store, CLI

New DHCP relay application will stores information from DHCP packet which processed by the app, administrator can use CLI to query these information.

The store provides these functionality:

  1. Latest state of DHCP client (e.g. client location, last seen time, DHCP type...), for debugging purpose
  2. For direct host, ONOS can find location and vlan from relay agent option, however, for indirect host, ONOS need to query last state from the store to find correct destination.

DHCPv6 configuration and Multi-Server Configuration for HA

New DHCP relay application supports different server for direct host and indirect host. 

HA can be achieved by specifying addtional server configuration objects. Client initiated packets like SOLICIT or REBIND shall be replicated and sent to each server object, (Currently, dhcpv6 is implemented)

Below is an example of new configuration:

DHCP relay config
{
   "apps" : {
       "org.onosproject.dhcprelay" : {
           "default": [
               {
                   "dhcpServerConnectPoint": "of:0000000000000205/5",
                   "serverIps": ["10.0.3.252", "2002:4::253"],
                   "gatewayIps": ["10.0.3.100","2001:3::100"],
                   "relayAgentIps": {
                       "of:0000000000000204": {
                           "ipv4": "10.0.2.254",
                           "ipv6": "2001:2::254"
                       }
                   }
               },
               {
                   "dhcpServerConnectPoint": "of:0000000000000206/3",
                   "serverIps": ["2002:5::253"],
                   "gatewayIps": ["2001:4::100"],
                   "relayAgentIps": {
                       "of:0000000000000204": {
                           "ipv4": "10.0.2.254",
                           "ipv6": "2001:2::254"
                       }
                   }
                }
            ],
            "indirect": [
                {
                    "dhcpServerConnectPoint": "of:0000000000000205/5",
                    "serverIps": ["10.0.3.252", "2002:4::253"],
                    "gatewayIps": ["10.0.3.100", "2001:3::100"],
                    "relayAgentIps": {
                        "of:0000000000000204": {
                            "ipv4": "10.0.2.254",
                            "ipv6": "2001:2::254"
                        }
                    }   
                },
                {
                    "dhcpServerConnectPoint": "of:0000000000000205/5",
                    "serverIps": ["10.0.3.252", "2002:5::253"],
                    "gatewayIps": ["10.0.3.100", "2001:3::100"],
                    "relayAgentIps": {
                        "of:0000000000000204": {
                            "ipv4": "10.0.2.254",
                            "ipv6": "2001:2::254"
                        }
                    }
                },
                {
                    "dhcpServerConnectPoint": "of:0000000000000206/3",
                    "serverIps": ["2002:5::253"],
                    "gatewayIps": ["2001:4::100"],
                    "relayAgentIps": {
                        "of:0000000000000204": {
                            "ipv4": "10.0.2.254",
                            "ipv6": "2001:2::254"
                        }
                    }
                },
                {
                    "dhcpServerConnectPoint": "of:0000000000000206/3",
                    "serverIps": ["2002:4::253"],
                    "gatewayIps": ["2001:4::100"],
                    "relayAgentIps": {
                        "of:0000000000000204": {
                            "ipv4": "10.0.2.254",
                            "ipv6": "2001:2::254"
                        }
                    }
                }
            ]
        }
    }
}

 

If indirect server configuration is not configured, the app will use default configuration for all cases.

For each server configuration, should contains dhcpServerConnectPoint, serverIps. gatewayIps is optional.

DHCP server config
{
      "dhcpServerConnectPoint": "of:0000000000000002/2",
      "serverIps": ["172.168.10.2", "2000::200:1"],
      "gatewayIps": ["192.168.10.254", "1000::100:1"]
}

 

  • dhcpServerConnectPoint: represent the location of DHCP server
  • serverIps: IP address of the DHCP server, contains at least one IP address of DHCP server, IP address can be IPv4 or IPv6 for different version of DHCP. Will use first address if multiple IPv4 or IPv6 address configed
  • gatewayIps: Optional config, should be configured if the DHCP server is not directly connected to the Trellis network, it tells which gateway we need to send to reach the server.

Relay agent address overwriting

The DHCP relay can overwrite the relay agent address (giaddr in DHCPv4, link-addr in DHCPv6) in DHCP message for different device.

Will not overwrite the relay agent address if not configured.

Users can add relayAgentIps to server config:

Relay agent address overwrite
{
  "dhcpServerConnectPoint": "of:0000000000000002/2",
  "serverIps": ["172.168.10.2", "2000::200:1"],
  "gatewayIps": ["192.168.10.254", "1000::100:1"],
  "relayAgentIps": {
    "of:0000000000000001": {
      "ipv4": "10.0.0.10",
      "ipv6": "2000::10"
    },
	"of:0000000000000002": {
      "ipv4": "10.0.1.10",
      "ipv6": "2000::1:10"
    }
 }
}

 

If relayAgentIps configed, the app will overwrite giaddr/Link address before it forward the DHCP message to the server.

 

Dhcp V6 Counters

There are two Dhcp V6 packet counters which are Host basis counters and Global counters. Host basis counters count and record dhcp v6 packets received on this host. It can be displayed by "dhcp-relay counter". These counters can be reset by typing "dhcp-relay counter reset".

onos> dhcp-relay counter
DHCP Relay Counters :
Counters for id=00:AA:BB:00:00:01/None, locations=[of:0000000000000204/3]
SOLICIT                         ............................  4    packets
REQUEST                         ............................  4    packets
ADVERTISE                       ............................  4    packets
RENEW                           ............................  1000 packets
REPLY                           ............................  1004 packets
Counters for id=00:AA:00:00:00:01/None, locations=[of:0000000000000205/3][D]
SOLICIT                         ............................  2    packets
REQUEST                         ............................  2    packets
ADVERTISE                       ............................  2    packets
RENEW                           ............................  500  packets
CONFIRM                         ............................  2    packets
REPLY                           ............................  500  packets


 
onos> dhcp-relay counter reset

Global counters counts and records all dhcp v6 packets received in onos.  It can be displayed by "dhcp-relay-agg-counters". These counters can be reset by typing "dhcp-relay-agg-counters  reset".

onos> dhcp-relay-agg-counters 
DHCP Relay Aggregate Counters :
SOLICIT                         ............................  12   packets
REQUEST                         ............................  12   packets
ADVERTISE                       ............................  12   packets
REBIND                          ............................  4    packets
RENEW                           ............................  3026 packets
CONFIRM                         ............................  4    packets
REPLY                           ............................  3044 packets


onos> dhcp-relay-agg-counters reset

Dhcp V6 timer expiration cleans up Address and PD prefix 

Dhcp v6 relay cleans up stale ip address and pd prefix based on timer whose  default interval is 24 hours (24 * 3600 secs = 86400 secs). If the preferred life time of ip address or pd prefix exceeds 1/2 of  poll interval, they will be removed from onos. The poll interval can be modified by "cfg set org.onosproject.dhcprelay.DhcpRelayManager dhcpPollInterval <newVal>".

onos> cfg get  org.onosproject.dhcprelay.DhcpRelayManager
org.onosproject.dhcprelay.DhcpRelayManager
    name=dhcpPollInterval, type=integer, value=86400, defaultValue=86400, description=dhcp relay poll interval
 
onos> cfg set org.onosproject.dhcprelay.DhcpRelayManager dhcpPollInterval 60

onos> cfg get  org.onosproject.dhcprelay.DhcpRelayManager
org.onosproject.dhcprelay.DhcpRelayManager
    name=dhcpPollInterval, type=integer, value=60, defaultValue=86400, description=dhcp relay poll interval

Ignoring DHCP relay on a Particular VLAN

In some cases, it may be necessary to avoid punting DHCP packets to the controller, and letting them be forwarded normally through the data plane. In such cases, the DHCP-relay application can be configured to avoid punting DHCP packets on a particular VLAN on a particular switch. 

 "apps" : {
        "org.onosproject.dhcprelay" : {
		
		...
		    "ignoreDhcp" : [
				{ "deviceId": "of:0000000000000205", "vlan":24 },
				{ "deviceId": "of:0000000000000206", "vlan":24 }
		    ]
        },
 
		...
}

 

In the example shown above, DHCP packets on vlan 24 are not punted to the controller from switches of:205 and of:206