the trace file taken by NS3

93 views
Skip to first unread message

Mohamed Bouti

unread,
May 26, 2023, 10:58:11 AM5/26/23
to ns-3-users

Hello,

I hope everyone is doing well. I'm new to ns-3 and I wanted to know if it is possible to convert a trace file (.tr) generated from an NS-2 simulation into a trace file (.pcap/.tr) that can be used by ns-3 for simulation purposes.

The reason I need this is because I want to communicate the packets generated in ns-2 with real equipment, creating a sort of emulation setup.


if you can guide or advice me this will be very much helpful

thank you in advance

Best regards

Tommaso Pecorella

unread,
May 26, 2023, 4:06:48 PM5/26/23
to ns-3-users
Sorry to bear bad news: no, you can't.

Perhaps you could translate a ns2 .tr trace to a pcap (no idea how, don't ask me how because I have NO idea), and use a pcap replay tool to inject the packets into a real network, but not using ns-3.

One (possible?) way could be to parse the .tr file with python, and sue a python library to write a pcap file, but... again, see above.

Mohamed Bouti

unread,
May 28, 2023, 9:04:29 AM5/28/23
to ns-3-...@googlegroups.com
Okay, thank you very much sir for your answer ! I very much appreciated!

I just... have another question regarding the trace file taken by ns3 in order to use it in a simulation.

I have a real Trace file captured by influx DB this Trace contains the time between each packet and the packet size.

I have read that in ns3 the files taken are.pcap or .tr but different from ns2 .tr.. so My question is.. if it is possible to use a real Trace file in ns3 emulation.(The two nods in my simulation are in two different machines).

And if I can convert the influx DB Trace in to Trace taken by ns3.

If you can advise me about this subject Sir

Thank you in advance.

Best regards 


--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/7c81c8a9-2aba-4055-9f83-fc879e960a15n%40googlegroups.com.

Tommaso Pecorella

unread,
May 28, 2023, 11:57:03 AM5/28/23
to ns-3-users
ns-3 .tr files are meant to be just informative, unlike the ns2 ones. I.e., their format might change w/o notice, and some events might be not there without the maintainer loosing their sleep.

About the trace you have (I have no idea of the format), you can create an application reading it and generating packets. You can borrow some ideas from UdpTraceClient, which does something similar.

Mohamed Bouti

unread,
May 28, 2023, 4:37:52 PM5/28/23
to ns-3-...@googlegroups.com
Okay...thank you very much sir for your answer!

Reply all
Reply to author
Forward
0 new messages