[ns] Calculate Signal strength in ns2
Daniel Rother
d.rother at tu-bs.de
Mon Jul 21 08:41:05 PDT 2008
Hi,
I've got the same problem. In tcl I haven't found a solution. I
thougth there is something easy like "set strength [$node set
signalstrength]" but it seems there isn't such a think... :(
Because of that I go to the C++-Source-Code. After a little bit of
searching I found the file "wireless-phy.cc" and there the function
"sendUp". I think there the variable "Pr" is the signal strength
(because later in the function "Pr" is compared with "CSTresh_" and
"RXTresh_" wich a used to simulated if a paket is recieved correct or
not).
But now I had the problem that "Pr" alway had got the same value and I
don't know why. I went back to my tcl file and play a little bit with
my settings. As I changed "set opt(prop) Propagation/TwoRayGround" to
"set opt(prop) Propagation/FreeSpace" and start a simulation, I've got
an output on my console like "time: 0.008566: d: 31.622777, Pr:
2.949347e-09" (and there the Pr is chaniging!). First I was wondered
about that, but then I looked into the file "propagation.cc" and there
I found in the function Pr() "printf("%lf: d: %lf, Pr: %e\n",
Scheduler::instance().clock(), d, Pr);". So I copy that and put it
into the file "tworayground.cc" at the same position (the function Pr)
and now it seems to work.
But I always have a question: Why is Pr in "tworayground" changing and
in "wireless-phy" not? And is it the correct position to read out the
signal strength?
I've alway looked into the file "mac-802_11.cc" and the function
"send" but there "Pr" also seems not to work correct (there it is
alwas "1.600278e-02" or "-1"...) What do I have to change?
And a last thing: I want to have the signal strength in dBm. Because
of that I made "10*log10(Pr)" but I'm not sure if I have to use
"10*log10(Pr/0.001)" instead (because 1mW is the referece value for
dBm and I don't know if it is include in Pr or not...)
I hope anybody can help me with my problem(s). Thanks!
Greets Daniel Rother
Zitat von angelina socratous <trypes247 at hotmail.com>:
>
>
> I have a topology with some access points and some wireless nodes
> attached to them. If a new node wants to join the network how can i
> get the signal strength which the new node receives from each access
> point?
> Should i use c++? If someone has a tutorial for this task it would
> be very helpful.
>
> Thanks, Angelina
> _________________________________________________________________
> Explore the seven wonders of the world
> http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE
>
More information about the Ns-users
mailing list