Wednesday, May 18, 2011

Topology routing table view

On 10.0.0.1:

Table: Links
Local IP    Remote IP    Hyst.    LQ    NLQ    Cost
10.0.0.1    10.0.0.3    0.00    1.000    1.000    1.000   

Table: Neighbors
IP address    SYM    MPR    MPRS    Will.    2 Hop Neighbors
10.0.0.3    YES    YES    NO    3    3

Table: Topology
Dest. IP    Last hop IP    LQ    NLQ    Cost
10.0.0.3    10.0.0.1    1.000    1.000    1.000
10.0.0.3    10.0.0.2    1.000    1.000    1.000
10.0.0.1    10.0.0.3    1.000    1.000    1.000
10.0.0.2    10.0.0.3    1.000    1.000    1.000
10.0.0.4    10.0.0.3    1.000    1.000    1.000
10.0.0.5    10.0.0.3    1.000    1.000    1.000
10.0.0.3    10.0.0.4    1.000    1.000    1.000
10.0.0.3    10.0.0.5    1.000    1.000    1.000

Table: HNA
Destination    Gateway

Table: MID
IP address    Aliases

Table: Routes
Destination    Gateway IP    Metric    ETX    Interface
10.0.0.2/32    10.0.0.3    2    2.000    if02   
10.0.0.3/32    10.0.0.3    1    1.000    if02   
10.0.0.4/32    10.0.0.3    2    2.000    if02   
10.0.0.5/32    10.0.0.3    2    2.000    if02   

On 10.0.0.2:
Table: Links
Local IP    Remote IP    Hyst.    LQ    NLQ    Cost
10.0.0.2    10.0.0.3    0.00    1.000    1.000    1.000   

Table: Neighbors
IP address    SYM    MPR    MPRS    Will.    2 Hop Neighbors
10.0.0.3    YES    YES    NO    3    3

Table: Topology
Dest. IP    Last hop IP    LQ    NLQ    Cost
10.0.0.3    10.0.0.1    1.000    1.000    1.000
10.0.0.3    10.0.0.2    1.000    1.000    1.000
10.0.0.1    10.0.0.3    1.000    1.000    1.000
10.0.0.2    10.0.0.3    1.000    1.000    1.000
10.0.0.4    10.0.0.3    1.000    1.000    1.000
10.0.0.5    10.0.0.3    1.000    1.000    1.000
10.0.0.3    10.0.0.4    1.000    1.000    1.000
10.0.0.3    10.0.0.5    1.000    1.000    1.000

Table: HNA
Destination    Gateway

Table: MID
IP address    Aliases

Table: Routes
Destination    Gateway IP    Metric    ETX    Interface
10.0.0.1/32    10.0.0.3    2    2.000    if02   
10.0.0.3/32    10.0.0.3    1    1.000    if02   
10.0.0.4/32    10.0.0.3    2    2.000    if02   
10.0.0.5/32    10.0.0.3    2    2.000    if02   

On 10.0.0.3:
Table: Links
Local IP    Remote IP    Hyst.    LQ    NLQ    Cost
10.0.0.3    10.0.0.5    0.00    1.000    1.000    1.000   
10.0.0.3    10.0.0.1    0.00    1.000    1.000    1.000   
10.0.0.3    10.0.0.2    0.00    1.000    1.000    1.000   
10.0.0.3    10.0.0.4    0.00    1.000    1.000    1.000   

Table: Neighbors
IP address    SYM    MPR    MPRS    Will.    2 Hop Neighbors
10.0.0.4    YES    NO    YES    3    0
10.0.0.5    YES    NO    YES    3    0
10.0.0.1    YES    NO    YES    3    0
10.0.0.2    YES    NO    YES    3    0

Table: Topology
Dest. IP    Last hop IP    LQ    NLQ    Cost
10.0.0.3    10.0.0.1    1.000    1.000    1.000
10.0.0.3    10.0.0.2    1.000    1.000    1.000
10.0.0.1    10.0.0.3    1.000    1.000    1.000
10.0.0.2    10.0.0.3    1.000    1.000    1.000
10.0.0.4    10.0.0.3    1.000    1.000    1.000
10.0.0.5    10.0.0.3    1.000    1.000    1.000
10.0.0.3    10.0.0.4    1.000    1.000    1.000
10.0.0.3    10.0.0.5    1.000    1.000    1.000

Table: HNA
Destination    Gateway

Table: MID
IP address    Aliases

Table: Routes
Destination    Gateway IP    Metric    ETX    Interface
10.0.0.1/32    10.0.0.1    1    1.000    if02   
10.0.0.2/32    10.0.0.2    1    1.000    if02   
10.0.0.4/32    10.0.0.4    1    1.000    if02   
10.0.0.5/32    10.0.0.5    1    1.000    if02   

On 10.0.0.4:
Table: Links
Local IP    Remote IP    Hyst.    LQ    NLQ    Cost
10.0.0.4    10.0.0.3    0.00    1.000    1.000    1.000   

Table: Neighbors
IP address    SYM    MPR    MPRS    Will.    2 Hop Neighbors
10.0.0.3    YES    YES    NO    3    3

