hello,
i am currently trying to develop a WiMAX framework in away that i have multiple Subscriber Station (SS>=1) consider this as multiple sensors streaming data to be processed in a proxy station, now in this framework the proxy is connected to the Base Station using fiber optics (i.e. not a bottleneck) so my application would look like it is located in the BS.
my question, can i add application to the BS or not??.
i tried the following but the system only runs for 6 sec and then it stops sending packet and some times it triggers some errors, i'd really want to know what is going wrong?
now that i am new to WiMAX.
int main (int argc, char *argv[])
{
bool verbose = false;
uint16_t nbSS = 20;
int duration = 30, schedType = 0;
WimaxHelper::SchedulerType scheduler = WimaxHelper::SCHED_TYPE_SIMPLE;
CommandLine cmd;
cmd.AddValue ("scheduler", "type of scheduler to use with the network devices", schedType);
cmd.AddValue ("duration", "duration of the simulation in seconds", duration);
cmd.AddValue ("verbose", "turn on all WimaxNetDevice log components", verbose);
cmd.Parse (argc, argv);
switch (schedType)
{
case 0:
scheduler = WimaxHelper::SCHED_TYPE_SIMPLE;
break;
case 1:
scheduler = WimaxHelper::SCHED_TYPE_MBQOS;
break;
case 2:
scheduler = WimaxHelper::SCHED_TYPE_RTPS;
break;
default:
scheduler = WimaxHelper::SCHED_TYPE_SIMPLE;
}
NodeContainer ssNodes;
NodeContainer bsNodes;
ssNodes.Create (nbSS);
bsNodes.Create (1);
WimaxHelper wimax;
NetDeviceContainer ssDevs, bsDevs;
ssDevs = wimax.Install (ssNodes,
WimaxHelper::DEVICE_TYPE_SUBSCRIBER_STATION,
WimaxHelper::SIMPLE_PHY_TYPE_OFDM,
scheduler);
bsDevs = wimax.Install (bsNodes, WimaxHelper::DEVICE_TYPE_BASE_STATION, WimaxHelper::SIMPLE_PHY_TYPE_OFDM, scheduler);
Ptr<SubscriberStationNetDevice>* ss = new Ptr<SubscriberStationNetDevice>[nbSS];
for (int i = 0; i < ssNodes.GetN(); i++)
{
ss[i] = ssDevs.Get (i)->GetObject<SubscriberStationNetDevice> ();
ss[i]->SetModulationType (WimaxPhy::MODULATION_TYPE_QAM16_12);
}
Ptr<BaseStationNetDevice> bs;
bs = bsDevs.Get (0)->GetObject<BaseStationNetDevice> ();
InternetStackHelper stack;
stack.Install (bsNodes);
stack.Install (ssNodes);
Ipv4AddressHelper address;
address.SetBase ("10.1.1.0", "255.255.255.0");
Ipv4InterfaceContainer BSinterface = address.Assign (bsDevs);
Ipv4InterfaceContainer SSinterfaces = address.Assign (ssDevs);
if (verbose)
{
wimax.EnableLogComponents (); // Turn on all wimax logging
}
//Application
LogComponentEnable ("UdpClient", LOG_LEVEL_INFO);
LogComponentEnable ("UdpServer", LOG_LEVEL_INFO);
UdpServerHelper udpServer;
ApplicationContainer serverApps;
UdpClientHelper udpClient;
ApplicationContainer clientApps;
udpServer = UdpServerHelper (100);
serverApps = udpServer.Install (bsNodes.Get (0));
serverApps.Start (Seconds (1));
serverApps.Stop (Seconds (duration));
udpClient = UdpClientHelper (BSinterface.GetAddress (0), 100);
udpClient.SetAttribute ("MaxPackets", UintegerValue (500000));
udpClient.SetAttribute ("Interval", TimeValue (Seconds (0.01)));
udpClient.SetAttribute ("PacketSize", UintegerValue (1024));
clientApps = udpClient.Install (ssNodes);
clientApps.Start (Seconds (2));
clientApps.Stop (Seconds (duration));
Simulator::Stop (Seconds (duration + 0.1));
for (int i = 0; i < ssNodes.GetN(); i++)
{
IpcsClassifierRecord DlClassifierUgs (Ipv4Address ("0.0.0.0"),
Ipv4Mask ("0.0.0.0"),
BSinterface.GetAddress (i),
Ipv4Mask ("255.255.255.255"),
0,
65000,
100 + (i * 10),
100 + (i * 10),
17,
1);
ServiceFlow DlServiceFlowUgs = wimax.CreateServiceFlow (ServiceFlow::SF_DIRECTION_DOWN,
ServiceFlow::SF_TYPE_RTPS,
DlClassifierUgs);
ss[i]->AddServiceFlow (DlServiceFlowUgs);
IpcsClassifierRecord UlClassifierUgs (SSinterfaces.GetAddress (i),
Ipv4Mask ("255.255.255.255"),
Ipv4Address ("0.0.0.0"),
Ipv4Mask ("0.0.0.0"),
0,
65000,
100 + (i * 10),
100 + (i * 10),
17,
1);
ServiceFlow UlServiceFlowUgs = wimax.CreateServiceFlow (ServiceFlow::SF_DIRECTION_UP,
ServiceFlow::SF_TYPE_RTPS,
UlClassifierUgs);
ss[i]->AddServiceFlow (UlServiceFlowUgs);
}
NS_LOG_INFO ("Starting simulation.....");
Simulator::Run ();
for (int i = 0; i < ssNodes.GetN(); i++)
{
ss[i] = 0;
}
delete[] ss;
bs = 0;
Simulator::Destroy ();
NS_LOG_INFO ("Done.");
return 0;
}
Best Regards