|
|
| 29 |
#include "ns3/pointer.h" |
29 |
#include "ns3/pointer.h" |
| 30 |
#include "wifi-phy-tag.h" |
30 |
#include "wifi-phy-tag.h" |
| 31 |
#include "ampdu-tag.h" |
31 |
#include "ampdu-tag.h" |
|
|
32 |
#include "wifi-phy-tag.h" |
| 32 |
#include "wifi-utils.h" |
33 |
#include "wifi-utils.h" |
| 33 |
|
34 |
|
| 34 |
namespace ns3 { |
35 |
namespace ns3 { |
|
Lines 191-203
WifiPhy::GetTypeId (void)
|
Link Here
|
|---|
|
| 191 |
MakeDoubleChecker<double> ()) |
192 |
MakeDoubleChecker<double> ()) |
| 192 |
.AddAttribute ("TxGain", |
193 |
.AddAttribute ("TxGain", |
| 193 |
"Transmission gain (dB).", |
194 |
"Transmission gain (dB).", |
| 194 |
DoubleValue (1.0), |
195 |
DoubleValue (0.0), |
| 195 |
MakeDoubleAccessor (&WifiPhy::SetTxGain, |
196 |
MakeDoubleAccessor (&WifiPhy::SetTxGain, |
| 196 |
&WifiPhy::GetTxGain), |
197 |
&WifiPhy::GetTxGain), |
| 197 |
MakeDoubleChecker<double> ()) |
198 |
MakeDoubleChecker<double> ()) |
| 198 |
.AddAttribute ("RxGain", |
199 |
.AddAttribute ("RxGain", |
| 199 |
"Reception gain (dB).", |
200 |
"Reception gain (dB).", |
| 200 |
DoubleValue (1.0), |
201 |
DoubleValue (0.0), |
| 201 |
MakeDoubleAccessor (&WifiPhy::SetRxGain, |
202 |
MakeDoubleAccessor (&WifiPhy::SetRxGain, |
| 202 |
&WifiPhy::GetRxGain), |
203 |
&WifiPhy::GetRxGain), |
| 203 |
MakeDoubleChecker<double> ()) |
204 |
MakeDoubleChecker<double> ()) |
|
Lines 308-313
WifiPhy::GetTypeId (void)
|
Link Here
|
|---|
|
| 308 |
MakeBooleanAccessor (&WifiPhy::GetShortPlcpPreambleSupported, |
309 |
MakeBooleanAccessor (&WifiPhy::GetShortPlcpPreambleSupported, |
| 309 |
&WifiPhy::SetShortPlcpPreambleSupported), |
310 |
&WifiPhy::SetShortPlcpPreambleSupported), |
| 310 |
MakeBooleanChecker ()) |
311 |
MakeBooleanChecker ()) |
|
|
312 |
.AddAttribute ("PreambleCaptureEnabled", |
| 313 |
"Whether or not to enable capture at the preamble portion of the packet.", |
| 314 |
BooleanValue (false), |
| 315 |
MakeBooleanAccessor (&WifiPhy::GetPreambleCapture, |
| 316 |
&WifiPhy::SetPreambleCapture), |
| 317 |
MakeBooleanChecker ()) |
| 318 |
.AddAttribute ("PayloadCaptureEnabled", |
| 319 |
"Whether or not to enable cautpure at the payload(data) portion of the packet", |
| 320 |
BooleanValue (false), |
| 321 |
MakeBooleanAccessor (&WifiPhy::GetPayloadCapture, |
| 322 |
&WifiPhy::SetPayloadCapture), |
| 323 |
MakeBooleanChecker ()) |
| 311 |
.AddTraceSource ("PhyTxBegin", |
324 |
.AddTraceSource ("PhyTxBegin", |
| 312 |
"Trace source indicating a packet " |
325 |
"Trace source indicating a packet " |
| 313 |
"has begun transmitting over the channel medium", |
326 |
"has begun transmitting over the channel medium", |
|
|
| 372 |
m_channelNumber (0), |
385 |
m_channelNumber (0), |
| 373 |
m_initialChannelNumber (0), |
386 |
m_initialChannelNumber (0), |
| 374 |
m_totalAmpduSize (0), |
387 |
m_totalAmpduSize (0), |
| 375 |
m_totalAmpduNumSymbols (0) |
388 |
m_totalAmpduNumSymbols (0), |
|
|
389 |
m_doPreambleCapture (false), |
| 390 |
m_doPayloadCapture (false) |
| 376 |
{ |
391 |
{ |
| 377 |
NS_LOG_FUNCTION (this); |
392 |
NS_LOG_FUNCTION (this); |
| 378 |
NS_UNUSED (m_numberOfTransmitters); |
393 |
NS_UNUSED (m_numberOfTransmitters); |
|
Lines 706-711
WifiPhy::GetChannelSwitchDelay (void) const
|
Link Here
|
|---|
|
| 706 |
return m_channelSwitchDelay; |
721 |
return m_channelSwitchDelay; |
| 707 |
} |
722 |
} |
| 708 |
|
723 |
|
|
|
724 |
void |
| 725 |
WifiPhy::SetPreambleCapture (bool enable) |
| 726 |
{ |
| 727 |
NS_LOG_FUNCTION (this << enable); |
| 728 |
m_doPreambleCapture = enable; |
| 729 |
} |
| 730 |
|
| 731 |
bool |
| 732 |
WifiPhy::GetPreambleCapture (void) const |
| 733 |
{ |
| 734 |
return m_doPreambleCapture; |
| 735 |
} |
| 736 |
|
| 737 |
void |
| 738 |
WifiPhy::SetPayloadCapture (bool enable) |
| 739 |
{ |
| 740 |
NS_LOG_FUNCTION (this << enable); |
| 741 |
m_doPayloadCapture = enable; |
| 742 |
} |
| 743 |
|
| 744 |
bool |
| 745 |
WifiPhy::GetPayloadCapture (void) const |
| 746 |
{ |
| 747 |
return m_doPayloadCapture; |
| 748 |
} |
| 749 |
|
| 709 |
double |
750 |
double |
| 710 |
WifiPhy::CalculateSnr (WifiTxVector txVector, double ber) const |
751 |
WifiPhy::CalculateSnr (WifiTxVector txVector, double ber) const |
| 711 |
{ |
752 |
{ |
|
Lines 2296-2301
WifiPhy::StartReceivePreambleAndHeader (Ptr<Packet> packet, double rxPowerW, Tim
|
Link Here
|
|---|
|
| 2296 |
txVector, |
2337 |
txVector, |
| 2297 |
rxDuration, |
2338 |
rxDuration, |
| 2298 |
rxPowerW); |
2339 |
rxPowerW); |
|
|
2340 |
Time currentRxStage = Seconds (0); |
| 2299 |
|
2341 |
|
| 2300 |
switch (m_state->GetState ()) |
2342 |
switch (m_state->GetState ()) |
| 2301 |
{ |
2343 |
{ |
|
Lines 2315-2334
WifiPhy::StartReceivePreambleAndHeader (Ptr<Packet> packet, double rxPowerW, Tim
|
Link Here
|
|---|
|
| 2315 |
{ |
2357 |
{ |
| 2316 |
//that packet will be noise _after_ the completion of the |
2358 |
//that packet will be noise _after_ the completion of the |
| 2317 |
//channel switching. |
2359 |
//channel switching. |
| 2318 |
goto maybeCcaBusy; |
2360 |
CalculateCcaBusyDuration (); |
| 2319 |
} |
2361 |
} |
| 2320 |
break; |
2362 |
break; |
| 2321 |
case WifiPhy::RX: |
2363 |
case WifiPhy::RX: |
| 2322 |
NS_LOG_DEBUG ("drop packet because already in Rx (power=" << |
2364 |
{ |
| 2323 |
rxPowerW << "W)"); |
2365 |
NS_ASSERT (m_rxPacketEvent != NULL); |
| 2324 |
NotifyRxDrop (packet); |
2366 |
if (preamble == WIFI_PREAMBLE_NONE) |
| 2325 |
if (endRx > Simulator::Now () + m_state->GetDelayUntilIdle ()) |
2367 |
{ |
| 2326 |
{ |
2368 |
NS_LOG_DEBUG ("New packet does not contains preamble/plcp header"); |
| 2327 |
//that packet will be noise _after_ the reception of the |
2369 |
NotifyRxDrop (packet); |
| 2328 |
//currently-received packet. |
2370 |
if (endRx > Simulator::Now () + m_state->GetDelayUntilIdle ()) |
| 2329 |
goto maybeCcaBusy; |
2371 |
{ |
| 2330 |
} |
2372 |
CalculateCcaBusyDuration (); |
| 2331 |
break; |
2373 |
} |
|
|
2374 |
break; |
| 2375 |
} |
| 2376 |
|
| 2377 |
currentRxStage = Simulator::Now() - m_rxPacketEvent->GetStartTime(); |
| 2378 |
bool doReceptionSwitch = false; |
| 2379 |
if (m_rxPreambleType != WIFI_PREAMBLE_NONE |
| 2380 |
&& currentRxStage < preambleAndHeaderDuration) // still receiving the preamble and plcp header portion of the old packet |
| 2381 |
{ |
| 2382 |
NS_LOG_DEBUG ("old preamble type "<<m_rxPreambleType |
| 2383 |
<<", new preamble type "<<preamble |
| 2384 |
<<", rxStage "<<currentRxStage); |
| 2385 |
doReceptionSwitch = CheckPreambleCapture (packet, event); |
| 2386 |
} |
| 2387 |
else |
| 2388 |
{ |
| 2389 |
doReceptionSwitch = CheckPayloadCapture (packet, event); |
| 2390 |
} |
| 2391 |
if (doReceptionSwitch) |
| 2392 |
{ |
| 2393 |
m_endPlcpRxEvent = Simulator::Schedule (preambleAndHeaderDuration, &WifiPhy::StartReceivePacket, this, |
| 2394 |
packet, txVector, mpdutype, event); |
| 2395 |
m_endRxEvent = Simulator::Schedule (rxDuration, &WifiPhy::EndReceive, this, |
| 2396 |
packet, preamble, mpdutype, event); |
| 2397 |
m_rxPreambleType = preamble; |
| 2398 |
} |
| 2399 |
break; |
| 2400 |
} |
| 2332 |
case WifiPhy::TX: |
2401 |
case WifiPhy::TX: |
| 2333 |
NS_LOG_DEBUG ("drop packet because already in Tx (power=" << |
2402 |
NS_LOG_DEBUG ("drop packet because already in Tx (power=" << |
| 2334 |
rxPowerW << "W)"); |
2403 |
rxPowerW << "W)"); |
|
Lines 2337-2343
WifiPhy::StartReceivePreambleAndHeader (Ptr<Packet> packet, double rxPowerW, Tim
|
Link Here
|
|---|
|
| 2337 |
{ |
2406 |
{ |
| 2338 |
//that packet will be noise _after_ the transmission of the |
2407 |
//that packet will be noise _after_ the transmission of the |
| 2339 |
//currently-transmitted packet. |
2408 |
//currently-transmitted packet. |
| 2340 |
goto maybeCcaBusy; |
2409 |
CalculateCcaBusyDuration (); |
| 2341 |
} |
2410 |
} |
| 2342 |
break; |
2411 |
break; |
| 2343 |
case WifiPhy::CCA_BUSY: |
2412 |
case WifiPhy::CCA_BUSY: |
|
Lines 2350-2356
WifiPhy::StartReceivePreambleAndHeader (Ptr<Packet> packet, double rxPowerW, Tim
|
Link Here
|
|---|
|
| 2350 |
m_mpdusNum = 0; |
2419 |
m_mpdusNum = 0; |
| 2351 |
NS_LOG_DEBUG ("drop packet because no PLCP preamble/header has been received"); |
2420 |
NS_LOG_DEBUG ("drop packet because no PLCP preamble/header has been received"); |
| 2352 |
NotifyRxDrop (packet); |
2421 |
NotifyRxDrop (packet); |
| 2353 |
goto maybeCcaBusy; |
2422 |
CalculateCcaBusyDuration (); |
| 2354 |
} |
2423 |
} |
| 2355 |
else if (preamble != WIFI_PREAMBLE_NONE && packet->PeekPacketTag (ampduTag) && m_mpdusNum == 0) |
2424 |
else if (preamble != WIFI_PREAMBLE_NONE && packet->PeekPacketTag (ampduTag) && m_mpdusNum == 0) |
| 2356 |
{ |
2425 |
{ |
|
Lines 2388-2393
WifiPhy::StartReceivePreambleAndHeader (Ptr<Packet> packet, double rxPowerW, Tim
|
Link Here
|
|---|
|
| 2388 |
NS_ASSERT (m_endPlcpRxEvent.IsExpired ()); |
2457 |
NS_ASSERT (m_endPlcpRxEvent.IsExpired ()); |
| 2389 |
NotifyRxBegin (packet); |
2458 |
NotifyRxBegin (packet); |
| 2390 |
m_interference.NotifyRxStart (); |
2459 |
m_interference.NotifyRxStart (); |
|
|
2460 |
m_rxPacket = packet; |
| 2461 |
m_rxPacketEvent = event; |
| 2462 |
m_rxPreambleType = preamble; |
| 2391 |
|
2463 |
|
| 2392 |
if (preamble != WIFI_PREAMBLE_NONE) |
2464 |
if (preamble != WIFI_PREAMBLE_NONE) |
| 2393 |
{ |
2465 |
{ |
|
Lines 2398-2404
WifiPhy::StartReceivePreambleAndHeader (Ptr<Packet> packet, double rxPowerW, Tim
|
Link Here
|
|---|
|
| 2398 |
|
2470 |
|
| 2399 |
NS_ASSERT (m_endRxEvent.IsExpired ()); |
2471 |
NS_ASSERT (m_endRxEvent.IsExpired ()); |
| 2400 |
m_endRxEvent = Simulator::Schedule (rxDuration, &WifiPhy::EndReceive, this, |
2472 |
m_endRxEvent = Simulator::Schedule (rxDuration, &WifiPhy::EndReceive, this, |
| 2401 |
packet, preamble, mpdutype, event); |
2473 |
packet, preamble, mpdutype, event); |
| 2402 |
} |
2474 |
} |
| 2403 |
else |
2475 |
else |
| 2404 |
{ |
2476 |
{ |
|
Lines 2406-2412
WifiPhy::StartReceivePreambleAndHeader (Ptr<Packet> packet, double rxPowerW, Tim
|
Link Here
|
|---|
|
| 2406 |
rxPowerW << "<" << GetEdThresholdW () << ")"); |
2478 |
rxPowerW << "<" << GetEdThresholdW () << ")"); |
| 2407 |
NotifyRxDrop (packet); |
2479 |
NotifyRxDrop (packet); |
| 2408 |
m_plcpSuccess = false; |
2480 |
m_plcpSuccess = false; |
| 2409 |
goto maybeCcaBusy; |
2481 |
CalculateCcaBusyDuration (); |
| 2410 |
} |
2482 |
} |
| 2411 |
break; |
2483 |
break; |
| 2412 |
case WifiPhy::SLEEP: |
2484 |
case WifiPhy::SLEEP: |
|
Lines 2417-2424
WifiPhy::StartReceivePreambleAndHeader (Ptr<Packet> packet, double rxPowerW, Tim
|
Link Here
|
|---|
|
| 2417 |
} |
2489 |
} |
| 2418 |
|
2490 |
|
| 2419 |
return; |
2491 |
return; |
|
|
2492 |
} |
| 2420 |
|
2493 |
|
| 2421 |
maybeCcaBusy: |
2494 |
void |
|
|
2495 |
WifiPhy::CalculateCcaBusyDuration () |
| 2496 |
{ |
| 2497 |
// maybeCcaBusy: |
| 2422 |
//We are here because we have received the first bit of a packet and we are |
2498 |
//We are here because we have received the first bit of a packet and we are |
| 2423 |
//not going to be able to synchronize on it |
2499 |
//not going to be able to synchronize on it |
| 2424 |
//In this model, CCA becomes busy when the aggregation of all signals as |
2500 |
//In this model, CCA becomes busy when the aggregation of all signals as |
|
|
| 2431 |
} |
2507 |
} |
| 2432 |
} |
2508 |
} |
| 2433 |
|
2509 |
|
|
|
2510 |
bool |
| 2511 |
WifiPhy::CheckPreambleCapture (Ptr<Packet> packet, Ptr<InterferenceHelper::Event> event) |
| 2512 |
{ |
| 2513 |
NS_LOG_DEBUG (Simulator::Now() << ", preamble capture check: old reception event start at " |
| 2514 |
<< m_rxPacketEvent->GetStartTime() |
| 2515 |
<< ", old preamble type "<<m_rxPreambleType |
| 2516 |
<< ", end at " << m_rxPacketEvent->GetEndTime() |
| 2517 |
<< ", old rxPower "<< m_rxPacketEvent->GetRxPowerW()); |
| 2518 |
bool result = false; |
| 2519 |
Time endRx = event->GetEndTime(); |
| 2520 |
InterferenceHelper::SnrPer snrPer; |
| 2521 |
snrPer = m_interference.CalculatePlcpHeaderSnrPer (m_rxPacketEvent); // check whether the plcp header can still decoded |
| 2522 |
NS_LOG_DEBUG ("snr(dB)=" << RatioToDb (snrPer.snr) << ", per=" << snrPer.per); |
| 2523 |
if (m_random->GetValue () > snrPer.per) // the reception of the old packet can be continued |
| 2524 |
{ |
| 2525 |
NS_ASSERT (m_endPlcpRxEvent.IsRunning()); |
| 2526 |
NS_LOG_INFO (Simulator::Now() << " preamble capture check: dropping newly arrived packet" |
| 2527 |
<< ", because already sync to a stronger enough signal"); |
| 2528 |
NotifyRxDrop (packet); |
| 2529 |
if (endRx > Simulator::Now() + m_state->GetDelayUntilIdle()) |
| 2530 |
{ |
| 2531 |
CalculateCcaBusyDuration (); |
| 2532 |
} |
| 2533 |
} |
| 2534 |
else // the reception of the old packet cannot be continued |
| 2535 |
{ |
| 2536 |
NS_LOG_INFO (Simulator::Now() << " preamble capture check: dropping currently received packet"); |
| 2537 |
AbortCurrentReception (m_rxPacket, snrPer.snr); |
| 2538 |
if (m_doPreambleCapture) // if the frame capture capability at preamble is enabled, check whether can |
| 2539 |
// switch to the new packet |
| 2540 |
{ |
| 2541 |
NS_ASSERT (m_endPlcpRxEvent.IsExpired() && m_endRxEvent.IsExpired()); |
| 2542 |
NS_LOG_INFO (Simulator::Now()<< " preamble capture check: switch to new packet"); |
| 2543 |
InterferenceHelper::SnrPer snrPerForNewPkt; |
| 2544 |
snrPerForNewPkt = m_interference.CalculatePlcpHeaderSnrPer (event); |
| 2545 |
double prob = m_interference.CalculatePreambleCaptureProbability(snrPerForNewPkt.snr); |
| 2546 |
if (m_random->GetValue () < prob) |
| 2547 |
{ |
| 2548 |
SwitchReception (packet, event); |
| 2549 |
result = true; |
| 2550 |
} |
| 2551 |
else |
| 2552 |
{ |
| 2553 |
NS_LOG_INFO (Simulator::Now()<<" preamble capture: signal is too low for capture"); |
| 2554 |
NotifyRxDrop (packet); |
| 2555 |
if (endRx > Simulator::Now() + m_state->GetDelayUntilIdle()) |
| 2556 |
{ |
| 2557 |
CalculateCcaBusyDuration (); |
| 2558 |
} |
| 2559 |
} |
| 2560 |
} |
| 2561 |
else // if the frame capture is not enabled, drop the packet |
| 2562 |
{ |
| 2563 |
NS_LOG_INFO (Simulator::Now()<<" preamble capture check: drop packet because already receiving"); |
| 2564 |
NotifyRxDrop (packet); |
| 2565 |
if (endRx > Simulator::Now() + m_state->GetDelayUntilIdle()) |
| 2566 |
{ |
| 2567 |
CalculateCcaBusyDuration (); |
| 2568 |
} |
| 2569 |
} |
| 2570 |
} |
| 2571 |
return result; |
| 2572 |
} |
| 2573 |
|
| 2574 |
bool |
| 2575 |
WifiPhy::CheckPayloadCapture (Ptr<Packet> packet, Ptr<InterferenceHelper::Event> event) |
| 2576 |
{ |
| 2577 |
NS_LOG_DEBUG (Simulator::Now() << ", payload capture check: old reception event start at " |
| 2578 |
<< m_rxPacketEvent->GetStartTime() |
| 2579 |
<< ", end at " << m_rxPacketEvent->GetEndTime() |
| 2580 |
<< ", old rxPower "<< m_rxPacketEvent->GetRxPowerW()); |
| 2581 |
bool result = false; |
| 2582 |
Time endRx = event->GetEndTime(); |
| 2583 |
InterferenceHelper::SnrPer snrPer; |
| 2584 |
snrPer = m_interference.CalculatePlcpPayloadSnrPer(m_rxPacketEvent); // check whether the plcp header can still decoded |
| 2585 |
NS_LOG_DEBUG ("snr(dB)=" << RatioToDb (snrPer.snr) << ", per=" << snrPer.per); |
| 2586 |
if (m_random->GetValue () > snrPer.per) // the reception of the old packet can be continued |
| 2587 |
{ |
| 2588 |
NS_ASSERT (m_endRxEvent.IsRunning()); |
| 2589 |
NS_LOG_INFO (Simulator::Now() << " payload capture check: dropping newly arrived packet" |
| 2590 |
<< ", because already sync to a stronger enough signal"); |
| 2591 |
NotifyRxDrop (packet); |
| 2592 |
if (endRx > Simulator::Now() + m_state->GetDelayUntilIdle()) |
| 2593 |
{ |
| 2594 |
CalculateCcaBusyDuration (); |
| 2595 |
} |
| 2596 |
} |
| 2597 |
else // the reception of the old packet cannot be continued |
| 2598 |
{ |
| 2599 |
NS_LOG_INFO (Simulator::Now() << " preamble capture check: dropping currently received packet"); |
| 2600 |
AbortCurrentReception (m_rxPacket, snrPer.snr); |
| 2601 |
if (m_doPayloadCapture) // if the frame capture capability at preamble is enabled, check whether can |
| 2602 |
// switch to the new packet |
| 2603 |
{ |
| 2604 |
NS_ASSERT (m_endPlcpRxEvent.IsExpired() && m_endRxEvent.IsExpired()); |
| 2605 |
NS_LOG_INFO (Simulator::Now()<< " payload capture check: switch to new packet"); |
| 2606 |
InterferenceHelper::SnrPer snrPerForNewPkt; |
| 2607 |
snrPerForNewPkt = m_interference.CalculatePlcpPayloadSnrPer (event); |
| 2608 |
double prob = m_interference.CalculatePayloadCaptureProbability (snrPerForNewPkt.snr); |
| 2609 |
if (m_random->GetValue () < prob) |
| 2610 |
{ |
| 2611 |
SwitchReception (packet, event); |
| 2612 |
result = true; |
| 2613 |
} |
| 2614 |
else |
| 2615 |
{ |
| 2616 |
NS_LOG_INFO (Simulator::Now()<<" payload capture: signal is too low for capture"); |
| 2617 |
NotifyRxDrop (packet); |
| 2618 |
if (endRx > Simulator::Now() + m_state->GetDelayUntilIdle()) |
| 2619 |
{ |
| 2620 |
CalculateCcaBusyDuration (); |
| 2621 |
} |
| 2622 |
} |
| 2623 |
} |
| 2624 |
else // if the frame capture is not enabled, drop the packet |
| 2625 |
{ |
| 2626 |
NS_LOG_INFO (Simulator::Now()<<" payload capture check: drop packet because already receiving"); |
| 2627 |
NotifyRxDrop (packet); |
| 2628 |
if (endRx > Simulator::Now() + m_state->GetDelayUntilIdle()) |
| 2629 |
{ |
| 2630 |
CalculateCcaBusyDuration (); |
| 2631 |
} |
| 2632 |
} |
| 2633 |
} |
| 2634 |
return result; |
| 2635 |
} |
| 2636 |
|
| 2637 |
void |
| 2638 |
WifiPhy::AbortCurrentReception (Ptr<Packet> packet, double snr) |
| 2639 |
{ |
| 2640 |
if (m_endPlcpRxEvent.IsRunning()) |
| 2641 |
{ |
| 2642 |
m_endPlcpRxEvent.Cancel(); |
| 2643 |
} |
| 2644 |
if (m_endRxEvent.IsRunning()) |
| 2645 |
{ |
| 2646 |
m_endRxEvent.Cancel(); |
| 2647 |
} |
| 2648 |
m_interference.NotifyRxEnd(); |
| 2649 |
m_state->SwitchFromRxAbort(packet, snr); |
| 2650 |
m_rxPacket = NULL; |
| 2651 |
m_rxPacketEvent = NULL; |
| 2652 |
m_rxPreambleType = WIFI_PREAMBLE_NONE; |
| 2653 |
} |
| 2654 |
|
| 2655 |
void |
| 2656 |
WifiPhy::SwitchReception (Ptr<Packet> packet, Ptr<InterferenceHelper::Event> event) |
| 2657 |
{ |
| 2658 |
m_rxPacket = packet; |
| 2659 |
m_rxPacketEvent = event; |
| 2660 |
m_state->SwitchToRx (event->GetDuration()); |
| 2661 |
NotifyRxBegin (packet); |
| 2662 |
m_interference.NotifyRxStart(); |
| 2663 |
} |
| 2664 |
|
| 2434 |
void |
2665 |
void |
| 2435 |
WifiPhy::StartReceivePacket (Ptr<Packet> packet, |
2666 |
WifiPhy::StartReceivePacket (Ptr<Packet> packet, |
| 2436 |
WifiTxVector txVector, |
2667 |
WifiTxVector txVector, |
|
Lines 2459-2464
WifiPhy::StartReceivePacket (Ptr<Packet> packet,
|
Link Here
|
|---|
|
| 2459 |
NS_LOG_DEBUG ("drop packet because it was sent using an unsupported mode (" << txMode << ")"); |
2690 |
NS_LOG_DEBUG ("drop packet because it was sent using an unsupported mode (" << txMode << ")"); |
| 2460 |
NotifyRxDrop (packet); |
2691 |
NotifyRxDrop (packet); |
| 2461 |
m_plcpSuccess = false; |
2692 |
m_plcpSuccess = false; |
|
|
2693 |
AbortCurrentReception (packet, snrPer.snr); |
| 2694 |
CalculateCcaBusyDuration (); |
| 2462 |
} |
2695 |
} |
| 2463 |
} |
2696 |
} |
| 2464 |
else //plcp reception failed |
2697 |
else //plcp reception failed |
|
Lines 2466-2471
WifiPhy::StartReceivePacket (Ptr<Packet> packet,
|
Link Here
|
|---|
|
| 2466 |
NS_LOG_DEBUG ("drop packet because plcp preamble/header reception failed"); |
2699 |
NS_LOG_DEBUG ("drop packet because plcp preamble/header reception failed"); |
| 2467 |
NotifyRxDrop (packet); |
2700 |
NotifyRxDrop (packet); |
| 2468 |
m_plcpSuccess = false; |
2701 |
m_plcpSuccess = false; |
|
|
2702 |
AbortCurrentReception (packet, snrPer.snr); |
| 2703 |
CalculateCcaBusyDuration (); |
| 2469 |
} |
2704 |
} |
| 2470 |
} |
2705 |
} |
| 2471 |
|
2706 |
|