Posts

Queuing Models in NS2

Image
M/M/1 is a system with poisson arrival time, servicing exponentially and a queue of unlimited capacity and type of FIFO Queue. This is the simplest queuing system.  NS2 supports various distributions like pareto, exponential, constant, unifrom, etc to handle the network dynamics and metrics.So it is very easy to test the given network link to monitor a given queue using any of these queuing models. The listing 3 and 4 are monitoring the link when DropTail queue is used with a capacity of finite and infinite.Listing 13.3 uses infinite capacity and Listing 13.4 uses Finite capacity The output screen shot is shown below the scripts for further understanding
Listing 3 – M/M/1 Queuing Model#new Simulator creationset ns [new Simulator]#trace file creation for capturing the UDP dataset tf [open out.tr w]$ns trace-all $tf
#setting the exponential distribution paramset lambda 30.0set mu     33.0
#creation of nodesset n1 [$ns node]set n2 [$ns node]#The queue limit is 1Lakh as the capacity is infin…

Random Number Generation using ns2

Random variables is an important concept in networks as the modeling of network traffic and other packet arrival times are mostly random models. Hence there is a necessity of modeling such metrics in ns2. NS2 supports various random models using different seed generations.
Seeds are numbers that are helpful in generating the random numbers. The seed number 0 indicates that the random number order changes every time the simulation is running. But other than 0, the order in which the random number generated are same.

The following listing 1 shows the random number generation for various distributions. This listing will just tell you how to create random number generation for various distributions. For seeing the output, refer to listing 2
Listing 1 – Random Number Generation Sample#create the random number generation using RNGset rand1 [new RNG]set rand2 [new RNG]set rand3 [new RNG]#$repli is the value set already and it can be either 1 or <1 or >1for {set i 1} {$i < $repli} {in…

Multicasting in NS2

Image
Mutlicast routing in ns2 can be easily set using any of the following syntax
Method 1:        set ns [new Simulator -multicast on] Method 2:        set ns [new Simulator]        $ns multicast when multicast mode is enabled, the nodes behave differently with the additional classifiers are created. A distribution tree kind of structure is created in the simulation when dealing with multicast routing.  NS supports three types of multicast routing: Centralized Multicast Routing(CM), Dense Mode (DM), Shared Tree Mode (ST) and Bi directional Shared Tree Support (BST). Here is the method to specify the multicast routing in ns.set cmc [$ns mrtproto CtrMcast]    # specify centralized multicast for all nodes;# cmc is the handle for multicast protocol object;$ns mrtproto DM                   # specify dense mode multicast for all nodes;$ns mrtproto ST                  # specify shared tree mode to run on all nodes;
The agents in the protocol can be joining the group or leaving the group f…

Error "bailing in Tcl::eval"

Image
In ns2, if you ever encounter a error like "bailing in Tcl::eval", then it could be due the size of the buffer that Tcl:: eval may offer
By default the buffer size is 1024 and it can be increased to 2048 (for example)

Usually this error will be encountered when you increase the number of nodes in the simulation (for example more than 100 nodes might give you this error)

How to overcome this error? Here is a small workaround
Open the command prompt and go the ns-allinone-2.35/tclcl-1.xx/ folder and open the file Tcl.cc

$] cd ns-allinone-2.35/tclcl-1.20/Tcl.cc (in my case)

in the following function (Line number: 202, change 1024 to 2048) as shown below

void Tcl::eval()
{
char* p = bp_;
bp_ = p + strlen(p) + 1;
/*XXX*/
if (bp_ >= &buffer_[2048]) {
fprintf(stderr, "bailing in Tcl::eval\n");
assert(0);
exit(1);
}
eval(p);
bp_ = p;
}

Once the changes are made, reinstall ns2 itself

$] cd ns-allinone-2.35/
$] ./install 

T S Pradeep Kumar

Internet of Things and 6LoWPAN

Image
This post tells you about the concepts behind
Internet of ThingsWhy we need IoTWhat Demands IoTWhat are the features of 6LoWPAN6LoWPAN characteristics Impact of 6LoWPANOpen Network for IoT6LoWPAN supporting Operating SystemsContiki OS, RIOT OS and Tiny OS Comparison of various OS for IoTA simple demo of CoAP Protocol 
Please see this video 2016-11-23 15.00 Internet of Things and 6LoWPAN from Techgig on Vimeo.


See the Video on Constrained Application Protocol (CoAP) using Contiki OS

T S Pradeep Kumar

Official Google Blog: Meet Google Duo, a simple 1-to-1 video calling app for everyone

OpenFlow in NS3

Image
Installation of OpenFlow in NS3 is a simple task  and here is the method to do that.

NS3 version: ns-3.24.1 and ns-3.25

Assumption: You should have installed #ns3 already in your machine. 

#OpenFlow is a software helpful for Simulating Software Defined Networks (#SDN).

There are some packages needed to enable OpenFlow. Download these packages and try the installation later.

$] sudo apt-get install libboost-all-dev libxml2 libxml2-dev 

Go to the ~ns-allinone-3.24.1/ns-3.24.1 folder and give this command 

$] hg clone http://code.nsnam.org/openflow
(if the above command does not work, the give this command)
$] sudo apt-get install mercurial

$] cd openflow
$] ./waf configure
$] ./waf build 
(if the build failed in the above steps, please give your comments)

$] cd ..
$] ./waf configure --enable-examples --enable-tests --with-openflow=path/to/openflow

In my case 
$] ./waf configure --enable-examples --enable-tests --with-openflow=openflow

After you run the above command, you should get the following scre…