Enabling BranchCache with Configuration Manager

Last week I wrote a post about setting up Windows PE Peer Caching.  One of the limitations of that feature is that it only works within the Windows PE portion of a build task sequence.  Once in the full OS or for deployments to established clients Peer Caching is unavailable.

Phil Wilcock, co-founder of 2Pint Software, commented and pointed out that you could use Peer Caching for getting the OS deployed and then use BranchCache within the full OS.

Now, I’ll be honest here.  I understand the “textbook” when it comes to BranchCache but I had never actually set it up.  It always seemed to fall under the, “One day I’m going to have to give that a try.”  Well that day is today.  This post will get BranchCache working with Configuration Manager.  Once that is done my next step will be getting 2Pint’s BranchCache for OSD up and running.

“Unless you try to do something beyond what you have already mastered, you will never grow.”

-Ralph Waldo Emerson

How do Configuration Manager and BranchCache work together?

One thing to keep in mind is the BranchCache is not a feature of Configuration Manager.  It is a feature of the Windows OS.  Configuration Manager is able to take advantage of BranchCache and has been able to since ConfigMgr 2007.  With ConfigMgr 2012 Microsoft made it simpler to get things set up, but in doing so may have given the impression that it is a function of ConfigMgr doing the work.  I’ll explain that later when we set things up.

Some quick definition of terms before beginning.  BranchCache has 2 modes that it can operate in, Hosted Mode and Distributed Mode.

Hosted Mode

In Hosted Mode there is a Windows server that acts as the content cache Host.  It does the work of pulling content and making it available to the clients.  Configuration Manager does NOT work with this mode of BranchCache.

Distributed Mode

With Distributed Mode you do not have a central server or host handling the caching.  Instead the caching responsibilities are distributed amongst all of the client peers.  This is like the Peer Caching in my previous posting.  It is this mode that Configuration Manager will work with.  The first client to pull content will do so across the WAN from the Distribution Point.  When other peer clients pull content they will first attempt to locate the content in the BranchCache of a peer on the same subnet.  If the content is not available on a peer it will then go across the WAN to the Distribution Point for it.

 


What is needed to use BranchCache with Configuration Manager?

Very little in fact.  Your servers will need to be running at least server 2008 R2 and clients that are at least Windows 7.  That’s it.  No special server roles.  No special hardware.  There is nothing extra that you need to add to Configuration Manager either.  There are no extra site servers or roles that need to be installed.


How do you set up Configuration Manager and BranchCache?

Lab Setup

I am going to use the same virtual lab configuration as before.  You can see how I built it through a series of posts I wrote, “Creating Your Own Personal Hydration Solution” (Part 1, Part 2, Part 3 and Part 4)

Lab Network Diagram - Full

In my prior article on Windows PE Peer Caching I used the network defined as Boundary Group 3.  Using BranchCache would be a good option to augment that setup (like Phil suggested) but since I’m hoping to next implement 2Pint’s BranchCache for OSD I’m going to instead use the network defined as Boundary Group 4.  It is the same configuration, a remote office with no Distribution Point and all content currently having to come across the WAN from the main office.

image

Setting Up BranchCache

Enable BranchCache on the Distribution Point/Points

First you are going to want to enable BranchCache on one or more of your Distribution Points in your main network.  In my case I’ll want to use DP01 since it is at the main network.  I wouldn’t want to use DP02 because being at another remote office I don’t want content coming across 2 WAN links as machines in one remote office pull content from another remote office.

First, check to see if BranchCache is already installed on the server (DP01 in my case).  You can do this either through Server Manager or via PowerShell.

image image

Open the Distribution Point properties of your DP.

image

Microsoft has made this simple to do from within the ConfigMgr console.

This is what I meant about it could give the impression that BranchCache was a feature of Configuration Manager.  Instead it is just Microsoft simplifying the process.  Just like if you enable PXE on a Distribution Point, Configuration Manager will automatically install Windows Deployment Services.  If you enable BranchCache Configuration Manager will automatically add that Windows feature.

