Tracefiles using satellite nodes and links are very similar to conventional ns tracing described in Chapter 26. Special SatTrace objects (class SatTrace derives from class Trace) are used to log the geographic latitude and longitude of the node logging the trace (in the case of a satellite node, the latitude and longitude correspond to the nadir point of the satellite).
For example, a packet on a link from node 66 to node 26 might normally be logged as:
+ 1.0000 66 26 cbr 210 ------- 0 66.0 67.0 0 0but in the satellite simulation, the position information is appended:
+ 1.0000 66 26 cbr 210 ------- 0 66.0 67.0 0 0 37.90 -122.30 48.90 -120.94In this case, node 66 is at latitude 37.90 degrees, longitude -122.30 degrees, while node 26 is a LEO satellite whose subsatellite point is at 48.90 degrees latitude, -120.94 degrees longitude (negative latitude corresponds to south, while negative longitude corresponds to west).
One addition is the Class Trace/Sat/Error, which traces any packets that are errored by an error model. The error trace logs packets dropped due to errors as follows, for example:
e 1.2404 12 13 cbr 210 ------- 0 12.0 13.0 0 0 -0.00 10.20 -0.00 -10.00
It may happen that a satellite node generates a packet that it cannot forward (such as in sat-mixed.tcl). This will show up as a drop in the tracefile with a destination field set to -2, and the coordinates set to -999.00:
d 848.0000 14 -2 cbr 210 ------- 1 14.0 15.0 6 21 0.00 10.00 -999.00 -999.00This indicates that node 14, in trying to send a packet to node 15, could not find an available route.
To enable tracing of all satellite links in the simulator, use the following commands before instantiating nodes and links:
set f [open out.tr w] $ns trace-all $fThen use the following line after all node and link creation (and all error model insertion, if any) to enable tracing of all satellite links:
$ns trace-all-satlinks $fSpecifically, this will put tracing around the link layer queues in all satellite links, and will put a receive trace between the mac and the link layer for received packets. To enable tracing only on a specific link on a specific node, one may use the command:
$node trace-inlink-queue $f $i $node trace-outlink-queue $f $iwhere is the index of the interface to be traced.
The implementations of the satellite trace objects can be found in ~ns/tcl/lib/ns-sat.tcl and ~ns/sattrace.{cc,h}.
Tom Henderson 2011-11-05