Skip to content

DHCP Relay Agent Test Plan

Joe LeVeque edited this page Feb 22, 2017 · 26 revisions

Overview

This test is aimed at confirming some of the features in the isc-dhcp-relay implementation. We must insure the basic objective the dhcp relay agent is met. This involves validating that DHCP discover, offer, request, and ack packets are successfully relayed from client to server(s). We must also insure that features such as attaching an Option 82 header are supported by this agent.

PTF Test

  • Basic DHCP packet construction functions have been added to p4/ptf/testutils (dhcp discover, offer, request, ack)
  • PTF test simulates a DHCP client acquiring a lease
    • We simulate a DHCP client (a server under the ToR) booting up by manually creating DHCP packets and sending them on an interface that is part of the ToR's VLAN.
  1. Create a DHCPDISCOVER packet and send it to the ToR on an interface that is part of the ToR's VLAN. The DHCP relay should receive this packet, add and Option 82 header and forward the packet to all known DHCP servers via it's uplinks.
  2. Listen to all packets on the ToR's uplinks and count the number of forwarded DHCPDISCOVER packets to ensure one is sent to every known DHCP server.
  3. Create a DHCPOFFER packet and send it to the ToR via one of its uplinks. The DHCP relay should forward this packet to the "client" on its VLAN
  4. Listen for the DHCPOFFER on the "client's" interface to ensure it would be received
  5. Create a DHCPREQUEST packet and send it to the ToR on an interface that is part of the ToR's VLAN. The DHCP relay should receive this packet, add and Option 82 header and forward the packet to all known DHCP servers via it's uplinks.
  6. Listen to all packets on the ToR's uplinks and count the number of forwarded DHCPREQUEST packets to ensure one is sent to every known DHCP server.
  7. Create a DHCPACK packet and send it to the ToR via one of its uplinks. The DHCP relay should forward this packet to the "client" on its VLAN
  8. Listen for the DHCPACK on the "client's" interface to ensure it would be received

How To Run Test

  • ansible-playbook -i str --limit <switch-running-relay-agent> test.yml -e "ptf_host=<IP-address-of-PTF-container>" --tags=dhcp_relay --vault-password-file <path-to-vault-password-file> -vvvv
Clone this wiki locally