I have not been able to find anything definitive in the code or elsewhere about
how n2n is *supposed* to work. This needs to be put somewhere - like an HACKING
file so there is no misunderstanding about what the programs and routines are
expected to do.
To get that underway I'm going to start describing how I think n2n is expected
to behave using a ping as an example. This will go into HACKING as well where
it can be modified directly.

----

A and B are edge nodes with public sockets Apub and Bpub; and private network
addresses A and B respectively.
S is the supernode.

A sends {REGISTER,Amac} to S. S registers {Amac->Apub}.
B sends {REGISTER,Bmac} to S. S registers {Bmac->Bpub}.

Now ping from A to B.
A sends broadcast "arp who-has B" to S. S relays the packet to all known edge
nodes. B replies "B at Bmac" to supernode which forwards this to A. So now ping
A->B is known to be ping Amac(A)->Bmac(B).
Note: gratuitous arp also requires discussion.

In response to receiving the arp reply, Apub sends {REGISTER,Amac} to Bpub. If
Bpub receives the request it sends back {REGISTER_ACK,Amac} and also sends its
own {REGISTER,Bmac} request.

In response to receiving the "arp who-has", Bpub sends {REGISTER,Bmac} to Apub.

Now the OS has received the arp reply and sends ICMP to Bmac(B) via the tunnel
on A. A looks up Bmac in the peers list and encapsulates the packet to Bpub or
the supernode if the MAC is not found.

We assume that between two edge nodes, if Bpub receives a packet from Apub then
Apub can receive a packet from Bpub. This is the symmetric NAT case.
Note: In the symmetric NAT case, the public socket for a MAC address will be
different for direct contact when compared to information from the supernode. 

When two edge nodes are both behind symmetric NAT they cannot establish direct
communication.

If A receives {REGISTER,Bmac} from B, A adds {Bmac->Bpub} to its peers list
knowing that Bmac is now reachable via that public socket. Similarly if B
receives {REGISTER,Amac} from A.

The supernode never forwards REGISTER messages because the public socket seen
by the supervisor for some edge (eg. A) may be different to the socket seen by
another edge due to the actions of symmetric NAT (alocating a new public socket
for the new outbound UDP "connection").

----
Blurg! This sucks without supporting diagrams. Maybe some ASCII art in the
file.

--
  Rich



      Get the name you always wanted with the new y7mail email address.
www.yahoo7.com.au/y7mail


_______________________________________________
Ntop-dev mailing list
[email protected]
http://listgateway.unipi.it/mailman/listinfo/ntop-dev

Reply via email to