You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Ntk_viphilama 6.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. == NTK_RFC 0010 ==
  2. Subject: Viphilama - Virtual to Physical Layer Mapper
  3. ----
  4. This text describes a change to the Npv7.
  5. It will be included in the final documentation, so feel free to correct it.
  6. But if you want to change the system here described, please contact us first.
  7. ----
  8. === Viphilama ===
  9. Viphilama will permit to Netsukuku to expand itself over the Internet and then
  10. switching automatically to the physical layer without interfering with the
  11. stability of the Net.
  12. The theory of Viphilama isn't complete yet. This document, right now, is just
  13. a description of what it would be.
  14. === Layer ===
  15. Netsukuku will be split in two layer: the virtual layer and the physical one.
  16. ==== The physical layer ====
  17. This is the original Netsukuku layer: every node is linked to other nodes by
  18. physical links (wifi, cables, ...).
  19. The physical layer is prioritised over the virtual one.
  20. ==== The virtual layer ====
  21. The virtual layer is built upon the Internet or any other existing network.
  22. The Netsukuku nodes, in this layer, are linked each other by tunnels.
  23. A node, in order to join in the virtual layer, has to know its physical
  24. coordinates.
  25. The use of geographical coordinates is required for Viphilama, because it has
  26. to map the virtual layer to the physical one and it needs a way to measure
  27. the effective distance between two virtual nodes.
  28. The coordinates can be retrieved using an online map service like
  29. http://maps.google.com or with a GPS.
  30. The coordinates are stored in the internal, external and bnode maps.
  31. In the internal map there are the coordinates of each single node.
  32. In the external maps, the coordinates which locate a gnode are set to its
  33. barycenter: it is the average of the coordinates of all its internal nodes.
  34. ==== Gate node ====
  35. The two layers are joined by the gate nodes. They are nodes which belong to
  36. both layers.
  37. This means that the two layer form a unique network.
  38. === Virtual to Physical mapper ===
  39. The mapper does a basic job: whenever it finds that a virtual link can be
  40. replaced by a physical one, it removes the virtual link.
  41. Assume this scenario:
  42. {{{
  43. Tokyo Moscow Rome London
  44. | | | |
  45. | | | |
  46. |__________|Internet tunnel|_________|
  47. }}}
  48. Only one link exists, and it is a virtual one.
  49. Only Tokyo and London are linked, all the other cities are alone.
  50. When Tokyo and Moscow will be linked by a series of physical nodes, the mapper
  51. will change the net in this way:
  52. {{{
  53. Tokyo<--ntk nodes-->Moscow Rome London
  54. | | |
  55. |______ Internet tunnel ___|
  56. }}}
  57. When even Moscow and Rome will be linked by physical nodes:
  58. {{{
  59. Tokyo<--ntk nodes-->Moscow<--ntk nodes-->Rome London
  60. | |
  61. |__ Inet tunnel _|
  62. }}}
  63. And so on.
  64. Basically when there are two nodes linked physically, one of them can cut
  65. its virtual link which connects it to the virtual layer.
  66. Let's go into the details.
  67. ==== Virtual hooking ====
  68. A node, which hasn't any physical neighbours, resides in a black zone and, for
  69. this reason, it can't hook to the physical layer. It will hook directly to
  70. a vnode (virtual node), joining the virtual layer.
  71. Let this hooking node be X.
  72. The first part of the Virtual Hooking is the creation of the virtual links
  73. (ip tunnels).
  74. X chooses, at first, a random vnode which can be located anywhere in the
  75. globe. If it is its first hook to the virtual layer, it will get the IP of
  76. the vnode from a small public list available on the Internet, otherwise it
  77. will consult its saved virtual maps.
  78. Let the chosen vnode be Y.
  79. X sends to Y a packet containing its coordinates. This pkt will be forwarded
  80. with a greedy technique:
  81. Y looks up its maps and forwards the pkt to the vnode which is the nearest to X.
  82. If this latter vnode knows another vnode which is nearer to X, it forwards
  83. again the packet. Finally, the pkt will arrive to the node Z, which is a node
  84. very near to X.
  85. Let d(A, B) be the physical distance between the node A and B.
  86. The node Z appends its Internet IP to the received packet and forwards it
  87. again to a node T, so that d(X,T) ~= d(X,Z).
  88. The node T will do the same (adds its IP and forwards the pkt).
  89. When the packet will be forwarded for the 16th time or when it can't be
  90. forwarded anymore, it is sent back to the node X.
  91. The node X collects this last packet and creates a virtual link (tunnel) to
  92. each Internet IP which has been stored in the packet itself.
  93. These linked nodes are the new rnodes of the node X.
  94. At this point the node X will hook to each linked node. This procedure is
  95. called v-linking:
  96. Let "L" be the generic linked node.
  97. X sends the I_AM_VHOOKING request to L.
  98. L analyses its virtual rnodes and compares d(L,vR) to d(X,vR), where vR is a
  99. vrnode. If d(X,vR) < d(L,vR), L adds the Internet IP of the vR in the reply
  100. packet. This means that if L finds out that X is nearer to one of its
  101. vrnodes, it tells X to create a link to it and deletes its link to the vrnode.
  102. X receives the reply packet of L and tries to create a virtual link to each
  103. vR listed in the same packet.
  104. X writes the list of all the vR nodes which has been successfully linked to X
  105. itself. This list is sent back to L.
  106. L reads this latter list and delete all its links to the vR nodes, which has
  107. been successfully linked to X.
  108. X repeats this same hooking procedure for each L.
  109. In the end, X chooses one of its vrnodes and hooks with the classical method
  110. to it.
  111. ==== Gate hooking ====
  112. A node can hook to the physical layer as a normal node or as gate node.
  113. A normal node is the old plain node of Netsukuku, it doesn't have to specify
  114. its coordinates and doesn't need any other prerequisites.
  115. The gate-node has an Internet connection that it uses to connect to
  116. the virtual layer, it is also connected to physical nodes.
  117. There are two cases:
  118. * When the node is from the start a gate node
  119. * When it is first a vnode and then becomes a gate node
  120. In the first case it hooks directly to a physical node. If one of its rnodes
  121. is a gate node too, it will start the v-linking procedure with it.
  122. In this way, the new gate-node will be linked to its nearer vrnodes.
  123. The old gate-node will delete all the links to the vrnodes which have been
  124. linked by the new gate-node.
  125. In the second case, the node directly v-links to the new gate node which is
  126. connected to.
  127. When a gate-node can reach one of it vrnodes using both a virtual and a
  128. physical link, it will delete the virtual one.
  129. == TODO ==
  130. * Is it possible to avoid using the coordinates?
  131. * What does happen when a (v)node dies?
  132. ----
  133. Feel free to help the development of Viphilama.