After checking “Enable and Configure BranchCache…” click OK.  It will take a few moments to process adding the BranchCache feature on the server.  Once it is complete you can check to see if BranchCache has been enabled, again either with Server Manager or PowerShell.

image

image

 

Enable and configure BranchCache on the clients

Now that the server is set up you will next enable BranchCache on the client machines.  Group Policy is the easiest way to do this.

I created a Group Policy Object to enable and configure BranchCache and I targeted it to an OU in Active Directory that will hold the machines that I want BranchCache running on.

image

The Group Policy settings for BranchCache can be found under Computer Configuration \ Policies \ Administrative Templates \ Network \ BranchCache.

You will want to enable these two settings:

  • Turn on BranchCache
  • Set BranchCache Distributed Cache mode

image

You will also need to enable the Windows Firewall rules that allow Incoming and Outgoing BranchCache communication.  There are pre-defined rules already in Windows Firewall that you will enable.

Go to and expand Computer Configuration \ Policies \ Windows Settings \ Windows Firewall with Advanced Settings.

First, right-click the Inbound Rule node and choose New Rule…

image

 

From the pre-defined list select 1) BranchCache – Content Retrieval (Uses HTTP) and then 2) BranchCache – Peer Discovery (Uses WSD).  Enable both and set them to allow the communication.

image image

image

Repeat these steps to add the same two rules to the Outbound rules.

 

Set the deployment to use BranchCache

The final step is to make sure your deployments are configured to take advantage of BranchCache.

 

image

On the deployment you will need to enable the option “Allow clients to share content with other clients on the same subnet”.  This setting instructs ConfigMgr to take advantage of BranchCache if it is available.


How do you know if it’s working?

First you can check your client machines to make sure that your GPO has indeed enabled and configured BranchCache.  Open an Administrative command prompt and issue the following NETSH command:

NETSH BranchCache Show Status

image

Once you have verified that BranchCache is enabled and configured on your clients you are now ready to put it to the test.

I created a simple package/program and made it available to a collection of my workstations.  When setting up the deployment make sure to enable the use of BranchCache.

image

First, you are going to need to get the content into the BranchCache of one machine on the subnet.  To do this I ran the deployment on PC42a.  Since this is the first time this deployment is being run on this subnet there is obviously no other location to pull the content other than across the WAN from DP01.

image

This first retrieval of content will always come across the WAN, but once that has been completed then it sits in the cache of that first machine and those that follow will be able to retrieve it from there.

After running the deployment on PC42a you can verify that the package is cached on the machine.  To verify it look in C:\Windows\ccmcache.  There will be one or more numerical folders there.  The latest date/time stamp will be your package.  In my case that is folder “7”.

Before Running Deployment

After Running Deployment

image

image

Alright, now it’s time to put it to the test…

We’re going to use Performance Monitor on PC42b to test the use of BranchCache.  On PC42b start Performance Monitor (Run perfmon).

Expand Data Collector Sets

Right-click User Defined

Select New > Data Collector Set

image
Give it a name (like “BranchCache”) and select the option to create the collector manually.

Click Next

image
Check Performance Counter

Click Next

image
Click Add image
Expand the BranchCache counter image
Select the following 2 counters and click the Add >> button

BITS: Bytes from cache
BITS: Bytes from server

Click OK

image
Click Next image
Accept the default save location image
Accept the defaults and click Finish image

Back in Performance Monitor right-click your counter and click Start

Now, run the test deployment on PC42b.  When it is complete stop your counter.

Drill down into the Reports \ User Defined node and open your BranchCache report.

image

It should show that the content was pulled from cache vs. being pulled from the server.

[My test package was 128MB / 134,217,728 Bytes.]

 


Reference

Configuring SCCM and BranchCache

ConfigMgr 2012 and utilizing BranchCache in your environment basics

How to Configure SCCM 2012 R2 and BranchCache

BranchCache – Client Configuration

Advertisements

Posted on February 29, 2016, in 2Pint, BranchCache, Configuration Manager, Handy to Have, Hyper-V, Peer Cache, SCCM and tagged , , , , , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: