Skip to content

Instantly share code, notes, and snippets.

@vibhavp
Created August 13, 2018 19:35
Show Gist options
  • Save vibhavp/9c55936b500ed0eccf237bdc0cc19d76 to your computer and use it in GitHub Desktop.
Save vibhavp/9c55936b500ed0eccf237bdc0cc19d76 to your computer and use it in GitHub Desktop.
GSoC 2018 Summary

nwpd is a userspace daemon for the Neighborhood Watch Protocol, an address resolution protocol for XIA. nwpd's consists of 8 main files:

  • config.c: Consists of function for reading configuration files, and command line options, and writing them to the global nwpd_config.

  • log.c: Functions for logging.

  • monitor.c: Implements the monitoring system. The main variable here is hosts_table, a hash table mapping Ethernet addresses to a host_clock structure, that stores a bunch of monitoring related data. Every given period of time (monitor.ping-period), monitor_start_ping_process will select a random host, and attempt to send it a ping packet. If the host doesn't receive an ack in a given amount of time (monitor.ack-timeout), monitor_on_ack_timeout will select investigate-neighbor-count hosts on the network, and send them investigative ping requests. Further, if no investigative ack is received in monitor.investigate-ack-timeout seconds, the offending host will be removed as a neighbor.

  • neigh.c: Contains the function modify_neighbor and modify_route, which help add and remove neighbor and route entries, respectively. A neighbor is a main route in the Ether principal module, while a route from an AD XID to an Ether XID.

  • nwp.c: Contains functions for reading and validating NWP structures from provided buffers.

  • rtnl.c: Helper rtnetlink functions for communicating with the XIA kernel. Uses libmnl.

  • timer.c: Helper functions for working with POSIX timers (SIGEV_THREAD).

  • nwpd.c: Functions for sending base NWP packets (announce, neighbor list), and listening on a hardware interface for NWP packets (ether_receiver).

Configuration

nwpd can be configured either by command line options (a complete list of options available by typing nwpd -h), or a config file provided with the flag -c. An example config file is provided with the source code in the file example.conf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment