Due: 13:00:00, May 27
Last update: Monday, 26-May-2003 14:03:25 PDT
Your assignment is to extend your Fishnet node with a naming service, so that you can ping hosts by their names, and a link-state routing protocol, so that messages are sent only to their destinations rather than being flooded.
Here are your constraints:
struct name_packet. These
packets are designed for flooding information about naming entries throughout
the network. Hostnames are named by you and null-terminated strings up to
12 characters including the null character. Empty strings should be taken
to mean that the associated address is no longer alive in the Fishnet.
A good design will keep the hostname to address listings at every node as
up-to-date as possible, yet use very little bandwidth. You will probably
want to modify your ping command so that it takes a hostname to ping as
well as an address. You will probably want to add a new ls
command that lists the nodes in the network. To see that your program is
working, you might use the fishhead to set up a small network and see that
your ls command at one node tracks the fishnet membership as
you stop and start nodes.
Here are your constraints:
struct neighbor_packet to
implement neighbor discovery. Conceptually, this is the same as using ping, but
using a different type of packet produces a cleaner solution than overloading ping.
struct link_state_packet to
distribute link-state information. These packets are designed for flooding and are
very similar to the naming packets. Each entry describes a directed link from node
A to node B and has a sequence number and validity interval. Each entry also has
a cost for the link, which is either 1 (one) if the link is up, or INFINITY if the link
is down.
struct neighbor_packet, which should only be used for neighbor
discovery as described above.
You may assume the network size (the total number of currently running fish nodes) is no more than 500 nodes. Once you have completed all of the above, you should be able to ping any other node in the network, and have a packet travel to that node and back without being unnecessarily flooded throughout the network. To see that your protocol is working, you might set up a small ring network, use ping to test whether you can reach remote nodes, and then break reachability by stopping a node on the path so that ping no longer receives a response. Your routing protocol should detect this and repair the situation by finding an alternative path. When it does, ping will work again.
You can have a group up to four for this assignment. We provide
skeleton source and a sample solution binary in ../public/cs123b-hw2.tar.
This time you can implement the hw in multiple files, as the code size
will be larger than the previous one. You can modify, add, delete the
provided files. But we will compile your program by make
hw2 command with the ieng9 gcc compiler and the original
libfish.a and fish.h.
Please start early, the sample solution has over two thousand lines of code. If you have enough people, you can do parallel development. Some can work on the naming part and the others work on the routing part. Since naming service is on top of routing, you can use the previous flooding code to route name packets first. When you finish link-state routing, you can use naming service to test it. If you run into some problem, double check the documentataion in fish.h and this web page.
For a simple test, run a four node private fishnet (using your program only, not the sample
solution), with each node running in a separate window. Make the nodes form a
ring network (see ./fishhead -h and look for ring). From one node,
ping the other node that is not directly connected, observing which way it travels
around the ring. Stop the intermediate node the messages passed through. Repeat
the ping when routing has repaired paths and it travels along an alternate path. You
can also try to specify a low background loss rate (e.g. 0.01), and
see how the network handles lost packets.
~/hw2% cd ..
~/% tar cvf hw2.tar hw2/
~/% turnin -c cs123b hw2.tar
Yes, and you can use the provided checksum functions in cs123b-hw2.tar .
No, and we encourage you to implement your own.
Different than hw1, this time you have to be more strict. The principle is, you are free to do things if fish.h or this page do not explicitly define the constraints. For example, the ttl limit is defined in fish.h as MaxTTL, so you should not accept packet with ttl larger than MaxTTL. If there are ambiguities and conflicts, contact us by posting on the message board (preferred) or by email.
No, but please provide information about how to use your program. In particular, many of you are implementing based on observing the sample solution behaviours. The sample solution might not be perfect (so is any software) or the most efficient, although we will fix the bugs, it is provided to help you develop your own better solution, not to help you learn to clone software.