From 03646e2b90b975337ae9068a9a4d35ee9eb6d6fb Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Thu, 20 Jun 2019 01:19:15 +0100 Subject: [PATCH] Document download mesh --- doc/design.md | 2 +- doc/download-mesh.md | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 doc/download-mesh.md diff --git a/doc/design.md b/doc/design.md index b4404512..c21acb4d 100644 --- a/doc/design.md +++ b/doc/design.md @@ -49,7 +49,7 @@ Files are transferred over HTTP1.1 protocol with some custom headers added for d ### Mesh management -Download mesh management is identical to Gnutella, except instead of ip addresses MuWire personas are used. [More information](http://rfc-gnutella.sourceforge.net/developer/tmp/download-mesh.html) +Download mesh management is a simplified version of Gnutella's "Alternate Location" system. For more information see the "download-mesh" document. ### In-Network updates diff --git a/doc/download-mesh.md b/doc/download-mesh.md new file mode 100644 index 00000000..b43f4b49 --- /dev/null +++ b/doc/download-mesh.md @@ -0,0 +1,15 @@ +# Download Mesh / Partial Sharing + +MuWire uses a system similar to Gnutella's "Alternate Location" download mesh management system, however it is simplified to account for I2P's strengths and borrows a bit from BitTorrent's "Have" message. + +### "X-Have" header + +With every request a downloader makes it sends an "X-Have" header containing the Base64-encoded representation of a bitfield where bits set to 1 represent pieces of the file that the downloader already has. To make partial file sharing possible, if the uploader does not have the complete file it also sends this header in every response. If the header is missing it is assumed the uploader has the complete file. + +### "X-Alt" header + +The uploader can recommend other uploaders to the downloader via the "X-Alt" header. The format of this header is a comma-separated list of Base64-encoded Personas that have previously reported having at least one piece of the file to the uploader via the "X-Have" header. + +### Differences from Gnutella + +Unlike Gnutella the uploader is the sole repository where possible sources of the file are tracked. There is no negative "X-Nalt" header to prevent attacking the download mesh by mass downvoting of sources.