53 #include "ns3/core-module.h"
54 #include "ns3/network-module.h"
55 #include "ns3/applications-module.h"
56 #include "ns3/mobility-module.h"
57 #include "ns3/config-store-module.h"
58 #include "ns3/wimax-module.h"
59 #include "ns3/csma-module.h"
61 #include "ns3/global-route-manager.h"
62 #include "ns3/mobility-module.h"
63 #include "ns3/internet-module.h"
64 #include "ns3/vector.h"
69 #define MAXDIST 10 // km
72 int main (
int argc,
char *argv[])
100 int nbSS = 10, duration = 7, schedType = 0;
104 cmd.
AddValue (
"nbSS",
"number of subscriber station to create", nbSS);
105 cmd.
AddValue (
"scheduler",
"type of scheduler to use with the netdevices", schedType);
106 cmd.
AddValue (
"duration",
"duration of the simulation in seconds", duration);
107 cmd.
AddValue (
"verbose",
"turn on all WimaxNetDevice log components", verbose);
108 cmd.
Parse (argc, argv);
136 channel = CreateObject<SimpleOfdmWimaxChannel> ();
138 ssDevs = wimax.
Install (ssNodes,
149 BSPosition = CreateObject<ConstantPositionMobilityModel> ();
159 for (
int i = 0; i < nbSS; i++)
161 SSPosition[i] = CreateObject<RandomWaypointMobilityModel> ();
162 SSPosAllocator[i] = CreateObject<RandomRectanglePositionAllocator> ();
165 xVar->SetAttribute (
"Max",
DoubleValue ((i / 40.0 + 1) * 2000));
166 SSPosAllocator[i]->SetX (xVar);
170 SSPosAllocator[i]->SetY (yVar);
189 LAN_ASN_BS.
Add (bsNodes.
Get (0));
191 LAN_ASN_BS.
Add (ASNGW_Node.
Get (0));
194 csmaASN_BS.SetChannelAttribute (
"Delay",
TimeValue (MilliSeconds (2)));
200 BS_CSMADevs.
Add (LAN_ASN_BS_Devs.
Get (0));
203 ASN_Devs1.
Add (LAN_ASN_BS_Devs.
Get (1));
208 LAN_ASN_STREAMER.
Add (ASNGW_Node.
Get (0));
209 LAN_ASN_STREAMER.
Add (Streamer_Node.
Get (0));
219 ASN_Devs2.
Add (LAN_ASN_STREAMER_Devs.
Get (0));
220 STREAMER_Devs.
Add (LAN_ASN_STREAMER_Devs.
Get (1));
233 address.
SetBase (
"10.1.0.0",
"255.255.255.0");
235 BSinterfaces = address.
Assign (bsDevsOne);
236 SSinterfaces = address.
Assign (ssDevs);
238 address.
SetBase (
"11.1.1.0",
"255.255.255.0");
242 address.
SetBase (
"12.1.1.0",
"255.255.255.0");
255 multicast.
AddMulticastRoute (multicastRouter, multicastSource, multicastGroup, inputIf, ASN_Devs1);
263 multicastRouter = bsNodes.
Get (0);
264 inputIf = BS_CSMADevs.
Get (0);
266 multicast.
AddMulticastRoute (multicastRouter, multicastSource, multicastGroup, inputIf, bsDevsOne);
268 uint16_t multicast_port = 100;
270 for (
int i = 0; i < nbSS; i++)
273 serverApps[i] = udpServer[i].
Install (ssNodes.
Get (i));
274 serverApps[i].
Start (Seconds (6));
275 serverApps[i].
Stop (Seconds (duration));
280 clientApps = udpClient.
Install (Streamer_Node.
Get (0));
281 clientApps.
Start (Seconds (6));
282 clientApps.
Stop (Seconds (duration));
297 MulticastClassifier);
305 for (
int i = 0; i < nbSS; i++)
309 SSPosAllocator[i] = 0;