Injecting/redistributing routes

21 views
Skip to first unread message

Antti Mäkelä

unread,
Jun 25, 2009, 11:55:39 AM6/25/09
to ns-3-users
Hi,

Latest hg pull seems to have fixed my previous issue with
GlobalRouting.

Now, I want to redistribute routes from static (or at the very
least, have GlobalRouting advertise prefixes from links that do NOT
have a global router peer).

If I have

{ cloud } ----router ------ router ---- LAN

where the router in the middle (and everything in cloud) is running
GlobalRouting, but the router on the right is not, and I call
GlobalRouteManager::PopulateRoutingTables(Nodecontainer); - the
address space of the link is not advertised to the cloud.

If I try to manually AddNetworkRouteTo() the network on the link,
using Ipv4GlobalRouting::AddNetworkRouteTo (Ipv4Address network,
Ipv4Mask networkMask, uint32_t interface), the changes only affect the
node where I configure the change. If I call
GlobalRouteManager::RecomputeRoutingTables(); I again get a segfault.

Anyway, right now my program flow is

GlobalRouteManager::PopulateRoutingTables (Nodecontainer);
Ptr<Ipv4GlobalRouting> globalRouting = GetGlobalRouting(ipv4); //
ipv4 being the router in the middle
ispglobalRouting->AddNetworkRouteTo ();
GlobalRouteManager::RecomputeRoutingTables();

Anyway, I figured that since PopulateRoutingTables is just
SelectRouterNodes();BuildGlobalRoutingDatabase (); and
InitializeRoutes (); I could go with doing a SelectRouterNodes before
injecting the additional route, and then doing the two other calls
later. Anyway, problem here is that BuildGlobalRoutingDatabase() and
InitializeRoutes are route-manager's private functions. As a quick
attempt at fix I just tried moving them to the public side.

Segfault avoided, but injected routes still don't propagate
anywhere.

Anyway, asking for thoughts on whether this would work: If I take a
look at global-router-interface.cc, DiscoverLSAs() function, it seems
to be pretty simple - you just go through the interfaces at a node
(and for DR calculation gather bunch of'em at separate nodes to a
NetDeviceContainer).

Would it work if I'd add somewhere around line 664 a construction
for External LSA's, basically just build them like so, for each route
I want to inject (provided via some data structure, basically a simple
table of Ipv4Address, Ipv4Mask - obviously I need to somehow provide a
suitable API for this)

for (i=0;i<InjectedNetworkAddress.size();i++) {
pLSA->SetLSType (GlobalRoutingLSA::ASExternalLSAs);
pLSA->SetLinkStateId (InjectedNetworkAddress[i]);
pLSA->SetAdvertisingRouter (m_routerId);
pLSA->SetNetworkLSANetworkMask (injectedNetworkMask[i]);
pLSA->SetStatus (GlobalRoutingLSA::LSA_SPF_NOT_EXPLORED);
m_LSAs.push_back (pLSA);
}

Thoughts? I'm concerned whether will using the type ASExternalLSAs
break up something..

(Of course, if someone else has already implemented this as well,
appreciating pointing to the correct direction).

Thanks for any input.
Reply all
Reply to author
Forward
0 new messages