Skip to content

Tests for reference router

Neelakandan Manihatty Bojan edited this page Oct 24, 2013 · 3 revisions

The following are the tests for reference router project:

hw_arp_misses

Send packets to each interface from an external 10G NIC such that the routing table matches, but the ARP table misses. Packets should be sent to the CPU. Check ARP miss counter.

hw_badipchksum_packet

Send IP packets to each interface from an external 10G NIC with a bad IP header checksum. Check that the packets are all dropped. Check the counters. Following is the steps involved in the test.

  1. Initialize netfpga hardware.
  2. Send packet with bad IP checksum with random size from external ethernet port to router port.
  3. Get the drop counter for the router port.
  4. Check that drop counter matches the packets sent.
  5. Repeat test for other router port.

hw_invalidttl_packet
Send packets to each interface from an external 10G NIC with IP time-to-live=1 or 0. Packets should be sent to the CPU. Check the counters.

  1. Initialize netfpga hardware.
  2. Send packet with TTL = 0x0 with random size from external ethernet port to router port.
  3. Check that packet are forwarded to CPU.
  4. Get the drop counter for the router port.
  5. Check that drop counter is same as the number of packets sent.
  6. Repeat test for other router port.

hw_ipdestfilter_hit Send packets to each interface from an external 10G NIC destined to IP addresses in the destination IP filter table (such as the router's IP addresses). Packets should be sent to the CPU. Check the counters.

hw_lpm_generic Insert two entries in the table with one entry being a subnet of the other. Send packets matching the longer prefix and check that it was received on the correct interface.

hw_lpm_misses

Send packets to each interface from an external card to an IP address that does not match in the routing table. Packets should be sent to the CPU. Check LPM miss counter.

hw_lpm_nexthop

Insert an entry in the routing table with next hop 0.0.0.0 then send packets to that subnet. Check that the packets are being sent with the next hop set as the destination address.

hw_nonip_packet

Send packets to each interface from an external 10G NIC with an Ethertype that is not IP. Packets should be sent to the CPU. Check the counters.

  1. Initialize netfpga hardware.
  2. Send packet with EtherType= 0x802 with random size from external ethernet port to router port.
  3. Get the drop counter for the router port.
  4. Check that packet are forwarded to CPU.
  5. Check that drop counter matches the number of packets sent.
  6. Repeat test for other router port.

hw_nonipv4_packet

Send packets to each interface from an external 10G NIC with either IP header options or version other than 4. Packets should be sent to the CPU. Check the counters.

  1. Initialize netfpga hardware.
  2. Send packets with IP_Version = 0x5 with random size from external ethernet port to router port.
  3. Check that packet are forwarded to CPU.
  4. Get the drop counter for the router port.
  5. Check that drop counter matches the expected number of packets.
  6. Repeat test for other router port.

hw_packet_forwarding

Send packets to each eth1 with the routing table and arp table entries to route the traffic to eth2. Send packets to each eth2 with the routing table and arp table entries to route the traffic to eth1. This generates a routing table and an ARP table hit.

hw_router_table

hw_wrong_destMAC Send packets to each interface from an external 10G NIC with MAC addresses that do not match the ports they are received on. Check the counters.

  1. Initialize netfpga hardware.
  2. Send 300 packet with wrong DA with random size from external ethernet port to router port.
  3. Get the drop counter for the router port.
  4. Check that drop counter matches the number of packets send with wrong destination MAC.
  5. Repeat test for other router port.
Clone this wiki locally