View | Details | Raw Unified | Return to bug 2108
Collapse All | Expand All

(-)a/src/wifi/model/interference-helper.cc (-204 / +108 lines)
 Lines 271-288    Link Here 
271
  Time previous = (*j).GetTime ();
271
  Time previous = (*j).GetTime ();
272
  WifiMode payloadMode = event->GetPayloadMode ();
272
  WifiMode payloadMode = event->GetPayloadMode ();
273
  WifiPreamble preamble = event->GetPreambleType ();
273
  WifiPreamble preamble = event->GetPreambleType ();
274
  Time plcpHeaderStart = (*j).GetTime () + WifiPhy::GetPlcpPreambleDuration (payloadMode, preamble); //packet start time+ preamble
274
  Time plcpHeaderStart = (*j).GetTime () + WifiPhy::GetPlcpPreambleDuration (payloadMode, preamble); //packet start time + preamble
275
  Time plcpHsigHeaderStart = plcpHeaderStart + WifiPhy::GetPlcpHeaderDuration (payloadMode, preamble);//packet start time+ preamble+L SIG
275
  Time plcpHsigHeaderStart = plcpHeaderStart + WifiPhy::GetPlcpHeaderDuration (payloadMode, preamble); //packet start time+ preamble + L-SIG
276
  Time plcpHtTrainingSymbolsStart = plcpHsigHeaderStart + WifiPhy::GetPlcpHtSigHeaderDuration (preamble);//packet start time+ preamble+L SIG+HT SIG
276
  Time plcpHtTrainingSymbolsStart = plcpHsigHeaderStart + WifiPhy::GetPlcpHtSigHeaderDuration (preamble); //packet start time+ preamble + L-SIG + HT-SIG
277
  Time plcpPayloadStart =plcpHtTrainingSymbolsStart + WifiPhy::GetPlcpHtTrainingSymbolDuration (preamble,event->GetTxVector()); //packet start time+ preamble+L SIG+HT SIG+Training
277
  Time plcpPayloadStart = plcpHtTrainingSymbolsStart + WifiPhy::GetPlcpHtTrainingSymbolDuration (preamble, event->GetTxVector()); //packet start time + preamble + L-SIG + HT-SIG + Training
278
  double noiseInterferenceW = (*j).GetDelta ();
278
  double noiseInterferenceW = (*j).GetDelta ();
279
  double powerW = event->GetRxPowerW ();
279
  double powerW = event->GetRxPowerW ();
280
    j++;
280
  j++;
281
  while (ni->end () != j)
281
  while (ni->end () != j)
282
    {
282
    {
283
      Time current = (*j).GetTime ();
283
      Time current = (*j).GetTime ();
284
      NS_ASSERT (current >= previous);
284
      NS_ASSERT (current >= previous);
285
      //Case 1: Both prev and curr point to the payload
285
      //Case 1: Both previous and curr point to the payload
286
      if (previous >= plcpPayloadStart)
286
      if (previous >= plcpPayloadStart)
287
        {
287
        {
288
          psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
288
          psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
 Lines 292-303    Link Here 
292
                                            payloadMode);
292
                                            payloadMode);
293
        }
293
        }
294
      //Case 2: previous is before payload
294
      //Case 2: previous is before payload
295
      else if (previous >= plcpHtTrainingSymbolsStart)
295
      else
296
        {
296
        {
297
          //Case 2a: current is after payload
297
          //Case 2a: current is after payload
298
          if (current >= plcpPayloadStart)
298
          if (current >= plcpPayloadStart)
299
            { 
299
            { 
300
               //Case 2ai and 2aii: All formats
301
               psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
300
               psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
302
                                                               noiseInterferenceW,
301
                                                               noiseInterferenceW,
303
                                                               payloadMode),
302
                                                               payloadMode),
 Lines 306-354    Link Here 
306
                
305
                
307
            }
306
            }
308
        }
307
        }
309
      //Case 3: previous is in HT-SIG: Non HT will not enter here since it didn't enter in the last two and they are all the same for non HT
310
      else if (previous >= plcpHsigHeaderStart)
