4.2 BITS and Peer-caching Interactions: Initial Download

The following sequence diagram illustrates a scenario where an application uses the BITS Upload Protocol and BITS Peer-caching protocols to download content. In this scenario:

  • The client’s peer list is initially empty.

  • Only a single peer server is online in the subnet; it is a member of the same Windows domain as the client.

  • The available peer is not caching the desired content.

Sequence diagram for initial download example

Figure 5: Sequence diagram for initial download example

  1. The application requests the BITS Upload Protocol to download the URL. The BITS Upload Protocol client enters STATE_INIT.

  2. The BITS Upload Protocol client proceeds to STATE_SIZE and sends a HEAD-REQUEST to the origin server.

  3. Server replies with HEAD-RESPONSE containing the timestamp and length of the URL.

  4. The BITS Upload Protocol client proceeds to SEARCH and issues a searchRequest to BPCR.

  5. BPCR Client creates a new FileSearchRequest element object in INIT state. The FileSearchRequest element proceeds to CHOOSE_SERVER.

    Because the peer list is empty and F_DISCOVERED element is initially false, the FileSearchRequest element proceeds to DISCOVER_SERVERS state. The client triggers a peer-discovery request as described in [MS-BPDP] section 3.2.6.4, and sets F_DISCOVERED element to true. The BPDP client sends a WS-Discovery Probe request.

  6. The BPDP server receives the Probe message. Because the server is in the same domain, it replies with a Probe-Match message.

  7. BPCR Client adds the server to its Table of Servers element, creates a new FileDiscoveryAttempt element entry, and sends a DISCOVERY-REQUEST message.

  8. BPCR Server does not recognize the client certificate, so it responds with CertificateNotFound, which maps to RESULT_CLIENT_CERT_UNKNOWN. The FileDiscoveryAttempt element is deleted.

  9. BPCR client calls the ExchangePublicKeys method, sending its local public key.

  10. BPCR server verifies that the client’s Kerberos identity matches the certificate information, then replies with its public key.

  11. BPCR Client verifies that the server’s Kerberos identity matches its certificate information, then sets the "Authenticated" field of the server to true. It creates a new FileDiscoveryAttempt element record and sends the DISCOVERY-REQUEST to the server.

  12. BPCR Server recognizes the client’s certificate but does not have the request content. It replies with a DISCOVERY-RESPONSE message with status ContentNotFound.

  13. BPCR client removes the FileDiscoveryAttempt element, and the FileSearchRequest element enters WAIT state. After the FileSearchRequest element times out, the BPCR client reports to BUP that the FileSearchRequest element has terminated.

  14. The BITS Upload Protocol Client creates a row in Table of Contents with RECORD_ID equal NULL, as described in [MC-BUP] section 3.6.5.2.3. BITS Upload Protocol Client switches to DOWNLOAD state and downloads from the origin server until the URL is completely downloaded.

  15. The BITS Upload Protocol Client signals the application that the download is complete.

  16. Application adds the content to the BPCR server cache.