[Click] NSClick - performance upgrade for NS-2

Wim Vandenberghe wim.vandenberghe at intec.ugent.be
Wed Jan 18 10:25:22 EST 2012


Hi everyone,

because i am having problems with Nsclick simulations that take forever 
to complete, i have been looking at possible causes. I've identified a 
flaw in the scheduling. Everytime the driver() function of 
routerthread.cc is executed (which is caused by timer expiration or 
packet reception), it schedules itself again in NS-2 if it has a timer 
that is scheduled to go off in the future. As a result, many duplicate 
schedules are introduced for the same node for exactly the same point in 
simulation time. This introduces great overhead when this point in 
simulation time is reached and all these duplicate events have to be 
executed.

I've found a very old post on the mailing list by Michael Neufeld 
(http://pdos.csail.mit.edu/pipermail/click/2004-May/002706.html) which 
presented a hack to overcome this problem. Basically he keeps a global 
map of points in time for which a ClickEvent is scheduled. If a node 
schedules a new event, it will be added to the unique already existing 
event for that given moment in time. During this addition, a check is 
performed to make sure that you schedule a node only once for a single 
point in time.

This code however was never introduced into mainstream click. I have 
implemented a new version which should be compatible with recent Click 
releases. The files can be found in attachment. They have to be put in 
the classifier directory of the NS-2 sources.

Perhaps it would be interesting if some people using NSClick in NS-2 
could try these files, and see if they also observe an improvement in 
performance, and if it does not introduce any bias in the simulation 
results? Also, i have tested it with Click 1.7 (upgrading is still on my 
to-do list) and NS2.34, experience with current git sources would also 
be interesting.

Regards,

Wim


PS: I also noticed that using a QuickNoteQueue instead of a standard 
Queue improves performance since the run_task of the tosimdevice will 
halt quicker when there are
no more packets left in the queue

-- 
Wim Vandenberghe
Department of Information Technology
Internet Based Communication Networks and Services (IBCN)
Ghent University - IBBT
Gaston Crommenlaan 8 (Bus 201), B-9050 Gent, Belgium
T: +32 9 33 14946 ; T Secr: +32 9 33 14900
F: +32 9 33 14899
E: wim.vandenberghe at intec.UGent.be
W : www.ibcn.intec.UGent.be

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: classifier-click.cc
Url: http://amsterdam.lcs.mit.edu/pipermail/click/attachments/20120118/0fa064bf/attachment-0002.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: classifier-click.h
Url: http://amsterdam.lcs.mit.edu/pipermail/click/attachments/20120118/0fa064bf/attachment-0003.txt 


More information about the click mailing list