[Ns-developers] radiotap + prism

Nicola Baldo nbaldo at cttc.es
Fri May 15 08:15:47 PDT 2009


Hi Mathieu & everybody,

back to this radiotap issue, I've made a new implementation of radiotap 
+ prism support, trying to address the issues that you raised.

The new code is available for review here:
http://codereview.appspot.com/67056/show

A few replies to your previous comments:

Mathieu Lacage wrote:
> The idea is great, but the implementation has lots of issues, mainly from a
> performance POV. I think that the best way to deal with the performance issue
> would be to not add a radiotap header to the packet itself but to write it
> directly with the PcapWriter for each packet.
> 
> i.e.,:
> 
> class PcapWriter 
> {
> public:
>   struct RadiotapHeader {
>   ...
>   };
>   void WriteRadiotapPacket (Ptr<const Packet> p, RadiotapHeader header) {
>     .. write each field of the header directly in the outgoing stream
>     .. write the packet content now
>   }
> };
> 

I got your point. The new implementation takes this approach, and most 
of the functionality has been moved into PcapWriter.

The only difference with what you proposed is that I am actually passing 
all needed values (signal, noise, etc.) explicitly as function 
parameters. I did this because I wanted to support also prism header, 
which has slightly different information, and I saw little point in 
defining a new struct only for this purpose, or in defining a callback 
for radiotap and another one for prism.

By the way, I would like to point out that, with Timo's WifiPhyTags, all 
the needed information would be already embedded in the Packet, and we 
would get rid of all those function parameters which are rather ugly.



> in the real world, the radiotap header is used _only_ for received packets, not
> transmitted packets.

That's not true. Just take a single madwifi device, and do wlanconfig 
create two virtual devices, one in sta mode and the other in monitor 
mode. In this case you will be able to see outgoing packets which have a 
radiotap header. The radiotap header obviously cannot show the signal 
and noise fields for outgoing packets, but other fields such as datarate 
and mactimestamp are there.

A description of how this can be handled is of course in the madwifi 
code (net80211/ieee80211_monitor.{h,c}). Come on, man, I though you knew 
that code almost by heart ;-)


Regards,

Nicola



More information about the Ns-developers mailing list