FactoryCategories as FC
from nepi.util.tunchannel_impl import \
preconfigure_tunchannel, postconfigure_tunchannel, \
- wait_tunchannel, create_tunchannel
+ prestart_tunchannel, create_tunchannel
import re
wifi_standards = dict({
helper = testbed_instance.ns3.FdNetDeviceHelper()
helper.EnablePcap(filepath, element, explicitFilename = True)
+def fdascii_trace(testbed_instance, guid, trace_id):
+ node_guid = _get_node_guid(testbed_instance, guid)
+ interface_number = _get_dev_number(testbed_instance, guid)
+ element = testbed_instance._elements[guid]
+ filename = "trace-fd-node-%d-dev-%d.tr" % (node_guid, interface_number)
+ filepath = _follow_trace(testbed_instance, guid, trace_id, filename)
+ helper = testbed_instance.ns3.FdNetDeviceHelper()
+ asciiHelper = testbed_instance.ns3.AsciiTraceHelper()
+ stream = asciiHelper.CreateFileStream(filepath)
+ helper.EnableAscii(stream, element)
+
def yanswifipcap_trace(testbed_instance, guid, trace_id):
dev_guid = testbed_instance.get_connected(guid, "dev", "phy")[0]
node_guid = _get_node_guid(testbed_instance, dev_guid)
"CsmaPcapTrace": csmapcap_trace,
"CsmaPcapPromiscTrace": csmapcap_promisc_trace,
"FdPcapTrace": fdpcap_trace,
+ "FdAsciiTrace": fdascii_trace,
"YansWifiPhyPcapTrace": yanswifipcap_trace,
"WimaxPcapTrace": wimaxpcap_trace,
"WimaxAsciiTrace": wimaxascii_trace,
def configure_device(testbed_instance, guid):
configure_traces(testbed_instance, guid)
-
element = testbed_instance._elements[guid]
parameters = testbed_instance._get_parameters(guid)
ifindex = ipv4.GetInterfaceForPrefix(nexthop_address, ifmask)
if ifindex == ifidx:
break
+ if ifindex == ifidx:
+ break
if ifindex < 0:
# Check previous ptp routes
- for chaindest, chainprefix, chainhop in routes:
+ for chaindest, chainprefix, chainhop, metric in routes:
if chaindest == nexthop and chainprefix == 32:
chainhop_address = ns3.Ipv4Address(chainhop)
for ifidx in xrange(nifaces):
### Factories ###
-factories_order = ["ns3::BasicEnergySource",
+factories_create_order = ["ns3::BasicEnergySource",
"ns3::WifiRadioEnergyModel",
"ns3::BSSchedulerRtps",
"ns3::BSSchedulerSimple",
"ns3::SubscriberStationNetDevice",
]
+factories_configure_order = ["ns3::BasicEnergySource",
+ "ns3::WifiRadioEnergyModel",
+ "ns3::BSSchedulerRtps",
+ "ns3::BSSchedulerSimple",
+ "ns3::UdpTraceClient",
+ "ns3::UdpServer",
+ "ns3::UdpClient",
+ "ns3::FlowMonitor",
+ "ns3::Radvd",
+ "ns3::Ping6",
+ "ns3::flame::FlameProtocol",
+ "ns3::flame::FlameRtable",
+ "ns3::dot11s::AirtimeLinkMetricCalculator",
+ "ns3::dot11s::HwmpProtocol",
+ "ns3::dot11s::HwmpRtable",
+ "ns3::dot11s::PeerManagementProtocol",
+ "ns3::dot11s::PeerLink",
+ "ns3::MeshWifiInterfaceMac",
+ "ns3::MeshPointDevice",
+ "ns3::UanMacRcGw",
+ "ns3::UanMacRc",
+ "ns3::UanPhyCalcSinrDual",
+ "ns3::UanPhyPerGenDefault",
+ "ns3::UanPhyDual",
+ "ns3::UanPropModelThorp",
+ "ns3::UanMacCw",
+ "ns3::UanNoiseModelDefault",
+ "ns3::UanMacAloha",
+ "ns3::UanPropModelIdeal",
+ "ns3::UanTransducerHd",
+ "ns3::UanPhyCalcSinrDefault",
+ "ns3::UanPhyGen",
+ "ns3::UanPhyCalcSinrFhFsk",
+ "ns3::UanPhyPerUmodem",
+ "ns3::UanChannel",
+ "ns3::V4Ping",
+ "ns3::AthstatsWifiTraceSink",
+ "ns3::FlameStack",
+ "ns3::Dot11sStack",
+ "ns3::NonCommunicatingNetDevice",
+ "ns3::HalfDuplexIdealPhy",
+ "ns3::AlohaNoackNetDevice",
+ "ns3::SpectrumAnalyzer",
+ "ns3::WaveformGenerator",
+ "ns3::MultiModelSpectrumChannel",
+ "ns3::SingleModelSpectrumChannel",
+ "ns3::MsduStandardAggregator",
+ "ns3::EdcaTxopN",
+ "ns3::StaWifiMac",
+ "ns3::ApWifiMac",
+ "ns3::QadhocWifiMac",
+ "ns3::MinstrelWifiManager",
+ "ns3::CaraWifiManager",
+ "ns3::AarfcdWifiManager",
+ "ns3::OnoeWifiManager",
+ "ns3::AmrrWifiManager",
+ "ns3::ConstantRateWifiManager",
+ "ns3::IdealWifiManager",
+ "ns3::AarfWifiManager",
+ "ns3::ArfWifiManager",
+ "ns3::WifiNetDevice",
+ "ns3::AdhocWifiMac",
+ "ns3::DcaTxop",
+ "ns3::WifiMacQueue",
+ "ns3::YansWifiChannel",
+ "ns3::YansWifiPhy",
+ "ns3::NistErrorRateModel",
+ "ns3::YansErrorRateModel",
+ "ns3::WaypointMobilityModel",
+ "ns3::ConstantAccelerationMobilityModel",
+ "ns3::RandomDirection2dMobilityModel",
+ "ns3::RandomWalk2dMobilityModel",
+ "ns3::SteadyStateRandomWaypointMobilityModel",
+ "ns3::RandomWaypointMobilityModel",
+ "ns3::GaussMarkovMobilityModel",
+ "ns3::ConstantVelocityMobilityModel",
+ "ns3::ConstantPositionMobilityModel",
+ "ns3::ListPositionAllocator",
+ "ns3::GridPositionAllocator",
+ "ns3::RandomRectanglePositionAllocator",
+ "ns3::RandomBoxPositionAllocator",
+ "ns3::RandomDiscPositionAllocator",
+ "ns3::UniformDiscPositionAllocator",
+ "ns3::HierarchicalMobilityModel",
+ "ns3::aodv::RoutingProtocol",
+ "ns3::UdpEchoServer",
+ "ns3::UdpEchoClient",
+ "ns3::PacketSink",
+ "ns3::OnOffApplication",
+ "ns3::VirtualNetDevice",
+ "ns3::FdNetDevice",
+ "ns3::Nepi::TunChannel",
+ "ns3::TapBridge",
+ "ns3::BridgeChannel",
+ "ns3::BridgeNetDevice",
+ "ns3::EmuNetDevice",
+ "ns3::CsmaChannel",
+ "ns3::CsmaNetDevice",
+ "ns3::PointToPointRemoteChannel",
+ "ns3::PointToPointChannel",
+ "ns3::PointToPointNetDevice",
+ "ns3::BaseStationNetDevice",
+ "ns3::SubscriberStationNetDevice",
+ "ns3::NscTcpL4Protocol",
+ "ns3::Icmpv6L4Protocol",
+ "ns3::Ipv6OptionPad1",
+ "ns3::Ipv6OptionPadn",
+ "ns3::Ipv6OptionJumbogram",
+ "ns3::Ipv6OptionRouterAlert",
+ "ns3::Ipv6ExtensionHopByHop",
+ "ns3::Ipv6ExtensionDestination",
+ "ns3::Ipv6ExtensionFragment",
+ "ns3::Ipv6ExtensionRouting",
+ "ns3::Ipv6ExtensionLooseRouting",
+ "ns3::Ipv6ExtensionESP",
+ "ns3::Ipv6ExtensionAH",
+ "ns3::Ipv6L3Protocol",
+ "ns3::LoopbackNetDevice",
+ "ns3::Icmpv4L4Protocol",
+ "ns3::RttMeanDeviation",
+ "ns3::ArpL3Protocol",
+ "ns3::TcpL4Protocol",
+ "ns3::UdpL4Protocol",
+ "ns3::Ipv4L3Protocol",
+ "ns3::SimpleNetDevice",
+ "ns3::SimpleChannel",
+ "ns3::PacketSocket",
+ "ns3::DropTailQueue",
+ "ns3::Node",
+ "ns3::FriisSpectrumPropagationLossModel",
+ "ns3::Cost231PropagationLossModel",
+ "ns3::JakesPropagationLossModel",
+ "ns3::RandomPropagationLossModel",
+ "ns3::FriisPropagationLossModel",
+ "ns3::TwoRayGroundPropagationLossModel",
+ "ns3::LogDistancePropagationLossModel",
+ "ns3::ThreeLogDistancePropagationLossModel",
+ "ns3::NakagamiPropagationLossModel",
+ "ns3::FixedRssLossModel",
+ "ns3::MatrixPropagationLossModel",
+ "ns3::RangePropagationLossModel",
+ "ns3::RandomPropagationDelayModel",
+ "ns3::ConstantSpeedPropagationDelayModel",
+ "ns3::RateErrorModel",
+ "ns3::ListErrorModel",
+ "ns3::ReceiveListErrorModel",
+ "ns3::PacketBurst",
+ "ns3::EnergySourceContainer",
+ "ns3::BSSchedulerRtps",
+ "ns3::BSSchedulerSimple",
+ "ns3::SimpleOfdmWimaxChannel",
+ "ns3::SimpleOfdmWimaxPhy",
+ "ns3::UplinkSchedulerMBQoS",
+ "ns3::UplinkSchedulerRtps",
+ "ns3::UplinkSchedulerSimple",
+ "ns3::IpcsClassifierRecord",
+ "ns3::ServiceFlow",
+ ]
+
+
factories_info = dict({
"ns3::Ping6": dict({
"category": FC.CATEGORY_APPLICATIONS,
"help": "Network interface associated to a file descriptor",
"connector_types": ["node", "->fd"],
"box_attributes": ["Address",
- "LinuxSocketAddress",
- "tun_proto", "tun_addr", "tun_port", "tun_key"],
- "traces": ["fdpcap"],
+ "tun_proto", "tun_addr", "tun_port", "tun_key", "tun_cipher_fdnd"],
+ "traces": ["fdpcap", "fdascii"],
"tags": [tags.INTERFACE, tags.ALLOW_ADDRESSES],
}),
"ns3::Nepi::TunChannel": dict({
"create_function": create_tunchannel,
"preconfigure_function": preconfigure_tunchannel,
"configure_function": postconfigure_tunchannel,
- "prestart_function": wait_tunchannel,
+ "prestart_function": prestart_tunchannel,
"help": "Channel to forward FdNetDevice data to "
"other TAP interfaces supporting the NEPI tunneling protocol.",
"connector_types": ["fd->", "udp", "tcp"],
"allow_addresses": False,
- "box_attributes": ["tun_proto", "tun_addr", "tun_port", "tun_key"],
+ "box_attributes": ["tun_proto", "tun_addr", "tun_port", "tun_key","tun_cipher"],
"tags": [tags.TUNNEL],
}),