how to get neighbor hosts in moblity framework

203 views
Skip to first unread message

Elwin

unread,
Nov 1, 2009, 9:15:22 PM11/1/09
to omnetpp
How can I get the neighbor hosts of a host in mobility framework?
Here I mean the hosts that connect to the host or in the range of the
host, not the neighbors dynamically found by replying.

PireTozu

unread,
Nov 5, 2009, 4:23:11 AM11/5/09
to omnetpp
Hi Elwin,
Have you found a solution for your problem?
I have the same situation, if any idea, could you please inform me?

Piretozu

Karl Wessel

unread,
Nov 5, 2009, 6:21:01 AM11/5/09
to omn...@googlegroups.com
Hi,

You can try the following:

Get a pointer to the ChannelControl module.
Call its "getGateList()" method which will give you a list of gates to
all neighboring hosts.
From these gates you can get the destination gate (have a look at class
cGate in the API).
And from the destination gate you can get the ownerModule which should
be the destinations host module.
Its not very convenient but should work.

Karl

PireTozu schrieb:

gülşah bulut

unread,
Nov 5, 2009, 6:36:35 AM11/5/09
to omn...@googlegroups.com
Thank you Karl, for your quick response :)
Could you post or point a reference a small code snippet that does what you say ;
- to get the pointer ChannelControl, getGateList() and so on..
 
Actually, I have to code DMAC (distributed mobility adaptive clustering) algorithm. The clustering algorithm have to calculate some sort of weight in each node. Also the nodes have to store one-hop neighbors as a list.. This is the reason of my question?
Do you think that I can do it by the way you tell? Or is there any other smart way of doing this?

Karl Wessel

unread,
Nov 5, 2009, 7:05:47 AM11/5/09
to omn...@googlegroups.com
You can take a look at the source of mobility-fws ChannelAccess class to
see how to get a pointer to ChannelControl and also how to get the list
of gates.
From there on you will have to ask the Omnet API on details how to get
destination and owner-module of a gate
(http://www.omnetpp.org/doc/omnetpp33/api/classcGate.html).

gülşah bulut schrieb:

Andreas Köpke

unread,
Nov 5, 2009, 8:11:19 AM11/5/09
to omn...@googlegroups.com
However, you should keep in mind that this returns you all neighbors according
to the following definition:

A neighbor is a node whos communication MAY interfere with my communication.

However, guessing from what you wrote about your application, you want a
different neighbor definition:

A neighbor is a node from which I can receive packets.

Or even more detailed:

A neighbor is a node from which I can successfully receive packets (success >
99% packet delivery ratio, 1200 byte long packets, 1MBit/s).

You may even include the return path into the definition:

A neighbor is a node from which I can successfully receive packets and which
receives my ACKs successfully.

So, first pick a neighbor definition, then ask how you can figure them out.

Best, Andreas

gülşah bulut

unread,
Nov 5, 2009, 8:32:46 AM11/5/09
to omn...@googlegroups.com
Hi Andreas and Karl.
Thank you for your attention and quick responses to my newbee questions :)
Yesterday, I sent a mail about the paper Mixim Vision, to you and some other stuff  (whose names were on the paper)
Then I found mail group by coincidence.
And it is nice to come up with you here.
My new question is;
Do you know anybody who works on clustering on adhoc networks and uses omnetpp and mixim for simulation purposes?
This might accelerate my studies, may be..
else I will ask all my silly questions to you :D
I guess you may not bear to such silly questions!
warm regards, gulsah

Laura Marie Feeney

unread,
Nov 5, 2009, 12:57:00 PM11/5/09
to omn...@googlegroups.com
Hi Gülşah,

I just wanted to add a little bit to Andreas' point: the channel module
returns you a list of potential interferers maintained by the simulation.

If you had "real" nodes, they couldn't just ask the global simulator
about neighbors - there isn't one!. They would have to find out some
other way: by sending and listening to 'hello' messages, or by
overhearing neighbors' traffic, for example.

Doing that would have communication overhead - there will be more data
on the channel - and energy overhead. The data would also have some
inaccuracy, since information will always be a little out of date, or
you might not hear some message due to interference, or whatever.

If you are trying to study the performance of a protocol, it is
important to think about which aspects of the protocol need to modeled
in operation and which can be handled in the simulation. This will
depend on your specific needs.

Regards,
Laura

