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

[ns] How to monitor TCP througput?



Hi,

I'm a _very_ novice user of ns, and have a problem with monitoring TCP traffic.
I've been searching the mailing list for an answer, but didn't find one. (The
question I have is not a new one though: it has been asked before (see
http://www-mash.cs.berkeley.edu/dist/archive/ns-users/0002/0030.html). But the
replies never really provided a solution to the problem, I think.)

QUESTION:
How can TCP throughput be monitored?
When you want to create a TCP flow, you attach an Agent/TCP to the source node,
and an Agent/TCPSink to the destination node, and connect them, right?
So where do you have to insert the Agent/LossMonitor, which should give you
the bytes_ received etc.?

Kind regards,
Chris.


P.S.: Code fragment illustrating problem:
# create tcp agents and loss monitor
set tcp0 [new Agent/TCP]
set tcpsink0 [new Agent/TCPSink]
set sink0 [new Agent/LossMonitor]
set ftp0 [new Application/FTP]

# attach agents
$ns attach-agent $n0 $tcp0
$ftp attach-agent $tcp0
$ns attach-agent $n1 $tcpsink0
$ns connect $tcp0 $tcpsink0
# AND NOW???
# WHERE SHOULD I ATTACH/CONNECT LOSSMONITOR sink0???