In this assignment, you will work in teams of two to develop a single C program that is a Fishnet node. We will extend the nodes and network with functionality throughout the quarter. The goals of this first assignment are to become familiar with the Fishnet development environment and to understand packet forwarding concepts.
fish_send(ALL_NEIGHBORS, <packet>)
struct echo_packet with code field ECHO_PROTOCOL_REQUEST.
struct echo_packet with code field ECHO_PROTOCOL_REPLY.
ALL_NEIGHBORS address, by sending a ping response to the source node of the ping request. You MAY not reply if the source and the destination of the request are the same (the sample solution doesn't).
Note you discover, not decide who your neighbors are. You will need to use timers fish_scheduleevent(), to implement periodic background activity. Also check the real topology at http://[hostname running fishhead]:[port] to verify your neighbor discovery works right.
fish.h so that other nodes can handle them, but you should do the best you can with whatever packets you receive from other nodes. Of course, you will get it right, but they will send broken packets. In particular, other nodes shouldn't be able to crash your node by sending it bad packets. If your node does crash, it's your responsibility to find out what happened and fix it.
Upcall programming is particularly good for network (or layering) implmentations. The upper layer only has to register events with their event handlers, this allows flexibility that different layer implementations with a simple interface. The downside is harder to control because event occurs asychronously, and memory leaks are harder to trace because data structures are passed between different functions possibly implemented by different people.
Both flooding checks and TTL checks can prevent packets from looping forever. The main reason is efficiency: Let's suppose we have two networks consist 3 nodes and 10000 nodes respectively. Flooding is much more effective in small network because the packet disappears once it has visited every node twice while the packet will bounce O(TTL) times before it got pruned. On the other hand, TTL is much more effective in large networks such as Internet, because it ensures the spread area is never beyond diameter TTL. Note both mechanisms require nodes to be co-operative, a malicious node can create forever loops by not decreasing the TTL or simply increasing the packet id.
The number of duplicates received equals the number of neighbors, because new packet gets flooded to every node at most twice. Same as echo replies.
The number of duplicates received equals the number of neighbors of that node. If the packet follow the shortest path to the destination, only the nodes along the path will receive (and forward) those packets. This can possibly eliminate O(N) packets if the path length is a small constant.
We accept any answers that make sense.
make hw1 command.
./fishhead -h for topology options)
turnin -c cs123b hw1.c
April 24, 2003
UCSD CSE123b Communications Software