From: <ul...@us...> - 2014-02-11 22:21:55
|
Revision: 122 http://sourceforge.net/p/adc/code/122 Author: ullner Date: 2014-02-11 22:21:52 +0000 (Tue, 11 Feb 2014) Log Message: ----------- Generated HTML documents for respective TXT document Added Paths: ----------- trunk/ADC-EXT.html trunk/ADC-PRD.html trunk/ADC-Recommendation.html trunk/ADC-Test.html trunk/ADC.html Added: trunk/ADC-EXT.html =================================================================== --- trunk/ADC-EXT.html (rev 0) +++ trunk/ADC-EXT.html 2014-02-11 22:21:52 UTC (rev 122) @@ -0,0 +1,2686 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" + "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" /> +<meta name="generator" content="AsciiDoc 8.6.9" /> +<title>ADC Extensions</title> +<style type="text/css"> +/* Shared CSS for AsciiDoc xhtml11 and html5 backends */ + +/* Default font. */ +body { + font-family: Georgia,serif; +} + +/* Title font. */ +h1, h2, h3, h4, h5, h6, +div.title, caption.title, +thead, p.table.header, +#toctitle, +#author, #revnumber, #revdate, #revremark, +#footer { + font-family: Arial,Helvetica,sans-serif; +} + +body { + margin: 1em 5% 1em 5%; +} + +a { + color: blue; + text-decoration: underline; +} +a:visited { + color: fuchsia; +} + +em { + font-style: italic; + color: navy; +} + +strong { + font-weight: bold; + color: #083194; +} + +h1, h2, h3, h4, h5, h6 { + color: #527bbd; + margin-top: 1.2em; + margin-bottom: 0.5em; + line-height: 1.3; +} + +h1, h2, h3 { + border-bottom: 2px solid silver; +} +h2 { + padding-top: 0.5em; +} +h3 { + float: left; +} +h3 + * { + clear: left; +} +h5 { + font-size: 1.0em; +} + +div.sectionbody { + margin-left: 0; +} + +hr { + border: 1px solid silver; +} + +p { + margin-top: 0.5em; + margin-bottom: 0.5em; +} + +ul, ol, li > p { + margin-top: 0; +} +ul > li { color: #aaa; } +ul > li > * { color: black; } + +.monospaced, code, pre { + font-family: "Courier New", Courier, monospace; + font-size: inherit; + color: navy; + padding: 0; + margin: 0; +} +pre { + white-space: pre-wrap; +} + +#author { + color: #527bbd; + font-weight: bold; + font-size: 1.1em; +} +#email { +} +#revnumber, #revdate, #revremark { +} + +#footer { + font-size: small; + border-top: 2px solid silver; + padding-top: 0.5em; + margin-top: 4.0em; +} +#footer-text { + float: left; + padding-bottom: 0.5em; +} +#footer-badges { + float: right; + padding-bottom: 0.5em; +} + +#preamble { + margin-top: 1.5em; + margin-bottom: 1.5em; +} +div.imageblock, div.exampleblock, div.verseblock, +div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, +div.admonitionblock { + margin-top: 1.0em; + margin-bottom: 1.5em; +} +div.admonitionblock { + margin-top: 2.0em; + margin-bottom: 2.0em; + margin-right: 10%; + color: #606060; +} + +div.content { /* Block element content. */ + padding: 0; +} + +/* Block element titles. */ +div.title, caption.title { + color: #527bbd; + font-weight: bold; + text-align: left; + margin-top: 1.0em; + margin-bottom: 0.5em; +} +div.title + * { + margin-top: 0; +} + +td div.title:first-child { + margin-top: 0.0em; +} +div.content div.title:first-child { + margin-top: 0.0em; +} +div.content + div.title { + margin-top: 0.0em; +} + +div.sidebarblock > div.content { + background: #ffffee; + border: 1px solid #dddddd; + border-left: 4px solid #f0f0f0; + padding: 0.5em; +} + +div.listingblock > div.content { + border: 1px solid #dddddd; + border-left: 5px solid #f0f0f0; + background: #f8f8f8; + padding: 0.5em; +} + +div.quoteblock, div.verseblock { + padding-left: 1.0em; + margin-left: 1.0em; + margin-right: 10%; + border-left: 5px solid #f0f0f0; + color: #888; +} + +div.quoteblock > div.attribution { + padding-top: 0.5em; + text-align: right; +} + +div.verseblock > pre.content { + font-family: inherit; + font-size: inherit; +} +div.verseblock > div.attribution { + padding-top: 0.75em; + text-align: left; +} +/* DEPRECATED: Pre version 8.2.7 verse style literal block. */ +div.verseblock + div.attribution { + text-align: left; +} + +div.admonitionblock .icon { + vertical-align: top; + font-size: 1.1em; + font-weight: bold; + text-decoration: underline; + color: #527bbd; + padding-right: 0.5em; +} +div.admonitionblock td.content { + padding-left: 0.5em; + border-left: 3px solid #dddddd; +} + +div.exampleblock > div.content { + border-left: 3px solid #dddddd; + padding-left: 0.5em; +} + +div.imageblock div.content { padding-left: 0; } +span.image img { border-style: none; vertical-align: text-bottom; } +a.image:visited { color: white; } + +dl { + margin-top: 0.8em; + margin-bottom: 0.8em; +} +dt { + margin-top: 0.5em; + margin-bottom: 0; + font-style: normal; + color: navy; +} +dd > *:first-child { + margin-top: 0.1em; +} + +ul, ol { + list-style-position: outside; +} +ol.arabic { + list-style-type: decimal; +} +ol.loweralpha { + list-style-type: lower-alpha; +} +ol.upperalpha { + list-style-type: upper-alpha; +} +ol.lowerroman { + list-style-type: lower-roman; +} +ol.upperroman { + list-style-type: upper-roman; +} + +div.compact ul, div.compact ol, +div.compact p, div.compact p, +div.compact div, div.compact div { + margin-top: 0.1em; + margin-bottom: 0.1em; +} + +tfoot { + font-weight: bold; +} +td > div.verse { + white-space: pre; +} + +div.hdlist { + margin-top: 0.8em; + margin-bottom: 0.8em; +} +div.hdlist tr { + padding-bottom: 15px; +} +dt.hdlist1.strong, td.hdlist1.strong { + font-weight: bold; +} +td.hdlist1 { + vertical-align: top; + font-style: normal; + padding-right: 0.8em; + color: navy; +} +td.hdlist2 { + vertical-align: top; +} +div.hdlist.compact tr { + margin: 0; + padding-bottom: 0; +} + +.comment { + background: yellow; +} + +.footnote, .footnoteref { + font-size: 0.8em; +} + +span.footnote, span.footnoteref { + vertical-align: super; +} + +#footnotes { + margin: 20px 0 20px 0; + padding: 7px 0 0 0; +} + +#footnotes div.footnote { + margin: 0 0 5px 0; +} + +#footnotes hr { + border: none; + border-top: 1px solid silver; + height: 1px; + text-align: left; + margin-left: 0; + width: 20%; + min-width: 100px; +} + +div.colist td { + padding-right: 0.5em; + padding-bottom: 0.3em; + vertical-align: top; +} +div.colist td img { + margin-top: 0.3em; +} + +@media print { + #footer-badges { display: none; } +} + +#toc { + margin-bottom: 2.5em; +} + +#toctitle { + color: #527bbd; + font-size: 1.1em; + font-weight: bold; + margin-top: 1.0em; + margin-bottom: 0.1em; +} + +div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { + margin-top: 0; + margin-bottom: 0; +} +div.toclevel2 { + margin-left: 2em; + font-size: 0.9em; +} +div.toclevel3 { + margin-left: 4em; + font-size: 0.9em; +} +div.toclevel4 { + margin-left: 6em; + font-size: 0.9em; +} + +span.aqua { color: aqua; } +span.black { color: black; } +span.blue { color: blue; } +span.fuchsia { color: fuchsia; } +span.gray { color: gray; } +span.green { color: green; } +span.lime { color: lime; } +span.maroon { color: maroon; } +span.navy { color: navy; } +span.olive { color: olive; } +span.purple { color: purple; } +span.red { color: red; } +span.silver { color: silver; } +span.teal { color: teal; } +span.white { color: white; } +span.yellow { color: yellow; } + +span.aqua-background { background: aqua; } +span.black-background { background: black; } +span.blue-background { background: blue; } +span.fuchsia-background { background: fuchsia; } +span.gray-background { background: gray; } +span.green-background { background: green; } +span.lime-background { background: lime; } +span.maroon-background { background: maroon; } +span.navy-background { background: navy; } +span.olive-background { background: olive; } +span.purple-background { background: purple; } +span.red-background { background: red; } +span.silver-background { background: silver; } +span.teal-background { background: teal; } +span.white-background { background: white; } +span.yellow-background { background: yellow; } + +span.big { font-size: 2em; } +span.small { font-size: 0.6em; } + +span.underline { text-decoration: underline; } +span.overline { text-decoration: overline; } +span.line-through { text-decoration: line-through; } + +div.unbreakable { page-break-inside: avoid; } + + +/* + * xhtml11 specific + * + * */ + +div.tableblock { + margin-top: 1.0em; + margin-bottom: 1.5em; +} +div.tableblock > table { + border: 3px solid #527bbd; +} +thead, p.table.header { + font-weight: bold; + color: #527bbd; +} +p.table { + margin-top: 0; +} +/* Because the table frame attribute is overriden by CSS in most browsers. */ +div.tableblock > table[frame="void"] { + border-style: none; +} +div.tableblock > table[frame="hsides"] { + border-left-style: none; + border-right-style: none; +} +div.tableblock > table[frame="vsides"] { + border-top-style: none; + border-bottom-style: none; +} + + +/* + * html5 specific + * + * */ + +table.tableblock { + margin-top: 1.0em; + margin-bottom: 1.5em; +} +thead, p.tableblock.header { + font-weight: bold; + color: #527bbd; +} +p.tableblock { + margin-top: 0; +} +table.tableblock { + border-width: 3px; + border-spacing: 0px; + border-style: solid; + border-color: #527bbd; + border-collapse: collapse; +} +th.tableblock, td.tableblock { + border-width: 1px; + padding: 4px; + border-style: solid; + border-color: #527bbd; +} + +table.tableblock.frame-topbot { + border-left-style: hidden; + border-right-style: hidden; +} +table.tableblock.frame-sides { + border-top-style: hidden; + border-bottom-style: hidden; +} +table.tableblock.frame-none { + border-style: hidden; +} + +th.tableblock.halign-left, td.tableblock.halign-left { + text-align: left; +} +th.tableblock.halign-center, td.tableblock.halign-center { + text-align: center; +} +th.tableblock.halign-right, td.tableblock.halign-right { + text-align: right; +} + +th.tableblock.valign-top, td.tableblock.valign-top { + vertical-align: top; +} +th.tableblock.valign-middle, td.tableblock.valign-middle { + vertical-align: middle; +} +th.tableblock.valign-bottom, td.tableblock.valign-bottom { + vertical-align: bottom; +} + + +/* + * manpage specific + * + * */ + +body.manpage h1 { + padding-top: 0.5em; + padding-bottom: 0.5em; + border-top: 2px solid silver; + border-bottom: 2px solid silver; +} +body.manpage h2 { + border-style: none; +} +body.manpage div.sectionbody { + margin-left: 3em; +} + +@media print { + body.manpage div#toc { display: none; } +} + + +</style> +<script type="text/javascript"> +/*<+'])'); + // Function that scans the DOM tree for header elements (the DOM2 + // nodeIterator API would be a better technique but not supported by all + // browsers). + var iterate = function (el) { + for (var i = el.firstChild; i != null; i = i.nextSibling) { + if (i.nodeType == 1 /* Node.ELEMENT_NODE */) { + var mo = re.exec(i.tagName); + if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") { + result[result.length] = new TocEntry(i, getText(i), mo[1]-1); + } + iterate(i); + } + } + } + iterate(el); + return result; + } + + var toc = document.getElementById("toc"); + if (!toc) { + return; + } + + // Delete existing TOC entries in case we're reloading the TOC. + var tocEntriesToRemove = []; + var i; + for (i = 0; i < toc.childNodes.length; i++) { + var entry = toc.childNodes[i]; + if (entry.nodeName.toLowerCase() == 'div' + && entry.getAttribute("class") + && entry.getAttribute("class").match(/^toclevel/)) + tocEntriesToRemove.push(entry); + } + for (i = 0; i < tocEntriesToRemove.length; i++) { + toc.removeChild(tocEntriesToRemove[i]); + } + + // Rebuild TOC entries. + var entries = tocEntries(document.getElementById("content"), toclevels); + for (var i = 0; i < entries.length; ++i) { + var entry = entries[i]; + if (entry.element.id == "") + entry.element.id = "_toc_" + i; + var a = document.createElement("a"); + a.href = "#" + entry.element.id; + a.appendChild(document.createTextNode(entry.text)); + var div = document.createElement("div"); + div.appendChild(a); + div.className = "toclevel" + entry.toclevel; + toc.appendChild(div); + } + if (entries.length == 0) + toc.parentNode.removeChild(toc); +}, + + +///////////////////////////////////////////////////////////////////// +// Footnotes generator +///////////////////////////////////////////////////////////////////// + +/* Based on footnote generation code from: + * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html + */ + +footnotes: function () { + // Delete existing footnote entries in case we're reloading the footnodes. + var i; + var noteholder = document.getElementById("footnotes"); + if (!noteholder) { + return; + } + var entriesToRemove = []; + for (i = 0; i < noteholder.childNodes.length; i++) { + var entry = noteholder.childNodes[i]; + if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote") + entriesToRemove.push(entry); + } + for (i = 0; i < entriesToRemove.length; i++) { + noteholder.removeChild(entriesToRemove[i]); + } + + // Rebuild footnote entries. + var cont = document.getElementById("content"); + var spans = cont.getElementsByTagName("span"); + var refs = {}; + var n = 0; + for (i=0; i<spans.length; i++) { + if (spans[i].className == "footnote") { + n++; + var note = spans[i].getAttribute("data-note"); + if (!note) { + // Use [\s\S] in place of . so multi-line matches work. + // Because JavaScript has no s (dotall) regex flag. + note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1]; + spans[i].innerHTML = + "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n + + "' title='View footnote' class='footnote'>" + n + "</a>]"; + spans[i].setAttribute("data-note", note); + } + noteholder.innerHTML += + "<div class='footnote' id='_footnote_" + n + "'>" + + "<a href='#_footnoteref_" + n + "' title='Return to text'>" + + n + "</a>. " + note + "</div>"; + var id =spans[i].getAttribute("id"); + if (id != null) refs["#"+id] = n; + } + } + if (n == 0) + noteholder.parentNode.removeChild(noteholder); + else { + // Process footnoterefs. + for (i=0; i<spans.length; i++) { + if (spans[i].className == "footnoteref") { + var href = spans[i].getElementsByTagName("a")[0].getAttribute("href"); + href = href.match(/#.*/)[0]; // Because IE return full URL. + n = refs[href]; + spans[i].innerHTML = + "[<a href='#_footnote_" + n + + "' title='View footnote' class='footnote'>" + n + "</a>]"; + } + } + } +}, + +install: function(toclevels) { + var timerId; + + function reinstall() { + asciidoc.footnotes(); + if (toclevels) { + asciidoc.toc(toclevels); + } + } + + function reinstallAndRemoveTimer() { + clearInterval(timerId); + reinstall(); + } + + timerId = setInterval(reinstall, 500); + if (document.addEventListener) + document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false); + else + window.onload = reinstallAndRemoveTimer; +} + +} +asciidoc.install(4); +/*]]>*/ +</script> +</head> +<body class="article"> +<div id="header"> +<h1>ADC Extensions</h1> +<span id="author">Fredrik Ullner, ul...@gm...</span><br /> +<span id="revnumber">version 1.0.8,</span> +<span id="revdate">February 2014</span> +<div id="toc"> + <div id="toctitle">Table of Contents</div> + <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript> +</div> +</div> +<div id="content"> +<div class="sect1"> +<h2 id="_abstract">1. Abstract</h2> +<div class="sectionbody"> +<div class="paragraph"><p>These are the official extensions to ADC. This document is based on the +information contained in the ADC wiki and ADC forum - spefications from there are moved here +when they are mature and stable enough.</p></div> +</div> +</div> +<div class="sect1"> +<h2 id="_version_history">2. Version history</h2> +<div class="sectionbody"> +<div class="paragraph"><p>The latest draft of the next version of this document as well as intermediate +and older versions can be downloaded from +$URL: <a href="https://svn.code.sf.net/p/adc/code/trunk/ADC-EXT.txt">https://svn.code.sf.net/p/adc/code/trunk/ADC-EXT.txt</a> $.</p></div> +<div class="paragraph"><p>This version corresponds to $Revision: 121 $.</p></div> +<div class="sect2"> +<h3 id="_version_1_0_8">2.1. Version 1.0.8</h3> +<div class="paragraph"><p>Fredrik Ullner <<a href="mailto:ul...@gm...">ul...@gm...</a>>, 2014-02-11</p></div> +<div class="ulist"><ul> +<li> +<p> +Improved <em>NATT</em> documentation, as according to the original paper. +</p> +</li> +<li> +<p> +Added <em>ONID</em> extension to provide online service integration. +</p> +</li> +<li> +<p> +TIGR now specifies the changes done to the file list. +</p> +</li> +<li> +<p> +Added error code <em>ADCS transfers are required</em> in STA. +</p> +</li> +<li> +<p> +Added <em>ASCH</em> extension for extended searching capability. +</p> +</li> +<li> +<p> +Added <em>Date</em> attribute in file list for files and directories. +</p> +</li> +<li> +<p> +Added <em>Size</em> attribute in file list for directories. +</p> +</li> +<li> +<p> +Added <em>Children</em> attribute in file list for directories. +</p> +</li> +<li> +<p> +Added downloaded progress report for uploaders in GET. +</p> +</li> +<li> +<p> +Added <em>RDEX</em> for extended redirecting capabilities. +</p> +</li> +</ul></div> +</div> +<div class="sect2"> +<h3 id="_version_1_0_7">2.2. Version 1.0.7</h3> +<div class="paragraph"><p>Fredrik Ullner <<a href="mailto:ul...@gm...">ul...@gm...</a>>, 2012-11-22</p></div> +<div class="ulist"><ul> +<li> +<p> +Added application and version separation in INF +</p> +</li> +<li> +<p> +TIGR should now correctly reference SCH and RES +</p> +</li> +</ul></div> +</div> +<div class="sect2"> +<h3 id="_version_1_0_6">2.3. Version 1.0.6</h3> +<div class="paragraph"><p>Fredrik Ullner <<a href="mailto:ul...@gm...">ul...@gm...</a>>, 2010-09-29</p></div> +<div class="ulist"><ul> +<li> +<p> +Added <em>KEYP</em> extension for providing certificate substitution protection in ADCS. +</p> +</li> +<li> +<p> +Added note to signal DFAV. +</p> +</li> +<li> +<p> +Added <em>SUDP</em> extension for encryption of UDP traffic. +</p> +</li> +<li> +<p> +Added <em>TYPE</em> extension for chat state notifications. +</p> +</li> +<li> +<p> +Added <em>FEED</em> extension for RSS feeds. +</p> +</li> +<li> +<p> +Added <em>SEGA</em> extension for grouping of file extensions in SCH. +</p> +</li> +<li> +<p> +Added failover hub addresses to the hub’s INF. +</p> +</li> +<li> +<p> +Added free slots to the client’s INF. +</p> +</li> +<li> +<p> +Added <em>ADCS</em> extension for encryption in ADC. +</p> +</li> +</ul></div> +</div> +<div class="sect2"> +<h3 id="_version_1_0_5">2.4. Version 1.0.5</h3> +<div class="paragraph"><p>Fredrik Ullner <<a href="mailto:ul...@gm...">ul...@gm...</a>>, 2010-09-16</p></div> +<div class="ulist"><ul> +<li> +<p> +Added locale field to INF. +</p> +</li> +<li> +<p> +Modified user parameter <em>line</em> in UCMD to handle multiple inputs. +</p> +</li> +<li> +<p> +Added hidden in enumeration of CT field in INF. +</p> +</li> +<li> +<p> +Added error code Invalid feature in STA. +</p> +</li> +</ul></div> +</div> +<div class="sect2"> +<h3 id="_version_1_0_4">2.5. Version 1.0.4</h3> +<div class="paragraph"><p>Fredrik Ullner <<a href="mailto:ul...@gm...">ul...@gm...</a>>, 2010-06-29</p></div> +<div class="ulist"><ul> +<li> +<p> +Added magnet link extension to UCMD. +</p> +</li> +<li> +<p> +Added NAT traversal extension <em>NATT</em>. +</p> +</li> +<li> +<p> +Added referral field to STA. +</p> +</li> +<li> +<p> +Added upload queue field to STA. +</p> +</li> +<li> +<p> +Added partial file sharing extension <em>PFSR</em>. +</p> +</li> +</ul></div> +</div> +<div class="sect2"> +<h3 id="_version_1_0_3">2.6. Version 1.0.3</h3> +<div class="paragraph"><p>Fredrik Ullner <<a href="mailto:ul...@gm...">ul...@gm...</a>>, 2010-05-26</p></div> +<div class="ulist"><ul> +<li> +<p> +Removed optional keywords from UCMD. +</p> +</li> +<li> +<p> +Added <em>BLOM</em> extension for bloom filters. +</p> +</li> +</ul></div> +</div> +<div class="sect2"> +<h3 id="_version_1_0_2">2.7. Version 1.0.2</h3> +<div class="paragraph"><p>Fredrik Ullner <<a href="mailto:ul...@gm...">ul...@gm...</a>>, 2010-04-04</p></div> +<div class="ulist"><ul> +<li> +<p> +Added <em>UCMD</em> extension for user commands. +</p> +</li> +</ul></div> +</div> +<div class="sect2"> +<h3 id="_version_1_0_1">2.8. Version 1.0.1</h3> +<div class="paragraph"><p>Fredrik Ullner <<a href="mailto:ul...@gm...">ul...@gm...</a>>, 2009-08-04</p></div> +<div class="ulist"><ul> +<li> +<p> +Added timestamp field to MSG. +</p> +</li> +<li> +<p> +Added <em>DFAV</em> extension for distributing hub addresses. +</p> +</li> +</ul></div> +</div> +<div class="sect2"> +<h3 id="_version_1_0">2.9. Version 1.0</h3> +<div class="paragraph"><p>Jacek Sieka <<a href="mailto:arn...@gm...">arn...@gm...</a>>, 2008-05-02</p></div> +<div class="ulist"><ul> +<li> +<p> +Initial release created from original ADC 1.0 text. +</p> +</li> +<li> +<p> +Added <em>PING</em> extension for hub pingers. +</p> +</li> +</ul></div> +</div> +</div> +</div> +<div class="sect1"> +<h2 id="_extensions">3. Extensions</h2> +<div class="sectionbody"> +<div class="sect2"> +<h3 id="_tigr_tiger_tree_hash_support">3.1. TIGR - Tiger tree hash support</h3> +<div class="sect3"> +<h4 id="_general">3.1.1. General</h4> +<div class="paragraph"><p>This extension adds Tiger tree hash support to the base protocol. It is +intended to be used both for identifying files and for purposes such as CID +generation and password negotiation</p></div> +</div> +<div class="sect3"> +<h4 id="_tigr_for_shared_files">3.1.2. TIGR for shared files</h4> +<div class="paragraph"><p>All files shared by TIGR supporting clients must have been hashed using Merkle +Hash trees, as defined by +<a href="http://web.archive.org/web/20080316033726/http://www.open-content.net/specs/draft-jchapweske-thex-02.html">http://web.archive.org/web/20080316033726/http://www.open-content.net/specs/draft-jchapweske-thex-02.html</a>. +The Tiger +algorithm, as specified by <a href="http://www.cs.technion.ac.il/~biham/Reports/Tiger/">http://www.cs.technion.ac.il/~biham/Reports/Tiger/</a>, +functions as the hash algorithm. A base segment size of 1024 bytes must be +used when generating the tree, but clients may then discard parts of the tree +as long as at least 7 levels are kept or a block granularity of 64 KiB is +achieved.</p></div> +<div class="paragraph"><p>Generally, the root of the tree (TTH) serves to identify a file uniquely. +Searches use it and it must be present in the file list. Further, the root of +the file list must also be available and discoverable via GFI. A client may +also request the rest of the tree using the normal client-client transfer +procedure. The root must be encoded using base32 encoding when converted to +text.</p></div> +<div class="paragraph"><p>In the file list, each File element carries an additional attribute "TTH" +containing the base32-encoded value of the Tiger tree root.</p></div> +<div class="paragraph"><p>In the GET/GFI type, the full tree may be accessed using the "tthl" type.</p></div> +<div class="paragraph"><p>"tthl" transfers send the largest set of leaves available) as a binary stream +of leaf data, right-to-left, with no spacing in between them. <start_pos> +must be set to 0 and <bytes> to -1 when requesting the data. <bytes> must +contain the total binary size of the leaf stream in SND; by dividing this +length by the individual hash length, the number of leaves, and thus the leaf +level, can be deducted. The received leaves can then be used to reconstruct +the entire tree, and the resulting root must match the root of the file (this +verifies the integrity of the tree itself). Identifier must be a TTH root +value from the "TTH/" root.</p></div> +<div class="paragraph"><p>In the GET/GFI namespace, files are identified by +"TTH/<base32-encoded tree root>".</p></div> +<div class="paragraph"><p>In SCH and RES, the following attributes are added:</p></div> +<div class="tableblock"> +<table rules="all" +frame="border" +cellspacing="0" cellpadding="4"> +<col /> +<col /> +<tbody> +<tr> +<td align="left" valign="top"><p class="table">TR</p></td> +<td align="left" valign="top"><p class="table">Tiger tree Hash root, encoded with base32.</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">TD</p></td> +<td align="left" valign="top"><p class="table">Tree depth, index of the highest level of tree data available, root-only = 0, first level (2 leaves) = 1, second level = 2, etc…</p></td> +</tr> +</tbody> +</table> +</div> +<div class="paragraph"><p>The following changes are done to the file list XML schema:</p></div> +<div class="paragraph"><p>A new type is defined with an appropriate attribute:</p></div> +<div class="listingblock"> +<div class="content"> +<pre><code><xs:simpleType name="tthType"> + <xs:restriction base="xs:string"> + <xs:pattern value="[A-Za-z2-7]{39}" /> + </xs:restriction> +</xs:simpleType> +<xs:attribute name="TTH" type="tthType" /></code></pre> +</div></div> +<div class="paragraph"><p>The attribute is then referenced in the File element:</p></div> +<div class="listingblock"> +<div class="content"> +<pre><code><xs:attribute ref="TTH" use="required" /></code></pre> +</div></div> +</div> +</div> +<div class="sect2"> +<h3 id="_bzip_file_list_compressed_with_bzip2">3.2. BZIP - File list compressed with bzip2</h3> +<div class="paragraph"><p>This extension adds a special file "files.xml.bz2" in the unnamed root of the +share which contains "files.xml" compressed with bzip2 1.0.3+ (www.bzip.org).</p></div> +</div> +<div class="sect2"> +<h3 id="_zlib_compressed_communication">3.3. ZLIB - Compressed communication</h3> +<div class="paragraph"><p>There are two variants of zlib support, FULL and GET, and only one should be +used on a each communications channel set up.</p></div> +<div class="sect3"> +<h4 id="_zlib_full">3.3.1. ZLIB-FULL</h4> +<div class="paragraph"><p>If, during SUP negotiation, a peer sends "ZLIF" in its support string, it must +accept two additional commands, ZON and ZOF. Upon reception of ZON the peer +must start decompressing the incoming stream of data with zlib before +interpreting it, and stop doing so after ZOF is received (in the compressed +stream). The compressing end must partially flush the zlib buffer after each +chunk of data to allow for decompression by the peer.</p></div> +</div> +<div class="sect3"> +<h4 id="_zlib_get">3.3.2. ZLIB-GET</h4> +<div class="paragraph"><p>The alternative is to send "ZLIG" to indicate that zlib is supported for +binary transfers using the GET command, but not otherwise. A flag "ZL1" is +added to the to the SND command to indicate that the data will come +compressed, and the client receiving requests it by adding the same flag to +GET (the sending client may ignore a request for a compressed transfer, but +may also use it even when not requested by the receiver). The <bytes> +parameter of the GET and SND commands is to be interpreted as the number of +uncompressed bytes to be transferred.</p></div> +</div> +</div> +<div class="sect2"> +<h3 id="_ping_pinger_extension">3.4. PING - Pinger extension</h3> +<div class="paragraph"><p>This extension can be supported by both clients and hubs, and when present, if hub +supports it, it must send additional information to the client ( otherwise normal +base client).</p></div> +<div class="paragraph"><p>It’s purpose is to send to hublist pingers additional information about the hub + that otherwise it would be impossible to get as a normal user (eg. minimum share, + maximum user count, etc).</p></div> +<div class="sect3"> +<h4 id="_inf">3.4.1. INF</h4> +<div class="paragraph"><p>Contexts : F</p></div> +<div class="paragraph"><p>When the client supporting the PING extension connects, the hub must send its +normal INF along with the following added fields ( none mandatory, if not present, +it means hub has no restrictions in that matter, or non existent):</p></div> +<div class="tableblock"> +<table rules="all" +frame="border" +cellspacing="0" cellpadding="4"> +<col /> +<col /> +<col /> +<thead> +<tr> +<th align="left" valign="top">Code </th> +<th align="left" valign="top"> Type </th> +<th align="left" valign="top"> Description</th> +</tr> +</thead> +<tbody> +<tr> +<td align="left" valign="top"><p class="table">HH</p></td> +<td align="left" valign="top"><p class="table">string</p></td> +<td align="left" valign="top"><p class="table">Hub Host address ( DNS or IP )</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">WS</p></td> +<td align="left" valign="top"><p class="table">url</p></td> +<td align="left" valign="top"><p class="table">Hub Website</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">NE</p></td> +<td align="left" valign="top"><p class="table">string</p></td> +<td align="left" valign="top"><p class="table">Hub Network</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">OW</p></td> +<td align="left" valign="top"><p class="table">string</p></td> +<td align="left" valign="top"><p class="table">Hub Owner name</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">UC</p></td> +<td align="left" valign="top"><p class="table">integer</p></td> +<td align="left" valign="top"><p class="table">Current User count</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">SS</p></td> +<td align="left" valign="top"><p class="table">integer</p></td> +<td align="left" valign="top"><p class="table">Total share size</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">SF</p></td> +<td align="left" valign="top"><p class="table">integer</p></td> +<td align="left" valign="top"><p class="table">Total files shared</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">MS</p></td> +<td align="left" valign="top"><p class="table">integer</p></td> +<td align="left" valign="top"><p class="table">Minimum share required to enter hub ( bytes )</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">XS</p></td> +<td align="left" valign="top"><p class="table">integer</p></td> +<td align="left" valign="top"><p class="table">Maximum share for entering hub ( bytes )</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">ML</p></td> +<td align="left" valign="top"><p class="table">integer</p></td> +<td align="left" valign="top"><p class="table">Minimum slots required to enter hub</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">XL</p></td> +<td align="left" valign="top"><p class="table">integer</p></td> +<td align="left" valign="top"><p class="table">Maximum slots for entering hub</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">MU</p></td> +<td align="left" valign="top"><p class="table">integer</p></td> +<td align="left" valign="top"><p class="table">Minimum hubs connected where clients can be users</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">MR</p></td> +<td align="left" valign="top"><p class="table">integer</p></td> +<td align="left" valign="top"><p class="table">Minimum hubs connected where client can be registered</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">MO</p></td> +<td align="left" valign="top"><p class="table">integer</p></td> +<td align="left" valign="top"><p class="table">Minimum hubs connected where client can be operators</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">XU</p></td> +<td align="left" valign="top"><p class="table">integer</p></td> +<td align="left" valign="top"><p class="table">Maximum hubs connected where clients can be users</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">XR</p></td> +<td align="left" valign="top"><p class="table">integer</p></td> +<td align="left" valign="top"><p class="table">Maximum hubs connected where client can be registered</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">XO</p></td> +<td align="left" valign="top"><p class="table">integer</p></td> +<td align="left" valign="top"><p class="table">Maximum hubs connected where client can be operators</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">MC</p></td> +<td align="left" valign="top"><p class="table">integer</p></td> +<td align="left" valign="top"><p class="table">Maximum possible clients ( users ) who can connect</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">UP</p></td> +<td align="left" valign="top"><p class="table">integer</p></td> +<td align="left" valign="top"><p class="table">Hub uptime (seconds)</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">NI</p></td> +<td align="left" valign="top"><p class="table">string</p></td> +<td align="left" valign="top"><p class="table">Hub name (from BASE)</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">DE</p></td> +<td align="left" valign="top"><p class="table">string</p></td> +<td align="left" valign="top"><p class="table">Hub description (from BASE)</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">VE</p></td> +<td align="left" valign="top"><p class="table">string</p></td> +<td align="left" valign="top"><p class="table">Hub software version (from BASE)</p></td> +</tr> +</tbody> +</table> +</div> +<div class="paragraph"><p>The hub must continue to send the user list as for a normal user (move to +NORMAL state). The pinger may decide to go through or disconnect (eg. if it +doesn’t require additional information about the users).</p></div> +<div class="sect4"> +<h5 id="_example">Example</h5> +<div class="exampleblock"> +<div class="content"> +<div class="literalblock"> +<div class="content"> +<pre><code>-pinger- HSUP ADBASE ADPING AD.. +-hub- ISUP ADBASE ADPING AD.. +-hub- ISID .. +-hub- IINF NIhubname DEcurrent\stopic VE.. HHexample.org:555 WShttp://example.org/ OWmyname UC2231 SS.. SF.. MS0 ML0 MC5000 +- (pinger may disconnect)</code></pre> +</div></div> +</div></div> +</div> +</div> +<div class="sect3"> +<h4 id="_hub_hublist_communication">3.4.2. Hub - Hublist communication</h4> +<div class="paragraph"><p>The same extension goes for hub- hublist communication. This way, the hub +takes the role of the client and the hublist of the server.</p></div> +<div class="paragraph"><p>The hublist may send INF about itself with NI field which would become hublist +name and WS hublist web address.</p></div> +<div class="sect4"> +<h5 id="_example_2">Example</h5> +<div class="exampleblock"> +<div class="content"> +<div class="literalblock"> +<div class="content"> +<pre><code>-hub- HSUP ADBASE ADPING AD.. +-hublist- ISUP ADBASE ADPING AD.. +-hublist- IINF NIhublist_name WShublist_address +-hub- HINF NIhubname DEcurrent\stopic VE.. HHexample.org:555 WShttp://example.org/ OWmyname UC2231 SS.. SF.. MS0 ML0 MC5000 +-( disconnect )</code></pre> +</div></div> +</div></div> +</div> +</div> +</div> +<div class="sect2"> +<h3 id="_ts_timestamp_in_msg">3.5. TS - Timestamp in MSG</h3> +<div class="paragraph"><p>Timestamp of the moment when the message was sent, expressed in seconds since the Unix Epoch (January 1 1970 00:00:00 GMT).</p></div> +</div> +<div class="sect2"> +<h3 id="_dfav_distributed_favorites">3.6. DFAV - Distributed Favorites</h3> +<div class="paragraph"><p>The idea behind this extension is to generate a public hublist from the users favorite hublist. Implementations should separate between public and private hubs in the favorite hublist of an user, in order not to distribute private hubs where one can not connect to anyway.</p></div> +<div class="paragraph"><p>Signal DFAV in SUP and the INF’s SU field.</p></div> +<div class="sect3"> +<h4 id="_gfa">3.6.1. GFA</h4> +<div class="literalblock"> +<div class="content"> +<pre><code>GFA</code></pre> +</div></div> +<div class="paragraph"><p>Contexts: T, C</p></div> +<div class="paragraph"><p>Asks all users within the same hub with the correct feature to send all publicly available hubs, in their favorite hub list to the requesting client.</p></div> +</div> +<div class="sect3"> +<h4 id="_rfa">3.6.2. RFA</h4> +<div class="literalblock"> +<div class="content"> +<pre><code>RFA</code></pre> +</div></div> +<div class="paragraph"><p>Contexts: C</p></div> +<div class="paragraph"><p>Response of a client.</p></div> +<div class="tableblock"> +<table rules="all" +frame="border" +cellspacing="0" cellpadding="4"> +<col /> +<col /> +<tbody> +<tr> +<td align="left" valign="top"><p class="table">HA</p></td> +<td align="left" valign="top"><p class="table">Hub address</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">LG</p></td> +<td align="left" valign="top"><p class="table">Last succesfull login time ( number of seconds since the epoch (1970), (UTC) )</p></td> +</tr> +</tbody> +</table> +</div> +<div class="paragraph"><p>All INF fields from BASE are inherited. All INF fields from PING extension are inherited.</p></div> +</div> +</div> +<div class="sect2"> +<h3 id="_ucmd_user_commands">3.7. UCMD - User commands</h3> +<div class="literalblock"> +<div class="content"> +<pre><code>CMD name</code></pre> +</div></div> +<div class="paragraph"><p>Contexts: F</p></div> +<div class="paragraph"><p>States: NORMAL</p></div> +<div class="paragraph"><p>User commands are used to send hub-specific commands to the client which provide useful shortcuts for the user. These commands contain strings which must be sent back to the hub and keyword substitutions in the strings. Each user command has a display name, a string to be sent to the hub, and one or more categories where it may appear. The strings passed to the hub must first be passed through a dictionary replacement that replaces all keywords in the string and then through the equivalent of the C standard function "strftime", with the current time.</p></div> +<div class="paragraph"><p>Name uniquely (per hub) identifies a particular user command. The name may contain "/" to indicate a logical structure on the viewing client, where each "/" introduces a new submenu level. Other than name, the command also has a number of flags that further detail what to do with it.</p></div> +<div class="tableblock"> +<table rules="all" +frame="border" +cellspacing="0" cellpadding="4"> +<col /> +<col /> +<tbody> +<tr> +<td align="left" valign="top"><p class="table">RM</p></td> +<td align="left" valign="top"><p class="table">1 = Remove Command</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">CT</p></td> +<td align="left" valign="top"><p class="table">Message Category, 1 = Hub command, client parameters only, 2 = User list command, client and user parameters, 4 = Search result command, client, user and file parameters, 8 = File list command, client, user and file parameters. Multiple types are specified by adding the numbers together.</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">TT</p></td> +<td align="left" valign="top"><p class="table">The full text to be sent to hub, including FOURCC, parameters and keywords.</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">CO</p></td> +<td align="left" valign="top"><p class="table">1 = Constrained, when sending this command on multiple users (for example in search results), constrain it to once per CID only</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">SP</p></td> +<td align="left" valign="top"><p class="table">1 = Insert separator instead of command name (name must still be present to uniquely identify the command).</p></td> +</tr> +</tbody> +</table> +</div> +<div class="sect3"> +<h4 id="_keywords">3.7.1. Keywords</h4> +<div class="paragraph"><p>Keywords are specified using "%[keyword]". Unknown keywords must be replaced by the empty string. Additionally, all %-substitutions of the C function "strftime" must be supported.</p></div> +<div class="paragraph"><p>The following tables specify the keywords that must be supported.</p></div> +<div class="paragraph"><p>Client parameters</p></div> +<div class="tableblock"> +<table rules="all" +frame="border" +cellspacing="0" cellpadding="4"> +<col /> +<col /> +<tbody> +<tr> +<td align="left" valign="top"><p class="table">myCID</p></td> +<td align="left" valign="top"><p class="table">Client CID</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">mySID</p></td> +<td align="left" valign="top"><p class="table">ClientSID</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">myXX</p></td> +<td align="left" valign="top"><p class="table">One for each flag on that particular hub; for example, myI4 and myNI</p></td> +</tr> +</tbody> +</table> +</div> +<div class="paragraph"><p>User parameters</p></div> +<div class="tableblock"> +<table rules="all" +frame="border" +cellspacing="0" cellpadding="4"> +<col /> +<col /> +<tbody> +<tr> +<td align="left" valign="top"><p class="table">userCID</p></td> +<td align="left" valign="top"><p class="table">User CID</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">userSID</p></td> +<td align="left" valign="top"><p class="table">User SID</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">userXX</p></td> +<td align="left" valign="top"><p class="table">One for each flag on the user sent; for example, userI4 and userNI</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">line:info</p></td> +<td align="left" valign="top"><p class="table">Prompts the user for input where <em>info</em> is the displayed text description for the user input. <em>info</em> can be used for multiple values (combobox etc), and should be structured as "general info/default selection/value0/value1/…/valueN". The general info can be viewed as the caption of the user input dialog. Default selection is an integer k which signifies the default value to be used. Note that N >= k >= 0 and N >= 1. Note that values are 0-index based. Values are separated with a forward slash (<em>/</em>). If a forward slash is part of a value, it should be escaped by using an additional forward slash (<em>//</em>).</p></td> +</tr> +</tbody> +</table> +</div> +<div class="paragraph"><p>File parameters</p></div> +<div class="tableblock"> +<table rules="all" +frame="border" +cellspacing="0" cellpadding="4"> +<col /> +<col /> +<tbody> +<tr> +<td align="left" valign="top"><p class="table">fileXX</p></td> +<td align="left" valign="top"><p class="table">One for each flag contained within a search result or file list entry (see RES)</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">fileMN</p></td> +<td align="left" valign="top"><p class="table">Specify magnet link. <a href="http://en.wikipedia.org/wiki/Magnet_link">Magnet links</a> are used to reference files across networks and applications. Clients may ignore parameters it does not understand, but are free to pass on the parameters to other programs.</p></td> +</tr> +</tbody> +</table> +</div> +<div class="paragraph"><p>Hub parameters</p></div> +<div class="tableblock"> +<table rules="all" +frame="border" +cellspacing="0" cellpadding="4"> +<col /> +<col /> +<tbody> +<tr> +<td align="left" valign="top"><p class="table">hubXX</p></td> +<td align="left" valign="top"><p class="table">One for each flag of the hub; for example, hubNI and hubVE</p></td> +</tr> +</tbody> +</table> +</div> +</div> +<div class="sect3"> +<h4 id="_example_3">3.7.2. Example</h4> +<div class="exampleblock"> +<div class="content"> +<div class="paragraph"><p>ICMD ADCH++/Hub\smanagement/Register\snick TTHMSG\s+regnick\s%[userNI]\s%[line:Password\s(leave\sempty\sto\sun-reg)]\s%[line:Level\s(facultative;\sdefaults\sto\syour\sown\slevel\sminus\sone)]\n CT2</p></div> +<div class="paragraph"><p>ICMD ADCH++/Hub\smanagement/Reload\sbans TTHMSG\s+loadbans\n CT3</p></div> +<div class="paragraph"><p>ICMD ADCH++/Hub\smanagement/Reload\sscripts TTHMSG\s+reload\n CT3</p></div> +<div class="paragraph"><p>ICMD ADCH++/Info TTHMSG\s+info\s%[userNI]\n CT2</p></div> +<div class="paragraph"><p>ICMD ADCH++/Info TTHMSG\s+info\n CT1</p></div> +</div></div> +</div> +</div> +<div class="sect2"> +<h3 id="_blom_bloom_filter">3.8. BLOM- Bloom filter</h3> +<div class="paragraph"><p>Bloom filters allow the hub to filter certain searches using bitmap that represents the hashes of the files in the users share. BLOM is an extension that allows hub software to create a map (bloom filter) of the shared files on the hub, but with minimal effort, e.g. the hub doesn’t keep a list of files, but a filter that never produces false negatives but only possible false positives. This can potentially save bandwidth and effort on the client side. When the user updates the share, the client must send an INF containing the flag SF. The hub may at any time request that the client sends an updated version of its bloom filter by sending a GET command to the client. The client will then respond using SND and send the bloom filter binary data.</p></div> +<div class="sect3"> +<h4 id="_legend">3.8.1. Legend</h4> +<div class="tableblock"> +<table rules="all" +frame="border" +cellspacing="0" cellpadding="4"> +<col /> +<col /> +<tbody> +<tr> +<td align="left" valign="top"><p class="table">b</p></td> +<td align="left" valign="top"><p class="table">Number of bits used for file hashes</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">n</p></td> +<td align="left" valign="top"><p class="table">Number of files in the user’s share</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">m</p></td> +<td align="left" valign="top"><p class="table">Size of the bloom filter in bits</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">k</p></td> +<td align="left" valign="top"><p class="table">Number of sub-hashes constructed from the file hash</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">h</p></td> +<td align="left" valign="top"><p class="table">Number of bits to use for each sub-hash</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">p</p></td> +<td align="left" valign="top"><p class="table">Propability of a false positive</p></td> +</tr> +</tbody> +</table> +</div> +<div class="paragraph"><p>The hub chooses k, h and m.</p></div> +</div> +<div class="sect3"> +<h4 id="_restrictions">3.8.2. Restrictions</h4> +<div class="tableblock"> +<table rules="all" +frame="border" +cellspacing="0" cellpadding="4"> +<col /> +<tbody> +<tr> +<td align="left" valign="top"><p class="table">k * h < = b</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">h < = 64</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">2<sup>h</sup> > m</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">m mod 64 == 0</p></td> +</tr> +</tbody> +</table> +</div> +</div> +<div class="sect3"> +<h4 id="_probability">3.8.3. Probability</h4> +<div class="tableblock"> +<table rules="all" +frame="border" +cellspacing="0" cellpadding="4"> +<col /> +<col /> +<tbody> +<tr> +<td align="left" valign="top"><p class="table">p == (1 - (1 - 1 / m)<sup>(k * n)</sup>)<sup>k</sup></p></td> +<td align="left" valign="top"><p class="table">False positives</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">p == 0</p></td> +<td align="left" valign="top"><p class="table">False negatives</p></td> +</tr> +</tbody> +</table> +</div> +</div> +<div class="sect3"> +<h4 id="_protocol_changes">3.8.4. Protocol changes</h4> +<div class="paragraph"><p>Signal BLOM in SUP.</p></div> +<div class="paragraph"><p>For the SND type, adds H as message type.</p></div> +<div class="paragraph"><p>For the GET type, adds I as message type.</p></div> +<div class="paragraph"><p>For the GET type, adds "blom" as type.</p></div> +<div class="paragraph"><p>For the GET type, "/" shall be used as namespace.</p></div> +<div class="paragraph"><p>For the GET type, 0 (zero) shall be used as start position.</p></div> +<div class="paragraph"><p>For the GET type, m / 8 shall be used as byte amount.</p></div> +<div class="paragraph"><p>Updates GET with the following flags;</p></div> +<div class="tableblock"> +<table rules="all" +frame="border" +cellspacing="0" cellpadding="4"> +<col /> +<col /> +<tbody> +<tr> +<td align="left" valign="top"><p class="table">BK</p></td> +<td align="left" valign="top"><p class="table">Specify <em>k</em>.</p></td> +</tr> +<tr> +<td align="left" valign="top"><p class="table">BH</p></td> +<td align="left" valign="top"><p class="table">Specify <em>h</em>.</p></td> +</tr> +</tbody> +</table> +</div> +</div> +<div class="sect3"> +<h4 id="_algorithm">3.8.5. Algorithm</h4> +<div class="paragraph"><p>The client constructs the bloom filter by creating a bit array of m bits set to 0 (zero). For each file it then sets to "1" k positions constructed from the file hash. Seeing the file hash as a stream of bits (starting from the lowest bit of the first byte, ending at the highest bit of the last byte), the client should use h bits starting at the first bit of the first byte to create an integer and apply modulo m to get the position in the bit array, then redo the process k times advancing the starting position by h each time.</p></div> +<div class="paragraph"><p>Once the hub has received the bloom filter bit array, for each search command it processes, if it contains a hash search term, it can skip broadcasting the search to a particular client if at least one of the k bits in that clients bit array is "0", calculating positions as the client does when setting bits to "1". The hub has to evaluate the filter for each client that it has a bloom filter for, for each search.</p></div> +</div> +<div class="sect3"> +<h4 id="_probability_calculations">3.8.6. Probability calculations</h4> +<div class="paragraph"><p>p = (1 - (1 - 1 / m)<sup>(k * n)</sup>)<sup>k</sup>, thus p becomes smaller as m grows and larger as n grows. Larger m means more bits to transfer but also fewer false positives. The optimum value for k given m and n is (m / n) * ln 2. The largest k supported by a hash of a certain size is b / h, so if the hub wants the smallest p possible, it should choose the smallest possible h which gives the largest k, and then calculate m = k * n/ln 2, checking that the resulting m < 2<sup>h</sup>. 2<sup>h</sup> should much be larger than m (at least 3-4 times), because of how the modulo operator works. Also, with m grows the required bandwidth to transfer the bloom filter, so the hub may wish to cap m. In that case, it should still choose k according to m / n * ln 2, but send an h as big as possible to alleviate biasing problems.</p></div> +</div> +<div class="sect3"> +<h4 id="_sample_implementations">3.8.7. Sample implementations</h4> +<div class="sect4"> +<h5 id="_tiger">Tiger</h5> +<div class="paragraph"><p>For TTH roots, b is 192 and a reasonable value for h is 24, giving a maximum k = 8 which means that m = 8 * n / ln 2 ≈ 11.5 * n. The required bandwidth then becomes 11.5 * n / 8 bytes, so approximately 1.44 bytes per file in the users share. For 20000 files, m should then be 230016 (taking into account the modulo 64 requirement), giving a p = 0.004, in other words ~99.6% of all searches that don’t match a users share would not be sent, saving valuable upload bandwidth for the hub. The client calculates i valid positions, if x is an array of bytes containing the hash of the file, on a little-endian machine, by doing pos = x[0+i*h/8] | (x[1+i*h/8] << 8) | (x[2+i*h/8] << 16) for i = [0;k). This is of course a special case where h % 8 = 0, the actual algorithm has to take into consideration values for h where the integer crosses byte boundaries.</p></div> +<div class="paragraph"><p>For test vectors, see the <a href="http://www.adcportal.com/wiki/index.php/Talk:BLOM">ADC wiki talk page</a>.</p></div> +</div> +</div> +</div> +<div class="sect2"> +<h3 id="_natt_nat_traversal">3.9. NATT - NAT traversal</h3> +<div class="paragraph"><p>NAT traversal allow two passive clients to connect to each other. This specification is based on the TCP hole punching algorithm described in <span class="footnote" id="_footnote_Peer-to-Peer Communication Across Network Address Translators"><br />[B. Ford and P. Srisuresh and and D. Kegel. "Peer-to-Peer Communication Across Network Address Translators". In USENIX Technical Conference 2005 - pages 179–192. Online version: <a href="http://www.brynosaurus.com/pub/net/p2pnat/">http://www.brynosaurus.com/pub/net/p2pnat/</a>]<br /></span>.</p></div> +<div class="paragraph"><p>If a client does not support TCP4 or TCP6, it will send an RCM to the client it is trying to connect to. If the other client also doesn’t support TCP4 (or TCP6 correspondingly), NAT traversal may instead be used. Signal NATT in the INF’s SU field.</p></div> +<div class="paragraph"><p>Do note that the hub must forward I4 or I6 for respective clients' INF.</p></div> +<div class="paragraph"><p>An endpoint is the tuple of IP and port. The "private endpoint port" refers to the outbound port to the connected hub, as seen by the client. Each client must listen for incoming connections on this port. Note that this protocol extension uses only this port for the TCP hole punching, the use of the "public endpoint port" as specified in <span class="footnoteref"><br /><a href="#_footnote_Peer-to-Peer Communication Across Network Address Translators">[Peer-to-Peer Communication Across Network Address Translators]</a><br /></span> is not supported.</p></div> +<div class="sect3"> +<h4 id="_base_rcm_updates">3.9.1. BASE RCM updates</h4> +<div class="paragraph"><p>When receiving an RCM and the client does not support TCP4 or TCP6, and if NAT-T is supported in the remote client, a NAT command should be sent repeating the protocol and token. The port shall be the private endpoint port to the connected hub.</p></div> +</div> +<div class="sect3"> +<h4 id="_nat">3.9.2. NAT</h4> +<div class="literalblock"> +<div class="content"> +<pre><code>NAT protocol separator port separator token</code></pre> +</div></div> +<div class="paragraph"><p>Contexts: T</p></div> +<div class="paragraph"><p>States: NORMAL</p></div> +<div class="paragraph"><p>Upon receiving this, try and connect to the specified port. An RNT command should be sent repeating the protocol and token. The port shall be the private endpoint. Upon receiving this, try and connect to the specified port.</p></div> +</div> +<div class="sect3"> +<h4 id="_rnt">3.9.3. RNT</h4> +<div class="literalblock"> +<div class="content"> +<pre><code>RNT protocol separator port separator token</code></pre> +</div></div> +<div class="paragraph"><p>Contexts: T</p></div> +<div class="paragraph"><p>States: NORMAL</p></div> +<div class="paragraph"><p>Upon receiving this, try and connect to the specified port.</p></div> +</div> +<div class="sect3"> +<h4 id="_example_4">3.9.4. Example</h4> +<div class="paragraph"><p>Client A is connected to hub A with the private endpoint 1000 and client B is connected to hub A with the private endpoint 2000. Client A has the SID AAAA and client B has the SID BBBB.</p></div> +<div class="exampleblock"> +<div class="content"> +<div class="paragraph"><p>Client A: DRCM AAAA BBBB ADC/1.0 foobar</p></div> +<div class="paragraph"><p>Client B: DNAT BBBB AAAA ADC/1.0 2000 foobar</p></div> +<div class="paragraph"><p><Client A connects to client B’s IP address and port 2000></p></div> +<div class="paragraph"><p>Client A: DRNT AAAA BBBB ADC/1.0 1000 foobar</p></div> +<div class="paragraph"><p><Client B connects to client A’s IP address and port 1000></p></div> +</div></div> +</div> +</div> +<div class="sect2"> +<h3 id="_rf_referrer_notification">3.10. RF - Referrer notification</h3> +<div class="paragraph"><p>Extends the RF field of the INF to STA, allowing a client to notify clients and hubs upon SUP-negotiation from where the C-C or C-H originated from.</p></div> +<div class="tableblock"> +<table rules="all" +frame="border" +cellspacing="0" cellpadding="4"> +<col /> +<col /> +<tbody> +<tr> +<td align="left" valign="top"><p class="table">RF</p></td> +<td align="left" valign="top"><p class="table">URL of referrer</p></td> +</tr> +</tbody> +</table> +</div> +<div class="sect3"> +<h4 id="_example_5">3.10.1. Example</h4> +<div class="exampleblock"> +<div class="content"> +<div class="paragraph"><p>CSUP ADBASE (…)</p></div> +<div class="paragraph"><p>CSTA 000 referrer RFadc://example.com:1234</p></div> +</div></div> +</div> +</div> +<div class="sect2"> +<h3 id="_qp_upload_queue_notification">3.11. QP - Upload queue notification</h3> +<div class="paragraph"><p>This extension’s purpose is creating a queue on a client, when multiple other clients want to download from it, but they have no slots. Currently, when a slot is being freed, the first connecting client gets it. Other clients that don’t have the luck of getting in time to attempt to download, have to wait again. The client who creates a queue must have a ticket number for each connecting client, which must be kept internally , and a difference between current connecting client’s queue number and the currently uploading client’s be provided to the connecting client, so that the clients are being deserved in the order they originally connected. The client could have a ticket incrementing starting from 1 for each session. Connecting clients must use the same token as they used when originally connected.</p></div> +<div class="tableblock"> +<table rules="all" +frame="border" +cellspacing="0" cellpadding="4"> +<col /> +<col /> +<tbody> +<tr> +<td align="left" valign="top"><p class="table">QP</p></td> +<td align="left" valign="top"><p class="table">Queue number, representing how many others are in front in the queue.</p></td> +</tr> +</tbody> +</table> +</div> +<div class="sect3"> +<h4 id="_example_6">3.11.1. Example</h4> +<div class="paragraph"><p>The following example will notify that the client’s slots are full and that there are three uploads in the queue.</p></div> +<div class="exampleblock"> +<div class="content"> +<div class="paragraph"><p>CSTA 253 No\sslots\savailable QP3</p></div> +</div></div> +</div> +</div> +<div class="sect2"> +<h3 id="_pfsr_partial_file_sharing">3.12. PFSR - Partial file sharing</h3> +<div class="paragraph"><p>Partial File Sharing allows sharing of files which are available in user’s download queue or in finished downloads list. As ... [truncated message content] |