lua-users home
lua-l archive

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


Hi to all.

I've been using Lua for prototyping and developing communication-heavy
socket-based lightweight apps. Now we are incurring in some complicated
network behavior, and would like to simulate it in a network simulator.
We're evaluating how to use ns-3 (a discret event network simulator
written in C++) [1]. Ideally, we would like to be able to run our
"production" code in the simulator.

I've already got the basic Lua linking, and even bound one function
(pfew!). Now to the interesting part: the socket API. ns-3 socket API
[2] is broadly aligned to BSD sockets, with one major difference: is
asynchronous, where sending and receiving is made trough callbacks. Of
course, that makes sense in a event-driven system. The folks at ns-3 are
working on a blocking API that directly mimics BSD API, to simplify
running "real" apps in the simulator, but there's no promised date. 

So it occurred to me it could be possible to add support for ns-3 right
into LuaSocket. The possibilities of that are mind-boggling (to me, at
least). 

I've looked around, and the platform-dependant code for Unix and Windows
is nicely isolated, and it doesn't seem an awful lot of code. What kind
of work would be to implement that using the ns-3 API? How would it
look? I suppose a dispatcher of some sort would be needed...

Any ideas/insight?


Jorge


[1] http://www.nsnam.org/
[2] http://www.nsnam.org/doxygen/classns3_1_1_socket.html