next up previous contents index
Next: 22.2.3 Agent and Features Up: 22.2 Ns commands for Previous: 22.2.1 Node

22.2.2 Link/Queue

Links are created between nodes to form a network topology. links are internally simplex, but it is invisible to the users. The trace event ``l'' creates two simplex links and other necessary setups, hence it looks to users identical to a duplex link. Link may have many colors and it can change its color during animation. Queues are constructed in nam between two nodes. Unlike link, nam queue is associated to a simplex link. The trace event ``q'' only creates a queue for a simplex link. In nam, queues are visualized as stacked packets. Packets are stacked along a line, and the angle between the line and the horizontal line can be specified in the trace event ``q''. Commands to setup different animation attributes of a link are as follows:

$ns duplex-link-op attribute value

The <attribute> may be one of the following: orient, color, queuePos. Orient or the link orientation defines the angle between the link and horizontal. The optional orientation values may be difined in degrees or by text like right (0), right-up (45), right-down (-45), left (180), left-up (135), left-down (-135), up (90), down (-90). The queuePos or position of queue is defined as the angle of the queue line with horizontal. Examples for each attribute are given as following :

$ns duplex-link-op orient right      ;# orientation is set as right. The order
                                     ;# in which links are created in nam
                                     ;# depends on calling order of this function.
$ns duplex-link-op color "green"
$ns duplex-link-op queuePos 0.5


next up previous contents index
Next: 22.2.3 Agent and Features Up: 22.2 Ns commands for Previous: 22.2.1 Node

2000-08-24