Ns2 Code for Wireless Network

How to Implement Wireless Network Simulation using Ns2 code

What is Wireless Network?How to Write Ns2 code for Wireless Network?

Wireless network is a communication system which transmits and recieves radio signals through air medium.Wireless Network generally refers to Wifi networks or 3g/4g data services. We have successfully accomplished more than 25+ Wireless network simulation using ns2 code. Research scholars and Engineering students who require Ns2 Code for Wireless Network can communicate us for customized project work.

 

Architecture-of-Wireless-Network

Characteristics of wireless network:

Some of the inherent characteristics of wireless network are as follows:

  • Wireless communications system provides new smart services like SMS and MMS.
  • It supports mobility.
  • Using wireless network system you can provide services any where any time access.
  • Greater reach-ability.
  • Flexibility.Investment is low to Set-up.
  • Easily Re-modify.
  • simplicity .

Merits of  Ns2 code for wireless network:

  •  Security is provided among wireless networks which  implements firewall concept into the wireless network
  • Cost is much cheaper compared to wired network.
  • Access the network in convenience manner
  • Wireless networks can serve a suddenly-increased number of clients with the existing equipment.

NS2 Projects Video Output

See our Latest Video Output of Ns2 Projects on Various Domain.

Ns2 Projects

Customized NS2 Projects for B.E/B.Tech/M.E/M.Tech/Ms/PhD Scholars.

Ns2 Projects Screen Shots

Ns2 Projects Screen Shots.Regular Update of NS2 Projects Screenshots here!

Download Sample Ns2 Code for Wireless Network



set val(chan)           Channel/WirelessChannel    ;# channel type 
set val(prop)           Propagation/TwoRayGround   ;# radio-propagation model 
set val(netif)          Phy/WirelessPhy            ;# network interface type 
set val(mac)            Mac/802_11                 ;# MAC type 
set val(ifq)            Queue/DropTail/PriQueue    ;# interface queue type 
set val(ll)             LL                         ;# link layer type 
set val(ant)            Antenna/OmniAntenna        ;# antenna model 
set val(ifqlen)         50                         ;# max packet in ifq 
set val(nn)             3                         ;# number of mobilenodes 
set val(rp)             DSR                       ;# routing protocol 
set val(x)              1200  			   ;# X dimension of topography 
set val(y)              1000   			   ;# Y dimension of topography   
set val(stop)		50			   ;# time of simulation end 
set val(err)        UniformErrorProc 
# Set up topography object 
#------------------------------------------- 
set ns		  [new Simulator] 
set tracefd       [open simple.tr w] 
set windowVsTime2 [open win.tr w]  
set namtrace      [open simwrls.nam w]  
$ns use-newtrace 
$ns trace-all $tracefd 
$ns namtrace-all-wireless $namtrace $val(x) $val(y) 
 
# set up topography object 
set topo       [new Topography] 
 
$topo load_flatgrid $val(x) $val(y) 
 
 
 
 
proc UniformErrorProc {} { 
	puts "dfdfad-----------------------------" 
	set err [new ErrorModel] 
	$err unit pkt 
	 
	$err set rate_ 0.1 
	 
	return $err 
}	 
	 
 
create-god $val(nn) 
 
 
 
$ns node-config -adhocRouting $val(rp) \ 
			 -llType $val(ll) \ 
			 -macType $val(mac) \ 
			 -ifqType $val(ifq) \ 
			 -ifqLen $val(ifqlen) \ 
			 -antType $val(ant) \ 
			 -propType $val(prop) \ 
			 -phyType $val(netif) \ 
			 -channel [new $val(chan)] \ 
			 -topoInstance $topo \ 
			 -agentTrace ON \ 
			 -routerTrace OFF \ 
			 -macTrace OFF \ 
			 -movementTrace OFF \ 
			 -IncomingErrProc $val(err)\ 
			 -OutgoingErrProc $val(err)			  
 
#			 -IncomingErrorProc ($err) \ 
#			 -OutcomingErrorProc UniformErrorProc	 
  
for {set i 0} {$i < $val(nn) } { incr i } { 
	set node_($i) [$ns node]	 
} 
 
 
 
$node_(0) set X_ 600.0 
$node_(0) set Y_ 500.0 
$node_(0) set Z_ 0.0 
 
$node_(1) set X_ 800.0 
$node_(1) set Y_ 400.0 
$node_(1) set Z_ 0.0 
 
$node_(2) set X_ 1000.0 
$node_(2) set Y_ 400.0 
$node_(2) set Z_ 0.0 
 
 
set tcp [new Agent/TCP/Newreno] 
$tcp set class_ 2 
set sink [new Agent/TCPSink] 
$ns attach-agent $node_(0) $tcp 
$ns attach-agent $node_(2) $sink 
$ns connect $tcp $sink 
set ftp [new Application/FTP] 
$ftp attach-agent $tcp 
$ns at 1.0 "$ftp start"  
 
set cbr_(0) [new Application/Traffic/CBR] 
$cbr_(0) set packetSize_ 200 
$cbr_(0) set interval_ 0.01 
$cbr_(0) set random_ 1 
$cbr_(0) set maxpkts_ 10000 
$cbr_(0) attach-agent $udp_(0) 
 
$ns connect $udp_(0) $null_(0) 
$ns at 11.0 "$cbr_(0) start" 
# Printing the window size 
proc plotWindow {tcpSource file} { 
	global ns 
	set time 5.00 
	set now [$ns now] 
	set cwnd [$tcpSource set cwnd_] 
	puts $file "$now $cwnd" 
	$ns at [expr $now+$time] "plotWindow $tcpSource $file" } 
	$ns at 10.1 "plotWindow $tcp $windowVsTime2"   
 
# Define node initial position in nam 
	for {set i 0} {$i < $val(nn)} { incr i } { 
# 30 defines the node size for nam 
	$ns initial_node_pos $node_($i) 30 
} 
 
# Telling nodes when the simulation ends 
for {set i 0} {$i < $val(nn) } { incr i } { 
    $ns at $val(stop) "$node_($i) reset"; 
} 
 
 
proc stop {} { 
    global ns tracefd namtrace 
    $ns flush-trace 
    close $tracefd 
    close $namtrace 
} 
 	 
$ns run 


Journal Support for Research Scholars
NS2 Projects Journal support
Ns2 Projects Work Progress
  • MANET – Mobile Ad Hoc Network 95%
  • VANET – Vechicle Ad Hoc Netwok 97%
  • LTE – Long Term Evolution 78%
  • IoT – Internet of Things 90%
  • Wireless Sensor Network 89%
  • Network Security 89%
  • Ns2 Attacks 96%
  • Cognitive Radio Network 85%
  • Parallel and Distributed Computing 73%
  • SDN – Software Defined Networking 95%
  • P2P , Video Streaming , Peersim 96%
  • IPV4 , IPV6 88%
  • 4G Network , 5G Network 80%
  • Visual , Underwater Sensor Network 79%
  • Multicasting Communication 84%
  • Wimax, WiFi 90%
  • OFDMA 94%
Our Achievements – Ns2 Projects
Ns2 Projects Achievements