311
        {
312
          //Case 3a: cuurent after payload start
313
          if (current >= plcpPayloadStart)
314
             {
315
                   psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
316
                                                                   noiseInterferenceW,
317
                                                                   payloadMode),
318
                                                     current - plcpPayloadStart,
319
                                                     payloadMode);
320
                 
321
              }
322
323
        }
324
      //Case 4: previous in L-SIG: GF will not reach here because it will execute the previous if and exit
325
      else if (previous >= plcpHeaderStart)
326
        {
327
          //Case 4a: current after payload start  
328
          if (current >= plcpPayloadStart)
329
             {
330
                   psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
331
                                                                   noiseInterferenceW,
332
                                                                   payloadMode),
333
                                                     current - plcpPayloadStart,
334
                                                     payloadMode);
335
336
              }
337
        }
338
      //Case 5: previous is in the preamble works for all cases
339
      else
340
        {
341
          if (current >= plcpPayloadStart)
342
            {
343
              //for all
344
              psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
345
                                                              noiseInterferenceW,
346
                                                              payloadMode),
347
                                                current - plcpPayloadStart,
348
                                                payloadMode); 
349
             
350
            }
351
        }
352
308
353
      noiseInterferenceW += (*j).GetDelta ();
309
      noiseInterferenceW += (*j).GetDelta ();
354
      previous = (*j).GetTime ();
310
      previous = (*j).GetTime ();
 Lines 367-432    Link Here 
367
  Time previous = (*j).GetTime ();
323
  Time previous = (*j).GetTime ();
368
  WifiMode payloadMode = event->GetPayloadMode ();
324
  WifiMode payloadMode = event->GetPayloadMode ();
369
  WifiPreamble preamble = event->GetPreambleType ();
325
  WifiPreamble preamble = event->GetPreambleType ();
370
  WifiMode MfHeaderMode ;
326
  WifiMode htHeaderMode ;
371
  if (preamble == WIFI_PREAMBLE_HT_MF)
327
  if (preamble == WIFI_PREAMBLE_HT_MF)
372
    {
328
    {
373
      MfHeaderMode = WifiPhy::GetMFPlcpHeaderMode (payloadMode, preamble); //return L-SIG mode
329
      //mode for HT modulation
330
      htHeaderMode = WifiPhy::GetHTPlcpHeaderMode (payloadMode, preamble);
374
    }
331
    }
375
  WifiMode headerMode = WifiPhy::GetPlcpHeaderMode (payloadMode, preamble);
332
  WifiMode headerMode = WifiPhy::GetPlcpHeaderMode (payloadMode, preamble);
376
  Time plcpHeaderStart = (*j).GetTime () + WifiPhy::GetPlcpPreambleDuration (payloadMode, preamble); // packet start time + preamble
333
  Time plcpHeaderStart = (*j).GetTime () + WifiPhy::GetPlcpPreambleDuration (payloadMode, preamble); //packet start time + preamble
377
  Time plcpHsigHeaderStart = plcpHeaderStart + WifiPhy::GetPlcpHeaderDuration (payloadMode, preamble); // packet start time + preamble+L SIG
334
  Time plcpHsigHeaderStart = plcpHeaderStart + WifiPhy::GetPlcpHeaderDuration (payloadMode, preamble); //packet start time + preamble + L-SIG
378
  Time plcpHtTrainingSymbolsStart = plcpHsigHeaderStart + WifiPhy::GetPlcpHtSigHeaderDuration (preamble); // packet start time + preamble + L SIG + HT SIG
335
  Time plcpHtTrainingSymbolsStart = plcpHsigHeaderStart + WifiPhy::GetPlcpHtSigHeaderDuration (preamble); //packet start time + preamble + L-SIG + HT-SIG
379
  Time plcpPayloadStart = plcpHtTrainingSymbolsStart + WifiPhy::GetPlcpHtTrainingSymbolDuration (preamble, event->GetTxVector()); // packet start time + preamble + L SIG + HT SIG + Training
336
  Time plcpPayloadStart = plcpHtTrainingSymbolsStart + WifiPhy::GetPlcpHtTrainingSymbolDuration (preamble, event->GetTxVector()); //packet start time + preamble + L-SIG + HT-SIG + Training
380
  double noiseInterferenceW = (*j).GetDelta ();
337
  double noiseInterferenceW = (*j).GetDelta ();
381
  double powerW = event->GetRxPowerW ();
338
  double powerW = event->GetRxPowerW ();
382
    j++;
339
  j++;
383
  while (ni->end () != j)
340
  while (ni->end () != j)
384
    {
341
    {
385
      Time current = (*j).GetTime ();
342
      Time current = (*j).GetTime ();
386
      NS_ASSERT (current >= previous);
343
      NS_ASSERT (current >= previous);
387
      //Case 1: previous is in HT-SIG: Non HT will not enter here since it didn't enter in the last two and they are all the same for non HT
344
      //Case 1: previous and current after playload start: nothing to do
388
      if (previous >= plcpHsigHeaderStart)
345
      if (previous >= plcpPayloadStart)
389
        {
346
        {
390
          //Case 1a: cuurent after payload start
347
          j++;
348
          continue;
349
        }
350
      //Case 2: previous is in HT-SIG: non HT will not enter here since it didn't enter in the last two and they are all the same for non HT
351
      else if (previous >= plcpHsigHeaderStart)
352
        {
353
          NS_ASSERT ((preamble != WIFI_PREAMBLE_LONG) && (preamble != WIFI_PREAMBLE_SHORT));
354
          //Case 2a: current after payload start
391
          if (current >= plcpPayloadStart)
355
          if (current >= plcpPayloadStart)
392
             {
393
394
                 
395
                    psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
396
                                                                    noiseInterferenceW,
397
                                                                    headerMode),
398
                                                      plcpHtTrainingSymbolsStart - previous,
399
                                                      headerMode);
400
              }
401
          //case 1b: current after HT training symbols start
402
          else if (current >=plcpHtTrainingSymbolsStart)
403
             {
404
                psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
405
                                                                noiseInterferenceW,
406
                                                                headerMode),
407
                                                  plcpHtTrainingSymbolsStart - previous,
408
                                                  headerMode);
409
                   
410
             }
411
         //Case 1c: current is with previous in HT sig
412
         else
413
            {
356
            {
414
                psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
357
                psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
415
                                                                noiseInterferenceW,
358
                                                                noiseInterferenceW,
416
                                                                headerMode),
359
                                                                htHeaderMode),
360
                                                  plcpPayloadStart - previous,
361
                                                  htHeaderMode);
362
            }
363
          //Case 2b: current is with previous in HT-SIG or current is after HT training symbols start
364
          else
365
            {
366
                psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
367
                                                                noiseInterferenceW,
368
                                                                htHeaderMode),
417
                                                  current - previous,
369
                                                  current - previous,
418
                                                  headerMode);
370
                                                  htHeaderMode);
419
                   
420
            }
371
            }
421
      }
372
      }
422
      // Case 2: previous in L-SIG: GF will not reach here because it will execute the previous if and exit
373
      //Case 3: previous in L-SIG: GF will not reach here because it will execute the previous if and exit
423
      else if (previous >= plcpHeaderStart)
374
      else if (previous >= plcpHeaderStart)
424
        {
375
        {
425
          // Case 2a: current after payload start
376
          NS_ASSERT (preamble != WIFI_PREAMBLE_HT_GF);
377
          //Case 3a: current after payload start
426
          if (current >= plcpPayloadStart)
378
          if (current >= plcpPayloadStart)
427
             {
379
             {
428
              // Case 2ai: Non HT format (No HT-SIG or Training Symbols)
380
              //Case 3ai: Non HT format (No HT-SIG or Training Symbols)
429
              if (preamble == WIFI_PREAMBLE_LONG || preamble == WIFI_PREAMBLE_SHORT) //plcpHtTrainingSymbolsStart==plcpHeaderStart)
381
              if (preamble == WIFI_PREAMBLE_LONG || preamble == WIFI_PREAMBLE_SHORT)
430
                {
382
                {
431
                    psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
383
                    psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
432
                                                                    noiseInterferenceW,
384
                                                                    noiseInterferenceW,
 Lines 434-585    Link Here 
434
                                                      plcpPayloadStart - previous,
386
                                                      plcpPayloadStart - previous,
435
                                                      headerMode);
387
                                                      headerMode);
436
                }
388
                }
389
              //Case 3aii: HT mixed format
437
              else
390
              else
438
                {
391
                {
439
                    psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
392
                    psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
440
                                                              noiseInterferenceW,
393
                                                                    noiseInterferenceW,
441
                                                              headerMode),
394
                                                                    htHeaderMode),
442
                                                      plcpHtTrainingSymbolsStart - plcpHsigHeaderStart,
395
                                                      plcpPayloadStart - plcpHsigHeaderStart,
443
                                                      headerMode);
396
                                                      htHeaderMode);
