Use Time() constructor with integer values
This commit is contained in:
@@ -893,7 +893,7 @@ in the ``my-mobility.cc`` implementation file::
|
||||
.AddAttribute("Time",
|
||||
"Change current direction and speed after moving for this delay.",
|
||||
// etc (more parameters).
|
||||
TimeValue(Seconds(1.0)),
|
||||
TimeValue(Seconds(1)),
|
||||
MakeTimeAccessor(&MyMobility::m_modeTime),
|
||||
MakeTimeChecker())
|
||||
;
|
||||
|
||||
@@ -76,18 +76,18 @@ Here is some example code that is written in Python and that runs |ns3|, which i
|
||||
echoServer = ns.UdpEchoServerHelper(9)
|
||||
|
||||
serverApps = echoServer.Install(nodes.Get(1))
|
||||
serverApps.Start(ns.Seconds(1.0))
|
||||
serverApps.Stop(ns.Seconds(10.0))
|
||||
serverApps.Start(ns.Seconds(1))
|
||||
serverApps.Stop(ns.Seconds(10))
|
||||
|
||||
address = interfaces.GetAddress(1).ConvertTo()
|
||||
echoClient = ns.UdpEchoClientHelper(address, 9)
|
||||
echoClient.SetAttribute("MaxPackets", ns.UintegerValue(1))
|
||||
echoClient.SetAttribute("Interval", ns.TimeValue(ns.Seconds(1.0)))
|
||||
echoClient.SetAttribute("Interval", ns.TimeValue(ns.Seconds(1)))
|
||||
echoClient.SetAttribute("PacketSize", ns.UintegerValue(1024))
|
||||
|
||||
clientApps = echoClient.Install(nodes.Get(0))
|
||||
clientApps.Start(ns.Seconds(2.0))
|
||||
clientApps.Stop(ns.Seconds(10.0))
|
||||
clientApps.Start(ns.Seconds(2))
|
||||
clientApps.Stop(ns.Seconds(10))
|
||||
|
||||
ns.Simulator.Run()
|
||||
ns.Simulator.Destroy()
|
||||
@@ -266,17 +266,17 @@ After installing it, you can start using ns-3 right away. For example, using the
|
||||
echoServer = ns.UdpEchoServerHelper(9)
|
||||
|
||||
serverApps = echoServer.Install(csmaNodes.Get(0))
|
||||
serverApps.Start(ns.Seconds(1.0))
|
||||
serverApps.Stop(ns.Seconds(10.0))
|
||||
serverApps.Start(ns.Seconds(1))
|
||||
serverApps.Stop(ns.Seconds(10))
|
||||
|
||||
echoClient = ns.UdpEchoClientHelper(csmaInterfaces.GetAddress(0).ConvertTo(), 9)
|
||||
echoClient.SetAttribute("MaxPackets", ns.UintegerValue(10))
|
||||
echoClient.SetAttribute("Interval", ns.TimeValue(ns.Seconds(1.0)))
|
||||
echoClient.SetAttribute("Interval", ns.TimeValue(ns.Seconds(1)))
|
||||
echoClient.SetAttribute("PacketSize", ns.UintegerValue(1024))
|
||||
|
||||
clientApps = echoClient.Install(csmaNodes.Get(1))
|
||||
clientApps.Start(ns.Seconds(2.0))
|
||||
clientApps.Stop(ns.Seconds(10.0))
|
||||
clientApps.Start(ns.Seconds(2))
|
||||
clientApps.Stop(ns.Seconds(10))
|
||||
|
||||
# Populate routing tables
|
||||
ns.Ipv4GlobalRoutingHelper.PopulateRoutingTables()
|
||||
|
||||
@@ -245,8 +245,8 @@ the constructor.
|
||||
UdpEchoServerHelper echoServer(9);
|
||||
|
||||
ApplicationContainer serverApps = echoServer.Install(csmaNodes.Get(nCsma));
|
||||
serverApps.Start(Seconds(1.0));
|
||||
serverApps.Stop(Seconds(10.0));
|
||||
serverApps.Start(Seconds(1));
|
||||
serverApps.Stop(Seconds(10));
|
||||
|
||||
Recall that the ``csmaNodes NodeContainer`` contains one of the
|
||||
nodes created for the point-to-point network and ``nCsma`` "extra" nodes.
|
||||
@@ -269,12 +269,12 @@ leftmost point-to-point node seen in the topology illustration.
|
||||
|
||||
UdpEchoClientHelper echoClient(csmaInterfaces.GetAddress(nCsma), 9);
|
||||
echoClient.SetAttribute("MaxPackets", UintegerValue(1));
|
||||
echoClient.SetAttribute("Interval", TimeValue(Seconds(1.0)));
|
||||
echoClient.SetAttribute("Interval", TimeValue(Seconds(1)));
|
||||
echoClient.SetAttribute("PacketSize", UintegerValue(1024));
|
||||
|
||||
ApplicationContainer clientApps = echoClient.Install(p2pNodes.Get(0));
|
||||
clientApps.Start(Seconds(2.0));
|
||||
clientApps.Stop(Seconds(10.0));
|
||||
clientApps.Start(Seconds(2));
|
||||
clientApps.Stop(Seconds(10));
|
||||
|
||||
Since we have actually built an internetwork here, we need some form of
|
||||
internetwork routing. |ns3| provides what we call global routing to
|
||||
@@ -1150,8 +1150,8 @@ start of the file. We have done this before.
|
||||
UdpEchoServerHelper echoServer(9);
|
||||
|
||||
ApplicationContainer serverApps = echoServer.Install(csmaNodes.Get(nCsma));
|
||||
serverApps.Start(Seconds(1.0));
|
||||
serverApps.Stop(Seconds(10.0));
|
||||
serverApps.Start(Seconds(1));
|
||||
serverApps.Stop(Seconds(10));
|
||||
|
||||
And we put the echo client on the last STA node we created, pointing it to
|
||||
the server on the CSMA network. We have also seen similar operations before.
|
||||
@@ -1160,13 +1160,13 @@ the server on the CSMA network. We have also seen similar operations before.
|
||||
|
||||
UdpEchoClientHelper echoClient(csmaInterfaces.GetAddress(nCsma), 9);
|
||||
echoClient.SetAttribute("MaxPackets", UintegerValue(1));
|
||||
echoClient.SetAttribute("Interval", TimeValue(Seconds(1.0)));
|
||||
echoClient.SetAttribute("Interval", TimeValue(Seconds(1)));
|
||||
echoClient.SetAttribute("PacketSize", UintegerValue(1024));
|
||||
|
||||
ApplicationContainer clientApps =
|
||||
echoClient.Install(wifiStaNodes.Get(nWifi - 1));
|
||||
clientApps.Start(Seconds(2.0));
|
||||
clientApps.Stop(Seconds(10.0));
|
||||
clientApps.Start(Seconds(2));
|
||||
clientApps.Stop(Seconds(10));
|
||||
|
||||
Since we have built an internetwork here, we need to enable internetwork routing
|
||||
just as we did in the ``second.cc`` example script.
|
||||
@@ -1186,7 +1186,7 @@ loop.
|
||||
|
||||
::
|
||||
|
||||
Simulator::Stop(Seconds(10.0));
|
||||
Simulator::Stop(Seconds(10));
|
||||
|
||||
We create just enough tracing to cover all three networks:
|
||||
|
||||
|
||||
@@ -554,8 +554,8 @@ created.
|
||||
UdpEchoServerHelper echoServer(9);
|
||||
|
||||
ApplicationContainer serverApps = echoServer.Install(nodes.Get(1));
|
||||
serverApps.Start(Seconds(1.0));
|
||||
serverApps.Stop(Seconds(10.0));
|
||||
serverApps.Start(Seconds(1));
|
||||
serverApps.Stop(Seconds(10));
|
||||
|
||||
The first line of code in the above snippet declares the
|
||||
``UdpEchoServerHelper``. As usual, this isn't the application itself, it
|
||||
@@ -600,8 +600,8 @@ converted for you. The two lines,
|
||||
|
||||
::
|
||||
|
||||
serverApps.Start(Seconds(1.0));
|
||||
serverApps.Stop(Seconds(10.0));
|
||||
serverApps.Start(Seconds(1));
|
||||
serverApps.Stop(Seconds(10));
|
||||
|
||||
will cause the echo server application to ``Start`` (enable itself) at one
|
||||
second into the simulation and to ``Stop`` (disable itself) at ten seconds
|
||||
@@ -620,12 +620,12 @@ that is managed by an ``UdpEchoClientHelper``.
|
||||
|
||||
UdpEchoClientHelper echoClient(interfaces.GetAddress(1), 9);
|
||||
echoClient.SetAttribute("MaxPackets", UintegerValue(1));
|
||||
echoClient.SetAttribute("Interval", TimeValue(Seconds(1.0)));
|
||||
echoClient.SetAttribute("Interval", TimeValue(Seconds(1)));
|
||||
echoClient.SetAttribute("PacketSize", UintegerValue(1024));
|
||||
|
||||
ApplicationContainer clientApps = echoClient.Install(nodes.Get(0));
|
||||
clientApps.Start(Seconds(2.0));
|
||||
clientApps.Stop(Seconds(10.0));
|
||||
clientApps.Start(Seconds(2));
|
||||
clientApps.Stop(Seconds(10));
|
||||
|
||||
For the echo client, however, we need to set five different ``Attributes``.
|
||||
The first two ``Attributes`` are set during construction of the
|
||||
@@ -668,11 +668,11 @@ When we previously called the methods,
|
||||
|
||||
::
|
||||
|
||||
serverApps.Start(Seconds(1.0));
|
||||
serverApps.Stop(Seconds(10.0));
|
||||
serverApps.Start(Seconds(1));
|
||||
serverApps.Stop(Seconds(10));
|
||||
...
|
||||
clientApps.Start(Seconds(2.0));
|
||||
clientApps.Stop(Seconds(10.0));
|
||||
clientApps.Start(Seconds(2));
|
||||
clientApps.Stop(Seconds(10));
|
||||
|
||||
we actually scheduled events in the simulator at 1.0 seconds, 2.0 seconds and
|
||||
two events at 10.0 seconds. When ``Simulator::Run`` is called, the system
|
||||
@@ -758,7 +758,7 @@ in the first example program will schedule an explicit stop at 11 seconds:
|
||||
|
||||
::
|
||||
|
||||
+ Simulator::Stop(Seconds(11.0));
|
||||
+ Simulator::Stop(Seconds(11));
|
||||
Simulator::Run();
|
||||
Simulator::Destroy();
|
||||
return 0;
|
||||
|
||||
@@ -1518,8 +1518,8 @@ The most common way to start pumping events is to start an
|
||||
(hopefully) familiar lines of an |ns3| script::
|
||||
|
||||
ApplicationContainer apps = ...
|
||||
apps.Start(Seconds(1.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(1));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
The application container code (see
|
||||
``src/network/helper/application-container.h`` if you are interested)
|
||||
|
||||
@@ -264,7 +264,7 @@ main(int argc, char* argv[])
|
||||
nextWaypoint += Seconds((maxAxisX - streetWidth) / 2 / vTx);
|
||||
txMob->GetObject<WaypointMobilityModel>()->AddWaypoint(
|
||||
Waypoint(nextWaypoint, Vector(0.0, maxAxisY / 2 - streetWidth / 2, 1.5)));
|
||||
nextWaypoint = Seconds(0.0);
|
||||
nextWaypoint = Seconds(0);
|
||||
rxMob->GetObject<WaypointMobilityModel>()->AddWaypoint(
|
||||
Waypoint(nextWaypoint, Vector(maxAxisX / 2 - streetWidth / 2, 0.0, 1.5)));
|
||||
nextWaypoint += Seconds(maxAxisY / vRx);
|
||||
|
||||
@@ -275,7 +275,7 @@ main(int argc, char* argv[])
|
||||
numPackets,
|
||||
interPacketInterval);
|
||||
|
||||
Simulator::Stop(Seconds(10.0));
|
||||
Simulator::Stop(Seconds(10));
|
||||
Simulator::Run();
|
||||
|
||||
for (auto iter = deviceModels.Begin(); iter != deviceModels.End(); iter++)
|
||||
|
||||
@@ -340,7 +340,7 @@ main(int argc, char* argv[])
|
||||
numPackets,
|
||||
interPacketInterval);
|
||||
|
||||
Simulator::Stop(Seconds(10.0));
|
||||
Simulator::Stop(Seconds(10));
|
||||
Simulator::Run();
|
||||
|
||||
for (auto iter = deviceModels.Begin(); iter != deviceModels.End(); iter++)
|
||||
|
||||
@@ -112,27 +112,27 @@ main(int argc, char* argv[])
|
||||
Address(InetSocketAddress(i3i2.GetAddress(1), port)));
|
||||
onoff.SetConstantRate(DataRate("448kb/s"));
|
||||
ApplicationContainer apps = onoff.Install(c.Get(0));
|
||||
apps.Start(Seconds(1.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(1));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
// Create an optional packet sink to receive these packets
|
||||
PacketSinkHelper sink("ns3::UdpSocketFactory",
|
||||
Address(InetSocketAddress(Ipv4Address::GetAny(), port)));
|
||||
apps = sink.Install(c.Get(2));
|
||||
apps.Start(Seconds(1.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(1));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
// Create a similar flow from n3 to n1, starting at time 1.1 seconds
|
||||
onoff.SetAttribute("Remote", AddressValue(InetSocketAddress(i1i2.GetAddress(0), port)));
|
||||
apps = onoff.Install(c.Get(3));
|
||||
apps.Start(Seconds(1.1));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
// Create a packet sink to receive these packets
|
||||
sink.SetAttribute("Local", AddressValue(InetSocketAddress(Ipv4Address::GetAny(), port)));
|
||||
apps = sink.Install(c.Get(1));
|
||||
apps.Start(Seconds(1.1));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
//
|
||||
// Error model
|
||||
|
||||
@@ -114,8 +114,8 @@ main(int argc, char** argv)
|
||||
// Create an UDP Echo server on n2
|
||||
UdpEchoServerHelper echoServer(42);
|
||||
ApplicationContainer serverApps = echoServer.Install(n2);
|
||||
serverApps.Start(Seconds(0.0));
|
||||
serverApps.Stop(Seconds(30.0));
|
||||
serverApps.Start(Seconds(0));
|
||||
serverApps.Stop(Seconds(30));
|
||||
|
||||
uint32_t maxPacketCount = 5;
|
||||
|
||||
@@ -125,16 +125,16 @@ main(int argc, char** argv)
|
||||
echoClient.SetAttribute("PacketSize", UintegerValue(packetSizeN1));
|
||||
echoClient.SetAttribute("MaxPackets", UintegerValue(maxPacketCount));
|
||||
ApplicationContainer clientAppsN1 = echoClient.Install(n1);
|
||||
clientAppsN1.Start(Seconds(2.0));
|
||||
clientAppsN1.Stop(Seconds(10.0));
|
||||
clientAppsN1.Start(Seconds(2));
|
||||
clientAppsN1.Stop(Seconds(10));
|
||||
|
||||
// Create an UDP Echo client on n0 to send UDP packets to n2 via r0 and r1
|
||||
uint32_t packetSizeN2 = 4000; // Packet should fragment as intermediate link MTU is 1500
|
||||
echoClient.SetAttribute("PacketSize", UintegerValue(packetSizeN2));
|
||||
echoClient.SetAttribute("MaxPackets", UintegerValue(maxPacketCount));
|
||||
ApplicationContainer clientAppsN2 = echoClient.Install(n1);
|
||||
clientAppsN2.Start(Seconds(11.0));
|
||||
clientAppsN2.Stop(Seconds(20.0));
|
||||
clientAppsN2.Start(Seconds(11));
|
||||
clientAppsN2.Stop(Seconds(20));
|
||||
|
||||
AsciiTraceHelper ascii;
|
||||
csma.EnableAsciiAll(ascii.CreateFileStream("fragmentation-ipv6-PMTU.tr"));
|
||||
|
||||
@@ -94,13 +94,13 @@ main(int argc, char** argv)
|
||||
echoClient.SetAttribute("PacketSize", UintegerValue(packetSize));
|
||||
echoClient.SetAttribute("MaxPackets", UintegerValue(maxPacketCount));
|
||||
ApplicationContainer clientApps = echoClient.Install(net1.Get(0));
|
||||
clientApps.Start(Seconds(2.0));
|
||||
clientApps.Stop(Seconds(20.0));
|
||||
clientApps.Start(Seconds(2));
|
||||
clientApps.Stop(Seconds(20));
|
||||
|
||||
UdpEchoServerHelper echoServer(42);
|
||||
ApplicationContainer serverApps = echoServer.Install(net2.Get(1));
|
||||
serverApps.Start(Seconds(0.0));
|
||||
serverApps.Stop(Seconds(30.0));
|
||||
serverApps.Start(Seconds(0));
|
||||
serverApps.Stop(Seconds(30));
|
||||
|
||||
AsciiTraceHelper ascii;
|
||||
csma.EnableAsciiAll(ascii.CreateFileStream("fragmentation-ipv6-two-mtu.tr"));
|
||||
|
||||
@@ -91,13 +91,13 @@ main(int argc, char** argv)
|
||||
echoClient.SetAttribute("PacketSize", UintegerValue(packetSize));
|
||||
echoClient.SetAttribute("MaxPackets", UintegerValue(maxPacketCount));
|
||||
ApplicationContainer clientApps = echoClient.Install(net1.Get(0));
|
||||
clientApps.Start(Seconds(2.0));
|
||||
clientApps.Stop(Seconds(20.0));
|
||||
clientApps.Start(Seconds(2));
|
||||
clientApps.Stop(Seconds(20));
|
||||
|
||||
UdpEchoServerHelper echoServer(42);
|
||||
ApplicationContainer serverApps = echoServer.Install(net2.Get(1));
|
||||
serverApps.Start(Seconds(0.0));
|
||||
serverApps.Stop(Seconds(30.0));
|
||||
serverApps.Start(Seconds(0));
|
||||
serverApps.Stop(Seconds(30));
|
||||
|
||||
AsciiTraceHelper ascii;
|
||||
csma.EnableAsciiAll(ascii.CreateFileStream("fragmentation-ipv6.tr"));
|
||||
|
||||
@@ -103,8 +103,8 @@ main(int argc, char** argv)
|
||||
iic1.GetInterfaceIndex(1));
|
||||
|
||||
Ptr<OutputStreamWrapper> routingStream = Create<OutputStreamWrapper>(&std::cout);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(0.0), r1, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(3.0), sta1, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(0), r1, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(3), sta1, routingStream);
|
||||
|
||||
NS_LOG_INFO("Create Applications.");
|
||||
uint32_t packetSize = 1024;
|
||||
@@ -114,8 +114,8 @@ main(int argc, char** argv)
|
||||
ping.SetAttribute("Count", UintegerValue(maxPacketCount));
|
||||
ping.SetAttribute("Size", UintegerValue(packetSize));
|
||||
ApplicationContainer apps = ping.Install(sta1);
|
||||
apps.Start(Seconds(2.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(2));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
AsciiTraceHelper ascii;
|
||||
csma.EnableAsciiAll(ascii.CreateFileStream("icmpv6-redirect.tr"));
|
||||
|
||||
@@ -146,7 +146,7 @@ main(int argc, char** argv)
|
||||
*/
|
||||
uint32_t packetSize = 1024;
|
||||
uint32_t maxPacketCount = 1;
|
||||
Time interPacketInterval = Seconds(1.0);
|
||||
Time interPacketInterval = Seconds(1);
|
||||
|
||||
std::vector<Ipv6Address> routersAddress;
|
||||
routersAddress.push_back(i3.GetAddress(1, 1));
|
||||
@@ -163,8 +163,8 @@ main(int argc, char** argv)
|
||||
ApplicationContainer apps = client.Install(h0);
|
||||
DynamicCast<Ping>(apps.Get(0))->SetRouters(routersAddress);
|
||||
|
||||
apps.Start(Seconds(1.0));
|
||||
apps.Stop(Seconds(20.0));
|
||||
apps.Start(Seconds(1));
|
||||
apps.Stop(Seconds(20));
|
||||
|
||||
AsciiTraceHelper ascii;
|
||||
csma.EnableAsciiAll(ascii.CreateFileStream("loose-routing-ipv6.tr"));
|
||||
|
||||
@@ -85,8 +85,8 @@ main(int argc, char** argv)
|
||||
ping.SetAttribute("InterfaceAddress", AddressValue(i.GetAddress(0, 0)));
|
||||
|
||||
ApplicationContainer apps = ping.Install(n.Get(0));
|
||||
apps.Start(Seconds(2.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(2));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
AsciiTraceHelper ascii;
|
||||
csma.EnableAsciiAll(ascii.CreateFileStream("ping6.tr"));
|
||||
|
||||
@@ -114,8 +114,8 @@ main(int argc, char** argv)
|
||||
radvdHelper.GetRadvdInterface(iic2.GetInterfaceIndex(1))->SetSendAdvert(false);
|
||||
|
||||
ApplicationContainer radvdApps = radvdHelper.Install(r);
|
||||
radvdApps.Start(Seconds(1.0));
|
||||
radvdApps.Stop(Seconds(10.0));
|
||||
radvdApps.Start(Seconds(1));
|
||||
radvdApps.Stop(Seconds(10));
|
||||
|
||||
/* Create a Ping application to send ICMPv6 echo request from n0 to n1 via R */
|
||||
uint32_t packetSize = 1024;
|
||||
@@ -126,8 +126,8 @@ main(int argc, char** argv)
|
||||
ping.SetAttribute("Count", UintegerValue(maxPacketCount));
|
||||
ping.SetAttribute("Size", UintegerValue(packetSize));
|
||||
ApplicationContainer apps = ping.Install(net1.Get(0));
|
||||
apps.Start(Seconds(2.0));
|
||||
apps.Stop(Seconds(7.0));
|
||||
apps.Start(Seconds(2));
|
||||
apps.Stop(Seconds(7));
|
||||
|
||||
AsciiTraceHelper ascii;
|
||||
csma.EnableAsciiAll(ascii.CreateFileStream("radvd.tr"));
|
||||
|
||||
@@ -174,8 +174,8 @@ main(int argc, char** argv)
|
||||
}
|
||||
|
||||
ApplicationContainer radvdApps = radvdHelper.Install(r);
|
||||
radvdApps.Start(Seconds(1.0));
|
||||
radvdApps.Stop(Seconds(2.0));
|
||||
radvdApps.Start(Seconds(1));
|
||||
radvdApps.Stop(Seconds(2));
|
||||
|
||||
/* Create a Ping application to send ICMPv6 echo request from n0 to n1 via R */
|
||||
uint32_t packetSize = 1024;
|
||||
@@ -187,18 +187,18 @@ main(int argc, char** argv)
|
||||
ping.SetAttribute("Count", UintegerValue(maxPacketCount));
|
||||
ping.SetAttribute("Size", UintegerValue(packetSize));
|
||||
ApplicationContainer apps = ping.Install(net1.Get(0));
|
||||
apps.Start(Seconds(2.0));
|
||||
apps.Stop(Seconds(5.0));
|
||||
apps.Start(Seconds(2));
|
||||
apps.Stop(Seconds(5));
|
||||
|
||||
Ptr<OutputStreamWrapper> routingStream = Create<OutputStreamWrapper>(&std::cout);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(2.0), n0, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(10.0), n0, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(2), n0, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(10), n0, routingStream);
|
||||
|
||||
IpAddressHelper ipAddressHelper;
|
||||
/* RA should be received, two prefixes + routes + default route should be present */
|
||||
Simulator::Schedule(Seconds(2.0), &IpAddressHelper::PrintIpAddresses, &ipAddressHelper, n0);
|
||||
Simulator::Schedule(Seconds(2), &IpAddressHelper::PrintIpAddresses, &ipAddressHelper, n0);
|
||||
/* at the end, RA addresses and routes should be cleared */
|
||||
Simulator::Schedule(Seconds(10.0), &IpAddressHelper::PrintIpAddresses, &ipAddressHelper, n0);
|
||||
Simulator::Schedule(Seconds(10), &IpAddressHelper::PrintIpAddresses, &ipAddressHelper, n0);
|
||||
|
||||
AsciiTraceHelper ascii;
|
||||
csma.EnableAsciiAll(ascii.CreateFileStream("radvd-two-prefix.tr"));
|
||||
|
||||
@@ -114,8 +114,8 @@ main(int argc, char** argv)
|
||||
ping.SetAttribute("Interval", TimeValue(interPacketInterval));
|
||||
ping.SetAttribute("Size", UintegerValue(packetSize));
|
||||
ApplicationContainer apps = ping.Install(nodes.Get(0));
|
||||
apps.Start(Seconds(2.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(2));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
AsciiTraceHelper ascii;
|
||||
lrWpanHelper.EnableAsciiAll(ascii.CreateFileStream("ping6wsn.tr"));
|
||||
|
||||
@@ -142,8 +142,8 @@ main(int argc, char* argv[])
|
||||
// directly.
|
||||
//
|
||||
ApplicationContainer apps = server.Install("/Names/server");
|
||||
apps.Start(Seconds(1.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(1));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
uint32_t packetSize = 1024;
|
||||
uint32_t maxPacketCount = 1;
|
||||
@@ -157,8 +157,8 @@ main(int argc, char* argv[])
|
||||
// directly.
|
||||
//
|
||||
apps = client.Install("/Names/client");
|
||||
apps.Start(Seconds(2.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(2));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
//
|
||||
// Use the Config system to connect a trace source using the object name
|
||||
|
||||
@@ -76,8 +76,8 @@ main(int argc, char* argv[])
|
||||
uint16_t port = 9; // well-known echo port number
|
||||
UdpEchoServerHelper server(port);
|
||||
ApplicationContainer apps = server.Install(n.Get(1));
|
||||
apps.Start(Seconds(1.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(1));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
//
|
||||
// Create a UdpEchoClient application to send UDP datagrams from node zero to
|
||||
@@ -91,8 +91,8 @@ main(int argc, char* argv[])
|
||||
client.SetAttribute("Interval", TimeValue(interPacketInterval));
|
||||
client.SetAttribute("PacketSize", UintegerValue(packetSize));
|
||||
apps = client.Install(n.Get(0));
|
||||
apps.Start(Seconds(2.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(2));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
AsciiTraceHelper ascii;
|
||||
csma.EnableAsciiAll(ascii.CreateFileStream("realtime-udp-echo.tr"));
|
||||
@@ -101,7 +101,7 @@ main(int argc, char* argv[])
|
||||
//
|
||||
// Now, do the actual simulation.
|
||||
//
|
||||
Simulator::Stop(Seconds(11.0));
|
||||
Simulator::Stop(Seconds(11));
|
||||
NS_LOG_INFO("Run Simulation.");
|
||||
Simulator::Run();
|
||||
Simulator::Destroy();
|
||||
|
||||
@@ -72,8 +72,8 @@ def main(argv):
|
||||
port = 9 # well-known echo port number
|
||||
server = ns.UdpEchoServerHelper(port)
|
||||
apps = server.Install(n.Get(1))
|
||||
apps.Start(ns.Seconds(1.0))
|
||||
apps.Stop(ns.Seconds(10.0))
|
||||
apps.Start(ns.Seconds(1))
|
||||
apps.Stop(ns.Seconds(10))
|
||||
|
||||
#
|
||||
# Create a UdpEchoClient application to send UDP datagrams from node zero to
|
||||
@@ -87,8 +87,8 @@ def main(argv):
|
||||
client.SetAttribute("Interval", ns.TimeValue(interPacketInterval))
|
||||
client.SetAttribute("PacketSize", ns.UintegerValue(packetSize))
|
||||
apps = client.Install(n.Get(0))
|
||||
apps.Start(ns.Seconds(2.0))
|
||||
apps.Stop(ns.Seconds(10.0))
|
||||
apps.Start(ns.Seconds(2))
|
||||
apps.Stop(ns.Seconds(10))
|
||||
|
||||
ascii = ns.AsciiTraceHelper()
|
||||
csma.EnableAsciiAll(ascii.CreateFileStream("realtime-udp-echo.tr"))
|
||||
|
||||
@@ -141,8 +141,8 @@ main(int argc, char* argv[])
|
||||
onoff.SetAttribute("PacketSize", UintegerValue(50));
|
||||
|
||||
ApplicationContainer apps = onoff.Install(c.Get(1));
|
||||
apps.Start(Seconds(1.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(1));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
// Create a second OnOff application to send UDP datagrams of size
|
||||
// 210 bytes at a rate of 448 Kb/s
|
||||
@@ -153,21 +153,21 @@ main(int argc, char* argv[])
|
||||
onoff2.SetAttribute("PacketSize", UintegerValue(50));
|
||||
|
||||
ApplicationContainer apps2 = onoff2.Install(c.Get(1));
|
||||
apps2.Start(Seconds(11.0));
|
||||
apps2.Stop(Seconds(16.0));
|
||||
apps2.Start(Seconds(11));
|
||||
apps2.Stop(Seconds(16));
|
||||
|
||||
// Create an optional packet sink to receive these packets
|
||||
PacketSinkHelper sink("ns3::UdpSocketFactory",
|
||||
Address(InetSocketAddress(Ipv4Address::GetAny(), port)));
|
||||
apps = sink.Install(c.Get(6));
|
||||
apps.Start(Seconds(1.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(1));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
PacketSinkHelper sink2("ns3::UdpSocketFactory",
|
||||
Address(InetSocketAddress(Ipv4Address::GetAny(), port)));
|
||||
apps2 = sink2.Install(c.Get(6));
|
||||
apps2.Start(Seconds(11.0));
|
||||
apps2.Stop(Seconds(16.0));
|
||||
apps2.Start(Seconds(11));
|
||||
apps2.Stop(Seconds(16));
|
||||
|
||||
AsciiTraceHelper ascii;
|
||||
Ptr<OutputStreamWrapper> stream = ascii.CreateFileStream("dynamic-global-routing.tr");
|
||||
|
||||
@@ -129,15 +129,15 @@ main(int argc, char* argv[])
|
||||
Address(InetSocketAddress(ifInAddrC.GetLocal(), port)));
|
||||
onoff.SetConstantRate(DataRate(6000));
|
||||
ApplicationContainer apps = onoff.Install(nA);
|
||||
apps.Start(Seconds(1.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(1));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
// Create a packet sink to receive these packets
|
||||
PacketSinkHelper sink("ns3::UdpSocketFactory",
|
||||
Address(InetSocketAddress(Ipv4Address::GetAny(), port)));
|
||||
apps = sink.Install(nC);
|
||||
apps.Start(Seconds(1.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(1));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
AsciiTraceHelper ascii;
|
||||
p2p.EnableAsciiAll(ascii.CreateFileStream("global-routing-injection32.tr"));
|
||||
|
||||
@@ -100,15 +100,15 @@ main(int argc, char* argv[])
|
||||
Address(InetSocketAddress(ifInAddrC.GetLocal(), port)));
|
||||
onoff.SetConstantRate(DataRate(6000));
|
||||
ApplicationContainer apps = onoff.Install(nA);
|
||||
apps.Start(Seconds(1.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(1));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
// Create a packet sink to receive these packets
|
||||
PacketSinkHelper sink("ns3::UdpSocketFactory",
|
||||
Address(InetSocketAddress(Ipv4Address::GetAny(), port)));
|
||||
apps = sink.Install(nC);
|
||||
apps.Start(Seconds(1.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(1));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
AsciiTraceHelper ascii;
|
||||
p2p.EnableAsciiAll(ascii.CreateFileStream("global-routing-slash32.tr"));
|
||||
|
||||
@@ -173,7 +173,7 @@ RoutingExperiment::CheckThroughput()
|
||||
|
||||
out.close();
|
||||
packetsReceived = 0;
|
||||
Simulator::Schedule(Seconds(1.0), &RoutingExperiment::CheckThroughput, this);
|
||||
Simulator::Schedule(Seconds(1), &RoutingExperiment::CheckThroughput, this);
|
||||
}
|
||||
|
||||
Ptr<Socket>
|
||||
|
||||
@@ -104,8 +104,8 @@ main(int argc, char* argv[])
|
||||
onoff.SetAttribute("PacketSize", UintegerValue(50));
|
||||
|
||||
ApplicationContainer apps = onoff.Install(c.Get(0));
|
||||
apps.Start(Seconds(1.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(1));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
AsciiTraceHelper ascii;
|
||||
Ptr<OutputStreamWrapper> stream = ascii.CreateFileStream("mixed-global-routing.tr");
|
||||
|
||||
@@ -204,25 +204,25 @@ main(int argc, char** argv)
|
||||
{
|
||||
Ptr<OutputStreamWrapper> routingStream = Create<OutputStreamWrapper>(&std::cout);
|
||||
|
||||
Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(30.0), a, routingStream);
|
||||
Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(30.0), b, routingStream);
|
||||
Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(30.0), c, routingStream);
|
||||
Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(30.0), d, routingStream);
|
||||
Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(30), a, routingStream);
|
||||
Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(30), b, routingStream);
|
||||
Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(30), c, routingStream);
|
||||
Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(30), d, routingStream);
|
||||
|
||||
Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(60.0), a, routingStream);
|
||||
Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(60.0), b, routingStream);
|
||||
Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(60.0), c, routingStream);
|
||||
Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(60.0), d, routingStream);
|
||||
Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(60), a, routingStream);
|
||||
Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(60), b, routingStream);
|
||||
Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(60), c, routingStream);
|
||||
Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(60), d, routingStream);
|
||||
|
||||
Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(90.0), a, routingStream);
|
||||
Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(90.0), b, routingStream);
|
||||
Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(90.0), c, routingStream);
|
||||
Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(90.0), d, routingStream);
|
||||
Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(90), a, routingStream);
|
||||
Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(90), b, routingStream);
|
||||
Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(90), c, routingStream);
|
||||
Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(90), d, routingStream);
|
||||
}
|
||||
|
||||
NS_LOG_INFO("Create Applications.");
|
||||
uint32_t packetSize = 1024;
|
||||
Time interPacketInterval = Seconds(1.0);
|
||||
Time interPacketInterval = Seconds(1);
|
||||
PingHelper ping(Ipv4Address("10.0.6.2"));
|
||||
|
||||
ping.SetAttribute("Interval", TimeValue(interPacketInterval));
|
||||
@@ -232,8 +232,8 @@ main(int argc, char** argv)
|
||||
ping.SetAttribute("VerboseMode", EnumValue(Ping::VerboseMode::VERBOSE));
|
||||
}
|
||||
ApplicationContainer apps = ping.Install(src);
|
||||
apps.Start(Seconds(1.0));
|
||||
apps.Stop(Seconds(110.0));
|
||||
apps.Start(Seconds(1));
|
||||
apps.Stop(Seconds(110));
|
||||
|
||||
AsciiTraceHelper ascii;
|
||||
csma.EnableAsciiAll(ascii.CreateFileStream("rip-simple-routing.tr"));
|
||||
@@ -243,7 +243,7 @@ main(int argc, char** argv)
|
||||
|
||||
/* Now, do the actual simulation. */
|
||||
NS_LOG_INFO("Run Simulation.");
|
||||
Simulator::Stop(Seconds(131.0));
|
||||
Simulator::Stop(Seconds(131));
|
||||
Simulator::Run();
|
||||
Simulator::Destroy();
|
||||
NS_LOG_INFO("Done.");
|
||||
|
||||
@@ -209,25 +209,25 @@ main(int argc, char** argv)
|
||||
{
|
||||
Ptr<OutputStreamWrapper> routingStream = Create<OutputStreamWrapper>(&std::cout);
|
||||
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(30.0), a, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(30.0), b, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(30.0), c, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(30.0), d, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(30), a, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(30), b, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(30), c, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(30), d, routingStream);
|
||||
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(60.0), a, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(60.0), b, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(60.0), c, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(60.0), d, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(60), a, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(60), b, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(60), c, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(60), d, routingStream);
|
||||
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(90.0), a, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(90.0), b, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(90.0), c, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(90.0), d, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(90), a, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(90), b, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(90), c, routingStream);
|
||||
Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(90), d, routingStream);
|
||||
}
|
||||
|
||||
NS_LOG_INFO("Create Applications.");
|
||||
uint32_t packetSize = 1024;
|
||||
Time interPacketInterval = Seconds(1.0);
|
||||
Time interPacketInterval = Seconds(1);
|
||||
PingHelper ping(iic7.GetAddress(1, 1));
|
||||
|
||||
ping.SetAttribute("Interval", TimeValue(interPacketInterval));
|
||||
@@ -237,8 +237,8 @@ main(int argc, char** argv)
|
||||
ping.SetAttribute("VerboseMode", EnumValue(Ping::VerboseMode::VERBOSE));
|
||||
}
|
||||
ApplicationContainer apps = ping.Install(src);
|
||||
apps.Start(Seconds(1.0));
|
||||
apps.Stop(Seconds(110.0));
|
||||
apps.Start(Seconds(1));
|
||||
apps.Stop(Seconds(110));
|
||||
|
||||
AsciiTraceHelper ascii;
|
||||
csma.EnableAsciiAll(ascii.CreateFileStream("ripng-simple-routing.tr"));
|
||||
|
||||
@@ -131,14 +131,14 @@ main(int argc, char* argv[])
|
||||
|
||||
ApplicationContainer apps = onoff.Install(c.Get(3));
|
||||
apps.Start(Seconds(1.1));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
// Create a packet sink to receive these packets
|
||||
PacketSinkHelper sink("ns3::UdpSocketFactory",
|
||||
Address(InetSocketAddress(Ipv4Address::GetAny(), port)));
|
||||
apps = sink.Install(c.Get(1));
|
||||
apps.Start(Seconds(1.1));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
AsciiTraceHelper ascii;
|
||||
p2p.EnableAsciiAll(ascii.CreateFileStream("simple-alternate-routing.tr"));
|
||||
|
||||
@@ -110,26 +110,26 @@ main(int argc, char* argv[])
|
||||
Address(InetSocketAddress(i3i2.GetAddress(0), port)));
|
||||
onoff.SetConstantRate(DataRate("448kb/s"));
|
||||
ApplicationContainer apps = onoff.Install(c.Get(0));
|
||||
apps.Start(Seconds(1.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(1));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
// Create a packet sink to receive these packets
|
||||
PacketSinkHelper sink("ns3::UdpSocketFactory",
|
||||
Address(InetSocketAddress(Ipv4Address::GetAny(), port)));
|
||||
apps = sink.Install(c.Get(3));
|
||||
apps.Start(Seconds(1.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(1));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
// Create a similar flow from n3 to n1, starting at time 1.1 seconds
|
||||
onoff.SetAttribute("Remote", AddressValue(InetSocketAddress(i1i2.GetAddress(0), port)));
|
||||
apps = onoff.Install(c.Get(3));
|
||||
apps.Start(Seconds(1.1));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
// Create a packet sink to receive these packets
|
||||
apps = sink.Install(c.Get(1));
|
||||
apps.Start(Seconds(1.1));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
AsciiTraceHelper ascii;
|
||||
p2p.EnableAsciiAll(ascii.CreateFileStream("simple-global-routing.tr"));
|
||||
|
||||
@@ -136,8 +136,8 @@ main(int argc, char** argv)
|
||||
ping.SetAttribute("Count", UintegerValue(maxPacketCount));
|
||||
ping.SetAttribute("Size", UintegerValue(packetSize));
|
||||
ApplicationContainer apps = ping.Install(net1.Get(0));
|
||||
apps.Start(Seconds(2.0));
|
||||
apps.Stop(Seconds(20.0));
|
||||
apps.Start(Seconds(2));
|
||||
apps.Stop(Seconds(20));
|
||||
|
||||
AsciiTraceHelper ascii;
|
||||
csma.EnableAsciiAll(ascii.CreateFileStream("simple-routing-ping6.tr"));
|
||||
|
||||
@@ -69,7 +69,7 @@ def main(argv):
|
||||
print("Application")
|
||||
packetSize = 1024
|
||||
maxPacketCount = 5
|
||||
interPacketInterval = ns.Seconds(1.0)
|
||||
interPacketInterval = ns.Seconds(1)
|
||||
# ping = ns.PingHelper(i2.GetAddress(1, 1).ConvertTo())
|
||||
ping = ns.PingHelper(i2.GetAddress(1, 1).ConvertTo())
|
||||
|
||||
@@ -81,8 +81,8 @@ def main(argv):
|
||||
ping.SetAttribute("Size", ns.UintegerValue(packetSize))
|
||||
|
||||
apps = ping.Install(ns.NodeContainer(net1.Get(0)))
|
||||
apps.Start(ns.Seconds(2.0))
|
||||
apps.Stop(ns.Seconds(20.0))
|
||||
apps.Start(ns.Seconds(2))
|
||||
apps.Stop(ns.Seconds(20))
|
||||
|
||||
print("Tracing")
|
||||
ascii = ns.AsciiTraceHelper()
|
||||
|
||||
@@ -106,15 +106,15 @@ main(int argc, char* argv[])
|
||||
Address(InetSocketAddress(ifInAddrC.GetLocal(), port)));
|
||||
onoff.SetConstantRate(DataRate(6000));
|
||||
ApplicationContainer apps = onoff.Install(nA);
|
||||
apps.Start(Seconds(1.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(1));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
// Create a packet sink to receive these packets
|
||||
PacketSinkHelper sink("ns3::UdpSocketFactory",
|
||||
Address(InetSocketAddress(Ipv4Address::GetAny(), port)));
|
||||
apps = sink.Install(nC);
|
||||
apps.Start(Seconds(1.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(1));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
AsciiTraceHelper ascii;
|
||||
p2p.EnableAsciiAll(ascii.CreateFileStream("static-routing-slash32.tr"));
|
||||
|
||||
@@ -144,17 +144,17 @@ main(int argc, char* argv[])
|
||||
// First packet as normal (goes via Rtr1)
|
||||
Simulator::Schedule(Seconds(0.1), &SendStuff, srcSocket, dstaddr, dstport);
|
||||
// Second via Rtr1 explicitly
|
||||
Simulator::Schedule(Seconds(1.0), &BindSock, srcSocket, SrcToRtr1);
|
||||
Simulator::Schedule(Seconds(1), &BindSock, srcSocket, SrcToRtr1);
|
||||
Simulator::Schedule(Seconds(1.1), &SendStuff, srcSocket, dstaddr, dstport);
|
||||
// Third via Rtr2 explicitly
|
||||
Simulator::Schedule(Seconds(2.0), &BindSock, srcSocket, SrcToRtr2);
|
||||
Simulator::Schedule(Seconds(2), &BindSock, srcSocket, SrcToRtr2);
|
||||
Simulator::Schedule(Seconds(2.1), &SendStuff, srcSocket, dstaddr, dstport);
|
||||
// Fourth again as normal (goes via Rtr1)
|
||||
Simulator::Schedule(Seconds(3.0), &BindSock, srcSocket, Ptr<NetDevice>(nullptr));
|
||||
Simulator::Schedule(Seconds(3), &BindSock, srcSocket, Ptr<NetDevice>(nullptr));
|
||||
Simulator::Schedule(Seconds(3.1), &SendStuff, srcSocket, dstaddr, dstport);
|
||||
// If you uncomment what's below, it results in ASSERT failing since you can't
|
||||
// bind to a socket not existing on a node
|
||||
// Simulator::Schedule(Seconds(4.0),&BindSock, srcSocket, dDstRtrdDst.Get(0));
|
||||
// Simulator::Schedule(Seconds(4),&BindSock, srcSocket, dDstRtrdDst.Get(0));
|
||||
Simulator::Run();
|
||||
Simulator::Destroy();
|
||||
|
||||
|
||||
@@ -149,8 +149,8 @@ main(int argc, char* argv[])
|
||||
PacketSinkHelper sink("ns3::TcpSocketFactory",
|
||||
InetSocketAddress(Ipv4Address::GetAny(), dstport));
|
||||
ApplicationContainer apps = sink.Install(nDst);
|
||||
apps.Start(Seconds(0.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(0));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
AsciiTraceHelper ascii;
|
||||
p2p.EnableAsciiAll(ascii.CreateFileStream("socket-bound-tcp-static-routing.tr"));
|
||||
@@ -162,17 +162,17 @@ main(int argc, char* argv[])
|
||||
// First packet as normal (goes via Rtr1)
|
||||
Simulator::Schedule(Seconds(0.1), &StartFlow, srcSocket1, dstaddr, dstport);
|
||||
// Second via Rtr1 explicitly
|
||||
Simulator::Schedule(Seconds(1.0), &BindSock, srcSocket2, SrcToRtr1);
|
||||
Simulator::Schedule(Seconds(1), &BindSock, srcSocket2, SrcToRtr1);
|
||||
Simulator::Schedule(Seconds(1.1), &StartFlow, srcSocket2, dstaddr, dstport);
|
||||
// Third via Rtr2 explicitly
|
||||
Simulator::Schedule(Seconds(2.0), &BindSock, srcSocket3, SrcToRtr2);
|
||||
Simulator::Schedule(Seconds(2), &BindSock, srcSocket3, SrcToRtr2);
|
||||
Simulator::Schedule(Seconds(2.1), &StartFlow, srcSocket3, dstaddr, dstport);
|
||||
// Fourth again as normal (goes via Rtr1)
|
||||
Simulator::Schedule(Seconds(3.0), &BindSock, srcSocket4, Ptr<NetDevice>(nullptr));
|
||||
Simulator::Schedule(Seconds(3), &BindSock, srcSocket4, Ptr<NetDevice>(nullptr));
|
||||
Simulator::Schedule(Seconds(3.1), &StartFlow, srcSocket4, dstaddr, dstport);
|
||||
// If you uncomment what's below, it results in ASSERT failing since you can't
|
||||
// bind to a socket not existing on a node
|
||||
// Simulator::Schedule(Seconds(4.0),&BindSock, srcSocket, dDstRtrdDst.Get(0));
|
||||
// Simulator::Schedule(Seconds(4),&BindSock, srcSocket, dDstRtrdDst.Get(0));
|
||||
Simulator::Run();
|
||||
Simulator::Destroy();
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ main(int argc, char* argv[])
|
||||
// Schedule SendPacket
|
||||
Time interPacketInterval = Seconds(packetInterval);
|
||||
Simulator::ScheduleWithContext(source->GetNode()->GetId(),
|
||||
Seconds(1.0),
|
||||
Seconds(1),
|
||||
&SendPacket,
|
||||
source,
|
||||
packetSize,
|
||||
|
||||
@@ -135,7 +135,7 @@ main(int argc, char* argv[])
|
||||
// Schedule SendPacket
|
||||
Time interPacketInterval = Seconds(packetInterval);
|
||||
Simulator::ScheduleWithContext(source->GetNode()->GetId(),
|
||||
Seconds(1.0),
|
||||
Seconds(1),
|
||||
&SendPacket,
|
||||
source,
|
||||
packetSize,
|
||||
|
||||
@@ -67,8 +67,8 @@ main(int argc, char* argv[])
|
||||
Address hubLocalAddress(InetSocketAddress(Ipv4Address::GetAny(), port));
|
||||
PacketSinkHelper packetSinkHelper("ns3::TcpSocketFactory", hubLocalAddress);
|
||||
ApplicationContainer hubApp = packetSinkHelper.Install(star.GetHub());
|
||||
hubApp.Start(Seconds(1.0));
|
||||
hubApp.Stop(Seconds(10.0));
|
||||
hubApp.Start(Seconds(1));
|
||||
hubApp.Stop(Seconds(10));
|
||||
|
||||
//
|
||||
// Create OnOff applications to send TCP to the hub, one on each spoke node.
|
||||
@@ -85,8 +85,8 @@ main(int argc, char* argv[])
|
||||
onOffHelper.SetAttribute("Remote", remoteAddress);
|
||||
spokeApps.Add(onOffHelper.Install(star.GetSpokeNode(i)));
|
||||
}
|
||||
spokeApps.Start(Seconds(1.0));
|
||||
spokeApps.Stop(Seconds(10.0));
|
||||
spokeApps.Start(Seconds(1));
|
||||
spokeApps.Stop(Seconds(10));
|
||||
|
||||
NS_LOG_INFO("Enable static global routing.");
|
||||
//
|
||||
|
||||
@@ -221,7 +221,7 @@ main(int argc, char* argv[])
|
||||
// Install application on the receiver
|
||||
PacketSinkHelper sink("ns3::TcpSocketFactory", InetSocketAddress(Ipv4Address::GetAny(), port));
|
||||
ApplicationContainer sinkApps = sink.Install(receiver.Get(0));
|
||||
sinkApps.Start(Seconds(0.0));
|
||||
sinkApps.Start(Seconds(0));
|
||||
sinkApps.Stop(stopTime);
|
||||
|
||||
// Create a new directory to store the output of the program
|
||||
|
||||
@@ -85,16 +85,16 @@ main(int argc, char* argv[])
|
||||
// Set the amount of data to send in bytes. Zero is unlimited.
|
||||
source.SetAttribute("MaxBytes", UintegerValue(maxBytes));
|
||||
ApplicationContainer sourceApps = source.Install(nodes.Get(0));
|
||||
sourceApps.Start(Seconds(0.0));
|
||||
sourceApps.Stop(Seconds(10.0));
|
||||
sourceApps.Start(Seconds(0));
|
||||
sourceApps.Stop(Seconds(10));
|
||||
|
||||
//
|
||||
// Create a PacketSinkApplication and install it on node 1
|
||||
//
|
||||
PacketSinkHelper sink("ns3::TcpSocketFactory", InetSocketAddress(Ipv4Address::GetAny(), port));
|
||||
ApplicationContainer sinkApps = sink.Install(nodes.Get(1));
|
||||
sinkApps.Start(Seconds(0.0));
|
||||
sinkApps.Stop(Seconds(10.0));
|
||||
sinkApps.Start(Seconds(0));
|
||||
sinkApps.Stop(Seconds(10));
|
||||
|
||||
//
|
||||
// Set up tracing if enabled
|
||||
@@ -110,7 +110,7 @@ main(int argc, char* argv[])
|
||||
// Now, do the actual simulation.
|
||||
//
|
||||
NS_LOG_INFO("Run Simulation.");
|
||||
Simulator::Stop(Seconds(10.0));
|
||||
Simulator::Stop(Seconds(10));
|
||||
Simulator::Run();
|
||||
Simulator::Destroy();
|
||||
NS_LOG_INFO("Done.");
|
||||
|
||||
@@ -151,8 +151,8 @@ main(int argc, char* argv[])
|
||||
InetSocketAddress(Ipv4Address::GetAny(), servPort));
|
||||
|
||||
ApplicationContainer apps = sink.Install(n1n2.Get(1));
|
||||
apps.Start(Seconds(0.0));
|
||||
apps.Stop(Seconds(3.0));
|
||||
apps.Start(Seconds(0));
|
||||
apps.Stop(Seconds(3));
|
||||
|
||||
// Create a source to send packets from n0. Instead of a full Application
|
||||
// and the helper APIs you might see in other example files, this example
|
||||
|
||||
@@ -92,8 +92,8 @@ InstallBulkSend(Ptr<Node> node,
|
||||
BulkSendHelper source(socketFactory, InetSocketAddress(address, port));
|
||||
source.SetAttribute("MaxBytes", UintegerValue(0));
|
||||
ApplicationContainer sourceApps = source.Install(node);
|
||||
sourceApps.Start(Seconds(10.0));
|
||||
Simulator::Schedule(Seconds(10.0) + Seconds(0.001), &TraceCwnd, nodeId, cwndWindow, CwndTrace);
|
||||
sourceApps.Start(Seconds(10));
|
||||
Simulator::Schedule(Seconds(10) + Seconds(0.001), &TraceCwnd, nodeId, cwndWindow, CwndTrace);
|
||||
sourceApps.Stop(stopTime);
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ InstallPacketSink(Ptr<Node> node, uint16_t port, std::string socketFactory)
|
||||
{
|
||||
PacketSinkHelper sink(socketFactory, InetSocketAddress(Ipv4Address::GetAny(), port));
|
||||
ApplicationContainer sinkApps = sink.Install(node);
|
||||
sinkApps.Start(Seconds(10.0));
|
||||
sinkApps.Start(Seconds(10));
|
||||
sinkApps.Stop(stopTime);
|
||||
}
|
||||
|
||||
|
||||
@@ -108,16 +108,16 @@ main(int argc, char* argv[])
|
||||
// Set the amount of data to send in bytes. Zero is unlimited.
|
||||
source.SetAttribute("MaxBytes", UintegerValue(maxBytes));
|
||||
ApplicationContainer sourceApps = source.Install(nodes.Get(0));
|
||||
sourceApps.Start(Seconds(0.0));
|
||||
sourceApps.Stop(Seconds(10.0));
|
||||
sourceApps.Start(Seconds(0));
|
||||
sourceApps.Stop(Seconds(10));
|
||||
|
||||
//
|
||||
// Create a PacketSinkApplication and install it on node 1
|
||||
//
|
||||
PacketSinkHelper sink("ns3::TcpSocketFactory", InetSocketAddress(Ipv4Address::GetAny(), port));
|
||||
ApplicationContainer sinkApps = sink.Install(nodes.Get(1));
|
||||
sinkApps.Start(Seconds(0.0));
|
||||
sinkApps.Stop(Seconds(10.0));
|
||||
sinkApps.Start(Seconds(0));
|
||||
sinkApps.Stop(Seconds(10));
|
||||
|
||||
//
|
||||
// Set up tracing if enabled
|
||||
@@ -132,7 +132,7 @@ main(int argc, char* argv[])
|
||||
// Now, do the actual simulation.
|
||||
//
|
||||
NS_LOG_INFO("Run Simulation.");
|
||||
Simulator::Stop(Seconds(10.0));
|
||||
Simulator::Stop(Seconds(10));
|
||||
Simulator::Run();
|
||||
Simulator::Destroy();
|
||||
NS_LOG_INFO("Done.");
|
||||
|
||||
@@ -115,8 +115,8 @@ main(int argc, char* argv[])
|
||||
Address sinkLocalAddress(InetSocketAddress(Ipv4Address::GetAny(), port));
|
||||
PacketSinkHelper sinkHelper("ns3::TcpSocketFactory", sinkLocalAddress);
|
||||
ApplicationContainer sinkApp = sinkHelper.Install(serverNode);
|
||||
sinkApp.Start(Seconds(1.0));
|
||||
sinkApp.Stop(Seconds(10.0));
|
||||
sinkApp.Start(Seconds(1));
|
||||
sinkApp.Stop(Seconds(10));
|
||||
|
||||
// Create the OnOff applications to send TCP to the server
|
||||
OnOffHelper clientHelper("ns3::TcpSocketFactory", Address());
|
||||
@@ -133,8 +133,8 @@ main(int argc, char* argv[])
|
||||
clientHelper.SetAttribute("Remote", remoteAddress);
|
||||
clientApps.Add(clientHelper.Install(clientNodes.Get(i)));
|
||||
}
|
||||
clientApps.Start(Seconds(1.0));
|
||||
clientApps.Stop(Seconds(10.0));
|
||||
clientApps.Start(Seconds(1));
|
||||
clientApps.Stop(Seconds(10));
|
||||
|
||||
// configure tracing
|
||||
AsciiTraceHelper ascii;
|
||||
|
||||
@@ -139,8 +139,8 @@ main(int argc, char* argv[])
|
||||
{
|
||||
sinkApps.Add(packetSinkHelper.Install(d.GetLeft(i)));
|
||||
}
|
||||
sinkApps.Start(Seconds(0.0));
|
||||
sinkApps.Stop(Seconds(30.0));
|
||||
sinkApps.Start(Seconds(0));
|
||||
sinkApps.Stop(Seconds(30));
|
||||
|
||||
ApplicationContainer clientApps;
|
||||
for (uint32_t i = 0; i < d.RightCount(); ++i)
|
||||
@@ -150,8 +150,8 @@ main(int argc, char* argv[])
|
||||
clientHelper.SetAttribute("Remote", remoteAddress);
|
||||
clientApps.Add(clientHelper.Install(d.GetRight(i)));
|
||||
}
|
||||
clientApps.Start(Seconds(1.0)); // Start 1 second after sink
|
||||
clientApps.Stop(Seconds(15.0)); // Stop before the sink
|
||||
clientApps.Start(Seconds(1)); // Start 1 second after sink
|
||||
clientApps.Stop(Seconds(15)); // Stop before the sink
|
||||
|
||||
Ipv4GlobalRoutingHelper::PopulateRoutingTables();
|
||||
|
||||
|
||||
@@ -140,8 +140,8 @@ main(int argc, char* argv[])
|
||||
{
|
||||
sinkApps.Add(packetSinkHelper.Install(d.GetLeft(i)));
|
||||
}
|
||||
sinkApps.Start(Seconds(0.0));
|
||||
sinkApps.Stop(Seconds(30.0));
|
||||
sinkApps.Start(Seconds(0));
|
||||
sinkApps.Stop(Seconds(30));
|
||||
|
||||
ApplicationContainer clientApps;
|
||||
for (uint32_t i = 0; i < d.RightCount(); ++i)
|
||||
@@ -151,8 +151,8 @@ main(int argc, char* argv[])
|
||||
clientHelper.SetAttribute("Remote", remoteAddress);
|
||||
clientApps.Add(clientHelper.Install(d.GetRight(i)));
|
||||
}
|
||||
clientApps.Start(Seconds(1.0)); // Start 1 second after sink
|
||||
clientApps.Stop(Seconds(15.0)); // Stop before the sink
|
||||
clientApps.Start(Seconds(1)); // Start 1 second after sink
|
||||
clientApps.Stop(Seconds(15)); // Stop before the sink
|
||||
|
||||
Ipv4GlobalRoutingHelper::PopulateRoutingTables();
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ main(int argc, char* argv[])
|
||||
PacketSinkHelper packetSinkHelper("ns3::TcpSocketFactory", localAddress);
|
||||
ApplicationContainer sinkApp = packetSinkHelper.Install(nodes.Get(0));
|
||||
|
||||
sinkApp.Start(Seconds(0.0));
|
||||
sinkApp.Start(Seconds(0));
|
||||
sinkApp.Stop(Seconds(simulationTime + 0.1));
|
||||
|
||||
uint32_t payloadSize = 1448;
|
||||
@@ -126,7 +126,7 @@ main(int argc, char* argv[])
|
||||
onoff.SetAttribute("Tos", UintegerValue(0xb8));
|
||||
|
||||
apps.Add(onoff.Install(nodes.Get(1)));
|
||||
apps.Start(Seconds(1.0));
|
||||
apps.Start(Seconds(1));
|
||||
apps.Stop(Seconds(simulationTime + 0.1));
|
||||
|
||||
Simulator::Stop(Seconds(simulationTime + 5));
|
||||
|
||||
@@ -149,7 +149,7 @@ main(int argc, char* argv[])
|
||||
PacketSinkHelper packetSinkHelper(socketType, localAddress);
|
||||
ApplicationContainer sinkApp = packetSinkHelper.Install(nodes.Get(0));
|
||||
|
||||
sinkApp.Start(Seconds(0.0));
|
||||
sinkApp.Start(Seconds(0));
|
||||
sinkApp.Stop(Seconds(simulationTime + 0.1));
|
||||
|
||||
uint32_t payloadSize = 1448;
|
||||
@@ -166,7 +166,7 @@ main(int argc, char* argv[])
|
||||
onoff.SetAttribute("Remote", AddressValue(rmt));
|
||||
onoff.SetAttribute("Tos", UintegerValue(0xb8));
|
||||
apps.Add(onoff.Install(nodes.Get(1)));
|
||||
apps.Start(Seconds(1.0));
|
||||
apps.Start(Seconds(1));
|
||||
apps.Stop(Seconds(simulationTime + 0.1));
|
||||
|
||||
FlowMonitorHelper flowmon;
|
||||
|
||||
@@ -50,17 +50,17 @@ main(int argc, char* argv[])
|
||||
UdpEchoServerHelper echoServer(9);
|
||||
|
||||
ApplicationContainer serverApps = echoServer.Install(nodes.Get(1));
|
||||
serverApps.Start(Seconds(1.0));
|
||||
serverApps.Stop(Seconds(10.0));
|
||||
serverApps.Start(Seconds(1));
|
||||
serverApps.Stop(Seconds(10));
|
||||
|
||||
UdpEchoClientHelper echoClient(interfaces.GetAddress(1), 9);
|
||||
echoClient.SetAttribute("MaxPackets", UintegerValue(1));
|
||||
echoClient.SetAttribute("Interval", TimeValue(Seconds(1.0)));
|
||||
echoClient.SetAttribute("Interval", TimeValue(Seconds(1)));
|
||||
echoClient.SetAttribute("PacketSize", UintegerValue(1024));
|
||||
|
||||
ApplicationContainer clientApps = echoClient.Install(nodes.Get(0));
|
||||
clientApps.Start(Seconds(2.0));
|
||||
clientApps.Stop(Seconds(10.0));
|
||||
clientApps.Start(Seconds(2));
|
||||
clientApps.Stop(Seconds(10));
|
||||
|
||||
Simulator::Run();
|
||||
Simulator::Destroy();
|
||||
|
||||
@@ -41,18 +41,18 @@ interfaces = address.Assign(devices)
|
||||
echoServer = ns.UdpEchoServerHelper(9)
|
||||
|
||||
serverApps = echoServer.Install(nodes.Get(1))
|
||||
serverApps.Start(ns.Seconds(1.0))
|
||||
serverApps.Stop(ns.Seconds(10.0))
|
||||
serverApps.Start(ns.Seconds(1))
|
||||
serverApps.Stop(ns.Seconds(10))
|
||||
|
||||
address = interfaces.GetAddress(1).ConvertTo()
|
||||
echoClient = ns.UdpEchoClientHelper(address, 9)
|
||||
echoClient.SetAttribute("MaxPackets", ns.UintegerValue(1))
|
||||
echoClient.SetAttribute("Interval", ns.TimeValue(ns.Seconds(1.0)))
|
||||
echoClient.SetAttribute("Interval", ns.TimeValue(ns.Seconds(1)))
|
||||
echoClient.SetAttribute("PacketSize", ns.UintegerValue(1024))
|
||||
|
||||
clientApps = echoClient.Install(nodes.Get(0))
|
||||
clientApps.Start(ns.Seconds(2.0))
|
||||
clientApps.Stop(ns.Seconds(10.0))
|
||||
clientApps.Start(ns.Seconds(2))
|
||||
clientApps.Stop(ns.Seconds(10))
|
||||
|
||||
ns.Simulator.Run()
|
||||
ns.Simulator.Destroy()
|
||||
|
||||
@@ -79,17 +79,17 @@ main(int argc, char* argv[])
|
||||
UdpEchoServerHelper echoServer(9);
|
||||
|
||||
ApplicationContainer serverApps = echoServer.Install(csmaNodes.Get(nCsma));
|
||||
serverApps.Start(Seconds(1.0));
|
||||
serverApps.Stop(Seconds(10.0));
|
||||
serverApps.Start(Seconds(1));
|
||||
serverApps.Stop(Seconds(10));
|
||||
|
||||
UdpEchoClientHelper echoClient(csmaInterfaces.GetAddress(nCsma), 9);
|
||||
echoClient.SetAttribute("MaxPackets", UintegerValue(1));
|
||||
echoClient.SetAttribute("Interval", TimeValue(Seconds(1.0)));
|
||||
echoClient.SetAttribute("Interval", TimeValue(Seconds(1)));
|
||||
echoClient.SetAttribute("PacketSize", UintegerValue(1024));
|
||||
|
||||
ApplicationContainer clientApps = echoClient.Install(p2pNodes.Get(0));
|
||||
clientApps.Start(Seconds(2.0));
|
||||
clientApps.Stop(Seconds(10.0));
|
||||
clientApps.Start(Seconds(2));
|
||||
clientApps.Stop(Seconds(10));
|
||||
|
||||
Ipv4GlobalRoutingHelper::PopulateRoutingTables();
|
||||
|
||||
|
||||
@@ -69,17 +69,17 @@ csmaInterfaces = address.Assign(csmaDevices)
|
||||
echoServer = ns.UdpEchoServerHelper(9)
|
||||
|
||||
serverApps = echoServer.Install(csmaNodes.Get(nCsma.value))
|
||||
serverApps.Start(ns.Seconds(1.0))
|
||||
serverApps.Stop(ns.Seconds(10.0))
|
||||
serverApps.Start(ns.Seconds(1))
|
||||
serverApps.Stop(ns.Seconds(10))
|
||||
|
||||
echoClient = ns.UdpEchoClientHelper(csmaInterfaces.GetAddress(nCsma.value).ConvertTo(), 9)
|
||||
echoClient.SetAttribute("MaxPackets", ns.UintegerValue(1))
|
||||
echoClient.SetAttribute("Interval", ns.TimeValue(ns.Seconds(1.0)))
|
||||
echoClient.SetAttribute("Interval", ns.TimeValue(ns.Seconds(1)))
|
||||
echoClient.SetAttribute("PacketSize", ns.UintegerValue(1024))
|
||||
|
||||
clientApps = echoClient.Install(p2pNodes.Get(0))
|
||||
clientApps.Start(ns.Seconds(2.0))
|
||||
clientApps.Stop(ns.Seconds(10.0))
|
||||
clientApps.Start(ns.Seconds(2))
|
||||
clientApps.Stop(ns.Seconds(10))
|
||||
|
||||
ns.Ipv4GlobalRoutingHelper.PopulateRoutingTables()
|
||||
|
||||
|
||||
@@ -147,21 +147,21 @@ main(int argc, char* argv[])
|
||||
UdpEchoServerHelper echoServer(9);
|
||||
|
||||
ApplicationContainer serverApps = echoServer.Install(csmaNodes.Get(nCsma));
|
||||
serverApps.Start(Seconds(1.0));
|
||||
serverApps.Stop(Seconds(10.0));
|
||||
serverApps.Start(Seconds(1));
|
||||
serverApps.Stop(Seconds(10));
|
||||
|
||||
UdpEchoClientHelper echoClient(csmaInterfaces.GetAddress(nCsma), 9);
|
||||
echoClient.SetAttribute("MaxPackets", UintegerValue(1));
|
||||
echoClient.SetAttribute("Interval", TimeValue(Seconds(1.0)));
|
||||
echoClient.SetAttribute("Interval", TimeValue(Seconds(1)));
|
||||
echoClient.SetAttribute("PacketSize", UintegerValue(1024));
|
||||
|
||||
ApplicationContainer clientApps = echoClient.Install(wifiStaNodes.Get(nWifi - 1));
|
||||
clientApps.Start(Seconds(2.0));
|
||||
clientApps.Stop(Seconds(10.0));
|
||||
clientApps.Start(Seconds(2));
|
||||
clientApps.Stop(Seconds(10));
|
||||
|
||||
Ipv4GlobalRoutingHelper::PopulateRoutingTables();
|
||||
|
||||
Simulator::Stop(Seconds(10.0));
|
||||
Simulator::Stop(Seconds(10));
|
||||
|
||||
if (tracing)
|
||||
{
|
||||
|
||||
@@ -135,21 +135,21 @@ address.Assign(apDevices)
|
||||
echoServer = ns.UdpEchoServerHelper(9)
|
||||
|
||||
serverApps = echoServer.Install(csmaNodes.Get(nCsma.value))
|
||||
serverApps.Start(ns.Seconds(1.0))
|
||||
serverApps.Stop(ns.Seconds(10.0))
|
||||
serverApps.Start(ns.Seconds(1))
|
||||
serverApps.Stop(ns.Seconds(10))
|
||||
|
||||
echoClient = ns.UdpEchoClientHelper(csmaInterfaces.GetAddress(nCsma.value).ConvertTo(), 9)
|
||||
echoClient.SetAttribute("MaxPackets", ns.UintegerValue(1))
|
||||
echoClient.SetAttribute("Interval", ns.TimeValue(ns.Seconds(1.0)))
|
||||
echoClient.SetAttribute("Interval", ns.TimeValue(ns.Seconds(1)))
|
||||
echoClient.SetAttribute("PacketSize", ns.UintegerValue(1024))
|
||||
|
||||
clientApps = echoClient.Install(wifiStaNodes.Get(nWifi.value - 1))
|
||||
clientApps.Start(ns.Seconds(2.0))
|
||||
clientApps.Stop(ns.Seconds(10.0))
|
||||
clientApps.Start(ns.Seconds(2))
|
||||
clientApps.Stop(ns.Seconds(10))
|
||||
|
||||
ns.Ipv4GlobalRoutingHelper.PopulateRoutingTables()
|
||||
|
||||
ns.Simulator.Stop(ns.Seconds(10.0))
|
||||
ns.Simulator.Stop(ns.Seconds(10))
|
||||
|
||||
if tracing.value:
|
||||
phy.SetPcapDataLinkType(phy.DLT_IEEE802_11_RADIO)
|
||||
|
||||
@@ -82,8 +82,8 @@ main(int argc, char* argv[])
|
||||
uint16_t port = 4000;
|
||||
UdpServerHelper server(port);
|
||||
ApplicationContainer apps = server.Install(n.Get(1));
|
||||
apps.Start(Seconds(1.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(1));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
NS_LOG_INFO("Create UdpClient application on node 0 to send to node 1.");
|
||||
uint32_t MaxPacketSize = 1024;
|
||||
@@ -94,8 +94,8 @@ main(int argc, char* argv[])
|
||||
client.SetAttribute("Interval", TimeValue(interPacketInterval));
|
||||
client.SetAttribute("PacketSize", UintegerValue(MaxPacketSize));
|
||||
apps = client.Install(n.Get(0));
|
||||
apps.Start(Seconds(2.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(2));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
NS_LOG_INFO("Run Simulation.");
|
||||
Simulator::Run();
|
||||
|
||||
@@ -81,16 +81,16 @@ main(int argc, char* argv[])
|
||||
NS_LOG_INFO("Create UdpServer application on node 1.");
|
||||
UdpServerHelper server(port);
|
||||
ApplicationContainer apps = server.Install(n.Get(1));
|
||||
apps.Start(Seconds(1.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(1));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
NS_LOG_INFO("Create UdpClient application on node 0 to send to node 1.");
|
||||
uint32_t MaxPacketSize = 1472; // Back off 20 (IP) + 8 (UDP) bytes from MTU
|
||||
UdpTraceClientHelper client(serverAddress);
|
||||
client.SetAttribute("MaxPacketSize", UintegerValue(MaxPacketSize));
|
||||
apps = client.Install(n.Get(0));
|
||||
apps.Start(Seconds(2.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(2));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
NS_LOG_INFO("Run Simulation.");
|
||||
Simulator::Run();
|
||||
|
||||
@@ -92,8 +92,8 @@ main(int argc, char* argv[])
|
||||
uint16_t port = 9; // well-known echo port number
|
||||
UdpEchoServerHelper server(port);
|
||||
ApplicationContainer apps = server.Install(n.Get(1));
|
||||
apps.Start(Seconds(1.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(1));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
//
|
||||
// Create a UdpEchoClient application to send UDP datagrams from node zero to
|
||||
@@ -107,8 +107,8 @@ main(int argc, char* argv[])
|
||||
client.SetAttribute("Interval", TimeValue(interPacketInterval));
|
||||
client.SetAttribute("PacketSize", UintegerValue(packetSize));
|
||||
apps = client.Install(n.Get(0));
|
||||
apps.Start(Seconds(2.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(2));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
#if 0
|
||||
//
|
||||
|
||||
@@ -284,8 +284,8 @@ main(int argc, char* argv[])
|
||||
uint16_t port = 5001;
|
||||
UdpServerHelper serverA(port);
|
||||
ApplicationContainer serverAppA = serverA.Install(wifiApNodes.Get(0));
|
||||
serverAppA.Start(Seconds(0.0));
|
||||
serverAppA.Stop(simulationTime + Seconds(1.0));
|
||||
serverAppA.Start(Seconds(0));
|
||||
serverAppA.Stop(simulationTime + Seconds(1));
|
||||
|
||||
InetSocketAddress destA(ApInterfaceA.GetAddress(0), port);
|
||||
|
||||
@@ -297,13 +297,13 @@ main(int argc, char* argv[])
|
||||
clientA.SetAttribute("Tos", UintegerValue(0x70)); // AC_BE
|
||||
|
||||
ApplicationContainer clientAppA = clientA.Install(wifiStaNodes.Get(0));
|
||||
clientAppA.Start(Seconds(1.0));
|
||||
clientAppA.Stop(simulationTime + Seconds(1.0));
|
||||
clientAppA.Start(Seconds(1));
|
||||
clientAppA.Stop(simulationTime + Seconds(1));
|
||||
|
||||
UdpServerHelper serverB(port);
|
||||
ApplicationContainer serverAppB = serverB.Install(wifiApNodes.Get(1));
|
||||
serverAppB.Start(Seconds(0.0));
|
||||
serverAppB.Stop(simulationTime + Seconds(1.0));
|
||||
serverAppB.Start(Seconds(0));
|
||||
serverAppB.Stop(simulationTime + Seconds(1));
|
||||
|
||||
InetSocketAddress destB(ApInterfaceB.GetAddress(0), port);
|
||||
|
||||
@@ -315,13 +315,13 @@ main(int argc, char* argv[])
|
||||
clientB.SetAttribute("Tos", UintegerValue(0x70)); // AC_BE
|
||||
|
||||
ApplicationContainer clientAppB = clientB.Install(wifiStaNodes.Get(1));
|
||||
clientAppB.Start(Seconds(1.0));
|
||||
clientAppB.Stop(simulationTime + Seconds(1.0));
|
||||
clientAppB.Start(Seconds(1));
|
||||
clientAppB.Stop(simulationTime + Seconds(1));
|
||||
|
||||
UdpServerHelper serverC(port);
|
||||
ApplicationContainer serverAppC = serverC.Install(wifiApNodes.Get(2));
|
||||
serverAppC.Start(Seconds(0.0));
|
||||
serverAppC.Stop(simulationTime + Seconds(1.0));
|
||||
serverAppC.Start(Seconds(0));
|
||||
serverAppC.Stop(simulationTime + Seconds(1));
|
||||
|
||||
InetSocketAddress destC(ApInterfaceC.GetAddress(0), port);
|
||||
|
||||
@@ -333,13 +333,13 @@ main(int argc, char* argv[])
|
||||
clientC.SetAttribute("Tos", UintegerValue(0xb8)); // AC_VI
|
||||
|
||||
ApplicationContainer clientAppC = clientC.Install(wifiStaNodes.Get(2));
|
||||
clientAppC.Start(Seconds(1.0));
|
||||
clientAppC.Stop(simulationTime + Seconds(1.0));
|
||||
clientAppC.Start(Seconds(1));
|
||||
clientAppC.Stop(simulationTime + Seconds(1));
|
||||
|
||||
UdpServerHelper serverD(port);
|
||||
ApplicationContainer serverAppD = serverD.Install(wifiApNodes.Get(3));
|
||||
serverAppD.Start(Seconds(0.0));
|
||||
serverAppD.Stop(simulationTime + Seconds(1.0));
|
||||
serverAppD.Start(Seconds(0));
|
||||
serverAppD.Stop(simulationTime + Seconds(1));
|
||||
|
||||
InetSocketAddress destD(ApInterfaceD.GetAddress(0), port);
|
||||
|
||||
@@ -351,8 +351,8 @@ main(int argc, char* argv[])
|
||||
clientD.SetAttribute("Tos", UintegerValue(0xb8)); // AC_VI
|
||||
|
||||
ApplicationContainer clientAppD = clientD.Install(wifiStaNodes.Get(3));
|
||||
clientAppD.Start(Seconds(1.0));
|
||||
clientAppD.Stop(simulationTime + Seconds(1.0));
|
||||
clientAppD.Start(Seconds(1));
|
||||
clientAppD.Stop(simulationTime + Seconds(1));
|
||||
|
||||
if (enablePcap)
|
||||
{
|
||||
@@ -366,7 +366,7 @@ main(int argc, char* argv[])
|
||||
phy.EnablePcap("STA_D", staDeviceD.Get(0));
|
||||
}
|
||||
|
||||
Simulator::Stop(simulationTime + Seconds(1.0));
|
||||
Simulator::Stop(simulationTime + Seconds(1));
|
||||
Simulator::Run();
|
||||
|
||||
/* Show results */
|
||||
|
||||
@@ -214,8 +214,8 @@ main(int argc, char* argv[])
|
||||
uint16_t port = 9;
|
||||
UdpServerHelper server(port);
|
||||
serverApp = server.Install(wifiStaNode.Get(0));
|
||||
serverApp.Start(Seconds(0.0));
|
||||
serverApp.Stop(simulationTime + Seconds(1.0));
|
||||
serverApp.Start(Seconds(0));
|
||||
serverApp.Stop(simulationTime + Seconds(1));
|
||||
const auto packetInterval = payloadSize * 8.0 / maxLoad;
|
||||
|
||||
UdpClientHelper client(staNodeInterface.GetAddress(0), port);
|
||||
@@ -223,8 +223,8 @@ main(int argc, char* argv[])
|
||||
client.SetAttribute("Interval", TimeValue(Seconds(packetInterval)));
|
||||
client.SetAttribute("PacketSize", UintegerValue(payloadSize));
|
||||
ApplicationContainer clientApp = client.Install(wifiApNode.Get(0));
|
||||
clientApp.Start(Seconds(1.0));
|
||||
clientApp.Stop(simulationTime + Seconds(1.0));
|
||||
clientApp.Start(Seconds(1));
|
||||
clientApp.Stop(simulationTime + Seconds(1));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -233,8 +233,8 @@ main(int argc, char* argv[])
|
||||
Address localAddress(InetSocketAddress(Ipv4Address::GetAny(), port));
|
||||
PacketSinkHelper packetSinkHelper("ns3::TcpSocketFactory", localAddress);
|
||||
serverApp = packetSinkHelper.Install(wifiStaNode.Get(0));
|
||||
serverApp.Start(Seconds(0.0));
|
||||
serverApp.Stop(simulationTime + Seconds(1.0));
|
||||
serverApp.Start(Seconds(0));
|
||||
serverApp.Stop(simulationTime + Seconds(1));
|
||||
|
||||
OnOffHelper onoff("ns3::TcpSocketFactory", Ipv4Address::GetAny());
|
||||
onoff.SetAttribute("OnTime",
|
||||
@@ -246,13 +246,13 @@ main(int argc, char* argv[])
|
||||
AddressValue remoteAddress(InetSocketAddress(staNodeInterface.GetAddress(0), port));
|
||||
onoff.SetAttribute("Remote", remoteAddress);
|
||||
ApplicationContainer clientApp = onoff.Install(wifiApNode.Get(0));
|
||||
clientApp.Start(Seconds(1.0));
|
||||
clientApp.Stop(simulationTime + Seconds(1.0));
|
||||
clientApp.Start(Seconds(1));
|
||||
clientApp.Stop(simulationTime + Seconds(1));
|
||||
}
|
||||
|
||||
Ipv4GlobalRoutingHelper::PopulateRoutingTables();
|
||||
|
||||
Simulator::Stop(simulationTime + Seconds(1.0));
|
||||
Simulator::Stop(simulationTime + Seconds(1));
|
||||
Simulator::Run();
|
||||
|
||||
double throughput = 0;
|
||||
|
||||
@@ -124,7 +124,7 @@ Experiment::AdvancePosition(Ptr<Node> node)
|
||||
return;
|
||||
}
|
||||
SetPosition(node, pos);
|
||||
Simulator::Schedule(Seconds(1.0), &Experiment::AdvancePosition, this, node);
|
||||
Simulator::Schedule(Seconds(1), &Experiment::AdvancePosition, this, node);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -186,7 +186,7 @@ Experiment::Run(const WifiHelper& wifi,
|
||||
|
||||
ApplicationContainer apps = onoff.Install(c.Get(0));
|
||||
apps.Start(Seconds(0.5));
|
||||
apps.Stop(Seconds(250.0));
|
||||
apps.Stop(Seconds(250));
|
||||
|
||||
Simulator::Schedule(Seconds(1.5), &Experiment::AdvancePosition, this, c.Get(1));
|
||||
Ptr<Socket> recvSink = SetupPacketReceive(c.Get(1));
|
||||
|
||||
@@ -270,8 +270,8 @@ main(int argc, char* argv[])
|
||||
uint16_t port = 9;
|
||||
UdpServerHelper serverA(port);
|
||||
ApplicationContainer serverAppA = serverA.Install(wifiStaNodes.Get(0));
|
||||
serverAppA.Start(Seconds(0.0));
|
||||
serverAppA.Stop(simulationTime + Seconds(1.0));
|
||||
serverAppA.Start(Seconds(0));
|
||||
serverAppA.Stop(simulationTime + Seconds(1));
|
||||
|
||||
UdpClientHelper clientA(StaInterfaceA.GetAddress(0), port);
|
||||
clientA.SetAttribute("MaxPackets", UintegerValue(4294967295U));
|
||||
@@ -279,13 +279,13 @@ main(int argc, char* argv[])
|
||||
clientA.SetAttribute("PacketSize", UintegerValue(payloadSize));
|
||||
|
||||
ApplicationContainer clientAppA = clientA.Install(wifiApNodes.Get(0));
|
||||
clientAppA.Start(Seconds(1.0));
|
||||
clientAppA.Stop(simulationTime + Seconds(1.0));
|
||||
clientAppA.Start(Seconds(1));
|
||||
clientAppA.Stop(simulationTime + Seconds(1));
|
||||
|
||||
UdpServerHelper serverB(port);
|
||||
ApplicationContainer serverAppB = serverB.Install(wifiStaNodes.Get(1));
|
||||
serverAppB.Start(Seconds(0.0));
|
||||
serverAppB.Stop(simulationTime + Seconds(1.0));
|
||||
serverAppB.Start(Seconds(0));
|
||||
serverAppB.Stop(simulationTime + Seconds(1));
|
||||
|
||||
UdpClientHelper clientB(StaInterfaceB.GetAddress(0), port);
|
||||
clientB.SetAttribute("MaxPackets", UintegerValue(4294967295U));
|
||||
@@ -293,13 +293,13 @@ main(int argc, char* argv[])
|
||||
clientB.SetAttribute("PacketSize", UintegerValue(payloadSize));
|
||||
|
||||
ApplicationContainer clientAppB = clientB.Install(wifiApNodes.Get(1));
|
||||
clientAppB.Start(Seconds(1.0));
|
||||
clientAppB.Stop(simulationTime + Seconds(1.0));
|
||||
clientAppB.Start(Seconds(1));
|
||||
clientAppB.Stop(simulationTime + Seconds(1));
|
||||
|
||||
UdpServerHelper serverC(port);
|
||||
ApplicationContainer serverAppC = serverC.Install(wifiStaNodes.Get(2));
|
||||
serverAppC.Start(Seconds(0.0));
|
||||
serverAppC.Stop(simulationTime + Seconds(1.0));
|
||||
serverAppC.Start(Seconds(0));
|
||||
serverAppC.Stop(simulationTime + Seconds(1));
|
||||
|
||||
UdpClientHelper clientC(StaInterfaceC.GetAddress(0), port);
|
||||
clientC.SetAttribute("MaxPackets", UintegerValue(4294967295U));
|
||||
@@ -307,13 +307,13 @@ main(int argc, char* argv[])
|
||||
clientC.SetAttribute("PacketSize", UintegerValue(payloadSize));
|
||||
|
||||
ApplicationContainer clientAppC = clientC.Install(wifiApNodes.Get(2));
|
||||
clientAppC.Start(Seconds(1.0));
|
||||
clientAppC.Stop(simulationTime + Seconds(1.0));
|
||||
clientAppC.Start(Seconds(1));
|
||||
clientAppC.Stop(simulationTime + Seconds(1));
|
||||
|
||||
UdpServerHelper serverD(port);
|
||||
ApplicationContainer serverAppD = serverD.Install(wifiStaNodes.Get(3));
|
||||
serverAppD.Start(Seconds(0.0));
|
||||
serverAppD.Stop(simulationTime + Seconds(1.0));
|
||||
serverAppD.Start(Seconds(0));
|
||||
serverAppD.Stop(simulationTime + Seconds(1));
|
||||
|
||||
UdpClientHelper clientD(StaInterfaceD.GetAddress(0), port);
|
||||
clientD.SetAttribute("MaxPackets", UintegerValue(4294967295U));
|
||||
@@ -321,8 +321,8 @@ main(int argc, char* argv[])
|
||||
clientD.SetAttribute("PacketSize", UintegerValue(payloadSize));
|
||||
|
||||
ApplicationContainer clientAppD = clientD.Install(wifiApNodes.Get(3));
|
||||
clientAppD.Start(Seconds(1.0));
|
||||
clientAppD.Stop(simulationTime + Seconds(1.0));
|
||||
clientAppD.Start(Seconds(1));
|
||||
clientAppD.Stop(simulationTime + Seconds(1));
|
||||
|
||||
if (enablePcap)
|
||||
{
|
||||
@@ -336,7 +336,7 @@ main(int argc, char* argv[])
|
||||
phy.EnablePcap("STA_D", staDeviceD.Get(0));
|
||||
}
|
||||
|
||||
Simulator::Stop(simulationTime + Seconds(1.0));
|
||||
Simulator::Stop(simulationTime + Seconds(1));
|
||||
Simulator::Run();
|
||||
|
||||
// Show results
|
||||
|
||||
@@ -150,7 +150,7 @@ AdvancePosition(Ptr<Node> node)
|
||||
}
|
||||
mobility->SetPosition(pos);
|
||||
|
||||
Simulator::Schedule(Seconds(1.0), &AdvancePosition, node);
|
||||
Simulator::Schedule(Seconds(1), &AdvancePosition, node);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -196,7 +196,7 @@ main(int argc, char* argv[])
|
||||
mobility.Install(stas);
|
||||
mobility.Install(ap);
|
||||
|
||||
Simulator::Schedule(Seconds(1.0), &AdvancePosition, ap.Get(0));
|
||||
Simulator::Schedule(Seconds(1), &AdvancePosition, ap.Get(0));
|
||||
|
||||
PacketSocketAddress socket;
|
||||
socket.SetSingleDevice(staDevs.Get(0)->GetIfIndex());
|
||||
@@ -208,9 +208,9 @@ main(int argc, char* argv[])
|
||||
|
||||
ApplicationContainer apps = onoff.Install(stas.Get(0));
|
||||
apps.Start(Seconds(0.5));
|
||||
apps.Stop(Seconds(43.0));
|
||||
apps.Stop(Seconds(43));
|
||||
|
||||
Simulator::Stop(Seconds(44.0));
|
||||
Simulator::Stop(Seconds(44));
|
||||
|
||||
Config::Connect("/NodeList/*/DeviceList/*/Mac/MacTx", MakeCallback(&DevTxTrace));
|
||||
Config::Connect("/NodeList/*/DeviceList/*/Mac/MacRx", MakeCallback(&DevRxTrace));
|
||||
|
||||
@@ -76,7 +76,7 @@ ns.cppyy.cppdef(
|
||||
if (pos.x >= 210.0)
|
||||
return;
|
||||
mob->SetPosition(pos);
|
||||
Simulator::Schedule(Seconds(1.0), AdvancePosition, node);
|
||||
Simulator::Schedule(Seconds(1), AdvancePosition, node);
|
||||
}"""
|
||||
)
|
||||
|
||||
@@ -124,7 +124,7 @@ def main(argv):
|
||||
mobility.Install(stas)
|
||||
mobility.Install(ap)
|
||||
|
||||
ns.Simulator.Schedule(ns.Seconds(1.0), ns.cppyy.gbl.AdvancePosition, ap.Get(0))
|
||||
ns.Simulator.Schedule(ns.Seconds(1), ns.cppyy.gbl.AdvancePosition, ap.Get(0))
|
||||
|
||||
socket = ns.PacketSocketAddress()
|
||||
socket.SetSingleDevice(staDevs.Get(0).GetIfIndex())
|
||||
@@ -136,9 +136,9 @@ def main(argv):
|
||||
|
||||
apps = onoff.Install(ns.NodeContainer(stas.Get(0)))
|
||||
apps.Start(ns.Seconds(0.5))
|
||||
apps.Stop(ns.Seconds(43.0))
|
||||
apps.Stop(ns.Seconds(43))
|
||||
|
||||
ns.Simulator.Stop(ns.Seconds(44.0))
|
||||
ns.Simulator.Stop(ns.Seconds(44))
|
||||
|
||||
# Config::Connect("/NodeList/*/DeviceList/*/Tx", MakeCallback(&DevTxTrace));
|
||||
# Config::Connect("/NodeList/*/DeviceList/*/Rx", MakeCallback(&DevRxTrace));
|
||||
|
||||
@@ -196,13 +196,13 @@ main(int argc, char* argv[])
|
||||
|
||||
UdpServerHelper apServer(9);
|
||||
ApplicationContainer apServerApp = apServer.Install(wifiApNode.Get(0));
|
||||
apServerApp.Start(Seconds(0.0));
|
||||
apServerApp.Stop(simulationTime + Seconds(1.0));
|
||||
apServerApp.Start(Seconds(0));
|
||||
apServerApp.Stop(simulationTime + Seconds(1));
|
||||
|
||||
UdpServerHelper staServer(5001);
|
||||
ApplicationContainer staServerApp = staServer.Install(wifiStaNode.Get(0));
|
||||
staServerApp.Start(Seconds(0.0));
|
||||
staServerApp.Stop(simulationTime + Seconds(1.0));
|
||||
staServerApp.Start(Seconds(0));
|
||||
staServerApp.Stop(simulationTime + Seconds(1));
|
||||
|
||||
if (apHasTraffic)
|
||||
{
|
||||
@@ -211,8 +211,8 @@ main(int argc, char* argv[])
|
||||
apClient.SetAttribute("Interval", TimeValue(Time("0.00001"))); // packets/s
|
||||
apClient.SetAttribute("PacketSize", UintegerValue(payloadSize)); // bytes
|
||||
ApplicationContainer apClientApp = apClient.Install(wifiApNode.Get(0));
|
||||
apClientApp.Start(Seconds(1.0));
|
||||
apClientApp.Stop(simulationTime + Seconds(1.0));
|
||||
apClientApp.Start(Seconds(1));
|
||||
apClientApp.Stop(simulationTime + Seconds(1));
|
||||
}
|
||||
|
||||
if (staHasTraffic)
|
||||
@@ -222,13 +222,13 @@ main(int argc, char* argv[])
|
||||
staClient.SetAttribute("Interval", TimeValue(Time("0.00001"))); // packets/s
|
||||
staClient.SetAttribute("PacketSize", UintegerValue(payloadSize)); // bytes
|
||||
ApplicationContainer staClientApp = staClient.Install(wifiStaNode.Get(0));
|
||||
staClientApp.Start(Seconds(1.0));
|
||||
staClientApp.Stop(simulationTime + Seconds(1.0));
|
||||
staClientApp.Start(Seconds(1));
|
||||
staClientApp.Stop(simulationTime + Seconds(1));
|
||||
}
|
||||
|
||||
Ipv4GlobalRoutingHelper::PopulateRoutingTables();
|
||||
|
||||
Simulator::Stop(simulationTime + Seconds(1.0));
|
||||
Simulator::Stop(simulationTime + Seconds(1));
|
||||
Simulator::Run();
|
||||
|
||||
double rxBytes;
|
||||
|
||||
@@ -150,12 +150,12 @@ main(int argc, char* argv[])
|
||||
|
||||
ApplicationContainer staApps = onOff.Install(sta);
|
||||
|
||||
staApps.Start(Seconds(1.0));
|
||||
staApps.Stop(Seconds(10.0));
|
||||
staApps.Start(Seconds(1));
|
||||
staApps.Stop(Seconds(10));
|
||||
|
||||
Ipv4GlobalRoutingHelper::PopulateRoutingTables();
|
||||
|
||||
Simulator::Stop(Seconds(10.0));
|
||||
Simulator::Stop(Seconds(10));
|
||||
|
||||
phy.EnablePcap("test-blockack", ap->GetId(), 0);
|
||||
Simulator::Run();
|
||||
|
||||
@@ -197,7 +197,7 @@ Experiment::Run(const WifiHelper& wifi,
|
||||
uint32_t packetSize = 1014;
|
||||
uint32_t maxPacketCount = 200;
|
||||
Time interPacketInterval = Seconds(1.);
|
||||
Simulator::Schedule(Seconds(1.0),
|
||||
Simulator::Schedule(Seconds(1),
|
||||
&Experiment::GenerateTraffic,
|
||||
this,
|
||||
source,
|
||||
|
||||
@@ -537,8 +537,8 @@ main(int argc, char* argv[])
|
||||
serverApp = server.Install(serverNodes.get());
|
||||
streamNumber += server.AssignStreams(serverNodes.get(), streamNumber);
|
||||
|
||||
serverApp.Start(Seconds(0.0));
|
||||
serverApp.Stop(simulationTime + Seconds(1.0));
|
||||
serverApp.Start(Seconds(0));
|
||||
serverApp.Stop(simulationTime + Seconds(1));
|
||||
const auto packetInterval = payloadSize * 8.0 / maxLoad;
|
||||
|
||||
for (std::size_t i = 0; i < nStations; i++)
|
||||
@@ -550,8 +550,8 @@ main(int argc, char* argv[])
|
||||
ApplicationContainer clientApp = client.Install(clientNodes.Get(i));
|
||||
streamNumber += client.AssignStreams(clientNodes.Get(i), streamNumber);
|
||||
|
||||
clientApp.Start(Seconds(1.0));
|
||||
clientApp.Stop(simulationTime + Seconds(1.0));
|
||||
clientApp.Start(Seconds(1));
|
||||
clientApp.Stop(simulationTime + Seconds(1));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -563,8 +563,8 @@ main(int argc, char* argv[])
|
||||
serverApp = packetSinkHelper.Install(serverNodes.get());
|
||||
streamNumber += packetSinkHelper.AssignStreams(serverNodes.get(), streamNumber);
|
||||
|
||||
serverApp.Start(Seconds(0.0));
|
||||
serverApp.Stop(simulationTime + Seconds(1.0));
|
||||
serverApp.Start(Seconds(0));
|
||||
serverApp.Stop(simulationTime + Seconds(1));
|
||||
|
||||
for (std::size_t i = 0; i < nStations; i++)
|
||||
{
|
||||
@@ -581,8 +581,8 @@ main(int argc, char* argv[])
|
||||
ApplicationContainer clientApp = onoff.Install(clientNodes.Get(i));
|
||||
streamNumber += onoff.AssignStreams(clientNodes.Get(i), streamNumber);
|
||||
|
||||
clientApp.Start(Seconds(1.0));
|
||||
clientApp.Stop(simulationTime + Seconds(1.0));
|
||||
clientApp.Start(Seconds(1));
|
||||
clientApp.Stop(simulationTime + Seconds(1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -598,10 +598,10 @@ main(int argc, char* argv[])
|
||||
serverApp,
|
||||
payloadSize,
|
||||
tputInterval,
|
||||
simulationTime + Seconds(1.0));
|
||||
simulationTime + Seconds(1));
|
||||
}
|
||||
|
||||
Simulator::Stop(simulationTime + Seconds(1.0));
|
||||
Simulator::Stop(simulationTime + Seconds(1));
|
||||
Simulator::Run();
|
||||
|
||||
// When multiple stations are used, there are chances that association requests
|
||||
|
||||
@@ -407,8 +407,8 @@ main(int argc, char* argv[])
|
||||
serverApp = server.Install(serverNodes.get());
|
||||
streamNumber += server.AssignStreams(serverNodes.get(), streamNumber);
|
||||
|
||||
serverApp.Start(Seconds(0.0));
|
||||
serverApp.Stop(simulationTime + Seconds(1.0));
|
||||
serverApp.Start(Seconds(0));
|
||||
serverApp.Stop(simulationTime + Seconds(1));
|
||||
const auto packetInterval = payloadSize * 8.0 / maxLoad;
|
||||
|
||||
for (std::size_t i = 0; i < nStations; i++)
|
||||
@@ -420,8 +420,8 @@ main(int argc, char* argv[])
|
||||
ApplicationContainer clientApp = client.Install(clientNodes.Get(i));
|
||||
streamNumber += client.AssignStreams(clientNodes.Get(i), streamNumber);
|
||||
|
||||
clientApp.Start(Seconds(1.0));
|
||||
clientApp.Stop(simulationTime + Seconds(1.0));
|
||||
clientApp.Start(Seconds(1));
|
||||
clientApp.Stop(simulationTime + Seconds(1));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -433,8 +433,8 @@ main(int argc, char* argv[])
|
||||
serverApp = packetSinkHelper.Install(serverNodes.get());
|
||||
streamNumber += packetSinkHelper.AssignStreams(serverNodes.get(), streamNumber);
|
||||
|
||||
serverApp.Start(Seconds(0.0));
|
||||
serverApp.Stop(simulationTime + Seconds(1.0));
|
||||
serverApp.Start(Seconds(0));
|
||||
serverApp.Stop(simulationTime + Seconds(1));
|
||||
|
||||
for (std::size_t i = 0; i < nStations; i++)
|
||||
{
|
||||
@@ -451,14 +451,14 @@ main(int argc, char* argv[])
|
||||
ApplicationContainer clientApp = onoff.Install(clientNodes.Get(i));
|
||||
streamNumber += onoff.AssignStreams(clientNodes.Get(i), streamNumber);
|
||||
|
||||
clientApp.Start(Seconds(1.0));
|
||||
clientApp.Stop(simulationTime + Seconds(1.0));
|
||||
clientApp.Start(Seconds(1));
|
||||
clientApp.Stop(simulationTime + Seconds(1));
|
||||
}
|
||||
}
|
||||
|
||||
Simulator::Schedule(Seconds(0), &Ipv4GlobalRoutingHelper::PopulateRoutingTables);
|
||||
|
||||
Simulator::Stop(simulationTime + Seconds(1.0));
|
||||
Simulator::Stop(simulationTime + Seconds(1));
|
||||
Simulator::Run();
|
||||
|
||||
// When multiple stations are used, there are chances that association requests
|
||||
|
||||
@@ -278,8 +278,8 @@ main(int argc, char* argv[])
|
||||
serverApp = server.Install(wifiStaNode.Get(0));
|
||||
streamNumber += server.AssignStreams(wifiStaNode.Get(0), streamNumber);
|
||||
|
||||
serverApp.Start(Seconds(0.0));
|
||||
serverApp.Stop(simulationTime + Seconds(1.0));
|
||||
serverApp.Start(Seconds(0));
|
||||
serverApp.Stop(simulationTime + Seconds(1));
|
||||
const auto packetInterval = payloadSize * 8.0 / maxLoad;
|
||||
|
||||
UdpClientHelper client(staNodeInterface.GetAddress(0), port);
|
||||
@@ -289,8 +289,8 @@ main(int argc, char* argv[])
|
||||
ApplicationContainer clientApp = client.Install(wifiApNode.Get(0));
|
||||
streamNumber += client.AssignStreams(wifiApNode.Get(0), streamNumber);
|
||||
|
||||
clientApp.Start(Seconds(1.0));
|
||||
clientApp.Stop(simulationTime + Seconds(1.0));
|
||||
clientApp.Start(Seconds(1));
|
||||
clientApp.Stop(simulationTime + Seconds(1));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -302,8 +302,8 @@ main(int argc, char* argv[])
|
||||
streamNumber +=
|
||||
packetSinkHelper.AssignStreams(wifiStaNode.Get(0), streamNumber);
|
||||
|
||||
serverApp.Start(Seconds(0.0));
|
||||
serverApp.Stop(simulationTime + Seconds(1.0));
|
||||
serverApp.Start(Seconds(0));
|
||||
serverApp.Stop(simulationTime + Seconds(1));
|
||||
|
||||
OnOffHelper onoff("ns3::TcpSocketFactory", Ipv4Address::GetAny());
|
||||
onoff.SetAttribute("OnTime",
|
||||
@@ -318,13 +318,13 @@ main(int argc, char* argv[])
|
||||
ApplicationContainer clientApp = onoff.Install(wifiApNode.Get(0));
|
||||
streamNumber += onoff.AssignStreams(wifiApNode.Get(0), streamNumber);
|
||||
|
||||
clientApp.Start(Seconds(1.0));
|
||||
clientApp.Stop(simulationTime + Seconds(1.0));
|
||||
clientApp.Start(Seconds(1));
|
||||
clientApp.Stop(simulationTime + Seconds(1));
|
||||
}
|
||||
|
||||
Ipv4GlobalRoutingHelper::PopulateRoutingTables();
|
||||
|
||||
Simulator::Stop(simulationTime + Seconds(1.0));
|
||||
Simulator::Stop(simulationTime + Seconds(1));
|
||||
Simulator::Run();
|
||||
|
||||
auto rxBytes = 0.0;
|
||||
|
||||
@@ -265,8 +265,8 @@ Experiment::Run(Parameters params)
|
||||
uint16_t port = 9;
|
||||
UdpServerHelper server(port);
|
||||
ApplicationContainer serverApp = server.Install(wifiApNode);
|
||||
serverApp.Start(Seconds(0.0));
|
||||
serverApp.Stop(simulationTime + Seconds(1.0));
|
||||
serverApp.Start(Seconds(0));
|
||||
serverApp.Stop(simulationTime + Seconds(1));
|
||||
|
||||
UdpClientHelper client(ApInterface.GetAddress(0), port);
|
||||
client.SetAttribute("MaxPackets", UintegerValue(4294967295U));
|
||||
@@ -286,10 +286,10 @@ Experiment::Run(Parameters params)
|
||||
{
|
||||
clientApps.Add(client.Install(wifiNStaNodes));
|
||||
}
|
||||
clientApps.Start(Seconds(1.0));
|
||||
clientApps.Stop(simulationTime + Seconds(1.0));
|
||||
clientApps.Start(Seconds(1));
|
||||
clientApps.Stop(simulationTime + Seconds(1));
|
||||
|
||||
Simulator::Stop(simulationTime + Seconds(1.0));
|
||||
Simulator::Stop(simulationTime + Seconds(1));
|
||||
Simulator::Run();
|
||||
|
||||
double totalPacketsThrough = DynamicCast<UdpServer>(serverApp.Get(0))->GetReceived();
|
||||
@@ -302,8 +302,8 @@ Experiment::Run(Parameters params)
|
||||
PacketSinkHelper packetSinkHelper("ns3::TcpSocketFactory", localAddress);
|
||||
|
||||
ApplicationContainer serverApp = packetSinkHelper.Install(wifiApNode.Get(0));
|
||||
serverApp.Start(Seconds(0.0));
|
||||
serverApp.Stop(simulationTime + Seconds(1.0));
|
||||
serverApp.Start(Seconds(0));
|
||||
serverApp.Stop(simulationTime + Seconds(1));
|
||||
|
||||
OnOffHelper onoff("ns3::TcpSocketFactory", Ipv4Address::GetAny());
|
||||
onoff.SetAttribute("OnTime", StringValue("ns3::ConstantRandomVariable[Constant=1]"));
|
||||
@@ -327,10 +327,10 @@ Experiment::Run(Parameters params)
|
||||
{
|
||||
clientApps.Add(onoff.Install(wifiNStaNodes));
|
||||
}
|
||||
clientApps.Start(Seconds(1.0));
|
||||
clientApps.Stop(simulationTime + Seconds(1.0));
|
||||
clientApps.Start(Seconds(1));
|
||||
clientApps.Stop(simulationTime + Seconds(1));
|
||||
|
||||
Simulator::Stop(simulationTime + Seconds(1.0));
|
||||
Simulator::Stop(simulationTime + Seconds(1));
|
||||
Simulator::Run();
|
||||
|
||||
double totalPacketsThrough = DynamicCast<PacketSink>(serverApp.Get(0))->GetTotalRx();
|
||||
|
||||
@@ -154,14 +154,14 @@ main(int argc, char* argv[])
|
||||
}
|
||||
}
|
||||
|
||||
sinkApplications.Start(Seconds(0.0));
|
||||
sinkApplications.Stop(simulationTime + Seconds(1.0));
|
||||
sourceApplications.Start(Seconds(1.0));
|
||||
sourceApplications.Stop(simulationTime + Seconds(1.0));
|
||||
sinkApplications.Start(Seconds(0));
|
||||
sinkApplications.Stop(simulationTime + Seconds(1));
|
||||
sourceApplications.Start(Seconds(1));
|
||||
sourceApplications.Stop(simulationTime + Seconds(1));
|
||||
|
||||
Ipv4GlobalRoutingHelper::PopulateRoutingTables();
|
||||
|
||||
Simulator::Stop(simulationTime + Seconds(1.0));
|
||||
Simulator::Stop(simulationTime + Seconds(1));
|
||||
Simulator::Run();
|
||||
|
||||
double throughput = 0;
|
||||
|
||||
@@ -578,8 +578,8 @@ main(int argc, char* argv[])
|
||||
|
||||
OnOffHelper onoff("ns3::UdpSocketFactory", InetSocketAddress(sinkAddress, port));
|
||||
onoff.SetConstantRate(DataRate("54Mb/s"), packetSize);
|
||||
onoff.SetAttribute("StartTime", TimeValue(Seconds(0.0)));
|
||||
onoff.SetAttribute("StopTime", TimeValue(Seconds(100.0)));
|
||||
onoff.SetAttribute("StartTime", TimeValue(Seconds(0)));
|
||||
onoff.SetAttribute("StopTime", TimeValue(Seconds(100)));
|
||||
ApplicationContainer apps_source = onoff.Install(wifiApNodes.Get(0));
|
||||
|
||||
PacketSinkHelper sink1("ns3::UdpSocketFactory", InetSocketAddress(sinkAddress1, port));
|
||||
@@ -587,8 +587,8 @@ main(int argc, char* argv[])
|
||||
|
||||
OnOffHelper onoff1("ns3::UdpSocketFactory", InetSocketAddress(sinkAddress1, port));
|
||||
onoff1.SetConstantRate(DataRate("54Mb/s"), packetSize);
|
||||
onoff1.SetAttribute("StartTime", TimeValue(Seconds(0.0)));
|
||||
onoff1.SetAttribute("StopTime", TimeValue(Seconds(100.0)));
|
||||
onoff1.SetAttribute("StartTime", TimeValue(Seconds(0)));
|
||||
onoff1.SetAttribute("StopTime", TimeValue(Seconds(100)));
|
||||
apps_source.Add(onoff1.Install(wifiApNodes.Get(1)));
|
||||
|
||||
apps_sink.Start(Seconds(0.5));
|
||||
|
||||
@@ -259,7 +259,7 @@ main(int argc, char* argv[])
|
||||
}
|
||||
|
||||
// Give OLSR time to converge-- 30 seconds perhaps
|
||||
Simulator::Schedule(Seconds(30.0),
|
||||
Simulator::Schedule(Seconds(30),
|
||||
&GenerateTraffic,
|
||||
source,
|
||||
packetSize,
|
||||
@@ -270,7 +270,7 @@ main(int argc, char* argv[])
|
||||
NS_LOG_UNCOND("Testing from node " << sourceNode << " to " << sinkNode << " with grid distance "
|
||||
<< distance);
|
||||
|
||||
Simulator::Stop(Seconds(33.0));
|
||||
Simulator::Stop(Seconds(33));
|
||||
Simulator::Run();
|
||||
Simulator::Destroy();
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ main(int argc, char* argv[])
|
||||
NS_LOG_UNCOND("Testing " << numPackets << " packets sent with receiver rss " << rss);
|
||||
|
||||
Simulator::ScheduleWithContext(source->GetNode()->GetId(),
|
||||
Seconds(1.0),
|
||||
Seconds(1),
|
||||
&GenerateTraffic,
|
||||
source,
|
||||
packetSize,
|
||||
|
||||
@@ -166,8 +166,8 @@ main(int argc, char* argv[])
|
||||
uint16_t port = 9;
|
||||
UdpServerHelper server(port);
|
||||
ApplicationContainer serverApp = server.Install(wifiApNode);
|
||||
serverApp.Start(Seconds(0.0));
|
||||
serverApp.Stop(simulationTime + Seconds(1.0));
|
||||
serverApp.Start(Seconds(0));
|
||||
serverApp.Stop(simulationTime + Seconds(1));
|
||||
streamNumber += server.AssignStreams(wifiApNode, streamNumber);
|
||||
|
||||
UdpClientHelper client(ApInterface.GetAddress(0), port);
|
||||
@@ -177,8 +177,8 @@ main(int argc, char* argv[])
|
||||
|
||||
// Saturated UDP traffic from stations to AP
|
||||
ApplicationContainer clientApp1 = client.Install(wifiStaNodes);
|
||||
clientApp1.Start(Seconds(1.0));
|
||||
clientApp1.Stop(simulationTime + Seconds(1.0));
|
||||
clientApp1.Start(Seconds(1));
|
||||
clientApp1.Stop(simulationTime + Seconds(1));
|
||||
streamNumber += client.AssignStreams(wifiStaNodes, streamNumber);
|
||||
|
||||
phy.EnablePcap("SimpleHtHiddenStations_Ap", apDevice.Get(0));
|
||||
@@ -188,7 +188,7 @@ main(int argc, char* argv[])
|
||||
AsciiTraceHelper ascii;
|
||||
phy.EnableAsciiAll(ascii.CreateFileStream("SimpleHtHiddenStations.tr"));
|
||||
|
||||
Simulator::Stop(simulationTime + Seconds(1.0));
|
||||
Simulator::Stop(simulationTime + Seconds(1));
|
||||
|
||||
Simulator::Run();
|
||||
|
||||
|
||||
@@ -229,14 +229,14 @@ main(int argc, char* argv[])
|
||||
std::cout << "Testing " << numPackets << " packets sent with receiver rss " << rss << std::endl;
|
||||
|
||||
Simulator::ScheduleWithContext(source->GetNode()->GetId(),
|
||||
Seconds(1.0),
|
||||
Seconds(1),
|
||||
&GenerateTraffic,
|
||||
source,
|
||||
packetSize,
|
||||
numPackets,
|
||||
interval);
|
||||
|
||||
Simulator::Stop(Seconds(30.0));
|
||||
Simulator::Stop(Seconds(30));
|
||||
Simulator::Run();
|
||||
Simulator::Destroy();
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@ main(int argc, char* argv[])
|
||||
Config::Connect("/NodeList/0/DeviceList/*/Phy/State/State", MakeCallback(&PhyStateTrace<0>));
|
||||
Config::Connect("/NodeList/1/DeviceList/*/Phy/State/State", MakeCallback(&PhyStateTrace<1>));
|
||||
|
||||
Simulator::Stop(duration + Seconds(1.0));
|
||||
Simulator::Stop(duration + Seconds(1));
|
||||
|
||||
Simulator::Run();
|
||||
Simulator::Destroy();
|
||||
|
||||
@@ -443,8 +443,8 @@ main(int argc, char* argv[])
|
||||
uint16_t port = 9;
|
||||
UdpServerHelper server(port);
|
||||
serverApp = server.Install(wifiStaNode.Get(0));
|
||||
serverApp.Start(Seconds(0.0));
|
||||
serverApp.Stop(simulationTime + Seconds(1.0));
|
||||
serverApp.Start(Seconds(0));
|
||||
serverApp.Stop(simulationTime + Seconds(1));
|
||||
const auto packetInterval = payloadSize * 8.0 / (datarate * 1e6);
|
||||
|
||||
UdpClientHelper client(staNodeInterface.GetAddress(0), port);
|
||||
@@ -452,8 +452,8 @@ main(int argc, char* argv[])
|
||||
client.SetAttribute("Interval", TimeValue(Seconds(packetInterval)));
|
||||
client.SetAttribute("PacketSize", UintegerValue(payloadSize));
|
||||
ApplicationContainer clientApp = client.Install(wifiApNode.Get(0));
|
||||
clientApp.Start(Seconds(1.0));
|
||||
clientApp.Stop(simulationTime + Seconds(1.0));
|
||||
clientApp.Start(Seconds(1));
|
||||
clientApp.Stop(simulationTime + Seconds(1));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -462,8 +462,8 @@ main(int argc, char* argv[])
|
||||
Address localAddress(InetSocketAddress(Ipv4Address::GetAny(), port));
|
||||
PacketSinkHelper packetSinkHelper("ns3::TcpSocketFactory", localAddress);
|
||||
serverApp = packetSinkHelper.Install(wifiStaNode.Get(0));
|
||||
serverApp.Start(Seconds(0.0));
|
||||
serverApp.Stop(simulationTime + Seconds(1.0));
|
||||
serverApp.Start(Seconds(0));
|
||||
serverApp.Stop(simulationTime + Seconds(1));
|
||||
|
||||
OnOffHelper onoff("ns3::TcpSocketFactory", Ipv4Address::GetAny());
|
||||
onoff.SetAttribute("OnTime", StringValue("ns3::ConstantRandomVariable[Constant=1]"));
|
||||
@@ -473,8 +473,8 @@ main(int argc, char* argv[])
|
||||
AddressValue remoteAddress(InetSocketAddress(staNodeInterface.GetAddress(0), port));
|
||||
onoff.SetAttribute("Remote", remoteAddress);
|
||||
ApplicationContainer clientApp = onoff.Install(wifiApNode.Get(0));
|
||||
clientApp.Start(Seconds(1.0));
|
||||
clientApp.Stop(simulationTime + Seconds(1.0));
|
||||
clientApp.Start(Seconds(1));
|
||||
clientApp.Stop(simulationTime + Seconds(1));
|
||||
}
|
||||
|
||||
Config::ConnectWithoutContext("/NodeList/0/DeviceList/*/Phy/MonitorSnifferRx",
|
||||
@@ -495,7 +495,7 @@ main(int argc, char* argv[])
|
||||
g_noiseDbmAvg = 0;
|
||||
g_samples = 0;
|
||||
|
||||
Simulator::Stop(simulationTime + Seconds(1.0));
|
||||
Simulator::Stop(simulationTime + Seconds(1));
|
||||
Simulator::Run();
|
||||
|
||||
auto throughput = 0.0;
|
||||
|
||||
@@ -498,8 +498,8 @@ main(int argc, char* argv[])
|
||||
uint16_t port = 9;
|
||||
UdpServerHelper server(port);
|
||||
serverApp = server.Install(wifiStaNode.Get(0));
|
||||
serverApp.Start(Seconds(0.0));
|
||||
serverApp.Stop(simulationTime + Seconds(1.0));
|
||||
serverApp.Start(Seconds(0));
|
||||
serverApp.Stop(simulationTime + Seconds(1));
|
||||
const auto packetInterval = payloadSize * 8.0 / (datarate * 1e6);
|
||||
|
||||
UdpClientHelper client(staNodeInterface.GetAddress(0), port);
|
||||
@@ -507,8 +507,8 @@ main(int argc, char* argv[])
|
||||
client.SetAttribute("Interval", TimeValue(Seconds(packetInterval)));
|
||||
client.SetAttribute("PacketSize", UintegerValue(payloadSize));
|
||||
ApplicationContainer clientApp = client.Install(wifiApNode.Get(0));
|
||||
clientApp.Start(Seconds(1.0));
|
||||
clientApp.Stop(simulationTime + Seconds(1.0));
|
||||
clientApp.Start(Seconds(1));
|
||||
clientApp.Stop(simulationTime + Seconds(1));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -517,8 +517,8 @@ main(int argc, char* argv[])
|
||||
Address localAddress(InetSocketAddress(Ipv4Address::GetAny(), port));
|
||||
PacketSinkHelper packetSinkHelper("ns3::TcpSocketFactory", localAddress);
|
||||
serverApp = packetSinkHelper.Install(wifiStaNode.Get(0));
|
||||
serverApp.Start(Seconds(0.0));
|
||||
serverApp.Stop(simulationTime + Seconds(1.0));
|
||||
serverApp.Start(Seconds(0));
|
||||
serverApp.Stop(simulationTime + Seconds(1));
|
||||
|
||||
OnOffHelper onoff("ns3::TcpSocketFactory", Ipv4Address::GetAny());
|
||||
onoff.SetAttribute("OnTime", StringValue("ns3::ConstantRandomVariable[Constant=1]"));
|
||||
@@ -528,8 +528,8 @@ main(int argc, char* argv[])
|
||||
AddressValue remoteAddress(InetSocketAddress(staNodeInterface.GetAddress(0), port));
|
||||
onoff.SetAttribute("Remote", remoteAddress);
|
||||
ApplicationContainer clientApp = onoff.Install(wifiApNode.Get(0));
|
||||
clientApp.Start(Seconds(1.0));
|
||||
clientApp.Stop(simulationTime + Seconds(1.0));
|
||||
clientApp.Start(Seconds(1));
|
||||
clientApp.Stop(simulationTime + Seconds(1));
|
||||
}
|
||||
|
||||
// Configure waveform generator
|
||||
@@ -593,7 +593,7 @@ main(int argc, char* argv[])
|
||||
"Error: Wi-Fi nodes must be tuned to 5190 MHz to match the waveform generator");
|
||||
}
|
||||
|
||||
Simulator::Stop(simulationTime + Seconds(1.0));
|
||||
Simulator::Stop(simulationTime + Seconds(1));
|
||||
Simulator::Run();
|
||||
|
||||
auto throughput = 0.0;
|
||||
|
||||
@@ -577,8 +577,8 @@ main(int argc, char* argv[])
|
||||
uint16_t port = 9;
|
||||
UdpServerHelper server(port);
|
||||
ApplicationContainer serverApp = server.Install(wifiStaNode.Get(0));
|
||||
serverApp.Start(Seconds(0.0));
|
||||
serverApp.Stop(simulationTime + Seconds(1.0));
|
||||
serverApp.Start(Seconds(0));
|
||||
serverApp.Stop(simulationTime + Seconds(1));
|
||||
const auto packetInterval = payloadSize * 8.0 / (datarate * 1e6);
|
||||
|
||||
UdpClientHelper client(staNodeInterface.GetAddress(0), port);
|
||||
@@ -586,8 +586,8 @@ main(int argc, char* argv[])
|
||||
client.SetAttribute("Interval", TimeValue(Seconds(packetInterval)));
|
||||
client.SetAttribute("PacketSize", UintegerValue(payloadSize));
|
||||
ApplicationContainer clientApp = client.Install(wifiApNode.Get(0));
|
||||
clientApp.Start(Seconds(1.0));
|
||||
clientApp.Stop(simulationTime + Seconds(1.0));
|
||||
clientApp.Start(Seconds(1));
|
||||
clientApp.Stop(simulationTime + Seconds(1));
|
||||
|
||||
if (enablePcap)
|
||||
{
|
||||
@@ -600,7 +600,7 @@ main(int argc, char* argv[])
|
||||
phy.EnablePcap(ss.str(), apDevice);
|
||||
}
|
||||
|
||||
Simulator::Stop(simulationTime + Seconds(1.0));
|
||||
Simulator::Stop(simulationTime + Seconds(1));
|
||||
Simulator::Run();
|
||||
|
||||
double totalPacketsThrough = DynamicCast<UdpServer>(serverApp.Get(0))->GetReceived();
|
||||
|
||||
@@ -170,8 +170,8 @@ main(int argc, char* argv[])
|
||||
ApplicationContainer serverApp = server.Install(staWifiNode);
|
||||
|
||||
/* Start Applications */
|
||||
sinkApp.Start(Seconds(0.0));
|
||||
serverApp.Start(Seconds(1.0));
|
||||
sinkApp.Start(Seconds(0));
|
||||
serverApp.Start(Seconds(1));
|
||||
Simulator::Schedule(Seconds(1.1), &CalculateThroughput);
|
||||
|
||||
/* Enable Traces */
|
||||
@@ -183,7 +183,7 @@ main(int argc, char* argv[])
|
||||
}
|
||||
|
||||
/* Start Simulation */
|
||||
Simulator::Stop(simulationTime + Seconds(1.0));
|
||||
Simulator::Stop(simulationTime + Seconds(1));
|
||||
Simulator::Run();
|
||||
|
||||
auto averageThroughput =
|
||||
|
||||
@@ -131,8 +131,8 @@ main(int argc, char* argv[])
|
||||
uint16_t port = 9;
|
||||
UdpServerHelper server(port);
|
||||
ApplicationContainer serverApp = server.Install(wifiStaNode.Get(0));
|
||||
serverApp.Start(Seconds(0.0));
|
||||
serverApp.Stop(simulationTime + Seconds(1.0));
|
||||
serverApp.Start(Seconds(0));
|
||||
serverApp.Stop(simulationTime + Seconds(1));
|
||||
|
||||
UdpClientHelper client(staNodeInterface.GetAddress(0), port);
|
||||
client.SetAttribute("MaxPackets", UintegerValue(4294967295U));
|
||||
@@ -140,14 +140,14 @@ main(int argc, char* argv[])
|
||||
client.SetAttribute("PacketSize", UintegerValue(1472)); // bytes
|
||||
|
||||
ApplicationContainer clientApp = client.Install(wifiApNode.Get(0));
|
||||
clientApp.Start(Seconds(1.0));
|
||||
clientApp.Stop(simulationTime + Seconds(1.0));
|
||||
clientApp.Start(Seconds(1));
|
||||
clientApp.Stop(simulationTime + Seconds(1));
|
||||
|
||||
// Populate routing table
|
||||
Ipv4GlobalRoutingHelper::PopulateRoutingTables();
|
||||
|
||||
// Set simulation time and launch simulation
|
||||
Simulator::Stop(simulationTime + Seconds(1.0));
|
||||
Simulator::Stop(simulationTime + Seconds(1));
|
||||
Simulator::Run();
|
||||
|
||||
// Get and print results
|
||||
|
||||
@@ -339,8 +339,8 @@ main(int argc, char* argv[])
|
||||
uint16_t port = 9;
|
||||
UdpServerHelper serverA(port);
|
||||
ApplicationContainer serverAppA = serverA.Install(wifiStaNodes.Get(0));
|
||||
serverAppA.Start(Seconds(0.0));
|
||||
serverAppA.Stop(simulationTime + Seconds(1.0));
|
||||
serverAppA.Start(Seconds(0));
|
||||
serverAppA.Stop(simulationTime + Seconds(1));
|
||||
|
||||
UdpClientHelper clientA(StaInterfaceA.GetAddress(0), port);
|
||||
clientA.SetAttribute("MaxPackets", UintegerValue(4294967295U));
|
||||
@@ -348,13 +348,13 @@ main(int argc, char* argv[])
|
||||
clientA.SetAttribute("PacketSize", UintegerValue(payloadSize));
|
||||
|
||||
ApplicationContainer clientAppA = clientA.Install(wifiApNodes.Get(0));
|
||||
clientAppA.Start(Seconds(1.0));
|
||||
clientAppA.Stop(simulationTime + Seconds(1.0));
|
||||
clientAppA.Start(Seconds(1));
|
||||
clientAppA.Stop(simulationTime + Seconds(1));
|
||||
|
||||
UdpServerHelper serverB(port);
|
||||
ApplicationContainer serverAppB = serverB.Install(wifiStaNodes.Get(1));
|
||||
serverAppB.Start(Seconds(0.0));
|
||||
serverAppB.Stop(simulationTime + Seconds(1.0));
|
||||
serverAppB.Start(Seconds(0));
|
||||
serverAppB.Stop(simulationTime + Seconds(1));
|
||||
|
||||
UdpClientHelper clientB(StaInterfaceB.GetAddress(0), port);
|
||||
clientB.SetAttribute("MaxPackets", UintegerValue(4294967295U));
|
||||
@@ -362,13 +362,13 @@ main(int argc, char* argv[])
|
||||
clientB.SetAttribute("PacketSize", UintegerValue(payloadSize));
|
||||
|
||||
ApplicationContainer clientAppB = clientB.Install(wifiApNodes.Get(1));
|
||||
clientAppB.Start(Seconds(1.0));
|
||||
clientAppB.Stop(simulationTime + Seconds(1.0));
|
||||
clientAppB.Start(Seconds(1));
|
||||
clientAppB.Stop(simulationTime + Seconds(1));
|
||||
|
||||
UdpServerHelper serverC(port);
|
||||
ApplicationContainer serverAppC = serverC.Install(wifiStaNodes.Get(2));
|
||||
serverAppC.Start(Seconds(0.0));
|
||||
serverAppC.Stop(simulationTime + Seconds(1.0));
|
||||
serverAppC.Start(Seconds(0));
|
||||
serverAppC.Stop(simulationTime + Seconds(1));
|
||||
|
||||
UdpClientHelper clientC(StaInterfaceC.GetAddress(0), port);
|
||||
clientC.SetAttribute("MaxPackets", UintegerValue(4294967295U));
|
||||
@@ -376,13 +376,13 @@ main(int argc, char* argv[])
|
||||
clientC.SetAttribute("PacketSize", UintegerValue(payloadSize));
|
||||
|
||||
ApplicationContainer clientAppC = clientC.Install(wifiApNodes.Get(2));
|
||||
clientAppC.Start(Seconds(1.0));
|
||||
clientAppC.Stop(simulationTime + Seconds(1.0));
|
||||
clientAppC.Start(Seconds(1));
|
||||
clientAppC.Stop(simulationTime + Seconds(1));
|
||||
|
||||
UdpServerHelper serverD(port);
|
||||
ApplicationContainer serverAppD = serverD.Install(wifiStaNodes.Get(3));
|
||||
serverAppD.Start(Seconds(0.0));
|
||||
serverAppD.Stop(simulationTime + Seconds(1.0));
|
||||
serverAppD.Start(Seconds(0));
|
||||
serverAppD.Stop(simulationTime + Seconds(1));
|
||||
|
||||
UdpClientHelper clientD(StaInterfaceD.GetAddress(0), port);
|
||||
clientD.SetAttribute("MaxPackets", UintegerValue(4294967295U));
|
||||
@@ -390,8 +390,8 @@ main(int argc, char* argv[])
|
||||
clientD.SetAttribute("PacketSize", UintegerValue(payloadSize));
|
||||
|
||||
ApplicationContainer clientAppD = clientD.Install(wifiApNodes.Get(3));
|
||||
clientAppD.Start(Seconds(1.0));
|
||||
clientAppD.Stop(simulationTime + Seconds(1.0));
|
||||
clientAppD.Start(Seconds(1));
|
||||
clientAppD.Stop(simulationTime + Seconds(1));
|
||||
|
||||
if (enablePcap)
|
||||
{
|
||||
@@ -405,7 +405,7 @@ main(int argc, char* argv[])
|
||||
phy.EnablePcap("STA_D", staDeviceD.Get(0));
|
||||
}
|
||||
|
||||
Simulator::Stop(simulationTime + Seconds(1.0));
|
||||
Simulator::Stop(simulationTime + Seconds(1));
|
||||
Simulator::Run();
|
||||
|
||||
// Show results
|
||||
|
||||
@@ -311,8 +311,8 @@ main(int argc, char* argv[])
|
||||
serverApp = server.Install(wifiStaNode.Get(0));
|
||||
streamNumber += server.AssignStreams(wifiStaNode.Get(0), streamNumber);
|
||||
|
||||
serverApp.Start(Seconds(0.0));
|
||||
serverApp.Stop(simulationTime + Seconds(1.0));
|
||||
serverApp.Start(Seconds(0));
|
||||
serverApp.Stop(simulationTime + Seconds(1));
|
||||
const auto packetInterval = payloadSize * 8.0 / maxLoad;
|
||||
|
||||
UdpClientHelper client(staNodeInterface.GetAddress(0), port);
|
||||
@@ -322,8 +322,8 @@ main(int argc, char* argv[])
|
||||
ApplicationContainer clientApp = client.Install(wifiApNode.Get(0));
|
||||
streamNumber += client.AssignStreams(wifiApNode.Get(0), streamNumber);
|
||||
|
||||
clientApp.Start(Seconds(1.0));
|
||||
clientApp.Stop(simulationTime + Seconds(1.0));
|
||||
clientApp.Start(Seconds(1));
|
||||
clientApp.Stop(simulationTime + Seconds(1));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -335,8 +335,8 @@ main(int argc, char* argv[])
|
||||
streamNumber +=
|
||||
packetSinkHelper.AssignStreams(wifiStaNode.Get(0), streamNumber);
|
||||
|
||||
serverApp.Start(Seconds(0.0));
|
||||
serverApp.Stop(simulationTime + Seconds(1.0));
|
||||
serverApp.Start(Seconds(0));
|
||||
serverApp.Stop(simulationTime + Seconds(1));
|
||||
|
||||
OnOffHelper onoff("ns3::TcpSocketFactory", Ipv4Address::GetAny());
|
||||
onoff.SetAttribute("OnTime",
|
||||
@@ -351,13 +351,13 @@ main(int argc, char* argv[])
|
||||
ApplicationContainer clientApp = onoff.Install(wifiApNode.Get(0));
|
||||
streamNumber += onoff.AssignStreams(wifiApNode.Get(0), streamNumber);
|
||||
|
||||
clientApp.Start(Seconds(1.0));
|
||||
clientApp.Stop(simulationTime + Seconds(1.0));
|
||||
clientApp.Start(Seconds(1));
|
||||
clientApp.Stop(simulationTime + Seconds(1));
|
||||
}
|
||||
|
||||
Ipv4GlobalRoutingHelper::PopulateRoutingTables();
|
||||
|
||||
Simulator::Stop(simulationTime + Seconds(1.0));
|
||||
Simulator::Stop(simulationTime + Seconds(1));
|
||||
Simulator::Run();
|
||||
|
||||
auto rxBytes = 0.0;
|
||||
|
||||
@@ -181,7 +181,7 @@ main(int argc, char* argv[])
|
||||
onoff.SetConstantRate(DataRate("500kb/s"));
|
||||
ApplicationContainer apps = onoff.Install(staNodes[0].Get(0));
|
||||
apps.Start(Seconds(0.5));
|
||||
apps.Stop(Seconds(3.0));
|
||||
apps.Stop(Seconds(3));
|
||||
|
||||
wifiPhy.EnablePcap("wifi-wired-bridging", apDevices[0]);
|
||||
wifiPhy.EnablePcap("wifi-wired-bridging", apDevices[1]);
|
||||
@@ -192,7 +192,7 @@ main(int argc, char* argv[])
|
||||
MobilityHelper::EnableAsciiAll(ascii.CreateFileStream("wifi-wired-bridging.mob"));
|
||||
}
|
||||
|
||||
Simulator::Stop(Seconds(5.0));
|
||||
Simulator::Stop(Seconds(5));
|
||||
Simulator::Run();
|
||||
Simulator::Destroy();
|
||||
|
||||
|
||||
@@ -184,7 +184,7 @@ Bug772ChainTest::CreateDevices()
|
||||
m_sendSocket->Connect(InetSocketAddress(interfaces.GetAddress(m_size - 1), m_port));
|
||||
m_sendSocket->SetAllowBroadcast(true);
|
||||
Simulator::ScheduleWithContext(m_sendSocket->GetNode()->GetId(),
|
||||
Seconds(1.0),
|
||||
Seconds(1),
|
||||
&Bug772ChainTest::SendData,
|
||||
this,
|
||||
m_sendSocket);
|
||||
|
||||
@@ -107,7 +107,7 @@ LoopbackTestCase::SendData(Ptr<Socket> socket)
|
||||
socket->SendTo(Create<Packet>(123), 0, realTo);
|
||||
|
||||
Simulator::ScheduleWithContext(socket->GetNode()->GetId(),
|
||||
Seconds(1.0),
|
||||
Seconds(1),
|
||||
&LoopbackTestCase::SendData,
|
||||
this,
|
||||
socket);
|
||||
@@ -158,7 +158,7 @@ LoopbackTestCase::DoRun()
|
||||
m_txSocket = socketFactory->CreateSocket();
|
||||
|
||||
Simulator::ScheduleWithContext(m_txSocket->GetNode()->GetId(),
|
||||
Seconds(1.0),
|
||||
Seconds(1),
|
||||
&LoopbackTestCase::SendData,
|
||||
this,
|
||||
m_txSocket);
|
||||
|
||||
@@ -46,7 +46,7 @@ UdpClient::GetTypeId()
|
||||
MakeUintegerChecker<uint32_t>())
|
||||
.AddAttribute("Interval",
|
||||
"The time to wait between packets",
|
||||
TimeValue(Seconds(1.0)),
|
||||
TimeValue(Seconds(1)),
|
||||
MakeTimeAccessor(&UdpClient::m_interval),
|
||||
MakeTimeChecker())
|
||||
.AddAttribute("RemoteAddress",
|
||||
@@ -226,7 +226,7 @@ UdpClient::StartApplication()
|
||||
m_peerString = peerAddressStringStream.str();
|
||||
#endif // NS3_LOG_ENABLE
|
||||
|
||||
m_sendEvent = Simulator::Schedule(Seconds(0.0), &UdpClient::Send, this);
|
||||
m_sendEvent = Simulator::Schedule(Seconds(0), &UdpClient::Send, this);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -38,7 +38,7 @@ UdpEchoClient::GetTypeId()
|
||||
MakeUintegerChecker<uint32_t>())
|
||||
.AddAttribute("Interval",
|
||||
"The time to wait between packets",
|
||||
TimeValue(Seconds(1.0)),
|
||||
TimeValue(Seconds(1)),
|
||||
MakeTimeAccessor(&UdpEchoClient::m_interval),
|
||||
MakeTimeChecker())
|
||||
.AddAttribute(
|
||||
|
||||
@@ -99,13 +99,13 @@ BulkSendBasicTestCase::DoRun()
|
||||
BulkSendHelper sourceHelper("ns3::TcpSocketFactory", InetSocketAddress(i.GetAddress(1), port));
|
||||
sourceHelper.SetAttribute("MaxBytes", UintegerValue(300000));
|
||||
ApplicationContainer sourceApp = sourceHelper.Install(nodes.Get(0));
|
||||
sourceApp.Start(Seconds(0.0));
|
||||
sourceApp.Stop(Seconds(10.0));
|
||||
sourceApp.Start(Seconds(0));
|
||||
sourceApp.Stop(Seconds(10));
|
||||
PacketSinkHelper sinkHelper("ns3::TcpSocketFactory",
|
||||
InetSocketAddress(Ipv4Address::GetAny(), port));
|
||||
ApplicationContainer sinkApp = sinkHelper.Install(nodes.Get(1));
|
||||
sinkApp.Start(Seconds(0.0));
|
||||
sinkApp.Stop(Seconds(10.0));
|
||||
sinkApp.Start(Seconds(0));
|
||||
sinkApp.Stop(Seconds(10));
|
||||
|
||||
Ptr<BulkSendApplication> source = DynamicCast<BulkSendApplication>(sourceApp.Get(0));
|
||||
Ptr<PacketSink> sink = DynamicCast<PacketSink>(sinkApp.Get(0));
|
||||
@@ -226,14 +226,14 @@ BulkSendSeqTsSizeTestCase::DoRun()
|
||||
sourceHelper.SetAttribute("MaxBytes", UintegerValue(300000));
|
||||
sourceHelper.SetAttribute("EnableSeqTsSizeHeader", BooleanValue(true));
|
||||
ApplicationContainer sourceApp = sourceHelper.Install(nodes.Get(0));
|
||||
sourceApp.Start(Seconds(0.0));
|
||||
sourceApp.Stop(Seconds(10.0));
|
||||
sourceApp.Start(Seconds(0));
|
||||
sourceApp.Stop(Seconds(10));
|
||||
PacketSinkHelper sinkHelper("ns3::TcpSocketFactory",
|
||||
InetSocketAddress(Ipv4Address::GetAny(), port));
|
||||
sinkHelper.SetAttribute("EnableSeqTsSizeHeader", BooleanValue(true));
|
||||
ApplicationContainer sinkApp = sinkHelper.Install(nodes.Get(1));
|
||||
sinkApp.Start(Seconds(0.0));
|
||||
sinkApp.Stop(Seconds(10.0));
|
||||
sinkApp.Start(Seconds(0));
|
||||
sinkApp.Stop(Seconds(10));
|
||||
|
||||
Ptr<BulkSendApplication> source = DynamicCast<BulkSendApplication>(sourceApp.Get(0));
|
||||
Ptr<PacketSink> sink = DynamicCast<PacketSink>(sinkApp.Get(0));
|
||||
|
||||
@@ -563,7 +563,7 @@ ThreeGppHttpObjectTestCase::DoRun()
|
||||
MakeCallback(&ThreeGppHttpObjectTestCase::ClientRxRttCallback, this));
|
||||
NS_ASSERT(traceSourceConnected);
|
||||
|
||||
Simulator::Schedule(Seconds(1.0), &ThreeGppHttpObjectTestCase::ProgressCallback, this);
|
||||
Simulator::Schedule(Seconds(1), &ThreeGppHttpObjectTestCase::ProgressCallback, this);
|
||||
|
||||
/*
|
||||
* Here we don't set the simulation stop time. During the run, the simulation
|
||||
@@ -707,7 +707,7 @@ ThreeGppHttpObjectTestCase::ServerRxCallback(Ptr<const Packet> packet,
|
||||
22,
|
||||
"Error finding ThreeGppHttpHeader in a packet received by the server");
|
||||
NS_TEST_ASSERT_MSG_GT(httpHeader.GetClientTs(),
|
||||
Seconds(0.0),
|
||||
Seconds(0),
|
||||
"Request object's client TS is unexpectedly non-positive");
|
||||
|
||||
m_requestObjectTracker.PartReceived(packet->GetSize());
|
||||
@@ -755,10 +755,10 @@ ThreeGppHttpObjectTestCase::ClientRxMainObjectCallback(Ptr<const ThreeGppHttpCli
|
||||
ThreeGppHttpHeader::MAIN_OBJECT,
|
||||
"Invalid content type in the received packet");
|
||||
NS_TEST_ASSERT_MSG_GT(httpHeader.GetClientTs(),
|
||||
Seconds(0.0),
|
||||
Seconds(0),
|
||||
"Main object's client TS is unexpectedly non-positive");
|
||||
NS_TEST_ASSERT_MSG_GT(httpHeader.GetServerTs(),
|
||||
Seconds(0.0),
|
||||
Seconds(0),
|
||||
"Main object's server TS is unexpectedly non-positive");
|
||||
|
||||
uint32_t txSize = 0;
|
||||
@@ -803,10 +803,10 @@ ThreeGppHttpObjectTestCase::ClientRxEmbeddedObjectCallback(Ptr<const ThreeGppHtt
|
||||
ThreeGppHttpHeader::EMBEDDED_OBJECT,
|
||||
"Invalid content type in the received packet");
|
||||
NS_TEST_ASSERT_MSG_GT(httpHeader.GetClientTs(),
|
||||
Seconds(0.0),
|
||||
Seconds(0),
|
||||
"Embedded object's client TS is unexpectedly non-positive");
|
||||
NS_TEST_ASSERT_MSG_GT(httpHeader.GetServerTs(),
|
||||
Seconds(0.0),
|
||||
Seconds(0),
|
||||
"Embedded object's server TS is unexpectedly non-positive");
|
||||
|
||||
uint32_t txSize = 0;
|
||||
@@ -845,7 +845,7 @@ void
|
||||
ThreeGppHttpObjectTestCase::ProgressCallback()
|
||||
{
|
||||
NS_LOG_DEBUG("Simulator time now: " << Simulator::Now().As(Time::S) << ".");
|
||||
Simulator::Schedule(Seconds(1.0), &ThreeGppHttpObjectTestCase::ProgressCallback, this);
|
||||
Simulator::Schedule(Seconds(1), &ThreeGppHttpObjectTestCase::ProgressCallback, this);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -88,8 +88,8 @@ UdpClientServerTestCase::DoRun()
|
||||
uint16_t port = 4000;
|
||||
UdpServerHelper serverHelper(port);
|
||||
auto serverApp = serverHelper.Install(n.Get(1));
|
||||
serverApp.Start(Seconds(1.0));
|
||||
serverApp.Stop(Seconds(10.0));
|
||||
serverApp.Start(Seconds(1));
|
||||
serverApp.Stop(Seconds(10));
|
||||
|
||||
uint32_t MaxPacketSize = 1024;
|
||||
Time interPacketInterval = Seconds(1.);
|
||||
@@ -100,8 +100,8 @@ UdpClientServerTestCase::DoRun()
|
||||
clientHelper.SetAttribute("Interval", TimeValue(interPacketInterval));
|
||||
clientHelper.SetAttribute("PacketSize", UintegerValue(MaxPacketSize));
|
||||
auto clientApp = clientHelper.Install(n.Get(0));
|
||||
clientApp.Start(Seconds(2.0));
|
||||
clientApp.Stop(Seconds(10.0));
|
||||
clientApp.Start(Seconds(2));
|
||||
clientApp.Stop(Seconds(10));
|
||||
|
||||
Simulator::Run();
|
||||
Simulator::Destroy();
|
||||
@@ -164,15 +164,15 @@ UdpTraceClientServerTestCase::DoRun()
|
||||
uint16_t port = 4000;
|
||||
UdpServerHelper serverHelper(InetSocketAddress(Ipv4Address::GetAny(), port));
|
||||
auto serverApp = serverHelper.Install(n.Get(1));
|
||||
serverApp.Start(Seconds(1.0));
|
||||
serverApp.Stop(Seconds(10.0));
|
||||
serverApp.Start(Seconds(1));
|
||||
serverApp.Stop(Seconds(10));
|
||||
|
||||
uint32_t MaxPacketSize = 1400 - 28; // ip/udp header
|
||||
UdpTraceClientHelper clientHelper(InetSocketAddress(i.GetAddress(1), port));
|
||||
clientHelper.SetAttribute("MaxPacketSize", UintegerValue(MaxPacketSize));
|
||||
auto clientApp = clientHelper.Install(n.Get(0));
|
||||
clientApp.Start(Seconds(2.0));
|
||||
clientApp.Stop(Seconds(10.0));
|
||||
clientApp.Start(Seconds(2));
|
||||
clientApp.Stop(Seconds(10));
|
||||
|
||||
Simulator::Run();
|
||||
Simulator::Destroy();
|
||||
@@ -312,11 +312,11 @@ UdpEchoClientSetFillTestCase::DoRun()
|
||||
uint16_t port = 5000;
|
||||
UdpEchoServerHelper echoServer(InetSocketAddress(Ipv4Address::GetAny(), port));
|
||||
ApplicationContainer serverApps = echoServer.Install(nodes.Get(1));
|
||||
serverApps.Start(Seconds(1.0));
|
||||
serverApps.Stop(Seconds(10.0));
|
||||
serverApps.Start(Seconds(1));
|
||||
serverApps.Stop(Seconds(10));
|
||||
UdpEchoClientHelper echoClient(InetSocketAddress(interfaces.GetAddress(1), port));
|
||||
echoClient.SetAttribute("MaxPackets", UintegerValue(1));
|
||||
echoClient.SetAttribute("Interval", TimeValue(Seconds(1.0)));
|
||||
echoClient.SetAttribute("Interval", TimeValue(Seconds(1)));
|
||||
echoClient.SetAttribute("PacketSize", UintegerValue(1024));
|
||||
|
||||
ApplicationContainer clientApps = echoClient.Install(nodes.Get(0));
|
||||
@@ -329,8 +329,8 @@ UdpEchoClientSetFillTestCase::DoRun()
|
||||
}
|
||||
echoClient.SetFill(clientApps.Get(0), &(array[0]), (uint32_t)64, (uint32_t)64);
|
||||
|
||||
clientApps.Start(Seconds(2.0));
|
||||
clientApps.Stop(Seconds(10.0));
|
||||
clientApps.Start(Seconds(2));
|
||||
clientApps.Stop(Seconds(10));
|
||||
|
||||
Simulator::Run();
|
||||
Simulator::Destroy();
|
||||
|
||||
@@ -180,15 +180,15 @@ main(int argc, char* argv[])
|
||||
|
||||
ApplicationContainer app = onoff.Install(n0);
|
||||
// Start the application
|
||||
app.Start(Seconds(1.0));
|
||||
app.Stop(Seconds(10.0));
|
||||
app.Start(Seconds(1));
|
||||
app.Stop(Seconds(10));
|
||||
|
||||
// Create an optional packet sink to receive these packets
|
||||
PacketSinkHelper sink("ns3::UdpSocketFactory",
|
||||
Address(InetSocketAddress(Ipv4Address::GetAny(), port)));
|
||||
ApplicationContainer sink1 = sink.Install(n1);
|
||||
sink1.Start(Seconds(1.0));
|
||||
sink1.Stop(Seconds(10.0));
|
||||
sink1.Start(Seconds(1));
|
||||
sink1.Stop(Seconds(10));
|
||||
|
||||
//
|
||||
// Create a similar flow from n3 to n0, starting at time 1.1 seconds
|
||||
@@ -196,11 +196,11 @@ main(int argc, char* argv[])
|
||||
onoff.SetAttribute("Remote", AddressValue(InetSocketAddress(Ipv4Address("10.1.1.2"), port)));
|
||||
ApplicationContainer app2 = onoff.Install(n3);
|
||||
app2.Start(Seconds(1.1));
|
||||
app2.Stop(Seconds(10.0));
|
||||
app2.Stop(Seconds(10));
|
||||
|
||||
ApplicationContainer sink2 = sink.Install(n0);
|
||||
sink2.Start(Seconds(1.1));
|
||||
sink2.Stop(Seconds(10.0));
|
||||
sink2.Stop(Seconds(10));
|
||||
|
||||
NS_LOG_INFO("Configure Tracing.");
|
||||
|
||||
|
||||
@@ -111,14 +111,14 @@ main(int argc, char* argv[])
|
||||
|
||||
ApplicationContainer app = onoff.Install(terminals.Get(0));
|
||||
// Start the application
|
||||
app.Start(Seconds(1.0));
|
||||
app.Stop(Seconds(10.0));
|
||||
app.Start(Seconds(1));
|
||||
app.Stop(Seconds(10));
|
||||
|
||||
// Create an optional packet sink to receive these packets
|
||||
PacketSinkHelper sink("ns3::UdpSocketFactory",
|
||||
Address(InetSocketAddress(Ipv4Address::GetAny(), port)));
|
||||
app = sink.Install(terminals.Get(1));
|
||||
app.Start(Seconds(0.0));
|
||||
app.Start(Seconds(0));
|
||||
|
||||
//
|
||||
// Create a similar flow from n3 to n0, starting at time 1.1 seconds
|
||||
@@ -126,10 +126,10 @@ main(int argc, char* argv[])
|
||||
onoff.SetAttribute("Remote", AddressValue(InetSocketAddress(Ipv4Address("10.1.1.1"), port)));
|
||||
app = onoff.Install(terminals.Get(3));
|
||||
app.Start(Seconds(1.1));
|
||||
app.Stop(Seconds(10.0));
|
||||
app.Stop(Seconds(10));
|
||||
|
||||
app = sink.Install(terminals.Get(0));
|
||||
app.Start(Seconds(0.0));
|
||||
app.Start(Seconds(0));
|
||||
|
||||
NS_LOG_INFO("Configure Tracing.");
|
||||
|
||||
|
||||
@@ -96,14 +96,14 @@ def main(argv):
|
||||
|
||||
app = onoff.Install(ns.NodeContainer(terminals.Get(0)))
|
||||
# Start the application
|
||||
app.Start(ns.Seconds(1.0))
|
||||
app.Stop(ns.Seconds(10.0))
|
||||
app.Start(ns.Seconds(1))
|
||||
app.Stop(ns.Seconds(10))
|
||||
|
||||
# Create an optional packet sink to receive these packets
|
||||
inet_address = ns.InetSocketAddress(ns.Ipv4Address.GetAny(), port)
|
||||
sink = ns.PacketSinkHelper("ns3::UdpSocketFactory", inet_address.ConvertTo())
|
||||
app = sink.Install(ns.NodeContainer(terminals.Get(1)))
|
||||
app.Start(ns.Seconds(0.0))
|
||||
app.Start(ns.Seconds(0))
|
||||
|
||||
#
|
||||
# Create a similar flow from n3 to n0, starting at time 1.1 seconds
|
||||
@@ -112,10 +112,10 @@ def main(argv):
|
||||
onoff.SetAttribute("Remote", ns.AddressValue(inet_address.ConvertTo()))
|
||||
app = onoff.Install(ns.NodeContainer(terminals.Get(3)))
|
||||
app.Start(ns.Seconds(1.1))
|
||||
app.Stop(ns.Seconds(10.0))
|
||||
app.Stop(ns.Seconds(10))
|
||||
|
||||
app = sink.Install(ns.NodeContainer(terminals.Get(0)))
|
||||
app.Start(ns.Seconds(0.0))
|
||||
app.Start(ns.Seconds(0))
|
||||
|
||||
#
|
||||
# Configure tracing of all enqueue, dequeue, and NetDevice receive events.
|
||||
|
||||
@@ -143,8 +143,8 @@ main(int argc, char* argv[])
|
||||
Address sinkLocalAddress(InetSocketAddress(Ipv4Address::GetAny(), port));
|
||||
PacketSinkHelper packetSinkHelper("ns3::TcpSocketFactory", sinkLocalAddress);
|
||||
sinkApps.Add(packetSinkHelper.Install(server.Get(0)));
|
||||
sinkApps.Start(Seconds(0.0));
|
||||
sinkApps.Stop(Seconds(10.0));
|
||||
sinkApps.Start(Seconds(0));
|
||||
sinkApps.Stop(Seconds(10));
|
||||
}
|
||||
|
||||
if (systemId == 0)
|
||||
@@ -158,8 +158,8 @@ main(int argc, char* argv[])
|
||||
AddressValue remoteAddress(InetSocketAddress(serverInterfaces.GetAddress(0), port));
|
||||
clientHelper.SetAttribute("Remote", remoteAddress);
|
||||
clientApps.Add(clientHelper.Install(client.Get(0)));
|
||||
clientApps.Start(Seconds(1.0)); // Start 1 second after sink
|
||||
clientApps.Stop(Seconds(9.0)); // Stop before the sink
|
||||
clientApps.Start(Seconds(1)); // Start 1 second after sink
|
||||
clientApps.Stop(Seconds(9)); // Stop before the sink
|
||||
}
|
||||
|
||||
if (!nix)
|
||||
@@ -174,7 +174,7 @@ main(int argc, char* argv[])
|
||||
}
|
||||
|
||||
// Run the simulator
|
||||
Simulator::Stop(Seconds(200.0));
|
||||
Simulator::Stop(Seconds(200));
|
||||
Simulator::Run();
|
||||
Simulator::Destroy();
|
||||
|
||||
|
||||
@@ -114,8 +114,8 @@ main(int argc, char* argv[])
|
||||
|
||||
UdpEchoServerHelper echoServer(9);
|
||||
ApplicationContainer serverApps = echoServer.Install(server.Get(0));
|
||||
serverApps.Start(Seconds(1.0));
|
||||
serverApps.Stop(Seconds(5.0));
|
||||
serverApps.Start(Seconds(1));
|
||||
serverApps.Stop(Seconds(5));
|
||||
|
||||
UdpEchoClientHelper echoClient(serverInterfaces.GetAddress(0), 9);
|
||||
echoClient.SetAttribute("MaxPackets", UintegerValue(1));
|
||||
@@ -123,8 +123,8 @@ main(int argc, char* argv[])
|
||||
echoClient.SetAttribute("PacketSize", UintegerValue(1024));
|
||||
|
||||
ApplicationContainer clientApps = echoClient.Install(client.Get(0));
|
||||
clientApps.Start(Seconds(2.0));
|
||||
clientApps.Stop(Seconds(5.0));
|
||||
clientApps.Start(Seconds(2));
|
||||
clientApps.Stop(Seconds(5));
|
||||
|
||||
if (!nix)
|
||||
{
|
||||
@@ -137,7 +137,7 @@ main(int argc, char* argv[])
|
||||
p2p.EnableAsciiAll(ascii.CreateFileStream("briteLeaves.tr"));
|
||||
}
|
||||
// Run the simulator
|
||||
Simulator::Stop(Seconds(6.0));
|
||||
Simulator::Stop(Seconds(6));
|
||||
Simulator::Run();
|
||||
Simulator::Destroy();
|
||||
|
||||
|
||||
@@ -79,22 +79,22 @@ serverInterfaces = address.Assign(p2pServerDevices)
|
||||
|
||||
echoServer = ns.UdpEchoServerHelper(9)
|
||||
serverApps = echoServer.Install(server.Get(0))
|
||||
serverApps.Start(ns.Seconds(1.0))
|
||||
serverApps.Stop(ns.Seconds(5.0))
|
||||
serverApps.Start(ns.Seconds(1))
|
||||
serverApps.Stop(ns.Seconds(5))
|
||||
|
||||
echoClient = ns.UdpEchoClientHelper(serverInterfaces.GetAddress(0).ConvertTo(), 9)
|
||||
echoClient.SetAttribute("MaxPackets", ns.UintegerValue(1))
|
||||
echoClient.SetAttribute("Interval", ns.TimeValue(ns.Seconds(1.0)))
|
||||
echoClient.SetAttribute("Interval", ns.TimeValue(ns.Seconds(1)))
|
||||
echoClient.SetAttribute("PacketSize", ns.UintegerValue(1024))
|
||||
|
||||
clientApps = echoClient.Install(client.Get(0))
|
||||
clientApps.Start(ns.Seconds(2.0))
|
||||
clientApps.Stop(ns.Seconds(5.0))
|
||||
clientApps.Start(ns.Seconds(2))
|
||||
clientApps.Stop(ns.Seconds(5))
|
||||
|
||||
asciiTrace = ns.AsciiTraceHelper()
|
||||
p2p.EnableAsciiAll(asciiTrace.CreateFileStream("briteLeaves.tr"))
|
||||
|
||||
# Run the simulator
|
||||
ns.Simulator.Stop(ns.Seconds(6.0))
|
||||
ns.Simulator.Stop(ns.Seconds(6))
|
||||
ns.Simulator.Run()
|
||||
ns.Simulator.Destroy()
|
||||
|
||||
@@ -174,19 +174,19 @@ BriteTopologyFunctionTestCase::DoRun()
|
||||
|
||||
ApplicationContainer apps = onOff.Install(source.Get(0));
|
||||
|
||||
apps.Start(Seconds(1.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(1));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
PacketSinkHelper sinkHelper("ns3::UdpSocketFactory",
|
||||
Address(InetSocketAddress(Ipv4Address::GetAny(), port)));
|
||||
apps = sinkHelper.Install(sink.Get(0));
|
||||
|
||||
apps.Start(Seconds(1.0));
|
||||
apps.Stop(Seconds(10.0));
|
||||
apps.Start(Seconds(1));
|
||||
apps.Stop(Seconds(10));
|
||||
|
||||
Ipv4GlobalRoutingHelper::PopulateRoutingTables();
|
||||
|
||||
Simulator::Stop(Seconds(10.0));
|
||||
Simulator::Stop(Seconds(10));
|
||||
Simulator::Run();
|
||||
|
||||
Ptr<PacketSink> sink1 = DynamicCast<PacketSink>(apps.Get(0));
|
||||
|
||||
@@ -45,7 +45,7 @@ RandomWalk2dOutdoorMobilityModel::GetTypeId()
|
||||
MakeRectangleChecker())
|
||||
.AddAttribute("Time",
|
||||
"Change current direction and speed after moving for this delay.",
|
||||
TimeValue(Seconds(20.0)),
|
||||
TimeValue(Seconds(20)),
|
||||
MakeTimeAccessor(&RandomWalk2dOutdoorMobilityModel::m_modeTime),
|
||||
MakeTimeChecker())
|
||||
.AddAttribute("Distance",
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user