propagation loss model (2)

122 views
Skip to first unread message

skydo...@gmail.com

unread,
Oct 6, 2008, 11:08:47 AM10/6/08
to ns-3-users
Hi,

I am a beginner to NS3 and I found the snippet

Ptr<LogDistancePropagationLossModel> log =
CreateObject<LogDistancePropagationLossModel> ();
log->SetReferenceModel (CreateObject<FriisPropagationLossModel> ());
channel->SetPropagationLossModel (log);


from http://www.nsnam.org/docs/tutorial/tutorial_26.html#SEC57

In this snippet, what does SetReferenceModel do? Why create a
LogDistancePropagationLossModel object first and then set to another
FrissPropagationLossMode?

In this case, which loss model is applied? I think it is Friss Loss
Model, but why LogDistance loss model created first?

Thanks!

Regards,
Bin

Mathieu Lacage

unread,
Oct 6, 2008, 4:49:56 PM10/6/08
to ns-3-...@googlegroups.com


Because that is what a "log distance model" does: it needs a "path loss
at reference distance, L0.
See:
http://www.nsnam.org/doxygen-release/classns3_1_1_log_distance_propagation_loss_model.html
from:
http://www.nsnam.org/doxygen-release/index.html


>
> Thanks!
>
> Regards,
> Bin
> >

Bin Ni

unread,
Oct 6, 2008, 10:48:34 PM10/6/08
to ns-3-...@googlegroups.com
Hi,

Thanks for your reply and I appreciate your kindness.

But I am still confused about the actual loss model used in this case.

From http://www.nsnam.org/doxygen/classns3_1_1_propagation_loss_model.html

I found that 
LogDistancePropagationLossModel

and FrissPropagationLossMode are siblings,

Why in the snippet, log is first created as a pointer to
LogDistancePropagationLossModel and then this pointer SetReferenceModel to
FriisPropagationLossModel

so what's the relationship between LogDistancePropagationLossMode and FriisPropagationLossModel here?

After the setting, which loss model are applied?

If I would like to use another loss model, which code I should modify?

Thanks!

Regards,
Bin Ni

Mathieu Lacage

unread,
Oct 7, 2008, 9:10:54 AM10/7/08
to ns-3-...@googlegroups.com
On Mon, 2008-10-06 at 22:48 -0400, Bin Ni wrote:

> Why in the snippet, log is first created as a pointer to
> LogDistancePropagationLossModel and then this pointer
> SetReferenceModel to
> FriisPropagationLossModel
>
> so what's the relationship between LogDistancePropagationLossMode and
> FriisPropagationLossModel here?

I explained it already: a log distance model calculates a log
attenuation over distance based on a reference distance d0 and a
reference loss at that reference distance L0. The 'reference' model is
the model used to calculate L0.

Mathieu

Raj Bhattacharjea

unread,
Oct 7, 2008, 11:21:30 AM10/7/08
to ns-3-users
On Oct 6, 10:48 pm, "Bin Ni" <skydoor2...@gmail.com> wrote:
> Hi,
>
> Thanks for your reply and I appreciate your kindness.
>
> But I am still confused about the actual loss model used in this case.

The actual loss model used is the log one. The third line says
explicitly to do so.

>
> Fromhttp://www.nsnam.org/doxygen/classns3_1_1_propagation_loss_model.html
>
> I found that  LogDistancePropagationLossModel
>
> and FrissPropagationLossMode are siblings,
>
> Why in the snippet, log is first created as a pointer to
> LogDistancePropagationLossModel
> and then this pointer SetReferenceModel to
> FriisPropagationLossModel
>
> so what's the relationship between LogDistancePropagationLossMode and
> FriisPropagationLossModel here?

As Mathieu noted, the Log model requires a figure which says "what is
the absolute loss at the reference distance?". This is like
establishing the zero point, i.e. when d=0, L=?. The Log model simply
uses another model to calculate this absolute reference. In this
case, the Friis model is used.

>
> After the setting, which loss model are applied?
>
> If I would like to use another loss model, which code I should modify?
>
> Thanks!
>

The Log model is applied. If you wanted to use another one, you
should delete BOTH lines, and simply add another one you want.

The core of the confusion however brings up an interesting idea. It
might be nice to simple be able to say that the loss is X dB at the
reference distance, and be able to set X explicitly, i.e.
LogDistancePropagationLossModel::SetReferenceLoss. This could be done
instead of setting the reference model. What do you think Mathieu?

Mathieu Lacage

unread,
Oct 8, 2008, 3:27:02 AM10/8/08
to ns-3-...@googlegroups.com
On Tue, 2008-10-07 at 08:21 -0700, Raj Bhattacharjea wrote:

> The core of the confusion however brings up an interesting idea. It
> might be nice to simple be able to say that the loss is X dB at the
> reference distance, and be able to set X explicitly, i.e.
> LogDistancePropagationLossModel::SetReferenceLoss. This could be done
> instead of setting the reference model. What do you think Mathieu?

I would be happy to review and approve a patch to do so.

Mathieu

Mathieu Lacage

unread,
Oct 28, 2008, 8:41:23 AM10/28/08
to ns-3-...@googlegroups.com

to track this issue:
http://www.nsnam.org/bugzilla/show_bug.cgi?id=395

I have just done this in http://code.nsnam.org/mathieu/ns-3-wifi. I will
close this bug once this code is merged back in ns-3-dev

regards,
Mathieu

Reply all
Reply to author
Forward
0 new messages