BranchCache | Microsoft Learn·续1
When the modified file is requested by a different client in a branch office, the new segments of the file are downloaded from the main office server and added to the distributed or hosted cache in that branch. Because of this, branch office users always receive the most recent versions of cached content.
BranchCache installation guide
You can use Server Manager in Windows Server 2016 to install either the BranchCache feature or the BranchCache for Network Files role service of the File Services server role. You can use the following table to determine whether to install the role service or the feature.
| Functionality | Computer location | Install this BranchCache element |
| --- | --- | --- |
| Content server (BITS-based application server) | Main office or cloud data center | BranchCache feature |
| Content server (Web server) | Main office or cloud data center | BranchCache feature |
| Content server (file server using the SMB protocol) | Main office or cloud data center | BranchCache for Network Files role service of the File Services server role |
| Hosted cache server | Branch office | BranchCache feature with hosted cache server mode enabled |
| BranchCache-enabled client computer | Branch office | No installation needed; just enable BranchCache and a BranchCache mode (distributed or hosted) on the client |
To install either the role service or the feature, open Server Manager and select the computers where you want to enable BranchCache functionality. In Server Manager, click Manage, and then click Add Roles and Features. The Add Roles and Features wizard opens. As you run the wizard, make the following selections:
-
On the wizard page Select Installation Type, select Role-based or Feature-based Installation.
-
On the wizard page Select Server Roles, if you are installing a BranchCache-enabled file server, expand File and Storage Services and File and iSCSI Services, and then select BranchCache for Network Files. To save disk space, you can also select the Data Deduplication role service, and then continue through the wizard to installation and completion. If you do not want to install a BranchCache-enabled file server, do not install the File and Storage Services role with the BranchCache for Network Files role service.
-
On the wizard page Select features, if you are installing a content server that is not a file server or you are installing a hosted cache server, select BranchCache, and then continue through the wizard to installation and completion. If you do not want to install a content server other than a file server or a hosted cache server, do not install the BranchCache feature.
Operating system versions for BranchCache
Following is a list of operating systems that support different types of BranchCache functionality.
Operating systems for BranchCache client computer functionality
The following operating systems provide BranchCache with support for Background Intelligent Transfer Service (BITS), Hyper Text Transfer Protocol (HTTP), and Server Message Block (SMB).
-
Windows 10 Enterprise
-
Windows 10 Education
-
Windows 8.1 Enterprise
-
Windows 8 Enterprise
-
Windows 7 Enterprise
-
Windows 7 Ultimate
In the following operating systems, BranchCache does not support HTTP and SMB functionality, but does support BranchCache BITS functionality.
-
Windows 10 Pro, BITS support only
-
Windows 8.1 Pro, BITS support only
-
Windows 8 Pro, BITS support only
-
Windows 7 Pro, BITS support only
Note
BranchCache is not available by default in the Windows Server 2008 or Windows Vista operating systems. On these operating systems, however, if you download and install the Windows Management Framework update, BranchCache functionality is available for the Background Intelligent Transfer Service (BITS) protocol only. For more information, and to download Windows Management Framework, see Windows Management Framework (Windows PowerShell 2.0, WinRM 2.0, and BITS 4.0) at /powershell/scripting/windows-powershell/install/installing-the-windows-powershell-2.0-engine.
Operating systems for BranchCache content server functionality
You can use the Windows Server 2016, Windows Server 2012 R2, and Windows Server 2012 families of operating systems as BranchCache content servers.
In addition, the Windows Server 2008 R2 family of operating systems can be used as BranchCache content servers, with the following exceptions:
-
BranchCache is not supported in Server Core installations of Windows Server 2008 R2 Enterprise with Hyper-V.
-
BranchCache is not supported in Server Core installations of Windows Server 2008 R2 Datacenter with Hyper-V.
Operating systems for BranchCache hosted cache server functionality
You can use the Windows Server 2016, Windows Server 2012 R2, and Windows Server 2012 families of operating systems as BranchCache hosted cache servers.
In addition, the following Windows Server 2008 R2 operating systems can be used as BranchCache hosted cache servers:
-
Windows Server 2008 R2 Enterprise
-
Windows Server 2008 R2 Enterprise with Hyper-V
-
Windows Server 2008 R2 Enterprise Server Core Installation
-
Windows Server 2008 R2 Enterprise Server Core Installation with Hyper-V
-
Windows Server 2008 R2 for Itanium-Based Systems
-
Windows Server 2008 R2 Datacenter
-
Windows Server 2008 R2 Datacenter with Hyper-V
-
Windows Server 2008 R2 Datacenter Server Core Installation with Hyper-V
BranchCache Security
BranchCache implements a secure-by-design approach that works seamlessly alongside your existing network security architectures, without the requirement for additional equipment or complex additional security configuration.
BranchCache is non-invasive and does not alter any Windows authentication or authorization processes. After you deploy BranchCache, authentication is still performed using domain credentials, and the way in which authorization with Access Control Lists (ACLs) functions is unchanged. In addition, other configurations continue to function just as they did before BranchCache deployment.
The BranchCache security model is based on the creation of metadata, which takes the form of a series of hashes. These hashes are also called content information.
After content information is created, it is used in BranchCache message exchanges rather than the actual data, and it is exchanged using the supported protocols (HTTP, HTTPS, and SMB).
Cached data is kept encrypted and cannot be accessed by clients that do not have permission to access content from the original source. Clients must be authenticated and authorized by the original content source before they can retrieve content metadata, and must possess content metadata to access the cache in the local office.
How BranchCache generates content information
Because content information is created from multiple elements, the value of the content information is always unique. These elements are:
-
The actual content (such as Web pages or shared files) from which the hashes are derived.
-
Configuration parameters, such as the hashing algorithm and block size. To generate content information, the content server divides the content into segments and then subdivides those segments into blocks. BranchCache uses secure cryptographic hashes to identify and verify each block and segment, supporting the SHA256 hash algorithm.
-
A server secret. All content servers must be configured with a server secret, which is a binary value of arbitrary length.
Note
The use of a server secret ensures that client computers are not able to generate the content information themselves. This prevents malicious users from using brute force attacks with BranchCache-enabled client computers to guess minor changes in content across versions in situations in which the client had access to a previous version but does not have access to the current version.
Content information details
BranchCache uses the server secret as a key in order to derive a content-specific hash that is sent to authorized clients. Applying a hashing algorithm to the combined server secret and the Hash of Data generates this hash.
This hash is called the segment secret. BranchCache uses segment secrets to secure communications. In addition, BranchCache creates a Block Hash List, which is list of hashed data blocks, and the Hash of Data, which is generated by hashing the Block Hash List.
The content information includes the following:
- The Block Hash List:
BlockHashi = Hash(dataBlocki) 1<=i<=n
- The Hash of Data (HoD):
HoD = Hash(BlockHashList)
- Segment Secret (Kp):
Kp = HMAC(Ks, HoD)
BranchCache uses the Peer Content Caching protocol and the Retrieval Framework protocol to implement the processes that are required to ensure the secure caching and retrieval of data between content caches.
In addition, BranchCache handles content information with the same degree of security that it uses when handling and transmitting the actual content itself.
Content flow and processes
The flow of content information and actual content is divided into four phases:
-
BranchCache processes: Request content
-
BranchCache processes: Locate content
-
BranchCache processes: Retrieve content
-
BranchCache processes: Cache content
The following sections describe these phases.
BranchCache processes: Request content
In the first phase, the client computer in the branch office requests content, such as a file or a Web page, from a content server in a remote location, such as a main office. The content server verifies that the client computer is authorized to receive the requested content. If the client computer is authorized and both content server and client are BranchCache-enabled, the content server generates content information.
The content server then sends the content information to the client computer using the same protocol as would have been used for the actual content.
For example, if the client computer requested a Web page over HTTP, the content server sends the content information using HTTP. Because of this, the wire-level security guarantees of the content and the content information are identical.
After the initial portion of content information (Hash of Data + Segment Secret) is received, the client computer performs the following actions:
-
Uses the Segment Secret (Kp) as the encryption key (Ke).
-
Generates the Segment ID (HoHoDk) from the HoD and Kp:
HoHoDk = HMAC(Kp, HoD + C), where C is the ASCII string "MS_P2P_CACHING" with NUL terminator.
The primary threat at this layer is the risk to the Segment Secret, however BranchCache encrypts the content data blocks to protect the Segment Secret. BranchCache does this by using the encryption key that is derived from the Segment Secret of the content segment within which the content blocks are located.
This approach ensures that an entity that is not in possession of the server secret cannot discover the actual content in a data block. The Segment Secret is treated with the same degree of security as the plaintext segment itself, because knowledge of the Segment Secret for a given segment enables an entity to obtain the segment from peers and then decrypt it. Knowledge of the Server Secret does not immediately yield any particular plaintext but can be used to derive certain types of data from the cipher text and then to possibly expose some partially known data to a brute-force guessing attack. The server secret, therefore, should be kept confidential.
BranchCache processes: Locate content
After the content information is received by the client computer, the client uses the Segment ID to locate the requested content in the local branch office cache, whether that cache is distributed between client computers or is located on a hosted cache server.
If the client computer is configured for hosted cache mode, it is configured with the computer name of the hosted cache server and contacts that server to retrieve the content.
If the client computer is configured for distributed cache mode, however, the content might be stored across multiple caches on multiple computers in the branch office. The client computer must discover where the content is located before the content is retrieved.
When they are configured for distributed cache mode, client computers locate content by using a discovery protocol that is based on the Web Services Dynamic Discovery (WS-Discovery) protocol. Clients send WS-Discovery multicast Probe messages to discover cached content over the network. Probe messages include the Segment ID, which enables clients to check whether the requested content matches the content stored in their cache. Clients that receive the initial Probe message reply to the querying client with unicast Probe-Match messages if the Segment ID matches content that is cached locally.
The success of the WS-Discovery process depends on the fact that the client that is performing the discovery has the correct content information, which was provided by the content server, for the content that it is requesting.
The main threat to data during the Request content phase is information disclosure, because access to the content information implies authorized access to content. To mitigate this risk, the discovery process does not reveal the content information, other than the Segment ID, which does not reveal anything about the plaintext segment that contains the content.
In addition, another client computer run by a malicious user on the same network subnet can see the BranchCache discovery traffic to the original content source going through the router.
If the requested content is not found in the branch office, the client requests the content directly from the content server across the WAN link.
