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

Re: Changing the background traffic



> I would like to show throughput on the offered load.
> To accomplish it, I need to increase background traffic during the simulation.
> How can I change the bacakground traffic on the fly.

It's not really clear to me what you mean. If you are dealing with TCP
sources, then you can change the background traffic by turning sources on
or off. So, you could create 10 TCP agent/sink pairs, connect them
appropriately and configure an FTP source to be connected to the agent.
Then you could start 5 of them at time 0.0, and start the remaining ones
at later times. You can also stop them whenever you want.

You could use code like this:
$ns at 0.0 "$ftpsource(0) start"
$ns at 0.0 "$ftpsource(1) start" 
$ns at 0.0 "$ftpsource(2) start"
$ns at 10.0 "$ftpsource(3) start"
$ns at 20.0 "$ftpsource(3) stop"
$ns at 25.0 "$ftpsource(2) stop"
$ns run

If you have some non-adaptive source as background traffic, then you could
use the same approach, or alternatively, you could modify the parameters
associated with background traffic. So, for example, if you have a CBR
source, you could modify the rate of the source using something like the
following:

$ns at 10.0 "$cbrsource set rate_ 5Mb"

[I've never tried changing the parameters of objects at the tcl level when
the simulation is running, but I think it should work.]

Sean.
-----
Sean Murphy,			Email: [email protected]
Teltec Ireland,			Phone: +353-1-7045080
DCU, Dublin 9,			Fax:   +353-1-7045092
Ireland.