Implementing bellman-ford into ns3?

317 views
Skip to first unread message

Bob Thomas

unread,
Mar 12, 2010, 11:17:13 AM3/12/10
to ns-3-users
I've been trying to get my head around how to go about implementing
the bellman-ford routing algorithm into ns3. I have been provided
with source that contains the bellman-ford algorithm. I have been
studying the global routing technique used in ns3 and am assuming I
need to modify this to change it from Dijkstra to Bellman-Ford..which
seems a very daunting task right now. Any tips would be greatly
appreciated. Thanks.

Bob Thomas

unread,
Mar 12, 2010, 4:09:01 PM3/12/10
to ns-3-users
Ok...so I have found this resource which goes into depth of explaining
the difference between Dijkstra and Bellman-Ford. I have also
duplicated ns3's global routing files.

I am thinking that I now need to modify these duplicated files and
change the routing algorithm it uses from Dijkstra to Bellman-Ford.
Any advice would be appreciated...

Thank you all.

to...@tomh.org

unread,
Mar 12, 2010, 5:13:37 PM3/12/10
to ns-3-...@googlegroups.com
On Fri, 12 Mar 2010 13:09:01 -0800 (PST), Bob Thomas <redv...@gmail.com>
wrote:

Hi Bob,
I am curious why you are trying to replace Dijkstra with Bellman-Ford; can
you elaborate on what you are trying to accomplish?

- Tom

Bob Thomas

unread,
Mar 15, 2010, 8:25:45 AM3/15/10
to ns-3-users
Hi, thanks for the reply.

I am trying to generate simulation graphs from both the Dijkstra and
Bellman-Ford algorithm separately. I am doing this as research of QoS
routing algorithms. Therefore, I am trying to replace the algorithm
used in ns3 with Bellman-Ford.

Thank you.

Bob Thomas

unread,
Mar 17, 2010, 1:55:57 PM3/17/10
to ns-3-users
Bump.

Bob Thomas

unread,
Mar 17, 2010, 2:55:19 PM3/17/10
to ns-3-users
After doing more research, I have found that OSPF uses Dijkstra and
RIP uses Bellman-Ford. Therefore, I am trying to implement RIP into
ns3.

Tom Henderson

unread,
Mar 17, 2010, 3:48:08 PM3/17/10
to ns-3-...@googlegroups.com

Bob, the reason that I asked was that adding any routing protocol from
scratch is a lot of work so I just wanted to make sure that you really
want to implement another global static (offline computation) routing
protocol, as opposed to a dynamic routing protocol.

If you want to code this as a functional replacement for global routing,
you could clone the existing files, rename to other class names, and
then look at replacing the existing data structures and SPF algorithm to
something that you need instead. Note that the data structures are
copied from quagga's OSPF and may not match what Bellman Ford/RIP need.

- Tom

Bob Thomas

unread,
Mar 17, 2010, 4:14:32 PM3/17/10
to ns-3-users
Well...I have already duplicated the global routing files..and have
renamed the data structures..I just haven't been able to get my head
around the actual Bellman-Ford/RIP implementation. Are you saying that
creating a new dynamic protocol would be an easier process? I'm not
100% sure but I think that it would be sufficient for my purposes.
Thank you.

to...@tomh.org

unread,
Mar 17, 2010, 7:54:53 PM3/17/10
to ns-3-...@googlegroups.com
On Wed, 17 Mar 2010 13:14:32 -0700 (PDT), Bob Thomas <redv...@gmail.com>
wrote:

I am not sure it will be easier but I think it would be more useful. If
you recreate another similar variant of global routing, it will just be
useful for comparing Dijkstra vs Bellman Ford for a static topology; it
seems likely to me (although I don't know offhand) that there may be other
available tools to do this kind of algorithm comparison.

ns-3 could use some simple basic distance vector and link state dynamic
routing protocols for educational and simple comparative analysis.
However, those would each require some work too. For instance, porting the
implementations from ns-2.

- Tom

Bob Thomas

unread,
Mar 19, 2010, 10:31:40 AM3/19/10
to ns-3-users

Ah ok I see, I will look into porting the ns2's implementation I
suppose...however I've never used ns2. Thanks :-/

Bob Thomas

unread,
Mar 19, 2010, 2:13:35 PM3/19/10
to ns-3-users
Could you please point me to the right direction on where to find
these ns2 protocols? thanks.

Bob Thomas

unread,
Mar 19, 2010, 2:45:56 PM3/19/10
to ns-3-users
After some more research I guess it might be easier to change AODV
from wireless to wired, since it uses distance vector...not sure how
to go about doing this tho..any tips? Thanks again.

Bob Thomas

unread,
Mar 22, 2010, 9:14:38 AM3/22/10
to ns-3-users
Bump ^^

Bob Thomas

unread,
Mar 26, 2010, 9:24:12 AM3/26/10
to ns-3-users
Ok...scratch anything from above...I need to change the Dijkstra
algorithm implemented in global routing to use Bellman-Ford
instead...I am supposed to do this by staying with the link-state
protocol used in global routing and only changing the algorithm. Any
help? Thanks

Tom Henderson

unread,
Mar 29, 2010, 12:52:50 AM3/29/10
to ns-3-...@googlegroups.com
On 3/19/10 11:13 AM, Bob Thomas wrote:
> Could you please point me to the right direction on where to find
> these ns2 protocols? thanks.
>

Unfortunately, this algorithm is coded in OTcl in ns-2:
# Class Agent/rtProto/DV -superclass Agent/rtProto
in file ns-2/tcl/rtglib/route-proto.tcl

so it probably is going to be pretty hard to port to ns-3, such that
starting fresh might be easier, or porting from another source.

Reply all
Reply to author
Forward
0 new messages