
Without any doubt, ns-3 has rich tracing support—it has more tracing features than any other simulator. Most above all, it has an excellent mechanism for grabbing any event from any layers during a network simulation run. So, a researcher will have the ultimate freedom while analyzing any aspect of a network simulation.
So, what is the purpose of discussing the question "Rich Tracing Features available in ns-3 – really a Strength? Or Weakness?" here?
It is somewhat complicated to understand. In fact, it is a feeling that I am having for more than a decade – but I may fail to express it correctly here. Anyway, I am going to try my best to express it.
I may be asking this question because I started learning network simulation from the days of ns-2. So, those who do not know about ns-2 could not understand what I am worrying about here.
So, I am starting with the fact on the old way of doing standard trace analysis with ns-2 .
The old ns-2 simply followed a universal trace format. Whoever writes a new routing protocol or mac protocol or transport protocol or any protocol module for ns-2, simply followed simple rules and the standard trace format. For that, they may need to alter several files in the core simulator code. Even though it is a hard way of doing it, it made it possible to do trace analysis on ns-2 trace files in a universal way. So, by using a single trace file, one can extract, physical or mac, or network or transport or application layer trace statistics. Of course, researchers may also try to add a few additional tracing features in a non-standard way in their core protocol itself. But still, the standard tracing techniques will work; so that, it will be possible to compute some elementary metrics such as mac load, network load, etc., by only following the universal trace format. So, the most of the standard metrics that will work on the wired networks and wireless networks may also work on the traces generated by a ns-2 module or protocol like Aquasim (UWSN), MannaSim (WSN) etc., Even though this kind of tracing has its own drawbacks, at least, ns-2 tried to do trace analysis in a universal way, So it simply worked in most cases..
Good Old ns-2 Days!
Now, let us try to understand the concern that I am trying to show on "trace analysis on ns-3"
Trace Analysis on ns-3
ns-3 provides several ways of trace analysis for analyzing simulation results. They are:
Of course, we can grab any statistics from a network simulation by applying the suitable trace analysis technique mentioned above. But the fact is: there is no 'authentic' documentation available on the internet to really teach you the 'correct or standard or universal way of doing it'.
For example, if one tried to do some routing protocol evaluation on ns-3, and try to calculate PDF, e2e Dealy, Throughput, and Routing overhead etc., certainly, they will end up with some problems during trace analysis and will search for solutions in the ns-3 user group. But the researcher only will discover the following :
If you are one such researcher and trying to do trace analysis in ns-3, then certainly you will end up reading replies from Mr. Tom Henderson, Mr. Tommaso Pecorella and Mr. Konstantinos. Their replies are somewhat authoritative since they are much involved in the development of ns-3. So, after reading replies of the experts, still the big question in the minds of the researcher is : how exactly we should to trace analysis? Where is the document explaining the standard way of doing it with authentic examples?
While developing new extensions and nodules for ns-3, no one is following any rules or standards during designing their own tracing techniques. For example, if you check LoRaWAN ns-3 extension, they designed their own metrics and their own way of doing trace analysis. Designing a new set of metrics for new technology is good—but there is no standard way of doing that. So, if you install similar LPWAN extensions NB-IoT and ns3-Sigfox, there you will find their own way of doing things. The net result is: you can not compare the performance of these three different technologies LoRaWAN, NB-IoT and ns3-Sigfox on ns-3, even though all of them are available for ns-3. In addition to that, if someone will write a new state-of-the-art routing protocol for LoRaWAN, sadly, they can not compare it with any of the existing routing protocols of ns-3 because of obvious reasons - they are not at all following any standards in their tracing design.
Of course, ns-3 also tried to mimic the ns-2 way of tracing in its ASCII trace. But, it simply failed to maintain a universal standard in it. ns-3 provides an excellent 'trace source and callback mechanism ', but ...
In my earlier blog article "What Makes ns-3 a Complex Thing to Understand and Use?", I mentioned that "There are so many standards (non-standards) in doing trace analysis in the case of ns-3. These standards (non-standards) is another main obstacle in front of a student or researcher that makes it difficult to understand and do research under ns-3" .
In his reply, Tom said, "We have felt that the 'non-standards' was a feature, not an obstacle. There are many choices, some built-in (ascii, pcap, flowmon) and the rest (trace sources, logs) customizable."
But still, I am not convinced with the customizable trace features since they are simply making a research simulation non-repeatable if the source code of the original simulation is not provided. Even though, as mentioned by Tom, there are new approaches that encourage the publication of source code as in the case of WNS3, still is common that researchers could not able 'publish' a source code for several other reasons. Still, a universal way of doing trace analysis is required.
For example, even though ns-3 has several ways of doing trace analysis, no way is obvious or simple to find 'classical' routing overhead. Of course, it may be possible with ASCII and pcap trace, but where is the guide to teach the universal or standard way of doing it? (as in the case of old ns-2)
Overall, ns-3 provides a range of trace analysis methods, each with its own advantages and limitations, along with a lot of confusion. In fact, the variety of features available for trace analysis is giving excellent freedom to researchers. But the same aspect reduces the reproducibility of the exact results of one particular simulation by another researcher since both will try to implement the trace analysis logic completely in a different way.
Anyone of the existing tracing methods should become a standard one and there should be a document strictly defining its standard as in the case of ns-2's trace format. I feel that the trace source and callback mechanism is a good one to follow as a standard. So, there should be some fundamental functions implemented in all modules on ns-3 - so that, anyone can use them readily without actually writing their own callback functions. I mean there should be 'one' standard, default trace object, from that, most of the basic performance metrics can be attained. If needed, a user can extend its functionality in their simulation by writing their own additional callbacks by extending the same trace subject of ns-3. So, for example, if the name of that Standard Tracing object is Ns3EventTracer, then by default, it should contain some functions implemented in it:
And even we may include object-level functions such as :
So, now the user can now extend the basic tracer to incorporate his own event of interest as follows:
Of course, these kinds of functions may be already available on ns-3. But the point is: they should be organized and standardised and documented so that, in future, everyone will do things in the standard way, at least for some basic tracing tasks.
So, in future, if one does trace analysis using this hypothetical 'Ns3EventTracer', then it will be possible to generate some fundamental outputs that will be exactly the same for anyone trying the same simulation. Even, someone may point out that ns-3 is already having this functionality implemented somewhere on ns-3. But what I am telling is: no one is actually following it in a standard way since there is no official document advising it to do so.
I think, the existing modules or protocols that are developed for ns-3 were already got complicated too much and made it impossible to compare one with another with a common metric under a common simulation framework. If the official developers and maintainers of ns-3 will not focus on maintaining a standard for trace analysis, then in future, every module developed for ns-3 can only be used as a stand-alone piece of software. I mean, if someone will develop a module for a hypothetical 7G technology, then it will become impossible to compare it with the other existing 'TechnoloGies' that are already available for ns-3.
Still, we are having time to rectify this. Because there are a lot of fine, open-source 'third-party extensions or modules available for ns-3 that were not at all merged with official ns-3. If the developers stick to some standards for doing event tracing, then the module developers will follow it and it will make the future ns-3 a much more practical network simulation software for research simulation (that is repeatable by anyone).
Note: My intention of this article is not to criticise ns-3 and the original views and scopes of the developers. I respect their hard work and views. I believe that event tracing and trace analysis is the major obstacle that makes an ns-3 research simulation a non-repeatable one. Even a simple reply from experts will strengthen ns-3 and will help future users of ns-3.