Issues with OLSR HNA messages sent by multiple gateways

585 views
Skip to first unread message

Julien Boite

unread,
Jan 27, 2011, 8:44:50 AM1/27/11
to ns-3-users
Hi,

I'm experiencing routing troubles when HNA messages are sent by
multiple nodes in a Wireless Mesh Network.
My use case is the following : I have a Wireless Mesh Network (grid of
4*4 nodes using a ConstantPositionMobilityModel) in which I would
like to have 4 mesh routers act as gateways (node 0, node 3, node 12,
node 15). I also have an "Internet" network simulated by a CsmaChannel
on which 2 nodes are connected. Finally, each mesh gateway access to
the "Internet" via a specific Point-to-Point link connected to the
"Internet" node whose index is "0".

My simulation script, based on the "olsr-hna.cc" distributed with
ns-3.10, includes:
- the construction of this topology
- the instanciation of the OLSR routing protocol inside the Wireless
Mesh Network (WMN)
- other routing configuration (static default route on gateways and
InternetNode1)

GW1 GW2 <-----P2P link GW1------>
WMN <-----P2P link GW2------>
(OLSR) <-----P2P link GW3------> InternetNode0
<-----CsmaChannel-----> InternetNode1
GW3 GW4 <-----P2P link GW4------>

Actually, I would like to send traffic from a node inside the WMN to
the InternetNode1 (I'm currently using the UdpEcho Server/Client
helpers). To do this, mesh nodes must have a default route to forward
packets to unknown destinations through one of the 4 gateways. Based
on the methods proposed in "olsr-hna.cc", I made several tests that
shows results I can not understand :
- if only GW1 is configured to advertise HNA messages for the network
"0.0.0.0" (ipMask="0.0.0.0"), a mesh node is able to communicate with
InternetNode1 (it works fine). However, I have noticed that the
default route does not appear in its routing table. Is this normal? I
think it should appear in the OLSR routing table...
- if more than one gateway is configured to send HNA messages
advertising default route, routing exhibits abnormal behaviour :
-> a node inside the mesh can not communicate with an Internet node
(it does not work)
-> even a gateway itself can not communicate with an InternetNode
whereas a static default route is configured on it!!

Have someone already experienced this? Does someone understand this?
Is someone able to explain me the potential mistake I have made, or
why it behaves like this, or both?!!

Moreover, next step in my scenario will be to install
NetworkAddressTranslation on gateways. If someone has already done
this, I would really appreciate inputs.

Finally, I have just joined the ns-3-users group and this is my first
message, so I don't know how to attach my script... Anyway, I paste
the important section below.

I will be pleased to read your answers. Thanks.


********************************************************************************************

// Install standard Internet stack on Internet nodes
NS_LOG_INFO("Installing standard Internet stack on Internet nodes");
internetStack.Install(internetNodes);

// Configuring mesh routers' Internet stack with OLSR
NS_LOG_INFO("Installing Internet stack with OLSR on mesh nodes");
// Add the OLSR routing protocol to the list of routing protocols
// used by mesh routers (second argument is the priority).
// To be able to add potential static routes, a static routing helper
// is also added to this list of routing protocols (with a lowest
priority).
meshRoutersListRoutingHelper.Add(ipv4StaticRoutingHelper, 0);
meshRoutersListRoutingHelper.Add(meshRoutersOlsrHelper, 1);

// Tell the Internet stack to use this list of routing protocols
internetStack.SetRoutingHelper(meshRoutersListRoutingHelper);

// Install this configured Internet stack on mesh routers.
// As gateways are also contained in the "meshRouters" NodeContainer,
// we have to run over this container and make a test for each
element.
int nbMeshRouters = meshRouters.GetN();
for (int i=0; i<nbMeshRouters; i++) {
// If it is a gateway, continue (OLSR configuration for GW is made
later)
if ( (i == 0) || (i == m_xSize-1) || (i == nbMeshRouters-m_xSize) ||
(i == nbMeshRouters-1) ) continue;
NS_LOG_DEBUG("Configuring OLSR on mesh node " << i);
Ptr<Node> node = meshRouters.Get(i);
internetStack.Install(node);
}


// Configuring mesh gateways' Internet stack with OLSR and static
routing
NS_LOG_INFO("Installing Internet stack with configured OLSR on mesh
gateways");
// Gateways' P2P device (index = 2) in a non-OLSR device.
// Each of them must be excluded from the local OLSR process
int nbMeshGateways = meshGateways.GetN();
for (int i=0; i<nbMeshGateways; i++) {
meshGatewaysOlsrHelper.ExcludeInterface(meshGateways.Get(i), 2);
}
// Add the configured OLSR routing protocol to the list of routing
protocols
// used by mesh gateways (second argument is the priority)
// To be able to add potential static routes, a static routing helper
// is also added to this list of routing protocols (with a lowest
priority).
meshGatewaysListRoutingHelper.Add(ipv4StaticRoutingHelper, 0);
meshGatewaysListRoutingHelper.Add(meshGatewaysOlsrHelper, 1);

// Tell the Internet stack to use this list of routing protocols
internetStack.SetRoutingHelper(meshGatewaysListRoutingHelper);

// Install this configured Internet stack on mesh gateways
internetStack.Install(meshGateways);


