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