Packet sizes and MAC/PHY headers

310 views
Skip to first unread message

Esteban Municio

unread,
Jul 23, 2013, 4:28:23 AM7/23/13
to ns-3-...@googlegroups.com
Hi list

I have some problems understanding the implementation of the MAC and PHY headers.

I have a P2P 802.11g link in which I have sending UDP packets with size 1500 bytes
By the way, are 1500 = 1500 application level or 1500 = 1492 application +8 udp???

onoff1.SetAttribute ("PacketSize", UintegerValue (1500));

When I trace the PHY level

Config::Connect ("/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/State/Tx",MakeCallback(&Experiment::PhyTx2,this));

with

void
  Experiment::PhyTx2 (std::string context , ns3::Ptr<ns3::Packet const> p, ns3::WifiMode a, ns3::WifiPreamble ab, unsigned char c)
  {

WifiMacHeader hdr1;
    if(p->GetSize() > 10){ // only data packets
   p_tx_1 += 1;
  p->PeekHeader(hdr1);
  std::cout << p->GetSize() << " bytes PHY - " << hdr1.GetSize() << " bytes MAC header " << std::endl;

    }
  }

I get:

1566 bytes PHY - 26 bytes MAC header 

So I don't know how to compose the total overload.
Suposing that 1566 are the total size, what should be the correct decomposition?

1566= 1500 (aplication level) + 8 (UDP) + 20 (IP) + 26 (MAC) + 4 (FCS) + 8 (PHY)?

1566= 1492 (aplication level) + 8 (UDP) + 20 (IP) + 26 (MAC) + 4 (FCS) + 16 (PHY)?

But I had understood that PHY layer are 6 bytes of the header + 18 of the preamble and don't fix with any suposition

What I am doing wrong??
Any idea is welcomed

Thanks you in advance

Kind regards,
Esteban

Esteban Municio

unread,
Jul 23, 2013, 5:04:42 AM7/23/13
to ns-3-...@googlegroups.com
Hi

Fortunately I have found the solution quickly

I only had to look up in the pcap file

Now I know that this is the structure:

1566 = 1500 app + 8 udp + 20 ip + 8 llc + 26 Mac + 4 fcs

Aditionally, depending of the standard we have to add the Radiotap header
In 802.11g the radiotap header is 25 bytes so the whole frame size is 1590

I hope you find it useful

Kind regards, 
Esteban
Reply all
Reply to author
Forward
0 new messages