[ns] Asking about configure snoop protocol in wired cum wireless architecture

2010-10-10 Thread AS-SUNDAIS

I have configure script for snoop protocol in wired cum wireless
architecture, but i always failed and got segmentation problem..
can you help me about this problem?
this is my script (just main scenario):

source ../lan/vlan.tcl

Phy/WirelessPhy set freq_ 2.472e9  ;#channel
Phy/WirelessPhy set bandwidth_ 11Mb;#Data Rate
Phy/WirelessPhy set Pt_ 0.28183815   ;#range radio 250m

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(macw)  Mac/802_3
#set opt(mac)Mac/802_11Ext
set opt(ifq)Queue/DropTail/PriQueue;# interface queue type
set opt(ll) LL   ;# link layer type
set opt(lls) LL/LLSnoop   ;# link layer type
set opt(ant)Antenna/OmniAntenna;# antenna model
set opt(ifqlen) 50   ;# max packet in ifq
set opt(nn) 2  ;# number of mobilenodes
set opt(adhocRouting)   DSDV;# routing protocol

set opt(bw)   10Mb
set opt(delay) 1ms
set opt(ifqw) Queue/DropTail
set opt(phy) Phy/WiredPhy
#set opt(node) 2
set opt(chanw) Channel

set opt(cp)  ;# cp file not used
set opt(sc)  ;# node movement file.

set opt(x)  1000   ;# x coordinate of topology
set opt(y)  1000   ;# y coordinate of topology
set opt(seed)   0.0;# random seed
set opt(stop)   15 ;# time to stop simulation

set opt(ftp1-start) 100.0

set num_wired_nodes 2
set num_bs_nodes1;# number of base nodes

# =

if { $opt(x) == 0 || $opt(y) == 0 } {
puts No X-Y boundary values given for wireless topology\n
}
if {$opt(seed)  0} {
puts Seeding Random number generator with $opt(seed)\n
ns-random $opt(seed)
}

set ns_   [new Simulator]
#ns-random 0

$ns_ node-config -addressType hierarchical

AddrParams set domain_num_ 2   ;# number of domains
lappend cluster_num 1 1 ;# number of clusters in each domain
AddrParams set cluster_num_ $cluster_num
lappend eilastlevel 3 3;# number of nodes in each cluster
AddrParams set nodes_num_ $eilastlevel ;# of each domain

set tracefd  [open wireless.tr w]
set namtrace [open wireless.nam w]
$ns_ trace-all $tracefd
$ns_ namtrace-all-wireless $namtrace $opt(x) $opt(y)

set topo   [new Topography]

$topo load_flatgrid $opt(x) $opt(y)

create-god [expr $opt(nn) + $num_bs_nodes]

set temp {0.0.0 0.0.1}   ;# hierarchical addresses
for {set i 0} {$i  $num_wired_nodes} {incr i} {
set W($i) [$ns_ node [lindex $temp $i]]
lappend nodelist $W($i)
}


set chan_1_ [new $opt(chan)]
# Configure for AP1
$ns_ node-config -mobileIP OFF \
 -adhocRouting $opt(adhocRouting) \
 -llType $opt(ll) \
-macType $opt(mac) \
 -ifqType $opt(ifq) \
 -ifqLen $opt(ifqlen) \
 -antType $opt(ant) \
 -propType $opt(prop) \
 -phyType $opt(netif) \
-topoInstance $topo \
 -wiredRouting ON \
-agentTrace ON \
 -routerTrace ON \
 -macTrace OFF \
-channel $chan_1_

set AP1 [$ns_ node 1.0.0]
$AP1 random-motion 0
$AP1 color blue
$AP1 label Akses_point

$AP1 set X_ 500.
$AP1 set Y_ 600.
$AP1 set Z_ 0.

$ns_ node-config -wiredRouting OFF
set client1 [$ns_ node 1.0.1]
set node_(0) $client1
$node_(0) base-station [AddrParams addr2id [$AP1 node-addr]]
$client1 label client1

set client2 [$ns_ node 1.0.2]
set node_(1) $client2
$node_(1) base-station [AddrParams addr2id [$AP1 node-addr]]
$client2 label client2

#coordinate for client2
$client2 set Z_ 0.
$client2 set Y_ 500.
$client2 set X_ 650.

#coordinate for client1
$client1 set Z_ 0.
$client1 set Y_ 500.
$client1 set X_ 500.

set lan [$ns_ newLan $nodelist $opt(bw) \
$opt(delay) -llType $opt(ll) -ifqType $opt(ifqw) \
-macType $opt(macw) -chanType $opt(chanw) -address 0.0.2]

$ns_ duplex-link $W(1) $AP1 10Mb 0.00012 DropTail
$ns_ queue-limit $W(1) $AP1 10

#$ns_ duplex-link-op $W(0) $W(1) orient right
$ns_ duplex-link-op $W(1) $AP1 orient right

#Colors
$ns_ color 0 blue
$ns_ color 1 red
$ns_ color 2 green
$ns_ color 3 magenta

$W(0) label server FTP
$W(1) label PC

set tcp1 [new Agent/TCP/Vegas]

[ns] Fwd: [Help] About configure snoop protocol in wired-cum-wireless architecture

2010-09-13 Thread AS-SUNDAIS

Dear all,

I want to asking how to configure script in ns-2, if we wanna implement's
snoop agent at link layer  in ns-2's wireless network,
because i've always failed, if i implement snoop agent in wireless node that
work as base station (the problem is : segmentation fault)..
but if i simulate snoop agent just in wired network, it works..
i'm using ns version 2.33 as my simulator and simulate wired-cum-wireless
network architecture

Thanks for attention..