How to create a pcap trace file and ASCII trace file in LTE module

1,289 views
Skip to first unread message

amith

unread,
Jul 31, 2011, 9:33:54 PM7/31/11
to ns-3-users
Hi,

I am a newbie to NS-3 and I am currently working on basic message
exchange simulation using NS-3 LTE module.
I am trying to see transmitted packets in the uplink for one of the
example programs lte-phy-uplink.cc. In order to do this I am trying to
create a pcap trace file. But I am not able to create either a pcap
trace file or an ASCII trace file. Can anyone please help me on this?

--
Thanks and regards,
Amith Kumar Nagaraj
M.S, Illinois Institute of Technology

amith

unread,
Aug 1, 2011, 9:01:58 AM8/1/11
to ns-3-users
Actually, as per pcap tutorial, the sixth.cc program only captures the
dropped packets, whereas I am trying to capture all packets exchanged
between two nodes.

Can anyone please review the following code? It will be of great help
to me.

============
PointToPointHelper Helper;
Helper.EnablePcapAll ("", true);

PcapHelper pcapHelper;
Ptr<PcapFileWrapper> file = pcapHelper.CreateFile ("uplink.pcap",
std::ios::out, PcapHelper::DLT_RAW);
pcapHelper.HookDefaultSink(ue,"TxStart", file );
============

"HookDefaultSink" calls "TraceConnectWithoutContext" in turn calls
"LookupTraceSourceByName" function. In "LookupTraceSourceByName",
"tid.GetTraceSourceN" is '0'. So, whatever trace source name I provide
in "HookDefaultSink" doesn't match. Thus, I get an error stating
"Unable to Hook <tracename>"

--
Thanks and regards,
Amith Kumar Nagaraj
M.S, Illinois Institute of Technology

Freedom Program

unread,
Aug 1, 2011, 6:43:01 PM8/1/11
to ns-3-users
hi,
if you want to:
1)-create file.pcap you have to add the following command:
pointToPoint.EnablePcapAll ("file"), and you execute this program by
tcpdump-nn-tt-r-0-0.pcap file or by the software Wireshark
2-for ascii trace file you added
AsciiTraceHelper ascii;
pointToPoint.EnableAsciiAll (ascii.CreateFileStream ("file. tr")), and
you will find this file in the ns3
good luck
Reply all
Reply to author
Forward
0 new messages