[Ns-developers] Antenna Model Patch
nbaldo at cttc.es
Mon Jan 30 02:40:13 PST 2012
thanks again for you contribution. I had a quick look at your
modifications, and I am fine with them in principle. I just have a few
1) I tried to apply your patch on
http://code.nsnam.org/nbaldo/ns-3-antenna rev bce66be66924. The patch
can be applied successfully, but the build fails because of a missing
wscript in src/orientation/examples. Can you please check this out?
2) I think it would be easier to converge to a final version of the
antenna model if you could publish your code as a mercurial repository
instead of sending patches. Would this be possible for you? This would
also allow preserving the correct code history when moving files (your
patch involves moving several files, hence by applying your patch the
previous history of the file is lost, together with the information on
the authorship of each line of code).
3) It would be great if you could provide some TestSuite that
automatically verifies that the additional functionality that you added
works correctly. As an example, for my version of the antenna model I
have some unit test suites in src/antenna/test, and a system test suite
for the use of the antenna model with LTE is provided in the LENA
For example, you could take you example program and turn it into a
system test suite by calculating offline a test vector of known rxpower
values at different positions.
4) It would also be great if you could add a few lines (to the antenna
model docs and/or where you feel appropriate) explaining how the
orientation model works and how it interacts with the antenna model. The
source of the antenna docs is in src/antenna/doc, you can also find a
copy of the generated html docs at http://lena.cttc.es/antenna/
The idea is that, when the antenna model gets eventually merged in
ns-3-dev, this documentation will be integrated in the ns-3 models library.
On 01/26/2012 05:08 PM, Panneton, Brian C CTR (US) wrote:
> I have fixed up my constant-gain-antenna-model to take into consideration the phi/theta angles. I added the orientation and modified how GetGainDb() works. It now takes in two mobility models.
> (ie: txAntenna->GetGainDb(txMobility, rxMobility)) Within GetGainDb, we get the orientation of the antenna, the txMobility and the orientation to the rxMobility. We combine these and form a single angle. Then DoGetGainDb(Angle) is called. This simplifies the computations in the Antenna Models.
> I added support for the Antennas in YansWifiChannel. Nicola, I also updated the spectrum model channel (used mobility instead of angle) and the cosine antenna model (removed orientation code from GetGainDb) for these changes.
> Lastly, I provided an example of the models in use. It is basically 3 ground nodes which have very high gain antennas pointed upwards(showing ConstantOrientationModel, ConstantGainAntennaModel). They are all 1km apart and using your standard 802.11 wifi, thus they are not in range. There is another node 800m in the +z direction that moves back and forth above the nodes (showing VelocityOrientationModel). The ground nodes all have an antenna with phi=PI/2, theta=PI/2 allowing for some overlap in their fields. They also have a ping application which pings the flying node continuously. Thus, you can watch as the flying node come within range of each of the antenna's fields.
> It should look something like this where 2,3,4 are the nodes in range and 1 flys across the top.
> ---> time
> Please let me know what everyone thinks.
> Brian Panneton
> From: Nicola Baldo [nbaldo at cttc.es]
> Sent: Tuesday, January 17, 2012 12:50 PM
> To: Panneton, Brian C CTR (US)
> Cc: Pavel Boyko; ns-developers at ISI.EDU
> Subject: Re: [Ns-developers] Antenna Model Patch
> Hi Brian,
> On 01/17/2012 05:29 PM, Panneton, Brian C CTR (US) wrote:
>> I have implemented the OrientationModel which aggregates to the
>> Antenna object or the Mobility object. This seems to work correctly.
>> Now, in the same spirit, I am attempting to aggregate the
>> AntennaModel to the phy objects but running in to problems.
>> I need a way from the AntennaModel to get the the Mobility's
>> Orientation. Since the phys have no common parent, other than object,
>> I can't seem to get to the NetDevice or the Node in order to get to
>> the Mobility. I saw in YansWifiPhy there is a GetMobility() function,
>> but I can't guarantee that all phys will implement this.
>> Thus I see two solutions:
>> 1) Aggregate the Antenna on the NetDevice. This will allow me to
>> 2) Create a common parent WirelessPhy base class which implements
>> GetDevice() and SetDevice(). Then I can call:
> I already dedicated much effort in the past on trying to generalize PHY
> models, and for instance I worked on the ns3's SpectrumPhy with this in
> mind, as well as in similar previous efforts for ns-2 (MPhy). You might
> be interested in reading these papers:
> Based on these experiences (plus some reiterated comments by more
> experienced developers), I think one can define a generic PHY base class
> that can fit many use cases, but it will never fit all use cases. This
> because, when you design the PHY base class, you have to make at least
> some modeling assumptions, and there will be always a few cases where
> these assumptions are not valid.
> So, I warmly recommend to forget about the idea of introducing a parent
> WirelessPhy class from which all ns-3 PHY models will inherit. Instead,
> I suggest to focus on the PHY model(s) that you are interested in using
> for your work.
> Based on this consideration, I think it should be fine for you to rely
> just on YansWifiPhy::GetMobility() to make the AntennaModel work with
> Wifi. Other PHY models should be considered case by case.
More information about the Ns-developers