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) 2005,2006 INRIA | 3 * Copyright (c) 2005,2006 INRIA |
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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 return WifiPhy::GetOfdmRate3MbpsBW10MHz (); | 199 return WifiPhy::GetOfdmRate3MbpsBW10MHz (); |
200 default: | 200 default: |
201 // IEEE Std 802.11-2007, 17.3.2 | 201 // IEEE Std 802.11-2007, 17.3.2 |
202 // actually this is only the first part of the PlcpHeader, | 202 // actually this is only the first part of the PlcpHeader, |
203 // because the last 16 bits of the PlcpHeader are using the | 203 // because the last 16 bits of the PlcpHeader are using the |
204 // same mode of the payload | 204 // same mode of the payload |
205 return WifiPhy::GetOfdmRate6Mbps (); | 205 return WifiPhy::GetOfdmRate6Mbps (); |
206 } | 206 } |
207 } | 207 } |
208 | 208 |
| 209 case WIFI_MOD_CLASS_ERP_OFDM: |
| 210 return WifiPhy::GetErpOfdmRate6Mbps (); |
| 211 |
209 case WIFI_MOD_CLASS_DSSS: | 212 case WIFI_MOD_CLASS_DSSS: |
210 if (preamble == WIFI_PREAMBLE_LONG) | 213 if (preamble == WIFI_PREAMBLE_LONG) |
211 { | 214 { |
212 // IEEE Std 802.11-2007, sections 15.2.3 and 18.2.2.1· | 215 // IEEE Std 802.11-2007, sections 15.2.3 and 18.2.2.1· |
213 return WifiPhy::GetDsssRate1Mbps (); | 216 return WifiPhy::GetDsssRate1Mbps (); |
214 } | 217 } |
215 else // WIFI_PREAMBLE_SHORT | 218 else // WIFI_PREAMBLE_SHORT |
216 { | 219 { |
217 // IEEE Std 802.11-2007, section 18.2.2.2 | 220 // IEEE Std 802.11-2007, section 18.2.2.2 |
218 return WifiPhy::GetDsssRate2Mbps (); | 221 return WifiPhy::GetDsssRate2Mbps (); |
(...skipping 24 matching lines...) Expand all Loading... |
243 return 4; | 246 return 4; |
244 case 10000000: | 247 case 10000000: |
245 // IEEE Std 802.11-2007, section 17.3.2.3, table 17-4 | 248 // IEEE Std 802.11-2007, section 17.3.2.3, table 17-4 |
246 return 8; | 249 return 8; |
247 case 5000000: | 250 case 5000000: |
248 // IEEE Std 802.11-2007, section 17.3.2.3, table 17-4 | 251 // IEEE Std 802.11-2007, section 17.3.2.3, table 17-4 |
249 return 16; | 252 return 16; |
250 } | 253 } |
251 } | 254 } |
252 | 255 |
| 256 case WIFI_MOD_CLASS_ERP_OFDM: |
| 257 return 16; |
| 258 |
253 case WIFI_MOD_CLASS_DSSS: | 259 case WIFI_MOD_CLASS_DSSS: |
254 if (preamble == WIFI_PREAMBLE_SHORT) | 260 if (preamble == WIFI_PREAMBLE_SHORT) |
255 { | 261 { |
256 // IEEE Std 802.11-2007, section 18.2.2.2 and figure 18-2 | 262 // IEEE Std 802.11-2007, section 18.2.2.2 and figure 18-2 |
257 return 24; | 263 return 24; |
258 } | 264 } |
259 else // WIFI_PREAMBLE_LONG | 265 else // WIFI_PREAMBLE_LONG |
260 { | 266 { |
261 // IEEE Std 802.11-2007, sections 18.2.2.1 and figure 18-1 | 267 // IEEE Std 802.11-2007, sections 18.2.2.1 and figure 18-1 |
262 return 48; | 268 return 48; |
(...skipping 22 matching lines...) Expand all Loading... |
285 // IEEE Std 802.11-2007, section 17.3.3, table 17-4 | 291 // IEEE Std 802.11-2007, section 17.3.3, table 17-4 |
286 // also section 17.3.2.3, table 17-4 | 292 // also section 17.3.2.3, table 17-4 |
287 return 32; | 293 return 32; |
288 case 5000000: | 294 case 5000000: |
289 // IEEE Std 802.11-2007, section 17.3.3 | 295 // IEEE Std 802.11-2007, section 17.3.3 |
290 // also section 17.3.2.3, table 17-4 | 296 // also section 17.3.2.3, table 17-4 |
291 return 64; | 297 return 64; |
292 } | 298 } |
293 } | 299 } |
294 | 300 |
| 301 case WIFI_MOD_CLASS_ERP_OFDM: |
| 302 return 4; |
| 303 |
295 case WIFI_MOD_CLASS_DSSS: | 304 case WIFI_MOD_CLASS_DSSS: |
296 if (preamble == WIFI_PREAMBLE_SHORT) | 305 if (preamble == WIFI_PREAMBLE_SHORT) |
297 { | 306 { |
298 // IEEE Std 802.11-2007, section 18.2.2.2 and figure 18-2 | 307 // IEEE Std 802.11-2007, section 18.2.2.2 and figure 18-2 |
299 return 72; | 308 return 72; |
300 } | 309 } |
301 else // WIFI_PREAMBLE_LONG | 310 else // WIFI_PREAMBLE_LONG |
302 { | 311 { |
303 // IEEE Std 802.11-2007, sections 18.2.2.1 and figure 18-1 | 312 // IEEE Std 802.11-2007, sections 18.2.2.1 and figure 18-1 |
304 return 144; | 313 return 144; |
305 } | 314 } |
306 | 315 |
307 default: | 316 default: |
308 NS_FATAL_ERROR("unsupported modulation class"); | 317 NS_FATAL_ERROR("unsupported modulation class"); |
309 return 0; | 318 return 0; |
310 } | 319 } |
311 } | 320 } |
312 | 321 |
313 uint32_t· | 322 uint32_t· |
314 InterferenceHelper::GetPayloadDurationMicroSeconds (uint32_t size, WifiMode payl
oadMode) | 323 InterferenceHelper::GetPayloadDurationMicroSeconds (uint32_t size, WifiMode payl
oadMode) |
315 { | 324 { |
316 NS_LOG_FUNCTION(size << payloadMode); | 325 NS_LOG_FUNCTION(size << payloadMode); |
317 | 326 |
318 switch (payloadMode.GetModulationClass ()) | 327 switch (payloadMode.GetModulationClass ()) |
319 { | 328 { |
320 case WIFI_MOD_CLASS_OFDM: | 329 case WIFI_MOD_CLASS_OFDM: |
| 330 case WIFI_MOD_CLASS_ERP_OFDM: |
321 { | 331 { |
322 // IEEE Std 802.11-2007, section 17.3.2.3, table 17-4 | 332 // IEEE Std 802.11-2007, section 17.3.2.3, table 17-4 |
323 // corresponds to T_{SYM} in the table | 333 // corresponds to T_{SYM} in the table |
324 uint32_t symbolDurationUs; | 334 uint32_t symbolDurationUs; |
325 | 335 |
326 switch (payloadMode.GetBandwidth ()) { | 336 switch (payloadMode.GetBandwidth ()) { |
327 case 20000000: | 337 case 20000000: |
328 default: | 338 default: |
329 symbolDurationUs = 4; | 339 symbolDurationUs = 4; |
330 break; | 340 break; |
331 case 10000000: | 341 case 10000000: |
332 symbolDurationUs = 8; | 342 symbolDurationUs = 8; |
333 break; | 343 break; |
334 case 5000000: | 344 case 5000000: |
335 symbolDurationUs = 16; | 345 symbolDurationUs = 16; |
336 break; | 346 break; |
337 } | 347 } |
338 | 348 |
339 // IEEE Std 802.11-2007, section 17.3.2.2, table 17-3 | 349 // IEEE Std 802.11-2007, section 17.3.2.2, table 17-3 |
340 // corresponds to N_{DBPS} in the table | 350 // corresponds to N_{DBPS} in the table |
341 double numDataBitsPerSymbol = payloadMode.GetDataRate () * symbolDurati
onUs / 1e6; | 351 double numDataBitsPerSymbol = payloadMode.GetDataRate () * symbolDurati
onUs / 1e6; |
342 | 352 |
343 // IEEE Std 802.11-2007, section 17.3.5.3, equation (17-11) | 353 // IEEE Std 802.11-2007, section 17.3.5.3, equation (17-11) |
344 uint32_t numSymbols = lrint (ceil ((16 + size * 8.0 + 6.0)/numDataBitsPe
rSymbol)); | 354 uint32_t numSymbols = lrint (ceil ((16 + size * 8.0 + 6.0)/numDataBitsPe
rSymbol)); |
345 | 355 |
| 356 // Add signal extension for ERP PHY |
| 357 if (payloadMode.GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM) |
| 358 return numSymbols*symbolDurationUs + 6; |
| 359 else |
346 return numSymbols*symbolDurationUs; | 360 return numSymbols*symbolDurationUs; |
347 } | 361 } |
348 | 362 |
349 case WIFI_MOD_CLASS_DSSS: | 363 case WIFI_MOD_CLASS_DSSS: |
350 // IEEE Std 802.11-2007, section 18.2.3.5 | 364 // IEEE Std 802.11-2007, section 18.2.3.5 |
351 NS_LOG_LOGIC(" size=" << size | 365 NS_LOG_LOGIC(" size=" << size |
352 << " mode=" << payloadMode· | 366 << " mode=" << payloadMode· |
353 << " rate=" << payloadMode.GetDataRate () ); | 367 << " rate=" << payloadMode.GetDataRate () ); |
354 return lrint(ceil ((size * 8.0) / (payloadMode.GetDataRate () / 1.0e6))); | 368 return lrint(ceil ((size * 8.0) / (payloadMode.GetDataRate () / 1.0e6))); |
355 | 369 |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 InterferenceHelper::NotifyRxStart () | 578 InterferenceHelper::NotifyRxStart () |
565 { | 579 { |
566 m_rxing = true; | 580 m_rxing = true; |
567 } | 581 } |
568 void | 582 void |
569 InterferenceHelper::NotifyRxEnd () | 583 InterferenceHelper::NotifyRxEnd () |
570 { | 584 { |
571 m_rxing = false; | 585 m_rxing = false; |
572 } | 586 } |
573 } // namespace ns3 | 587 } // namespace ns3 |
OLD | NEW |