Skip to content

Simulation and Analysis of Diffserv Network under ns-2

Introduction.

During the last few years the international research community has devoted a lot of effort to develop and standardise a new IP oriented Quality of Service (QoS) architecture called differentiated services (diffserv). Differentiated services was born as a simple, pragmatic and scalable QoS solution as opposed to existing QoS protocols and architectures, such as the resource ReSerVation Protocol (RSVP) – an IP reservation protocol developed at IETF – and ATM (Asynchronous Transfer Mode).

Quality of Service Overview

Quality of Service refers to the capability of a network to provide better service to selected network traffic over various technologies, including Frame Relay, Asynchronous Transfer Mode (ATM), Ethernet, SONET, and IP-routed networks that may use any or all of these underlying technologies. The primary goal of QoS is to provide guarantees including dedicated bandwidth, controlled latency and jitter, and improved loss characteristics.
The term bandwidth refers to the data-clocking rate of the system, typically expressed in bits per second (bps). Dedicating bandwidth allows some of the clock rate to be reserved for certain traffic.

Latency is a measurement of time, specifically, the period of time it takes a data packet to traverse from one point in the network to another.

Jitter is the variation of delay over a period of time. Among the delay components are fixed delay components and variable delay components. Jitter results from the variable delay components, specifically changes in queuing delays at network switches due to variations in the short term network load.

Loss is an attribute of packet networks indicating the probability that an individual packet will be discarded by the network.
Of these QoS attributes, controlling jitter is among the least studied and least understood.

Importance of Quality of Service

The Internet infrastructure was originally developed to move data traffic, such as File Transfer Protocol or E-mail, that had little or no requirements for high levels of Quality of Service (QoS). Hence a best-effort network was acceptable. The success of the World Wide Web and a drive by many towards convergence, the merging of data, voice, and video onto a single network, has led the characteristics of Internet traffic to change. Multimedia traffic is becoming more common. Real-time interactive video conferencing and IP telephony, non-interactive traffic such as video and audio on demand, real time streaming of data such as stock quotes, and other new and developing uses have placed demands on the Internet that the system was not originally designed to meet. Successful implementation of all these services will likely require modifications to the original Internet protocols in order to enable different levels of QoS. The major goal of this research is to investigate one of the key parameters which affects QoS, jitter.

Differentiated Services

While today’s networks generally use FIFO packet servicing, tomorrow’s networks are likely to be carrying a traffic mix best served by multiple classes of service. DiffServ is a standardized approach to providing these multiple classes that is likely to see widespread use in the future. Hence, it is of interest to examine how DiffServ will affect jitter.

The DiffServ approach to providing QoS in networks employs a small, well-defined set of building blocks from which you can build a variety of services. Its aim is to define the Differentiated Services (DS) byte, the Type of Service (ToS) byte from the Internet Protocol (IP) version 4 header and the Traffic Class byte from IP version 6, and mark the standardized DS byte of the packet such that it receives a particular forwarding treatment or per-hop behavior (PHB), at each network node.

Differentiated services  enhancements to the Internet protocol are intended to enable scalable service discrimination in the Internet without the need for per-flow state and signaling at every hop. There is a base set of packet forwarding treatments, or per-hop behaviors.

Expedited Forwarding

Among these PHBs (Per-Hop Behaviors), you can use EF PHB (Expedited Forwarding Per-Hop Behavior) [22] to build a low-loss, low-latency, low-jitter, assured bandwidth, end-to-end service through multiple domains. EF PHB targets applications such as Voice over IP (VoIP) and video conferencing, and services such as virtual leased lines. EF PHB is the highest available in DiffServ, and is best suited for premium services.
EF PHB is defined in RFC 2598 [22] as ‘a forwarding treatment for a particular aggregate where the departure rate of the aggregate’s packets from any node must equal or exceed a configurable rate’.

Implementation of EF PHB

A number of mechanisms might be used to implement the EF PHB. The simplest of these is a priority queue (PQ) where the arrival rate of the queue is strictly less than its service rate.
As jitter comes from the random queuing delays along the path, a feature of this implementation is that EF-marked flows will see reduced jitter at their subscribed rate since packets spend little time in queues.

Priority Queueing

PQ (Priority Queueing) allows you to define how traffic is prioritized in the network. A series of filters based on packet characteristics could be defined to cause the router to place traffic into these queues; the queue with the highest priority is serviced first until it is empty, then the lower queues are serviced in sequence. The next figure shows an example of this PQ (Priority Queuing) [36].

Objectives of Simulation Experiment

The main goals of the diffserv simulation are the following:
Ø the experience in diffserv network design and related issues like network dimensioning and service level agreements
Ø the familiarity with QoS features available on different router platforms and with their implementation details
Ø the definition of QoS features deployment guidelines
Ø parameter tuning, QoS performance measurement, the analysis of end-to-end performance and the validation of the diffserv architecture
Ø the study of interoperability issues
Ø the definition, implementation and analysis of services relevant in the design of production networks
Ø the study of interoperability between IP QoS and ATM classes of services
Ø the study of the integration between the diffserv and the intserv architectures
Ø the experimentation of Bandwidth Brokerage according to the ongoing developments in this area

 

 


 

Important Sections of the ns-2 Simulation Script

 

Setting Some Parameters

set NumberOfServiceProviders 3
set TrafficStartTime 0.5
set SimulationStopTime 10

set CommittedInformationRateOf_ftp_Service 200
set CommittedInformationRateOf_http_Service 200
set CommittedInformationRateOf_VoIP_Service 200

 

 

Creating the User Nodes of the Network

set VoipUserNode [$ns node]
set httpUserNode [$ns node]
set ftpUserNode [$ns node]

SetLabelAndColor $VoipUserNode "VoIP_Service_User" green
SetLabelAndColor $httpUserNode "http_Service_User" brown
SetLabelAndColor $ftpUserNode "ftp_Service_User" gold

 

 

 

Creating the Backbone Routers

set UserSideRouter [$ns node]
set ISPSideRouter [$ns node]

$UserSideRouter label "UserSideRouter"
$UserSideRouter shape hexagon
$UserSideRouter color red

$ISPSideRouter label "ISPSideRouter"
$ISPSideRouter shape hexagon
$ISPSideRouter color red


for {set i 1} {$i <= $NumberOfServiceProviders } {incr i} {
#Create Service Providing Nodes
set ServiceProviderRouter($i) [$ns node]
$ServiceProviderRouter($i) shape hexagon
$ServiceProviderRouter($i) color red
set VoIP_Service_Node($i) [$ns node]
set http_Service_Node($i) [$ns node]
set ftp_Service_Node($i) [$ns node]
SetLabelAndColor $ServiceProviderRouter($i) "ServiceProvider-$i" black
SetLabelAndColor $VoIP_Service_Node($i) "VoIP_Service" green 
SetLabelAndColor $http_Service_Node($i) "http_Service" brown
SetLabelAndColor $ftp_Service_Node($i) "ftp_Service" gold
}

# User Side Connections
$ns simplex-link $VoipUserNode $UserSideRouter 4Mb 10ms dsRED/edge
$ns simplex-link $httpUserNode $UserSideRouter 2Mb 10ms dsRED/edge
$ns simplex-link $ftpUserNode $UserSideRouter 2Mb 10ms dsRED/edge
$ns simplex-link $UserSideRouter $VoipUserNode 4Mb 10ms DropTail
$ns simplex-link $UserSideRouter $httpUserNode 2Mb 10ms DropTail
$ns simplex-link $UserSideRouter $ftpUserNode 2Mb 10ms DropTail

# User to ISP Connection
$ns simplex-link $UserSideRouter $ISPSideRouter 3Mb 15ms dsRED/core
$ns simplex-link $ISPSideRouter $UserSideRouter 3Mb 15ms dsRED/core
$ns simplex-link-op $UserSideRouter $ISPSideRouter queuePos -0.5
$ns simplex-link-op $ISPSideRouter $UserSideRouter queuePos 0.5

