CS 284: Mobile Computing
Homework Assignment #2
Due by 5pm on Tuesday, May 1st, 2007

Assignment Overview

This assignment is to be completed individually.

In this assignment, you will add reliability to the UDP transport layer protocol. Currently, the UDP transport layer performs best effort delivery without adding any reliability. It transmits a packet to the network layer as soon as it gets a packet from the application layer (e.g. CBR). If due to any reason a packet is lost somewhere between the source and destination, UDP does not retransmit it. Your task will be to modify the UDP layer in QualNet and add reliability to it.

You will do this based on the Stop-and-Wait principal. The UDP transport layer you modify will receive packets from the application layer, do the appropriate processing, and then send the packets to the network layer. However, it only transmits one packet into the network at a time. After transmitting the packet, the source stops and waits for an acknowledgment to be received from the receiver. Upon reception of the acknowledgment, the source sends the next packet, assuming there is another packet to send. If the application sends packets to the transport layer faster than the transport layer can transmit, the transport layer should buffer the data packets in a queue while waiting to transmit them.

There are multiple purposes for this assignment. First, it is to help familiarize you with the programming environment of QualNet. You will become familiar with the programming interface and the built-in functions that allow you to process packets. Second, it will give you hands-on experience with the layering of the protocol stack and the interfacing and packet processing that occurs as packets are passed between protocol layers. It is very important in networking to fully understand this concept. Finally, it will reinforce the technique of running simulations and obtaining thorough analyses of network protocols.

Assignment Details

Development

As indicated in the previous section, you are to modify the UDP protocol in QualNet and add reliability. Part of the challenge will be learning the QualNet constructs and determining how and where to modify the UDP layer in QualNet. You will need to understand timers in QualNet and how to generate packets and inject them into the network. You will also need to determine the format of the data handed down from the application layer, as well as the appropriate format for the network layer.

The modified UDP protocol transmits one data packet, and then waits for the reception of an acknowledgment from the receiver before sending another data packet. You will implement both the sender and receiver functionality for this protocol. The first thing to do to implement your protocol is decide what components of reliability you will need to perform this task. You will also need some type of buffer at the source node, so that the source can buffer packets from the application layer while it is waiting to send them. The best way to understand timers in QualNet and how to generate acknowledgments is by going through the TCP code included in the QualNet package.

Technical details

Here are some technical details that you will need.

1. The source node should buffer a maximum of 20 packets, after which it should start dropping the rest.
2. Use a timeout value of 500ms at the source node to wait for an acknowledgment from the destination. Retransmit the packet if you don't get an ACK back in 500 ms.

Testing

Now that you have modified the UDP protocol and made it more reliable, you should test it in a number of scenarios with increasing levels of complexity. Your development and initial testing scenario should be simple so that the complexities of mobility and randomness do not complicate your results. Use the following testing topologies for testing your protocol:

1. A single line of 5 nodes, with each node spaced 200m apart.
2. A grid of 4 x 4 nodes, with the horizontal and vertical node interspacing of 200m.
3. A random network of 50 nodes in a 1000mx1000m network.
4. A random network of 50 nodes in a 1000mx1000m network. Include mobility, with minimum speed of 0m/s and maximum speed 20m/s.
Always use a transmission range of 250m. For each of the above scenarios, use a data traffic model of CBR traffic. In test 1, node 1 is the source and node 5 is the destination. In tests 2-4, the sources are nodes 1, 2, 3, 4, and 5, and the destinations are nodes 6, 7, 8, 9, and 10. Use the same session start times as in homework 1. For each scenario, each source sends data packets at a rate of 2 packets/second. The data packet size is 512 bytes, and each source sends 1000 total packets. Run each simulation for 600 seconds.

For tests 3 and 4, run the simulations 5 times using SEED values 1 through 5 and a RANDOM distribution of nodes. For all tests, if any parameters weren't included in this assignment, use the values indicated in homework 1.

For your results, answer the following questions:

1. What are the functions you use to interface to the application layer? to the network layer?
2. What happens to the packet as it is passed from the application layer to the transport layer? From the transport layer to the network layer?
3. What is the average throughput of each network configuration?
4. What is the average packet delivery ratio of each network configuration?
5. What is the average end-to-end delay of data packets in each test?
6. What happens when the CBR application generates data at a faster rate? Try a sending rate of 50 packets/sec at each source. What is the packet delivery ratio in this case? If it differs from the 2 packet/sec sending rate, why?


Turn-in

The homework is due by 5pm on May 1st. You have two things to turn in: a print out of the source code and header files you modified of UDP, and a write-up that includes the answers and results for each of the above questions. Turn in your assignment to the homework box in Engr. 1 room 2108.