|
|
| 64 |
|
64 |
|
| 65 |
NS_LOG_COMPONENT_DEFINE ("SimpleMpduAggregation"); |
65 |
NS_LOG_COMPONENT_DEFINE ("SimpleMpduAggregation"); |
| 66 |
|
66 |
|
|
|
67 |
void |
| 68 |
SetPosition (Ptr<Node> node, Vector position) |
| 69 |
{ |
| 70 |
Ptr<MobilityModel> mobility = node->GetObject<MobilityModel> (); |
| 71 |
mobility->SetPosition (position); |
| 72 |
} |
| 73 |
|
| 74 |
Vector |
| 75 |
GetPosition (Ptr<Node> node) |
| 76 |
{ |
| 77 |
Ptr<MobilityModel> mobility = node->GetObject<MobilityModel> (); |
| 78 |
return mobility->GetPosition (); |
| 79 |
} |
| 80 |
|
| 81 |
void |
| 82 |
AdvancePosition (Ptr<Node> node, int step) |
| 83 |
{ |
| 84 |
Vector pos = GetPosition (node); |
| 85 |
pos.x += step; |
| 86 |
SetPosition (node, pos); |
| 87 |
} |
| 88 |
|
| 67 |
int main (int argc, char *argv[]) |
89 |
int main (int argc, char *argv[]) |
| 68 |
{ |
90 |
{ |
| 69 |
uint32_t payloadSize = 1472; //bytes |
91 |
uint32_t payloadSize = 1472; //bytes |
|
|
| 90 |
|
112 |
|
| 91 |
WifiHelper wifi; |
113 |
WifiHelper wifi; |
| 92 |
wifi.SetStandard (WIFI_PHY_STANDARD_80211n_5GHZ); |
114 |
wifi.SetStandard (WIFI_PHY_STANDARD_80211n_5GHZ); |
| 93 |
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("HtMcs7"), "ControlMode", StringValue ("HtMcs0")); |
115 |
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("HtMcs7"), "ControlMode", StringValue ("HtMcs0"), "RtsCtsThreshold", UintegerValue (0)); |
| 94 |
WifiMacHelper mac; |
116 |
WifiMacHelper mac; |
| 95 |
|
117 |
|
| 96 |
NetDeviceContainer staDeviceA, staDeviceB, staDeviceC, staDeviceD, apDeviceA, apDeviceB, apDeviceC, apDeviceD; |
118 |
NetDeviceContainer staDeviceA, staDeviceB, staDeviceC, staDeviceD, apDeviceA, apDeviceB, apDeviceC, apDeviceD; |
|
|
| 181 |
mobility.SetPositionAllocator (positionAlloc); |
203 |
mobility.SetPositionAllocator (positionAlloc); |
| 182 |
mobility.Install (wifiApNode); |
204 |
mobility.Install (wifiApNode); |
| 183 |
mobility.Install (wifiStaNode); |
205 |
mobility.Install (wifiStaNode); |
|
|
206 |
|
| 207 |
Simulator::Schedule (Seconds (2), &AdvancePosition, wifiStaNode.Get (0), 25); |
| 184 |
|
208 |
|
| 185 |
/* Internet stack */ |
209 |
/* Internet stack */ |
| 186 |
InternetStackHelper stack; |
210 |
InternetStackHelper stack; |