[Ns-developers] spectrum modeling and wifi device

Mathieu Lacage mathieu.lacage at sophia.inria.fr
Tue Feb 24 11:36:28 PST 2009


On Tue, 2009-02-24 at 17:53 +0100, Nicola Baldo wrote:

> >> I am trying to add a new object between the phy and the channel for
> the 
> >> purpose of modeling the usage of the radio spectrum by wireless
> devices.
> > 
> > What do you mean exactly by this ?
> > 
> 
> I mean modeling the power spectral density of transmissions.
> The goal is to provide support for stuff such as adjacent channel 
> interference, inter-technology interference, and cognitive
> radio/dynamic 
> spectrum access scenarios. Something of this kind is implemented in 
> ns2-miracle (http://www.dei.unipd.it/~baldo/mypapers/wns2-2008.pdf),
> and 
> here at CTTC we're interested in doing something similar for ns3.

ok, I see. You basically want to add a SrcSpectralMask and a
DstSpectralMask. If you do this, please, don't make the classes
virtual :)

> >> What do you think of this approach? Would you accept a patch with these 
> >> changes?
> > 
> > I would be fine with this if it _really_ helps you but one thing that I
> > would like to eventually support in this part of the code is
> > omnidirectional antennas. My feeling is that, eventually, this will
> > require us to push a bunch of extra pointers in YansWifiChannel::Add (a
> > pointer to the tx and the rx antenna associated to a
> > receiver/transmitter) and keep track of them in YansWifiChannel which
> > seems really wasteful since all this information will be already stored
> > in YansWifiPhy 
> 
> Can we use Packet Tags for this purpose?

Tags don't work very well for this kind of thing. They are great for
end-to-end tagging.

> > so, why not just keep the pointer to YansWifiPhy directly
> > and live with the ugly and low-tech but fairly simple circular
> > dependency we have for now ?
> 
> I agree that simple is better if it is enough for one's purposes. But I 
> want to add the spectrum modeling functionality while at the same time 
> while still making it possible to use the wifi device in the current 
> way. I just though that the best way to do this was to implement part of 

I suspect that the extra loss added by the spectrum model could be
encapsulated in a single class and we could make this class virtual with
a no-op version. i.e., 

class SpectrumLossModel
{
public:
  virtual double CalcRxPower (double txPower, Spectrum txMask, Spectrum
recvMask) = 0;
};

It's not the most beautiful thing but, well, it should work.

> the spectrum modeling functionality in a new per-device object to be 
> attached below YansWifiPhy. Comparing the ns3 wifi device with real 
> devices, it is like YansWifiPhy is the baseband chipset, and the new 
> object is the RF chipset. I don't see how to insert this new RF object 
> with the current dependency between YansWifiPhy and YansWifiChannel.

You could keep a member variable m_spectrumLoss of type
Ptr<SpectrumLossModel> in YansWifiPhy and pass around the txMask in
YansWifiChannel::Send and YansWifiPhy::Recv.

Mathieu



More information about the Ns-developers mailing list