Differences between revisions 1 and 9 (spanning 8 versions)
Revision 1 as of 2005-11-08 22:17:14
Size: 868
Editor: alpt
Comment:
Revision 9 as of 2005-12-24 03:53:02
Size: 3192
Editor: alpt
Comment:
Deletions are marked like this. Additions are marked like this.
Line 11: Line 11:
If the nodes are in restricted mode (compatibility with the Internet), they should share their Internet connection. This can be easily done, in fact, when a node X, connected to the Internet, activates the masquerading, the other nodes can also connect by setting as the default gateway the node X. If the nodes are in restricted mode (compatibility with the Internet), they
should share their Internet connection. This can be easily done, in fact, if
a node X, connected to the Internet, activates the masquerading, it is
possi
ble for the other nodes to connect by setting as the default gateway
their rnode which lead to
the node X.
Line 13: Line 17:
This can be automated by Netsukuku itself and it requires small changes in the code: it is just necessary that the nodes connected to the Internet set a flag in the qspn_pkt, in this way the other nodes will know the routes to reach the Internet. Simple and easy. The same holds for the gnode. This can be automated by Netsukuku itself and it requires small changes in the
code: it is just necessary that the nodes connected to the Internet set a flag
in the qspn_pkt, in this way the other nodes will know the routes to reach the
Internet.

=== Multi-gateways ===

The situation becomes a little complex when there is more than one node which
shares its internet connection. Let's consider this scenario:

{{{
     A(gw) B(gw)
      \ /
       \___ ___/
           \/
        Ntk nodes (10.x.x.x)
}}}

A and B are nodes which shares their internet connection, we call the
gateways. Let's call X the node which wants to connect to an Internet host.
In this case, the nodes near to A, might find useful to use A itself to
reach the Internet, the same happens for the nodes near to B.
Instead, the nodes in the middle don't know what it the best choice and they
might continuosly changing their gw. This means that when a tcp connection
(to an inet host), which was established trough A, is then routed trough B,
dies because A and B have different public IPs on the Internet.

The node X has to create an IPIP tunnel to the gateway it wants to use, and
set as default gw the tunnel. In this way it is sure to use always the same
gateway while the routing of the packets between it and the gw is made
transparently by the other Netsukuku nodes.

=== Load sharing ===

Let's consider the previous scenario.

The node X can also decide to use both A and B to reach the Internet, using
at the same time their connections! Even the gw A can use at the same time
its own line and the connection of the gw B.

The procedure to implement this is what follows:

 * X creates a tunnel to A and another one to B
 
 * X adds in the routing table default route using A and B as multipath gateways. The gateway for the connections is chosen randomly.

 * X adds a rule in the routing table to route all the packets of established connections trough the same gateway used to create the same connection.

=== The bad ===

The implementation of the Load sharing is very Linux specific, so it will be
difficult to port it to other kernels.

=== MASQUERADING ===

Each node sharing the Internet connection (gw) has to masquerade its
interfaces, so iptables must be used.
In order to keep the daemon portable, NetsukukuD will launch the script found
at /etc/netsukuku/masquerade.sh, which in Linux will be a simple script that
executes "iptables -A POSTROUTING -t nat -j MASQUERADE".

----
related: ["Netsukuku RFC"]

NTK_RFC 0003

Subject: Internet Gateway Search


This text describes a change to the Npv7. It will be included in the final documentation, so feel free to correct it. But if you want to change the system here described, please contact us first.


If the nodes are in restricted mode (compatibility with the Internet), they should share their Internet connection. This can be easily done, in fact, if a node X, connected to the Internet, activates the masquerading, it is possible for the other nodes to connect by setting as the default gateway their rnode which lead to the node X.

This can be automated by Netsukuku itself and it requires small changes in the code: it is just necessary that the nodes connected to the Internet set a flag in the qspn_pkt, in this way the other nodes will know the routes to reach the Internet.

Multi-gateways

The situation becomes a little complex when there is more than one node which shares its internet connection. Let's consider this scenario:

                   A(gw)      B(gw)
                    \          /
                     \___  ___/
                         \/
                      Ntk nodes (10.x.x.x)

A and B are nodes which shares their internet connection, we call the gateways. Let's call X the node which wants to connect to an Internet host. In this case, the nodes near to A, might find useful to use A itself to reach the Internet, the same happens for the nodes near to B. Instead, the nodes in the middle don't know what it the best choice and they might continuosly changing their gw. This means that when a tcp connection (to an inet host), which was established trough A, is then routed trough B, dies because A and B have different public IPs on the Internet.

The node X has to create an IPIP tunnel to the gateway it wants to use, and set as default gw the tunnel. In this way it is sure to use always the same gateway while the routing of the packets between it and the gw is made transparently by the other Netsukuku nodes.

Load sharing

Let's consider the previous scenario.

The node X can also decide to use both A and B to reach the Internet, using at the same time their connections! Even the gw A can use at the same time its own line and the connection of the gw B.

The procedure to implement this is what follows:

  • X creates a tunnel to A and another one to B
  • X adds in the routing table default route using A and B as multipath gateways. The gateway for the connections is chosen randomly.
  • X adds a rule in the routing table to route all the packets of established connections trough the same gateway used to create the same connection.

The bad

The implementation of the Load sharing is very Linux specific, so it will be difficult to port it to other kernels.

MASQUERADING

Each node sharing the Internet connection (gw) has to masquerade its interfaces, so iptables must be used. In order to keep the daemon portable, NetsukukuD will launch the script found at /etc/netsukuku/masquerade.sh, which in Linux will be a simple script that executes "iptables -A POSTROUTING -t nat -j MASQUERADE".


related: ["Netsukuku RFC"]

Ntk_IGS (last edited 2009-05-13 16:41:15 by anonymous)