gülşah bulut wrote:
> Hi Andreas and Karl.
> Thank you for your attention and quick responses to my newbee questions :)
> Yesterday, I sent a mail about the paper Mixim Vision, to you and some
> other stuff (whose names were on the paper)
> Then I found mail group by coincidence.
> And it is nice to come up with you here.
> My new question is;
> Do you know anybody who works on clustering on adhoc networks and uses
> omnetpp and mixim for simulation purposes?
> This might accelerate my studies, may be..
> else I will ask all my silly questions to you :D
> I guess you may not bear to such silly questions!
> warm regards, gulsah
> > Â From there on you will have to ask the Omnet API on details how
> to get
> > destination and owner-module of a gate
> > (http://www.omnetpp.org/doc/omnetpp33/api/classcGate.html).
> >
> > gülşah bulut schrieb:
> > > Thank you Karl, for your quick response :)
> > > Could you post or point a reference a small code snippet that does
> > > what you say ;
> > > - to get the pointer ChannelControl, getGateList() and so on..
> > >
> > > Actually, I have to code DMAC (distributed mobility adaptive
> > > clustering) algorithm. The clustering algorithm have to
> calculate some
> > > sort of weight in each node. Also the nodes have to store one-hop
> > > neighbors as a list.. This is the reason of my question?
> > > Do you think that I can do it by the way you tell? Or is there any
> > > other smart way of doing this?
> > >
> > > On Thu, Nov 5, 2009 at 1:21 PM, Karl Wessel
> > > <wesse...@googlemail.com <mailto:wesse...@googlemail.com>
> <mailto:wesse...@googlemail.com
> <mailto:wesse...@googlemail.com>>> wrote:
> > >
> > >
> > > Â Â Hi,
> > >
> > > Â Â You can try the following:
> > >
> > > Â Â Get a pointer to the ChannelControl module.
> > > Â Â Call its "getGateList()" method which will give you a
> list of gates
> > > to all neighboring hosts.
> > > Â Â Â From these gates you can get the destination gate (have
> a look at
> > > Â Â class
> > > Â Â cGate in the API).
> > > Â Â And from the destination gate you can get the ownerModule
> which
> > > should be the destinations host module.
> > > Â Â Its not very convenient but should work.
> > >
> > > Â Â Karl
> > >
> > > Â Â PireTozu schrieb:
> > > Â Â > Hi Elwin,
> > > Â Â > Have you found a solution for your problem?
> > > Â Â > I have the same situation, if any idea, could you
> please inform me?
> > > Â Â >
> > > Â Â > Piretozu
> > > Â Â >
> > >   > On 2 Kasım, 04:15, Elwin <maoyu...@gmail.com
> <mailto:maoyu...@gmail.com>
> > >
> > > Â Â <mailto:maoyu...@gmail.com <mailto:maoyu...@gmail.com>>>
> wrote:
> > > Â Â >> How can I get the neighbor hosts of a host in mobility
> framework?
> > > Â Â >> Here I mean the hosts that connect to the host or in
> the range
> > >
> > > Â Â of the
> > >
> > > Â Â >> host, not the neighbors dynamically found by replying.
> >
> > >
>
>
>
> >

gülşah bulut

unread,
Nov 5, 2009, 2:31:01 PM11/5/09
to omn...@googlegroups.com
Hi Laura;
My thesis subject is "mobility based clustering for service discovery in ad hoc networks "
In the literature survey, I found DMAC (Distributed Mobility Adaptive Clustering -by Stefan Basagni- )
I will try to combine it with my own service discovery algorithm.
If I return to your suggestion, how will I implement your method?
As I am a newbee, I don't know how I will implement my thoughts using omnet and mixim .
I read some sort of tutorial and paper but it is still not very clear :(
I will be really grateful if you help me..

Elwin

unread,
Nov 5, 2009, 10:32:02 PM11/5/09
to omnetpp
Hi Karl,
I have read the source code and solve the problem. Thank you for your
help. However, it seems that there is a problem of cross-layer module
interference. I mean a upper-layer module gets the pointer to a lower-
layer module and accesses its functions. Is it unsafe or does it
destroy the structure of the framework?
> >> host, not the neighbors dynamically found by replying.- 隐藏被引用文字 -
>
> - 显示引用的文字 -

Andreas Köpke

unread,
Nov 6, 2009, 5:31:06 AM11/6/09
to omn...@googlegroups.com
Sorry, there is no replacement for engaging your brain and hard work -- it is
your thesis, after all. Even if we help you, it is unlikely that you would
understand our answers. Try a systematic approach:

1. Define your system (includes a precise definition of "neighbor", btw. you
want to use definition 4:

A neighbor is a node from which I can successfully receive packets and which
receives my ACKs successfully.

What is inside your system, what out side? Then check, whether the "out" part
can be infered from the simulation environment (you wanted to do that with the
neighbors, but that was probably the wrong border), or whether it can be
"assumed away".

2. Check out what functions are offered by MiXiM

3. Check which functions you need

4. Define a protocol FSM on paper and check it for correctness

5. Implement and debug it

6. Simulate your stuff

When you write while doing all the stuff, you already have the main part of
your thesis ;)

Best, Andreas

gülşah bulut

unread,
Nov 6, 2009, 2:26:27 PM11/6/09
to omn...@googlegroups.com
Hi Andreas;
Is this guideline for me :)

PireTozu

unread,
Nov 7, 2009, 9:40:07 AM11/7/09
to omnetpp
Hi everybody,
I examined the tictoc tutorial example (for omnet) and baseNetwork
example (for mixim).
What I understand is;
(please correct me if I misunderstand any of following)

-cSimpleModule of omnet has a significant method: handleMessage()
any message received by a node is processed in this method
-cMessage class is used for messaging purposes basically and I can
extend it by .msg types.
it has a "kind" property (which I understand that I can interpret
cmessage parameters according to a "kind")
-any event that is dependent on timer can be manipulated by self
messaging.

Now what I will try is to modify the handleMessage() method that is
used by BaseNode.ned (in BaseNetwork example of Mixim)
That is not difficult in TicToc example since every .ned has .cc
files, subclassing from cSimpleModule, overriding handleMessage()
But unfortunately, I couldn't find which .cc is used by BaseNode.ned
(there should be something like BaseNode.cc which subclasses from
cSimpleModule of omnet? Am I wrong?)

Also, for sending out helloMessages() periodically, (since the network
is ad hoc, this is the only way for each node to be aware who are
around)
self messaging can be used for this purpose:
-when timer expires, the node sends out a helloMessage() to the
network.. (just with little info, something like node's id..)
> > > On Thu, Nov 5, 2009 at 7:57 PM, Laura Marie Feeney <lmfee...@sics.se>
> > > > >      > > <wessel.k...@googlemail.com
> > > > >      > > <mailto:wessel.k...@googlemail.com>
>
> > > > >     <mailto:wessel.k...@googlemail.com
> > > > >      > > replying.- Alıntıyı gizle -
>
> - Alıntıyı göster -
Reply all
Reply to author
Forward
0 new messages