Hi Ns-Users,
Thank you Teerawat for your reply, but in my simulation, from 0-3.4
seconds th-uid() is positive but from 3.4 it goes negative. I think the
most probably reason is that the packet uid space exhausts, but then why
doesn't it shows some error. Any ways even if it goes exhausts is there
any way to wrap around the uid's , I mean renew all the uid's.
Thanks again,
Regards,
Amit Soni
email id: [EMAIL PROTECTED]
Hi Amit,
Negative UID is a common mechanism in NS2. NS2 uses the scheduler to keep
track of event. The mechanism is as follows:
1. When you schedule an event at a certain time, a positive uid_
value is assigned to the event.
2. When the event is executed, the uid_ is revert to its negative value.
3. Again, when you create another event, a new event with positive uid_
is created.
Having negative uid_ simply means that the packet (or event) is being
executed (e.g., transmitted to another node).
Best,
Teerawat
P.S. There is one book for NS2. If you are interested, please check the
following link
http://www.springer.com/engineering/signals/book/978-0-387-71759-3?detailsPage=otherBooksCIPageCounter=CI_MORE_BOOKS_BY_AUTHOR0
On 6/6/2008, Amit Soni [EMAIL PROTECTED] wrote:
Hello Ns-Users,
I am simulating Large Ethernet LAN over ns2 and wanted to trace packets
that are ready to be send in to the channel. Since ns2 does not support
this type of trace I have to change the code of mac-802_3.cc to know when
and which packets are ready to be dumped in to the channel.
Following is the code in mac-802_3.cc::
hdr_cmn *th = hdr_cmn::access(p);
hdr_mac *mh= HDR_MAC(p);
mytrace+2\t\tth-uid()\t\t(Scheduler::instance().clock())\t\tt\t\tth-size()\t\tmh-macDA()\t\tmh-macSA()'\n';
Following are my specification of network::
Bandwidth of the LAN: 10Mb
Number of nodes: 2002
Delay: 0.025ms
1001 nodes are cbr agents and 1001 nodes are null.
Following line is used to make LAN::
set lan_ [$ns make-lan -trace on $nodelist 10Mb .025ms LL Queue/DropTail
Mac/802_3 Channel Phy/WiredPhy ]
I am Simulating just for 5 seconds and after around 3.4 seconds or so I
started getting th-uid() as negative. And the uid of the packet just
before negative uid is 2147453588. Please point me where I am going
wrong.
I would greatly appreciate any suggestions.
Thanks,
Regards,
Amit Soni
email id: [EMAIL PROTECTED]