Bug 953 - WiMAX channel scanning overflow
authorFlavio Kubota <flaviokubota@gmail.com>
Sat, 07 Aug 2010 21:15:14 -0300
changeset 6524 7a1c0a99152d
parent 6523 a6bc1f7cd068
child 6525 80937beaed64
Bug 953 - WiMAX channel scanning overflow
examples/wimax/wimax-ipv4.cc
examples/wimax/wimax-multicast.cc
examples/wimax/wimax-simple.cc
src/devices/wimax/bs-link-manager.cc
src/devices/wimax/ss-link-manager.cc
src/devices/wimax/wimax-net-device.cc
src/devices/wimax/wimax-phy.cc
--- a/examples/wimax/wimax-ipv4.cc	Fri Aug 06 21:55:17 2010 -0300
+++ b/examples/wimax/wimax-ipv4.cc	Sat Aug 07 21:15:14 2010 -0300
@@ -67,7 +67,7 @@
 int main (int argc, char *argv[])
 {
   // default values
-  int nbSS = 4, duration = 2, schedType = 0;
+  int nbSS = 4, duration = 7, schedType = 0;
   bool verbose = false;
   WimaxHelper::SchedulerType scheduler = WimaxHelper::SCHED_TYPE_SIMPLE;
   LogComponentEnable ("UdpClient", LOG_LEVEL_INFO);
@@ -151,7 +151,7 @@
       // set server port to 100+(i*10)
       udpServer[i] = UdpServerHelper (100 + (i * 10));
       serverApps[i] = udpServer[i].Install (ssNodes.Get (i));
-      serverApps[i].Start (Seconds (1));
+      serverApps[i].Start (Seconds (6));
       serverApps[i].Stop (Seconds (duration));
 
       udpClient[i] = UdpClientHelper (SSinterfaces.GetAddress (i), 100 + (i * 10));
@@ -160,7 +160,7 @@
       udpClient[i].SetAttribute ("PacketSize", UintegerValue (800));
 
       clientApps[i] = udpClient[i].Install (ssNodes.Get (i + (nbSS / 2)));
-      clientApps[i].Start (Seconds (1));
+      clientApps[i].Start (Seconds (6));
       clientApps[i].Stop (Seconds (duration));
     }
 
--- a/examples/wimax/wimax-multicast.cc	Fri Aug 06 21:55:17 2010 -0300
+++ b/examples/wimax/wimax-multicast.cc	Sat Aug 07 21:15:14 2010 -0300
@@ -98,7 +98,7 @@
   Ptr<RandomRectanglePositionAllocator> SSPosAllocator[MAXSS];
 
   // default values
-  int nbSS = 10, duration = 2, schedType = 0;
+  int nbSS = 10, duration = 7, schedType = 0;
   WimaxHelper::SchedulerType scheduler = WimaxHelper::SCHED_TYPE_SIMPLE;
 
   CommandLine cmd;
@@ -266,14 +266,14 @@
     {
       udpServer[i] = UdpServerHelper (multicast_port);
       serverApps[i] = udpServer[i].Install (ssNodes.Get (i));
-      serverApps[i].Start (Seconds (1));
+      serverApps[i].Start (Seconds (6));
       serverApps[i].Stop (Seconds (duration));
     }
 
   udpClient = UdpTraceClientHelper (multicastGroup, multicast_port, "");
 
   clientApps = udpClient.Install (Streamer_Node.Get (0));
