[Ns-developers] ns-3-openflow weekly update
Blake Hurd
naimorai at gmail.com
Mon Jun 28 08:44:22 PDT 2010
Thanks for the feedback!
On Mon, Jun 28, 2010 at 4:16 AM, Mathieu Lacage <
mathieu.lacage at sophia.inria.fr> wrote:
Out of curiosity, why would you need to compile your C code as C++ ?
It's perfectly possible to compile your C code with a C compiler and
then to link everything with a C++ linker (I have been doing that for a
while in some of my ns-3 branches).
That's basically what I'm doing with most of the OFSI code, the part that
doesn't need modification: compiling it as a C static library and linking it
to ns-3 via waf. As I studied the code, it seemed the datapath struct and
its dependencies would run best with different ns-3 modules (such as the
ns-3 logger) and could then hook directly into the ns-3 simulation, and this
would require C++. It didn't take too long to convert (all the C that needs
to be C++ is now), and some of the benefits of C++ have shown that so far
this method seems to be the best approach.
It is possible to not do any code translation, but the results would be
unsatisfactory. I could've used tap bridge devices to link all of the OFSI
code indirectly from the ns-3 simulation. However, then the OpenFlow switch
wouldn't be configurable in ns-3, and more importantly, the packets wouldn't
be tracked by ns-3 once sent on the tap device to the OpenFlow switch and
only once received back from it.
Hopefully that answers your question.
Blake
More information about the Ns-developers
mailing list