# The Service Provider Side Connections
for {set i 1} {$i <= $NumberOfServiceProviders } {incr i} {
$ns simplex-link $ISPSideRouter $ServiceProviderRouter($i) 4Mb 10ms DropTail
$ns simplex-link $ServiceProviderRouter($i) $ISPSideRouter 4Mb 10ms dsRED/edge
$ns duplex-link $ServiceProviderRouter($i) $VoIP_Service_Node($i) 2Mb 10ms DropTail
$ns duplex-link $ServiceProviderRouter($i) $http_Service_Node($i) 2Mb 10ms DropTail
$ns duplex-link $ServiceProviderRouter($i) $ftp_Service_Node($i) 2Mb 10ms DropTail
}

# U2SP - User to Service Provider
# SP2U - Service Provider to User


# Creation of Traffic Sources and Sinks
for {set i 1} {$i <= $NumberOfServiceProviders} {incr i} {
#U2SP VoIP_Service

set udpVoIP_U2SP($i) [new Agent/UDP]
set udpVoIP_U2SPClient($i) [new Agent/Null]
$ns attach-agent $VoipUserNode $udpVoIP_U2SP($i)
$ns attach-agent $VoIP_Service_Node($i) $udpVoIP_U2SPClient($i)
$ns connect $udpVoIP_U2SP($i) $udpVoIP_U2SPClient($i)
$udpVoIP_U2SPClient($i) set fid_ 0

#SP2U VoIP_Service
set udpVoIP_SP2U($i) [new Agent/UDP]
set udpVoIP_SP2UClient($i) [new Agent/Null]
$ns attach-agent $VoipUserNode $udpVoIP_SP2UClient($i)
$ns attach-agent $VoIP_Service_Node($i) $udpVoIP_SP2U($i)
$ns connect $udpVoIP_SP2UClient($i) $udpVoIP_SP2U($i)
$udpVoIP_SP2U($i) set fid_ 1

#http_Service
set tcphttp_ServiceClient($i) [new Agent/TCPSink]
set tcphttp_Server($i) [new Agent/TCP]
$ns attach-agent $httpUserNode $tcphttp_ServiceClient($i)
$ns attach-agent $http_Service_Node($i) $tcphttp_Server($i)
$ns connect $tcphttp_ServiceClient($i) $tcphttp_Server($i)
$tcphttp_Server($i) set fid_ 2

#ftp_Service
set tcpftp_ServiceClient($i) [new Agent/TCPSink]
set tcpftp_Server($i) [new Agent/TCP]
$ns attach-agent $ftpUserNode $tcpftp_ServiceClient($i)
$ns attach-agent $ftp_Service_Node($i) $tcpftp_Server($i)
$ns connect $tcpftp_ServiceClient($i) $tcpftp_Server($i)        
$tcpftp_Server($i) set fid_ 4
}

# Creating Traffic Types

for {set i 1} {$i <=$NumberOfServiceProviders} {incr i} {
#U2SP Traffic
set appVoIP_U2SP($i) [new Application/Traffic/CBR]
$appVoIP_U2SP($i) attach-agent $udpVoIP_U2SP($i)
$appVoIP_U2SP($i) set rate_ 1Mb

#SP2U Traffic
set appVoIP_SP2U($i) [new Application/Traffic/CBR]
$appVoIP_SP2U($i) attach-agent $udpVoIP_SP2U($i)
$appVoIP_SP2U($i) set rate_ 1Mb

#http_Service
set apphttp_Server($i) [new Application/Traffic/Exponential]
$apphttp_Server($i) attach-agent $tcphttp_Server($i)
$apphttp_Server($i) set rate_ 1Mb

#ftp_Service
set appftp_Server($i) [new Application/FTP]
$appftp_Server($i) attach-agent $tcpftp_Server($i)
$appftp_Server($i) set rate_ 1Mb
}


CreateUserISPLink $UserSideRouter $ISPSideRouter
CreateUserISPLink $ISPSideRouter $UserSideRouter
CreateUserSideLink $VoipUserNode $VoipUserNode $UserSideRouter $CommittedInformationRateOf_VoIP_Service "BE"
CreateUserSideLink $httpUserNode $httpUserNode $UserSideRouter $CommittedInformationRateOf_http_Service "EF"
CreateUserSideLink $ftpUserNode $ftpUserNode $UserSideRouter $CommittedInformationRateOf_ftp_Service "EF"

