code for clustering in vanet

922 views
Skip to first unread message

Amel Ltifi

unread,
Apr 28, 2014, 4:16:32 AM4/28/14
to ns-3-users
Hi all,
I'm working on trust management in VANET in my thesis project. and I
need as a part of my work to have a clustering algorithm.
can someone send me please a code of a clustering in VANET in C++ that
I can after integrated it in my application or to have an idea about
clustering code and imlement a new simple one!

Amel,

Tommaso Pecorella

unread,
Apr 28, 2014, 4:42:16 AM4/28/14
to ns-3-...@googlegroups.com
Hi,

I'm sorry but I think I heavily misunderstood your request. I'm totally sure that it's due to English not being our mother language, so can you rephrase ?

My issue is that, as it is, your request loosely translate to "Hi, I need to do my thesis and I'm need to develop a part. Can somebody do it for me?".
Which, as you may easily understand, would be kinda unacceptable both from the community standpoint and for your academic tutor as well.

As a consequence, given that I'm totally sure that you did not meant what I did (mis)understand, can you please rephrase ?

Thanks,

T.

Amel Ltifi

unread,
Apr 28, 2014, 5:13:33 AM4/28/14
to ns-3-users
Hi Tommaso,
my request is: I need to define and implement a "simple" clustering algorithm for VANET. so if there are persons in this group are working on it, can they help me by providing examples of algorithms or codes to use it. 
  my aim is to not start from 0. and I think is very logic and is acceptable! why is "unacceptable both from the community standpoint and for my academic tutor as well"?


--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

Tommaso Pecorella

unread,
Apr 28, 2014, 5:53:09 AM4/28/14
to ns-3-...@googlegroups.com
Hi Amel,

language barriers and translators, that's why.

If you "need to define and implement a "simple" clustering algorithm for VANET" as part of your thesis work, then using one from someone else would not be acceptable (at least in my University).
If you need to use a simple clustering algorithm, then asking for one is totally acceptable.

Words, they may be simply ink or bytes, but they're heavier than mountains.

Anyway, enough hair splitting. Clustering.

Clustering may be the result of:
  1. L2 - a node joining a WiFi AP is part of a cluster. The Ap selection is clustering
  2. L3 - joining a subnet is clustering (up to some extent)
  3. L7 - same as L3
  4. etc.
Basically, clustering can't be modeled in a generic way, because it depends on the type of technology and the clustering type. Moreover, clustering may be the result of trust algorithms. You join a cluster because you trust the nodes already in the cluster, or you're rejected from joining because they don't trust you.
As a consequence, you can't really disjoin the trust algorithms from the cluster formation and management. Because they are the same thing.

Summarizing. Clustering: first you have to define what is a cluster for you. Logical ? Physical ? How the nodes should communicate ? Why they consider them as part of a cluster ?
Then you may look for a cluster formation algorithm, which must be compliant with the your assumptions and goals.
And in the cluster formation algorithm, you may as well add trust management.

Looking for a pre-cooked cluster formation and management algorithm could help you, but it could also drive you nowhere, because you'll be bound to the pre-cooked algorithm assumptions, which may as well not suite your needs.

T.

Amel Ltifi

unread,
Apr 28, 2014, 6:30:55 AM4/28/14
to ns-3-users
2014-04-28 10:53 GMT+01:00 Tommaso Pecorella <tomm...@gmail.com>:
Hi Amel,

language barriers and translators, that's why.

If you "need to define and implement a "simple" clustering algorithm for VANET" as part of your thesis work, then using one from someone else would not be acceptable (at least in my University).
If you need to use a simple clustering algorithm, then asking for one is totally acceptable.
of course, I'm totaly agree with you
Words, they may be simply ink or bytes, but they're heavier than mountains.

Anyway, enough hair splitting. Clustering.

Clustering may be the result of:
  1. L2 - a node joining a WiFi AP is part of a cluster. The Ap selection is clustering
  2. L3 - joining a subnet is clustering (up to some extent)
  3. L7 - same as L3
  4. etc.
