From e02e86faa71e4b0abbcb4477b12acf624a97570f Mon Sep 17 00:00:00 2001
From: Pasquale Imputato
Date: Tue, 8 Mar 2016 10:45:27 -0800
Subject: [PATCH] network: Move RED model, test and examples to the
traffic-control module This move prepares RED to become a queue disc.
Building of RED model, tests and examples is disabled until the conversion is
done.
---
src/network/doc/queue.rst | 78 ++++---------------
src/network/examples/wscript | 6 --
src/network/test/examples-to-run.py | 1 -
src/network/wscript | 3 -
.../examples/pfifo-vs-red.cc} | 0
.../examples/red-tests.cc | 0
.../model/red-queue-disc.cc} | 0
.../model/red-queue-disc.h} | 0
.../test/red-queue-disc-test-suite.cc} | 0
9 files changed, 15 insertions(+), 73 deletions(-)
rename src/{network/examples/droptail_vs_red.cc => traffic-control/examples/pfifo-vs-red.cc} (100%)
rename src/{network => traffic-control}/examples/red-tests.cc (100%)
rename src/{network/utils/red-queue.cc => traffic-control/model/red-queue-disc.cc} (100%)
rename src/{network/utils/red-queue.h => traffic-control/model/red-queue-disc.h} (100%)
rename src/{network/test/red-queue-test-suite.cc => traffic-control/test/red-queue-disc-test-suite.cc} (100%)
diff --git a/src/network/doc/queue.rst b/src/network/doc/queue.rst
index 7811c5e51..c2510b5a2 100644
--- a/src/network/doc/queue.rst
+++ b/src/network/doc/queue.rst
@@ -7,11 +7,10 @@ Queues
============= Subsection (#.#.#)
############# Paragraph (no number)
-This section documents a few queue objects, typically associated with
-NetDevice models, that are maintained as part of the ``network`` module:
+This section documents the queue object, typically associated with
+NetDevice models, that is maintained as part of the ``network`` module:
* DropTail
-* Random Early Detection
Model Description
*****************
@@ -32,11 +31,13 @@ Design
======
An abstract base class, class Queue, is typically used and subclassed
-for specific scheduling and drop policies. Common operations
-include:
+for specific scheduling and drop policies. A class QueueItem is introduced
+to model the items stored in a queue. The base class QueueItem only contains
+a pointer to a packet. Subclasses may be defined to store additional information.
+Common operations provided by the base class Queue include:
-* ``bool Enqueue (Ptr p)``: Enqueue a packet
-* ``Ptr Dequeue (void)``: Dequeue a packet
+* ``bool Enqueue (Ptr item)``: Enqueue a packet
+* ``Ptr Dequeue (void)``: Dequeue a packet
* ``uint32_t GetNPackets (void)``: Get the queue depth, in packets
* ``uint32_t GetNBytes (void)``: Get the queue depth, in packets
@@ -54,27 +55,6 @@ DropTail
This is a basic first-in-first-out (FIFO) queue that performs a tail drop
when the queue is full.
-Random Early Detection
-######################
-
-Random Early Detection (RED) is a queue variant that aims to provide
-early signals to transport protocol congestion control (e.g. TCP) that
-congestion is imminent, so that they back off their rate gracefully
-rather than with a bunch of tail-drop losses (possibly incurring
-TCP timeout). The model in ns-3 is a port of Sally Floyd's ns-2
-RED model.
-
-Scope and Limitations
-=====================
-
-The RED model just supports default RED. Adaptive RED is not supported.
-
-References
-==========
-
-The RED queue aims to be close to the results cited in:
-S.Floyd, K.Fall http://icir.org/floyd/papers/redsims.ps
-
Usage
*****
@@ -82,8 +62,7 @@ Helpers
=======
A typical usage pattern is to create a device helper and to configure
-the queue type and attributes from the helper, such as this example
-from ``src/network/examples/red-tests.cc``:
+the queue type and attributes from the helper, such as this example:
.. sourcecode:: cpp
@@ -99,34 +78,14 @@ from ``src/network/examples/red-tests.cc``:
p2p.SetChannelAttribute ("Delay", StringValue ("3ms"));
NetDeviceContainer devn1n2 = p2p.Install (n1n2);
- p2p.SetQueue ("ns3::RedQueue", // only backbone link has RED queue
- "LinkBandwidth", StringValue (redLinkDataRate),
- "LinkDelay", StringValue (redLinkDelay));
- p2p.SetDeviceAttribute ("DataRate", StringValue (redLinkDataRate));
- p2p.SetChannelAttribute ("Delay", StringValue (redLinkDelay));
+ p2p.SetQueue ("ns3::DropTailQueue",
+ "LinkBandwidth", StringValue (linkDataRate),
+ "LinkDelay", StringValue (linkDelay));
+ p2p.SetDeviceAttribute ("DataRate", StringValue (linkDataRate));
+ p2p.SetChannelAttribute ("Delay", StringValue (linkDelay));
NetDeviceContainer devn2n3 = p2p.Install (n2n3);
-Attributes
-==========
-
-The RED queue contains a number of attributes that control the RED
-policies:
-
-* Mode (bytes or packets)
-* MeanPktSize
-* IdlePktSize
-* Wait (time)
-* Gentle mode
-* MinTh, MaxTh
-* QueueLimit
-* Queue weight
-* LInterm
-* LinkBandwidth
-* LinkDelay
-
-Consult the ns-3 documentation for explanation of these attributes.
-
Output
======
@@ -154,12 +113,5 @@ Examples
========
The drop-tail queue is used in several examples, such as
-``examples/udp/udp-echo.cc``. The RED queue example is found at
-``src/network/examples/red-tests.cc``.
-
-Validation
-**********
-
-The RED model has been validated and the report is currently stored
-at: https://github.com/downloads/talau/ns-3-tcp-red/report-red-ns3.pdf
+``examples/udp/udp-echo.cc``.
diff --git a/src/network/examples/wscript b/src/network/examples/wscript
index 4d50819b0..ba85212b5 100644
--- a/src/network/examples/wscript
+++ b/src/network/examples/wscript
@@ -10,11 +10,5 @@ def build(bld):
obj = bld.create_ns3_program('main-packet-tag', ['network'])
obj.source = 'main-packet-tag.cc'
- obj = bld.create_ns3_program('red-tests', ['point-to-point', 'internet', 'applications', 'flow-monitor'])
- obj.source = 'red-tests.cc'
-
- obj = bld.create_ns3_program('droptail_vs_red', ['point-to-point', 'point-to-point-layout', 'internet', 'applications'])
- obj.source = 'droptail_vs_red.cc'
-
obj = bld.create_ns3_program('packet-socket-apps', ['core', 'network'])
obj.source = 'packet-socket-apps.cc'
diff --git a/src/network/test/examples-to-run.py b/src/network/test/examples-to-run.py
index 3861b97dc..a9647ae79 100644
--- a/src/network/test/examples-to-run.py
+++ b/src/network/test/examples-to-run.py
@@ -10,7 +10,6 @@
cpp_examples = [
("main-packet-header", "True", "True"),
("main-packet-tag", "True", "True"),
- ("red-tests", "True", "True"),
]
# A list of Python examples to run in order to ensure that they remain
diff --git a/src/network/wscript b/src/network/wscript
index 15d4c1eb7..fb6032d64 100644
--- a/src/network/wscript
+++ b/src/network/wscript
@@ -50,7 +50,6 @@ def build(bld):
'utils/pcap-file-wrapper.cc',
'utils/queue.cc',
'utils/radiotap-header.cc',
- 'utils/red-queue.cc',
'utils/simple-channel.cc',
'utils/simple-net-device.cc',
'utils/sll-header.cc',
@@ -77,7 +76,6 @@ def build(bld):
'test/packet-test-suite.cc',
'test/packet-metadata-test.cc',
'test/pcap-file-test-suite.cc',
- 'test/red-queue-test-suite.cc',
'test/sequence-number-test-suite.cc',
'test/packet-socket-apps-test-suite.cc',
]
@@ -134,7 +132,6 @@ def build(bld):
'utils/generic-phy.h',
'utils/queue.h',
'utils/radiotap-header.h',
- 'utils/red-queue.h',
'utils/sequence-number.h',
'utils/sgi-hashmap.h',
'utils/simple-channel.h',
diff --git a/src/network/examples/droptail_vs_red.cc b/src/traffic-control/examples/pfifo-vs-red.cc
similarity index 100%
rename from src/network/examples/droptail_vs_red.cc
rename to src/traffic-control/examples/pfifo-vs-red.cc
diff --git a/src/network/examples/red-tests.cc b/src/traffic-control/examples/red-tests.cc
similarity index 100%
rename from src/network/examples/red-tests.cc
rename to src/traffic-control/examples/red-tests.cc
diff --git a/src/network/utils/red-queue.cc b/src/traffic-control/model/red-queue-disc.cc
similarity index 100%
rename from src/network/utils/red-queue.cc
rename to src/traffic-control/model/red-queue-disc.cc
diff --git a/src/network/utils/red-queue.h b/src/traffic-control/model/red-queue-disc.h
similarity index 100%
rename from src/network/utils/red-queue.h
rename to src/traffic-control/model/red-queue-disc.h
diff --git a/src/network/test/red-queue-test-suite.cc b/src/traffic-control/test/red-queue-disc-test-suite.cc
similarity index 100%
rename from src/network/test/red-queue-test-suite.cc
rename to src/traffic-control/test/red-queue-disc-test-suite.cc