Skip to main content

Posts

Showing posts from July, 2018

Energy Model in ns2 - NS2 Tutorial # 6

LEcture 6 - Ns2 Energy Model



Wireless NEtworking in ns2



By default, nodes have infinite energy, to make it finite, we need to implement energy model.



in the node config we need to include the following lines



-energyModel "EnergyModel" \

-initialEnergy 3.0 \

-txPower 0.9 \

-rxPower 0.5 \

-idlePower 0.45 \

-sleepPower 0.05 \



Energy (joules) = Power (Watts) * Time (sec)



www.nsnam.com for downloading the source codes

Also subscribe to my youtube channel



www.youtube.com/tspradeepkumar



Thanks for watching. Stay Tuned for more Lectures...



Subscribe and Share.











Copy the Source Code here



#Lecture 6 

#Example of Wireless networks

#Step 1 initialize variables

#Step 2 - Create a Simulator object

#step 3 - Create Tracing and animation file

#step 4 - topography

#step 5 - GOD - General Operations Director

#step 6 - Create nodes

#Step 7 - Create Channel (Communication PATH)

#step 8 - Position of the nodes (Wireless nodes needs a location)

#step 9 - Any mobility codes (if the nodes are moving)

#step 10 - TCP,…

Wireless network Coding in ns2 - NS2 Tutorial # 5

This post shows you how to write TCL code for Wireless simulations in ns2. It also explains the various aspects of wireless network.

It is part of a lecture series in network simulator 2.

The following image is shown for explanation

Download the Source code for Wireless Networks

#Example of Wireless networks
#Step 1 initialize variables
#Step 2 - Create a Simulator object
#step 3 - Create Tracing and animation file
#step 4 - topography
#step 5 - GOD - General Operations Director
#step 6 - Create nodes
#Step 7 - Create Channel (Communication PATH)
#step 8 - Position of the nodes (Wireless nodes needs a location)
#step 9 - Any mobility codes (if the nodes are moving)
#step 10 - TCP, UDP Traffic
#run the simulation

#initialize the variables
set val(chan)           Channel/WirelessChannel    ;#Channel Type
set val(prop)           Propagation/TwoRayGround   ;# radio-propagation model
set val(netif)          Phy/WirelessPhy            ;# network interface type WAVELAN DSSS 2.4GHz
set val(mac)            Ma…

Wired Network Coding in ns2 - NS2 Tutorial # 4

This post shows the wired network coding in ns2. It uses 6 nodes ( 0 to 5) and exchange FTP/CBR packets between the nodes.
Please find the coding here. 

Wired Coding in ns2 (with comments and explanation, for detailed explanation see the video at the end)
#please subscribe #www.youtube.com/tspradeepkumar #Thank you
#create a simulator object  set ns [new Simulator]
#create a trace file, this file is for logging purpose  set tracefile [open wired.tr w] $ns trace-all $tracefile
#create a animation infomration or NAM file creation set namfile [open wired.nam w] $ns namtrace-all $namfile
#create nodes set n0 [$ns node] set n1 [$ns node] set n2 [$ns node] set n3 [$ns node] set n4 [$ns node] set n5 [$ns node]
#creation of link between nodes with DropTail Queue #Droptail means Dropping the tail. $ns duplex-link $n0 $n1 5Mb 2ms DropTail $ns duplex-link $n2 $n1 10Mb 5ms DropTail $ns duplex-link $n1 $n4 3Mb 10ms DropTail $ns duplex-link $n4 $n3 100Mb 2ms DropTail $ns duplex-link $n4 $n5 4Mb 10ms DropTail
#creation of A…

Wired Networks Design - NS2 Tutorial # 3

Introduction to NS2 - NS2 Tutorial # 1

Video Lecture Channel







Subscribe to My YouTube Channels

Tech Channel

Travel Channel