38 #include "ns3/core-module.h"
39 #include "ns3/network-module.h"
40 #include "ns3/internet-module.h"
41 #include "ns3/point-to-point-module.h"
42 #include "ns3/applications-module.h"
43 #include "ns3/ipv4-static-routing-helper.h"
44 #include "ns3/ipv4-list-routing-helper.h"
65 main (
int argc,
char *argv[])
71 cmd.
Parse (argc, argv);
77 Ptr<Node> nDstRtr = CreateObject<Node> ();
106 ipv4.
SetBase (
"10.1.1.0",
"255.255.255.0");
108 ipv4.
SetBase (
"10.1.2.0",
"255.255.255.0");
110 ipv4.
SetBase (
"10.10.1.0",
"255.255.255.0");
112 ipv4.
SetBase (
"10.10.2.0",
"255.255.255.0");
114 ipv4.
SetBase (
"10.20.1.0",
"255.255.255.0");
157 uint16_t dstport = 12345;
162 apps.
Start (Seconds (0.0));
163 apps.
Stop (Seconds (10.0));
204 localSocket->
Bind ();
215 while (currentTxBytes < totalTxBytes && localSocket->GetTxAvailable () > 0)
218 uint32_t dataOffset = currentTxBytes %
writeSize;
219 uint32_t toWrite =
writeSize - dataOffset;
220 toWrite = std::min (toWrite, left);
222 int amountSent = localSocket->
Send (&
data[dataOffset], toWrite, 0);
228 currentTxBytes += amountSent;
230 localSocket->
Close ();