[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] nam trace of a particular flow - is it possible?



On Thu, 17 Aug 2000, Sean Murphy wrote:

> I'm currently looking at routing of packets using the MNS software in my
> simulation. I'm looking at reasonably large scenarios (250 nodes) and I
> want to ensure that packets are being routed correctly through my
> network. nam seems best suited to this. However, even for short
> simulations, the nam trace files are very large - this means that the sim
> times are quite long and also that they hog large amounts of disk space.

   set nf [open "| gzip -c > output.nam.gz" w]
   $ns namtrace-all $nf

is your friend.

> Ideally, what I would like is for nam to log *just* the events related to
> some particular set of flows that I identify (somehow). Has anyone done
> this before?

I think you could pipe into a filter first that examines the nam stuff
line by line and filters on a colour set by flowid. Not quite as easy
as doing same for .tr stuff...

But really, what I think is needed in ns (a la that debug_
functionality idea allman had) is a global don't-trace or trace flag
(bound var) that is inherited by all created objects, and which can be
set explicitly for each object to tell trace-all and namtrace-all
what to record. So that you can do e.g.

   set ns [new Simulator]
   $ns set trace_ 0 ;# disable all tracing - trace-alls record nothing
   set node0 [$ns node]
   $node0 set trace_ 1 ;# enable tracing just for this node

   set agent0 [new Agent/UDP]
   $agent0 set trace_ 1 ;# enable tracing for this agent.

and have trace-all and namtrace-all pick up on that. Far easier than
postfiltering.

packets created by an agent (which has the trace_ bound
variable) would need to have a new header field saying trace me/don't
trace me.

$ns set trace_ returns 1 if not set, so all events are recorded (as
is the present case).

Since events involve more than one object, and the objects can have
different trace rules, doing the intuitive thing gets a little hard.

Suggestion: 
if the global [$ns trace_] returns 0, then a packet interacting with a
node/link where the objects have different trace values is recorded.

if the global [$ns trace_] returns 1, then a packet interacting with a
node/link where the objects have different trace values is not
recorded.

..and you could schedule flipping the trace_:

$ns at 50.0 "$agent0 set trace_ 0" ;# no longer interested in that 
$ns at 50.0 "$agent1 set trace_ 1" ;# what's that doing?


> I guess in principle, it's not difficult - packets could be checked for a
> particular fid, for example, and if it has one of a set of specified fids
> then all events pertaining to that packet could be logged.

I'd think of enhancing flow-monitor - but that doesn't interact with
nam recording afaik (nsDoc^H^H^H manual 21.7)

L.

<[email protected]>PGP<http://www.ee.surrey.ac.uk/Personal/L.Wood/>