|
Example:
set tcp1 [new Agent/TCP/Reno] |
|
Example:
set sink1 [new Agent/TCPSink] |
They can be attached to any Node object
$ns attach-agent NODE TCP-Agent |
set ns [new Simulator] set node1 [$ns node] set tcp1 [new Agent/TCP/Reno] $ns attach-agent $node1 $tcp1 |
We need to tell NS the destination of each sending Transport Agent.
The destination must be a receiving Transport Agent.
set ns [new Simulator] set tcp1 [new Agent/TCP/Reno] set sink1 [new Agent/TCPSink] (tcp1 and sink1 must also be attached to nodes, this step is omitted) $ns connect $tcp1 $sink1 |
This will make NS route all packets from the source tcp1 towards the destination sink1
set tcp1 [new Agent/TCP/Reno] $tcp1 set packetSize_ 552 |
Example:
set tcp1 [new Agent/TCP/Reno] set pksize [$tcp1 set packetSize_] // get packetzise used |