the problem of flow monitor--packet loss

982 views
Skip to first unread message

hardwo...@gmail.com

unread,
Feb 15, 2016, 4:15:56 AM2/15/16
to ns-3-users
hello,
I have simulated the leaf-spine datacenter network using ns3-dce-sdn, there exists some problem in the flow monitor module.

////
FlowMonitorHelper flowmon;
Ptr<FlowMonitor> monitor;
monitor = flowmon.InstallAll();
.........
monitor->SerializeToXmlFile ("dce-python-sdn.xml" , true, true );
  Ptr<Ipv4FlowClassifier> classifier = DynamicCast<Ipv4FlowClassifier> (flowmon.GetClassifier ());
  std::map<FlowId, FlowMonitor::FlowStats> stats = monitor->GetFlowStats ();

  for (std::map<FlowId, FlowMonitor::FlowStats>::const_iterator iter = stats.begin (); iter != stats.end (); ++iter)
    {
      Ipv4FlowClassifier::FiveTuple t = classifier->FindFlow (iter->first);

      NS_LOG_UNCOND("Flow ID: " << iter->first << " Src Addr " << t.sourceAddress << " Dst Addr " << t.destinationAddress);
      NS_LOG_UNCOND("Tx Packets = " << iter->second.txPackets);
      NS_LOG_UNCOND("Tx Bytes = " << iter->second.txBytes);
      NS_LOG_UNCOND("Sum jitter = " << iter->second.jitterSum);
      NS_LOG_UNCOND("Delay Sum = " << iter->second.delaySum);
      NS_LOG_UNCOND("Lost Packet = " << iter->second.lostPackets);
      NS_LOG_UNCOND("Rx Bytes = " << iter->second.rxBytes);
      NS_LOG_UNCOND("Rx Packets = " << iter->second.rxPackets);
      NS_LOG_UNCOND("Throughput: " << iter->second.rxBytes * 8.0 / (iter->second.timeLastRxPacket.GetSeconds()-iter->second.timeFirstTxPacket.GetSeconds()) /     1024  << " Kbps");
      NS_LOG_UNCOND("Packet loss %= " << ((iter->second.txPackets-iter->second.rxPackets)*1.0)/iter->second.txPackets);
    } 
////

Parts of the results are as follows: there are 4 packets loss as the flow monitor's results, and in the opposite direction of the flow all packets are lost. Actually there are no packets loss. I don't know how to find the reason. 

Flow ID: 7 Src Addr 10.0.0.1 Dst Addr 10.0.0.3
Tx Packets = 14
Tx Bytes = 5852
Sum jitter = +0.0ns
Delay Sum = +485580.0ns
Lost Packet = 4
Rx Bytes = 5640
Rx Packets = 10
Throughput: 0.537577 Kbps
Packet loss %= 0.285714
Flow ID: 8 Src Addr 10.0.0.3 Dst Addr 10.0.0.1
Tx Packets = 11
Tx Bytes = 576
Sum jitter = +0.0ns
Delay Sum = +0.0ns
Lost Packet = 11
Rx Bytes = 0
Rx Packets = 0
Throughput: -0 Kbps
Packet loss %= 1


that's very kind of you who will help me! Thank you very much.
results.xml

Konstantinos

unread,
Feb 15, 2016, 11:23:32 AM2/15/16
to ns-3-users
Hi

Why do you suggest that the error/problem is in FlowMonitor and not somewhere else?
For example you say "Actually there are no packets loss". How do you calculate that? Have you used some other type of monitoring?
Further, I would say that FlowMonitor may not be the best tool to measure such metrics when using linux stack, since the way that FlowMonitor classifies packets is ns-3 specific. 
So, if the packet is for some reason altered within the linux stack, then you can not classify them.

Finally, we can not provide support for modules not in the ns-3 main distribution and I can not find "ns3-dce-sdn" there. Which means, you should contact the developers of that module/port first.

Regards,
K.

Tommaso Pecorella

unread,
Feb 15, 2016, 12:56:15 PM2/15/16
to ns-3-users
Just a remark...

FlowMonitor can NOT track packets outside the ns-3 simulation. It will not work with Emulated devices, and I'd expect extremely strange results in DCE.
This is due to how FlowMonitor is tracking packets, i.e., with Tags. Anything that will remove ByteTags will (basically) stop FlowMonitor, and any sender node that will not add the proper ByteTag will send untraceable packets.
Note that the tags are added, removed and processed in Ipv[4,6]L3Protocol callbacks, so it's enough to be using the ns-3 L3 protocol (and not remove the tag in the middle of the path).

Cheers,

T.
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages