| 1 |
Forban is a p2p application for link-local and local area network. |
| 2 |
|
| 3 |
Forban works independently from Internet and use only the local |
| 4 |
area capabilities to announce, discover, search or share files. |
| 5 |
Forban relies on HTTP and he is opportunistic. |
| 6 |
|
| 7 |
The name took his origins from the old French word : |
| 8 |
http://fr.wiktionary.org/wiki/forban |
| 9 |
|
| 10 |
Forban name can be also a playword in English |
| 11 |
for banning an unwanted software or services on Internet. |
| 12 |
|
| 13 |
Forban is free software licensed under |
| 14 |
the GNU Affero General Public License version 3. |
| 15 |
http://www.fsf.org/licensing/licenses/agpl-3.0.html |
| 16 |
|
| 17 |
|
| 18 |
== message format used for announce/discovery == |
| 19 |
|
| 20 |
=== announce message === |
| 21 |
|
| 22 |
ASCII encoded message using UDP on port 12555 with |
| 23 |
the following format: |
| 24 |
|
| 25 |
forban;name;<nameoftheforban>;uuid;<identityoftheforban>;hmac;<hmacvaluecofindex> |
| 26 |
|
| 27 |
The messages are flooded in broadcast (IPv4) and using |
| 28 |
ff02::1 (IPv6) at a regular interval. |
| 29 |
|
| 30 |
Based on the source IP and the destination port used, |
| 31 |
a HTTP URL is build to get to default forban service. |
| 32 |
|
| 33 |
=== HTTP services for Forban === |
| 34 |
|
| 35 |
The UDP port 12555 is there for announcing forban services. |
| 36 |
The TCP port 12555 is the HTTP server running for forban services. |
| 37 |
|
| 38 |
base URL: [REQUIRED] |
| 39 |
http://<ip>:<destport>/ |
| 40 |
|
| 41 |
index URL where Forban stored his index: [REQUIRED] |
| 42 |
http://<ip>:<destport>/s/?g=forban/index |
| 43 |
|
| 44 |
store URL where Forban stored his loot and how to get a file: [REQUIRED] |
| 45 |
http://<ip>:<destport>/s/?g=base64_urlsafe(<filenamefromindex>)&f=b64e |
| 46 |
|
| 47 |
search URL: [OPTIONAL] |
| 48 |
http://<ip>:<destport>/q/?v=<yoursearch>&r=<refreshtimeinsec> |
| 49 |
|
| 50 |
REQUIRED interfaces are required to have a full operational Forban |
| 51 |
protocol in all the modes. The OPTIONAL interfaces are not required |
| 52 |
for machine-to-machine interaction but used to ease the life of the users. |
| 53 |
|
| 54 |
==== base64_urlsafe function (b64e) ==== |
| 55 |
|
| 56 |
'+' is replaced by '-'. |
| 57 |
'/' is replaced by '_'(underscore). |
| 58 |
'=' is replaced by '!'. |
| 59 |
|
| 60 |
This is following the same approach of MIME::Base64::URLSafe |
| 61 |
or the python base64.urlsafe_b64encode with an addition to |
| 62 |
the equal sign being replaced by an exclamation mark. |
| 63 |
|
| 64 |
=== Forban mode available === |
| 65 |
|
| 66 |
* Opportunistic mode |
| 67 |
* Shared mode |
| 68 |
|
| 69 |
The opportunistic mode and shared used all the REQUIRED components of |
| 70 |
the protocol. The only difference is the lack of automatic file fetching |
| 71 |
in the shared mode. The shared mode is usally used on fixed node content |
| 72 |
where the opportunistic fetching is not desired (e.g. a fixed bookshelf). |
| 73 |
|
| 74 |
The opportunistic mode is working as a simple gossip (or epidemic) protocol |
| 75 |
to replicate the information from one local to another local Forban. |
| 76 |
|
| 77 |
=== message format - notes about HMAC === |
| 78 |
|
| 79 |
The optional HMAC value has two purposes : |
| 80 |
|
| 81 |
* To know if the index has been updated |
| 82 |
* and to verify (if a PSK is set) if the index has been tampered. |
| 83 |
|
| 84 |
When a PSK is not set, the default PSK value is 'Forban'. |
| 85 |
|
| 86 |
The value is optional as other Forban can download any index when they |
| 87 |
want. |
| 88 |
|
| 89 |
=== software required === |
| 90 |
|
| 91 |
* Python (tested successfully with 2.5, 2.6 and 2.7) - 2.5 is required for the uuid library |