set ns [new Simulator]set tracefd [open test.tr w]$ns trace-all $tracefdwhere,tracefd → file handle for test.trns → Simulator instance