wifi pcap

717 views
Skip to first unread message

Thunder

unread,
Oct 2, 2011, 10:03:36 AM10/2/11
to ns-3-users
Hi,

when I made a simulation in ns3 of 4 wifi nodes and when I opened the
pcap file in wireshark I could see the packets but I also got (in the
lower window of wireshark):

Frame check sequence: 0x00000000 [incorrect, should be 0x264b2176]
[Good: False]
[Bad: True]

why do I get this?
and how can I fix it

Thanks in advance

Thunder

unread,
Oct 2, 2011, 10:04:43 AM10/2/11
to ns-3-users
and here is my code:

/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2005,2006,2007 INRIA
* This program is free software; you can redistribute it and/or
modify
*
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA
*
* Author: Mathieu Lacage <mathieu...@sophia.inria.fr>
*/

#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/applications-module.h"
#include "ns3/mobility-module.h"
#include "ns3/tools-module.h"
#include "ns3/wifi-module.h"

#include <iostream>

NS_LOG_COMPONENT_DEFINE ("Main");

using namespace ns3;


int main (int argc, char *argv[])
{

WifiHelper wifi = WifiHelper::Default ();

wifi.SetRemoteStationManager ("ns3::ArfWifiManager");
wifi.SetStandard (WIFI_PHY_STANDARD_80211b);
NqosWifiMacHelper mac = NqosWifiMacHelper::Default ();
YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default
();

NodeContainer c;
c.Create (4);

PacketSocketHelper packetSocket;
packetSocket.Install (c);

phy.SetChannel (wifiChannel.Create ());

Ssid ssid ("Raad-network");

mac.SetType ("ns3::StaWifiMac",
"Ssid", SsidValue (ssid),
"ActiveProbing", BooleanValue (false));

NetDeviceContainer staDevices = wifi.Install (phy, mac, c.Get(0));


mac.SetType ("ns3::ApWifiMac",
"Ssid", SsidValue (ssid));

NetDeviceContainer apDevices = wifi.Install (phy, mac, c.Get(1));

Ssid ssid2 ("Raad-network2");

mac.SetType ("ns3::StaWifiMac",
"Ssid", SsidValue (ssid2),
"ActiveProbing", BooleanValue (false));

NetDeviceContainer staDevices2 = wifi.Install (phy, mac, c.Get(2));


mac.SetType ("ns3::ApWifiMac",
"Ssid", SsidValue (ssid2));

NetDeviceContainer apDevices2 = wifi.Install (phy, mac, c.Get(3));

MobilityHelper mobility;
mobility.SetPositionAllocator ("ns3::GridPositionAllocator",
"MinX", DoubleValue (0.0),
"MinY", DoubleValue (0.0),
"DeltaX", DoubleValue (5.0),
"DeltaY", DoubleValue (10.0),
"GridWidth", UintegerValue (3),
"LayoutType", StringValue
("RowFirst"));

mobility.Install (c);

PacketSocketAddress socket;
socket.SetSingleDevice (staDevices.Get (0)->GetIfIndex ());
socket.SetPhysicalAddress (apDevices.Get (0)->GetAddress ());
socket.SetProtocol (1);

OnOffHelper onoff ("ns3::PacketSocketFactory", Address (socket));
onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable
(250)));
onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable
(0)));
onoff.SetAttribute ("DataRate", DataRateValue (DataRate
(600000000)));
onoff.SetAttribute ("PacketSize", UintegerValue (2000));

ApplicationContainer apps = onoff.Install (c.Get (0));
apps.Start (Seconds (0.5));
apps.Stop (Seconds (30));

PacketSocketAddress socket2;
socket2.SetSingleDevice (staDevices2.Get (0)->GetIfIndex ());
socket2.SetPhysicalAddress (apDevices2.Get (0)->GetAddress ());
socket2.SetProtocol (1);

OnOffHelper onoff2 ("ns3::PacketSocketFactory", Address (socket2));
onoff2.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable
(250)));
onoff2.SetAttribute ("OffTime", RandomVariableValue
(ConstantVariable (0)));
onoff2.SetAttribute ("DataRate", DataRateValue (DataRate
(600000000)));
onoff2.SetAttribute ("PacketSize", UintegerValue (2000));

ApplicationContainer apps2 = onoff2.Install (c.Get (2));
apps2.Start (Seconds (0.5));
apps2.Stop (Seconds (30));

phy.SetPcapDataLinkType(YansWifiPhyHelper::DLT_IEEE802_11_RADIO);

phy.EnablePcap ("new", apDevices.Get(0));
phy.EnablePcap ("new", staDevices.Get(0));
phy.EnablePcap ("new", apDevices2.Get(0));
phy.EnablePcap ("new", staDevices2.Get(0));

Simulator::Stop(Seconds(30));
Simulator::Run ();
Simulator::Destroy ();
return 0;
}

Thunder

unread,
Oct 2, 2011, 10:32:51 AM10/2/11
to ns-3-users
I also get "Encapsulated Ethernet" in each data packet
how can I fix this??

Hajar Hantouti

unread,
Sep 6, 2015, 7:33:14 AM9/6/15
to ns-3-users
Hello Raad,
I have a similar problem could you help me understand why wireshark displays this error ?
Cordially,
Hajar

RAAD QANDAH

unread,
Sep 6, 2015, 8:05:54 AM9/6/15
to ns-3-...@googlegroups.com

Hi Hajar,

I think this because it is a simulation, as I remember it will not affect your simulation.
But, consider geting more replies on this question if you can.
You can try asking wireshark developers on their forum page if that is possible.
Good luck.

Best regards,
Raad Qandah

--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/c6QgsIy34KE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

Tommaso Pecorella

unread,
Sep 6, 2015, 8:42:36 AM9/6/15
to ns-3-users
Hi both,

The encapsulation type depends on how the frame is written in the pcap file. Recently the whole output has been greatly enhanced. As a consequence I strongly suggest to use 3.24 (as soon as it's out, it shouldn't take long) or ns-3-dev.
About the FCS being zero, it's to speedup the simulation. It doesn't affect the results in any way, it's safe to tell Wireshark to stop checking it (right click on the FCS field, then it's self-explanatory).

Cheers,

T.
Reply all
Reply to author
Forward
0 new messages