444
                    psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
397
                    psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
445
                                                                    noiseInterferenceW,
398
                                                                    noiseInterferenceW,
446
                                                                    MfHeaderMode),
399
                                                                    headerMode),
447
                                                      plcpHsigHeaderStart - previous,
400
                                                      plcpHsigHeaderStart - previous,
448
                                                      MfHeaderMode);
401
                                                      headerMode);
449
                 }
402
                 }
450
              }
403
              }
451
          // Case 2b: current in HT training symbol. non HT will not come here since it went in previous if or if the previous ifis not true this will be not true
404
          //Case 3b: current in HT-SIG or in HT training symbol. Non HT will not come here since it went in previous if or if the previous if is not true this will be not true
452
          else if (current >= plcpHtTrainingSymbolsStart)
453
             {
454
                psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
455
                                                              noiseInterferenceW,
456
                                                              headerMode),
457
                                                  plcpHtTrainingSymbolsStart - plcpHsigHeaderStart,
458
                                                  headerMode);
459
                psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
460
                                                                noiseInterferenceW,
461
                                                                MfHeaderMode),
462
                                                   plcpHsigHeaderStart - previous,
463
                                                   MfHeaderMode);
464
              }
465
          // Case 2c: current in H sig. non HT will not come here since it went in previous if or if the previous ifis not true this will be not true
466
          else if (current >= plcpHsigHeaderStart)
405
          else if (current >= plcpHsigHeaderStart)
467
             {
406
             {
407
                 NS_ASSERT ((preamble != WIFI_PREAMBLE_LONG) && (preamble != WIFI_PREAMBLE_SHORT));
408
                 
409
                 psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
410
                                                                 noiseInterferenceW,
411
                                                                 htHeaderMode),
412
                                                   current - plcpHsigHeaderStart,
413
                                                   htHeaderMode);
414
                 psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
415
                                                                 noiseInterferenceW,
416
                                                                 headerMode),
417
                                                   plcpHsigHeaderStart - previous,
418
                                                   headerMode);
419
              }
420
         //Case 3c: Current with previous in L-SIG
421
         else 
422
            {
468
                psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
423
                psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
469
                                                                noiseInterferenceW,
424
                                                                noiseInterferenceW,
470
                                                                headerMode),
425
                                                                headerMode),
471
                                                  current - plcpHsigHeaderStart,
426
                                                  current - previous,
472
                                                  headerMode);
427
                                                  headerMode);
473
                 psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
428
            }
474
                                                                 noiseInterferenceW,
429
        }
475
                                                                 MfHeaderMode),
430
      //Case 4: previous is in the preamble works for all cases
476
                                                   plcpHsigHeaderStart - previous,
431
      else
477
                                                   MfHeaderMode);
432
        {
478
433
          if (current >= plcpPayloadStart)
479
             }
480
         // Case 2d: Current with prev in L SIG
481
         else 
