Bug 978: Run check-style.py on files touched in the reorganisation
Cosmetic changes only in this one (hence the reason I wanted them kept separate from the the previous changeset).
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
// Number of wifi or csma nodes can be increased up to 250
|
||||
//
|
||||
// Wifi 10.1.3.0
|
||||
// AP
|
||||
// AP
|
||||
// * * * *
|
||||
// | | | | 10.1.1.0
|
||||
// n5 n6 n7 n0 -------------- n1 n2 n3 n4
|
||||
@@ -54,7 +54,7 @@ main (int argc, char *argv[])
|
||||
// Distributed simulation setup
|
||||
MpiInterface::Enable (&argc, &argv);
|
||||
GlobalValue::Bind ("SimulatorImplementationType",
|
||||
StringValue ("ns3::DistributedSimulatorImpl"));
|
||||
StringValue ("ns3::DistributedSimulatorImpl"));
|
||||
|
||||
uint32_t systemId = MpiInterface::GetSystemId ();
|
||||
uint32_t systemCount = MpiInterface::GetSize ();
|
||||
@@ -109,7 +109,7 @@ main (int argc, char *argv[])
|
||||
|
||||
NodeContainer csmaNodes;
|
||||
csmaNodes.Add (p2pNodes.Get (1));
|
||||
csmaNodes.Create (nCsma , 1); // Create csma nodes with rank 1
|
||||
csmaNodes.Create (nCsma, 1); // Create csma nodes with rank 1
|
||||
|
||||
CsmaHelper csma;
|
||||
csma.SetChannelAttribute ("DataRate", StringValue ("100Mbps"));
|
||||
@@ -130,7 +130,7 @@ main (int argc, char *argv[])
|
||||
wifi.SetRemoteStationManager ("ns3::AarfWifiManager");
|
||||
|
||||
NqosWifiMacHelper mac = NqosWifiMacHelper::Default ();
|
||||
|
||||
|
||||
Ssid ssid = Ssid ("ns-3-ssid");
|
||||
mac.SetType ("ns3::StaWifiMac",
|
||||
"Ssid", SsidValue (ssid),
|
||||
@@ -148,15 +148,15 @@ main (int argc, char *argv[])
|
||||
MobilityHelper mobility;
|
||||
|
||||
mobility.SetPositionAllocator ("ns3::GridPositionAllocator",
|
||||
"MinX", DoubleValue (0.0),
|
||||
"MinY", DoubleValue (0.0),
|
||||
"DeltaX", DoubleValue (5.0),
|
||||
"DeltaY", DoubleValue (5.0),
|
||||
"GridWidth", UintegerValue (10),
|
||||
"LayoutType", StringValue ("RowFirst"));
|
||||
"MinX", DoubleValue (0.0),
|
||||
"MinY", DoubleValue (0.0),
|
||||
"DeltaX", DoubleValue (5.0),
|
||||
"DeltaY", DoubleValue (5.0),
|
||||
"GridWidth", UintegerValue (10),
|
||||
"LayoutType", StringValue ("RowFirst"));
|
||||
|
||||
mobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel",
|
||||
"Bounds", RectangleValue (Rectangle (-250, 250, -250, 250)));
|
||||
"Bounds", RectangleValue (Rectangle (-250, 250, -250, 250)));
|
||||
mobility.Install (wifiStaNodes);
|
||||
|
||||
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
|
||||
|
||||
@@ -16,13 +16,13 @@
|
||||
|
||||
// Network topology
|
||||
//
|
||||
// +----------+
|
||||
// | external |
|
||||
// | Linux |
|
||||
// | Host |
|
||||
// +----------+
|
||||
// | external |
|
||||
// | Linux |
|
||||
// | Host |
|
||||
// | |
|
||||
// | "mytap" |
|
||||
// +----------+
|
||||
// | "mytap" |
|
||||
// +----------+
|
||||
// | n0 n3 n4
|
||||
// | +--------+ +------------+ +------------+
|
||||
// +-------| tap | | | | |
|
||||
@@ -31,8 +31,8 @@
|
||||
// | Wifi | | Wifi | P2P |-----| P2P | CSMA |
|
||||
// +--------+ +------+-----+ +-----+------+
|
||||
// | | ^ |
|
||||
// ((*)) ((*)) | |
|
||||
// P2P 10.1.2 |
|
||||
// ((*)) ((*)) | |
|
||||
// P2P 10.1.2 |
|
||||
// ((*)) ((*)) | n5 n6 n7
|
||||
// | | | | | |
|
||||
// n1 n2 ================
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
// Default Network Topology
|
||||
//
|
||||
// Wifi 10.1.3.0
|
||||
// AP
|
||||
// AP
|
||||
// * * * *
|
||||
// | | | | 10.1.1.0
|
||||
// n5 n6 n7 n0 -------------- n1 n2 n3 n4
|
||||
@@ -90,7 +90,7 @@ main (int argc, char *argv[])
|
||||
wifi.SetRemoteStationManager ("ns3::AarfWifiManager");
|
||||
|
||||
NqosWifiMacHelper mac = NqosWifiMacHelper::Default ();
|
||||
|
||||
|
||||
Ssid ssid = Ssid ("ns-3-ssid");
|
||||
mac.SetType ("ns3::StaWifiMac",
|
||||
"Ssid", SsidValue (ssid),
|
||||
@@ -108,15 +108,15 @@ main (int argc, char *argv[])
|
||||
MobilityHelper mobility;
|
||||
|
||||
mobility.SetPositionAllocator ("ns3::GridPositionAllocator",
|
||||
"MinX", DoubleValue (0.0),
|
||||
"MinY", DoubleValue (0.0),
|
||||
"DeltaX", DoubleValue (5.0),
|
||||
"DeltaY", DoubleValue (10.0),
|
||||
"GridWidth", UintegerValue (3),
|
||||
"LayoutType", StringValue ("RowFirst"));
|
||||
"MinX", DoubleValue (0.0),
|
||||
"MinY", DoubleValue (0.0),
|
||||
"DeltaX", DoubleValue (5.0),
|
||||
"DeltaY", DoubleValue (10.0),
|
||||
"GridWidth", UintegerValue (3),
|
||||
"LayoutType", StringValue ("RowFirst"));
|
||||
|
||||
mobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel",
|
||||
"Bounds", RectangleValue (Rectangle (-50, 50, -50, 50)));
|
||||
"Bounds", RectangleValue (Rectangle (-50, 50, -50, 50)));
|
||||
mobility.Install (wifiStaNodes);
|
||||
|
||||
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
//
|
||||
// This ns-3 example demonstrates the use of helper functions to ease
|
||||
// the construction of simulation scenarios.
|
||||
// the construction of simulation scenarios.
|
||||
//
|
||||
// The simulation topology consists of a mixed wired and wireless
|
||||
// scenario in which a hierarchical mobility model is used.
|
||||
@@ -27,7 +27,7 @@
|
||||
// Each backbone router also has a local 802.11 network and is connected
|
||||
// to a local LAN. An additional set of (K-1) nodes are connected to
|
||||
// this backbone. Finally, a local LAN is connected to each router
|
||||
// on the backbone, with L-1 additional hosts.
|
||||
// on the backbone, with L-1 additional hosts.
|
||||
//
|
||||
// The nodes are populated with TCP/IP stacks, and OLSR unicast routing
|
||||
// on the backbone. An example UDP transfer is shown. The simulator
|
||||
@@ -178,7 +178,7 @@ main (int argc, char *argv[])
|
||||
|
||||
//
|
||||
// The ad-hoc network nodes need a mobility model so we aggregate one to
|
||||
// each of the nodes we just finished building.
|
||||
// each of the nodes we just finished building.
|
||||
//
|
||||
MobilityHelper mobility;
|
||||
Ptr<ListPositionAllocator> positionAlloc =
|
||||
@@ -225,7 +225,7 @@ main (int argc, char *argv[])
|
||||
//
|
||||
CsmaHelper csma;
|
||||
csma.SetChannelAttribute ("DataRate",
|
||||
DataRateValue (DataRate (5000000)));
|
||||
DataRateValue (DataRate (5000000)));
|
||||
csma.SetChannelAttribute ("Delay", TimeValue (MilliSeconds (2)));
|
||||
NetDeviceContainer lanDevices = csma.Install (lan);
|
||||
//
|
||||
@@ -330,7 +330,7 @@ main (int argc, char *argv[])
|
||||
|
||||
// The below global routing does not take into account wireless effects.
|
||||
// However, it is useful for setting default routes for all of the nodes
|
||||
// such as the LAN nodes.
|
||||
// such as the LAN nodes.
|
||||
NS_LOG_INFO ("Enabling global routing on all nodes");
|
||||
Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
|
||||
|
||||
@@ -354,10 +354,10 @@ main (int argc, char *argv[])
|
||||
NS_ASSERT (lanNodes > 1 && infraNodes > 1);
|
||||
// We want the source to be the first node created outside of the backbone
|
||||
// Conveniently, the variable "backboneNodes" holds this node index value
|
||||
Ptr<Node> appSource = NodeList::GetNode (backboneNodes);
|
||||
// We want the sink to be the last node created in the topology.
|
||||
Ptr<Node> appSource = NodeList::GetNode (backboneNodes);
|
||||
// We want the sink to be the last node created in the topology.
|
||||
uint32_t lastNodeIndex = backboneNodes + backboneNodes*(lanNodes - 1) + backboneNodes*(infraNodes - 1) - 1;
|
||||
Ptr<Node> appSink = NodeList::GetNode (lastNodeIndex);
|
||||
Ptr<Node> appSink = NodeList::GetNode (lastNodeIndex);
|
||||
// Let's fetch the IP address of the last node, which is on Ipv4Interface 1
|
||||
Ipv4Address remoteAddr = appSink->GetObject<Ipv4> ()->GetAddress(1, 0).GetLocal ();
|
||||
|
||||
@@ -383,17 +383,17 @@ main (int argc, char *argv[])
|
||||
|
||||
NS_LOG_INFO ("Configure Tracing.");
|
||||
if (enableTracing == true)
|
||||
{
|
||||
{
|
||||
CsmaHelper csma;
|
||||
|
||||
//
|
||||
// Let's set up some ns-2-like ascii traces, using another helper class
|
||||
//
|
||||
AsciiTraceHelper ascii;
|
||||
Ptr<OutputStreamWrapper> stream = ascii.CreateFileStream ("mixed-wireless.tr");
|
||||
wifiPhy.EnableAsciiAll (stream);
|
||||
csma.EnableAsciiAll (stream);
|
||||
internet.EnableAsciiIpv4All (stream);
|
||||
//
|
||||
// Let's set up some ns-2-like ascii traces, using another helper class
|
||||
//
|
||||
AsciiTraceHelper ascii;
|
||||
Ptr<OutputStreamWrapper> stream = ascii.CreateFileStream ("mixed-wireless.tr");
|
||||
wifiPhy.EnableAsciiAll (stream);
|
||||
csma.EnableAsciiAll (stream);
|
||||
internet.EnableAsciiIpv4All (stream);
|
||||
|
||||
// Let's do a pcap trace on the application source and sink, ifIndex 0
|
||||
// Csma captures in non-promiscuous mode
|
||||
@@ -420,6 +420,6 @@ main (int argc, char *argv[])
|
||||
|
||||
NS_LOG_INFO ("Run Simulation.");
|
||||
Simulator::Stop (Seconds (stopTime));
|
||||
Simulator::Run ();
|
||||
Simulator::Run ();
|
||||
Simulator::Destroy ();
|
||||
}
|
||||
|
||||
@@ -78,15 +78,15 @@ public:
|
||||
const NqosWifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel, const MobilityHelper &mobility);
|
||||
|
||||
bool CommandSetup (int argc, char **argv);
|
||||
bool IsRouting () { return (enableRouting == 1) ? 1:0; }
|
||||
bool IsMobility () { return (enableMobility == 1) ? 1:0; }
|
||||
bool IsRouting () { return (enableRouting == 1) ? 1 : 0; }
|
||||
bool IsMobility () { return (enableMobility == 1) ? 1 : 0; }
|
||||
|
||||
uint32_t GetScenario () {return scenario; }
|
||||
uint32_t GetScenario () { return scenario; }
|
||||
|
||||
std::string GetRtsThreshold () { return rtsThreshold; }
|
||||
std::string GetOutputFileName () { return outputFileName; }
|
||||
std::string GetRateManager () { return rateManager; }
|
||||
|
||||
|
||||
private:
|
||||
|
||||
Vector GetPosition (Ptr<Node> node);
|
||||
@@ -123,19 +123,20 @@ private:
|
||||
};
|
||||
|
||||
Experiment::Experiment ()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
Experiment::Experiment (std::string name) :
|
||||
Experiment::Experiment (std::string name) :
|
||||
m_output (name),
|
||||
totalTime (0.3),
|
||||
totalTime (0.3),
|
||||
expMean (0.1), //flows being exponentially distributed
|
||||
bytesTotal(0),
|
||||
packetSize (2000),
|
||||
gridSize (10), //10x10 grid for a total of 100 nodes
|
||||
nodeDistance (30),
|
||||
port (5000),
|
||||
scenario (4),
|
||||
enablePcap (false),
|
||||
scenario (4),
|
||||
enablePcap (false),
|
||||
enableTracing (true),
|
||||
enableFlowMon (false),
|
||||
enableRouting (false),
|
||||
@@ -164,9 +165,9 @@ Experiment::ReceivePacket (Ptr<Socket> socket)
|
||||
{
|
||||
Ptr<Packet> packet;
|
||||
while (packet = socket->Recv ())
|
||||
{
|
||||
bytesTotal += packet->GetSize();
|
||||
}
|
||||
{
|
||||
bytesTotal += packet->GetSize();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -202,31 +203,31 @@ Experiment::AssignNeighbors (NodeContainer c)
|
||||
if ( (i % gridSize) <= (gridSize/2 - 1))
|
||||
{
|
||||
//lower left quadrant
|
||||
if ( i < totalNodes/2 )
|
||||
{
|
||||
containerA.Add(c.Get(i));
|
||||
if ( i < totalNodes/2 )
|
||||
{
|
||||
containerA.Add(c.Get(i));
|
||||
}
|
||||
|
||||
|
||||
//upper left quadrant
|
||||
if ( i >= (uint32_t)(4*totalNodes)/10 )
|
||||
{
|
||||
containerC.Add(c.Get(i));
|
||||
{
|
||||
containerC.Add(c.Get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( (i % gridSize) >= (gridSize/2 - 1))
|
||||
{
|
||||
//lower right quadrant
|
||||
if ( i < totalNodes/2 )
|
||||
{
|
||||
containerB.Add(c.Get(i));
|
||||
if ( i < totalNodes/2 )
|
||||
{
|
||||
containerB.Add(c.Get(i));
|
||||
}
|
||||
|
||||
//upper right quadrant
|
||||
if ( i >= (uint32_t)(4*totalNodes)/10 )
|
||||
{
|
||||
containerD.Add(c.Get(i));
|
||||
{
|
||||
containerD.Add(c.Get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -238,7 +239,7 @@ NodeContainer
|
||||
Experiment::GenerateNeighbors (NodeContainer c, uint32_t senderId)
|
||||
{
|
||||
NodeContainer nc;
|
||||
uint32_t limit = senderId + 2;
|
||||
uint32_t limit = senderId + 2;
|
||||
for (uint32_t i= senderId - 2; i <= limit; i++)
|
||||
{
|
||||
//must ensure the boundaries for other topologies
|
||||
@@ -265,7 +266,7 @@ Experiment::SelectSrcDest (NodeContainer c)
|
||||
|
||||
for (uint32_t i=0; i < totalNodes/3; i++)
|
||||
{
|
||||
ApplicationSetup (c.Get(uvSrc.RandomVariable::GetInteger()), c.Get(uvDest.RandomVariable::GetInteger()) , 0, totalTime);
|
||||
ApplicationSetup (c.Get(uvSrc.RandomVariable::GetInteger()), c.Get(uvDest.RandomVariable::GetInteger()), 0, totalTime);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,9 +296,9 @@ Experiment::SendMultiDestinations(Ptr<Node> sender, NodeContainer c)
|
||||
|
||||
do {
|
||||
destIndex = (uint32_t) uv.GetValue();
|
||||
} while ( (c.Get(destIndex))->GetId () == sender->GetId ());
|
||||
|
||||
ApplicationSetup (sender, c.Get(destIndex) , start, stop);
|
||||
} while ( (c.Get(destIndex))->GetId () == sender->GetId ());
|
||||
|
||||
ApplicationSetup (sender, c.Get(destIndex), start, stop);
|
||||
|
||||
start = stop;
|
||||
|
||||
@@ -325,15 +326,15 @@ Experiment::ApplicationSetup (Ptr<Node> client, Ptr<Node> server, double start,
|
||||
Ipv4Address ipv4AddrClient = iaddrClient.GetLocal ();
|
||||
|
||||
NS_LOG_DEBUG("Set up Server Device " << (server->GetDevice(0))->GetAddress ()
|
||||
<< " with ip " << ipv4AddrServer
|
||||
<< " position (" << serverPos.x << "," << serverPos.y << "," << serverPos.z << ")");
|
||||
<< " with ip " << ipv4AddrServer
|
||||
<< " position (" << serverPos.x << "," << serverPos.y << "," << serverPos.z << ")");
|
||||
|
||||
NS_LOG_DEBUG("Set up Client Device " << (client->GetDevice(0))->GetAddress ()
|
||||
<< " with ip " << ipv4AddrClient
|
||||
<< " position (" << clientPos.x << "," << clientPos.y << "," << clientPos.z << ")"
|
||||
<< "\n");
|
||||
<< " with ip " << ipv4AddrClient
|
||||
<< " position (" << clientPos.x << "," << clientPos.y << "," << clientPos.z << ")"
|
||||
<< "\n");
|
||||
|
||||
|
||||
|
||||
// Equipping the source node with OnOff Application used for sending
|
||||
OnOffHelper onoff ("ns3::UdpSocketFactory", Address(InetSocketAddress(Ipv4Address("10.0.0.1"), port)));
|
||||
onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
|
||||
@@ -371,7 +372,7 @@ Experiment::Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy,
|
||||
Ipv4StaticRoutingHelper staticRouting;
|
||||
|
||||
Ipv4ListRoutingHelper list;
|
||||
|
||||
|
||||
if (enableRouting)
|
||||
{
|
||||
list.Add (staticRouting, 0);
|
||||
@@ -392,15 +393,15 @@ Experiment::Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy,
|
||||
|
||||
Ipv4InterfaceContainer ipInterfaces;
|
||||
ipInterfaces = address.Assign(devices);
|
||||
|
||||
|
||||
MobilityHelper mobil= mobility;
|
||||
mobil.SetPositionAllocator ("ns3::GridPositionAllocator",
|
||||
"MinX", DoubleValue (0.0),
|
||||
"MinY", DoubleValue (0.0),
|
||||
"DeltaX", DoubleValue (nodeDistance),
|
||||
"DeltaY", DoubleValue (nodeDistance),
|
||||
"GridWidth", UintegerValue (gridSize),
|
||||
"LayoutType", StringValue ("RowFirst"));
|
||||
"MinX", DoubleValue (0.0),
|
||||
"MinY", DoubleValue (0.0),
|
||||
"DeltaX", DoubleValue (nodeDistance),
|
||||
"DeltaY", DoubleValue (nodeDistance),
|
||||
"GridWidth", UintegerValue (gridSize),
|
||||
"LayoutType", StringValue ("RowFirst"));
|
||||
|
||||
mobil.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
|
||||
|
||||
@@ -506,7 +507,7 @@ Experiment::Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy,
|
||||
}
|
||||
|
||||
Simulator::Destroy ();
|
||||
|
||||
|
||||
return m_output;
|
||||
}
|
||||
|
||||
@@ -552,7 +553,7 @@ int main (int argc, char *argv[])
|
||||
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
|
||||
YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
|
||||
Ssid ssid = Ssid ("Testbed");
|
||||
|
||||
|
||||
wifiMac.SetType ("ns3::AdhocWifiMac",
|
||||
"Ssid", SsidValue(ssid));
|
||||
wifi.SetStandard (WIFI_PHY_STANDARD_holland);
|
||||
|
||||
@@ -49,7 +49,7 @@ int main (int argc, char *argv[])
|
||||
LogComponentEnable ("MsduAggregator", LOG_LEVEL_INFO);
|
||||
LogComponentEnable ("UdpEchoClientApplication", LOG_LEVEL_INFO);
|
||||
LogComponentEnable ("UdpEchoServerApplication", LOG_LEVEL_INFO);
|
||||
|
||||
|
||||
uint32_t nWifi = 1;
|
||||
CommandLine cmd;
|
||||
cmd.AddValue ("nWifi", "Number of wifi STA devices", nWifi);
|
||||
@@ -73,15 +73,15 @@ int main (int argc, char *argv[])
|
||||
"Ssid", SsidValue (ssid),
|
||||
"ActiveProbing", BooleanValue (false));
|
||||
mac.SetMsduAggregatorForAc (AC_BE, "ns3::MsduStandardAggregator",
|
||||
"MaxAmsduSize", UintegerValue (3839));
|
||||
|
||||
"MaxAmsduSize", UintegerValue (3839));
|
||||
|
||||
NetDeviceContainer staDevices;
|
||||
staDevices = wifi.Install (phy, mac, wifiNodes);
|
||||
|
||||
|
||||
mac.SetType ("ns3::ApWifiMac",
|
||||
"Ssid", SsidValue (ssid));
|
||||
mac.SetMsduAggregatorForAc (AC_BE, "ns3::MsduStandardAggregator",
|
||||
"MaxAmsduSize", UintegerValue (7935));
|
||||
"MaxAmsduSize", UintegerValue (7935));
|
||||
|
||||
NetDeviceContainer apDevice;
|
||||
apDevice = wifi.Install (phy, mac, wifiApNode);
|
||||
@@ -90,20 +90,20 @@ int main (int argc, char *argv[])
|
||||
MobilityHelper mobility;
|
||||
|
||||
mobility.SetPositionAllocator ("ns3::GridPositionAllocator",
|
||||
"MinX", DoubleValue (0.0),
|
||||
"MinY", DoubleValue (0.0),
|
||||
"DeltaX", DoubleValue (5.0),
|
||||
"DeltaY", DoubleValue (10.0),
|
||||
"GridWidth", UintegerValue (3),
|
||||
"LayoutType", StringValue ("RowFirst"));
|
||||
"MinX", DoubleValue (0.0),
|
||||
"MinY", DoubleValue (0.0),
|
||||
"DeltaX", DoubleValue (5.0),
|
||||
"DeltaY", DoubleValue (10.0),
|
||||
"GridWidth", UintegerValue (3),
|
||||
"LayoutType", StringValue ("RowFirst"));
|
||||
|
||||
mobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel",
|
||||
"Bounds", RectangleValue (Rectangle (-50, 50, -50, 50)));
|
||||
"Bounds", RectangleValue (Rectangle (-50, 50, -50, 50)));
|
||||
mobility.Install (wifiNodes);
|
||||
|
||||
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
|
||||
mobility.Install (wifiApNode);
|
||||
|
||||
|
||||
/* Internet stack*/
|
||||
InternetStackHelper stack;
|
||||
stack.Install (wifiApNode);
|
||||
@@ -114,10 +114,10 @@ int main (int argc, char *argv[])
|
||||
address.SetBase ("192.168.1.0", "255.255.255.0");
|
||||
Ipv4InterfaceContainer wifiNodesInterfaces;
|
||||
Ipv4InterfaceContainer apNodeInterface;
|
||||
|
||||
|
||||
wifiNodesInterfaces = address.Assign (staDevices);
|
||||
apNodeInterface = address.Assign (apDevice);
|
||||
|
||||
|
||||
/* Setting applications */
|
||||
UdpEchoServerHelper echoServer (9);
|
||||
|
||||
@@ -138,12 +138,12 @@ int main (int argc, char *argv[])
|
||||
Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
|
||||
|
||||
Simulator::Stop (Seconds (10.0));
|
||||
|
||||
|
||||
phy.EnablePcap ("test-802.11n",
|
||||
wifiNodes.Get (nWifi - 1)->GetId (), 0);
|
||||
wifiNodes.Get (nWifi - 1)->GetId (), 0);
|
||||
|
||||
Simulator::Run ();
|
||||
Simulator::Destroy ();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ int main (int argc, char *argv[])
|
||||
cmd.AddValue ("verbose", "Print trace information if true", g_verbose);
|
||||
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
|
||||
Packet::EnablePrinting ();
|
||||
|
||||
// enable rts cts all the time.
|
||||
@@ -186,7 +186,7 @@ int main (int argc, char *argv[])
|
||||
Config::Connect ("/NodeList/*/DeviceList/*/Phy/State/RxError", MakeCallback (&PhyRxErrorTrace));
|
||||
Config::Connect ("/NodeList/*/DeviceList/*/Phy/State/Tx", MakeCallback (&PhyTxTrace));
|
||||
Config::Connect ("/NodeList/*/DeviceList/*/Phy/State/State", MakeCallback (&PhyStateTrace));
|
||||
|
||||
|
||||
AthstatsHelper athstats;
|
||||
athstats.EnableAthstats("athstats-sta", stas);
|
||||
athstats.EnableAthstats("athstats-ap", ap);
|
||||
|
||||
@@ -58,7 +58,7 @@ int main (int argc, char const* argv[])
|
||||
|
||||
Ptr<Node> sta = CreateObject<Node> ();
|
||||
Ptr<Node> ap = CreateObject<Node> ();
|
||||
|
||||
|
||||
YansWifiChannelHelper channel = YansWifiChannelHelper::Default ();
|
||||
YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
|
||||
phy.SetChannel (channel.Create ());
|
||||
@@ -69,9 +69,9 @@ int main (int argc, char const* argv[])
|
||||
wifi.SetRemoteStationManager ("ns3::AarfWifiManager", "FragmentationThreshold", UintegerValue (2500));
|
||||
|
||||
Ssid ssid ("My-network");
|
||||
|
||||
|
||||
mac.SetType ("ns3::StaWifiMac",
|
||||
"Ssid" , SsidValue (ssid),
|
||||
"Ssid", SsidValue (ssid),
|
||||
"ActiveProbing", BooleanValue (false));
|
||||
/* setting blockack threshold for sta's BE queue */
|
||||
mac.SetBlockAckThresholdForAc (AC_BE, 2);
|
||||
@@ -83,20 +83,20 @@ int main (int argc, char const* argv[])
|
||||
"Ssid", SsidValue (ssid));
|
||||
mac.SetBlockAckThresholdForAc (AC_BE, 0);
|
||||
NetDeviceContainer apDevice = wifi.Install (phy, mac, ap);
|
||||
|
||||
|
||||
/* Setting mobility model */
|
||||
MobilityHelper mobility;
|
||||
|
||||
mobility.SetPositionAllocator ("ns3::GridPositionAllocator",
|
||||
"MinX", DoubleValue (0.0),
|
||||
"MinY", DoubleValue (0.0),
|
||||
"DeltaX", DoubleValue (5.0),
|
||||
"DeltaY", DoubleValue (10.0),
|
||||
"GridWidth", UintegerValue (3),
|
||||
"LayoutType", StringValue ("RowFirst"));
|
||||
"MinX", DoubleValue (0.0),
|
||||
"MinY", DoubleValue (0.0),
|
||||
"DeltaX", DoubleValue (5.0),
|
||||
"DeltaY", DoubleValue (10.0),
|
||||
"GridWidth", UintegerValue (3),
|
||||
"LayoutType", StringValue ("RowFirst"));
|
||||
|
||||
mobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel",
|
||||
"Bounds", RectangleValue (Rectangle (-50, 50, -50, 50)));
|
||||
"Bounds", RectangleValue (Rectangle (-50, 50, -50, 50)));
|
||||
mobility.Install (sta);
|
||||
|
||||
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
|
||||
@@ -106,7 +106,7 @@ int main (int argc, char const* argv[])
|
||||
InternetStackHelper stack;
|
||||
stack.Install (sta);
|
||||
stack.Install (ap);
|
||||
|
||||
|
||||
Ipv4AddressHelper address;
|
||||
|
||||
address.SetBase ("192.168.1.0", "255.255.255.0");
|
||||
@@ -116,7 +116,7 @@ int main (int argc, char const* argv[])
|
||||
apIf = address.Assign (apDevice);
|
||||
|
||||
/* Setting applications */
|
||||
|
||||
|
||||
uint16_t port = 9;
|
||||
|
||||
DataRate dataRate ("1Mb/s");
|
||||
|
||||
@@ -107,7 +107,7 @@ int main (int argc, char *argv[])
|
||||
cmd.AddValue ("numPackets", "number of packets generated", numPackets);
|
||||
cmd.AddValue ("interval", "interval (seconds) between packets", interval);
|
||||
cmd.AddValue ("verbose", "turn on all WifiNetDevice log components", verbose);
|
||||
|
||||
|
||||
cmd.Parse (argc, argv);
|
||||
// Convert to time object
|
||||
Time interPacketInterval = Seconds (interval);
|
||||
@@ -149,7 +149,7 @@ int main (int argc, char *argv[])
|
||||
NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default ();
|
||||
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
|
||||
"DataMode",StringValue(phyMode),
|
||||
"ControlMode",StringValue(phyMode));
|
||||
"ControlMode",StringValue(phyMode));
|
||||
|
||||
// Setup the rest of the upper mac
|
||||
Ssid ssid = Ssid ("wifi-default");
|
||||
@@ -196,7 +196,7 @@ int main (int argc, char *argv[])
|
||||
|
||||
// Tracing
|
||||
wifiPhy.EnablePcap ("wifi-simple-infra", devices);
|
||||
|
||||
|
||||
// Output what we are doing
|
||||
NS_LOG_UNCOND ("Testing " << numPackets << " packets sent with receiver rss " << rss );
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
// WIFI STA WIFI STA WIFI STA WIFI STA
|
||||
// -------- -------- -------- --------
|
||||
// ((*)) ((*)) | ((*)) ((*))
|
||||
// |
|
||||
// |
|
||||
// ((*)) | ((*))
|
||||
// ------- -------
|
||||
// WIFI AP CSMA ========= CSMA WIFI AP
|
||||
@@ -38,9 +38,9 @@
|
||||
// BRIDGE BRIDGE
|
||||
// ############## ##############
|
||||
// 192.168.0.1 192.168.0.2
|
||||
// +---------+ +---------+
|
||||
// +---------+ +---------+
|
||||
// | AP Node | | AP Node |
|
||||
// +---------+ +---------+
|
||||
// +---------+ +---------+
|
||||
//
|
||||
|
||||
#include "ns3/core-module.h"
|
||||
@@ -116,12 +116,12 @@ int main (int argc, char *argv[])
|
||||
|
||||
sta.Create (nStas);
|
||||
mobility.SetPositionAllocator ("ns3::GridPositionAllocator",
|
||||
"MinX", DoubleValue (wifiX),
|
||||
"MinY", DoubleValue (0.0),
|
||||
"DeltaX", DoubleValue (5.0),
|
||||
"DeltaY", DoubleValue (5.0),
|
||||
"GridWidth", UintegerValue (1),
|
||||
"LayoutType", StringValue ("RowFirst"));
|
||||
"MinX", DoubleValue (wifiX),
|
||||
"MinY", DoubleValue (0.0),
|
||||
"DeltaX", DoubleValue (5.0),
|
||||
"DeltaY", DoubleValue (5.0),
|
||||
"GridWidth", UintegerValue (1),
|
||||
"LayoutType", StringValue ("RowFirst"));
|
||||
|
||||
|
||||
// setup the AP.
|
||||
@@ -140,10 +140,10 @@ int main (int argc, char *argv[])
|
||||
// setup the STAs
|
||||
stack.Install (sta);
|
||||
mobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel",
|
||||
"Mode", StringValue ("Time"),
|
||||
"Time", StringValue ("2s"),
|
||||
"Speed", StringValue ("Constant:1.0"),
|
||||
"Bounds", RectangleValue (Rectangle (wifiX, wifiX+5.0,0.0, (nStas+1)*5.0)));
|
||||
"Mode", StringValue ("Time"),
|
||||
"Time", StringValue ("2s"),
|
||||
"Speed", StringValue ("Constant:1.0"),
|
||||
"Bounds", RectangleValue (Rectangle (wifiX, wifiX+5.0,0.0, (nStas+1)*5.0)));
|
||||
mobility.Install (sta);
|
||||
wifiMac.SetType ("ns3::StaWifiMac",
|
||||
"Ssid", SsidValue (ssid),
|
||||
@@ -184,7 +184,7 @@ int main (int argc, char *argv[])
|
||||
ApplicationContainer apps = onoff.Install (staNodes[0].Get (0));
|
||||
apps.Start (Seconds (0.5));
|
||||
apps.Stop (Seconds (3.0));
|
||||
|
||||
|
||||
wifiPhy.EnablePcap ("wifi-wired-bridging", apDevices[0]);
|
||||
wifiPhy.EnablePcap ("wifi-wired-bridging", apDevices[1]);
|
||||
|
||||
|
||||
@@ -32,26 +32,26 @@ AirtimeLinkMetricCalculator::GetTypeId ()
|
||||
.AddConstructor<AirtimeLinkMetricCalculator> ()
|
||||
.AddAttribute ( "TestLength",
|
||||
"Rate should be estimated using test length.",
|
||||
UintegerValue (1024),
|
||||
MakeUintegerAccessor (
|
||||
&AirtimeLinkMetricCalculator::SetTestLength),
|
||||
MakeUintegerChecker<uint16_t> (1)
|
||||
)
|
||||
UintegerValue (1024),
|
||||
MakeUintegerAccessor (
|
||||
&AirtimeLinkMetricCalculator::SetTestLength),
|
||||
MakeUintegerChecker<uint16_t> (1)
|
||||
)
|
||||
.AddAttribute ( "Dot11MetricTid",
|
||||
"TID used to calculate metric (data rate)",
|
||||
UintegerValue (0),
|
||||
MakeUintegerAccessor (
|
||||
&AirtimeLinkMetricCalculator::SetHeaderTid),
|
||||
&AirtimeLinkMetricCalculator::SetHeaderTid),
|
||||
MakeUintegerChecker<uint8_t> (0)
|
||||
)
|
||||
)
|
||||
.AddAttribute ( "Dot11sMeshHeaderLength",
|
||||
"Length of the mesh header",
|
||||
UintegerValue (6),
|
||||
MakeUintegerAccessor (
|
||||
&AirtimeLinkMetricCalculator::m_meshHeaderLength),
|
||||
&AirtimeLinkMetricCalculator::m_meshHeaderLength),
|
||||
MakeUintegerChecker<uint16_t> (0)
|
||||
)
|
||||
;
|
||||
)
|
||||
;
|
||||
return tid;
|
||||
}
|
||||
AirtimeLinkMetricCalculator::AirtimeLinkMetricCalculator () :
|
||||
@@ -69,7 +69,7 @@ AirtimeLinkMetricCalculator::SetHeaderTid (uint8_t tid)
|
||||
void
|
||||
AirtimeLinkMetricCalculator::SetTestLength (uint16_t testLength)
|
||||
{
|
||||
m_testFrame = Create<Packet> (testLength + 6 /*Mesh header*/ + 36/*802.11 header*/);
|
||||
m_testFrame = Create<Packet> (testLength + 6 /*Mesh header*/ + 36 /*802.11 header*/);
|
||||
}
|
||||
uint32_t
|
||||
AirtimeLinkMetricCalculator::CalculateMetric (Mac48Address peerAddress, Ptr<MeshWifiInterfaceMac> mac)
|
||||
@@ -91,10 +91,10 @@ AirtimeLinkMetricCalculator::CalculateMetric (Mac48Address peerAddress, Ptr<Mesh
|
||||
double failAvg = mac->GetWifiRemoteStationManager ()->GetInfo (peerAddress).GetFrameErrorRate ();
|
||||
NS_ASSERT (failAvg < 1.0);
|
||||
//calculate metric
|
||||
uint32_t metric = (uint32_t)((double)(/*Overhead + payload*/
|
||||
mac->GetPifs () + mac->GetSlot () + mac->GetEifsNoDifs () + //DIFS + SIFS + AckTxTime = PIFS + SLOT + EifsNoDifs
|
||||
mac->GetWifiPhy () ->CalculateTxDuration (m_testFrame->GetSize (), mode, WIFI_PREAMBLE_LONG)
|
||||
).GetMicroSeconds () / (10.24 * (1.0 - failAvg)));
|
||||
uint32_t metric = (uint32_t)((double)( /*Overhead + payload*/
|
||||
mac->GetPifs () + mac->GetSlot () + mac->GetEifsNoDifs () + //DIFS + SIFS + AckTxTime = PIFS + SLOT + EifsNoDifs
|
||||
mac->GetWifiPhy ()->CalculateTxDuration (m_testFrame->GetSize (), mode, WIFI_PREAMBLE_LONG)
|
||||
).GetMicroSeconds () / (10.24 * (1.0 - failAvg)));
|
||||
return metric;
|
||||
}
|
||||
} //namespace dot11s
|
||||
|
||||
@@ -45,31 +45,31 @@ TypeId
|
||||
MeshWifiInterfaceMac::GetTypeId ()
|
||||
{
|
||||
static TypeId tid = TypeId ("ns3::MeshWifiInterfaceMac")
|
||||
.SetParent<RegularWifiMac> ()
|
||||
.AddConstructor<MeshWifiInterfaceMac> ()
|
||||
.AddAttribute ( "BeaconInterval",
|
||||
"Beacon Interval",
|
||||
TimeValue (Seconds (0.5)),
|
||||
.SetParent<RegularWifiMac> ()
|
||||
.AddConstructor<MeshWifiInterfaceMac> ()
|
||||
.AddAttribute ( "BeaconInterval",
|
||||
"Beacon Interval",
|
||||
TimeValue (Seconds (0.5)),
|
||||
|
||||
MakeTimeAccessor (
|
||||
MakeTimeAccessor (
|
||||
&MeshWifiInterfaceMac::m_beaconInterval),
|
||||
MakeTimeChecker ()
|
||||
)
|
||||
.AddAttribute ( "RandomStart",
|
||||
"Window when beacon generating starts (uniform random) in seconds",
|
||||
TimeValue (Seconds (0.5)),
|
||||
MakeTimeAccessor (
|
||||
MakeTimeChecker ()
|
||||
)
|
||||
.AddAttribute ( "RandomStart",
|
||||
"Window when beacon generating starts (uniform random) in seconds",
|
||||
TimeValue (Seconds (0.5)),
|
||||
MakeTimeAccessor (
|
||||
&MeshWifiInterfaceMac::m_randomStart),
|
||||
MakeTimeChecker ()
|
||||
)
|
||||
.AddAttribute ( "BeaconGeneration",
|
||||
"Enable/Disable Beaconing.",
|
||||
BooleanValue (true),
|
||||
MakeBooleanAccessor (
|
||||
MakeTimeChecker ()
|
||||
)
|
||||
.AddAttribute ( "BeaconGeneration",
|
||||
"Enable/Disable Beaconing.",
|
||||
BooleanValue (true),
|
||||
MakeBooleanAccessor (
|
||||
&MeshWifiInterfaceMac::SetBeaconGeneration, &MeshWifiInterfaceMac::GetBeaconGeneration),
|
||||
MakeBooleanChecker ()
|
||||
)
|
||||
;
|
||||
MakeBooleanChecker ()
|
||||
)
|
||||
;
|
||||
return tid;
|
||||
}
|
||||
MeshWifiInterfaceMac::MeshWifiInterfaceMac () :
|
||||
@@ -364,7 +364,7 @@ MeshWifiInterfaceMac::ShiftTbtt (Time shift)
|
||||
// Shift scheduled event
|
||||
Simulator::Cancel (m_beaconSendEvent);
|
||||
m_beaconSendEvent = Simulator::Schedule (GetTbtt () - Simulator::Now (), &MeshWifiInterfaceMac::SendBeacon,
|
||||
this);
|
||||
this);
|
||||
}
|
||||
void
|
||||
MeshWifiInterfaceMac::ScheduleNextBeacon ()
|
||||
@@ -410,7 +410,7 @@ MeshWifiInterfaceMac::Receive (Ptr<Packet> packet, WifiMacHeader const *hdr)
|
||||
packet->PeekHeader (beacon_hdr);
|
||||
|
||||
NS_LOG_DEBUG ("Beacon received from " << hdr->GetAddr2 () << " I am " << GetAddress () << " at "
|
||||
<< Simulator::Now ().GetMicroSeconds () << " microseconds");
|
||||
<< Simulator::Now ().GetMicroSeconds () << " microseconds");
|
||||
|
||||
// update supported rates
|
||||
if (beacon_hdr.GetSsid ().IsEqual (GetSsid ()))
|
||||
@@ -495,19 +495,19 @@ MeshWifiInterfaceMac::Statistics::Print (std::ostream & os) const
|
||||
{
|
||||
os << "<Statistics "
|
||||
// TODO txBeacons
|
||||
"rxBeacons=\"" << recvBeacons << "\" "
|
||||
"txFrames=\"" << sentFrames << "\" "
|
||||
"txBytes=\"" << sentBytes << "\" "
|
||||
"rxFrames=\"" << recvFrames << "\" "
|
||||
"rxBytes=\"" << recvBytes << "\"/>" << std::endl;
|
||||
"rxBeacons=\"" << recvBeacons << "\" "
|
||||
"txFrames=\"" << sentFrames << "\" "
|
||||
"txBytes=\"" << sentBytes << "\" "
|
||||
"rxFrames=\"" << recvFrames << "\" "
|
||||
"rxBytes=\"" << recvBytes << "\"/>" << std::endl;
|
||||
}
|
||||
void
|
||||
MeshWifiInterfaceMac::Report (std::ostream & os) const
|
||||
{
|
||||
os << "<Interface "
|
||||
"BeaconInterval=\"" << GetBeaconInterval ().GetSeconds () << "\" "
|
||||
"Channel=\"" << GetFrequencyChannel () << "\" "
|
||||
"Address = \"" << GetAddress () << "\">" << std::endl;
|
||||
"BeaconInterval=\"" << GetBeaconInterval ().GetSeconds () << "\" "
|
||||
"Channel=\"" << GetFrequencyChannel () << "\" "
|
||||
"Address = \"" << GetAddress () << "\">" << std::endl;
|
||||
m_stats.Print (os);
|
||||
os << "</Interface>" << std::endl;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ AdhocWifiMac::GetTypeId (void)
|
||||
static TypeId tid = TypeId ("ns3::AdhocWifiMac")
|
||||
.SetParent<RegularWifiMac> ()
|
||||
.AddConstructor<AdhocWifiMac> ()
|
||||
;
|
||||
;
|
||||
return tid;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ ApWifiMac::GetTypeId (void)
|
||||
MakeBooleanAccessor (&ApWifiMac::SetBeaconGeneration,
|
||||
&ApWifiMac::GetBeaconGeneration),
|
||||
MakeBooleanChecker ())
|
||||
;
|
||||
;
|
||||
return tid;
|
||||
}
|
||||
|
||||
|
||||
@@ -99,15 +99,15 @@ private:
|
||||
virtual void TxOk (const WifiMacHeader &hdr);
|
||||
virtual void TxFailed (const WifiMacHeader &hdr);
|
||||
|
||||
/**
|
||||
* This method is called to de-aggregate an A-MSDU and forward the
|
||||
* constituent packets up the stack. We override the WifiMac version
|
||||
* here because, as an AP, we also need to think about redistributing
|
||||
* to other associated STAs.
|
||||
*
|
||||
* \param aggregatedPacket the Packet containing the A-MSDU.
|
||||
* \param hdr a pointer to the MAC header for \c aggregatedPacket.
|
||||
*/
|
||||
/**
|
||||
* This method is called to de-aggregate an A-MSDU and forward the
|
||||
* constituent packets up the stack. We override the WifiMac version
|
||||
* here because, as an AP, we also need to think about redistributing
|
||||
* to other associated STAs.
|
||||
*
|
||||
* \param aggregatedPacket the Packet containing the A-MSDU.
|
||||
* \param hdr a pointer to the MAC header for \c aggregatedPacket.
|
||||
*/
|
||||
virtual void DeaggregateAmsduAndForward (Ptr<Packet> aggregatedPacket,
|
||||
const WifiMacHeader *hdr);
|
||||
|
||||
|
||||
@@ -56,10 +56,10 @@ class MgtDelBaHeader;
|
||||
|
||||
/* This queue contains packets for a particular access class.
|
||||
* possibles access classes are:
|
||||
*
|
||||
*
|
||||
* -AC_VO : voice, tid = 6,7 ^
|
||||
* -AC_VI : video, tid = 4,5 |
|
||||
* -AC_BE : best-effort, tid = 0,3 | priority
|
||||
* -AC_BE : best-effort, tid = 0,3 | priority
|
||||
* -AC_BK : background, tid = 1,2 |
|
||||
*
|
||||
* For more details see section 9.1.3.1 in 802.11 standard.
|
||||
@@ -78,12 +78,12 @@ public:
|
||||
|
||||
typedef Callback <void, const WifiMacHeader&> TxOk;
|
||||
typedef Callback <void, const WifiMacHeader&> TxFailed;
|
||||
|
||||
|
||||
static TypeId GetTypeId (void);
|
||||
EdcaTxopN ();
|
||||
virtual ~EdcaTxopN ();
|
||||
void DoDispose ();
|
||||
|
||||
|
||||
void SetLow (Ptr<MacLow> low);
|
||||
void SetTxMiddle (MacTxMiddle *txMiddle);
|
||||
void SetManager (DcfManager *manager);
|
||||
@@ -139,7 +139,7 @@ public:
|
||||
bool IsLastFragment (void) const;
|
||||
void NextFragment (void);
|
||||
Ptr<Packet> GetFragmentPacket (WifiMacHeader *hdr);
|
||||
|
||||
|
||||
void SetAccessCategory (enum AcIndex ac);
|
||||
void Queue (Ptr<const Packet> packet, const WifiMacHeader &hdr);
|
||||
void SetMsduAggregator (Ptr<MsduAggregator> aggr);
|
||||
@@ -187,7 +187,7 @@ private:
|
||||
* if an established block ack agreement exists with the receiver.
|
||||
*/
|
||||
void VerifyBlockAck (void);
|
||||
|
||||
|
||||
AcIndex m_ac;
|
||||
class Dcf;
|
||||
class TransmissionListener;
|
||||
@@ -206,12 +206,12 @@ private:
|
||||
RandomStream *m_rng;
|
||||
Ptr<WifiRemoteStationManager> m_stationManager;
|
||||
uint8_t m_fragmentNumber;
|
||||
|
||||
|
||||
/* current packet could be a simple MSDU or, if an aggregator for this queue is
|
||||
present, could be an A-MSDU.
|
||||
*/
|
||||
Ptr<const Packet> m_currentPacket;
|
||||
|
||||
|
||||
WifiMacHeader m_currentHdr;
|
||||
Ptr<MsduAggregator> m_aggregator;
|
||||
TypeOfStation m_typeOfStation;
|
||||
|
||||
@@ -638,7 +638,7 @@ private:
|
||||
|
||||
typedef std::map<AgreementKey, BlockAckCache> BlockAckCaches;
|
||||
typedef std::map<AgreementKey, BlockAckCache>::iterator BlockAckCachesI;
|
||||
|
||||
|
||||
Agreements m_bAckAgreements;
|
||||
BlockAckCaches m_bAckCaches;
|
||||
|
||||
|
||||
@@ -392,14 +392,14 @@ RegularWifiMac::GetBssid (void) const
|
||||
|
||||
void
|
||||
RegularWifiMac::Enqueue (Ptr<const Packet> packet,
|
||||
Mac48Address to, Mac48Address from)
|
||||
Mac48Address to, Mac48Address from)
|
||||
{
|
||||
// We expect RegularWifiMac subclasses which do support forwarding (e.g.,
|
||||
// AP) to override this method. Therefore, we throw a fatal error if
|
||||
// someone tries to invoke this method on a class which has not done
|
||||
// this.
|
||||
NS_FATAL_ERROR ("This MAC entity (" << this << ", " << GetAddress ()
|
||||
<< ") does not support Enqueue() with from address");
|
||||
<< ") does not support Enqueue() with from address");
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -619,7 +619,7 @@ RegularWifiMac::GetTypeId (void)
|
||||
.AddTraceSource ("TxErrHeader",
|
||||
"The header of unsuccessfully transmitted packet",
|
||||
MakeTraceSourceAccessor (&RegularWifiMac::m_txErrCallback))
|
||||
;
|
||||
;
|
||||
|
||||
return tid;
|
||||
}
|
||||
|
||||
@@ -274,13 +274,13 @@ protected:
|
||||
|
||||
void ForwardUp (Ptr<Packet> packet, Mac48Address from, Mac48Address to);
|
||||
|
||||
/**
|
||||
* This method can be called to de-aggregate an A-MSDU and forward
|
||||
* the constituent packets up the stack.
|
||||
*
|
||||
* \param aggregatedPacket the Packet containing the A-MSDU.
|
||||
* \param hdr a pointer to the MAC header for \c aggregatedPacket.
|
||||
*/
|
||||
/**
|
||||
* This method can be called to de-aggregate an A-MSDU and forward
|
||||
* the constituent packets up the stack.
|
||||
*
|
||||
* \param aggregatedPacket the Packet containing the A-MSDU.
|
||||
* \param hdr a pointer to the MAC header for \c aggregatedPacket.
|
||||
*/
|
||||
virtual void DeaggregateAmsduAndForward (Ptr<Packet> aggregatedPacket,
|
||||
const WifiMacHeader *hdr);
|
||||
|
||||
|
||||
@@ -50,11 +50,11 @@ NS_LOG_COMPONENT_DEFINE ("StaWifiMac");
|
||||
\ ----------------- -----------------------------
|
||||
\-> | Beacon Missed | --> | Wait Association Response |
|
||||
----------------- -----------------------------
|
||||
\ ^
|
||||
\ |
|
||||
\ -----------------------
|
||||
\-> | Wait Probe Response |
|
||||
-----------------------
|
||||
\ ^
|
||||
\ |
|
||||
\ -----------------------
|
||||
\-> | Wait Probe Response |
|
||||
-----------------------
|
||||
*/
|
||||
|
||||
namespace ns3 {
|
||||
@@ -89,7 +89,7 @@ StaWifiMac::GetTypeId (void)
|
||||
MakeTraceSourceAccessor (&StaWifiMac::m_assocLogger))
|
||||
.AddTraceSource ("DeAssoc", "Association with an access point lost.",
|
||||
MakeTraceSourceAccessor (&StaWifiMac::m_deAssocLogger))
|
||||
;
|
||||
;
|
||||
return tid;
|
||||
}
|
||||
|
||||
@@ -212,39 +212,39 @@ StaWifiMac::TryToEnsureAssociated (void)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
switch (m_state) {
|
||||
case ASSOCIATED:
|
||||
return;
|
||||
break;
|
||||
case WAIT_PROBE_RESP:
|
||||
/* we have sent a probe request earlier so we
|
||||
do not need to re-send a probe request immediately.
|
||||
We just need to wait until probe-request-timeout
|
||||
or until we get a probe response
|
||||
*/
|
||||
break;
|
||||
case BEACON_MISSED:
|
||||
/* we were associated but we missed a bunch of beacons
|
||||
* so we should assume we are not associated anymore.
|
||||
* We try to initiate a probe request now.
|
||||
*/
|
||||
m_linkDown ();
|
||||
SetState (WAIT_PROBE_RESP);
|
||||
SendProbeRequest ();
|
||||
break;
|
||||
case WAIT_ASSOC_RESP:
|
||||
/* we have sent an assoc request so we do not need to
|
||||
re-send an assoc request right now. We just need to
|
||||
wait until either assoc-request-timeout or until
|
||||
we get an assoc response.
|
||||
*/
|
||||
break;
|
||||
case REFUSED:
|
||||
/* we have sent an assoc request and received a negative
|
||||
assoc resp. We wait until someone restarts an
|
||||
association with a given ssid.
|
||||
*/
|
||||
break;
|
||||
}
|
||||
case ASSOCIATED:
|
||||
return;
|
||||
break;
|
||||
case WAIT_PROBE_RESP:
|
||||
/* we have sent a probe request earlier so we
|
||||
do not need to re-send a probe request immediately.
|
||||
We just need to wait until probe-request-timeout
|
||||
or until we get a probe response
|
||||
*/
|
||||
break;
|
||||
case BEACON_MISSED:
|
||||
/* we were associated but we missed a bunch of beacons
|
||||
* so we should assume we are not associated anymore.
|
||||
* We try to initiate a probe request now.
|
||||
*/
|
||||
m_linkDown ();
|
||||
SetState (WAIT_PROBE_RESP);
|
||||
SendProbeRequest ();
|
||||
break;
|
||||
case WAIT_ASSOC_RESP:
|
||||
/* we have sent an assoc request so we do not need to
|
||||
re-send an assoc request right now. We just need to
|
||||
wait until either assoc-request-timeout or until
|
||||
we get an assoc response.
|
||||
*/
|
||||
break;
|
||||
case REFUSED:
|
||||
/* we have sent an assoc request and received a negative
|
||||
assoc resp. We wait until someone restarts an
|
||||
association with a given ssid.
|
||||
*/
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -284,7 +284,7 @@ StaWifiMac::RestartBeaconWatchdog (Time delay)
|
||||
NS_LOG_FUNCTION (this << delay);
|
||||
m_beaconWatchdogEnd = std::max (Simulator::Now () + delay, m_beaconWatchdogEnd);
|
||||
if (Simulator::GetDelayLeft (m_beaconWatchdog) < delay &&
|
||||
m_beaconWatchdog.IsExpired ())
|
||||
m_beaconWatchdog.IsExpired ())
|
||||
{
|
||||
NS_LOG_DEBUG ("really restart watchdog.");
|
||||
m_beaconWatchdog = Simulator::Schedule (delay, &StaWifiMac::MissedBeacons, this);
|
||||
|
||||
@@ -58,16 +58,17 @@ private:
|
||||
|
||||
WifiTest::WifiTest ()
|
||||
: TestCase ("Wifi")
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
WifiTest::SendOnePacket (Ptr<WifiNetDevice> dev)
|
||||
{
|
||||
Ptr<Packet> p = Create<Packet> ();
|
||||
dev->Send (p, dev->GetBroadcast (), 1);
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
WifiTest::CreateOne (Vector pos, Ptr<YansWifiChannel> channel)
|
||||
{
|
||||
Ptr<Node> node = CreateObject<Node> ();
|
||||
@@ -120,7 +121,7 @@ WifiTest::DoRun (void)
|
||||
{
|
||||
m_mac.SetTypeId ("ns3::AdhocWifiMac");
|
||||
m_propDelay.SetTypeId ("ns3::ConstantSpeedPropagationDelayModel");
|
||||
|
||||
|
||||
m_manager.SetTypeId ("ns3::ArfWifiManager");
|
||||
RunOne ();
|
||||
m_manager.SetTypeId ("ns3::AarfWifiManager");
|
||||
@@ -196,9 +197,10 @@ private:
|
||||
|
||||
InterferenceHelperSequenceTest::InterferenceHelperSequenceTest ()
|
||||
: TestCase ("InterferenceHelperSequence")
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
InterferenceHelperSequenceTest::SendOnePacket (Ptr<WifiNetDevice> dev)
|
||||
{
|
||||
Ptr<Packet> p = Create<Packet> (9999);
|
||||
@@ -263,20 +265,20 @@ InterferenceHelperSequenceTest::DoRun (void)
|
||||
propLoss->SetDefaultLoss (999);
|
||||
|
||||
Simulator::Schedule (Seconds (1.0),
|
||||
&InterferenceHelperSequenceTest::SendOnePacket, this,
|
||||
DynamicCast<WifiNetDevice> (senderB->GetDevice (0)));
|
||||
&InterferenceHelperSequenceTest::SendOnePacket, this,
|
||||
DynamicCast<WifiNetDevice> (senderB->GetDevice (0)));
|
||||
|
||||
Simulator::Schedule (Seconds (1.0000001),
|
||||
&InterferenceHelperSequenceTest::SwitchCh, this,
|
||||
DynamicCast<WifiNetDevice> (rxOnly->GetDevice (0)));
|
||||
&InterferenceHelperSequenceTest::SwitchCh, this,
|
||||
DynamicCast<WifiNetDevice> (rxOnly->GetDevice (0)));
|
||||
|
||||
Simulator::Schedule (Seconds (5.0),
|
||||
&InterferenceHelperSequenceTest::SendOnePacket, this,
|
||||
DynamicCast<WifiNetDevice> (senderA->GetDevice (0)));
|
||||
&InterferenceHelperSequenceTest::SendOnePacket, this,
|
||||
DynamicCast<WifiNetDevice> (senderA->GetDevice (0)));
|
||||
|
||||
Simulator::Schedule (Seconds (7.0),
|
||||
&InterferenceHelperSequenceTest::SendOnePacket, this,
|
||||
DynamicCast<WifiNetDevice> (senderB->GetDevice (0)));
|
||||
&InterferenceHelperSequenceTest::SendOnePacket, this,
|
||||
DynamicCast<WifiNetDevice> (senderB->GetDevice (0)));
|
||||
|
||||
Simulator::Stop (Seconds (100.0));
|
||||
Simulator::Run ();
|
||||
|
||||
@@ -26,10 +26,12 @@
|
||||
namespace ns3 {
|
||||
|
||||
NqosWifiMacHelper::NqosWifiMacHelper ()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
NqosWifiMacHelper::~NqosWifiMacHelper ()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
NqosWifiMacHelper
|
||||
NqosWifiMacHelper::Default (void)
|
||||
|
||||
@@ -28,10 +28,12 @@
|
||||
namespace ns3 {
|
||||
|
||||
QosWifiMacHelper::QosWifiMacHelper ()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
QosWifiMacHelper::~QosWifiMacHelper ()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
QosWifiMacHelper
|
||||
QosWifiMacHelper::Default (void)
|
||||
@@ -117,7 +119,7 @@ QosWifiMacHelper::Setup (Ptr<WifiMac> mac, enum AcIndex ac, std::string dcaAttrN
|
||||
PointerValue ptr;
|
||||
mac->GetAttribute (dcaAttrName, ptr);
|
||||
Ptr<EdcaTxopN> edca = ptr.Get<EdcaTxopN> ();
|
||||
|
||||
|
||||
if (it != m_aggregators.end ())
|
||||
{
|
||||
ObjectFactory factory = it->second;
|
||||
@@ -139,7 +141,7 @@ Ptr<WifiMac>
|
||||
QosWifiMacHelper::Create (void) const
|
||||
{
|
||||
Ptr<WifiMac> mac = m_mac.Create<WifiMac> ();
|
||||
|
||||
|
||||
Setup (mac, AC_VO, "VO_EdcaTxopN");
|
||||
Setup (mac, AC_VI, "VI_EdcaTxopN");
|
||||
Setup (mac, AC_BE, "BE_EdcaTxopN");
|
||||
|
||||
@@ -39,14 +39,17 @@ NS_LOG_COMPONENT_DEFINE ("WifiHelper");
|
||||
namespace ns3 {
|
||||
|
||||
WifiPhyHelper::~WifiPhyHelper ()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
WifiMacHelper::~WifiMacHelper ()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
WifiHelper::WifiHelper ()
|
||||
: m_standard (WIFI_PHY_STANDARD_80211a)
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
WifiHelper
|
||||
WifiHelper::Default (void)
|
||||
|
||||
@@ -61,11 +61,11 @@ TcRegressionTest::DoRun ()
|
||||
{
|
||||
SeedManager::SetSeed(12345);
|
||||
CreateNodes ();
|
||||
|
||||
|
||||
Simulator::Stop (m_time);
|
||||
Simulator::Run ();
|
||||
Simulator::Destroy ();
|
||||
|
||||
|
||||
if (!WRITE_VECTORS) CheckResults ();
|
||||
return GetErrorStatus ();
|
||||
}
|
||||
@@ -76,25 +76,25 @@ TcRegressionTest::CreateNodes ()
|
||||
// create 3 nodes
|
||||
NodeContainer c;
|
||||
c.Create (3);
|
||||
|
||||
|
||||
// place nodes in the chain
|
||||
MobilityHelper mobility;
|
||||
mobility.SetPositionAllocator ("ns3::GridPositionAllocator",
|
||||
"MinX", DoubleValue (0.0),
|
||||
"MinY", DoubleValue (0.0),
|
||||
"DeltaX", DoubleValue (m_step),
|
||||
"DeltaY", DoubleValue (0),
|
||||
"GridWidth", UintegerValue (3),
|
||||
"LayoutType", StringValue ("RowFirst"));
|
||||
"MinX", DoubleValue (0.0),
|
||||
"MinY", DoubleValue (0.0),
|
||||
"DeltaX", DoubleValue (m_step),
|
||||
"DeltaY", DoubleValue (0),
|
||||
"GridWidth", UintegerValue (3),
|
||||
"LayoutType", StringValue ("RowFirst"));
|
||||
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
|
||||
mobility.Install (c);
|
||||
|
||||
|
||||
// install TCP/IP & OLSR
|
||||
OlsrHelper olsr;
|
||||
InternetStackHelper internet;
|
||||
internet.SetRoutingHelper (olsr);
|
||||
internet.Install (c);
|
||||
|
||||
|
||||
// create wifi channel & devices
|
||||
NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default ();
|
||||
wifiMac.SetType ("ns3::AdhocWifiMac");
|
||||
@@ -127,11 +127,11 @@ TcRegressionTest::CheckResults ()
|
||||
// File naming conventions are hard-coded here.
|
||||
os1 << NS_TEST_SOURCEDIR << PREFIX << "-" << i << "-1.pcap";
|
||||
os2 << GetTempDir () << PREFIX << "-" << i << "-1.pcap";
|
||||
|
||||
|
||||
uint32_t sec(0), usec(0);
|
||||
bool diff = PcapFile::Diff (os1.str(), os2.str(), sec, usec);
|
||||
NS_TEST_EXPECT_MSG_EQ (diff, false, "PCAP traces " << os1.str() << " and " << os2.str()
|
||||
<< " differ starting from " << sec << " s " << usec << " us");
|
||||
<< " differ starting from " << sec << " s " << usec << " us");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user