The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ... The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

nmlab.korea.ac.kr
from nmlab.korea.ac.kr More from this publisher
12.07.2015 Views

Chapter 9Differentiated Services Module in nsNote: The Differentiated Services module described in this chapter has been integrated into ns-2.1b8.Differentiated Services, or DiffServ, is an IP QoS architecture based on packet marking that allows packets to be prioritizedaccording to user requirements. During the time of congestion, more low priority packets are discarded than high prioritypackets. This chapter describes the DiffServ module that was originally implemented by the Advanced IP Networks group inNortel Networks [28].9.1 OverviewThe DiffServ architecture provides QoS by dividing traffic into different categories, marking each packet with a code pointthat indicates its category, and scheduling packets according accordingly. The DiffServ module in nscan support four classesof traffic, each of which has three dropping precedences allowing differential treatment of traffic within a single class. Packetsin a single class of traffic are enqueued into one corresponding physical RED queue, which contains three virtual queues (onefor each drop precedence).Different RED parameters can be configured for virtual queues, causing packets from one virtual queue to be dropped morefrequently than packets from another. A packet with a lower dropping precedence is given better treatment in times ofcongestion because it is assigned a code point that corresponds to a virtual queue with relatively lenient RED parameters.The DiffServ module in nshas three major components:Policy: Policy is specified by network administrator about the level of service a class of traffic should receive in the network.Edge router: Edge router marks packets with a code point according to the policy specified.Core router: Core router examines packets’ code point marking and forwarding them accordingly.DiffServ attempts to restrict complexity to only the edge routers.87

9.2 ImplementationThe procedures and functions described in this section can be found in ~ns/diffserv/dsred, dsredq, dsEdge, dsCore, dsPolicy.{cc,h}.9.2.1 RED queue in DiffServ moduleA DiffServ queue (in class dsREDQueue) derived from the base class Queue is implemented in DiffServ module to providethe basic DiffServ router functionality, see dsred.{h,cc}). dsREDQueue has the following abilities:• to implement multiple physical RED queues along a single link;• to implement multiple virtual queues within a physical queue, with individual set of parameters for each virtual queue;• to determine in which physical and virtual queue a packet is enqueued according to its code point;• to determine in from which physical and virtual queue a packet is dequeued according to the scheduling scheme chosen.The class dsREDQueue consists of four physical RED queues, each containing three virtual queues. The number of physicaland virtual queues are defined in numPrec and numQueues_. Each combination of physical and virtual queue number isassociated with a code point (or a drop preference), which specifies a certain level of service.The physical queue is defined in class redQueue, which enables traffic differentiation by defining virtual queues withindependent configuration and state parameters, see dsredq.{h,cc}. For example, the length of each virtual queue iscalculated only on packets mapped to that queue. Thus, packet dropping decisions can be applied based on the state andconfiguration parameters of that virtual queues. Class redQueue is not equivalent to class REDQueue, which was alreadypresent in ns. Instead, it is a modified version of RED implementation with the notion of virtual queues and is only used byclass redQueue to realize physical queues. All user interaction with class redQueue is handled through the commandinterface of class dsREDQueue.Class dsREDQueue contains a data structure known as the Per Hop Behavior (PHB) Table In DiffServ, edge routers markpackets with code points and core routers simply respond to existing code points; both of them use PHB table to map a codepoint to a particular physical and virtual queue. The PHB Table is defined as an array with three fields:struct phbParam {int codePt_; // corresponding code pointint queue_; // physical queueint prec_; // virtual queue (drop precedence)};9.2.2 Edge and core routersThe DiffServ edge and core routers are defined in class edgeQueue and class coreQueue, which are derived fromclass dsREDQueue, see dsEdge, dsCore.{h,cc}.Packet marking is implemented in class edgeQueue. A packet is marked with a code point according to the policy specifiedbefore it is put into the corresponding physical and virtual queue. Class edgeQueue has a reference to an instance ofclass PolicyClassifier, which contains policies for packet marking.88

9.2 Implement<strong>at</strong>ion<strong>The</strong> procedures <strong>and</strong> functio<strong>ns</strong> described in this section can be found in ~<strong>ns</strong>/diffserv/dsred, dsredq, dsEdge, dsCore, dsPolicy.{cc,h}.9.2.1 RED queue in DiffServ moduleA DiffServ queue (in class dsREDQueue) derived from the base class Queue is implemented in DiffServ module to providethe basic DiffServ router functionality, see dsred.{h,cc}). dsREDQueue has the following abilities:• to implement multiple physical RED queues along a single link;• to implement multiple virtual queues within a physical queue, with individual set of parameters for each virtual queue;• to determine in which physical <strong>and</strong> virtual queue a packet is enqueued according to its code point;• to determine in from which physical <strong>and</strong> virtual queue a packet is dequeued according to the scheduling scheme chosen.<strong>The</strong> class dsREDQueue co<strong>ns</strong>ists of four physical RED queues, each containing three virtual queues. <strong>The</strong> number of physical<strong>and</strong> virtual queues are defined in numPrec <strong>and</strong> numQueues_. Each combin<strong>at</strong>ion of physical <strong>and</strong> virtual queue number isassoci<strong>at</strong>ed with a code point (or a drop preference), which specifies a certain level of service.<strong>The</strong> physical queue is defined in class redQueue, which enables traffic differenti<strong>at</strong>ion by defining virtual queues withindependent configur<strong>at</strong>ion <strong>and</strong> st<strong>at</strong>e parameters, see dsredq.{h,cc}. For example, the length of each virtual queue iscalcul<strong>at</strong>ed only on packets mapped to th<strong>at</strong> queue. Thus, packet dropping decisio<strong>ns</strong> can be applied based on the st<strong>at</strong>e <strong>and</strong>configur<strong>at</strong>ion parameters of th<strong>at</strong> virtual queues. Class redQueue is not equivalent to class REDQueue, which was alreadypresent in <strong>ns</strong>. I<strong>ns</strong>tead, it is a modified version of RED implement<strong>at</strong>ion with the notion of virtual queues <strong>and</strong> is only used byclass redQueue to realize physical queues. All user interaction with class redQueue is h<strong>and</strong>led through the comm<strong>and</strong>interface of class dsREDQueue.Class dsREDQueue contai<strong>ns</strong> a d<strong>at</strong>a structure known as the Per Hop Behavior (PHB) Table In DiffServ, edge routers markpackets with code points <strong>and</strong> core routers simply respond to existing code points; both of them use PHB table to map a codepoint to a particular physical <strong>and</strong> virtual queue. <strong>The</strong> PHB Table is defined as an array with three fields:struct phbParam {int codePt_; // corresponding code pointint queue_; // physical queueint prec_; // virtual queue (drop precedence)};9.2.2 Edge <strong>and</strong> core routers<strong>The</strong> DiffServ edge <strong>and</strong> core routers are defined in class edgeQueue <strong>and</strong> class coreQueue, which are derived fromclass dsREDQueue, see dsEdge, dsCore.{h,cc}.Packet marking is implemented in class edgeQueue. A packet is marked with a code point according to the policy specifiedbefore it is put into the corresponding physical <strong>and</strong> virtual queue. Class edgeQueue has a reference to an i<strong>ns</strong>tance ofclass PolicyClassifier, which contai<strong>ns</strong> policies for packet marking.88

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!