The goal of this lab is to give you more practice with network programming, concurrency, and distributed systems.
For this lab, you will extend the program you implemented for Lab 2. You will enable the TempCollector program to gather information about the topology of the network. The basestation will periodically log to a file a list of the SPOTs in the network and, for each SPOT, a list of its directly attached neighbors.
- Periodically, each SPOT will send the basestation a list of the SPOTs to which it directly connects. To gather this information, each SPOT will periodically send a broadcast packet (a ping), with a hop count of one, to its directly attached neighbors. Upon hearing from a neighbor, a SPOT will record the IEEE address of the neighbor in a neighbor table and periodically transmit this information to the basestation.
- If a SPOT fails to hear from a neighbor for some period of time, it will remove the neighbor from its neighbor table.
- On each SPOT, you will need to create a separate thread that listens for incoming pings and updates the neighbor table.
- You may piggyback the neighbor information on the packet containing the temperature that gets sent to the basestation, or you may send separate packets.
- To thoroughly test this application, you will need to create a multihop network. You should use the setOutputPower method of IRadioPolicyManager to reduce the output power of the radio and hence the distance packets sent by the SPOT will travel. You will need to experiment to find the appropriate output power for your tests. Somewhere in the range of -29 has been successful in the past.
- You may need to use the setMaxBroadcastHops method of RadiogramConnection to ensure that packets broadcast toward the basestation will be forwarded by SPOTs between the sender and the basestation.
- SPOTs that are actively using their radios will, by default, forward packets appropriately. If you wish to use a SPOT to forward packets and that SPOT is not running an application that uses the radio, you need to enable mesh routing. See the red Developer's Guide for more information.
- For full credit, you must upload your code to your SVN repository. Upload your code into directories using the following naming convention. Failure to use this exact naming scheme may result in deduction of points.
- <username>/cs685/lab3/SPOTTempReporter
- <username>/cs685/lab3/TempCollector
- See this SVN How-to for more information on using SVN.