|
|
| 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 (true), |
| 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 (true), |
| 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 (true), |
| 390 |
m_doPayloadCapture (true) |
| 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 |
currentRxStage = Simulator::Now() - m_rxPacketEvent->GetStartTime(); |
| 2325 |
if (endRx > Simulator::Now () + m_state->GetDelayUntilIdle ()) |
2367 |
bool doReceptionSwitch = false; |
| 2326 |
{ |
2368 |
if (currentRxStage <= preambleAndHeaderDuration) // still receiving the preamble and plcp header portion of the old packet |
| 2327 |
//that packet will be noise _after_ the reception of the |
2369 |
{ |
| 2328 |
//currently-received packet. |
2370 |
doReceptionSwitch = CheckPreambleCapture (packet, event); |
| 2329 |
goto maybeCcaBusy; |
2371 |
} |
| 2330 |
} |
2372 |
else |
| 2331 |
break; |
2373 |
{ |
|
|
2374 |
doReceptionSwitch = CheckPayloadCapture (packet, event); |
| 2375 |
} |
| 2376 |
if (doReceptionSwitch) |
| 2377 |
{ |
| 2378 |
m_endPlcpRxEvent = Simulator::Schedule (preambleAndHeaderDuration, &WifiPhy::StartReceivePacket, this, |
| 2379 |
packet, txVector, mpdutype, event); |
| 2380 |
} |
| 2381 |
break; |
| 2382 |
} |
| 2332 |
case WifiPhy::TX: |
2383 |
case WifiPhy::TX: |
| 2333 |
NS_LOG_DEBUG ("drop packet because already in Tx (power=" << |
2384 |
NS_LOG_DEBUG ("drop packet because already in Tx (power=" << |
| 2334 |
rxPowerW << "W)"); |
2385 |
rxPowerW << "W)"); |
|
Lines 2337-2343
WifiPhy::StartReceivePreambleAndHeader (Ptr<Packet> packet, double rxPowerW, Tim
|
Link Here
|
|---|
|
| 2337 |
{ |
2388 |
{ |
| 2338 |
//that packet will be noise _after_ the transmission of the |
2389 |
//that packet will be noise _after_ the transmission of the |
| 2339 |
//currently-transmitted packet. |
2390 |
//currently-transmitted packet. |
| 2340 |
goto maybeCcaBusy; |
2391 |
CalculateCcaBusyDuration (); |
| 2341 |
} |
2392 |
} |
| 2342 |
break; |
2393 |
break; |
| 2343 |
case WifiPhy::CCA_BUSY: |
2394 |
case WifiPhy::CCA_BUSY: |
|
Lines 2350-2356
WifiPhy::StartReceivePreambleAndHeader (Ptr<Packet> packet, double rxPowerW, Tim
|
Link Here
|
|---|
|
| 2350 |
m_mpdusNum = 0; |
2401 |
m_mpdusNum = 0; |
| 2351 |
NS_LOG_DEBUG ("drop packet because no PLCP preamble/header has been received"); |
2402 |
NS_LOG_DEBUG ("drop packet because no PLCP preamble/header has been received"); |
| 2352 |
NotifyRxDrop (packet); |
2403 |
NotifyRxDrop (packet); |
| 2353 |
goto maybeCcaBusy; |
2404 |
CalculateCcaBusyDuration (); |
| 2354 |
} |
2405 |
} |
| 2355 |
else if (preamble != WIFI_PREAMBLE_NONE && packet->PeekPacketTag (ampduTag) && m_mpdusNum == 0) |
2406 |
else if (preamble != WIFI_PREAMBLE_NONE && packet->PeekPacketTag (ampduTag) && m_mpdusNum == 0) |
| 2356 |
{ |
2407 |
{ |
|
Lines 2388-2393
WifiPhy::StartReceivePreambleAndHeader (Ptr<Packet> packet, double rxPowerW, Tim
|
Link Here
|
|---|
|
| 2388 |
NS_ASSERT (m_endPlcpRxEvent.IsExpired ()); |
2439 |
NS_ASSERT (m_endPlcpRxEvent.IsExpired ()); |
| 2389 |
NotifyRxBegin (packet); |
2440 |
NotifyRxBegin (packet); |
| 2390 |
m_interference.NotifyRxStart (); |
2441 |
m_interference.NotifyRxStart (); |
|
|
2442 |
m_rxPacket = packet; |
| 2443 |
m_rxPacketEvent = event; |
| 2391 |
|
2444 |
|
| 2392 |
if (preamble != WIFI_PREAMBLE_NONE) |
2445 |
if (preamble != WIFI_PREAMBLE_NONE) |
| 2393 |
{ |
2446 |
{ |
|
Lines 2395-2404
WifiPhy::StartReceivePreambleAndHeader (Ptr<Packet> packet, double rxPowerW, Tim
|
Link Here
|
|---|
|
| 2395 |
m_endPlcpRxEvent = Simulator::Schedule (preambleAndHeaderDuration, &WifiPhy::StartReceivePacket, this, |
2448 |
m_endPlcpRxEvent = Simulator::Schedule (preambleAndHeaderDuration, &WifiPhy::StartReceivePacket, this, |
| 2396 |
packet, txVector, mpdutype, event); |
2449 |
packet, txVector, mpdutype, event); |
| 2397 |
} |
2450 |
} |
| 2398 |
|
|
|
| 2399 |
NS_ASSERT (m_endRxEvent.IsExpired ()); |
| 2400 |
m_endRxEvent = Simulator::Schedule (rxDuration, &WifiPhy::EndReceive, this, |
| 2401 |
packet, preamble, mpdutype, event); |
| 2402 |
} |
2451 |
} |
| 2403 |
else |
2452 |
else |
| 2404 |
{ |
2453 |
{ |
|
Lines 2406-2412
WifiPhy::StartReceivePreambleAndHeader (Ptr<Packet> packet, double rxPowerW, Tim
|
Link Here
|
|---|
|
| 2406 |
rxPowerW << "<" << GetEdThresholdW () << ")"); |
2455 |
rxPowerW << "<" << GetEdThresholdW () << ")"); |
| 2407 |
NotifyRxDrop (packet); |
2456 |
NotifyRxDrop (packet); |
| 2408 |
m_plcpSuccess = false; |
2457 |
m_plcpSuccess = false; |
| 2409 |
goto maybeCcaBusy; |
2458 |
CalculateCcaBusyDuration (); |
| 2410 |
} |
2459 |
} |
| 2411 |
break; |
2460 |
break; |
| 2412 |
case WifiPhy::SLEEP: |
2461 |
case WifiPhy::SLEEP: |
|
Lines 2417-2424
WifiPhy::StartReceivePreambleAndHeader (Ptr<Packet> packet, double rxPowerW, Tim
|
Link Here
|
|---|
|
| 2417 |
} |
2466 |
} |
| 2418 |
|
2467 |
|
| 2419 |
return; |
2468 |
return; |
|
|
2469 |
} |
| 2420 |
|
2470 |
|
| 2421 |
maybeCcaBusy: |
2471 |
void |
|
|
2472 |
WifiPhy::CalculateCcaBusyDuration () |
| 2473 |
{ |
| 2474 |
// maybeCcaBusy: |
| 2422 |
//We are here because we have received the first bit of a packet and we are |
2475 |
//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 |
2476 |
//not going to be able to synchronize on it |
| 2424 |
//In this model, CCA becomes busy when the aggregation of all signals as |
2477 |
//In this model, CCA becomes busy when the aggregation of all signals as |
|
|
| 2431 |
} |
2484 |
} |
| 2432 |
} |
2485 |
} |
| 2433 |
|
2486 |
|
|
|
2487 |
bool |
| 2488 |
WifiPhy::CheckPreambleCapture (Ptr<Packet> packet, Ptr<InterferenceHelper::Event> event) |
| 2489 |
{ |
| 2490 |
NS_LOG_DEBUG (Simulator::Now() << ", preamble capture check: old reception event start at " |
| 2491 |
<< m_rxPacketEvent->GetStartTime() |
| 2492 |
<< ", end at " << m_rxPacketEvent->GetEndTime() |
| 2493 |
<< ", old rxPower "<< m_rxPacketEvent->GetRxPowerW()); |
| 2494 |
bool result = false; |
| 2495 |
Time endRx = event->GetEndTime(); |
| 2496 |
InterferenceHelper::SnrPer snrPer; |
| 2497 |
snrPer = m_interference.CalculatePlcpHeaderSnrPer (m_rxPacketEvent); // check whether the plcp header can still decoded |
| 2498 |
NS_LOG_DEBUG ("snr(dB)=" << RatioToDb (snrPer.snr) << ", per=" << snrPer.per); |
| 2499 |
if (m_random->GetValue () > snrPer.per) // the reception of the old packet can be continued |
| 2500 |
{ |
| 2501 |
NS_ASSERT (m_endPlcpRxEvent.IsRunning()); |
| 2502 |
NS_LOG_INFO (Simulator::Now() << " preamble capture check: dropping newly arrived packet" |
| 2503 |
<< ", because already sync to a stronger enough signal"); |
| 2504 |
NotifyRxDrop (packet); |
| 2505 |
if (endRx > Simulator::Now() + m_state->GetDelayUntilIdle()) |
| 2506 |
{ |
| 2507 |
CalculateCcaBusyDuration (); |
| 2508 |
} |
| 2509 |
} |
| 2510 |
else // the reception of the old packet cannot be continued |
| 2511 |
{ |
| 2512 |
NS_LOG_INFO (Simulator::Now() << " preamble capture check: dropping currently received packet"); |
| 2513 |
AbortCurrentReception (); |
| 2514 |
if (m_doPreambleCapture) // if the frame capture capability at preamble is enabled, check whether can |
| 2515 |
// switch to the new packet |
| 2516 |
{ |
| 2517 |
NS_ASSERT (m_endPlcpRxEvent.IsExpired() && m_endRxEvent.IsExpired()); |
| 2518 |
NS_LOG_INFO (Simulator::Now()<< " preamble capture check: switch to new packet"); |
| 2519 |
InterferenceHelper::SnrPer snrPerForNewPkt; |
| 2520 |
snrPerForNewPkt = m_interference.CalculatePlcpHeaderSnrPer (event); |
| 2521 |
double prob = m_interference.CalculatePreambleCaptureProbability(snrPerForNewPkt.snr); |
| 2522 |
if (m_random->GetValue () < prob) |
| 2523 |
{ |
| 2524 |
SwitchReception (packet, event); |
| 2525 |
result = true; |
| 2526 |
} |
| 2527 |
else |
| 2528 |
{ |
| 2529 |
NS_LOG_INFO (Simulator::Now()<<" preamble capture: signal is too low for capture"); |
| 2530 |
NotifyRxDrop (packet); |
| 2531 |
if (endRx > Simulator::Now() + m_state->GetDelayUntilIdle()) |
| 2532 |
{ |
| 2533 |
CalculateCcaBusyDuration (); |
| 2534 |
} |
| 2535 |
} |
| 2536 |
} |
| 2537 |
else // if the frame capture is not enabled, drop the packet |
| 2538 |
{ |
| 2539 |
NS_LOG_INFO (Simulator::Now()<<" preamble capture check: drop packet because already receiving"); |
| 2540 |
NotifyRxDrop (packet); |
| 2541 |
if (endRx > Simulator::Now() + m_state->GetDelayUntilIdle()) |
| 2542 |
{ |
| 2543 |
CalculateCcaBusyDuration (); |
| 2544 |
} |
| 2545 |
} |
| 2546 |
} |
| 2547 |
return result; |
| 2548 |
} |
| 2549 |
|
| 2550 |
bool |
| 2551 |
WifiPhy::CheckPayloadCapture (Ptr<Packet> packet, Ptr<InterferenceHelper::Event> event) |
| 2552 |
{ |
| 2553 |
NS_LOG_DEBUG (Simulator::Now() << ", payload capture check: old reception event start at " |
| 2554 |
<< m_rxPacketEvent->GetStartTime() |
| 2555 |
<< ", end at " << m_rxPacketEvent->GetEndTime() |
| 2556 |
<< ", old rxPower "<< m_rxPacketEvent->GetRxPowerW()); |
| 2557 |
bool result = false; |
| 2558 |
Time endRx = event->GetEndTime(); |
| 2559 |
InterferenceHelper::SnrPer snrPer; |
| 2560 |
snrPer = m_interference.CalculatePlcpPayloadSnrPer(m_rxPacketEvent); // check whether the plcp header can still decoded |
| 2561 |
NS_LOG_DEBUG ("snr(dB)=" << RatioToDb (snrPer.snr) << ", per=" << snrPer.per); |
| 2562 |
if (m_random->GetValue () > snrPer.per) // the reception of the old packet can be continued |
| 2563 |
{ |
| 2564 |
NS_ASSERT (m_endRxEvent.IsRunning()); |
| 2565 |
NS_LOG_INFO (Simulator::Now() << " payload capture check: dropping newly arrived packet" |
| 2566 |
<< ", because already sync to a stronger enough signal"); |
| 2567 |
NotifyRxDrop (packet); |
| 2568 |
if (endRx > Simulator::Now() + m_state->GetDelayUntilIdle()) |
| 2569 |
{ |
| 2570 |
CalculateCcaBusyDuration (); |
| 2571 |
} |
| 2572 |
} |
| 2573 |
else // the reception of the old packet cannot be continued |
| 2574 |
{ |
| 2575 |
NS_LOG_INFO (Simulator::Now() << " preamble capture check: dropping currently received packet"); |
| 2576 |
AbortCurrentReception (); |
| 2577 |
if (m_doPayloadCapture) // if the frame capture capability at preamble is enabled, check whether can |
| 2578 |
// switch to the new packet |
| 2579 |
{ |
| 2580 |
NS_ASSERT (m_endPlcpRxEvent.IsExpired() && m_endRxEvent.IsExpired()); |
| 2581 |
NS_LOG_INFO (Simulator::Now()<< " payload capture check: switch to new packet"); |
| 2582 |
InterferenceHelper::SnrPer snrPerForNewPkt; |
| 2583 |
snrPerForNewPkt = m_interference.CalculatePlcpPayloadSnrPer (event); |
| 2584 |
double prob = m_interference.CalculatePayloadCaptureProbability (snrPerForNewPkt.snr); |
| 2585 |
if (m_random->GetValue () < prob) |
| 2586 |
{ |
| 2587 |
SwitchReception (packet, event); |
| 2588 |
result = true; |
| 2589 |
} |
| 2590 |
else |
| 2591 |
{ |
| 2592 |
NS_LOG_INFO (Simulator::Now()<<" payload capture: signal is too low for capture"); |
| 2593 |
NotifyRxDrop (packet); |
| 2594 |
if (endRx > Simulator::Now() + m_state->GetDelayUntilIdle()) |
| 2595 |
{ |
| 2596 |
CalculateCcaBusyDuration (); |
| 2597 |
} |
| 2598 |
} |
| 2599 |
} |
| 2600 |
else // if the frame capture is not enabled, drop the packet |
| 2601 |
{ |
| 2602 |
NS_LOG_INFO (Simulator::Now()<<" payload capture check: drop packet because already receiving"); |
| 2603 |
NotifyRxDrop (packet); |
| 2604 |
if (endRx > Simulator::Now() + m_state->GetDelayUntilIdle()) |
| 2605 |
{ |
| 2606 |
CalculateCcaBusyDuration (); |
| 2607 |
} |
| 2608 |
} |
| 2609 |
} |
| 2610 |
return result; |
| 2611 |
} |
| 2612 |
|
| 2613 |
void |
| 2614 |
WifiPhy::AbortCurrentReception () |
| 2615 |
{ |
| 2616 |
if (m_endPlcpRxEvent.IsRunning()) |
| 2617 |
{ |
| 2618 |
m_endPlcpRxEvent.Cancel(); |
| 2619 |
} |
| 2620 |
if (m_endRxEvent.IsRunning()) |
| 2621 |
{ |
| 2622 |
m_endRxEvent.Cancel(); |
| 2623 |
} |
| 2624 |
m_interference.NotifyRxEnd(); |
| 2625 |
m_state->SwitchFromRxAbort(); |
| 2626 |
m_rxPacket = NULL; |
| 2627 |
m_rxPacketEvent = NULL; |
| 2628 |
} |
| 2629 |
|
| 2630 |
void |
| 2631 |
WifiPhy::SwitchReception (Ptr<Packet> packet, Ptr<InterferenceHelper::Event> event) |
| 2632 |
{ |
| 2633 |
m_rxPacket = packet; |
| 2634 |
m_rxPacketEvent = event; |
| 2635 |
m_state->SwitchToRx (event->GetDuration()); |
| 2636 |
NotifyRxBegin (packet); |
| 2637 |
m_interference.NotifyRxStart(); |
| 2638 |
} |
| 2639 |
|
| 2434 |
void |
2640 |
void |
| 2435 |
WifiPhy::StartReceivePacket (Ptr<Packet> packet, |
2641 |
WifiPhy::StartReceivePacket (Ptr<Packet> packet, |
| 2436 |
WifiTxVector txVector, |
2642 |
WifiTxVector txVector, |
|
Lines 2453-2464
WifiPhy::StartReceivePacket (Ptr<Packet> packet,
|
Link Here
|
|---|
|
| 2453 |
{ |
2659 |
{ |
| 2454 |
NS_LOG_DEBUG ("receiving plcp payload"); //endReceive is already scheduled |
2660 |
NS_LOG_DEBUG ("receiving plcp payload"); //endReceive is already scheduled |
| 2455 |
m_plcpSuccess = true; |
2661 |
m_plcpSuccess = true; |
|
|
2662 |
WifiPreamble preamble = txVector.GetPreambleType (); |
| 2663 |
Time preambleAndHeaderDuration = CalculatePlcpPreambleAndHeaderDuration (txVector); |
| 2664 |
m_endRxEvent = Simulator::Schedule (event->GetDuration() - preambleAndHeaderDuration, &WifiPhy::EndReceive, this, |
| 2665 |
packet, preamble, mpdutype, event); |
| 2456 |
} |
2666 |
} |
| 2457 |
else //mode is not allowed |
2667 |
else //mode is not allowed |
| 2458 |
{ |
2668 |
{ |
| 2459 |
NS_LOG_DEBUG ("drop packet because it was sent using an unsupported mode (" << txMode << ")"); |
2669 |
NS_LOG_DEBUG ("drop packet because it was sent using an unsupported mode (" << txMode << ")"); |
| 2460 |
NotifyRxDrop (packet); |
2670 |
NotifyRxDrop (packet); |
| 2461 |
m_plcpSuccess = false; |
2671 |
m_plcpSuccess = false; |
|
|
2672 |
AbortCurrentReception (); |
| 2673 |
CalculateCcaBusyDuration (); |
| 2462 |
} |
2674 |
} |
| 2463 |
} |
2675 |
} |
| 2464 |
else //plcp reception failed |
2676 |
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"); |
2678 |
NS_LOG_DEBUG ("drop packet because plcp preamble/header reception failed"); |
| 2467 |
NotifyRxDrop (packet); |
2679 |
NotifyRxDrop (packet); |
| 2468 |
m_plcpSuccess = false; |
2680 |
m_plcpSuccess = false; |
|
|
2681 |
AbortCurrentReception (); |
| 2682 |
CalculateCcaBusyDuration (); |
| 2469 |
} |
2683 |
} |
| 2470 |
} |
2684 |
} |
| 2471 |
|
2685 |
|