Basically, clustering can't be modeled in a generic way, because it depends on the type of technology and the clustering type. Moreover, clustering may be the result of trust algorithms. You join a cluster because you trust the nodes already in the cluster, or you're rejected from joining because they don't trust you.
As a consequence, you can't really disjoin the trust algorithms from the cluster formation and management. Because they are the same thing.

Summarizing. Clustering: first you have to define what is a cluster for you. Logical ? Physical ? How the nodes should communicate ? Why they consider them as part of a cluster ?
its physical, it depends on distance between vehicles. trust is considerated only for selection of the group leader. in my work, I did the part of communication between the group leader and other vehicles neighbors. but I dont know how I create another group! this my problem now!! 

Tommaso Pecorella

unread,
Apr 28, 2014, 4:32:22 PM4/28/14
to ns-3-...@googlegroups.com
Hi,

it's easier than I thought then. Much easier. Because you already have your clustering algorithm, you just didn't realize you do.

Let me explain (and correct me if I'm wrong).

You have a system to associate two nodes. One will become a group leader, the other will be part of the group.
This is the very beginning of a cluster. It's the 0th building block.

Now, what happens when you have one more node approaching the 2-nodes cluster ?
If it can join the cluster, either by talking to the cluster leader or to the other node, then you have a 3node cluster.

By induction, your cluster can grow. 

About the cluster leaving, that's another point, but I guess nodes will leave the cluster if they're too far away and that a node knows when it's leaving a cluster.

Anyway, if you can do this for ONE cluster, then you have done it for any number of clusters. Simply let the simulation evolve. It's "natural" that if you have 4 nodes and they're in two different areas (i.e., 2 close to each other but the couples far away), then two clusters will be made.

The problem may be in cluster selection. I.e., what happens when a node approaches an area where two clusters are present. However, is this possible ?
Yes. Consider two groups of nodes moving as two separate flocks. They could, at one point, collide and become a single group.

In order to solve this problem, you should break the problem in sub-problems. In this case the "base block" is: a node is already in a cluster. It "senses" other nodes around it, belonging to a different cluster. Should it leave its current cluster and join the other one ?
This is a distributed cluster resolution, and depending on how the decision is made, clusters may become one or not.
An alternative is to let the two cluster heads to decide who's going to survive. This is a form of "centralized" decision. The loosing cluster can simply disband, the nodes will "naturally" join the other one.

Mind, there are infinite possible optimizations, but this is the basic, and if you have already a 2-nodes cluster creation, you already have 99% of the algorithm done.

So... don't search. You already did it. Just try, you'll find out that it works.

Cheers,

T.

Amel Ltifi

unread,
Apr 29, 2014, 5:50:05 AM4/29/14
to ns-3-...@googlegroups.com
thank you Tommaso,
I will try to create a second group.
In my work, a vehicle Vi sends the alarm message received from its
predecessor to its successor. and to simplify the task, I supposed
that the predecessor of Vi is V(i-1) and the successor is V(i+1), I
think now this hypothesis should be deleted to work with clusters. I
should work by a function that return the nearest neighbor.

another thing, in my work, each new injected vehicle Vi on road sends
a hello message in broadcast, and I fix one leader (V0), when the
leader receives the hello message it send an ackhello to Vi, so the
vehicle Vi registers the address as the leader address and it's used
after for communication.

I you have an idea to enhance this algorithm to support clustering, It
will be very helpfull for me.


Amel,

2014-04-28 21:32 UTC+01:00, Tommaso Pecorella <tomm...@gmail.com>:
> Hi,
>
> it's easier than I thought then. Much easier. Because you already have your
>
> clustering algorithm, you just didn't realize you do.
>
> Let me explain (and correct me if I'm wrong).
>
> You have a system to associate two nodes. One will become a group leader,
> the other will be part of the group.
> This is the very beginning of a cluster. It's the 0th building block.
>
> Now, what happens when you have one more node approaching the 2-nodes
> cluster ?
> If it can join the cluster, either by talking to the cluster leader or to
> the other node, then you have a 3node cluster.
>
> By induction, your cluster can grow.
>
> About the cluster leaving, that's another point, but I guess nodes will
> leave the cluster if they're too far away and that a node knows when it's
> leaving a cluster.
>
> Anyway, if you can do this for ONE cluster, then you have done it for any
> number of clusters. Simply let the simulation evolve. It's "natural" that
> if you have 4 nodes and they're in two different areas (i.e., 2 close to
> each other but the couples far away), then two clusters will be made.
>
> The problem may be in cluster *selection*. I.e., what happens when a node
> approaches an area where two clusters are present. However, is this
> possible ?
> Yes. Consider two groups of nodes moving as two separate flocks. They
> could, at one point, collide and become a single group.
>
> In order to solve this problem, you should break the problem in
> sub-problems. In this case the "base block" is: a node is already in a
> cluster. It "senses" other nodes around it, belonging to a different
> cluster. Should it leave its current cluster and join the other one ?
> This is a distributed cluster resolution, and depending on how the decision
>
> is made, clusters may become one or not.
> An alternative is to let the two cluster heads to decide who's going to
> survive. This is a form of "centralized" decision. The loosing cluster can
> simply disband, the nodes will "naturally" join the other one.
>
> Mind, there are infinite possible optimizations, but this is the basic, and
>
> if you have already a 2-nodes cluster creation, you already have 99% of the
>
> algorithm done.
>
> So... don't search. You already did it. Just try, you'll find out that it
> works.
>
> Cheers,
>
> T.
>
>
> On Monday, April 28, 2014 12:30:55 PM UTC+2, amel wrote:
>>
>>
>>
>>
>> 2014-04-28 10:53 GMT+01:00 Tommaso Pecorella
>> <tomm...@gmail.com<javascript:>
>> >:
>>
>>> Hi Amel,
>>>
>>> language barriers and translators, that's why.
>>>
>>> If you "need to define and implement a "simple" clustering algorithm for
>>>
>>> VANET" as part of your thesis work, then using one from someone else
>>> would
>>> not be acceptable (at least in my University).
>>> If you need to *use* a simple clustering algorithm, then asking for one
>>> is totally acceptable.
>>> of course, I'm totaly agree with you
>>> Words, they may be simply ink or bytes, but they're heavier than
>>> mountains.
>>>
>>> Anyway, enough hair splitting. Clustering.
>>>
>>> Clustering may be the result of:
>>>
>>> 1. L2 - a node joining a WiFi AP is part of a cluster. The Ap
>>> selection is clustering
>>> 2. L3 - joining a subnet is clustering (up to some extent)
>>> 3. L7 - same as L3
>>> 4. etc.
>>>
>>> Basically, clustering can't be modeled in a generic way, because it
>>> depends on the type of technology and the clustering type. Moreover,
>>> clustering may be the *result* of trust algorithms. You join a cluster
>>> email to ns-3-users+...@googlegroups.com <javascript:>.
>>> To post to this group, send email to
>>> ns-3-...@googlegroups.com<javascript:>
>>> .

Housin Eng

unread,
May 4, 2014, 10:20:20 AM5/4/14
to ns-3-...@googlegroups.com
I have the same project , clustering in Vanet
did you resolved it

Amel Ltifi

unread,
May 16, 2014, 1:49:34 PM5/16/14
to ns-3-...@googlegroups.com
Hi Houssin,
Not yet, I study now some existing clustering algorithm for vanet in
order to choose one to use it.

2014-05-15 15:52 UTC+01:00, Housin Eng <hous...@gmail.com>:
> Dear Amel, I need some information about the clustering, please

Housin Eng

unread,
May 15, 2014, 10:52:06 AM5/15/14
to ns-3-...@googlegroups.com

yashi

unread,
Aug 3, 2016, 11:53:37 PM8/3/16
to ns-3-users
dear Amel,
I am working on the same project which you did and trying to add some privacy measures as future work.
For this reason, I need the clustering algorithm and code for the same so that I can focus on my future work.
Do reply please.

Ezgi Tetik

unread,
Nov 12, 2019, 2:14:24 PM11/12/19
to ns-3-users
Hi Amel,

Is that possible to share the code with me? 
I work on vanet routing algorithm which requires clustering which I do not want to spent so much time and focus my developed part. I would appreciate if you can share.
Thank you,

28 Nisan 2014 Pazartesi 11:16:32 UTC+3 tarihinde amel yazdı:
Reply all
Reply to author
Forward
0 new messages