Table: Topology
Dest. IP    Last hop IP    LQ    NLQ    Cost
10.0.0.3    10.0.0.1    1.000    1.000    1.000
10.0.0.3    10.0.0.2    1.000    1.000    1.000
10.0.0.1    10.0.0.3    1.000    1.000    1.000
10.0.0.2    10.0.0.3    1.000    1.000    1.000
10.0.0.4    10.0.0.3    1.000    1.000    1.000
10.0.0.5    10.0.0.3    1.000    1.000    1.000
10.0.0.3    10.0.0.4    1.000    1.000    1.000
10.0.0.3    10.0.0.5    1.000    1.000    1.000

Table: HNA
Destination    Gateway

Table: MID
IP address    Aliases

Table: Routes
Destination    Gateway IP    Metric    ETX    Interface
10.0.0.1/32    10.0.0.3    2    2.000    if02   
10.0.0.2/32    10.0.0.3    2    2.000    if02   
10.0.0.3/32    10.0.0.3    1    1.000    if02   
10.0.0.5/32    10.0.0.3    2    2.000    if02   

On 10.0.0.5:
Table: Links
Local IP    Remote IP    Hyst.    LQ    NLQ    Cost
10.0.0.5    10.0.0.3    0.00    1.000    1.000    1.000   

Table: Neighbors
IP address    SYM    MPR    MPRS    Will.    2 Hop Neighbors
10.0.0.3    YES    YES    NO    3    3

Table: Topology
Dest. IP    Last hop IP    LQ    NLQ    Cost
10.0.0.3    10.0.0.1    1.000    1.000    1.000
10.0.0.3    10.0.0.2    1.000    1.000    1.000
10.0.0.1    10.0.0.3    1.000    1.000    1.000
10.0.0.2    10.0.0.3    1.000    1.000    1.000
10.0.0.4    10.0.0.3    1.000    1.000    1.000
10.0.0.5    10.0.0.3    1.000    1.000    1.000
10.0.0.3    10.0.0.4    1.000    1.000    1.000
10.0.0.3    10.0.0.5    1.000    1.000    1.000

Table: HNA
Destination    Gateway

Table: MID
IP address    Aliases

Table: Routes
Destination    Gateway IP    Metric    ETX    Interface
10.0.0.1/32    10.0.0.3    2    2.000    if02   
10.0.0.2/32    10.0.0.3    2    2.000    if02   
10.0.0.3/32    10.0.0.3    1    1.000    if02   
10.0.0.4/32    10.0.0.3    2    2.000    if02   

Tuesday, May 17, 2011

Ebtables Script for 5 vm topology

#!/bin/bash

ebtables -t filter -P FORWARD DROP  #set policy
ebtables -t filter -F FORWARD       #remove all commands

sudo ebtables -t filter -A FORWARD -i tap1 -o tap3 -j ACCEPT
sudo ebtables -t filter -A FORWARD -i tap3 -o tap1 -j ACCEPT

sudo ebtables -t filter -A FORWARD -i tap2 -o tap3 -j ACCEPT
sudo ebtables -t filter -A FORWARD -i tap3 -o tap2 -j ACCEPT

sudo ebtables -t filter -A FORWARD -i tap4 -o tap3 -j ACCEPT
sudo ebtables -t filter -A FORWARD -i tap3 -o tap4 -j ACCEPT

sudo ebtables -t filter -A FORWARD -i tap5 -o tap3 -j ACCEPT
sudo ebtables -t filter -A FORWARD -i tap3 -o tap5 -j ACCEPT

Thursday, May 5, 2011

Bugfix deleted routes win32

The bug was not really a new bug, it had to do with win32 exit.
A long sleep(1000) in main.c caused the delay between the given command ctrl+c and the closing of olsrd.exe. Also, a break in scheduler.c was not a solution for a quick exit, because it caused that the kernel routes not to be realeased after exit.
I tested the bugfix between 2 instances of olsrd.exe: one running the one with the bug, and one running the fixed one, and the routes were deleted on the fixed one, while they remained on the "bugged" one. I also tested what happens if the fixed one got a new neighbour after it received ctrl+c command, but didn't manage to close.
The route would be added again, even after the ctrl+c command in the kernel routes, but would still be deleted after the exit. Or, it didn't actually close anymore, and it started again.
A next test would be with more than 2 instances, with at least one running the bug one, and the other two running the fixed one, in order to find out what happens after the ctrl+c command is send and a new neighbor appears and the routing table has multiple routes.

Tuesday, May 3, 2011

Include txtinfo plugin to olsrd.exe

Edit olsrd.conf: (no comments between LoadPlugin and bracket)

LoadPlugin "olsrd_txtinfo.dll"
{
    # port number the txtinfo plugin will be listening, default 2006
    #   PlParam     "port"   "81"
    # ip address that can access the plugin, use "0.0.0.0"
    # to allow everyone
    PlParam     "Accept"   "0.0.0.0"
}

Run make txtinfo to create the .dll file, which olsrd.exe links to itself on startup.
Add the .dll file into the same directory as olsrd.exe in order to run it.
Run wget -O http://{ip_vm}:2006/all or /links /neighbours /routes or /config (which is not in /all ) in your terminal to get the output from the vm on your running system.