Wednesday, July 6, 2011

Improve olsrd on BSD: use linklocal address or not?

Olsrd before the improvements (no filtering, each node can see all others):
IPv4:

--- 20:53:00.042579 ---------------------------------------------------- LINKS

IP address       hyst         LQ       ETX
10.0.0.3         0.000  1.000/1.000    1.000
10.0.0.2         0.000  0.839/0.761    1.565
10.0.0.1         0.000  1.000/1.000    1.000

--- 20:53:03.216848 ----------------------- TWO-HOP NEIGHBORS

IP addr (2-hop)  IP addr (1-hop)  Total cost
10.0.0.3         10.0.0.1         2.000
                 10.0.0.2         3.117
10.0.0.1         10.0.0.2         3.582
                 10.0.0.3         2.000
10.0.0.2         10.0.0.3         2.128
                 10.0.0.1         2.595

netstat output:

netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
10.0.0.0/8         link#1             U           2    13258    re0
10.0.0.1/32        00:01:00:00:00:04  U           0        0    re0
10.0.0.2           10.0.0.3           UGH         0        5    re0 =>
10.0.0.2/32        00:01:00:00:00:04  U           0        0    re0
10.0.0.3           10.0.0.2           UGH         0        2    re0 =>
10.0.0.3/32        00:01:00:00:00:04  U           0        0    re0
10.0.0.4           link#1             UHS         0        0    lo0
127.0.0.1          link#4             UH          0        0    lo0

Aliases are also created and not deleted after closing olsrd.


IPv6:
--- 21:18:09.197225 ---------------------------------------------------- LINKS

IP address                               hyst         LQ       ETX
fd00::1                                  0.000  1.000/1.000    1.000
fd00::2                                  0.000  1.000/1.000    1.000
fd00::3                                  0.000  1.000/1.000    1.000

--- 21:18:09.197602 ----------------------- TWO-HOP NEIGHBORS

IP addr (2-hop)  IP addr (1-hop)  Total cost
fd00::3          fd00::2          2.000
                 fd00::1          2.000
fd00::1          fd00::3          2.000
                 fd00::2          2.000
fd00::2          fd00::3          2.000
                 fd00::1          2.000


netstat output:
Internet6:
Destination                       Gateway                       Flags      Netif Expire
::/96                             ::1                           UGRS        lo0
::1                               ::1                           UH          lo0
::ffff:0.0.0.0/96                 ::1                           UGRS        lo0
fd00::/8                          link#1                        U           re0
fd00::1                           fe80::1%re0                   UGH         re0
fd00::2                           fe80::2%re0                   UGH         re0
fd00::3                           fe80::3%re0                   UGH         re0
fd00::4                           link#1                        UHS         lo0
fe80::/10                         ::1                           UGRS        lo0
fe80::%re0/64                     link#1                        U           re0
fe80::201:ff:fe00:4%re0           link#1                        UHS         lo0
fe80::%re1/64                     link#2                        U           re1
fe80::201:ff:fe00:d%re1           link#2                        UHS         lo0
fe80::%lo0/64                     link#4                        U           lo0
fe80::1%lo0                       link#4                        UHS         lo0
ff01:1::/32                       fe80::201:ff:fe00:4%re0       U           re0
ff01:2::/32                       fe80::201:ff:fe00:d%re1       U           re1
ff01:4::/32                       ::1                           U           lo0
ff02::/16                         ::1                           UGRS        lo0
ff02::%re0/32                     fe80::201:ff:fe00:4%re0       U           re0
ff02::%re1/32                     fe80::201:ff:fe00:d%re1       U           re1
ff02::%lo0/32                     ::1                           U           lo0


Olsrd with no aliases added:
IPv4:
netstat output:

netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
10.0.0.0/8         link#1             U           2     8707    re0
10.0.0.1/32        00:01:00:00:00:03  U           0        0    re0
10.0.0.2/32        00:01:00:00:00:03  U           0       11    re0
10.0.0.3           link#1             UHS         0        0    lo0
10.0.0.4/32        00:01:00:00:00:03  U           0        0    re0
127.0.0.1          link#4             UH          0        0    lo0

IPv6:
netstat output:

Internet6:
Destination                       Gateway                       Flags      Netif Expire
::/96                             ::1                           UGRS        lo0 =>
default                           fe80::4%re0                   U           re0
::1                               ::1                           UH          lo0
::ffff:0.0.0.0/96                 ::1                           UGRS        lo0
fd00::/8                          link#1                        U           re0
fd00::3                           link#1                        UHS         lo0
fe80::/10                         ::1                           UGRS        lo0
fe80::%re0/64                     link#1                        U           re0
fe80::201:ff:fe00:3%re0           link#1                        UHS         lo0
fe80::%lo0/64                     link#4                        U           lo0
fe80::1%lo0                       link#4                        UHS         lo0
ff01:1::/32                       fe80::201:ff:fe00:3%re0       U           re0
ff01:4::/32                       ::1                           U           lo0
ff02::/16                         ::1                           UGRS        lo0
ff02::%re0/32                     fe80::201:ff:fe00:3%re0       U           re0
ff02::%lo0/32                     ::1                           U           lo0


So, instead of routes, there is only one default route created, which is not deleted after closing olsrd.

Olsrd with no aliases, and MAC addresses for IPv6 gateways:
IPv4:
netstat output:
netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
10.0.0.0/8         link#1             U           2    20770    re0
10.0.0.1/32        00:01:00:00:00:03  U           0        0    re0
10.0.0.2/32        00:01:00:00:00:03  U           0        0    re0
10.0.0.3           link#1             UHS         0        0    lo0
10.0.0.4/32        00:01:00:00:00:03  U           0        0    re0
127.0.0.1          link#4             UH          0        0    lo0

IPv6:
netstat output:
Internet6:
Destination                       Gateway                       Flags      Netif Expire
::/96                             ::1                           UGRS        lo0
::1                               ::1                           UH          lo0
::ffff:0.0.0.0/96                 ::1                           UGRS        lo0
fd00::/8                          link#1                        U           re0
fd00::1/128                       00:01:00:00:00:03             U           re0
fd00::2/128                       00:01:00:00:00:03             U           re0
fd00::3                           link#1                        UHS         lo0
fd00::4/128                       00:01:00:00:00:03             U           re0
fe80::/10                         ::1                           UGRS        lo0
fe80::%re0/64                     link#1                        U           re0
fe80::201:ff:fe00:3%re0           link#1                        UHS         lo0
fe80::%lo0/64                     link#4                        U           lo0
fe80::1%lo0                       link#4                        UHS         lo0
ff01:1::/32                       fe80::201:ff:fe00:3%re0       U           re0
ff01:4::/32                       ::1                           U           lo0
ff02::/16                         ::1                           UGRS        lo0
ff02::%re0/32                     fe80::201:ff:fe00:3%re0       U           re0
ff02::%lo0/32                     ::1                           U           lo0

No comments:

Post a Comment