class NS3BaseNode(NS3Base):
_rtype = "abstract::ns3::Node"
+ @classmethod
+ def _register_attributes(cls):
+ enablestack = Attribute("enableStack",
+ "Install network stack in Node, including: ARP, "
+ "IP4, ICMP, UDP and TCP ",
+ type = Types.Bool,
+ default = False,
+ flags = Flags.Design)
+
+ cls._register_attribute(enablestack)
+
@property
def simulation(self):
from nepi.resources.ns3.ns3simulation import NS3Simulation
return rms
def _configure_object(self):
- ### node.AggregateObject(PacketSocketFactory())
- uuid_packet_socket_factory = self.simulation.create("PacketSocketFactory")
- self.simulation.invoke(self.uuid, "AggregateObject", uuid_packet_socket_factory)
+ if self.get("enableStack"):
+ uuid_stack_helper = self.simulation.create("InternetStackHelper")
+ self.simulation.invoke(uuid_stack_helper, "Install", self.uuid)
+ else:
+ ### node.AggregateObject(PacketSocketFactory())
+ uuid_packet_socket_factory = self.simulation.create("PacketSocketFactory")
+ self.simulation.invoke(self.uuid, "AggregateObject", uuid_packet_socket_factory)
dceapplications = self.dceapplications
if dceapplications: