Introduction
I created an overlay network that connects machines that replicate common content in this project. A simple link-state routing protocol for the network is implemented and we could then use the obtained distance metric to improve our transport efficiency.

Features
- Self-organized: Nodes communicate with each other. The state of the network is shared and updated without a central server.
- Change detection: Nodes respond quickly to the change of network structure. Node online/offline state can be detected and spread quickly in the network.
- Link-state detection: Each node knows the shape of this network. Link-state information is broadcasted to other nodes.
- User Interface: Command line interface provides a simple and easy way to interact with the system.
Functions
- “uuid”: Print node’s unique identification.
- “neighbors”: Print node’s directly connected neighbors (online only).
- “addneighbors”: Adding a new neighbor to CDN.
- “map”: Print all the active links in CDN.
- “rank”: Print the shortest distance to every other node.
- “kill”: Clean up and exit this program.
Major Designs
Network Detection and Link-state Broadcast are designed and implemented to complete the functions mentioned above. Both protocols are based on UDP communication.
Neighbor Detection
To achieve Neighbor Detection, the Keepalive package is used to inform the online state of the node. Keepalive package includes the following information:
- Source: uuid, node_name, backend_port