5b1bca72b2d2c6f69059f1dfafb6bfb7ff8d08c2
[nepi.git] / src / nepi / testbeds / ns3 / metadata_v3_9_RC3.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 from constants import TESTBED_ID
5 from nepi.core import metadata
6 from nepi.core.attributes import Attribute
7 from nepi.util.constants import AF_INET, STATUS_NOT_STARTED, STATUS_RUNNING, \
8         STATUS_FINISHED
9
10 wifi_standards = dict({
11     "WIFI_PHY_STANDARD_holland": 5,
12     "WIFI_PHY_STANDARD_80211p_SCH": 7,
13     "WIFI_PHY_STANDARD_80211_5Mhz": 4,
14     "WIFI_PHY_UNKNOWN": 8,
15     "WIFI_PHY_STANDARD_80211_10Mhz": 3,
16     "WIFI_PHY_STANDARD_80211g": 2,
17     "WIFI_PHY_STANDARD_80211p_CCH": 6,
18     "WIFI_PHY_STANDARD_80211a": 0,
19     "WIFI_PHY_STANDARD_80211b": 1
20 })
21
22 ### Connection functions ####
23
24 def connect_node_device(testbed_instance, node, device):
25     node.AddDevice(device)
26
27 def connect_queue_device(testbed_instance, queue, device):
28     device.SetQueue(queue)
29
30 def connect_manager_device(testbed_instance, manager, device):
31     device.SetRemoteStationManager(manager)
32
33 def connect_phy_device(testbed_instance, phy, device):
34     device.SetPhy(phy)
35     phy.SetDevice(device)
36     # search for the node asociated with the device
37     node_guid = testbed_instance.get_connected(guid, "node", "devs")
38     if len(node_guid) == 0:
39         raise RuntimeError("Can't instantiate interface %d outside netns \
40                 node" % guid)
41     node = testbed_instance.elements[node_guid[0]]
42     phy.SetMobility(node)
43
44 def connect_mac_device(testbed_instance, mac, device):
45     device.SetMac(mac)
46
47 def connect_errormodel_device(testbed_instance, model, device):
48     device.SetReceiveErrorModel(model)
49
50 def connect_errormodel_phy(testbed_instance, err, phy):
51     phy.SetErrorRateModel(err)
52
53 def connect_channel_device(testbed_instance, channel, device):
54     device.Attach(channel)
55
56 def connect_simple_channel_device(testbed_instance, channel, device):
57     device.SetChannel(channel)
58
59 def connect_loss_channel(testbed_instance, loss, channel):
60     channel.SetPropagationLossModel(loss)
61
62 def connect_next_loss(testbed_instance, prev, next):
63     prev.SetNext(next)
64
65 def connect_delay_channel(testbed_instance, delay, channel):
66     channel.SetPropagationDelayModel(delay)
67
68 def connect_node_application(testbed_instance, node, application):
69     node.AddApplication(application)
70 # works for ArpL3Protocol, Ipv4L3Protocol, UdpL4Protocol, TcpL4Protocol,
71 # NscTcpL4Protocol, MobilityModel (every subclass), 
72 # RoutingProtocol (every subclass)
73
74 def connect_node_other(tesbed_instance, node, other):
75     node.AggregateObject(other)
76  
77  ### create traces functions ###
78
79 def get_node_guid(testbed_instance, guid):
80     node_guid = testbed_instance.get_connected(guid, "node", "devs")[0]
81     return node_guid
82
83 def get_dev_number(testbed_instance, guid):
84     dev_guids = testbed_instance.get_connected(node_guid, "devs", "node")
85     interface_number = 0
86     for guid_ in dev_guids:
87         if guid_ == guid:
88             break
89         inteface_number += 1
90     return interface_number
91
92 def p2pcap_trace(testbed_instance, guid):
93     trace_id = "p2ppcap"
94     node_guid = get_node_guid(testbed_instance, guid)
95     interface_number = get_dev_number(testbed_instance, guid)
96     element = testbed_instance._elements[guid]
97     filename = "trace-p2p-node-%d-dev-%d.pcap" % (node_name, interface_number)
98     testbed_instance.follow_trace(guid, trace_id, filename)
99     filepath = testbed_instance.trace_filename(self, guid, trace_id):
100     helper = testbed_instance.ns3.PointToPointHelper()
101     helper.EnablePcap(filepath, element, explicitFilename = True)
102
103 def _csmapcap_trace(testbed_instance, guid, trace_id, promisc):
104     node_guid = get_node_guid(testbed_instance, guid)
105     interface_number = get_dev_number(testbed_instance, guid)
106     element = testbed_instance._elements[guid]
107     filename = "trace-csma-node-%d-dev-%d.pcap" % (node_name, interface_number)
108     testbed_instance.follow_trace(guid, trace_id, filename)
109     filepath = testbed_instance.trace_filename(self, guid, trace_id):
110     helper = testbed_instance.ns3.CsmaHelper()
111     helper.EnablePcap(filepath, element, promiscuous = promisc, 
112             explicitFilename = True)
113
114 def csmapcap_trace(testbed_instance, guid):
115     trace_id = "csmapcap"
116     promisc = False
117     _csmapcap_trace(testbed_instance, guid, trace_id, promisc)
118
119 def csmapcap_promisc_trace(testbed_instance, guid):
120     trace_id = "csmapcap_promisc"
121     promisc = True
122     _csmapcap_trace(testbed_instance, guid, trace_id, promisc)
123
124 def fdpcap_trace(testbed_instance, guid):
125     trace_id = "fdpcap"
126     node_guid = get_node_guid(testbed_instance, guid)
127     interface_number = get_dev_number(testbed_instance, guid)
128     element = testbed_instance._elements[guid]
129     filename = "trace-fd-node-%d-dev-%d.pcap" % (node_name, interface_number)
130     testbed_instance.follow_trace(guid, trace_id, filename)
131     filepath = testbed_instance.trace_filename(self, guid, trace_id):
132     helper = testbed_instance.ns3.FileDescriptorHelper()
133     helper.EnablePcap(filepath, element, explicitFilename = True)
134
135 def yanswifipcap_trace(testbed_instance, guid):
136     trace_id = "yanswifipcap"
137     dev_guid = testbed_instance.get_connected(guid, "dev", "phy")[0]
138     node_guid = get_node_guid(testbed_instance, dev_guid)
139     interface_number = get_dev_number(testbed_instance, dev_guid)
140     element = testbed_instance._elements[dev_guid]
141     filename = "trace-yanswifi-node-%d-dev-%d.pcap" % (node_name, interface_number)
142     testbed_instance.follow_trace(guid, trace_id, filename)
143     filepath = testbed_instance.trace_filename(self, guid, trace_id):
144     helper = testbed_instance.ns3.YansWifiPhyHelper()
145     helper.EnablePcap(filepath, element, explicitFilename = True)
146
147 trace_functions = dict({
148     "p2ppcap": p2ppcap_trace,
149     "csmapcap": csmapcap_trace,
150     "csmapcap_promisc": csmapcap_promisc_trace,
151     "fdpcap": fdpcap_trace,
152     "yanswifipcap": yanswifipcap_trace
153     })
154
155 ### Creation functions ###
156
157 def create_element(testbed_instance, guid):
158     element_factory = testbed_instance.ns3.ObjectFactory()
159     factory_id = testbed_instance._create[guid]
160     element_factory.SetTypeId(factory_id) 
161     factory_parameters = testbed_instance._get_factory_parameters(guid)
162     for name, value in factory_parameters.iteritems():
163         testbed_instance._set(element_factory, factory_id, name, value)
164     element = element_factory.Create()
165     testbed_instance._elements[guid] = element
166     traces = testbed_instance._get_traces(guid)
167     for trace_id in traces:
168         trace_func = trace_functions[trace_id]
169         trace_func(testbed_instance, guid)
170
171 def create_node(testbed_instance, guid):
172     create_element(testbed_instance, guid)
173     element = testbed_instance._elements[guid]
174     element.AggregateObject(testbed_instance.PacketSocketFactory())
175
176 def create_device(testbed_instance, guid):
177     create_element(testbed_instance, guid)
178     element = testbed_instance._elements[guid]
179     parameters = testbed_instance._get_parameters(guid)
180     if "macAddress" in parameters:
181         address = parameters["macAddress"]
182         macaddr = testbed_instance.ns3.Mac48Address(address)
183     else:
184         macaddr = testbed_instance.ns3.Mac48Address.Allocate()
185     element.SetAddress(macaddr)
186
187 def create_wifi_standard_model(testbed_instance, guid):
188     create_element(testbed_instance, guid)
189     element = testbed_instance._elements[guid]
190     parameters = testbed_instance._get_parameters(guid)
191     if "standard" in parameters:
192         standard = parameters["standard"]
193         if standard:
194             elements.ConfigureStandard(wifi_standards[standard])
195
196 def create_ipv4stack(testbed_instance, guid):
197     create_element(testbed_instance, guid)
198     element = testbed_instance._elements[guid]
199     list_routing = testbed_instance.ns3.Ipv4ListRouting()
200     element.SetRoutingProtocol(list_routing)
201     static_routing = testbed_instance.ns3.Ipv4StaticRouting()
202     list_routing.AddRoutingProtocol(static_routing, 1)
203
204 ### Start/Stop functions ###
205
206 def start_application(testbed_instance, guid):
207     element = testbed_instance.elements[guid]
208     element.Start()
209
210 def stop_application(testbed_instance, guid):
211     element = testbed_instance.elements[guid]
212     element.Stop()
213
214 ### Status functions ###
215
216 def status_application(testbed_instance, guid):
217     if guid not in testbed_instance.elements.keys():
218         return STATUS_NOT_STARTED
219     app = testbed_instance.elements[guid]
220     parameters = testbed_instance._get_parameters(guid)
221     if "stopTime" in parameters:
222         stop = parameters["stopTime"]
223         if stop:
224             simTime = testbed_instance.ns3.Simulator.Now()
225             if simTime.Compare(stopTime) > 0:
226                 return STATUS_RUNNING
227     return STATUS_FINISHED
228
229 ### Factory information ###
230
231 connector_types = dict({
232     "node": dict({
233                 "help": "Connector to a ns3::Node object (mandatory)",
234                 "name": "node",
235                 "max": 1,
236                 "min": 1
237             }),
238     "devs": dict({
239                 "help": "Connector to network interfaces",
240                 "name": "devs",
241                 "max": -1,
242                 "min": 0
243             }),
244     "dev2": dict({
245                 "help": "Connector to exactly two network interfaces (mandatory)",
246                 "name": "dev2",
247                 "max": 2,
248                 "min": 2
249             }),
250     "dev": dict({
251                 "help": "Connector to exactly one network interface (mandatory)",
252                 "name": "dev",
253                 "max": 1,
254                 "min": 1
255             }),
256     "apps": dict({
257                 "help": "Connector to applications", 
258                 "name": "apps",
259                 "max": -1,
260                 "min": 0
261             }),
262     "protos": dict({
263                 "help": "Connector to network stacks and protocols", 
264                 "name": "protos",
265                 "max": -1,
266                 "min": 0
267             }),
268     "chan": dict({
269                 "help": "Connector to a channel for the device (mandatory)", 
270                 "name": "chan",
271                 "max": 1,
272                 "min": 1
273             }),
274     "queue": dict({
275                 "help": "Connector to a queueing discipline (mandatory)", 
276                 "name": "queue",
277                 "max": 1,
278                 "min": 1
279             }),
280     "err": dict({
281                 "help": "Connector to an error model for the device", 
282                 "name": "err",
283                 "max": 1,
284                 "min": 0
285             }),
286     "fd": dict({
287                 "help": "Connector to interconnect devices with file descriptors",
288                 "name": "fd",
289                 "max": 1,
290                 "min": 0
291             }),
292     "phy": dict({
293                 "help": "Connector to interconnect elements with a PHY wifi model", 
294                 "name": "phy",
295                 "max": 1,
296                 "min": 0
297             }),
298     "phys": dict({
299                 "help": "Connector to interconnect a wifi channel with PHY wifi models", 
300                 "name": "phys",
301                 "max": -1,
302                 "min": 0
303             }),
304     "mac": dict({
305                 "help": "Connector to interconnect a device with a MAC wifi model", 
306                 "name": "mac",
307                 "max": 1,
308                 "min": 0
309             }),
310     "manager": dict({
311                 "help": "Connector to interconnect a wifi device with a wifi manager", 
312                 "name": "manager",
313                 "max": 1,
314                 "min": 0
315             }),
316     "delay": dict({
317                 "help": "Connector to a delay model", 
318                 "name": "delay",
319                 "max": 1,
320                 "min": 0
321             }),
322     "loss": dict({
323                 "help": "Connector to a loss model", 
324                 "name": "loss",
325                 "max": 1,
326                 "min": 0
327             }),
328     "prev": dict({
329                 "help": "Connector to the previous loss model", 
330                 "name": "prev",
331                 "max": 1,
332                 "min": 0
333             }),
334     "next": dict({
335                 "help": "Connector to the next loss model", 
336                 "name": "next",
337                 "max": 1,
338                 "min": 0
339             }),
340     "mobility": dict({
341                 "help": "Connector to a mobility model for the node", 
342                 "name": "mobility",
343                 "max": 1,
344                 "min": 0
345             }),
346     })
347
348 connections = [
349     dict({
350             "from": ( "ns3", "ns3::Node", "devs" ),
351             "to":   ( "ns3", "ns3::BridgeNetDevice", "node" ),
352             "code": connect_node_device,
353             "can_cross": False
354     }),
355     dict({
356             "from": ( "ns3", "ns3::Node", "devs" ),
357             "to":   ( "ns3", "ns3::CsmaNetDevice", "node" ),
358             "code": connect_node_device,
359             "can_cross": False
360     }),
361     dict({
362             "from": ( "ns3", "ns3::Node", "devs" ),
363             "to":   ( "ns3", "ns3::EmuNetDevice", "node" ),
364             "code": connect_node_device,
365             "can_cross": False
366     }),
367     dict({
368             "from": ( "ns3", "ns3::Node", "devs" ),
369             "to":   ( "ns3", "ns3::PointToPointNetDevice", "node" ),
370             "code": connect_node_device,
371             "can_cross": False
372     }),
373     dict({
374             "from": ( "ns3", "ns3::Node", "devs" ),
375             "to":   ( "ns3", "ns3::SimpleNetDevice", "node" ),
376             "code": connect_node_device,
377             "can_cross": False
378     }),
379     dict({
380             "from": ( "ns3", "ns3::Node", "devs" ),
381             "to":   ( "ns3", "ns3::FileDescriptorNetDevice", "node" ),
382             "code": connect_node_device,
383             "can_cross": False
384     }),
385     dict({
386             "from": ( "ns3", "ns3::Node", "devs" ),
387             "to":   ( "ns3", "ns3::WifiNetDevice", "node" ),
388             "code": connect_node_device,   
389             "can_cross": False
390     }),
391     dict({
392             "from": ( "ns3", "ns3::DropTailQueue", "dev" ),
393             "to":   ( "ns3", "ns3::CsmaNetDevice", "queue" ),
394             "code": connect_queue_device,
395             "can_cross": False
396     }),
397     dict({
398             "from": ( "ns3", "ns3::DropTailQueue", "dev" ),
399             "to":   ( "ns3", "ns3::EmuNetDevice", "queue" ),
400             "code": connect_queue_device,
401             "can_cross": False
402     }),
403     dict({
404             "from": ( "ns3", "ns3::DropTailQueue", "dev" ),
405             "to":   ( "ns3", "ns3::PointToPointNetDevice", "queue" ),
406             "code": connect_queue_device,
407             "can_cross": False
408     }),
409     dict({
410             "from": ( "ns3", "ns3::ArfWifiManager", "dev" ),
411             "to":   ( "ns3", "ns3::WifiNetDevice", "manager" ),  
412             "code": connect_manager_device,
413             "can_cross": False
414     }),
415     dict({
416             "from": ( "ns3", "ns3::ConstantRateWifiManager", "dev" ),
417             "to":   ( "ns3", "ns3::WifiNetDevice", "manager" ),  
418             "code": connect_manager_device,
419             "can_cross": False
420     }),
421     dict({
422             "from": ( "ns3", "ns3::YansWifiPhy", "dev" ),
423             "to":   ( "ns3", "ns3::WifiNetDevice", "phy" ),  
424             "code": connect_phy_device,
425             "can_cross": False
426     }),
427     dict({
428             "from": ( "ns3", "ns3::QapWifiMac", "dev" ),
429             "to":   ( "ns3", "ns3::WifiNetDevice", "mac" ),
430             "code": connect_mac_device,
431             "can_cross": False
432     }),
433     dict({
434             "from": ( "ns3", "ns3::QstaWifiMac", "dev" ),
435             "to":   ( "ns3", "ns3::WifiNetDevice", "mac" ),
436             "code": connect_mac_device,
437             "can_cross": False
438     }),
439     dict({
440             "from": ( "ns3", "ns3::RateErrorModel", "dev" ),
441             "to":   ( "ns3", "ns3::CsmaNetDevice", "err" ),
442             "code": connect_errormodel_device,
443             "can_cross": False
444     }),
445     dict({
446             "from": ( "ns3", "ns3::RateErrorModel", "dev" ),
447             "to":   ( "ns3", "ns3::PointToPointNetDevice", "err" ),
448             "code": connect_errormodel_device,
449             "can_cross": False
450     }),
451     dict({
452             "from": ( "ns3", "ns3::ListErrorModel", "dev" ),
453             "to":   ( "ns3", "ns3::CsmaNetDevice", "err" ),
454             "code": connect_errormodel_device,
455             "can_cross": False
456     }),
457     dict({
458             "from": ( "ns3", "ns3::ListErrorModel", "dev" ),
459             "to":   ( "ns3", "ns3::PointToPointNetDevice", "err" ),
460             "code": connect_errormodel_device,
461             "can_cross": False
462     }),
463     dict({
464         "from": ( "ns3", "ns3::NistErrorRateModel", "phy" ),        
465         "to":   ( "ns3", "ns3::YansWifiPhy", "err" ),
466         "code": connect_errormodel_phy,
467         "can_cross": False
468     }),
469     dict({
470         "from": ( "ns3", "ns3::CsmaChannel", "devs" ),
471         "to":   ( "ns3", "ns3::CsmaNetDevice", "chan" ),
472         "code": connect_channel_device,
473         "can_cross": False
474     }),
475     dict({
476         "from": ( "ns3", "ns3::PointToPointChannel", "dev2" ),
477         "to":   ( "ns3", "ns3::PointToPointNetDevice", "chan" ),
478         "code": connect_channel_device,
479         "can_cross": False
480     }),
481     dict({
482         "from": ( "ns3", "ns3::SimpleChannel", "devs" ),
483         "to":   ( "ns3", "ns3::SimpleNetDevice", "chan" ),
484         "code": connect_simple_channel_device,
485         "can_cross": False
486     }),
487     dict({
488         "from": ( "ns3", "ns3::YansWifiChannel", "phys" ),
489         "to":   ( "ns3", "ns3::YansWifiPhy", "chan" ),  
490         "code": connect_simple_channel_device,
491         "can_cross": False
492     }),
493     dict({
494         "from": ( "ns3", "ns3::LogDistancePropagationLossModel", "prev" ),
495         "to":   ( "ns3", "ns3::YansWifiChannel", "loss" ),  
496         "code": connect_loss_channel,
497         "can_cross": False
498     }),
499     dict({
500         "from": ( "ns3", "ns3::LogDistancePropagationLossModel", "prev" ),
501         "to":   ( "ns3", "ns3::LogDistancePropagationLossModel", "next" ),  
502         "code": connect_next_loss,
503         "can_cross": False
504     }),
505     dict({
506         "from": ( "ns3", "ns3::ConstantSpeedPropagationDelayModel", "chan" ),
507         "to":   ( "ns3", "ns3::YansWifiChannel", "delay" ),  
508         "code": connect_delay_channel,
509         "can_cross": False
510     }),
511     dict({
512         "from": ( "ns3", "ns3::Node", "apps" ),
513         "to":   ( "ns3", "ns3::OnOffApplication", "node" ),
514         "code": connect_node_application,
515         "can_cross": False
516     }),
517     dict({
518         "from": ( "ns3", "ns3::Node", "apps" ),
519         "to":   ( "ns3", "ns3::PacketSink", "node" ),
520         "code": connect_node_application,
521         "can_cross": False
522     }),
523     dict({
524         "from": ( "ns3", "ns3::Node", "apps" ),
525         "to":   ( "ns3", "ns3::UdpEchoClient", "node" ),
526         "code": connect_node_application,
527         "can_cross": False
528     }),
529     dict({
530         "from": ( "ns3", "ns3::Node", "apps" ),
531         "to":   ( "ns3", "ns3::UdpEchoServer", "node" ),
532         "code": connect_node_application,
533         "can_cross": False
534     }),
535     dict({
536         "from": ( "ns3", "ns3::Node", "apps" ),
537         "to":   ( "ns3", "ns3::V4Ping", "node" ),
538         "code": connect_node_application,
539         "can_cross": False
540     }),
541     dict({
542         "from": ( "ns3", "ns3::Node", "protos" ),
543         "to":   ( "ns3", "ns3::ArpL3Protocol", "node" ),
544         "code": connect_node_other,
545         "can_cross": False
546     }),
547     dict({
548         "from": ( "ns3", "ns3::Node", "protos" ),
549         "to":   ( "ns3", "ns3::Icmpv4L4Protocol", "node" ),
550         "code": connect_node_other,
551         "can_cross": False
552     }),
553     dict({
554         "from": ( "ns3", "ns3::Node", "protos" ),
555         "to":   ( "ns3", "ns3::Ipv4L3Protocol", "node" ),
556         "code": connect_node_other,
557         "can_cross": False
558     }),
559     dict({
560         "from": ( "ns3", "ns3::Node", "protos" ),
561         "to":   ( "ns3", "ns3::UdpL4Protocol", "node" ),
562         "code": connect_node_other,
563         "can_cross": False
564     }),
565     dict({
566         "from": ( "ns3", "ns3::Node", "protos" ),
567         "to":   ( "ns3", "ns3::TcpL4Protocol", "node" ),
568         "code": connect_node_other,
569         "can_cross": False
570     }),
571     dict({
572         "from": ( "ns3", "ns3::Node", "mobility" ),
573         "to":   ( "ns3", "ns3::ConstantAccelerationMobilityModel", "node" ),
574         "code": connect_node_other,
575         "can_cross": False
576     }),
577     dict({
578         "from": ( "ns3", "ns3::Node", "mobility" ),
579         "to":   ( "ns3", "ns3::ConstantPositionMobilityModel", "node" ),
580         "code": connect_node_other,
581         "can_cross": False
582     }),
583     dict({
584         "from": ( "ns3", "ns3::Node", "mobility" ),
585         "to":   ( "ns3", "ns3::ConstantVelocityMobilityModel", "node" ),
586         "code": connect_node_other,
587         "can_cross": False
588     }),
589     dict({
590         "from": ( "ns3", "ns3::Node", "mobility" ),
591         "to":   ( "ns3", "ns3::HierarchicalMobilityModel", "node" ),
592         "code": connect_node_other,
593         "can_cross": False
594     }),
595     dict({
596         "from": ( "ns3", "ns3::Node", "mobility" ),
597         "to":   ( "ns3", "ns3::RandomDirection2dMobilityModel", "node" ),
598         "code": connect_node_other,
599         "can_cross": False
600     }),
601     dict({
602         "from": ( "ns3", "ns3::Node", "mobility" ),
603         "to":   ( "ns3", "ns3::RandomWalk2dMobilityModel", "node" ),
604         "code": connect_node_other,
605         "can_cross": False
606     }),
607     dict({
608         "from": ( "ns3", "ns3::Node", "mobility" ),
609         "to":   ( "ns3", "ns3::RandomWaypointMobilityModel", "node" ),
610         "code": connect_node_other,
611         "can_cross": False
612     })
613 ]
614
615 traces = dict({
616     "p2ppcap": dict({
617                 "name": "P2PPcapTrace",
618                 "help": "Trace to sniff packets from a P2P network device"
619               }),
620     "csmapcap_promisc": dict({
621                 "name": "CsmaPromiscPcapTrace",
622                 "help": "Trace to sniff packets from a Csma network device in promiscuous mode"
623               }),
624     "csmapcap": dict({
625                 "name": "CsmaPcapTrace",
626                 "help": "Trace to sniff packets from a Csma network device"
627               }),
628     "fdpcap": dict({
629                 "name": "FileDescriptorPcapTrace",
630                 "help": "Trace to sniff packets from a FileDescriptor network device"
631               }),
632     "yanswifipcap": dict({
633                 "name": "YansWifiPhyPcapTrace",
634                 "help": "Trace to sniff packets from a Wifi network device"
635               }),
636 })
637
638 factories_order = ["ns3::BasicEnergySource",
639     "ns3::WifiRadioEnergyModel",
640     "ns3::BSSchedulerRtps",
641     "ns3::BSSchedulerSimple",
642     "ns3::SubscriberStationNetDevice",
643     "ns3::BaseStationNetDevice",
644     "ns3::UdpTraceClient",
645     "ns3::UdpServer",
646     "ns3::UdpClient",
647     "ns3::FlowMonitor",
648     "ns3::Radvd",
649     "ns3::Ping6",
650     "ns3::flame::FlameProtocol",
651     "ns3::flame::FlameRtable",
652     "ns3::dot11s::AirtimeLinkMetricCalculator",
653     "ns3::dot11s::HwmpProtocol",
654     "ns3::dot11s::HwmpRtable",
655     "ns3::dot11s::PeerManagementProtocol",
656     "ns3::dot11s::PeerLink",
657     "ns3::MeshWifiInterfaceMac",
658     "ns3::MeshPointDevice",
659     "ns3::UanMacRcGw",
660     "ns3::UanMacRc",
661     "ns3::UanPhyCalcSinrDual",
662     "ns3::UanPhyPerGenDefault",
663     "ns3::UanPhyDual",
664     "ns3::UanPropModelThorp",
665     "ns3::UanMacCw",
666     "ns3::UanNoiseModelDefault",
667     "ns3::UanMacAloha",
668     "ns3::UanPropModelIdeal",
669     "ns3::UanTransducerHd",
670     "ns3::UanPhyCalcSinrDefault",
671     "ns3::UanPhyGen",
672     "ns3::UanPhyCalcSinrFhFsk",
673     "ns3::UanPhyPerUmodem",
674     "ns3::UanChannel",
675     "ns3::V4Ping",
676     "ns3::AthstatsWifiTraceSink",
677     "ns3::FlameStack",
678     "ns3::Dot11sStack",
679     "ns3::NonCommunicatingNetDevice",
680     "ns3::HalfDuplexIdealPhy",
681     "ns3::AlohaNoackNetDevice",
682     "ns3::SpectrumAnalyzer",
683     "ns3::WaveformGenerator",
684     "ns3::MultiModelSpectrumChannel",
685     "ns3::SingleModelSpectrumChannel",
686     "ns3::MsduStandardAggregator",
687     "ns3::EdcaTxopN",
688     "ns3::QstaWifiMac",
689     "ns3::QapWifiMac",
690     "ns3::QadhocWifiMac",
691     "ns3::MinstrelWifiManager",
692     "ns3::CaraWifiManager",
693     "ns3::AarfcdWifiManager",
694     "ns3::OnoeWifiManager",
695     "ns3::AmrrWifiManager",
696     "ns3::ConstantRateWifiManager",
697     "ns3::IdealWifiManager",
698     "ns3::AarfWifiManager",
699     "ns3::ArfWifiManager",
700     "ns3::WifiNetDevice",
701     "ns3::NqstaWifiMac",
702     "ns3::NqapWifiMac",
703     "ns3::AdhocWifiMac",
704     "ns3::DcaTxop",
705     "ns3::WifiMacQueue",
706     "ns3::YansWifiChannel",
707     "ns3::YansWifiPhy",
708     "ns3::NistErrorRateModel",
709     "ns3::YansErrorRateModel",
710     "ns3::WaypointMobilityModel",
711     "ns3::ConstantAccelerationMobilityModel",
712     "ns3::RandomDirection2dMobilityModel",
713     "ns3::RandomWalk2dMobilityModel",
714     "ns3::SteadyStateRandomWaypointMobilityModel",
715     "ns3::RandomWaypointMobilityModel",
716     "ns3::GaussMarkovMobilityModel",
717     "ns3::ConstantVelocityMobilityModel",
718     "ns3::ConstantPositionMobilityModel",
719     "ns3::ListPositionAllocator",
720     "ns3::GridPositionAllocator",
721     "ns3::RandomRectanglePositionAllocator",
722     "ns3::RandomBoxPositionAllocator",
723     "ns3::RandomDiscPositionAllocator",
724     "ns3::UniformDiscPositionAllocator",
725     "ns3::HierarchicalMobilityModel",
726     "ns3::aodv::RoutingProtocol",
727     "ns3::UdpEchoServer",
728     "ns3::UdpEchoClient",
729     "ns3::PacketSink",
730     "ns3::OnOffApplication",
731     "ns3::VirtualNetDevice",
732     "ns3::FileDescriptorNetDevice",
733     "ns3::TapBridge",
734     "ns3::BridgeChannel",
735     "ns3::BridgeNetDevice",
736     "ns3::EmuNetDevice",
737     "ns3::CsmaChannel",
738     "ns3::CsmaNetDevice",
739     "ns3::PointToPointRemoteChannel",
740     "ns3::PointToPointChannel",
741     "ns3::PointToPointNetDevice",
742     "ns3::NscTcpL4Protocol",
743     "ns3::Icmpv6L4Protocol",
744     "ns3::Ipv6OptionPad1",
745     "ns3::Ipv6OptionPadn",
746     "ns3::Ipv6OptionJumbogram",
747     "ns3::Ipv6OptionRouterAlert",
748     "ns3::Ipv6ExtensionHopByHop",
749     "ns3::Ipv6ExtensionDestination",
750     "ns3::Ipv6ExtensionFragment",
751     "ns3::Ipv6ExtensionRouting",
752     "ns3::Ipv6ExtensionLooseRouting",
753     "ns3::Ipv6ExtensionESP",
754     "ns3::Ipv6ExtensionAH",
755     "ns3::Ipv6L3Protocol",
756     "ns3::LoopbackNetDevice",
757     "ns3::Icmpv4L4Protocol",
758     "ns3::RttMeanDeviation",
759     "ns3::ArpL3Protocol",
760     "ns3::TcpL4Protocol",
761     "ns3::UdpL4Protocol",
762     "ns3::Ipv4L3Protocol",
763     "ns3::SimpleNetDevice",
764     "ns3::SimpleChannel",
765     "ns3::PacketSocket",
766     "ns3::DropTailQueue",
767     "ns3::Node",
768     "ns3::FriisSpectrumPropagationLossModel",
769     "ns3::Cost231PropagationLossModel",
770     "ns3::JakesPropagationLossModel",
771     "ns3::RandomPropagationLossModel",
772     "ns3::FriisPropagationLossModel",
773     "ns3::TwoRayGroundPropagationLossModel",
774     "ns3::LogDistancePropagationLossModel",
775     "ns3::ThreeLogDistancePropagationLossModel",
776     "ns3::NakagamiPropagationLossModel",
777     "ns3::FixedRssLossModel",
778     "ns3::MatrixPropagationLossModel",
779     "ns3::RangePropagationLossModel",
780     "ns3::RandomPropagationDelayModel",
781     "ns3::ConstantSpeedPropagationDelayModel",
782     "ns3::RateErrorModel",
783     "ns3::ListErrorModel",
784     "ns3::ReceiveListErrorModel",
785     "ns3::PacketBurst",
786     "ns3::EnergySourceContainer"
787  ]
788
789 testbed_attributes = dict({
790         "ns3_bindings": dict({
791                 "name": "ns3Bindings",
792                 "help": "Location of the ns-3 python binding",
793                 "type": Attribute.STRING,
794                 "value": None,
795                 "range": None,
796                 "allowed": None,
797                 "flags": Attribute.DesignOnly,
798                 "validation_function": validation.is_string # TODO: validation.is_path
799             }),
800          "ns3_library": dict({
801                 "name": "ns3Library",
802                 "help": "Location of the ns-3 library .so file",
803                 "type": Attribute.STRING,
804                 "value": None,
805                 "range": None,
806                 "allowed": None,
807                 "flags": Attribute.DesignOnly,
808                 "validation_function": validation.is_string # TODO: validation.is_path
809             }),
810          "simu_impl_type": dict({
811                 "name": "SimulatorImplementationType",
812                 "help": "The object class to use as the simulator implementation",
813                 "type": Attribute.STRING,
814                 "value": None,
815                 "range": None,
816                 "allowed": None,
817                 "flags": Attribute.DesignOnly,
818                 "validation_function": validation.is_string
819             }),
820           "checksum": dict({
821                 "name": "ChecksumEnabled",
822                 "help": "A global switch to enable all checksums for all protocols",
823                 "type": Attribute.BOOL,
824                 "value": False,
825                 "range": None,
826                 "allowed": None,
827                 "flags": Attribute.DesignOnly,
828                 "validation_function": validation.is_bool
829             })
830  })
831
832 class VersionedMetadataInfo(metadata.VersionedMetadataInfo):
833     @property
834     def connections_types(self):
835         return connection_types
836
837     @property
838     def connections(self):
839         return connections
840
841     @property
842     def attributes(self):
843         from attributes_metadata_v3_9_RC3 import attributes
844         return attributes
845
846     @property
847     def traces(self):
848         return traces
849
850     @property
851     def factories_order(self):
852         return factories_order
853
854     @property
855     def factories_info(self):
856         from factories_metadata_v3_9_RC3 import factories_info
857         return factories_info
858
859     @property
860     def testbed_attributes(self):
861         return testbed_attributes
862