for {set i 1} {$i<=$NumberOfServiceProviders} {incr i} {
CreateUserSideLink $VoIP_Service_Node($i) $ServiceProviderRouter($i) $ISPSideRouter $CommittedInformationRateOf_VoIP_Service "BE"
CreateUserSideLink $http_Service_Node($i) $ServiceProviderRouter($i) $ISPSideRouter $CommittedInformationRateOf_http_Service "EF"
CreateUserSideLink $ftp_Service_Node($i) $ServiceProviderRouter($i) $ISPSideRouter $CommittedInformationRateOf_ftp_Service "EF"
}


 

How the DiffServ Policy Works under ns-2

1. ExpediteForward and BestEffort are user defined array type of variables used just for holding a set of parameters. That is we can set any name for denoting a type of traffic descriptor.

2. The command  “$queues($node1$node2) configQ 1 0 $BestEffort(in_min) $BestEffort(in_max) $BestEffort(in_prob)”

will use the following function in dsred.cc and set the redq_ parameter

 

int dsREDQueue::command(int argc, const char*const* argv) {
if (strcmp(argv[1], "configQ") == 0) {
// modification to set the parameter q_w by Thilo
redq_[atoi(argv[2])].config(atoi(argv[3]), argc, argv);
return(TCL_OK);
}

 

3. The command   “$queues($node1$node2) addPHBEntry $BestEffort(cp) 1 0 ;”

will use the following function in dsred.cc and set some parameters for that flow

 

void dsREDQueue::addPHBEntry(int codePt, int queue, int prec) {
if (phbEntries == MAX_CP) {
printf("ERROR: PHB Table size limit exceeded.\n");
} else {
phb_[phbEntries].codePt_ = codePt;
phb_[phbEntries].queue_ = queue;
phb_[phbEntries].prec_ = prec;
stats.valid_CP[codePt] = 1;
phbEntries++;
}
}

4. The command  “$queues($host$edgeRouter) addPolicerEntry TSW2CM $cp_ $cp_”

will add a policy for the queue to provide diffserv

The Nam Output Showing the Simulated Network Topology

Throughput Comparision

 


Better and constant throughput provided by Diffserv mechanism for VOIP traffic
Sacrificing HTTP traffic and FTP traffic throughputs

The End to End Delay Analysis

 

Low End to End Delay is provided to VoIP Traffic

The Above graph obviously shows the Better performance of DiffServ

Jitter Analysis

Jitter Formula

[1] jitter(i+1) = jitter(i) + |(R(i+1)-S(i+1))-(R(i)-S(i))|
[2] jitter(i+1) = jitter(i) + |(R(i+1)-R(i))-(R(i)-R(i-1))|
[3] jitter(i+1) = jitter(i) + [ |(R(i+1)-S(i+1))-(R(i)-S(i))| – jitter(i) ] / 16
[4] jitter(i+1) = jitter(i) + [ |(R(i+1)-R(i))-(R(i)-R(i-1))| – jitter(i) ] / 16

where S(i) is the time at which packet ‘i’ was transmitted from the sender
R(i) is the time at which packet ‘i’ was received by the destination

Delay Formula

Delay(i+1) = R(i+1) – R(i)

End to End Delay Formula

e2eDelay = The Time at which the packet with (id) is received – The Time at which the packet with (id) is Sent

In the following pages only selected outputs of JitterAnalysis (Jitter 2)  has been presented.

 

The VoIP has very low Jitter

 

 

Conclusion

In this network simulation we have tryied to giving better service to VoIP by using DiffServ mechanism. The arrived results and graphs Proves that VoIP is better served in the case of DiffServ.

The main observations in this proposed experiment are :

  • A constant throughput was experience by VoIP Traffic
  • The End to End Delay was very very low while comparing it with normal network.
  • The Jitter in the case of difserv is low while comparing it with normal network.

Leave a Reply

WhatsApp Discuss Through WhatsApp