[Ns-developers] New branch gjc/ns-3-real
Gustavo Carneiro
gjcarneiro at gmail.com
Tue Jun 15 11:15:13 PDT 2010
http://code.nsnam.org/gjc/ns-3-real/
<http://code.nsnam.org/gjc/ns-3-real/>It contains the new experimental
broadcast socket option (needs review but I can't block on the review), a
new RealUdpSocket class that translates NS-3 Socket API calls into real UDP
sockets, and a RealStackHelper which, at least on Linux, possibly also other
unix systems, detects real host interfaces, together with MAC addresses and
IPv4 address, and adds them to a Node as SimpleNetDevice devices. It's
trivial to get the OLSR model to work on real UDP sockets with this. E.g.:
GlobalValue::Bind ("SimulatorImplementationType", StringValue
("ns3::RealtimeSimulatorImpl"));
GlobalValue::Bind ("ChecksumEnabled", BooleanValue (true));
OlsrHelper olsr;
Ipv4StaticRoutingHelper staticRouting;
Ipv4ListRoutingHelper list;
list.Add (staticRouting, 0);
list.Add (olsr, 10);
RealStackHelper stack;
stack.SetRoutingHelper (list);
Ptr<Node> realNode = CreateObject<Node> ();
stack.Install (realNode);
Simulator::Run ();
You need of course superuser privileges to run this, because of the OLSR
port under 1024 (for instance, I run with sudo
LD_LIBRARY_PATH=$LD_LIBRARY_PATH ./path/to/program, inside a ./waf shell).
Regards,
--
Gustavo J. A. M. Carneiro
INESC Porto, UTM, WiN, http://win.inescporto.pt/gjc
"The universe is always one step beyond logic." -- Frank Herbert
More information about the Ns-developers
mailing list