482
            {
434
            {
483
              // Case 4di: Non HT format (No HT-SIG or Training Symbols)
435
              //Non HT format (No HT-SIG or Training Symbols)
484
              if (preamble == WIFI_PREAMBLE_LONG || preamble == WIFI_PREAMBLE_SHORT) //plcpHtTrainingSymbolsStart==plcpHeaderStart)
436
              if (preamble == WIFI_PREAMBLE_LONG || preamble == WIFI_PREAMBLE_SHORT)
485
                {
437
                {
486
                    psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
438
                    psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
487
                                                                    noiseInterferenceW,
439
                                                                    noiseInterferenceW,
488
                                                                    headerMode),
440
                                                                    headerMode),
489
                                                      current - previous,
441
                                                      plcpPayloadStart - plcpHeaderStart,
490
                                                      headerMode);
442
                                                      headerMode);
491
                }
443
                }
492
              else
444
              else
493
                {
445
              //HT format
494
                    psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
446
              {
495
                                                               noiseInterferenceW,
447
                  psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
496
                                                               MfHeaderMode),
448
                                                                  noiseInterferenceW,
497
                                                      current - previous,
449
                                                                  htHeaderMode),
498
                                                      MfHeaderMode);
450
                                                    plcpPayloadStart - plcpHsigHeaderStart,
499
                }
451
                                                    htHeaderMode);
452
                  
453
                  psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
454
                                                                  noiseInterferenceW,
455
                                                                  headerMode),
456
                                                    plcpHsigHeaderStart - plcpHeaderStart, //HT GF: plcpHsigHeaderStart - plcpHeaderStart = 0
457
                                                    headerMode);
458
              }
500
            }
459
            }
501
        }
460
          //non HT will not come here
502
      // Case 3: previous is in the preamble works for all cases
461
          else if (current >= plcpHsigHeaderStart)
503
      else
462
             {
504
        {
463
                 NS_ASSERT ((preamble != WIFI_PREAMBLE_LONG) && (preamble != WIFI_PREAMBLE_SHORT));
505
          if (current >= plcpPayloadStart)
464
506
            {
465
                 psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
507
              // Non HT format (No HT-SIG or Training Symbols)
466
                                                                 noiseInterferenceW,
508
              if (preamble == WIFI_PREAMBLE_LONG || preamble == WIFI_PREAMBLE_SHORT)
467
                                                                 htHeaderMode),
468
                                                   current - plcpHsigHeaderStart,
469
                                                   htHeaderMode);
470
509
                 psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
471
                 psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
510
                                                                 noiseInterferenceW,
472
                                                                 noiseInterferenceW,
511
                                                                 headerMode),
473
                                                                 headerMode),
512
                                                   plcpPayloadStart - plcpHeaderStart,
474
                                                   plcpHsigHeaderStart - plcpHeaderStart, //HT GF: plcpHsigHeaderStart - plcpHeaderStart = 0
513
                                                   headerMode);
475
                                                   headerMode);
514
              else
476
             }
515
              // Greenfield or Mixed format
477
          //GF will not come here
478
          else if (current >= plcpHeaderStart)
479
            {
480
                NS_ASSERT(preamble != WIFI_PREAMBLE_HT_GF);
481
                
516
                psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
482
                psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
517
                                                                noiseInterferenceW,
483
                                                                noiseInterferenceW,
518
                                                                headerMode),
484
                                                                headerMode),
519
                                                  plcpHtTrainingSymbolsStart - plcpHsigHeaderStart,
485
                                                  current - plcpHeaderStart,
520
                                                  headerMode);
486
                                                  headerMode);
521
              if (preamble == WIFI_PREAMBLE_HT_MF)
522
                 psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
523
                                                                 noiseInterferenceW,
524
                                                                 MfHeaderMode),
525
                                                   plcpHsigHeaderStart-plcpHeaderStart,
526
                                                   MfHeaderMode);             
527
            }
528
          else if (current >= plcpHtTrainingSymbolsStart )
529
          { 
530
              // Non HT format will not come here since it will execute prev if
531
              // Greenfield or Mixed format
532
              psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
533
                                                              noiseInterferenceW,
534
                                                              headerMode),
535
                                                plcpHtTrainingSymbolsStart - plcpHsigHeaderStart,
536
                                                headerMode);
537
              // Greenfield
538
              if (preamble == WIFI_PREAMBLE_HT_MF)
539
                {
540
                    psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
541
                                                                    noiseInterferenceW,
542
                                                                    MfHeaderMode),
