客户端和服务器端通过路由器传输UDP包 采用fifo
Network Switching Technology CourseProject 1
Description
In this project you will implement weighted fair queuing. We will use UDP packets as our transport mechanism.
The primary goals of this project:
• To gain experience with the techniques for implementing weighted fair queuing.
• To observe first-hand the behavior of multiple clients competing for available link bandwidth using FIFO queuing and weighted fair queuing.
You will need to program three routines for this project, the “sender”, the “receiver”, and the “router”.
Behavior of the sender:
1. send UDP packets to the "router". The data payload of the UDP packets should look like:
source ip destination ip
source port destination port
weight flow id
up to 1400 bytes of data
The first 24 bytes of the UDP payload are called the "Project1 Header".
The sender program should send UDP packets at an average rate. The average rate should be able to be set easily via a program parameter.
You will be running several senders simultaneously for the experiments.
2. by receiving packets that are sent back by the receiver, the sender routine should figure out the transmission delay for the flow.
Behavior of the receiver:
The receiver should be able to work in two different modes to meet the different experimental requirements
1. receive packets from different flows and record the arrival time, size, etc for every packets. By using this information, you are asked to draw a graph of the total bytes received on each flow vs. time.
2. send back each received packet to its source without any change to packet data, so that the sender can get the packet and figure out the transmitting time, which is actually the total delay for the packet.
3. A single receiver can hopefully handle all of the simultaneous senders.
Behavior of the router:
The router implements weighted fair queuing to allocate the bandwidth of the output link amongst the flows passing through it. For simplicity you may assume that the weight associated with any particular flow is unchanging. (That is, you can just use the weight seen in the first packet of a flow and ignore the weights in subsequent packets.)
I suggest using the FIFO router to get your sender and receiver working before beginning to build the FQ routers.
Experiments
1. With each of the routers (FIFO, WFQ) perform the following experiment. Start a sender with FlowID=1, Weight=1 and packet size 1024. After a couple of seconds, start another sender with FlowID=2, Weight=1, and packet size 512. After another couple of seconds, start a third sender with FlowID=3, Weight=2, and packet size 1024. After two more seconds stop the second sender, and 2 seconds later stop everything. You will probably want to use a shell script (or C program) to manage this starting and stopping of senders. The 2 second intervals are not critical.
2. Provide a graph of the total bytes received on each flow vs. time. The receiver should log the time, the flow ID, and the packet size each time it completes a packet. You can process this information to produce the required graph. Please use a separate graph for FIFO and WFQ.
3. Provide a graph of the packets on each flow vs. delay. The sender should log the delay, the flow ID, and the packet size each time it completes a packet. Please use a separate graph for FIFO and WFQ.