Concept

1

Protocols

 


Lab network: Distributed Cache for network files

2

After clients join the domain, export the settings of Windows Firewall with Advanced Security to a file, e.g. fw.wfw.

Create a Active Directory OU and move the client computer objects into it.

4


Create a GPO:BranchCacheGPO and link it to BRANCH OU

5

Edit the BranchCacheGPO with the following settings:

6

Configure BranchCache for network files

7

 

3

Enable "Allow or disallow use of the Offline Files feature" by GPO (offline files feature is by default enabled in Windows 7.)

Computer Configuration\Policies\Administrative Templates\Network\Offline Files

9


Add BranchCache Feature

10

Add role: file server

7

Default Domain Controller Policy--because only the domain controller works as content server in this lab. For several member servers work as content servers, you should create a OU and link a GPO to it.

18

HKLM\System\CurrentControlSet\Service\LanmanServer\Parameters.

HashStorageLimitPercent:1

Create a shared folder with necessary permissions and select "Enable BranchCache"

11

12

Create a shared folder with necessary permissions and without "Enable BranchCache"

13


W7Ent.test.com client computer

netsh branchcache show status all

14

The Active Current Cache Size = 0 Bytes

Create a mapped drive to \\msir2\camtasia

Offline a file by selecting "Always available offline"

To see whether the "BranchCache for network files" works or not, you should use "Netsh branchcache show localcache". You should use the performance monitor.

21

If the SMB BranchCache counters are all 0, please make sure that branchcache for http works. Try to disable the firewall if still not working.

Please don't use the same folder for testing SMB branchcache and http branchcache.


Create a simple web page

20

HTTP://msir2/default.html

When you download a file, IE8-WindowsServer2003-x64-ENU.exe, it is branchcached.

19

The following two screenshots show that when you download same package from the website and save it as a different name, it downloads super fast because it is from local cache.

same1

same2

"Active Current Cache Size" is empty. Why?

The file server has problem. You can find that the error is recorded in the event viewer.

Event Viewer/Applications and Services Log/Microsoft/Windows/BranchCache/Operational

Error:

The BranchCache service cannot start because the HTTP namespace used for serving content to requesting clients is not reserved.
Run the command "netsh branchcache set service" from an elevated comman

Solution:

netsh branchcache set service local


Change the default localcache location

netsh branchcache set localcache directory=C:\BranchCache\Localcache

reset to default location

netsh branchcache set localcache DEFAULT


Check Offline files content

Control Panel and Sync Center

By default, %windir%\csc is the offline folder location. You can change it.

delete old cache

takeown /r /f c:\windows\csc
rd /s c:\windows\csc


Windows 2008 R2 as workstation

To support the branchcache feature, you must install the branchcache feature and desktop experience


Hosted Cache Mode

My lab has one domain controller (windows 2008 R2 Enterprise), a member server (Windows 2008 R2 Enterprise), and a workstation (Windows 7 Enterprise)

Domain controller:

Add Branchcache feature

Add File Server Role

Add Role services: BranchCache for network files

Add role: Active Directory Certificate Services -- Hosted Cache Server must have a certificate.

Export the Enterprise Root CA certificate

Trusted Root Certificate Authorities --Import the CA certificate

All members of the domain trust the certificate authorities.

create a shared folder with cache option: Branchcache

Member server:

GPO

Computer Configuration-Plicies-Administrative Templates-Network-Lanman Server

--Hash Publication for BranchCache: Enable --Allow hash publication for file shares targeted with branchcache support

Install BranchCache Feature

netsh branchcache set service mode=HOSTEDSERVER

Request a computer certificate

MMC--add certificate snapin for computer account

22

Link the certificate to BranchCache

23

79a031983990547611668df3657fa5656e092aef

In command prompt:

NETSH HTTP ADD SSLCERT IPPORT=0.0.0.0:443 CERTHASH=79a031983990547611668df3657fa5656e092aef APPID={d673f5ee-a714-454d-8de2-492e4c1bd8f8}

Resize the cache on the Hosted Cache server

By default, BranchCache allocates 5% of the active partition on the Hosted Cache server.

netsh branchcache set cache size=30 percent=true

Hosted Cache Server Ports

The Hosted Cache accepts connections from BranchCache clients on two ports. TCP Port 80 is used to accept connections from clients that are seeking to download cached data using the BranchCache retrieval protocol. Port 443 is used to accept connections from clients that are seeking to upload data to the Hosted Cache using the Hosted Cache protocol.

You can modify the default port numbers if you want. The instruction is on Microsoft site.

workstation:

Computer Configuration/Policies/Administrative Templates/Network/BranchCache