for your eyes only
Knowledge Hurts – a blog of thoughts, things and stuff.

ns2 trace files explained

The product after running ns2 will probably be some tracefile. They are terribly documented (as everything I am working with at the moment).
A typical example of a line could be:

r 3.052590420 _75_ RTR — 14 SPAN 40 [0 ffffffff 5e 0] [energy 999.989886 ei 0.000 es 0.000 et 0.001 er 0.009] ——- [94:-1 -1:-1 32 0],

So… here it is, all beautifully laid out and explained for you:

Entry r 3.052590420 _75_ RTR 14 SPAN 40 [0 ffffffff 5e 0] [energy 999.989886 ei 0.000 es 0.000 et 0.001 er 0.009] ——- [94 :-1 -1 :-1 32 0]
Interpretation action time node number kind of trace reason for logging identifier for this event packet type size of cmn header expected time to send data mac destination address mac sender address protocol type remaining node nergy idle energy sleep energy energy transmit energy receiv ip source address src port dest
TTL next hop
possible entries r(ead)
time stamp src_ name of object type tracing why ch->uid(),>ptype()) ch->size() mh->dh_duration ETHER_ADDR(mh->dh_da) ETHER_ADDR(mh->dh_sa) GET_ETHER_TYPE(mh->dh_body)) ih->src ih->ttl if no next hop: 0

Note: This applies to CMU trace files that were created using the span protocol. Your ns2 output could be a bit different, but still: you will find this very helpful.

P.S.: Oh… I’m out of luck publishing this on wordpress. It’s all cut off on the right. Please, do simply copy this article to the clipboard and paste it somewhere to read, ok?

Read on! Knowledge is lazy today.


11 Responses to “ns2 trace files explained”

  1. It is good website for ns2 learners

  2. hi, when i want to compare energy consumption of aodv and dsr, should i concern about idel and sleep time or no?

  3. nic epost

  4. I have started working with NS2 and using ns-2.34. So I need help from others.

  5. hi, i am using ns2.35 in ubuntu for first time, can anyone tell me please how to turn on energy trace and how can i see the energy trace file, i dont know about command

  6. hi sir.

    i am facing error when i generate xgraph from trace(.tr) file like this

    Error in file ‘’ at line …
    unknown line type
    problems found with input data.

    please sir give me solution it is very important to me.

  7. Hi,
    Can you help me understand ns-2 energy model. Which parameter I have to analyze? And how I can do that ?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: