[ns] Network Emulator

2013-01-31 Thread Bipul Kumar

Hellow , i am looking for help regading this problem


root@bipul-Linux:~/Desktop# nse Emulation1.tcl
warning: no class variable Scheduler/RealTime::adjust_new_width_interval_

see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Scheduler/RealTime::min_bin_width_

TapAgent(_o40): linked sock 6 as READABLE
TCPTapAgent(_o43): sent packet (sz: 40)
TCPTapAgent(_o43): sent packet (sz: 40)
TCPTapAgent(_o43): sent packet (sz: 40)
###
Out put packet data below
root@bipul-Linux:~/Desktop# cat out.tr
+ 1.000118 2 1 tcp 40 --- 0 2.0 1.0 0 0
- 1.000118 2 1 tcp 40 --- 0 2.0 1.0 0 0
r 1.001166 2 1 tcp 40 --- 0 2.0 1.0 0 0
+ 4.000225 2 1 tcp 40 --- 0 2.0 1.0 0 1
- 4.000225 2 1 tcp 40 --- 0 2.0 1.0 0 1
r 4.001263 2 1 tcp 40 --- 0 2.0 1.0 0 1
+ 10.000309 2 1 tcp 40 --- 0 2.0 1.0 0 2
- 10.000309 2 1 tcp 40 --- 0 2.0 1.0 0 2
r 10.001342 2 1 tcp 40 --- 0 2.0 1.0 0 2

##
My .tcl script for network emulation between two computer is

set ns [new Simulator]
$ns use-scheduler RealTime

set f [open out.tr w]
$ns trace-all $f

set entry_node [$ns node]
set exit_node [$ns node]
set tcp_node [$ns node]

$ns simplex-link $entry_node $tcp_node 10Mb 1ms DropTail
$ns simplex-link $tcp_node $exit_node 10M 1ms DropTail

# Configure the entry node
set tap1 [new Agent/TCPTap];   # Create the TCPTap Agent
set bpf [new Network/Pcap/Live];   # Create the bpf
set dev [$bpf open readonly eth0]
$bpf filter src 113.19.128.119 and src port 5000 and dst 113.19.128.22 and
dst port 80
$tap1 network $bpf;# Connect bpf to TCPTap Agent
$ns attach-agent $entry_node $tap1;# Attach TCPTap Agent to the node

# Configure the exit node
set tap2 [new Agent/TCPTap];   # Create a TCPTap Agent
set ipnet [new Network/IP];# Create a Network agent
$ipnet open writeonly
$tap2 network $ipnet;  # Connect network agent to tap agent
$tap2 advertised-window 512
$tap2 extipaddr 113.19.128.119
$tap2 extport 80
$ns attach-agent $exit_node $tap2;# Attach agent to the node.

# Configure the TCP agent
set tcp [new Agent/TCP/FullTcp]
$ns attach-agent $tcp_node $tcp

# Connect the agents.
$ns simplex-connect $tap1 $tcp
$ns simplex-connect $tcp $tap2


$ns at 01.0 $tcp advance 1
$ns at 20.0 finish

proc finish {} {
global ns f nf
$ns flush-trace
close $f
exit 0
}

$ns run


PLease help me in knowing what's wrong as i am unable to see NAM on my
scree and i getting this error in my terminal

Thank you


[ns] Simulating a simple application that does not send/receive data messages

2013-01-31 Thread Alexandros I. Giagkos [alg25]

Dear ns-users,

I am experimenting with ns-2 in order to understand if I can eventually
use it to my project. Here is how I describe my idea:

Some mobile nodes move around a terrain and make use of the wireless
network to exchange some FTP/TCP data between sources and destinations
using AODV.

Here is the unorthodox part:

Each node will have a simple application simulated at its application
layer (lets call it AppAgent). AppAgent will need to be attacked to the
node and its purpose will be to do some calculations using the node
positions (will query the data at some intervals) and data coming from
the network layer, without making use of the network. I mean, the
AppAgent will not send or receive messages through the network. Thus the
AppAgent doesn't have to be attached to a transport layer agent,
TCPAgent or TCPSink, or the equivalent UDP stuff. I see it as being
attached to the node in general.

So based on your experience and knowledge, is it possible to simulate an
application (at the application layer of ns-2), which will do some
interesting stuff by making use of data coming from lower layers of the
stack, but will not require any sending/receiving of data like other
applications such as Telnet for instance?

My other concern is weather this simulated application will take its
share of the internal clock of ns-2, as it has to run while the
simulation is running and perhaps report to the trace file like the rest
of the attached agents. Lets say it will have a start() command, and
will start just after it is attached on its node, at the beginning of
the simulation.

I hope I have described the idea good enough to trigger some answers
from the community. Please let me know if I don't make sense!

Many thanks in advance,
Alexandros



[ns] Creating many wireless nodes

2013-01-31 Thread Rafael P B Mota

How can I create, for instance, 100 wireless nodes in tcl script ?

I tried
set nn 100
for {set i 1} {$i  $val(nn) } { incr i } {
set tag($i) [new Agent/...]
$tag($i) set var1_ $i+10
$tag($i) set time_ 1
$tag($i) set debug_ 0
}

But I am not able to bind the vars. The values are not assigned.
What's my mistake ?

Thanks

--

Rafael Perazzo B Mota
rafaelpera...@gmail.com
Web-page: https://sites.google.com/site/rafaelperazzo/
Doutorando em Ciência da Computação
Universidade de São Paulo (USP)
Campus da Capital
Instituto de Matemática e estatística (IME)
--