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

Re: colours in nams



> set node(0) [$ns node]
> $node(0) color "blue" 
> 
> You can color packets by setting a colorindex corresponding to the packts
> flow ID to a certain color.
> 
> ex:
> $ns color 1 red
> 
> set tcp [new Agent/TCP]		
> $tcp set fid_ 1		
> 
> Will make the packets sent by this tcp agent red.
>   
> 
> I don't know how to color the link :(

You do link color in the same way. E.g.:

$link_($n1:$n2) color "red"

Note the link here should be a simplex-link. To change color of a duplex
link, use:

$ns_ duplex-link-op $n1 $n2 color "red"

You can find more details in ns-2 man page.

- Haobo