802.11 Data Frame - Malformed Packet in wireshark

1,012 views
Skip to first unread message

Geovany Teca

unread,
Apr 7, 2022, 4:46:55 AM4/7/22
to ns-3-...@googlegroups.com
Hi Everyone, 
I am simulating a Wireless Local Network (Wi-Fi) using an On-Off application traffic generator as shown below. I am able to see the content of probe request/response, association request/response, beacon, and ACK, but for the 802.11 Data frame, it shows me a Malformed Packet error. From Wireshark, it seems that the protocol versions field is set to 2, the allowed value for this field according to the 802.11 standard is 0x00, but the thing is that I don't change the Header of any frame that is exchanged. I took the third.cc tutorial and I am able to see UDP frames in the CSMA network, but when I implemented the same UDP application for Wi-Fi the Data frame in Wireshark has the same Malformed Packet error. Is the problem with Wireshark, that it cannot read 802.11 Data frames or ns-3 is not generating 802.11 data frames properly? Thank you in advance for any explanation or help.
PS: Wireshark error also attached.

Best regards
Geovani

ApplicationContainer clientApp, serverApp;
    uint32_t serverPort = 9;
    for(int i = 0; i < nStations; ++i)
    {
      auto ipv4 = wifiApNode.Get (0)->GetObject<Ipv4> ();
      const auto address = ipv4->GetAddress (1, 0).GetLocal ();
      InetSocketAddress serverSocket (address, serverPort++);
      OnOffHelper onoff ("ns3::UdpSocketFactory", serverSocket);
      onoff.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1]"));
      onoff.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0]"));
      onoff.SetConstantRate (DataRate (offeredLoad + "Mbps"), packetSize);
      clientApp.Add(onoff.Install(wifiStaNodes.Get(i)));
      PacketSinkHelper packetSinkHelper ("ns3::UdpSocketFactory", serverSocket);
      serverApp.Add(packetSinkHelper.Install(wifiApNode.Get(0)));
    }

    serverApp.Start (Seconds (0.0));
    serverApp.Stop (Seconds (simulationTime + 1.0));
    clientApp.Start (Seconds (1.0));
    clientApp.Stop (Seconds (simulationTime + 1.0));

Malformed Packet.png

Tom Henderson

unread,
Apr 7, 2022, 10:13:18 AM4/7/22
to ns-3-...@googlegroups.com, Geovany Teca
On 4/7/22 01:46, Geovany Teca wrote:
> Hi Everyone,
> I am simulating a Wireless Local Network (Wi-Fi) using an On-Off
> application traffic generator as shown below. I am able to see the
> content of probe request/response, association request/response,
> beacon, and ACK, but for the 802.11 Data frame, it shows me a
> Malformed Packet error. From Wireshark, it seems that the protocol
> versions field is set to 2, the allowed value for this field according
> to the 802.11 standard is 0x00, but the thing is that I don't change
> the Header of any frame that is exchanged. I took the third.cc
> tutorial and I am able to see UDP frames in the CSMA network, but when
> I implemented the same UDP application for Wi-Fi the Data frame in
> Wireshark has the same Malformed Packet error. Is the problem with
> Wireshark, that it cannot read 802.11 Data frames or ns-3 is not
> generating 802.11 data frames properly? Thank you in advance for any
> explanation or help.
> PS: Wireshark error also attached.
>
> Best regards
> Geovani

I can't reproduce your problem (using ns-3-dev) on our existing examples
that use UDP and TCP.  For instance, I ran:

$ ./ns3 run 'wifi-simple-ht-hidden-stations --nMpdus=4 --enableRts=1'

and looked at the Pcap under Wireshark and, once I disabled FCS checking
in 'IEEE 802.11', 'UDP', 'IPv4', and 'TCP' protocols in the preferences,
all of the frames are accepted by Wireshark.

Similarly, this also produces good output for me:

$ ./ns3 run 'wifi-tcp --pcap=1'

Can you please try the above examples?  If they are OK, then perhaps
there is some problem with the modified program that you are using (I
think you would have to share the program for us to look further).

- Tom

Geovany Teca

unread,
Apr 7, 2022, 11:30:21 AM4/7/22
to ns-3-...@googlegroups.com
Hi Tom,
Thank you for the response,
I went back to tutorials and managed to create a wifi network and exchange UDP traffic with no error, I must have broken something in the simulator
I guess I will start from the scratch.

Best regards
Geovani
Reply all
Reply to author
Forward
0 new messages