From Nsnam
Jump to: navigation, search

Main Page - Current Development - Developer FAQ - Tools - Related Projects - Project Ideas - Summer Projects

Installation - Troubleshooting - User FAQ - HOWTOs - Samples - Models - Education - Contributed Code - Papers

Back to GSoC 2022 projects

Project Overview

  • Project Name: Perfect ARP and NDP
  • Student: Zhiheng Dong
  • Mentors: Tommaso Pecorella, Ameya Deshpande, Manoj Kumar Rana
  • Google page:
  • Project Goals: The project aims to implement a “Perfect” version of ARP and NDP which produce caches that contain all needed IP address–MAC address mapping. ARP and NDP are sometimes intrusive in high level testing, it will introduce unexpected noise to the simulation (unwanted delays, packet drops, etc.). Perfect ARP/NDP can ensure every ARP/NDP look-up hits the cache so that no ARP messages or Neighbor discovery messages will be generated.
  • Repository:
  • About Me: I’m a first-year computer science graduate student from University of Southern California, US. I got my bachelor’s degree in computer science from University of Wisconsin- Madison, US. I began my graduate study in August 2021. I’m interested in computer networks and have good code experience in C and C++, I also did projects with Python, Java and JavaScript.
  • Project Plan: link
  • Final Report:link

Milestones and Deliverables

Phase 1

Duration: Week 1 to Week 7

  • Enable ipv4 static perfect Arp
  • Enable ipv6 static perfect Ndp
  • Write examples and tests for them
  • Update documentation

Phase 2

Duration: Week 8 to Week 10

  • Enable ipv4 dynamical perfect Arp
  • Enable ipv6 dynamical perfect Ndp
  • Write examples and tests for them
  • Update documentation

Weekly Reports


Duration: June 13 - June 19

  • Start working on IPv4 perfect Arp.
  • Implemented an approach of creating subclass of ArpL3Protocol and ArpCache to dynamically create shared perfect cache.
  • Handled interface up/down event in that approach.
  • Tested IP neighbor cache flushing behavior about permanent entries in Linux.
  • Determined to implement perfect cache in a more concise way, which is create static perfect cache first after discussing with mentors.


Duration: June 20 - June 26

  • Implemented static perfect cache on both IPv4 and IPv6 by new helper class.
  • Start adding tests and examples for perfect ARP/NDP
  • Tested DAD behavior when interface disable ARP/NDP in Linux.


Duration: June 27 - July 3

  • Implemented a subclass of Icmpv6L4Protocol for disable DAD
  • Create two example for perfect ARP/NDP, the one is simple csma, another is double wifi. Meet problems when creating global routing in double wifi example, fix by using nix-vector routing instead.
  • Draft Merge Request of static perfect cache with two examples. link


Duration: July 4 - July 10

  • Add test for perfect ARP/NDP.
  • Add user-level API for updating perfect cache after IP address changes.
  • Update MR based on comments. Fix mistakes and improve iteration logic. link
  • Continue and refine the work on the dynamical perfect cache. Perfect cache updating will base on IP addresses added/removed instead of link up/down.


Duration: July 11 - July 17

  • Update MR based on comments.
  • Implement dynamical perfect ARP on locally shared cache per network.
  • Add new perfect-arp-cache and perfect-arp-l3-protocol.
  • Add addAddressCallback and removeAddressCallback to make it perfect caches updated dynamically by IP addresses change.
  • Use a new data structure for perfect cache, std::unordered_map<Ipv4Address, Cache *, Ipv4AddressHash> PerfectCache; The key is network address and the value is the pointer to the unorder_map of normal caches. This new structure is used to differentiate a case that when an interface has multiple IP addresses from different networks, its perfect cache would contain entries from different networks.
  • Overwite ArpCache::Lookup,ArpCache::Add,ArpCache::Remove for the new data structure of perfect ARP cache.


Duration: July 18 - July 24

  • Update the ARP/NDISC cache to make them ordered.
  • modify examples to show populate cache with interfaceContainer.
  • replace the word perfect from the code with more technical words.


Duration: July 25 - July 31

  • Refactor Icmpv6L4Protocol::ReceiveLLA and Icmpv6L4Protocol::HandleNA, change the nesting of if statement to switch case of NUD_STATE
  • Add new NUD_STATE: STATIC_AUTOGENERATED. The entries generated by perfect ARP/NDP will use the new state
  • Update printout in test and example, because of the new state and ARP/NDISC cache reorder.

Week8 - Week9

Duration: August 1 - August 14

I'm not fully involved in GSoC program these days because of some personal issue

  • Update MR based on comments.
  • add function to flush all auto-generated entries
  • add remove callbacks in ipv4interface to enable dynamical perfect cache
  • delete the double wifi example and modify the simple example to a detailed one to show all API and sending a data stream to show how perfect cache reduces the packet drop rate in some situation.

Week10 - Week11

Duration: August 15 - August 28

  • Complete the update on the static neighbor cache, which is ready to be merged.
  • Update the MR of dynamic neighbor cache based on comments.

Week10 - Week11 Duration: August 29 - September 4

  • MRon static neighbor cache has been merged.
  • Update the MR of dynamic neighbor cache based on comments.
  • Refactor on NUD_STATE process on icmpv6.