Skip to content
Tom Barbette edited this page Nov 25, 2022 · 3 revisions

ARPQuerier Element Documentation

NAME

ARPQuerier — Click element; encapsulates IP packets in Ethernet headers found via ARP

SYNOPSIS

ARPQuerier(IP, ETH, keywords)
ARPQuerier(NAME, keywords)

Batching: Batching natively supported
Ports: 2 inputs, 1-2 outputs
Processing: push

DESCRIPTION

Handles most of the ARP protocol. Argument IP should be this host's IP address, and ETH should be this host's Ethernet address. (In the one-argument form, NAME should be shorthand for both an IP and an Ethernet address; see AddressInfo.)

Packets arriving on input 0 should be IP packets, and must have their destination address annotations set. If an Ethernet address is already known for the destination, the IP packet is wrapped in an Ethernet header and sent to output 0. Otherwise the IP packet is saved and an ARP query is sent instead. If an ARP response arrives on input 1 for an IP address that we need, the mapping is recorded and any saved IP packets are sent.

The ARP reply packets on input 1 should include the Ethernet header.

ARPQuerier may have one or two outputs. If it has two, then ARP queries are sent to the second output.

ARPQuerier implements special behavior for 0.0.0.0, 255.255.255.255, multicast addresses, and, if specified, any BROADCAST address. Packets addressed to 0.0.0.0 are dropped. Packets for broadcast addresses are forwarded with destination Ethernet address FF-FF-FF-FF-FF-FF. Multicast IP addresses are forwarded to 01-00-5E-xx-yy-zz, where xx-yy-zz are the lower 23 bits of the multicast IP address, as specified in RFC1112.

Keyword arguments are:

  • TABLE — Element. Names an ARPTable element that holds this element's corresponding ARP state. By default ARPQuerier creates its own internal ARPTable and uses that. If TABLE is specified, CAPACITY, ENTRY_CAPACITY, ENTRY_PACKET_CAPACITY, and TIMEOUT are ignored.
  • CAPACITY — Unsigned integer. The maximum number of saved IP packets the table will hold at a time. Default is 2048.
  • ENTRY_CAPACITY — Unsigned integer. The maximum number of ARP entries the table will hold at a time. Default is 0, which means unlimited.
  • ENTRY_PACKET_CAPACITY — Unsigned integer. The maximum number of saved packets the table will hold for any given ARP entry at a time. Default is 0, which means unlimited.
  • TIMEOUT — Amount of time before an ARP entry expires. Defaults to 5 minutes.
  • POLL_TIMEOUT — Amount of time after which ARPQuerier will start polling for renewal. 0 means don't poll. Defaults to one minute.
  • BROADCAST — IP address. Local broadcast IP address. Packets sent to this address will be forwarded to Ethernet address FF-FF-FF-FF-FF-FF. Defaults to the local broadcast address that can be extracted from the IP address's corresponding prefix, if any.
  • BROADCAST_POLL — Boolean. If true, then send broadcast ARP polls (where an entry is about to expire, but hasn't expired yet). The default is to send such polls unicast to the known Ethernet address. Defaults to false.

EXAMPLES

   c :: Classifier(12/0806 20/0002, 12/0800, ...);
   a :: ARPQuerier(18.26.4.24, 00:00:C0:AE:67:EF);
   c[0] -> a[1];
   c[1] -> ... -> a[0];
   a[0] -> ... -> ToDevice(eth0);

NOTES

If a host has multiple interfaces, it will need multiple instances of ARPQuerier.

ARPQuerier uses packets' destination IP address annotations, and can destroy their next packet annotations. Generated ARP queries have VLAN TCI annotations set from the corresponding input packets.

ARPQuerier will send at most 10 queries a second for any IP address.

ELEMENT HANDLERS

  • ipaddr (read/write) — Returns or sets the ARPQuerier's source IP address.
  • broadcast (read-only) — Returns the ARPQuerier's IP broadcast address.
  • table (read-only) — Returns a textual representation of the ARP table. See ARPTable's table handler.
  • stats (read-only) — Returns textual statistics (queries and drops).
  • queries (read-only) — Returns the number of queries sent.
  • responses (read-only) — Returns the number of responses received.
  • drops (read-only) — Returns the number of packets dropped.
  • count (read-only) — Returns the number of entries in the ARP table.
  • length (read-only) — Returns the number of packets stored in the ARP table.
  • insert (write-only) — Add an entry to the ARP table. The input string should have the form "IP ETH".
  • delete (write-only) — Delete an entry from the ARP table. The input string should be an IP address.
  • clear (write-only) — Clear the ARP table.

SEE ALSO

ARPTable, ARPResponder, ARPFaker, AddressInfo

Generated by click-elem2man from ../elements/ethernet/arpquerier.hh:12 on 2022/11/25.

Clone this wiki locally