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

Re: [ns] Re: meaning of time in trace file



On Tue, 17 Jul 2001, George Riley wrote:

> > > Can anyone please tell me the exact meaning of 
> > > the time field in the trace file? I mean:
> > > 
> > > For Send event, the time is: the FIRST bit of the packet 
> > > is going to be sent out, or the LAST bit is just sent out?
> > > 
> > > For Receive event, the time is: the first bit of the packet
> > > is going to be received, or the whole packet is just received?
> > 
> > last in both.
> I disagree.  I believe tx event is FIRST bit out and rx event is LAST bit
> in.

Mea culpa.

I had to think (should have thought) about this; I took
tcl/ex/simple.tcl and set all the link delays in duplex-link lines to
zero. Here's the start of the resulting tracefile.

+ 1 0 2 cbr 210 ------- 0 0.0 3.1 0 0
- 1 0 2 cbr 210 ------- 0 0.0 3.1 0 0
r 1.000336 0 2 cbr 210 ------- 0 0.0 3.1 0 0
+ 1.000336 2 3 cbr 210 ------- 0 0.0 3.1 0 0
- 1.000336 2 3 cbr 210 ------- 0 0.0 3.1 0 0
r 1.001456 2 3 cbr 210 ------- 0 0.0 3.1 0 0
+ 1.00375 0 2 cbr 210 ------- 0 0.0 3.1 1 1
- 1.00375 0 2 cbr 210 ------- 0 0.0 3.1 1 1
r 1.004086 0 2 cbr 210 ------- 0 0.0 3.1 1 1
+ 1.004086 2 3 cbr 210 ------- 0 0.0 3.1 1 1
- 1.004086 2 3 cbr 210 ------- 0 0.0 3.1 1 1
r 1.005206 2 3 cbr 210 ------- 0 0.0 3.1 1 1


So a 210-byte CBR packet arrives on a 5Mb/s link after 0.336ms.

(210*8)/5,000,000 = 0.000336

and that's all serialisation (yesyes, serial but no stop bits, M
really *is* a million). And '-' happens at one second, i.e when the
event is scheduled and the very first bit is sent.

If, as I mistakenly said, it really was last to last, then the packet
would arrive in zero time across a zero-delay link...

L.


>  See code in delay.cc (simplified by me for discussion):
> 
>         double txt = txtime(p);
>         s.schedule(target_, p, txt + delay);
> 
> The txtime is the time it takes to wiggle all the bits out the link,
> starting fromthe first..delay is the link propagation delay.
> 
> Another clue is looking at trace files, and noting that the rx event is
> (txtime  + delay) after the dequeue event for the same pkt.
> 
> George

<L.Wood@surrey.ac.uk>PGP<http://www.ee.surrey.ac.uk/Personal/L.Wood/>