543
                                                      plcpHsigHeaderStart-plcpHeaderStart,
544
                                                      MfHeaderMode);
545
                }
546
           }
547
          // non HT will not come here
548
          else if (current >= plcpHsigHeaderStart)
549
             { 
550
                psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
551
                                                                noiseInterferenceW,
552
                                                                headerMode),
553
                                                  current- plcpHsigHeaderStart,
554
                                                  headerMode); 
555
                if  (preamble != WIFI_PREAMBLE_HT_GF)
556
                 {
557
                   psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
558
                                                                   noiseInterferenceW,
559
                                                                   MfHeaderMode),
560
                                                     plcpHsigHeaderStart-plcpHeaderStart,
561
                                                     MfHeaderMode);    
562
                  }          
563
             }
564
          // GF will not come here
565
          else if (current >= plcpHeaderStart)
566
            {
567
               if (preamble == WIFI_PREAMBLE_LONG || preamble == WIFI_PREAMBLE_SHORT)
568
                 {
569
                 psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
570
                                                                 noiseInterferenceW,
571
                                                                 headerMode),
572
                                                   current - plcpHeaderStart,
573
                                                   headerMode);
574
                 }
575
              else
576
                 {
577
              psr *= CalculateChunkSuccessRate (CalculateSnr (powerW,
578
                                                              noiseInterferenceW,
579
                                                              MfHeaderMode),
580
                                                current - plcpHeaderStart,
581
                                                MfHeaderMode);
582
                       }
583
            }
487
            }
584
        }
488
        }
585
489
(-)a/src/wifi/model/wifi-phy.cc (-41 / +11 lines)
 Lines 117-135    Link Here 
117
  NS_LOG_FUNCTION (this);
117
  NS_LOG_FUNCTION (this);
118
}
118
}
119
119
120
//return the L-SIG
121
WifiMode
120
WifiMode
122
WifiPhy::GetMFPlcpHeaderMode (WifiMode payloadMode, WifiPreamble preamble)
121
WifiPhy::GetHTPlcpHeaderMode (WifiMode payloadMode, WifiPreamble preamble)
123
{
122
{
124
    switch (payloadMode.GetBandwidth ())
123
    switch (payloadMode.GetBandwidth ())
125
       {
124
       {
126
       case 20000000:
125
         case 20000000:
127
          return WifiPhy::GetOfdmRate6_5MbpsBW20MHz ();
128
        case 40000000:
129
           return WifiPhy::GetOfdmRate13_5MbpsBW40MHz ();
130
        default:
131
            return WifiPhy::GetOfdmRate6_5MbpsBW20MHz ();
126
            return WifiPhy::GetOfdmRate6_5MbpsBW20MHz ();
132
      }
127
         case 40000000:
128
            return WifiPhy::GetOfdmRate13_5MbpsBW40MHz ();
129
         default:
130
            return WifiPhy::GetOfdmRate6_5MbpsBW20MHz ();
131
       }
133
}
132
}
134
133
135
Time
134
Time
 Lines 168-187    Link Here 
168
    }
167
    }
169
}
168
}
170
169
171
//return L-SIG
172
Time
170
Time
173
WifiPhy::GetPlcpHtSigHeaderDuration (WifiPreamble preamble)
171
WifiPhy::GetPlcpHtSigHeaderDuration (WifiPreamble preamble)
174
{
172
{
175
         switch (preamble)
173
         switch (preamble)
176
            {
174
            {
177
             case WIFI_PREAMBLE_HT_MF:
175
             case WIFI_PREAMBLE_HT_MF:
178
               // HT-SIG
176
               //HT-SIG
179
               return MicroSeconds(8);
177
               return MicroSeconds(8);
180
             case WIFI_PREAMBLE_HT_GF:
178
             case WIFI_PREAMBLE_HT_GF:
181
               //HT-SIG
179
               //HT-SIG
182
               return MicroSeconds(8);
180
               return MicroSeconds(8);
183
             default:
181
             default:
184
               // no HT-SIG for non HT
182
               //no HT-SIG for non HT
185
               return MicroSeconds(0);
183
               return MicroSeconds(0);
186
            }
184
            }
187
}
185
}
 Lines 191-196    Link Here 
191
{
189
{
192
  switch (payloadMode.GetModulationClass ())
190
  switch (payloadMode.GetModulationClass ())
193
    {
191
    {
192
    case WIFI_MOD_CLASS_HT:
194
    case WIFI_MOD_CLASS_OFDM:
193
    case WIFI_MOD_CLASS_OFDM:
195
      {
194
      {
196
        switch (payloadMode.GetBandwidth ())
195
        switch (payloadMode.GetBandwidth ())
 Lines 207-242    Link Here 
207
            return WifiPhy::GetOfdmRate6Mbps ();
206
            return WifiPhy::GetOfdmRate6Mbps ();
208
          }
207
          }
209
      }
208
      }
210
    //Added by Ghada to support 11n
209
      
211
    case WIFI_MOD_CLASS_HT:
212
      {  //return the HT-SIG
213
         // IEEE Std 802.11n, 20.3.23
214
         switch (preamble)
215
           {
216
            case WIFI_PREAMBLE_HT_MF:
217
                switch (payloadMode.GetBandwidth ())
218
                  {
219
                   case 20000000:
220
                      return WifiPhy::GetOfdmRate13MbpsBW20MHz ();
221
                   case 40000000:
222
                      return WifiPhy::GetOfdmRate27MbpsBW40MHz ();
223
                   default:
224
                      return WifiPhy::GetOfdmRate13MbpsBW20MHz ();
225
                  }
226
            case WIFI_PREAMBLE_HT_GF:
227
                  switch (payloadMode.GetBandwidth ())
228
                  {
229
                   case 20000000:
230
                      return WifiPhy::GetOfdmRate13MbpsBW20MHz ();
231
                   case 40000000:
232
                      return WifiPhy::GetOfdmRate27MbpsBW40MHz ();
233
                   default:
234
                      return WifiPhy::GetOfdmRate13MbpsBW20MHz ();
235
                  }
236
             default:
237
                return WifiPhy::GetOfdmRate6Mbps ();
238
          }
239
      }
240
    case WIFI_MOD_CLASS_ERP_OFDM:
210
    case WIFI_MOD_CLASS_ERP_OFDM:
241
      return WifiPhy::GetErpOfdmRate6Mbps ();
211
      return WifiPhy::GetErpOfdmRate6Mbps ();
242
212
(-)a/src/wifi/model/wifi-phy.h (-4 / +3 lines)
 Lines 314-330    Link Here 
314
   * \param payloadMode the WifiMode use for the transmission of the payload
314
   * \param payloadMode the WifiMode use for the transmission of the payload
315
   * \param preamble the type of preamble
315
   * \param preamble the type of preamble
316
   * 
316
   * 
317
   * \return the WifiMode used for the transmission of the HT-SIG in Mixed Format and greenfield format PLCP header 
317
   * \return the WifiMode used for the transmission of the HT-SIG and HT training in Mixed Format and greenfield format PLCP header
318
   */
318
   */
319
  static WifiMode GetMFPlcpHeaderMode (WifiMode payloadMode, WifiPreamble preamble);
319
  static WifiMode GetHTPlcpHeaderMode (WifiMode payloadMode, WifiPreamble preamble);
320
  /** 
320
  /**
321
   * \param preamble the type of preamble
321
   * \param preamble the type of preamble
322
   * 
322
   * 
323
   * \return the duration of the HT-SIG in Mixed Format and greenfield format PLCP header 
323
   * \return the duration of the HT-SIG in Mixed Format and greenfield format PLCP header 
324
   */
324
   */
325
  static Time GetPlcpHtSigHeaderDuration (WifiPreamble preamble);
325
  static Time GetPlcpHtSigHeaderDuration (WifiPreamble preamble);
326
326
327
328
  /** 
327
  /** 
329
   * \param payloadMode the WifiMode use for the transmission of the payload
328
   * \param payloadMode the WifiMode use for the transmission of the payload
330
   * \param preamble the type of preamble
329
   * \param preamble the type of preamble

Return to bug 2108