// Configure IP addresses for every interfaces
Ipv4AddressHelper address;
NS_LOG_INFO("Now configuring IPv4 addresses for each network:");
address.SetBase("192.168.0.0", "255.255.255.0");
wifiInterfaces = address.Assign(meshDevices);
NS_LOG_INFO("Interfaces in the mesh network have IP addresses in the
network 192.168.0.0/24");

address.SetBase("10.0.0.0", "255.255.255.0");
internetInterfaces = address.Assign(internetDevices);
NS_LOG_INFO("Interfaces in the Internet have IP addresses in the
network 10.0.0.0/24");

address.SetBase("172.16.1.0", "255.255.255.0");
gateway1InternetLinkInterfaces =
address.Assign(gateway1InternetLinkDevices);
NS_LOG_INFO("Interfaces between GW1 and the Internet entry node have
IP addresses in the network 172.16.1.0/24");

address.SetBase("172.16.2.0", "255.255.255.0");
gateway2InternetLinkInterfaces =
address.Assign(gateway2InternetLinkDevices);
NS_LOG_INFO("Interfaces between GW2 and the Internet entry node have
IP addresses in the network 172.16.2.0/24");

address.SetBase("172.16.3.0", "255.255.255.0");
gateway3InternetLinkInterfaces =
address.Assign(gateway3InternetLinkDevices);
NS_LOG_INFO("Interfaces between GW3 and the Internet entry node have
IP addresses in the network 172.16.3.0/24");

address.SetBase("172.16.4.0", "255.255.255.0");
gateway4InternetLinkInterfaces =
address.Assign(gateway4InternetLinkDevices);
NS_LOG_INFO("Interfaces between GW4 and the Internet entry node have
IP addresses in the network 172.16.4.0/24");

// Add a default route on the destination node
Ptr<Node> dest = internetNodes.Get(1);
// The index of the outbound interface (last parameter) for this
route
// is 1 (first created interface after loopback, whose index is 0)
CreateDefaultRoute(dest, "10.0.0.1", 1);

// Add a default route on each gateway
//GW1
Ptr<Node> gw1 = meshGateways.Get(0);
CreateDefaultRoute(gw1, "172.16.1.2", 2);
//GW2
Ptr<Node> gw2 = meshGateways.Get(1);
CreateDefaultRoute(gw2, "172.16.2.2", 2);
//GW3
Ptr<Node> gw3 = meshGateways.Get(2);
CreateDefaultRoute(gw3, "172.16.3.2", 2);
//GW4
Ptr<Node> gw4 = meshGateways.Get(3);
CreateDefaultRoute(gw4, "172.16.4.2", 2);


// On each gateway, configure OLSR to announce a default route
// via HNA (Host and Network Association) messages
int nbMeshGateways = meshGateways.GetN();
for (int i=0; i<nbMeshGateways; i++) {

//Single GW announces HNA messages
// int i = 0;

Ptr<Node> gw = meshGateways.Get(i);
NS_LOG_INFO("Configuring HNA announcement on GW" << i+1);

// Find the OLSR routing protocol instance
// Get the current gateway IPv4 stack
Ptr<Ipv4> ipStack = gw->GetObject<Ipv4>();
// Get the IPv4 routing system, that can handle multiple routing
protocols
Ptr<Ipv4RoutingProtocol> routingSystem = ipStack-
>GetRoutingProtocol();
// In our case, it is a list. Casting is necessary to find OLSR by
iteration
Ptr<Ipv4ListRouting> listOfRoutingProtocols =
DynamicCast<Ipv4ListRouting>(routingSystem);
// Find OLSR and static routing in the list of routing protocols
Ptr<olsr::RoutingProtocol> olsr;
Ptr<Ipv4StaticRouting> staticRouting;
for (uint32_t j=0; j<listOfRoutingProtocols->GetNRoutingProtocols();
j++) {
// Output parameter set inside the "GetRoutingProtocol()" method
// to the priority value of the returned routing protocol
int16_t priority;
Ptr<Ipv4RoutingProtocol> temp = listOfRoutingProtocols-
>GetRoutingProtocol (j, priority);
if (DynamicCast<olsr::RoutingProtocol>(temp)) {
olsr = DynamicCast<olsr::RoutingProtocol>(temp);
NS_LOG_INFO("OLSR routing protocol found");
}
else if (DynamicCast<Ipv4StaticRouting>(temp)) {
staticRouting = DynamicCast<Ipv4StaticRouting>(temp);
NS_LOG_INFO("Static routing protocol found");
}
else NS_LOG_INFO("This Ipv4RoutingProtocol is not an instance of
OLSR or StaticRouting protocols");
}

if (hnaAssocMethod1) {
// Create a special Ipv4StaticRouting instance for
RoutingTableAssociation
// Even the Ipv4StaticRouting instance added to list may be used
Ptr<Ipv4StaticRouting> hnaEntries = Create<Ipv4StaticRouting>();
// Add the required routes into the Ipv4StaticRouting Protocol
instance
// and have the node generate HNA messages for all these routes
// which are associated with non-OLSR interfaces specified above.
hnaEntries->AddNetworkRouteTo(Ipv4Address("0.0.0.0"),
Ipv4Mask("0.0.0.0"), uint32_t(2), uint32_t(1));
// Ptr<OutputStreamWrapper> hnaStaticRoutes =
Create<OutputStreamWrapper>("hna.routes", std::ios::out);
// hnaEntries->PrintRoutingTable(hnaStaticRoutes);
NS_LOG_INFO("Associating the created routing table to OLSR for HNA
announcements");
olsr->SetRoutingTableAssociation(hnaEntries);

// // Associating the existing static routing table has the same
effect...
//// Ptr<OutputStreamWrapper> hnaStaticRoutes =
Create<OutputStreamWrapper>("hna.routes", std::ios::out);
//// staticRouting->PrintRoutingTable(hnaStaticRoutes);
// NS_LOG_INFO("Associating static routing table to OLSR for HNA
announcements");
// olsr->SetRoutingTableAssociation(staticRouting);
}
else if (hnaAssocMethod2) {
// Specify the association to announce
NS_LOG_INFO("Associating a default route to OLSR for HNA
announcements");
olsr->AddHostNetworkAssociation(Ipv4Address("0.0.0.0"),
Ipv4Mask("0.0.0.0"));
}
else NS_LOG_INFO("No HNA association method defined");
}


//TODO NAT on each GW
// Waiting for NAT to be functional, install a static route on
InternetNode0, using GW1.
Ptr<Node> net = internetNodes.Get(0);
// The index of the outbound interface (last parameter) for this
route
// is 2 (first p2p link, 1 being the index of the csma device's
address)
CreateDefaultRoute(net, "172.16.1.1", 2);

// Trace routing tables
Ipv4GlobalRoutingHelper g;
Ptr<OutputStreamWrapper> routingStream =
Create<OutputStreamWrapper>("routing.routes", std::ios::out);
g.PrintRoutingTableAllAt(Seconds(30), routingStream);
}

void MeshScenario::CreateDefaultRoute(Ptr<Node> node, char const
*nextHop, uint32_t interface) {
// Get the IP stack
Ptr<Ipv4> ipStack = node->GetObject<Ipv4>();
// Get the static routing elements in this stack
Ptr<Ipv4StaticRouting> staticRouting =
ipv4StaticRoutingHelper.GetStaticRouting(ipStack);
// Configure the default route entry
staticRouting->SetDefaultRoute(Ipv4Address(nextHop), interface, 0);
}

........

********************************************************************************************

Lalith Suresh

unread,
Jan 30, 2011, 6:38:39 AM1/30/11
to ns-3-...@googlegroups.com
Hello,

Can you attach the full script so that I can investigate this?


--
Lalith Suresh
Department of Computer Science and Engineering
Instituto Superior Técnico
www.lalith.in

Julien Boite

unread,
Jan 30, 2011, 9:53:18 AM1/30/11
to ns-3-users
Hello,

Thank you for proposing your help.
Before pasting the full script I currently use, I would like to say
that, after a fiew experiements using "V4ping" application, the idea I
mentionned in my previous message (changing routing protocols priority
on gateways) is not convenient.
I believe the problem comes from the fact that gateways take into
account HNA messages sent from other gateways whereas they should not
(because they announce the same network themselves)...

Thank you for investigating this.

********************************
My script:

#include "ns3/core-module.h"
#include "ns3/simulator-module.h"
#include "ns3/node-module.h"
#include "ns3/helper-module.h"
#include "ns3/global-routing-module.h"
#include "ns3/ipv4-list-routing-helper.h"
#include "ns3/ipv4-static-routing-helper.h"
#include "ns3/wifi-module.h"
#include "ns3/mobility-module.h"
#include "ns3/ipv4-list-routing.h"
#include "ns3/olsr-helper.h"
#include "ns3/olsr-routing-protocol.h"
#include "ns3/v4ping.h"

#include <iostream>
#include <sstream>
#include <fstream>

using namespace ns3;

NS_LOG_COMPONENT_DEFINE("MeshScenario");

class MeshScenario { // = specification in MeshScenario.h
// Declaration of public constructor and methods
public:
// Init scenario
MeshScenario(); // Constructor
// Other methods
// Configure scenario from command line arguments
void Configure(int argc, char ** argv);
// Run scenario
int Run();
static void PingRttResult(Time rtt);
// Declaration of private attributes
private:
// Grid parameters
int m_xSize;
int m_ySize;
double m_step;
// Node parameters
bool m_pcap;
// OLSR configuration parameters
bool hnaAssocMethod1;
bool hnaAssocMethod2;
//Simulation and application parameters
double m_totalTime;
double m_packetInterval;
uint16_t m_packetSize;

// List of mesh routers
NodeContainer meshRouters;
// List of mesh gateways
NodeContainer meshGateways;
// List of nodes that are part of the Internet
NodeContainer internetNodes;
// List of nodes for Internet link 1
NodeContainer internetLink1Nodes;
// List of nodes for Internet link 2
NodeContainer internetLink2Nodes;
// List of nodes for Internet link 3
NodeContainer internetLink3Nodes;
// List of nodes for Internet link 4
NodeContainer internetLink4Nodes;

// List of all mesh routers devices
NetDeviceContainer meshDevices;
// List of all Internet nodes' devices
NetDeviceContainer internetDevices;
// List of all devices connecting GW1 to the Internet
NetDeviceContainer gateway1InternetLinkDevices;
// List of all devices connecting GW2 to the Internet
NetDeviceContainer gateway2InternetLinkDevices;
// List of all devices connecting GW3 to the Internet
NetDeviceContainer gateway3InternetLinkDevices;
// List of all devices connecting GW4 to the Internet
NetDeviceContainer gateway4InternetLinkDevices;

//IP addresses of wifi interfaces
Ipv4InterfaceContainer wifiInterfaces;
//IP addresses of internet interfaces
Ipv4InterfaceContainer internetInterfaces;
//IP addresses of devices' interfaces that connect GW1 to the
Internet
Ipv4InterfaceContainer gateway1InternetLinkInterfaces;
//IP addresses of devices' interfaces that connect GW2 to the
Internet
Ipv4InterfaceContainer gateway2InternetLinkInterfaces;
//IP addresses of devices' interfaces that connect GW3 to the
Internet
Ipv4InterfaceContainer gateway3InternetLinkInterfaces;
//IP addresses of devices' interfaces that connect GW4 to the
Internet
Ipv4InterfaceContainer gateway4InternetLinkInterfaces;

// WifiHelper and CsmaHelper. Report is not static methods
WifiHelper wifi;
YansWifiPhyHelper wifiPhy;
CsmaHelper internet;
PointToPointHelper p2pGW1;
PointToPointHelper p2pGW2;
PointToPointHelper p2pGW3;
PointToPointHelper p2pGW4;

// Helpers to deal with IP and routing configuration
InternetStackHelper internetStack;
InternetStackHelper olsrStack;
Ipv4StaticRoutingHelper ipv4StaticRoutingHelper;
Ipv4ListRoutingHelper meshRoutersListRoutingHelper;
Ipv4ListRoutingHelper meshGatewaysListRoutingHelper;
OlsrHelper meshRoutersOlsrHelper;
OlsrHelper meshGatewaysOlsrHelper;

// Declaration of private methods
private:
// Create nodes, channels and configures mobility
void CreateTopology();
// Called by CreateTopology()
void CreateMeshNodesAndGateways();
void CreateInternetNodes();
void LinkGatewaysToInternet();
// Install internet stack on nodes
void InstallInternetStacks();
// Configures routing on nodes
void ConfigureRouting();
// Creates a default static route for the specified node,
// using the specified next hop and output interface.
void CreateDefaultRoute(Ptr<Node> node, char const *address,
uint32_t interface);
// Install applications
void InstallApplication();
void InstallUdpEcho();
void InstallPing();
// Enable captures for some nodes
void EnablePcapCaptures();
// Print mesh devices diagnostics
void Report();
}; // End of MeshScenario.h specification.


MeshScenario::MeshScenario() {
m_xSize = 4;
m_ySize = 4;
m_step = 100.0;

hnaAssocMethod1 = false;
hnaAssocMethod2 = false;

m_pcap = true;

m_totalTime = 50.0;
m_packetInterval = 2.0;
m_packetSize = 1024;
}


void MeshScenario::CreateTopology() {
CreateMeshNodesAndGateways();
CreateInternetNodes();
LinkGatewaysToInternet();
}

void MeshScenario::CreateMeshNodesAndGateways() {
int nbMeshNodes = m_ySize*m_xSize;
NS_LOG_INFO("Creating " << nbMeshNodes << " mesh nodes (including
gateways)");

// Create m_ySize*m_xSize stations to form a grid topology
meshRouters.Create(m_ySize*m_xSize);
// Add gateways to the gateway nodes container
meshGateways.Add(meshRouters.Get(0));
meshGateways.Add(meshRouters.Get(m_xSize - 1));
meshGateways.Add(meshRouters.Get(nbMeshNodes - m_xSize) );
meshGateways.Add(meshRouters.Get(nbMeshNodes - 1));

// Configure YansWifiChannel (802.11a)
NS_LOG_INFO ("Creating WifiChannel.");

// PHY layer
wifiPhy = YansWifiPhyHelper::Default();
// Creates a WifiChannel with a propagation delay equal to a
constant,
// the speed of light, and a propagation loss based on a log distance
model
// with a reference loss of 46.6777 dB at reference distance of 1m.
YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default();
// Associates the physical medium and the channel
wifiPhy.SetChannel (wifiChannel.Create());

// MAC layer
// WifiHelper helps to create WifiNetDevices with the same
configuration parameters.
// The default state is defined as being an Adhoc MAC layer with an
ARF rate control algorithm
// and both objects using their default attribute values. By default,
configure MAC and PHY for 802.11a.
wifi = WifiHelper::Default();
// Changes the control rate from ARF to AARF.
// wifi.SetRemoteStationManager ("ns3::AarfWifiManager");
// Creates a Wifi MAC layer without QoS (default type = AdHocMac)
NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default();
// Configures SSID and sets it and other parameters to the type of
MAC
Ssid ssid = Ssid("meshScenario");
wifiMac.SetType("ns3::AdhocWifiMac",
"Ssid", SsidValue(ssid)//,
/*"ActiveProbing", BooleanValue(false)*/);

// Install devices in mesh nodes
NS_LOG_INFO ("Installing devices in Mesh Routers");
meshDevices = wifi.Install(wifiPhy, wifiMac, meshRouters);

NS_LOG_INFO ("Setting ConstantPositionMobilityModel to mesh
routers");
// Setup mobility - static grid topology
MobilityHelper mobility;
mobility.SetPositionAllocator ("ns3::GridPositionAllocator",
"MinX", DoubleValue (0.0),
"MinY", DoubleValue (0.0),
"DeltaX", DoubleValue (m_step),
"DeltaY", DoubleValue (m_step),
"GridWidth", UintegerValue (m_xSize),
"LayoutType", StringValue ("RowFirst"));
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobility.Install(meshRouters);
}

void MeshScenario::CreateInternetNodes() {
int nbInternetNodes = 2;
NS_LOG_INFO ("Creating " << nbInternetNodes << " Internet nodes");
internetNodes.Create(nbInternetNodes);

NS_LOG_INFO ("Creating CsmaChannel for the Internet");
internet.SetChannelAttribute ("DataRate", StringValue ("10Mbps"));
internet.SetChannelAttribute ("Delay", TimeValue (MilliSeconds(10)));

NS_LOG_INFO ("Installing devices in Internet nodes");
internetDevices = internet.Install(internetNodes);
}

void MeshScenario::LinkGatewaysToInternet() {
NS_LOG_INFO("Adding nodes to the node container of their respective
internet link");
internetLink1Nodes.Add(meshGateways.Get(0));
internetLink1Nodes.Add(internetNodes.Get(0));

internetLink2Nodes.Add(meshGateways.Get(1));
internetLink2Nodes.Add(internetNodes.Get(0));

internetLink3Nodes.Add(meshGateways.Get(2));
internetLink3Nodes.Add(internetNodes.Get(0));

internetLink4Nodes.Add(meshGateways.Get(3));
internetLink4Nodes.Add(internetNodes.Get(0));

NS_LOG_INFO ("Creating P2P connection and installing devices between
gateways and the Internet");
p2pGW1.SetDeviceAttribute("DataRate", StringValue("5Mbps"));
p2pGW1.SetChannelAttribute("Delay", StringValue("2ms"));
gateway1InternetLinkDevices = p2pGW1.Install(internetLink1Nodes);

p2pGW2.SetDeviceAttribute("DataRate", StringValue("5Mbps"));
p2pGW2.SetChannelAttribute("Delay", StringValue("2ms"));
gateway2InternetLinkDevices = p2pGW2.Install(internetLink2Nodes);

p2pGW3.SetDeviceAttribute("DataRate", StringValue("5Mbps"));
p2pGW3.SetChannelAttribute("Delay", StringValue("2ms"));
gateway3InternetLinkDevices = p2pGW3.Install(internetLink3Nodes);

p2pGW4.SetDeviceAttribute("DataRate", StringValue("5Mbps"));
p2pGW4.SetChannelAttribute("Delay", StringValue("2ms"));
gateway4InternetLinkDevices = p2pGW4.Install(internetLink4Nodes);
}

void MeshScenario::InstallInternetStacks() {

// Install standard Internet stack on Internet nodes
NS_LOG_INFO("Installing standard Internet stack on Internet nodes");
internetStack.Install(internetNodes);
// internetStack.Install(meshRouters);
meshGatewaysListRoutingHelper.Add(ipv4StaticRoutingHelper, 1);
meshGatewaysListRoutingHelper.Add(meshGatewaysOlsrHelper, 0);
void MeshScenario::ConfigureRouting() {

// The following instruction does not work with wireless networks.
// Explanations can be found here: http://www.nsnam.org/doxygen/group__globalrouting.html
// Ipv4GlobalRoutingHelper::PopulateRoutingTables();

// Add a default route on the destination node
Ptr<Node> dest = internetNodes.Get(1);
// The index of the outbound interface (last parameter) for this
route
// is 1 (first created interface after loopback, whose index is 0)
CreateDefaultRoute(dest, "10.0.0.1", 1);


// Add a default route on each gateway
//GW1
Ptr<Node> gw1 = meshGateways.Get(0);
CreateDefaultRoute(gw1, "172.16.1.2", 2);
//GW2
Ptr<Node> gw2 = meshGateways.Get(1);
CreateDefaultRoute(gw2, "172.16.2.2", 2);
//GW3
Ptr<Node> gw3 = meshGateways.Get(2);
CreateDefaultRoute(gw3, "172.16.3.2", 2);
//GW4
Ptr<Node> gw4 = meshGateways.Get(3);
CreateDefaultRoute(gw4, "172.16.4.2", 2);


// On each gateway, configure OLSR to announce a default route
// via HNA (Host and Network Association) messages
int nbMeshGateways = meshGateways.GetN();
for (int i=0; i<nbMeshGateways; i++) {

// //Single GW announces HNA messages
Ipv4Mask::GetZero(), uint32_t(2), uint32_t(1));
// Ptr<OutputStreamWrapper> hnaStaticRoutes =
Create<OutputStreamWrapper>("hna.routes", std::ios::out);
// hnaEntries->PrintRoutingTable(hnaStaticRoutes);
NS_LOG_INFO("Associating the created routing table to OLSR for HNA
announcements");
olsr->SetRoutingTableAssociation(hnaEntries);

// // Associating the existing static routing table has the same
effect...
//// Ptr<OutputStreamWrapper> hnaStaticRoutes =
Create<OutputStreamWrapper>("hna.routes", std::ios::out);
//// staticRouting->PrintRoutingTable(hnaStaticRoutes);
// NS_LOG_INFO("Associating static routing table to OLSR for HNA
announcements");
// olsr->SetRoutingTableAssociation(staticRouting);
}
else if (hnaAssocMethod2) {
// Specify the association to announce
NS_LOG_INFO("Associating a default route to OLSR for HNA
announcements");
olsr->AddHostNetworkAssociation(Ipv4Address("0.0.0.0"),
Ipv4Mask::GetZero());
}
else NS_LOG_INFO("No HNA association method defined");
}


//TODO NAT on each GW
// En attendant, route statique (0.0.0.0 vers GW1) sur point d'entrée
Internet.
Ptr<Node> net = internetNodes.Get(0);
// The index of the outbound interface (last parameter) for this
route
// is 2 (first p2p link, 1 being the index of the csma device's
address)
CreateDefaultRoute(net, "172.16.1.1", 2);

// Trace routing tables
Ipv4GlobalRoutingHelper g;
Ptr<OutputStreamWrapper> routingStream1 =
Create<OutputStreamWrapper>("routing_1.routes", std::ios::out);
g.PrintRoutingTableAllAt(Seconds(7), routingStream1);
Ptr<OutputStreamWrapper> routingStream2 =
Create<OutputStreamWrapper>("routing_2.routes", std::ios::out);
g.PrintRoutingTableAllAt(Seconds(30), routingStream2);
}

void MeshScenario::CreateDefaultRoute(Ptr<Node> node, char const
*nextHop, uint32_t interface) {
// Get the IP stack
Ptr<Ipv4> ipStack = node->GetObject<Ipv4>();
// Get the static routing elements in this stack
Ptr<Ipv4StaticRouting> staticRouting =
ipv4StaticRoutingHelper.GetStaticRouting(ipStack);
// Configure the default route entry
staticRouting->SetDefaultRoute(Ipv4Address(nextHop), interface, 0);
}

void MeshScenario::InstallApplication() {
InstallPing();
// InstallUdpEcho();
}

void MeshScenario::InstallPing() {
NS_LOG_INFO ("Install \"V4Ping\" Application");
V4PingHelper pingHelper =
V4PingHelper(internetInterfaces.GetAddress(1));
// V4PingHelper pingHelper =
V4PingHelper(wifiInterfaces.GetAddress(12));
pingHelper.SetAttribute("Verbose", BooleanValue(true));
ApplicationContainer appContainer =
pingHelper.Install(meshRouters.Get(1));
Ptr<V4Ping> app = DynamicCast<V4Ping>(appContainer.Get(0));
// Hook a trace to print RTT when the response comes back
app->TraceConnectWithoutContext("Rtt",
MakeCallback(&MeshScenario::PingRttResult));
}

void MeshScenario::PingRttResult(Time rtt) {
NS_LOG_UNCOND("RTT = " << rtt);
}

void MeshScenario::InstallUdpEcho() {
UdpEchoServerHelper echoServer(9);
// ApplicationContainer serverApps =
echoServer.Install(meshRouters.Get(1));
ApplicationContainer serverApps =
echoServer.Install(internetNodes.Get(1));
serverApps.Start (Seconds (31.0));
serverApps.Stop (Seconds (m_totalTime));

// UdpEchoClientHelper echoClient(wifiInterfaces.GetAddress(1), 9);
UdpEchoClientHelper echoClient(internetInterfaces.GetAddress(1), 9);
echoClient.SetAttribute ("MaxPackets", UintegerValue ((uint32_t)
(m_totalTime*(1/m_packetInterval))));
echoClient.SetAttribute ("Interval", TimeValue (Seconds
(m_packetInterval)));
echoClient.SetAttribute ("PacketSize", UintegerValue (m_packetSize));
// ApplicationContainer clientApps =
echoClient.Install(internetNodes.Get(1));
ApplicationContainer clientApps =
echoClient.Install(meshRouters.Get(1));
clientApps.Start (Seconds (31.0));
clientApps.Stop (Seconds (m_totalTime));
}

void MeshScenario::EnablePcapCaptures() {
wifiPhy.EnablePcap("pcapMesh", meshDevices.Get(0), false);
wifiPhy.EnablePcap("pcapMesh", meshDevices.Get(1), false);
wifiPhy.EnablePcap("pcapMesh", meshDevices.Get(2), false);
wifiPhy.EnablePcap("pcapMesh", meshDevices.Get(3), false);
wifiPhy.EnablePcap("pcapMesh", meshDevices.Get(5), false);
wifiPhy.EnablePcap("pcapMesh", meshDevices.Get(6), false);
wifiPhy.EnablePcap("pcapMesh", meshDevices.Get(10), false);

p2pGW1.EnablePcap("pcapP2P", gateway1InternetLinkDevices.Get(0),
false);
internet.EnablePcap("pcapInternet",internetDevices.Get(0), false);
internet.EnablePcap("pcapInternet",internetDevices.Get(1), false);
}

void MeshScenario::Report() {
// unsigned n (0);
// for (NetDeviceContainer::Iterator i = meshDevices.Begin (); i !=
meshDevices.End (); ++i, ++n) {
// std::ostringstream os;
// os << "mp-report-" << n << ".xml";
// std::cerr << "Printing mesh point device #" << n << " diagnostics
to " << os.str () << "\n";
// std::ofstream of;
// of.open (os.str().c_str());
// if (! of.is_open ()) {
// std::cerr << "Error: Can't open file " << os.str() << "\n";
// return;
// }
// wifi.Report (*i, of);
// of.close ();
// }
}

void MeshScenario::Configure(int argc, char *argv[]) {
CommandLine cmd;
cmd.AddValue("x-size", "Number of nodes in a row grid. [4]",
m_xSize);
cmd.AddValue("y-size", "Number of rows in a grid. [4]", m_ySize);
cmd.AddValue("step", "Size of edge in our grid, in meters. [100
m]", m_step);
cmd.AddValue ("hnaAssocMethod1", "Use SetRoutingTableAssociation ()
method", hnaAssocMethod1);
cmd.AddValue ("hnaAssocMethod2", "Use AddHostNetworkAssociation ()
method", hnaAssocMethod2);
cmd.AddValue("pcap", "Enable PCAP traces on interfaces. [0]",
m_pcap);
cmd.AddValue("time", "Simulation time, in seconds [100 s]",
m_totalTime);
cmd.AddValue("packet-interval", "Interval between packets in UDP
ping, in seconds [0.001 s]", m_packetInterval);
cmd.AddValue("packet-size", "Size of packets in UDP ping",
m_packetSize);

cmd.Parse(argc, argv);

NS_LOG_DEBUG("Grid:" << m_xSize << "*" << m_ySize);
NS_LOG_DEBUG("Simulation time: " << m_totalTime << " s");

LogComponentEnable("MeshScenario", LOG_INFO);
// LogComponentEnable("OlsrRoutingProtocol", LOG_DEBUG);
LogComponentEnable("UdpEchoClientApplication", LOG_INFO);
LogComponentEnable("UdpEchoServerApplication", LOG_INFO);
}

int MeshScenario::Run() {
CreateTopology();
InstallInternetStacks();
ConfigureRouting();
InstallApplication();
if (m_pcap) EnablePcapCaptures();
Simulator::Schedule(Seconds(m_totalTime), & MeshScenario::Report,
this);
Simulator::Stop(Seconds (m_totalTime));
Simulator::Run();
Simulator::Destroy();
return 0;
}

int main(int argc, char *argv[]) {
MeshScenario t;
t.Configure(argc, argv);
return t.Run();
}


********************************



On 30 jan, 12:38, Lalith Suresh <suresh.lal...@gmail.com> wrote:
> Hello,
>
> Can you attach the full script so that I can investigate this?
>
> --
> Lalith Suresh
> Department of Computer Science and Engineering
> *Instituto Superior Técnico*www.lalith.in

Lalith Suresh

unread,
Jan 31, 2011, 12:02:21 PM1/31/11
to ns-3-...@googlegroups.com
Hello,

I didn't have time to investigate the script in detail, but I believe I understand the problem. My comments inline.


On Sun, Jan 30, 2011 at 2:53 PM, Julien Boite <jub...@gmail.com> wrote:
Hello,

Thank you for proposing your help.
Before pasting the full script I currently use, I would like to say
that, after a fiew experiements using "V4ping" application, the idea I
mentionned in my previous message (changing routing protocols priority
on gateways) is not convenient.
I believe the problem comes from the fact that gateways take into
account HNA messages sent from other gateways whereas they should not
(because they announce the same network themselves)...

Basically, RFC 3626 is a little vague regarding HNA and as far as this situation is concerned, offers no pointers whatsoever. From the looks of it, this situation pretty much assumes that a gateway node is supposed to forward any packets it receives corresponding to an association it holds on a non-olsr interface.

The fix is trivial in my opinon. We can have an HNA gateway add the associated networks on its non-olsr interfaces as routes in it's HNA routing table before adding the routes it receives via HNA messages. Doing this inside RoutingTableComputation() just before line 1105 should do the trick. I'll try this out later tonight, but if its urgent for you, a patch is most welcome. :)
 

Thank you for investigating this.

 


--
Lalith Suresh
Department of Computer Science and Engineering
Instituto Superior Técnico
www.lalith.in

Julien Boite

unread,
Jan 31, 2011, 3:05:23 PM1/31/11
to ns-3-users
Hello,

Thanks for your suggestions. And you're right, this misbehaviour is a
blocking element I would like to overcome soon.

I had a look at the "RoutingTableComputation()" method you mentioned,
and noticed that:
- the "m_associationSet" attribute of the "OlsrState" class (that
represents HNA entries received from other gateways) is used from line
1111 (I paste the section below)
- however, the "m_associations" attribute (also in "OlsrState") that
deals with LOCAL HNA entries is never used.

Don't you think the patch should take place in this section rather
(from line 1111) ?
I still don't know precisely where, but I think a test comparing each
association from the "m_associationSet" with the content of
"m_association" is necessary to decide whether or not to (possibly
remove and) add a route: I believe it is not necessary to add a route
for a destination network that is included in the "m_associations"
attribute (so, sent via HNA messages) because it is naturally
installed in the static routing table (assuming an announced network
is directly attached to a non-olsr interface), or, in case it is a
default route, because it might also have been installed in the static
routing table.
If the destination network announced by other gateways is not in the
local associations ("m_associations" attribute), the current process
seems accurate.

What is your opinion about that?
Thanks again!

// 5. For each tuple in the association set,
// If there is no entry in the routing table with:
// R_dest_addr == A_network_addr/A_netmask
// then a new routing entry is created.
const AssociationSet &associationSet = m_state.GetAssociationSet ();
for (AssociationSet::const_iterator it = associationSet.begin ();
it != associationSet.end (); it++)
{
AssociationTuple const &tuple = *it;
RoutingTableEntry gatewayEntry;

bool gatewayEntryExists = Lookup (tuple.gatewayAddr,
gatewayEntry);
bool addRoute = false;

uint32_t routeIndex = 0;

for (routeIndex = 0; routeIndex < m_hnaRoutingTable->GetNRoutes
(); routeIndex++)
{
Ipv4RoutingTableEntry route = m_hnaRoutingTable->GetRoute
(routeIndex);
if (route.GetDestNetwork () == tuple.networkAddr &&
route.GetDestNetworkMask () == tuple.netmask)
{
break;
}
}

if (routeIndex == m_hnaRoutingTable->GetNRoutes ())
{
addRoute = true;
}
else if(gatewayEntryExists && m_hnaRoutingTable->GetMetric
(routeIndex) > gatewayEntry.distance)
{
m_hnaRoutingTable->RemoveRoute(routeIndex);
addRoute = true;
}

if(addRoute && gatewayEntryExists)
{
m_hnaRoutingTable->AddNetworkRouteTo (tuple.networkAddr,
tuple.netmask,
gatewayEntry.nextAddr,

gatewayEntry.interface,

gatewayEntry.distance);

}
}



On 31 jan, 18:02, Lalith Suresh <suresh.lal...@gmail.com> wrote:
> Hello,
>
> I didn't have time to investigate the script in detail, but I believe I
> understand the problem. My comments inline.
>
> *Instituto Superior Técnico*www.lalith.in

Julien Boite

unread,
Jan 31, 2011, 4:41:10 PM1/31/11
to ns-3-users
Hi again,

I have tried to add the following section, and it seems to work, but
only in case the association method 2 is used (call to
"AddHostNetworkAssociation()" ). While using the association method 1,
my first debug logging element indicates "0" local associations...
I deduce that no consistency is maintained between the elements used
by each association method. I think this may also be an issue... This
implies that necessary tests must be duplicated (one for each method).
Not so good conceptual choice, don't you think?

Thanks for telling me what you think about this solution.


**********************************************
// 5. For each tuple in the association set,
// If there is no entry in the routing table with:
// R_dest_addr == A_network_addr/A_netmask
// then a new routing entry is created.
const AssociationSet &associationSet = m_state.GetAssociationSet ();
for (AssociationSet::const_iterator it = associationSet.begin ();
it != associationSet.end (); it++)
{
AssociationTuple const &tuple = *it;

// ADDED SECTION: test if HNA associations received from other
GWs
// are also announced by this node.
// In such case, do NOT add a route for this association and go
to the next association tuple.
bool goToNextAssociationTuple = false;
const Associations &localHnaAssociations =
m_state.GetAssociations();
NS_LOG_DEBUG("Nb local associations: " <<
localHnaAssociations.size());
for (Associations::const_iterator assocIterator =
localHnaAssociations.begin();
assocIterator != localHnaAssociations.end(); assocIterator++) {
Association const &localHnaAssoc = *assocIterator;
if (localHnaAssoc.networkAddr == tuple.networkAddr &&
localHnaAssoc.netmask == tuple.netmask) {
NS_LOG_DEBUG("HNA association received from another GW is part
of local associations: no route added for network " <<
tuple.networkAddr << "/" << tuple.netmask);
goToNextAssociationTuple = true;
}
}
if (goToNextAssociationTuple) continue;
// END OF ADDED SECTION

RoutingTableEntry gatewayEntry;

bool gatewayEntryExists = Lookup (tuple.gatewayAddr,
gatewayEntry);
bool addRoute = false;
.....

**********************************************

Lalith Suresh

unread,
Jan 31, 2011, 6:07:23 PM1/31/11
to ns-3-...@googlegroups.com
Hello,

On Mon, Jan 31, 2011 at 9:41 PM, Julien Boite <jub...@gmail.com> wrote:
Hi again,

I have tried to add the following section, and it seems to work, but
only in case the association method 2 is used (call to
"AddHostNetworkAssociation()" ). While using the association method 1,
my first debug logging element indicates "0" local associations...
I deduce that no consistency is maintained between the elements used
by each association method. I think this may also be an issue... This
implies that necessary tests must be duplicated (one for each method).
Not so good conceptual choice, don't you think?

m_associationSet is returned by OlsrState::GetAssociationSet(). This is the set of associations learnt via HNA messages, and used in the routing table computations. On the other hand, if you look into SendHna(), you'll notice a call to OlsrState::GetAssociations(). This returns the set of local HNA entries that the node actually announces through HNA messages. This is the behaviour prescribed by the RFC.

If by consistency you imply that that the same association can be announced twice by entering it via either association method, I believe that is being handled already from SendHna(). In case I got you wrong, can you elaborate a little more?
 

--
Lalith Suresh
Department of Computer Science and Engineering
Instituto Superior Técnico
www.lalith.in

Lalith Suresh

unread,
Jan 31, 2011, 6:13:09 PM1/31/11
to ns-3-...@googlegroups.com
Hello again,

I've created a bug report for this: http://www.nsnam.org/bugzilla/show_bug.cgi?id=1049

Let's continue the discussion there. Please upload a diff of your patches there as well.

Julien Boite

unread,
Jan 31, 2011, 8:18:02 PM1/31/11
to ns-3-users
Thanks for creating a bug report. I don't know how important the
problem description is, but, more precisely, the routing loop created
by the bug is not "between the HNA gateways themselves", but between
each gateway and one of its 1-hop neighbours. Feel free to modify your
description regarding how relevant you think this precision is.
I would be pleased to upload my patches. If you can just tell me what
the process is (I'm currently not using Mercurial)...

Then, I totally agree with the first paragraph in your reply. I get
well the difference between "OlsrState::GetAssociationSet()" that
returns HNA associations learnt from other gateways, and
"OlsrState::GetAssociations()" that stores what I called local HNA
associations (to be announced by the gateway itself).

Now, I'm trying to clarify what I wanted to say about consistency.
Let's focus on the local association part. If I want a gateway to
announce one or more network associations, ns-3 currently proposes 2
methods:
- (1) the first one allows to set a static routing table through the
use of "SetRoutingTableAssociation(Ptr<Ipv4StaticRouting>
routingTable)".
- (2) the second one allows to add one network address (with its
associated netmask) to a list of network associations through the use
of "AddHostNetworkAssociation(Ipv4Address networkAddr, Ipv4Mask
netmask)".
The consistency problem I would like to highlight is that, for 2
methods proposed with the same expected result, 2 different structures
are used. I don't know if this functioning is clearly described in the
RFC, but I believe that consistency and ease of management would be
ensured if only one structure would hold the entire set of local HNA
entries.
For instance, the SendHna() method currently deals with both
structures, and must check if entries in the second structure have not
already been added in HNA messages from the first structure. So,
you're right, HNA annoucements cannot be duplicated. However, if only
one structure would hold all HNA entries, this test would not even
exist (not here at least). Coming back to my last modification in the
method "RoutingTableComputation()", I would not have to write 2
equivalent tests to make my patch work for both association methods
because the "GetAssociations()" method would return all the entries,
even if the association method (1) has been used.
I think something that could be envisioned is that the
"SetRoutingTableAssociation()" method could iterate on entries only
once and use "AddHostNetworkAssociation()" to add each of them (more
precisely, entries whose outgoing interface is a non-olsr interface)
to the list of network associations, if it does not already exist.
Then, everywhere else, only this list would be used and accessible
with "GetAssociations()", that would return all entries without
surprise (not only entries added with one of the two association
methods) !

I hope I made myself clearer... :-)
Do not hesitate to react.



On 1 fév, 00:13, Lalith Suresh <suresh.lal...@gmail.com> wrote:
> Hello again,
>
> I've created a bug report for this:http://www.nsnam.org/bugzilla/show_bug.cgi?id=1049
>
> Let's continue the discussion there. Please upload a diff of your patches
> there as well.
>
> --
> Lalith Suresh
> Department of Computer Science and Engineering
> *Instituto Superior Técnico*www.lalith.in

Lalith Suresh

unread,
Feb 1, 2011, 5:18:32 AM2/1/11
to ns-3-...@googlegroups.com
Hello,

On Tue, Feb 1, 2011 at 1:18 AM, Julien Boite <jub...@gmail.com> wrote:
Thanks for creating a bug report. I don't know how important the
problem description is, but, more precisely, the routing loop created
by the bug is not "between the HNA gateways themselves", but between
each gateway and one of its 1-hop neighbours. Feel free to modify your
description regarding how relevant you think this precision is.
I would be pleased to upload my patches. If you can just tell me what
the process is (I'm currently not using Mercurial)...

If you're not using Mercurial, then do:

$: diff -u originalfile.cc modifiedfile.cc > patch

If you're using mercurial, it's just a matter of doing:

$: hg diff > patch

In any case, upload the patch file at the bugzilla report.
Ah I get it now. Initially, the two methods were provided to allow for different use cases. The SetRoutingTableAssociation() method would be faster if the user already had a static routing protocol in place, which is why it was implemented. Note that the RFC does not specify anything about the structures to be used, and this is left entirely to the implementation.

When HNA support was implemented, the only part where the local associations were being used was in the SendHna() method, and thus it seemed OK to draw associations from two different structures and do the check for duplicates within SendHna() itself. But considering the situation you've just highlighted, I think it would be good to have GetAssociations() to return associations from either structure without any repeating element.

Feel free to submit a patch. :) Else, I can get this done tomorrow perhaps.

Thanks!
 

I hope I made myself clearer... :-)
Do not hesitate to react.



On 1 fév, 00:13, Lalith Suresh <suresh.lal...@gmail.com> wrote:
> Hello again,
>
> I've created a bug report for this:http://www.nsnam.org/bugzilla/show_bug.cgi?id=1049
>
> Let's continue the discussion there. Please upload a diff of your patches
> there as well.
>
> --
> Lalith Suresh
> Department of Computer Science and Engineering
> *Instituto Superior Técnico*www.lalith.in

--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.




--
Lalith Suresh
Department of Computer Science and Engineering
Instituto Superior Técnico
www.lalith.in

Julien Boite

unread,
Feb 1, 2011, 6:05:50 AM2/1/11
to ns-3-users
Hello,

That's cool if I get understood!
I'm working on the patch in my free time. I'll advertise you as soon
as I will be ready to submit this patch (with all improvements
previously mentioned).
Thanks again for your inputs and discussion.

For my work (not free time!), I need to make gateways perform NAT. I
suppose this is not the appropriate topic to speak about that
(although NAT often occurs on gateways!), but if you have inputs to
give me (which parts of code should I use? Are examples available
somewhere?), I would really appreciate. Thank you.


On 1 fév, 11:18, Lalith Suresh <suresh.lal...@gmail.com> wrote:
> Hello,
>
> > ns-3-users+...@googlegroups.com<ns-3-users%2Bunsu...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/ns-3-users?hl=en.
>
> --
> Lalith Suresh
> Department of Computer Science and Engineering
> *Instituto Superior Técnico*www.lalith.in

Lalith Suresh

unread,
Feb 1, 2011, 6:16:50 AM2/1/11
to ns-3-...@googlegroups.com
Hello,

On Tue, Feb 1, 2011 at 11:05 AM, Julien Boite <jub...@gmail.com> wrote:
Hello,

That's cool if I get understood!
I'm working on the patch in my free time. I'll advertise you as soon
as I will be ready to submit this patch (with all improvements
previously mentioned).
Thanks again for your inputs and discussion.

For my work (not free time!), I need to make gateways perform NAT. I
suppose this is not the appropriate topic to speak about that
(although NAT often occurs on gateways!), but if you have inputs to
give me (which parts of code should I use? Are examples available
somewhere?), I would really appreciate. Thank you.

As far as I know, it still needs a bit more work, but you could perhaps look into the ns-3-netfilters repo [0]. There's also one specifically for NAT [1], but it was last worked on 19 months ago. :)


 
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.




--
Lalith Suresh
Department of Computer Science and Engineering
Instituto Superior Técnico
www.lalith.in

Julien Boite

unread,
Feb 1, 2011, 7:16:19 PM2/1/11
to ns-3-users
Hello,

Thanks for your inputs regarding NAT. I had seen the "qasimj/ns-3-dev-
nat/" repo, and I'm also going to have a look at the other one.
I think I will experience a lot of pain to make my entire scenario
work...!

FYI, I have attached the diff result to the bug report you created
(you probably received an e-mail for that).
If I have made something wrong (I let a lot of comments, I did not
performed various tests), do not hesitate to tell me how to come up
with better contributions for the future.


On 1 fév, 12:16, Lalith Suresh <suresh.lal...@gmail.com> wrote:
> Hello,
>
> > <ns-3-users%2Bunsu...@googlegroups.com<ns-3-users%252Buns...@googlegroups.com>

Julien Boite

unread,
Jan 28, 2011, 8:10:49 PM1/28/11
to ns-3-users
Hi,

I am still in trouble, so still waiting for help or ideas to overcome
routing problems I described in my previous message.
However, I identified the reason why the routing problems occur.

I previously said that the default route advertised by gateways using
HNA messages is not installed in the OLSR routing table of mesh
routers. This is still right (and I do think the default behaviour
should be to include the best route from HNA annoucements in the OLSR
routing table), but I saw this default route stored in the HNA routing
table. I do not master the routing lookup process implemented in ns-3
at all, but I suppose this HNA routing table is used in the packets
forwarding process. Is it the best choice? I don't know...

The essential point I would like to mention might highlight a bug:

- when only one gateway announces a default route in HNA messages,
mesh routers in its 1-hop neighbourhood add in their HNA routing table
a default route with this gateway as the next hop. Other mesh routers
in a wider range receive add in their routing table a default route
with their respective next hop towards the gateway. This way, routing
converges and any mesh router can send traffic to any destination

- when multiple gateways advertise the same route via HNA messages,
the routing protocol converges but creates a ROUTING LOOP between each
gateway and one of its 1-hop neighbours. I suppose that forwarding of
HNA messages can be the cause of this routing loop. It looks like a
gateway receives announcements sent by other gateways, adds the
advertised networks in their HNA routing table and use it instead of
using the static default route I have configured...

I will continue to investigate and go further in the ns-3
implementation of OLSR, but if someone has an idea on how to overcome
this, I would be very pleased to read it.

Oh!! An idea went to my mind while writing this message! I just
changed the priority of routing protocols on gateways. With static
routing set to a priority higher than the priority of OLSR routing, it
works fine! However, I do think that something could be done in the
management of HNA message to avoid the behaviour I described...

Now, my next step is to install NAT on gateways, and any inputs that
can help me are welcome. Thanks.
Reply all
Reply to author
Forward
0 new messages