33 ns.core.GlobalValue.Bind(
"SimulatorImplementationType", ns.core.StringValue(
"ns3::RealtimeSimulatorImpl"))
34 ns.core.GlobalValue.Bind(
"ChecksumEnabled", ns.core.BooleanValue(
"true"))
41 nodes = ns.network.NodeContainer()
47 wifi = ns.wifi.WifiHelper()
48 wifi.SetStandard (ns.wifi.WIFI_PHY_STANDARD_80211a);
49 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
"DataMode", ns.core.StringValue (
"OfdmRate54Mbps"));
54 wifiMac = ns.wifi.WifiMacHelper
55 wifiMac.SetType (
"ns3::AdhocWifiMac");
60 wifiChannel = ns.wifi.YansWifiChannelHelper.Default()
61 wifiPhy = ns.wifi.YansWifiPhyHelper.Default()
62 wifiPhy.SetChannel(wifiChannel.Create())
67 devices = wifi.Install(wifiPhy, wifiMac, nodes)
73 mobility = ns.mobility.MobilityHelper()
74 positionAlloc = ns.mobility.ListPositionAllocator()
75 positionAlloc.Add(ns.core.Vector(0.0, 0.0, 0.0))
76 positionAlloc.Add(ns.core.Vector(5.0, 0.0, 0.0))
77 mobility.SetPositionAllocator(positionAlloc)
78 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel")
79 mobility.Install(nodes)
89 tapBridge = ns.tap_bridge.TapBridgeHelper()
90 tapBridge.SetAttribute (
"Mode", ns.core.StringValue (
"UseLocal"));
91 tapBridge.SetAttribute (
"DeviceName", ns.core.StringValue (
"tap-left"));
92 tapBridge.Install (nodes.Get (0), devices.Get (0));
98 tapBridge.SetAttribute (
"DeviceName", ns.core.StringValue (
"tap-right"));
99 tapBridge.Install (nodes.Get (1), devices.Get (1));
104 ns.core.Simulator.Stop (ns.core.Seconds (600));
105 ns.core.Simulator.Run(signal_check_frequency = -1)
106 ns.core.Simulator.Destroy()
109 if __name__ ==
'__main__':
110 sys.exit(main(sys.argv))