OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2016 Sébastien Deronne | 3 * Copyright (c) 2016 Sébastien Deronne |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 "QosSupported", BooleanValue (true), | 116 "QosSupported", BooleanValue (true), |
117 "Ssid", SsidValue (ssid), | 117 "Ssid", SsidValue (ssid), |
118 "EnableBeaconJitter", BooleanValue (false)); | 118 "EnableBeaconJitter", BooleanValue (false)); |
119 apDeviceB = wifi.Install (phy, mac, wifiApNodes.Get (1)); | 119 apDeviceB = wifi.Install (phy, mac, wifiApNodes.Get (1)); |
120 | 120 |
121 //Modify EDCA configuration (TXOP limit) for AC_BE | 121 //Modify EDCA configuration (TXOP limit) for AC_BE |
122 Ptr<NetDevice> dev = wifiApNodes.Get (1)->GetDevice (0); | 122 Ptr<NetDevice> dev = wifiApNodes.Get (1)->GetDevice (0); |
123 Ptr<WifiNetDevice> wifi_dev = DynamicCast<WifiNetDevice> (dev); | 123 Ptr<WifiNetDevice> wifi_dev = DynamicCast<WifiNetDevice> (dev); |
124 Ptr<WifiMac> wifi_mac = wifi_dev->GetMac (); | 124 Ptr<WifiMac> wifi_mac = wifi_dev->GetMac (); |
125 PointerValue ptr; | 125 PointerValue ptr; |
126 Ptr<EdcaTxopN> edca; | 126 Ptr<QosTxop> edca; |
127 wifi_mac->GetAttribute ("BE_EdcaTxopN", ptr); | 127 wifi_mac->GetAttribute ("BE_Txop", ptr); |
128 edca = ptr.Get<EdcaTxopN> (); | 128 edca = ptr.Get<QosTxop> (); |
129 edca->SetTxopLimit (MicroSeconds (3008)); | 129 edca->SetTxopLimit (MicroSeconds (3008)); |
130 | 130 |
131 //Network C | 131 //Network C |
132 ssid = Ssid ("network-C"); | 132 ssid = Ssid ("network-C"); |
133 phy.Set ("ChannelNumber", UintegerValue (44)); | 133 phy.Set ("ChannelNumber", UintegerValue (44)); |
134 mac.SetType ("ns3::StaWifiMac", | 134 mac.SetType ("ns3::StaWifiMac", |
135 "QosSupported", BooleanValue (true), | 135 "QosSupported", BooleanValue (true), |
136 "Ssid", SsidValue (ssid)); | 136 "Ssid", SsidValue (ssid)); |
137 | 137 |
138 staDeviceC = wifi.Install (phy, mac, wifiStaNodes.Get (2)); | 138 staDeviceC = wifi.Install (phy, mac, wifiStaNodes.Get (2)); |
(...skipping 16 matching lines...) Expand all Loading... |
155 mac.SetType ("ns3::ApWifiMac", | 155 mac.SetType ("ns3::ApWifiMac", |
156 "QosSupported", BooleanValue (true), | 156 "QosSupported", BooleanValue (true), |
157 "Ssid", SsidValue (ssid), | 157 "Ssid", SsidValue (ssid), |
158 "EnableBeaconJitter", BooleanValue (false)); | 158 "EnableBeaconJitter", BooleanValue (false)); |
159 apDeviceD = wifi.Install (phy, mac, wifiApNodes.Get (3)); | 159 apDeviceD = wifi.Install (phy, mac, wifiApNodes.Get (3)); |
160 | 160 |
161 //Modify EDCA configuration (TXOP limit) for AC_VO | 161 //Modify EDCA configuration (TXOP limit) for AC_VO |
162 dev = wifiApNodes.Get (3)->GetDevice (0); | 162 dev = wifiApNodes.Get (3)->GetDevice (0); |
163 wifi_dev = DynamicCast<WifiNetDevice> (dev); | 163 wifi_dev = DynamicCast<WifiNetDevice> (dev); |
164 wifi_mac = wifi_dev->GetMac (); | 164 wifi_mac = wifi_dev->GetMac (); |
165 wifi_mac->GetAttribute ("VI_EdcaTxopN", ptr); | 165 wifi_mac->GetAttribute ("VI_Txop", ptr); |
166 edca = ptr.Get<EdcaTxopN> (); | 166 edca = ptr.Get<QosTxop> (); |
167 edca->SetTxopLimit (MicroSeconds (0)); | 167 edca->SetTxopLimit (MicroSeconds (0)); |
168 | 168 |
169 /* Setting mobility model */ | 169 /* Setting mobility model */ |
170 MobilityHelper mobility; | 170 MobilityHelper mobility; |
171 Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator>
(); | 171 Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator>
(); |
172 mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); | 172 mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); |
173 | 173 |
174 //Set position for APs | 174 //Set position for APs |
175 positionAlloc->Add (Vector (0.0, 0.0, 0.0)); | 175 positionAlloc->Add (Vector (0.0, 0.0, 0.0)); |
176 positionAlloc->Add (Vector (10.0, 0.0, 0.0)); | 176 positionAlloc->Add (Vector (10.0, 0.0, 0.0)); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 throughput = totalPacketsThrough * payloadSize * 8 / (simulationTime * 1000000
.0); | 340 throughput = totalPacketsThrough * payloadSize * 8 / (simulationTime * 1000000
.0); |
341 std::cout << "Throughput for AC_VI with non-default TXOP limit (0ms): " << thr
oughput << " Mbit/s" << '\n'; | 341 std::cout << "Throughput for AC_VI with non-default TXOP limit (0ms): " << thr
oughput << " Mbit/s" << '\n'; |
342 if (verifyResults && (throughput < 31.5 || throughput > 32.5)) | 342 if (verifyResults && (throughput < 31.5 || throughput > 32.5)) |
343 { | 343 { |
344 NS_LOG_ERROR ("Obtained throughput " << throughput << " is not in the expe
cted boundaries!"); | 344 NS_LOG_ERROR ("Obtained throughput " << throughput << " is not in the expe
cted boundaries!"); |
345 exit (1); | 345 exit (1); |
346 } | 346 } |
347 | 347 |
348 return 0; | 348 return 0; |
349 } | 349 } |
OLD | NEW |