OverSim has many sample applications & overlays that you can look at & understand. But, it's always better to build your own ones so you would understand things better. OverSimDevelop provides the steps necessary to build your first application & overlay. My objectives it to provide few additional details that would complete the picture.
Synopsis
A node generates a ping messages & sends it to a randomly selected node. When the destination node gets the ping message, it replies with a pong message. As this process continuous messages are probabilistically dropped & statistics are collected.
Overview
MyApplication randomly selects set of overlay nodes then send a ping message to each of them using the MyOverlay. Each overlay node maintains 2 pointers, one to the successor & another to the predecessor node. Ping messages are forwarded clockwise or anticlockwise based on these 2 pointers, e.g., message from node 8 to 2 (in a network with 10 nodes) will follow the path 8 → 7 → 6 → 5 → 4 → 3 → 2 (it will not take the path 8 → 9 → 0 → 1 → 2). The destination node directly (using an UDP connection) replies back to the sender, when it receives the ping message. After receiving its own ping, source node records statistics & then drop the ping message. If desired, ping messages can be dropped while they are being forwarded.
The application is dependent on SimpleUnderlayNetwork and default routing (i.e., iterative routing) as defined in default.ini file. Later, RPC messages are used to discover set of neighbors of a given node.
MyApplication
Overview
MyApplication randomly selects set of overlay nodes then send a ping message to each of them using the MyOverlay. Each overlay node maintains 2 pointers, one to the successor & another to the predecessor node. Ping messages are forwarded clockwise or anticlockwise based on these 2 pointers, e.g., message from node 8 to 2 (in a network with 10 nodes) will follow the path 8 → 7 → 6 → 5 → 4 → 3 → 2 (it will not take the path 8 → 9 → 0 → 1 → 2). The destination node directly (using an UDP connection) replies back to the sender, when it receives the ping message. After receiving its own ping, source node records statistics & then drop the ping message. If desired, ping messages can be dropped while they are being forwarded.
The application is dependent on SimpleUnderlayNetwork and default routing (i.e., iterative routing) as defined in default.ini file. Later, RPC messages are used to discover set of neighbors of a given node.
MyApplication
- Periodically selects a random set of nodes then sends a ping message to a each of those nodes
- A message contains a type (i.e., ping) & senderAddress
- When a message reaches the destination, the receiving node changes the message type to pong & send directly to the sender based on the senderAddress indicated in the ping message.
- ping messages are delivered through overlay while pong messages are delivered directly through a UDP connection.
- In the underlay level, even the overlay messages are delivered as UDP messages.
- Application binds to a UDP port because it receives UDP messages
- When a pong message is received, the sender update message counter then delete the message
- Join the overlay & establish a pointer to successor & predecessor
- Forward messages
- Determine a potential next hop node based on overlay routing scheme, which is either through successor or predecessor
- Drop messages based on a given probability. Don't tell a next hop in the forward() method ,if message is being dropped
- Node's IP address is derived from its key & has the format 1.0.0.key
- Count the number of dropped messages
- Message delivery latency is calculated based on the distance between the 2 nodes on a 2D plane & packet size
- Has a message type, 1 for ping & 2 for pong
- Include the address of the sender so that pong message can be send directly using UDP
- RPC messages are used to request set of neighbors of a node & to reply with list of neighbors
Extend MyOverlay & MyApplication to provide more functionality such as:
- Modify joinOverlay & findNode methods to support a circular address space & bidirectional routing
- Track hop count for messages & verify different routing types in OverSim
- Keep points to nodes that are faraway (2 or 4-hops) then observe reduction in hop count
Then you can play with the KBRTestApp.
Comments
thank you for your all useful posts about OverSim. But i cannot undestand how KBR routing works for the example MyOverlay. The type is defined as "iterative" but the program defines a new protocol which is not implemented.
Thank you in advance.