4.13 The Peer-list Compression Set of rules
maintains the
list of peers
ordered according to the numerical order of the IP addresses of the end-points of
the peers. Thanks to this and depending on the compression ratio, the splitter
should minimize the transmission time of the list of peers by compressing it
with the Algorithm 7. Notice that only the IP addresses of the end-points are
compressed.
- Send 4 bytes for .
- Send 2 bytes for “A”, “C” or “C”, depending on type of network that is
going to be sent next.
- Send 3 (A class), 2 (B class) or 1 (C
class) bytes to encode the rest of peers of
that are in the sub-network specified in the previous step.
- For each peer in the sub-network:
- Send the host part of the IP address of the peer, using 3 (A class), 2
(B class) or (C class) 1 bytes.
- Send the port of the peer using 2 bytes.
Algorithm 7: : Compression algorithm of the list of peers.