|
|
| 52 |
.SetParent<ns3::Txop> () |
52 |
.SetParent<ns3::Txop> () |
| 53 |
.SetGroupName ("Wifi") |
53 |
.SetGroupName ("Wifi") |
| 54 |
.AddConstructor<QosTxop> () |
54 |
.AddConstructor<QosTxop> () |
| 55 |
.AddTraceSource ("BackoffTrace", |
|
|
| 56 |
"Trace source for backoff values", |
| 57 |
MakeTraceSourceAccessor (&QosTxop::m_backoffTrace), |
| 58 |
"ns3::TracedValueCallback::Uint32") |
| 59 |
.AddTraceSource ("CwTrace", |
| 60 |
"Trace source for contention window values", |
| 61 |
MakeTraceSourceAccessor (&QosTxop::m_cwTrace), |
| 62 |
"ns3::TracedValueCallback::Uint32") |
| 63 |
.AddTraceSource ("TxopTrace", |
55 |
.AddTraceSource ("TxopTrace", |
| 64 |
"Trace source for txop start and duration times", |
56 |
"Trace source for txop start and duration times", |
| 65 |
MakeTraceSourceAccessor (&QosTxop::m_txopTrace), |
57 |
MakeTraceSourceAccessor (&QosTxop::m_txopTrace), |
|
|
| 409 |
UpdateFailedCw (); |
401 |
UpdateFailedCw (); |
| 410 |
} |
402 |
} |
| 411 |
} |
403 |
} |
| 412 |
m_backoffTrace = m_rng->GetInteger (0, GetCw ()); |
404 |
m_backoff = m_rng->GetInteger (0, GetCw ()); |
| 413 |
StartBackoffNow (m_backoffTrace); |
405 |
m_backoffTrace (m_backoff); |
|
|
406 |
StartBackoffNow (m_backoff); |
| 414 |
RestartAccessIfNeeded (); |
407 |
RestartAccessIfNeeded (); |
| 415 |
} |
408 |
} |
| 416 |
|
409 |
|
|
|
| 418 |
QosTxop::NotifyCollision (void) |
411 |
QosTxop::NotifyCollision (void) |
| 419 |
{ |
412 |
{ |
| 420 |
NS_LOG_FUNCTION (this); |
413 |
NS_LOG_FUNCTION (this); |
| 421 |
m_backoffTrace = m_rng->GetInteger (0, GetCw ()); |
414 |
m_backoff = m_rng->GetInteger (0, GetCw ()); |
| 422 |
StartBackoffNow (m_backoffTrace); |
415 |
m_backoffTrace (m_backoff); |
|
|
416 |
StartBackoffNow (m_backoff); |
| 423 |
RestartAccessIfNeeded (); |
417 |
RestartAccessIfNeeded (); |
| 424 |
} |
418 |
} |
| 425 |
|
419 |
|
|
|
| 481 |
UpdateFailedCw (); |
475 |
UpdateFailedCw (); |
| 482 |
m_cwTrace = GetCw (); |
476 |
m_cwTrace = GetCw (); |
| 483 |
} |
477 |
} |
| 484 |
m_backoffTrace = m_rng->GetInteger (0, GetCw ()); |
478 |
m_backoff = m_rng->GetInteger (0, GetCw ()); |
| 485 |
StartBackoffNow (m_backoffTrace); |
479 |
m_backoffTrace (m_backoff); |
|
|
480 |
StartBackoffNow (m_backoff); |
| 486 |
RestartAccessIfNeeded (); |
481 |
RestartAccessIfNeeded (); |
| 487 |
} |
482 |
} |
| 488 |
|
483 |
|
|
|
| 529 |
m_txopTrace (m_startTxop, Simulator::Now () - m_startTxop); |
524 |
m_txopTrace (m_startTxop, Simulator::Now () - m_startTxop); |
| 530 |
} |
525 |
} |
| 531 |
m_cwTrace = GetCw (); |
526 |
m_cwTrace = GetCw (); |
| 532 |
m_backoffTrace = m_rng->GetInteger (0, GetCw ()); |
527 |
m_backoff = m_rng->GetInteger (0, GetCw ()); |
| 533 |
StartBackoffNow (m_backoffTrace); |
528 |
m_backoffTrace (m_backoff); |
|
|
529 |
StartBackoffNow (m_backoff); |
| 534 |
RestartAccessIfNeeded (); |
530 |
RestartAccessIfNeeded (); |
| 535 |
} |
531 |
} |
| 536 |
} |
532 |
} |
|
|
| 543 |
{ |
539 |
{ |
| 544 |
m_txopTrace (m_startTxop, Simulator::Now () - m_startTxop); |
540 |
m_txopTrace (m_startTxop, Simulator::Now () - m_startTxop); |
| 545 |
m_cwTrace = GetCw (); |
541 |
m_cwTrace = GetCw (); |
| 546 |
m_backoffTrace = m_rng->GetInteger (0, GetCw ()); |
542 |
m_backoff = m_rng->GetInteger (0, GetCw ()); |
| 547 |
StartBackoffNow (m_backoffTrace); |
543 |
m_backoffTrace (m_backoff); |
|
|
544 |
StartBackoffNow (m_backoff); |
| 548 |
m_fragmentNumber++; |
545 |
m_fragmentNumber++; |
| 549 |
RestartAccessIfNeeded (); |
546 |
RestartAccessIfNeeded (); |
| 550 |
} |
547 |
} |
|
|
| 613 |
UpdateFailedCw (); |
610 |
UpdateFailedCw (); |
| 614 |
m_cwTrace = GetCw (); |
611 |
m_cwTrace = GetCw (); |
| 615 |
} |
612 |
} |
| 616 |
m_backoffTrace = m_rng->GetInteger (0, GetCw ()); |
613 |
m_backoff = m_rng->GetInteger (0, GetCw ()); |
| 617 |
StartBackoffNow (m_backoffTrace); |
614 |
m_backoffTrace (m_backoff); |
|
|
615 |
StartBackoffNow (m_backoff); |
| 618 |
RestartAccessIfNeeded (); |
616 |
RestartAccessIfNeeded (); |
| 619 |
} |
617 |
} |
| 620 |
|
618 |
|
|
|
| 687 |
ResetCw (); |
685 |
ResetCw (); |
| 688 |
m_cwTrace = GetCw (); |
686 |
m_cwTrace = GetCw (); |
| 689 |
} |
687 |
} |
| 690 |
m_backoffTrace = m_rng->GetInteger (0, GetCw ()); |
688 |
m_backoff = m_rng->GetInteger (0, GetCw ()); |
| 691 |
StartBackoffNow (m_backoffTrace); |
689 |
m_backoffTrace (m_backoff); |
|
|
690 |
StartBackoffNow (m_backoff); |
| 692 |
RestartAccessIfNeeded (); |
691 |
RestartAccessIfNeeded (); |
| 693 |
} |
692 |
} |
| 694 |
|
693 |
|
|
|
| 941 |
m_currentPacket = 0; |
940 |
m_currentPacket = 0; |
| 942 |
ResetCw (); |
941 |
ResetCw (); |
| 943 |
m_cwTrace = GetCw (); |
942 |
m_cwTrace = GetCw (); |
| 944 |
m_backoffTrace = m_rng->GetInteger (0, GetCw ()); |
943 |
m_backoff = m_rng->GetInteger (0, GetCw ()); |
| 945 |
StartBackoffNow (m_backoffTrace); |
944 |
m_backoffTrace (m_backoff); |
|
|
945 |
StartBackoffNow (m_backoff); |
| 946 |
StartAccessIfNeeded (); |
946 |
StartAccessIfNeeded (); |
| 947 |
} |
947 |
} |
| 948 |
|
948 |
|
|
|
| 1271 |
m_txopTrace (m_startTxop, Simulator::Now () - m_startTxop); |
1271 |
m_txopTrace (m_startTxop, Simulator::Now () - m_startTxop); |
| 1272 |
} |
1272 |
} |
| 1273 |
m_cwTrace = GetCw (); |
1273 |
m_cwTrace = GetCw (); |
| 1274 |
m_backoffTrace = m_rng->GetInteger (0, GetCw ()); |
1274 |
m_backoff = m_rng->GetInteger (0, GetCw ()); |
| 1275 |
StartBackoffNow (m_backoffTrace); |
1275 |
m_backoffTrace (m_backoff); |
|
|
1276 |
StartBackoffNow (m_backoff); |
| 1276 |
RestartAccessIfNeeded (); |
1277 |
RestartAccessIfNeeded (); |
| 1277 |
} |
1278 |
} |
| 1278 |
} |
1279 |
} |
|
|
| 1535 |
NS_LOG_FUNCTION (this); |
1536 |
NS_LOG_FUNCTION (this); |
| 1536 |
ResetCw (); |
1537 |
ResetCw (); |
| 1537 |
m_cwTrace = GetCw (); |
1538 |
m_cwTrace = GetCw (); |
| 1538 |
m_backoffTrace = m_rng->GetInteger (0, GetCw ()); |
1539 |
m_backoff = m_rng->GetInteger (0, GetCw ()); |
| 1539 |
StartBackoffNow (m_backoffTrace); |
1540 |
m_backoffTrace (m_backoff); |
|
|
1541 |
StartBackoffNow (m_backoff); |
| 1540 |
} |
1542 |
} |
| 1541 |
|
1543 |
|
| 1542 |
void |
1544 |
void |