NAM Coding

Turn on nam tracing in your Tcl script
        - As easy as turning on normal tracing
$ns namtrace $file

Specify link orientation (or node position for
wireless)
$ns duplex-link-op $node1 $node2 orient left

Execute nam
exec nam $filename


Node options — color, shape, label
$node color red
$node shape hexagon
$node label “my text”
$node label-color blue
$node label-at up

Link options
$ns duplex-link-op $n1 $n2 color green
$ns duplex-link-op queuePos right
$ns duplex-link-op $n1 $n2 label “my text”
$ns duplex-link-op $n1 $n2 label-color blue
$ns duplex-link-op $n1 $n2 label-at down

Packet colors
$ns color $n blue
$agent set fid_ $n

Annotation
$ns at $time “$ns trace-annotate $text”

Control playback
$ns set-animation-rate 3ms