Hello to everybody!
I would know your opinion about my solution.
I'm working in MANET routing context and I'm simulating a simple network made up
by 4 fixed wireless nodes (A,B,C,D) with mac layer 802_11 (dataRate_ set to 
11Mb) 
and a mobile node (E) with mac layer 802_11 but dataRate_ set to 1Mb that moves 
from the
left side to the right side of the network as shown in the next picture:

| A |             | B |            | C |              | D |

----->>----| E |--->>------------->>-----------------

Now I want to check the data throughput for the communication among node A and 
node E and viceversa.
The simulator seams to run correctly but I'm not sure that the current 
implementation
of the mac layer mac-802_11.{h,cc} allows me to deal with this scenario, i.e. 
it allows me to
use different channel capacities in the same wireless network.

The used simulation script is the following one:

# ======================================================================
# Define options
# ======================================================================
# following options are to define a network feature: default values
set opt(chan) Channel/WirelessChannel ;# channel type
set opt(prop) Propagation/TwoRayGround ;# radio-propagation model
set opt(netif) Phy/WirelessPhy ;# network interface type
set opt(mac) Mac/802_11 ;# MAC type
set opt(ifq) Queue/DropTail/PriQueue ;# interface queue type
set opt(ll) LL ;# link layer type
set opt(ant) Antenna/OmniAntenna ;# antenna model
set opt(ifqlen) 50 ;# max packet in ifq
set opt(nn) 5 ;# number of mobilenodes
set opt(rp) OLSR ;# routing protocol
set opt(x) 500 ;# X-dimention for the topology
set opt(y) 550 ;# Y-dimention for the topology
set opt(packetSize) 400 ;# packet size for CBR traffic in Bytes
set opt(rate) 80Kb ;# CBR traffic bit rate
set opt(speed) 3.0 ;# mobile node linear speed in m/sec
set opt(startCBR) 100 ;# CBR flow start time in seconds
set opt(stopCBR) 600 ;# CBR flow end time in seconds
set opt(stopSimulation) 650 ;# Simulation end time in seconds

proc usage {} {
    puts {manet_net.tcl: Usage> ns manet_net.tcl }
    puts {PARAMETERS NEED NOT BE SPECIFIED... DEFAULTS WILL BE USED}
    exit
}
if {[string compare $opt(rp) "OLSR"] == 0} {
                                                                Agent/OLSR set 
use_mac_ true
}
puts "This is a basic manet network"
# =====================================================================
# Main Program
# ======================================================================


# Initialize a network simulator
set ns_ [new Simulator]
set tracefd [open manet_net.tr w]
$ns_ trace-all $tracefd

# Initialize nam trace for netwrok visualization
set namtrace [open manet_net.nam w]
$ns_ namtrace-all-wireless $namtrace $opt(x) $opt(y)

# Set up topography object
set topo [new Topography]
$topo load_flatgrid $opt(x) $opt(y)

# Create God
set god_ [create-god $opt(nn)]
set chan_1_ [new $opt(chan)]

# Create the specified number of mobilenodes [$opt(nn)] and "attach" them
# to the channel.

# Configure the node features
Mac/802_11 set dataRate_ 11Mb
Mac/802_11 set PLCPdataRate_ 11Mb
$ns_ node-config -adhocRouting $opt(rp) \
                         -llType $opt(ll) \
                         -macType $opt(mac) \
                         -ifqType $opt(ifq) \
                         -ifqLen $opt(ifqlen) \
                         -antType $opt(ant) \
                         -propType $opt(prop) \
                         -phyType $opt(netif) \
                         -channel $chan_1_ \
                         -topoInstance $topo \
                         -agentTrace ON \
                         -routerTrace ON \
                         -macTrace OFF \
                         -movementTrace ON

#in order to compute this threshold run the program in 
indeep-utils/propagation/threshold 
#command ./threshold -m TwoRayGround 200

Phy/WirelessPhy set RXThresh_ 1.42681e-08 ;# 100 m
set node_(0) [$ns_ node]
$node_(0) random-motion 0

Phy/WirelessPhy set RXThresh_ 1.42681e-08 ;# 100 m
set node_(1) [$ns_ node]
$node_(1) random-motion 0

Phy/WirelessPhy set RXThresh_ 1.42681e-08 ;# 100 m
set node_(2) [$ns_ node]
$node_(2) random-motion 0

Phy/WirelessPhy set RXThresh_ 1.42681e-08 ;# 100 m
set node_(3) [$ns_ node]
$node_(3) random-motion 0

Phy/WirelessPhy set RXThresh_ 1.42681e-08 ;# 100 m
Mac/802_11 set dataRate_ 1Mb
Mac/802_11 set PLCPdataRate_ 1Mb
$ns_ node-config -adhocRouting $opt(rp) \
                          -llType $opt(ll) \
                          -macType $opt(mac) \
                          -ifqType $opt(ifq) \
                          -ifqLen $opt(ifqlen) \
                          -antType $opt(ant) \
                          -propType $opt(prop) \
                          -phyType $opt(netif) \
                          -channel $chan_1_ \
                          -topoInstance $topo \
                          -agentTrace ON \
                          -routerTrace ON \
                          -macTrace OFF \
                          -movementTrace ON
set node_(4) [$ns_ node]
$node_(4) random-motion 0

# Provide initial (X,Y, for now Z=0) co-ordinates for mobilenodes
# Set of linear x-axis placed nodes
$node_(0) set X_ 5.0 ; $node_(0) set Y_ 495.0
$node_(1) set X_ 103.0 ; $node_(1) set Y_ 495.0
$node_(2) set X_ 201.0 ; $node_(2) set Y_ 495.0
$node_(3) set X_ 299.0 ; $node_(3) set Y_ 495.0
$node_(4) set X_ 5.0 ; $node_(4) set Y_ 460.0

# Apply the initial-position to every nodes in the topology
for {set i 0} {$i < $opt(nn) } {incr i} { 
                                                    $node_($i) random-motion 0 
;# disable random motion
                                                    $ns_ initial_node_pos 
$node_($i) 20 ;# set size of nodes (Only graphical info for nam)
}

# Now produce some simple linear movements for node 11 toward the x-axis
# All the other nodes still to be fixed in place
$ns_ at 200.1 "$node_(4) setdest 389.0 460.0 $opt(speed)"
$ns_ at 400.1 "$node_(4) setdest 5.0 460.0 $opt(speed)"

#Set UDP agent and cbr agent for traffic generation
set udp4 [new Agent/UDP]
$ns_ attach-agent $node_(4) $udp4
$udp4 set class_ 0
set cbr4 [new Application/Traffic/CBR]
$cbr4 attach-agent $udp4
$cbr4 set packetSize_ $opt(packetSize)
$cbr4 set rate_ $opt(rate)

#Set null agent for packet reception
set null4 [new Agent/Null]
$ns_ attach-agent $node_(0) $null4

# Make a connection between UDP and CBR agents
$ns_ connect $udp4 $null4
$ns_ at $opt(startCBR) "$cbr4 start"

# End the scenario
$ns_ at $opt(stopCBR) "$cbr4 stop"
$ns_ at $opt(stopSimulation).0 "puts \"NS EXITING...\" ; $ns_ halt"
$ns_ at $opt(stopSimulation).1 "stop"
proc stop {} {
                    global ns_ tracefd namtrace
                    $ns_ flush-trace
                    close $tracefd
                    close $namtrace
                    # execute NAM using a trace file
                    exec nam manet_net.nam &
}

puts "Starting Simulation..."
$ns_ run


In other words, I would that the fixed nodes communicate among themself using a 
11Mbps channel and that the communication among
a fixed node and a moving one takes place using a 1Mbps channel.
Any help can be very useful and so thank you in advance for your attention!


Best regards,
 Massimo

Reply via email to