Description

In order to scale the current structure to support AI use cases one solution is to use P2P CDN. This document is a draft of the specification for an upcoming upgrade to the Subspace protocol after the Mainnet launch.

Overview of HCDN (Hybrid CDN)

System roles and definition:

  1. Origin Server: The main server holding the original content, which distributes copies to surrogate servers.
  2. Surrogate Servers: Servers in a CDN that store and deliver content closer to users to reduce latency.
  3. Index Server: A server in a P2P network that tracks which peers have specific file chunks for efficient content sharing.
  4. Peers: User nodes in a P2P network that download and share content with each other.
  5. Seeds: Peers that have the complete file and are sharing it with other downloaders.
  6. Downloaders: Peers currently downloading content but who haven’t yet received the entire file.

Data Flow of HCDN

  1. The origin server begins by splitting the large file into smaller, manageable chunks. During this process, erasure coding (e.g., Reed-Solomon or Luby Transform codes) is applied to the chunks.
  2. The encoded chunks are then distributed to multiple surrogate servers within the CDN.
  3. When a user (peer) requests the file, the request is routed to the nearest surrogate server based on network proximity and server load.
  4. The surrogate server responds to the user’s request by delivering one or more of the encoded file chunks.
  5. Transition to Peer-to-Peer Sharing
    1. Formation of Seeds: As peers complete downloading all required chunks, they become seeds. These seeds can now upload chunks to other peers.
    2. Peer Exchange of Chunks: Downloaders (peers still downloading the file) can obtain different chunks from multiple sources, including both surrogate servers and other peers (seeds).