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

Re: [ns] TCP Session start and stops



Hello,

you can use a tcl-procedure named done. If you define this procedure for the
whole agent class, it will be called when the last ack is received by the
sender (I am not exactly sure whether this works with start and stop) So you
would get something like:

XXXX instproc done {} {
    global ns
    puts "[$ns now]: Last ACK received"
    $ns at [expr [$ns now] + 5.0] "$self send 1000"
# I am not sure about the expr now + 5.0 part but it should be something
like that
}

This would send 1000 bytes with an interval of 5.0 seconds (from last ACK to
first new sent byte) XXXX of course is the name of the agent (e.g.
Agent/TCP)

For more information, you can look at the done callback for agents in the NS
manual.
Now is a method of a Simulator object which gives the current
simulation-time.,

Hope this helps.

Mark
----- Original Message -----
From: <[email protected]>
To: <[email protected]>
Sent: Monday, December 18, 2000 5:59 PM
Subject: [ns] TCP Session start and stops


>
> hi everyone,
> i have a problem in which i am trying to simulate a number
> of sessions, one after the other, between a source destination pair.
> the idea is to open a TCP connection between the source destination
> pair and
>
> step 1. transfer a file (or a given no. of packets) between them
> step 2. wait for some time say 5 seconds
> step 3. go to step 1
>
> my problem is how do i know, (other than looking in the trace file)
> that my first transfer is over? and is there any way so that i can
> put all this in the .tcl file for the simulator? Thanks,
>
> Biplab Sikdar,
> Grad. Student,
> Dept. of eCSE,
> Rensselaer Polytechnic Inst.,
> Troy NY 12180.
>
>