bindings: Remove injected namespaces
This commit is contained in:
@@ -29,41 +29,41 @@ except ModuleNotFoundError:
|
||||
# // point-to-point
|
||||
# //
|
||||
|
||||
ns.core.LogComponentEnable("UdpEchoClientApplication", ns.core.LOG_LEVEL_INFO)
|
||||
ns.core.LogComponentEnable("UdpEchoServerApplication", ns.core.LOG_LEVEL_INFO)
|
||||
ns.LogComponentEnable("UdpEchoClientApplication", ns.LOG_LEVEL_INFO)
|
||||
ns.LogComponentEnable("UdpEchoServerApplication", ns.LOG_LEVEL_INFO)
|
||||
|
||||
nodes = ns.network.NodeContainer()
|
||||
nodes = ns.NodeContainer()
|
||||
nodes.Create(2)
|
||||
|
||||
pointToPoint = ns.point_to_point.PointToPointHelper()
|
||||
pointToPoint.SetDeviceAttribute("DataRate", ns.core.StringValue("5Mbps"))
|
||||
pointToPoint.SetChannelAttribute("Delay", ns.core.StringValue("2ms"))
|
||||
pointToPoint = ns.PointToPointHelper()
|
||||
pointToPoint.SetDeviceAttribute("DataRate", ns.StringValue("5Mbps"))
|
||||
pointToPoint.SetChannelAttribute("Delay", ns.StringValue("2ms"))
|
||||
|
||||
devices = pointToPoint.Install(nodes)
|
||||
|
||||
stack = ns.internet.InternetStackHelper()
|
||||
stack = ns.InternetStackHelper()
|
||||
stack.Install(nodes)
|
||||
|
||||
address = ns.internet.Ipv4AddressHelper()
|
||||
address.SetBase(ns.network.Ipv4Address("10.1.1.0"), ns.network.Ipv4Mask("255.255.255.0"))
|
||||
address = ns.Ipv4AddressHelper()
|
||||
address.SetBase(ns.Ipv4Address("10.1.1.0"), ns.Ipv4Mask("255.255.255.0"))
|
||||
|
||||
interfaces = address.Assign(devices)
|
||||
|
||||
echoServer = ns.applications.UdpEchoServerHelper(9)
|
||||
echoServer = ns.UdpEchoServerHelper(9)
|
||||
|
||||
serverApps = echoServer.Install(nodes.Get(1))
|
||||
serverApps.Start(ns.core.Seconds(1.0))
|
||||
serverApps.Stop(ns.core.Seconds(10.0))
|
||||
serverApps.Start(ns.Seconds(1.0))
|
||||
serverApps.Stop(ns.Seconds(10.0))
|
||||
|
||||
address = interfaces.GetAddress(1).ConvertTo()
|
||||
echoClient = ns.applications.UdpEchoClientHelper(address, 9)
|
||||
echoClient.SetAttribute("MaxPackets", ns.core.UintegerValue(1))
|
||||
echoClient.SetAttribute("Interval", ns.core.TimeValue(ns.core.Seconds(1.0)))
|
||||
echoClient.SetAttribute("PacketSize", ns.core.UintegerValue(1024))
|
||||
echoClient = ns.UdpEchoClientHelper(address, 9)
|
||||
echoClient.SetAttribute("MaxPackets", ns.UintegerValue(1))
|
||||
echoClient.SetAttribute("Interval", ns.TimeValue(ns.Seconds(1.0)))
|
||||
echoClient.SetAttribute("PacketSize", ns.UintegerValue(1024))
|
||||
|
||||
clientApps = echoClient.Install(nodes.Get(0))
|
||||
clientApps.Start(ns.core.Seconds(2.0))
|
||||
clientApps.Stop(ns.core.Seconds(10.0))
|
||||
clientApps.Start(ns.Seconds(2.0))
|
||||
clientApps.Stop(ns.Seconds(10.0))
|
||||
|
||||
ns.core.Simulator.Run()
|
||||
ns.core.Simulator.Destroy()
|
||||
ns.Simulator.Run()
|
||||
ns.Simulator.Destroy()
|
||||
|
||||
Reference in New Issue
Block a user