MAC过滤过程中丢包错误

时间:2019-04-09 10:33:10

标签: macos filtering ns-3

我正在尝试从设备FF:FF向00:01和00:02设备发送一个数据包,但是由于MAC过滤,该数据包已被丢弃。这可能是由于数据包在队列中。我收到以下错误

Packet of size 100 was dropped during MAC filtering

有人知道如何解决吗? 这是我的代码。

  static void PacketSendInfo (Ptr<LrWpanNetDevice> dev, Ptr<const Packet> 
  p, 
  uint8_t retries, uint8_t csmaca_backoffs)
{
BasicPacketData bpd (p);
NS_LOG_UNCOND ("----------MSDU SEND INFO----------\n"
<< "Packet with sequence number "<< int(bpd.seq_nr)        
    <<"\n"
<< "was sent or given up on device with address " << dev->GetMac()- 
    >GetShortAddress() << "\n"
<< "Number of sending retries " << int(retries)<<"\n"
<< "Number of CSMA/CA backoffs " << int(csmaca_backoffs) << "\n"
<< "----------MSDU SEND INFO------------\n"

   }

   static void PacketDropped (Ptr<LrWpanNetDevice> dev, Ptr<const Packet> 
   p)
   {

BasicPacketData bpd (p);
NS_LOG_UNCOND ("----------Packet dropped----------\n"
        << "Packet of size " << bpd.size << " was dropped 
    during MAC filtering\n"
<< "on device with address "<<dev->GetMac()->GetShortAddress()<<"\n"
<< "coming from address " << bpd.src << " to address " << bpd.dst << 
    "\n" 
        << "sequence number is " << (int) bpd.seq_nr << "\n"
        << "PAN ID is " << bpd.pan_id << "\n"
        << "----------Packet dropped------------\n\n"
 );
     }



Ptr< Packet> createpacketschallenge(Ptr<LrWpanNetDevice> dev, 
Ptr<LrWpanNetDevice> dev3)
{
Ptr< Packet> packet;

if (dev->GetMac()->GetShortAddress() == ("FF:FF") && dev3->GetMac()- 
>GetShortAddress() == ("00:01") ){


std::string packettype = ("01");
std::string packetInformation = ("4565613685534302");
packettype += packetInformation;
std::stringstream msgx;
msgx << packettype;
uint16_t packetSize = msgx.str().length()+1;
packet = Create<Packet>((uint8_t*) msgx.str().c_str(), packetSize);

}
 }

0 个答案:

没有答案