How to pcap dropped packets with PointToPointHelper in NS3

42 views
Skip to first unread message

antique refer

unread,
Sep 8, 2017, 5:10:58 AM9/8/17
to ns-3-users

I was trying to capture the packets in NS3 experiment.

I used PointToPointHelper to use pcap. And, it can capture the normal packets.


PointToPointHelper pointToPoint;
pointToPoint.EnablePcap ("Host", (hosts.Get(0))->GetDevice(1));


But, it cannot capture the packet that I intentionally dropped.

I dropped the packets in RouteInput method. And I just simply return false to drop the packet.


RouteInput(Ptr<Packet> p, Ipv4Header &header, Ptr<const NetDevice> idev, UnicastForwardCallback ucb, MulticastForwardCallback mcb, LocalDeliverCallback lcb, ErrorCallback ecb) {
...
return false;
}


And I found that pcap didn't capture the dropped packets.

Although, the packet was intentionally dropped by the switch, it did come to the switch. So, I want the packet be capture by pcap.

Is there a way that I can capture the packets that is intentionally dropped?

Reply all
Reply to author
Forward
0 new messages