CS276 Assignment 3
Writeup due before class on March 18, 1999
Code turnin due by midnight on March 18, 1999
1.0 Overview
In this assignment you use unicast TCP connections to simulate a
multicast service over the Internet. The topology of the tree will
vary and you will have to deal with all types of virtual trees.
Given a unicast routing topology,
you will be required to build a multicast tree and manage join/leave
messages for all group members. The key performance measure will
be whether nodes implement the multicast routing/forwarding protocol
correctly. This will be determined based on whether each node in
the graph handles join/leave messages correctly and whether each
node properly forwards or discards packets from the source. Your nodes
will have to run in both a ``broadcast-and-prune'' and a ``join-and-graph''
mode of operation (but only one protocol at a time).
You will write a ``node'' program that is run on up to 10 different
machines (though extending beyond 10 should be trivial). Each ``node''
program will read from a topology file and establish a virtual
topology of unicast links. The links will actually be implemented
using TCP connections. Each link will have a virtual cost.
Using Node 1 as the one and only source you will need to build a
logical representation of a multicast tree. When Node 1 begins
sending packets, each packet should be delivered across the multicast
tree, but only to nodes that are group members.
Two input files will be needed: the topology file mentioned above,
and an event file. The event file will contain a list of
times and corresponding node actions. These events will be join/leave
messages from nodes wishing to join/leave the multicast group. The
node which initiates the event must send an event message to the
next-hop, upstream router who must properly act on the message, either
adding the node to the multicast tree and passing the message further
upstream or pruning the link from the multicast tree.
The output from your programs will be two files for each node.
The first will contain a history of events for each node and the second
will contain a transmission summary. The possible events are for data
packets only and include: transmitted (source node only),
forwarded (intermediate nodes only), discarded, and received.
The transmission summary will include information about the total
number of packets sent, received, forwarded, and dropped by each
node.
2.0 Input Given
Two configuration files will be used: (1) one file specifying
the topology of the nodes, and (2) a second file specifying the
events that occur during the simulation.
- Topology File (click here for an example)
- You should be able to read the topology configuration file and create
a logical representation of the unicast routing topology in your simulator.
The following format will be used:
<number of nodes in tree> <duration> <interval> <dense/sparse>
<node #> <IP address of host> <starting port number>
<node 1> <node 2> <hop cost>
- The dense/sparse option specifies what type of routing protocol
will be run for this particular configuration.
- Event File (click here for an example)
3.0 Output Format
Two output files will need to be generated per node:
summary-<node #>.out: (click here for an example)
4.0 Detailed Operation
The detailed operation is left mainly to the discretion of the student.
However, there are some strict requirements that need to be implemented.
This list is both a list of requirements and a list of suggestions.
Be forewarned that items will be added to the list over the course of
the assignment (as corrections and clarifications are made).
The two output files created should be log-<node #>.out and
summary-<node #>.out.
- EXTRA CREDIT: The *.out files should be sent to Node 1 via
the open TCP connections. Node 1 will then sort and combine all the log
files and summarize the summary files. This data transmission activity
should not be included in the log file statistics.
The source will always be Node 1. However, because there is only
one node.c program, the send function will be included in each
node. Your node.c should determine whether it is Node 1 and
then initiate the heartbeat and data packet transmission if it is.
Data packets should be sent
once every two seconds, and heartbeat packets should be sent once
every second. Finally, ONLY data packets and not heartbeat
packets are counted in the log and summary output files.
Upon startup, each node will need to form a unicast routing table
using a link state style protocol (since all nodes will have access
to the topology and link costs). You will also need to create a
shortest path broadcast tree for the heartbeat packets.
You will also need to use a TTL value to keep packets from looping
indefinitely. The TTL should be equal to the maximum diameter of the
broadcast tree. The TTL is a measure of link costs and not just a hop
count. Nodes will forward packets that have a TTL greater
than 0 unless the TTL would become negative (current TTL value minus
the link cost).
Upon startup, a TCP connection should be opened for each link
specified in
the topology file. The link should be opened by the node with
the lowest number. For this reason, when running a program, always
start nodes from highest to lowest (so that when the lower numbered
node in a link is started, the peer will already exist).
Handling port assignments will be a little bit tricky, but
use the following convention: The lower numbered node will connect
to the higher numbered nodes IP address. The port number used will
be the number specified in the topology file plus the node number of
the client node. For example, if 5 is connecting to 6 and 6 has
a port number of 38000 in the configuration file, node 5 should
connect to port 38005.
You will have to implement a dense-style broadcast-and-prune
version and a sparse-style join-and-graft style of protocol.
You will need to create state in each node based on whether
traffic should be forwarded or dropped based on prune state. Since
there is only one multicast group there will only be one entry for
each outgoing link.
A node should not actually print out any messages while executing.
This is so the nodes can be run in the background, possibly on the
same machine.
You will need to create both control packets (for joins, leaves,
and heartbeat packets) and data packets. This will require you to
create a protocol on top of TCP so that nodes know whether an incoming
packet should be forwarded/dropped or processed. You are free to
implement these headers however you like.
5.0 Turnin
- Electronic turnin: Use the turnin command (see instructions on
WWW page) to turnin node.c and Makefile files only.
- Hardcopy turnin: Turnin a copy of the source code as well as
a brief (1 page max) summary of the differences between sparse and
dense mode protocols. You should identify ways of quantitatively
comparing the performance of the two (packet hops for example) and
state whether there are cases when dense is better than sparse and
vice versa.
6.0 Grading
We will design several strategies that will test and stress the
functionality of your program. We will develop 4 test cases of
increasing complexity. Each will be tested against dense and
sparse mode protocols. Each successful execution will be worth
5 points.
- 40: dense-mode protocol works correctly
- 40: sparse-mode protocol works correctly
- 20: analysis (write-up)
The extra credit for this assignment will be worth up to 20 points (so
it is a significant opportunity).
The late submission penalty policy is 10% per late day.