ns-2 Simulation Code and Examples
Simulation results in [GM:sigmetrics02] and [GM:spie02] were all performed in ns-2.
Size-aware scheduling consists of two parts: packet classification and packet differentiation. Therefore, corresponding modules (size-aware classifier and corresponding AQM schemes like RIO-PS) need to be installed. Step-by-step instructions can be found here.
When all the modules have been installed, we now see an illustrative scenario in which flows of size 5 packets or below being identified as short flows, and enjoy high priorities in packet delivery. Figure 1 depicts the simulation topology.
Figure 1: Simulation Topology
In this simple example, there are two parallel TCP sessions sharing a single bottleneck link between
node 1 and node 2 (of capacity 700kb).
One of the sessions runs from node 3 to node 5, periodically transmitting 1000 packets. Therefore, all flows in this session are long according to our definition. On the contrary, in the session from node 4 to node 6, only 4 packets are transmitted in each flow. The simulation script is shown below:
Node 0 is the "size-aware classifier", which counts the incoming packets from each flow. Once the count exceeds a certain threshold (in this case 5), the remaining packets from the corresponding flow are identified as long flow packets. In the simulation, long flow packets are colored in blue. All the other packets, i.e., packets from flows of size less than 5, and the first 5 packets from a long flow, are all identified as short flow packets, and colored in red in the simulation.
To upload a size-aware classifier with threshold set to 5 to node 0, do the following:
As a result, all packets between node 4 and node 6 are colored in red:
Figure 2: Packets from short flows.
For flows of size bigger than 5, the first 5 packets are colored in red, and the remaining packets are colored in blue:
Figure 3: Packets from long flows.
At the bottleneck link (link between node 1 and node 2), a differentiated dropping scheme is employed. This is achieved by:
Notice that to obtain a more drastic effect of size-aware differentiation, we choose a relatively high ratio between long and short flow packet dropping rate (weight_ is set to 10).
When congestion happens, low priority packets are dropped at a faster rate (on average 10 times faster) than that for high priority packets. This is illustrated in Figure 4:
As a result, high priority flows, or short flows, are transmitted at a rate higher than that of low priority flows, or long flows, as TCP flows are responsive to packet drops. That is the basic scheme of our size-aware scheduling. Figure 5 shows packets generated from the two sessions, after some packets are dropped:
Reference[GM:sigmetrics02] L. Guo and I. Matta. "Scheduling Flows with Unknown Sizes: Approximate Analysis". Proc. ACM SIGMETRICS'02 (poster), Los Angeles, CA, June 2002. [.ps], [.pdf] Full paper available as BU CS Technical Report TR-2002-09.
[GM:spie02] L. Guo and Ibrahim Matta. Differentiated Control of Web Traffic: A Numerical Analysis. Proc. SPIE ITCOM'2002: Scalability and Traffic Control in IP Networks, Boston, MA, August 2002.