number of dropped packets calculation

624 views
Skip to first unread message

Doaa Terri

unread,
Aug 4, 2015, 10:07:55 AM8/4/15
to ns-3-users
Hi all 

I am trying to find the number of dropped packet on the mac layer. I used the MacRxDrop attribute to trace the number of dropped packets. However when I run the script nothing is calculating (dropped packets). I have an empty file. Can someone advise me in this issue. Below is what I have done. for the purpose of debugging I tried to print the context but it did not show up. This means that the trace source is not fired up

void DroppedPacket(string context, Ptr <const Packet> p)
{

cout << " TX p: " << *p << endl;

totalBytesDropped += p->GetSize();
cout<< totalBytesDropped<<endl;
totalBytesDropped=0;
rdTraced << totalBytesDropped << ;

}

inside the main 
{
   rdTraced.open("receivedvsdropped.dat", ios::out);                                             //
  rdTraced << "# Time \t Dropped \n received \n" ;

stringstream Sd;

Sd<<"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/MacRxDrop";                 //
Config::Connect (Sd.str(), MakeCallback(&DroppedPacket) ); 
}

Thanks 
wifi.txt

Tommaso Pecorella

unread,
Aug 4, 2015, 10:36:06 AM8/4/15
to ns-3-users
Him,

I must repeat what has been already suggested: study the standard. Not the ns-3 implementation, I mean the real standard.
A packet is dropped at Rx time only if you have errors in the packet, and this is highly unlikely (unless you are out of range). Practically speaking, in the space of a few meters or less, the node will go from a 100% packet reception to zero.
In this case, the automatic rate adaptation algorithms kicks in, the Tx rate is reduced and yo can go further away with a PLR close to zero. Again, it's how Wi-Fi works.
Seeing a packet dropped by the receiving MAC is extremely rare. Not impossible, but extremely rare. This is due to the channel coding techniques (again, this is not the place to explain this point).

Now, and this time I'll repeat myself, this is a group to help people with ns-3 issues. We expect that the basics of the protocols one wants to simulate are known. While we can (and we do) discuss technical and obscure details, and sometimes even less obscure ones, we DO expect that the experimenter knows enough of the standard. As a consequence (again) please read the standard.

Thanks,

T.

Doaa Terri

unread,
Aug 4, 2015, 4:46:09 PM8/4/15
to ns-3-...@googlegroups.com
Thank you Tommaso for your reply! Thanks also for the clarification. 
I believe that this group is for ns3 help and I really appreciate all of your help. Actually, I am re-studying the standard as suggested before in order to gain more knowledge to help me in the implementation.
 I tried to find the number of dropped packet in order to analyze the results I've obtained. Not all of the transmitted packets are received so I wanted to know the reason.(collision, drop, loss,..). I am going to study the standards in order to be able to know what is happening.
 I would kindly request if you can suggest some techniques used in ns3 to figure out such problem ie, how to debug such problems.

Thanks a lot!

--
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/65_0qUZVKIQ/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,
Aug 4, 2015, 5:01:59 PM8/4/15
to ns-3-users
Hi,

look for transmitted packets and collisions.
It is more probable that the packet is being dropped for a collision than for a low SNR. However, if you have just one AP and one STA, no collision should happen (well, it's possible but unlikely).
The most probable thing is a fail to acquire the channel, i.e., EDCA not finding a free TX opportunity. Basically it's the CSMA failing to find a free slot.

Suggestion: concentrate your study on how the channel is sensed and when the transmission happens. I.e., on the CSMA/CA part.

T.

Doaa Terri

unread,
Aug 4, 2015, 5:07:51 PM8/4/15
to ns-3-...@googlegroups.com
Hi 

Thanks a lot Tommaso for your reply and for your advise! I really appreciate it.

Regards

Doaa Terri

unread,
Aug 7, 2015, 10:52:36 AM8/7/15
to ns-3-...@googlegroups.com
Hi Tommaso 

I have tried to trace the transmitted packets from the station, I found that it is sending packets but the Ap is not receiving any thing (except in 1 time instance). I also used pcap files and found that there are no mac frame exchanged!. 
PS: I found an error in my previous script. I was configuring different port to the on/off and the sink application. 
I would really appreciate any help or hint. 
Regards

Tommaso Pecorella

unread,
Aug 7, 2015, 2:16:58 PM8/7/15
to ns-3-users
Hi,

it's hard to say without the code. And without a real knowledge of what you mean by "it is sending packets". What object are you sure it is sending ? The application, the IP layer, routing, MAC ?
Without a real description we're just wasting our time here. And I hate to waste my time.

T.

Doaa Terri

unread,
Aug 7, 2015, 2:42:57 PM8/7/15
to ns-3-users
Hi Tommaso 

I apology if my inquiry was not clear. 
I attached my code. 
I used the trace source (MacTx) that showed me that the station is sending packet. I attached also part of the pcap file. 

Regards
ap.txt
Capture.JPG
Reply all
Reply to author
Forward
0 new messages