[Ns-developers] GSoC '10: Click Modular Router Integration
suresh.lalith at gmail.com
Fri Mar 19 05:25:36 PDT 2010
On Tue, Mar 9, 2010 at 2:43 AM, Ruben Merz <ruben at net.t-labs.tu-berlin.de>wrote:
> > 1) As is used in the current implementation, we'll need to implement new
> > Click elements to get packets from the Simulator Devices (FromSimDevice,
> > ToSimDevice, which should replace FromDevice and SimDevice elements
> > respectively). A Kernel tap device is used to send packets from Click to
> If you look at the Click elements, there are already ToSimDevice and
> FromSimDevice elements
> (http://read.cs.ucla.edu/click/elements/tosimdevice.u and
> I'm not sure what you mean with the kernel tap device.
As per the nsclick manual, Kernel tap device (tap0) is used to get packets
to and from the operating system (ToSimDevice (tap0) and FromSimDevice
(tap0) respectively). In the case of ns-3, these would be packets to and
from the traffic generator sink/source.
> > layer above it on the stack (towards the application).
> > 2) The reason why TCP isn't supported in nsclick is because with ns-2,
> > Packets had to be enforced since Click understands only wire frame format
> > packets. In ns-3, this shouldn't be much of a problem since packet
> > are Serialized/Deserialized.
> Not sure. Because you would typically have a traffic generator in ns-3
> feeding a Click configuration, with its outputs to ns-3.
> > 3) A new API should be implemented to allow Click to talk with the ns-3
> > Simulation environment. This includes tracking events, and using the
> > Simulator Time (that is, the value given by Simulator::Now() instead of
> > gettimeofday() to refer to the current time).
> See the --simtime option from Click:
Thanks for that link! Looks very convenient for the integration. I'll get to
reading on it.
> > 4) In an nsclick network interface, a ClickQueue is used between the LL
> > MAC layers. I'm a little confused about this and I am trying to figure it
> > out.
>From what I've understood so far, I believe we need to do something like
1) Use a special RecvCallback at the NetDevice level which will pass on the
packet (to be sent up the stack) to the Click device. FromSimDevice(eth0)
(say) will be used from Click's side to receive the packet.
2) UdpL4Protocol and TcpL4Protocol implementations act as interfaces between
the socket implementation and the IP layer. This implementation can be
modified to pass on and receive packets from an external router like Click.
The Send() and Receive() methods in UdpL4Protocol and TcpL4Protocol are used
by the respective sockets. Click can then receive a packet from above the
stack using FromSimDevice(tap0) and send a packet up the stack using
3) A packet coming down the stack, after being processed by Click, can be
sent out from Click using ToSimDevice(eth0) (say) and then have the
NetDevice send it further down the stack. For this, I believe we'll need to
pass on the packet to the NetDevice' Send() method.
I hope these are the points at which the packet handoffs should be made to
and from Click. The fact that the packets are serialised and deserialised as
required at each layer in ns-3 makes it more convenient to talk with Click.
Furthermore, I'm exploring whether we'd actually need to modify all the
individual devices in devices/ to account for this integration (I know, that
sounds ugly), or if there's a more graceful way of doing it only through
NetDevice itself (Add something like ToClick and FromClick in the base
class, which would be called by only Click nodes instead of the usual Send()
routine and the RecvCallback. This wouldn't require too much changes to the
Now that I'm done with exams, I can focus on this full time! :)
Thanks and regards,
Department of Computer Engineering
Malaviya National Institute of Technology, Jaipur
+91-9982190365 , www.lalith.in
More information about the Ns-developers