manet:prophet
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
manet:prophet [2006/11/07 23:28] – Spam removed 84.142.251.254 | manet:prophet [2008/03/07 06:08] (current) – 69.157.153.226 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Prophet Address Allocation ====== | ||
+ | Prophet ((Hongbo Zhou, Lionel M. Ni, and Matt W. Mutka, " | ||
+ | |||
+ | Prophet tries to avoid duplicate addresses by using a stateful function, which should create a large row of unique numbers starting from a single seed. For a detailed look on how it works have a look at the original [[http:// | ||
+ | |||
+ | |||
+ | ===== Implementation ===== | ||
+ | |||
+ | I did a prototype implementation for my thesis. You can {{manet: | ||
+ | |||
+ | You need [[http:// | ||
+ | |||
+ | |||
+ | ==== Communication ==== | ||
+ | |||
+ | To exchange information between clients before any IP addresses are available, my implementation uses modified ARP packages to send Prophet requests and replies. Prophet replies use an additional payload to transfer the state and the network ID. | ||
+ | |||
+ | //example ARP package (blue) with additional Payload (white):// | ||
+ | |||
+ | ^ Harwaretype | ||
+ | ^ HW Addrlen. | ||
+ | ^ Sender HW Address | ||
+ | ^ Sender HW Addr. ^^ Sender IP Addr ^ | ||
+ | ^ Sender IP Addr. ^^ Receiver HW Addr ^ | ||
+ | ^ Receiver HW Address | ||
+ | ^ Receiver IP Address | ||
+ | | Network ID (4 Byte) ||| | ||
+ | | State index (4 Byte) ||| | ||
+ | | State (32 Byte) ||| | ||
+ | |||
+ | In difference to usual ARP packages this implementation uses different Opcodes. Prophet Requests use an Opcode of 55 and Replies use 56. | ||
+ | |||
+ | |||
+ | ==== Address Calculation ==== | ||
+ | |||
+ | The implementation uses a prime factorization as suggested in the original proposal. The function is ''// | ||
+ | |||
+ | Here is the part of address calculation in the C code: | ||
+ | |||
+ | <code c> | ||
+ | u_long ip; // this is my address | ||
+ | u_long address=1; // holds the new address | ||
+ | int i = 0; | ||
+ | |||
+ | ip = libnet_get_ipaddr4(_libnet); | ||
+ | | ||
+ | //calc new address | ||
+ | for(i=0; i<K; i++){ | ||
+ | address *= _prime[i]^_prophet.state[i]; | ||
+ | address %= RANGE; | ||
+ | } | ||
+ | address += ip; | ||
+ | address %= RANGE; | ||
+ | address += 1; | ||
+ | address += BASENET; | ||
+ | address | ||
+ | |||
+ | //increase state at index_pos | ||
+ | _prophet.state[_prophet.index]++; | ||
+ | </ |