#5, First Floor, 4th Street , Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 pro@slogix.in

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • pro@slogix.in
  • +91- 81240 01111

Social List

How to create wireless mesh network in ns2?

Description

Wireless Mesh Network (WMN) has its potential in many practical applications such as battlefield surveillance, file sharing and so on. WMN consists of mesh routers, mesh clients, and gateway. In file mesh_network.tcl, mesh routers and gateway are static nodes and mesh clients are mobile devices.

Sample Code

#Filename: mesh_network.tcl

proc MeshRouters {} {
if { $a < [expr $rc + 1] } {
for {set i $f} {$i < $a } { incr i } {
set xx($i) [expr $xx([expr $i – 1]) + 150]
set yy($i) $yy([expr $i – 1])
$node_($i) set X_ $xx($i)
$node_($i) set Y_ $yy($i)
}
set f [expr $a + 1]
set a [expr $f + [expr $column -1]]
}
}
proc MeshClients {} {
for {set i $rc } {$i < $val(nn) } { incr i } {
set xx($i) [expr rand()*$val(x)]
set yy($i) [expr [expr rand()*300] + 200]
$ns at $tm "$node_($i) setdest $xx($i) $yy($i) 500"
}
}

 


Screenshots