calculating overhead for manet-routing-compare.cc

93 views
Skip to first unread message

Ali HosseinAliPour

unread,
Dec 29, 2022, 3:43:57 AM12/29/22
to ns-3-users
I have run "manet-routing-comaper.cc" with "nsink=1" and "nwifi=10" (node 10 sends data to node1).

For OLSR and AODV routing protocols, I calculate the overhead from ".pcap" output with Wireshark.
 
Would anyone be able to help me calculate the overhead?

For this purpose, I have calculated UDP and OLSR/AODV packet lengths, but the results are incorrect. Since the routing overhead is too high.

Thanks in advance. 
aodv0.xlsx
olsr0.xlsx

Tom Henderson

unread,
Dec 29, 2022, 5:03:57 PM12/29/22
to ns-3-...@googlegroups.com
Using the pcap trace, you should be able to classify each packet as either being a data packet or a routing packet.

Then, you should be able to count up the bytes for all routing packets; the total packet size should be available from the pcap trace information.

Then, you need to define overhead in some specific way, such as the 'number of routing protocol bits sent during the simulation' divided by the simulation duration, which would yield an routing protocol overhead in bits/second.  You can then refine the calculation as needed.
--
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/f7e8141b-937f-4c48-ae30-639714e26d81n%40googlegroups.com.


Ali HosseinAliPour

unread,
Jan 9, 2023, 5:25:37 AM1/9/23
to ns-3-users
Thanks for your reply.

There is, however, a different .pcap file produced by NS3 for each selected node (sink, source, or none) in the network.

Due to this, each .pcap file shows a different number of packets for routing protocol and transmitted data.
 
Therefore, I am unsure which .pcap file should be used to calculate routing overhead.

Could you please assist me with this issue?

Tom Henderson

unread,
Jan 9, 2023, 10:52:51 AM1/9/23
to ns-3-...@googlegroups.com
You can use all of the pcap files if you filter them properly.

It is true that in an adhoc network, you will generally see different packets in each node's pcap file, because each pcap file reports on both the sent and received packets, which can differ depending on the position of the node.  If you filter each of these pcap files to include only the sent packets by each node (you will need to know the address of each node to filter the pcaps in this way) and use all of these filtered pcap outputs, you will have a record of all packets sent.

Another tracing mechanism that may make it easier for this specifically is the ASCII trace.  You can enable it by uncommenting the following lines in manet-routing-compare.cc:

    // AsciiTraceHelper ascii;
    // Ptr<OutputStreamWrapper> osw = ascii.CreateFileStream(tr_name + ".tr");
    // wifiPhy.EnableAsciiAll(osw);

You will need to comment or delete the subsequent line that redeclares AsciiTraceHelper in this case; i.e.:

    AsciiTraceHelper ascii;
    Ptr<OutputStreamWrapper> osw = ascii.CreateFileStream(tr_name + ".tr");
    wifiPhy.EnableAsciiAll(osw);
    //AsciiTraceHelper ascii;
    MobilityHelper::EnableAsciiAll(ascii.CreateFileStream(tr_name + ".mob"));

This will generate a file called 'manet-routing-compare.tr'.  In this file, the first character will be a 't'(transmit), 'r'(receive) or 'd'(drop), followed by a timestamp, and a path string showing the node and device.  Following that, the headers of the packets are printed out.  For instance, here is the start of that file:

t 0.00705 /NodeList/21/DeviceList/0/$ns3::WifiNetDevice/Phy/State/Tx DsssRate11Mbps ns3::WifiMacHeader

This will allow you to filter on all lines that start with 't'.  then, you will need to classify them as routing or data, and calculate the length of each one (which can be deduced from the length field shown in the IP header printout).

- Tom
Reply all
Reply to author
Forward
0 new messages