BUG 662 (the GetRequestedBandwidth() function doesn't return the correct value of
BandwidthRequested) Fixed
--- a/examples/wimax-ipv4.cc Mon Sep 21 14:17:54 2009 +0200
+++ b/examples/wimax-ipv4.cc Fri Oct 16 15:21:07 2009 +0200
@@ -213,7 +213,7 @@
wimax.ClassifierConfig (ss[i + (nbSS / 2)], ss[i], bs[0],
SSinterfaces.GetAddress (i + (nbSS / 2)),
SSinterfaces.GetAddress (i), 0, 100 + (i * 10), 17,
- ServiceFlow::SFID_TYPE_UGS);
+ ServiceFlow::SFID_TYPE_RTPS);
}
--- a/examples/wimax-rtps.cc Mon Sep 21 14:17:54 2009 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,215 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright 2009 TELEMATICS LAB - Dipartimento di Elettronica ed Elettrotecnica,
- * Politecnico di Bari
- * Via Orabona,4 - 70125 BARI, ITALY
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Author: Giuseppe Piro <g.piro@poliba.it>
- */
-
-// Default network topology includes a base station (BS) and some number of
-// subscriber station (SS) specified by the variable nbSS (default to 10).
-// The SSs are grouped into two groups: senders and receivers. SSs from 0 to
-// nbSS/2 are designed as senders and SSs from (nbSS/2 + 1) to nbSS-1 will
-// designed as receivers.
-// each sender SS creates a number of rtps service flows specified by the
-// variable nbRTPS (default to 1).
-// Senders SSs send some stamped IP packets with variable bitrate to receiver SSs
-// through the BS station.
-
-// +-----+ +-----+ +-----+ +-----+ +-----+
-// | SS0 | | SS1 | | SS2 | | SS3 | | SS4 |
-// +-----+ +-----+ +-----+ +-----+ +-----+
-// 10.1.1.1 10.1.1.2 10.1.1.3 10.1.1.4 10.1.1.5
-// -------- -------- ------- -------- --------
-// ((*)) ((*)) ((*)) ((*)) ((*))
-//
-// 10.1.1.11
-// +------------+
-// |Base Station| ==((*))
-// +------------+
-//
-// ((*)) ((*)) ((*)) ((*)) ((*))
-// ------- -------- -------- ------- --------
-// 10.1.1.6 10.1.1.7 10.1.1.8 10.1.1.9 10.1.1.10
-// +-----+ +-----+ +-----+ +-----+ +-----+
-// | SS5 | | SS6 | | SS7 | | SS8 | | SS9 |
-// +-----+ +-----+ +-----+ +-----+ +-----+
-
-#include "ns3/core-module.h"
-#include "ns3/common-module.h"
-#include "ns3/node-module.h"
-#include "ns3/helper-module.h"
-#include "ns3/mobility-module.h"
-#include "ns3/contrib-module.h"
-#include "ns3/wimax-module.h"
-#include "ns3/global-route-manager.h"
-#include "ns3/trace-based-streamer-helper.h"
-#include <iostream>
-#include <vector>
-#include <sstream>
-#include <cstdlib>
-#include <cstdio>
-#include <fstream>
-
-NS_LOG_COMPONENT_DEFINE ("WiMAXRTPSSimulation");
-
-using namespace ns3;
-using namespace std;
-
-int
-main (int argc, char *argv[])
-{
-
- int nbSS = 10, duration = 150, nbBS = 1; //default values
- int nbRTPS = 1;
-
- CommandLine cmd;
- cmd.AddValue ("nbSS", "number of subscriber station to create", nbSS);
- cmd.AddValue ("nbRTPS", "number of RTPS_flows for each source_ss", nbRTPS);
- cmd.Parse (argc, argv);
-
- std::cout << "-- Setup wimax network ---\n"
- "\nnumeber of Base Station: " << nbBS
- << "\nnumeber of Subscriber Station: " << nbSS
- << "\nnumeber of RTPS_flows for each source_ss: " << nbRTPS << std::endl;
-
- LogComponentEnable ("TraceBasedStreamerApplication", LOG_LEVEL_INFO);
- LogComponentEnable ("UdpServerApplication", LOG_LEVEL_INFO);
-
- TimeStepPrecision::Set (TimeStepPrecision::FS);
-
- NodeContainer ssNodes;
- NodeContainer bsNodes;
-
- ssNodes.Create (nbSS);
- bsNodes.Create (nbBS);
-
- WimaxHelper wimax;
-
- NetDeviceContainer ssDevs, bsDevs;
-
- ssDevs = wimax.Install (ssNodes, WimaxHelper::DEVICE_TYPE_SUBSCRIBER_STATION,
- WimaxHelper::SIMPLE_PHY_TYPE_OFDM, WimaxHelper::SCHED_TYPE_RTPS);
- bsDevs = wimax.Install (bsNodes, WimaxHelper::DEVICE_TYPE_BASE_STATION,
- WimaxHelper::SIMPLE_PHY_TYPE_OFDM, WimaxHelper::SCHED_TYPE_RTPS);
-
- Ptr<WimaxSubscriberStationNetDevice> ss[nbSS];
- for (int i = 0; i < nbSS; i++)
- {
- ss[i] = ssDevs.Get (i)->GetObject<WimaxSubscriberStationNetDevice> ();
- ss[i]->SetModulationType (WimaxPhy::MODULATION_TYPE_QAM16_12);
- }
-
- Ptr<WimaxBaseStationNetDevice> bs[nbBS];
- for (int i = 0; i < nbBS; i++)
- {
- bs[i] = bsDevs.Get (i)->GetObject<WimaxBaseStationNetDevice> ();
- }
-
- MobilityHelper mobility;
- mobility.Install (bsNodes);
- mobility.Install (ssNodes);
-
- InternetStackHelper stack;
- stack.Install (bsNodes);
- stack.Install (ssNodes);
-
- Ipv4AddressHelper address;
- address.SetBase ("10.1.1.0", "255.255.255.0");
-
- Ipv4InterfaceContainer SSinterfaces = address.Assign (ssDevs);
- Ipv4InterfaceContainer BSinterface = address.Assign (bsDevs);
-
- /*------------------------------*/
-
- /*
- * Setup Socket Connection between a couple of ss node
- *
- * ss(i) ------> ss((nbSS / 2)+i)
- * ss(i+1)------> ss((nbSS / 2)+2)
- * ...
- * ss((nbSS / 2) - 1)------> ss(nbSS - 1)
- */
-
- UdpServerHelper * RTPS_UdpSink[nbSS / 2][nbRTPS];
- ApplicationContainer RTPS_AppsSink[nbSS / 2][nbRTPS];
- TraceBasedStreamerHelper * RTPS_UdpClient[nbSS / 2][nbRTPS];
- ApplicationContainer RTPS_AppsClient[nbSS / 2][nbRTPS];
-
- int port_number = 101; //initial port_number
-
- srand ((unsigned) time (0));
- float starting_time = 0; //application starting time
- float duration_time = 0; //application duration time
-
-
- for (int i = 0; i < nbSS / 2; i++)
- {
- //Setup service flows for each ss_source
-
- std::cout << "\n\tSetup Serivce flows for ss: "
- "id= " << i << " Address= " << ssDevs.Get (i)->GetAddress ()
- << std::endl;
-
- for (int j = 0; j < nbRTPS; j++)
- {
-
- starting_time = ((rand () % 10)) + 10;
- duration_time = 60.0;
-
- RTPS_UdpSink[i][j] = new UdpServerHelper (port_number);
- RTPS_AppsSink[i][j] = RTPS_UdpSink[i][j]->Install (ssNodes.Get (i));
- RTPS_AppsSink[i][j].Start (Seconds (0.1));
- RTPS_AppsSink[i][j].Stop (Seconds (duration));
-
- RTPS_UdpClient[i][j] = new TraceBasedStreamerHelper (
- SSinterfaces.GetAddress (i), port_number,
- (char*) "/home/peppe/Desktop/Jurassik_MPEG4hq_.dat");
-
- RTPS_AppsClient[i][j] = RTPS_UdpClient[i][j]->Install (ssNodes.Get (i
- + (nbSS / 2)));
- RTPS_AppsClient[i][j].Start (Seconds (starting_time));
- RTPS_AppsClient[i][j].Stop (Seconds (duration_time));
- //for(ApplicationContainer::Iterator it = RTPS_AppsClient[i][j].Begin(); it != RTPS_AppsClient[i][j].End(); it++)
- // ((TraceClient*)(&**it))->SetTraceFile(&TraceFile);
-
- QoSParameterSet *parameterSet = wimax.CreateRtpsParameterSet (3832,
- 767000, 3349000, 40);
- wimax.SetupConnection (ss[i + (nbSS / 2)], ss[i], bs[0],
- parameterSet, QoSParameterSet::SCHEDULING_TYPE_RTPS);
- wimax.ClassifierConfig (ss[i + (nbSS / 2)], ss[i], bs[0],
- SSinterfaces.GetAddress (i + (nbSS / 2)),
- SSinterfaces.GetAddress (i), 0, port_number, 17, 101);
-
- std::cout << "\tSetup RTPS connection between \n\tss[ "
- << SSinterfaces.GetAddress (i) << " ] and \n\tss["
- << SSinterfaces.GetAddress (i + (nbSS / 2)) << " ]"
- "\n\tport number: " << port_number << "\n" << std::endl;
-
- port_number++;
- }
- }
-
- Simulator::Stop (Seconds (duration + 0.1));
-
- NS_LOG_INFO ("Starting simulation.....");
- Simulator::Run ();
- Simulator::Destroy ();
- NS_LOG_INFO ("Done.");
-
- return 0;
-}
--- a/src/devices/wimax/bandwidth-manager.cc Mon Sep 21 14:17:54 2009 +0200
+++ b/src/devices/wimax/bandwidth-manager.cc Fri Oct 16 15:21:07 2009 +0200
@@ -134,8 +134,6 @@
//Modify by G. Piro
//bandwidth is requested for all packets
bytesToRequest = serviceFlow->GetQueue ()->GetNBytes ();
- NS_LOG_DEBUG ("GP_DEBUG: bytesToRequest = " << bytesToRequest
- << std::endl);
}
}
@@ -212,6 +210,8 @@
// update backlogged
serviceFlow->GetRecord ()->IncreaseBacklogged (bwRequestHdr.GetBr ());
+ std::cout << "\tGP_DEBUG: ProcessBandwidthRequest\n\t\ttGetBr() = "
+ << bwRequestHdr.GetBr() << std::endl;
}
void
--- a/src/devices/wimax/wimax-mac-header.cc Mon Sep 21 14:17:54 2009 +0200
+++ b/src/devices/wimax/wimax-mac-header.cc Fri Oct 16 15:21:07 2009 +0200
@@ -484,10 +484,9 @@
Buffer::Iterator i = start;
uint8_t headerBuffer[6];
- uint8_t br_msb1 = (m_br >> 16) & 0x00000007;
- uint8_t br_msb2 = (m_br >> 8) & 0x000000FF;
+ uint8_t br_msb1 = (((uint32_t)m_br) >> 16) & 0x00000007;
+ uint8_t br_msb2 = (((uint32_t)m_br) >> 8) & 0x000000FF;
uint8_t br_lsb = m_br & 0x000000FF;
-
headerBuffer[0] = ((m_ht << 7) & 0x80) | ((m_ec << 6) & 0x40)
| ((m_type << 3) & 0x38) | br_msb1;
headerBuffer[1] = br_msb2;
@@ -535,7 +534,7 @@
uint32_t br_msb1 = headerBuffer[0] & 0x00000007;
uint32_t br_msb2 = headerBuffer[1] & 0x000000FF;
uint32_t br_lsb = headerBuffer[2] & 0x000000FF;
- m_br = (br_msb2 << 16) | (br_msb1 << 8) | br_lsb;
+ m_br = ((uint32_t)br_msb1 << 14) | ((uint32_t)br_msb2 << 8) | br_lsb;
uint16_t cidmsb = headerBuffer[3];
uint16_t cidlsb = headerBuffer[4];
--- a/src/devices/wimax/wimax.h Mon Sep 21 14:17:54 2009 +0200
+++ b/src/devices/wimax/wimax.h Fri Oct 16 15:21:07 2009 +0200
@@ -230,8 +230,7 @@
* europeenne dans le domaine de la recherche Scientifique et Technique)
* is a European Union Forum for cooperative scientific research which has
* developed this model accordingly to various experiments and researches.
- * This model is applicable to urban areas. To further evaluate Path Loss
- * in Suburban or Rural Quasi-open/Open Areas.
+ * This model is applicable to urban areas.
* Frequency: 1500 MHz to 2000 MHz
* Mobile Station Antenna Height: 1 up to 10m
* Base station Antenna Height: 30m to 200m