-  clientApps.Start (Seconds (1));
+  clientApps.Start (Seconds (6));
   clientApps.Stop (Seconds (duration));
 
   IpcsClassifierRecord MulticastClassifier (Ipv4Address ("0.0.0.0"),
--- a/examples/wimax/wimax-simple.cc	Fri Aug 06 21:55:17 2010 -0300
+++ b/examples/wimax/wimax-simple.cc	Sat Aug 07 21:15:14 2010 -0300
@@ -61,7 +61,7 @@
 {
   bool verbose = false;
 
-  int duration = 2, schedType = 0;
+  int duration = 7, schedType = 0;
   WimaxHelper::SchedulerType scheduler = WimaxHelper::SCHED_TYPE_SIMPLE;
 
   CommandLine cmd;
@@ -140,7 +140,7 @@
   udpServer = UdpServerHelper (100);
 
   serverApps = udpServer.Install (ssNodes.Get (0));
-  serverApps.Start (Seconds (1));
+  serverApps.Start (Seconds (6));
   serverApps.Stop (Seconds (duration));
 
   udpClient = UdpClientHelper (SSinterfaces.GetAddress (0), 100);
@@ -149,7 +149,7 @@
   udpClient.SetAttribute ("PacketSize", UintegerValue (1024));
 
   clientApps = udpClient.Install (ssNodes.Get (1));
-  clientApps.Start (Seconds (1));
+  clientApps.Start (Seconds (6));
   clientApps.Stop (Seconds (duration));
 
   Simulator::Stop (Seconds (duration + 0.1));
--- a/src/devices/wimax/bs-link-manager.cc	Fri Aug 06 21:55:17 2010 -0300
+++ b/src/devices/wimax/bs-link-manager.cc	Sat Aug 07 21:15:14 2010 -0300
@@ -321,8 +321,11 @@
 uint64_t
 BSLinkManager::SelectDlChannel (void)
 {
-  // temporarily set to 1 for quick scanning
-  return m_bs->GetChannel (1);
+  // Values according to WirelessMAN-OFDM RF profile for 10 MHz channelization
+  // Section 12.3.3.1 from IEEE 802.16-2004 standard
+  // profR10_3 :
+  // channels: 5000 + n ⋅ 5 MHz, ∀n ∈ { 147, 149, 151, 153, 155, 157, 159, 161, 163, 165, 167 }
+  return m_bs->GetChannel (147);
 }
 
 bool
--- a/src/devices/wimax/ss-link-manager.cc	Fri Aug 06 21:55:17 2010 -0300
+++ b/src/devices/wimax/ss-link-manager.cc	Sat Aug 07 21:15:14 2010 -0300
@@ -138,6 +138,12 @@
       m_dlChnlNr++;
     }
 
+  // using max number of channel according to according to Section 8.5.1 of IEEE 802.16-2004 standard.
+  if (m_dlChnlNr >= 200)
+    {
+      m_dlChnlNr = 0;
+    }
+
   uint64_t dlChannel = m_ss->GetChannel (m_dlChnlNr);
 
   m_ss->SetState (SubscriberStationNetDevice::SS_STATE_SCANNING);
--- a/src/devices/wimax/wimax-net-device.cc	Fri Aug 06 21:55:17 2010 -0300
+++ b/src/devices/wimax/wimax-net-device.cc	Sat Aug 07 21:15:14 2010 -0300
@@ -581,13 +581,19 @@
 void
 WimaxNetDevice::InitializeChannels (void)
 {
-  // initializing arbitrary vector of channels (or frequencies)
-  uint64_t frequency = 2000;
 
-  for (uint8_t i = 0; i < 20; i++)
+  // initializing vector of channels (or frequencies)
+  // Values according to WirelessMAN-OFDM RF profile for 10 MHz channelization
+  // Section 12.3.3.1 from IEEE 802.16-2004 standard
+  // profR10_3 :
+  // channels: 5000 + n ⋅ 5 MHz, ∀n ∈ { 147, 149, 151, 153, 155, 157, 159, 161, 163, 165, 167 }
+  // from a range 5GHz to 6GHz, according to Section 8.5.1.
+  uint64_t frequency = 5000;
+
+  for (uint8_t i = 0; i < 200; i++)
     {
       m_dlChannels.push_back (frequency);
-      frequency += 40;
+      frequency += 5;
     }
 }
 
--- a/src/devices/wimax/wimax-phy.cc	Fri Aug 06 21:55:17 2010 -0300
+++ b/src/devices/wimax/wimax-phy.cc	Sat Aug 07 21:15:14 2010 -0300
@@ -60,7 +60,7 @@
 
     .AddAttribute ("Bandwidth",
                    "The channel bandwidth in Hz.",
-                   UintegerValue (20000000),
+                   UintegerValue (10000000),
                    MakeUintegerAccessor (&WimaxPhy::SetChannelBandwidth, &WimaxPhy::GetChannelBandwidth),
                    MakeUintegerChecker<uint32_t> (5000000, 30000000))
 
@@ -73,7 +73,7 @@
     m_nrCarriers (0),
     m_frameDuration (Seconds (0.01)),
     m_frequency (5000000),
-    m_channelBandwidth (20000000),
+    m_channelBandwidth (10000000),
     m_psDuration (Seconds (0)),
     m_symbolDuration (Seconds (0)),
     m_psPerSymbol (0),