Menu

#53 Getting Negative Values for nlost_ and bytes_

open
nobody
ns-2 (62)
5
2010-03-15
2010-03-15
Anonymous
No

I'm using NS to simulate a network with lots of TCP/FTP and UDP/CBR connections. I'm using the LossMonitor and /TCPSink/Sack1 for the sinks.

Using the Lossmonitor, it seems that the nlost_ variable gets some sort of overflow, at the sudden it becomes a negative value, here's an example:

time bytes_ npkts_ nlost_ ... ... ... ... ...
1092.70 44855790 213599 2145574003 504.00 44729600.0 50348800.0 0.768 1
1092.80 44862090 213629 2145985588 504.00 44736000.0 50358400.0 0.768 1
1092.90 44868600 213660 2146397173 520.80 44742400.0 50368000.0 0.768 1
1093.00 44874900 213690 2146808758 504.00 44748800.0 50377600.0 0.768 1
1093.10 44881200 213720 2147220343 504.00 44755200.0 50387200.0 0.768 1
1093.20 44887920 213752 -2147307929 537.60 44761600.0 50396800.0 0.768 1
1093.30 44894010 213781 -2146923784 487.20 44768000.0 50406400.0 0.768 1
1093.40 44900100 213810 -2146567080 487.20 44774400.0 50416000.0 0.768 1
1093.50 44906820 213842 -2146155500 537.60 44780800.0 50425600.0 0.768 1
1093.60 44913120 213872 -2145743915 504.00 44787200.0 50435200.0 0.768 1

Note the fourth colunn, something very strange happens.

I notice the same happened in the TCPSink/Sack1 at the bytes_ variable. Another example:

time cwnd_ ... bytes_ ...
1881.30 220 220.0 2146771570 11.860363636363639
1881.40 220 218.0 2146969380 11.860363636363639
1881.50 221 225.0 2147073570 11.860363636363639
1881.60 221 221.0 2147295540 11.860363636363639
1881.70 222 222.0 2147339330 11.860363636363639
1881.80 222 219.0 -2147347106 11.860363636363639
1881.90 222 222.0 -2147310866 11.860363636363639
1882.00 223 221.0 -2147149296 11.860363636363639
1882.10 223 230.0 -2146992256 -31224.001861818189
1882.20 224 229.0 -2146990746 -31224.001861818189

Again, in the fourth colunn. It seems that after the number gets over 2 bilion 147 milion and something, it turns to negative.

Discussion

  • Tom Henderson

    Tom Henderson - 2010-06-03

    Update from Lloyd Wood on ns-developers list

    look at ~ns/tools/loss-monitor.cc
    where nlost_ and npkts_ (which is what is really overflowing, I think...) are defined as int, rather than say ulong.

    But binding in ns defaults to int, even when unsigned int might make more sense.

     
  • Nobody/Anonymous

    xDlaKa Really informative blog article. Really Cool.

     
  • Nobody/Anonymous

    Thanks a lot for the blog.Really looking forward to read more. Much obliged.

     
  • Nobody/Anonymous

    I appreciate you sharing this blog post.Really looking forward to read more. Really Cool.

     
  • Nobody/Anonymous

    Thanks again for the article post.Much thanks again. Great.

     
  • Nobody/Anonymous

    I cannot thank you enough for the blog article.Thanks Again. Fantastic.

     
  • Nobody/Anonymous

    I appreciate you sharing this article.Really looking forward to read more. Much obliged.

     

Log in to post a comment.