Reason of packet loss

177 views
Skip to first unread message

NanerLee

unread,
Sep 14, 2016, 5:34:15 AM9/14/16
to ns-3-users
Hello everyone!
   Today, I meet a problem. At my picture, you can see node 94 loss some data. then I use ns3::CsmaNetDevice/MacTxDrop tracesource to find these data. And it's ok. Which shows that packet loss occurs in CsmaNetDevice and a packet has been dropped by the device before transmission.
   Then, I see the source codes. I find that there  two reasons. 
One is :
957  if (IsSendEnabled () == false)
958  {
959  m_macTxDropTrace (packet);
960  return false;
961  }
Another is:
973  if (m_queue->Enqueue (Create<QueueItem> (packet)) == false)
974  {
975  m_macTxDropTrace (packet);
976  return false;
977  }
But they are not suitable for my problem, because in my program IsSendEnabled is ture and the datarate of channels that link node 94 is more than 100Mbps. Enqueue shouldn't get false and default is no queue. So I don't know the reason of packet loss.
Is there someone have some advice? Thanks.


packet loss.png

Tommaso Pecorella

unread,
Sep 14, 2016, 9:32:38 AM9/14/16
to ns-3-users
Hi,

don't underestimate the power of packet synchronization effects. 100 Mbps is not that much if you have many synced sources.
Just add a NS_LOG_UNCOND where you think the loss happens and you'll have more info (or use a debugger).

T.

NanerLee

unread,
Sep 18, 2016, 11:07:37 PM9/18/16
to ns-3-users
Hi Tommaso!
      I'm  gald to recevie you reply and sorry to replay you so late. But I think I find the answer after seeing the source codes of p2p and csma.
      The key is the delay of CsmaChannel. Because of the character of csma link, there is one packet at most in one csma channel at any moment(CsmaNetDeive is only to transmit a packet when channel is idle). So if the number of packets that received by a CsmaNetDevice at a delay+PacketSize/datarate time is more than the length of queue(default is 100), it will occur traffic congestion and drop packets at last. And I also write a simple simulation to verify it.
     In my simulation, although the DataRate is enough, the delay is seems to be a little too big. It's my fault. What's more, the p2p link is different from the csma link, so the loss always happens in the joint of csma link and p2p link. 
     Now, I write these to give some advice to people who meet similar problem. And Thanks Tommaso again!
在 2016年9月14日星期三 UTC+8下午9:32:38,Tommaso Pecorella写道:

Tommaso Pecorella

unread,
Sep 19, 2016, 6:51:35 PM9/19/16
to ns-3-users
Hi !

good analysis. As a matter of fact, both P2P and CSMA models are very basic models. They should be updated to take into account the channel delay between stations and so on.

Cheers,

T.
Reply all
Reply to author
Forward
0 new messages