[Ns-developers] Traced callbacks in WifiPhy

Timo Bingmann timo.bingmann at student.kit.edu
Fri Jan 9 04:10:05 PST 2009


Hallo Mathieu,
i'm running into some ugly problems debugging while the WifiPhy.

It started out that I wanted to add another parameter to the WifiPhyStateHelper::m_rxOkTrace(), i believe it was rxPowerDbm or txDuration that i required.
That didn't work so good, because TracedCallbacks can have only 4 template parameters.

So I tried to extend the number of template parameters, but that code was too ...erm extraordinary.

My next plan was to make a WifiPhyTag class and tag the packet with lots of useful information collected as it travels through the wifi layers. However tags can only have 16 bytes and cannot be updated, and the tag must be updated in at least two phases: send and receive (e.g. txPower and rxPower).

So the final plan is to group all wifi info, that is "WifiMode txMode, WifiPreamble preamble, uint8_t txPower, double snr, ...", into a class (proposal: WifiPhyInfo) that is passed through the functions and also exported to the trace callback. That also fixes the problem of the wifi callback's signature, which throws strange runtime-error if you don't get it right.

Good idea or bad idea?

Also can I rename the WifiPhy::State SYNC -> RX please? SYNC always makes me think of preamble synchronizing.

Greetings
Timo


More information about the Ns-developers mailing list