BITS PEERCACHING Sample

Summary

This sample demonstrates the new BITS API in a program that downloads a file.

BITS Peercaching is a new feature of BITS 3.0 that allows BITS to download content from peers in the same subnet, rather than the origin server. This feature can significantly reduce the load on the origin server.

If a computer BITS has peercaching enabled, BITS creates a group of up to 100 peers that are in the same subnet and belong to the same domain (peers from a trusted domain are not included in the neighborhood). When a job requests content from a peer, BITS randomly chooses 10 peers from the peer group and asks them if they have the content. Since BITS can download content only from authenticated peer servers, the client and server initially authenticate each other using Kerberos, and exchange self-signed certificates for authentication during content discovery and download. BITS downloads the content from the first authenticated peer to respond to the request. If one peer does not contain all the content, BITS can download the complete content from multiple peers and the origin server. If none of the peers has the content or an error occurs while downloading from a peer, BITS downloads the content from the origin server.

The negotiation and security aspects of peer discovery are beyond the scope of this sample. However, you will be able to see the results of the discovery using this sample.

Program flow

This sample builds on the concepts established in the DOWNLOADS.cpp example, it is recommended that you review DOWNLOADS.cpp prior to reviewing this sample – it will aid understanding of the program flow.The key differences between the two samples are:

Key Concepts

Build/Configuration instructions

Basic Usage


System configuration