P2P

Windows Updates versus Software Distribution

For Windows Updates, Windows Update Delivery Optimization (WUDO) is a native Microsoft tool that’s a part of Windows 10. The tool is designed to reduce bandwidth by having your PCs grab updates from other peers on your network who have already downloaded the content, reducing the amount of traffic generated due to updates.

Link: https://docs.microsoft.com/en-us/windows/deployment/update/waas-delivery-optimization

For Software Distribution, Workspace ONE Peer Distribution uses the native Windows BranchCache feature that is built into the Windows operating system. This feature provides an alternative peer-to-peer technology for customers to use instead of Adaptiva.

https://docs.vmware.com/en/VMware-Workspace-ONE-UEM/services/Peer-to-Peer_Distribution_Management/GUID-8669B3A2-5C32-4590-A9FE-C2A96CE9C72D.html

Troubleshooting for Software Distribution

Credit: Phil Helming

If BranchCache does not seem to work in the environment, here is a list of items to check:

  1. BranchCache Service and Configuration

Ensure that BranchCache is enabled and set to the correct mode (Distributed, Hosted or Local) and BranchCache service is running on the device/s. To verify, follow steps in the Verifying Installation of Workspace ONE Peer Distribution (BranchCache) Profile on Device subsection.

  1. No existing policies that disables BranchCache

Profile to enable BranchCache will fail to install if there are existing policies set through GPO or VMware OS Optimization Tool on the device disabling BranchCache. Steps to check these policies are available in the Checking for Policies set through GPO or VMware OS Optimization Tool on the Device to Disable BranchCache section.

  1. Expected peer devices in same network subnet when using Distributed Mode

Verify that the devices are in the same subnet. The Workspace ONE UEM Server and CDN do not have to be in the same subnet.

  1. Device Firewall Settings
    On the Windows 10 devices, check the firewall settings and verify that the inbound and outbound rules are set to allow the required ports for peer-to-peer communication. Ensure there is no Group Policy overwriting the Firewall exceptions after BranchCache is enabled. See this page for list of required ports to allow: https://docs.vmware.com/en/VMware-Workspace-ONE-UEM/1907/Peer-to-Peer_Distribution_Management/GUID-4086C330-DE0F-4ADB-9636-C7085E257B3E.html
  2. Device Services Server – File Storage Caching Enabled

In the Workspace ONE UEM Console, navigate to Groups & SettingsAll SettingsInstallationFile Path, check that “File Storage Caching Enabled” is enabled. See this page on how to change the configuration: https://docs.vmware.com/en/VMware-AirWatch/9.3/vmware-airwatch-guides-93/GUID-AW93-FS_Enable_Reports.html

  1. Device Services Server – Content Information (Hash) Generation

The initial download request for the application triggers the BranchCache Content Information (hash) to be generated. We recommend admins send the application to one device initially (or a small subset of devices), verify the application is installed and then send to the remaining devices. This provides sufficient time for BranchCache to generate the Content Information for the application on the Device Services server.

Troubleshooting Steps

The following sections provide a set of detailed troubleshooting methods to verify BranchCache is enabled and operational in Workspace ONE UEM.

Verifying Installation of Workspace ONE Peer Distribution (BranchCache) Profile on Device

  1. On the device, run Windows PowerShell
  2. Type in Get-BCStatus
  3. Verify the following status are shown:

BranchCacheIsEnabled           : True

BranchCacheServiceStatus    : Running

ClientConfiguration:
    CurrentClientMode           : DistributedCache*

NetworkConfiguration:

    ContentRetrievalFirewallRulesEnabled  : True

    PeerDiscoveryFirewallRulesEnabled     : True

    HostedCacheServerFirewallRulesEnabled : True

HashCache:

    CacheFileDirectoryPath    : C:\Windows\ServiceProfiles\NetworkService\AppData\Local\PeerDistPub

    CurrentActiveCacheSize   : 0

DataCache:

    CacheFileDirectoryPath   : C:\Windows\ServiceProfiles\NetworkService\AppData\Local\PeerDistRepub

    CurrentActiveCacheSize  : 0

*CurrentClientMode will have the following values based on the Peer Distributed Mode selected:

Setting

Client Configuration

Distributed Mode

CurrentClientMode  : DistributedCache

Hosted Mode

CurrentClientMode  : HostedCacheClient

HostedServerList      : {server.name}

Local Mode

CurrentClientMode  : LocalCache

  1. Also check in Local Services that BranchCache is in ‘Running’ state
  2. If status is incorrect, review Workspace ONE Peer Distribution is enabled from Settings in the Workspace ONE UEM Console. Also check Assignment Group and if this device is a member of the selected Smart Group.

Verifying device policies set through Group Policy or VMware OS Optimization Tool (OSOT) on the Device do not Disable BranchCache

  1. On the device, open Registry Editor.
  2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PeerDist\Service.

Group Policy or VMware OSOT creates policy settings in this path. Values seen in the path correspond to the below key-value pairs.

Setting

Key

Value

Notes

Not Configured

None

None

PeerDist\Service registry path is not present

Enabled

Enable

1

BranchCache is enabled.

Disabled

0

BranchCache is disabled.

  1. If Disabled setting exists:
    1. Check there is no Group Policy Object created to disable BranchCache. BranchCache settings are in Computer Configuration Administrative Templates Network BranchCache. Ensure the setting in Group Policy is set to either Not Configured or Enabled.
    2. Check if using VMware OSOT that BranchCache is unchecked (disabled) in Modifications to Standard Image Disable Services BranchCache

Note: Manual editing of this registry key value will not be reflected in Group Policy. The value will be overwritten by any setting applied through GPO.

Verifying Workspace ONE Peer Distribution (BranchCache) Source URL is added in ContentManifest.XML through Registry

  1. On the device, open Registry Editor
  2. Browse for the AirWatchMDM Key: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\AirWatchMDM
  3. Take note of the target application Deployment ID from \AppDeploymentAgent\AppManifests. Check against the “Name” and “Version” in that GUID to see that you have the correct ID.
  4. Look for the corresponding Deployment ID in \AppDeploymentAgent\ContentManifests then get the value of ContentManifestXML.
  5. Verify that Source Type “P2P_BC” is present. The P2P_BC URL should have the AirWatch DeviceServices URL with “p2predirect=true” query parameter.
  6. If P2P_BC source is not present, check if CDN is enabled from Settings in the Console. Also check BranchCache profile installation on this device by following steps in the Verifying Installation of BranchCache Profile on Device subsection

Using Event Viewer to track Workspace ONE Peer Distribution (BranchCache) logs

  1. On the device, open Windows Event Viewer
  2. Navigate to Application and Service Logs → Microsoft → Windows → BranchCache → Operational
  3. Here are some log messages observed while using BranchCache

Event ID

Message

1

The BranchCache service started successfully.

2

The BranchCache service stopped successfully.

5

A BranchCache configuration change was detected.

25

The BranchCache service started and loaded a cache file from disk.

26

BranchCache saved a cache file to disk.

28

The BranchCache service is stopping.

Verifying BITS Job uses the Workspace ONE Peer Distribution (BranchCache) URL

  1. On the device, open Windows Event Viewer
  2. Navigate to Application and Service Logs → Microsoft → Windows → Bits-Client → Operational
  3. Here are some log messages observed while requesting a file through BITS

Event ID

Message

306

The BITS service loaded the job list from disk.

3

The BITS service created a new job.

59

BITS started the BITS Transfer job that is associated with the https://www.7-zip.org/a/7z1900-x64.exe URL.

60

BITS stopped transferring the BITS Transfer job that is associated with the https://www.7-zip.org/a/7z1900-x64.exe URL. The status code is 0x0.

4

The transfer job is complete.

Using Windows Performance Monitor Counters for Workspace ONE Peer Distribution (BranchCache)

BranchCache status, caching and bytes transfer between server to peer and peer to peer can be monitored through Windows Performance Monitor.

  1. On the server and device, open Performance Monitor
  2. Create a data collector set from Performance → Data Collector Sets → User Defined
  3. Right click to create New → add name → Create Manually
  4. Select Performance Counter Alert and click Next
  5. Select Add
  6. Navigate to BranchCache then add the counters (see table below for commonly used counters and their description) click Finish
  7. Select the new data collector set, right click and click Start to begin monitoring
  8. Assign applications/files to the target devices

Counter

Description

Client Performance (BranchCache Counters)

BITS: Bytes from cache

Total number of bytes received from the local cache or peers.

BITS: Bytes from server

Total number of bytes received from the original content source.

Discovery: Attempted discoveries

Total number of attempted peer discoveries.

Discovery: Successful discoveries

Total number of successful discoveries.

Retrieval: Bytes from cache

Total number of bytes received from the local cache or peers.

Retrieval: Bytes from server

Total number of bytes received from the original content source.

Retrieval: Bytes served

Total number of bytes served by this peer to other peers.

Server Performance (BranchCache Kernel Mode Counters)

BranchCache aware HTTP Requests

Total number of BranchCache aware HTTP requests received by the server.

Client Cache Miss Bytes

Total number of bytes served because content was not found within the branch.

Hash Bytes

Total number of bytes of content hashes transferred.

Projected Server Bytes Without Caching

Total number of bytes that would have been transferred if the BranchCache kernel mode component was not present.

Server Cache Miss Bytes

Total number of bytes served because hashes for the content was not currently on the server.

Total Hash Generations Accepted

Total hash generation attempts accepted.

Total Hash Retrievals Accepted

Total hash retrieval attempts accepted.

Total HTTP Requests

Total number of HTTP requests received by the server.

For a complete list of counters available, please refer to this page: https://technet.microsoft.com/en-us/library/dd637826(v=ws.10).aspx

Checking Cache Size and Location on Server and Desktop

  1. On the device, run Windows PowerShell
  2. Type in Get-BCStatus
  3. Status will show:
    1. HashCache – All information regarding the generated content information
    2. DataCache – All information regarding content shared to the device through peer distribution

Sample below:

HashCache:

    CacheFileDirectoryPath    : C:\Windows\ServiceProfiles\NetworkService\AppData\Local\PeerDistPub

    MaxCacheSizeAsPercentageOfDiskVolume : 1   

    MaxCacheSizeAsNumberOfBytes          : 10226004828

    CurrentSizeOnDiskAsNumberOfBytes     : 0

DataCache:

    CacheFileDirectoryPath   : C:\Windows\ServiceProfiles\NetworkService\AppData\Local\PeerDistRepub

    MaxCacheSizeAsPercentageOfDiskVolume : 5

    MaxCacheSizeAsNumberOfBytes          : 51130024140

    CurrentSizeOnDiskAsNumberOfBytes     : 0

            Note:

  • Cache Location

By Default, the cache location is as shown on the Sample above. The admin can change the location with the following commands:

Netsh.exe branchcache set localcache

*Use “DEFAULT” in Path to set back to default location 

Verifying Workspace ONE Peer Distribution Enablement through Server Log

  1. On the server , open the directory C:\AirWatch\Logs\DeviceServices\
  2. View the file: log
  3. List of log messages available:

Event

Log Message

Setting Configuration / Profile Assignment

BranchCache Feature Flag disabled.

“BranchCache is not enabled in OG: {OrganizationGroupID}.”

BranchCache Profile is assigned and installed on device.

“BranchCache profile installed on Device: {DeviceID}.”

Software Distribution / App Deployment

Applications will be distributed using P2P BranchCache.

“Software distribution P2P BranchCache is enabled.”

CDN is not available. Applications will be distributed using P2P BranchCache from the DeviceServices server.

“CDN is disabled. Skipping BranchCache redirect URL creation.”

Applications will be distributed using P2P Adaptiva

“Software distribution P2P Adaptiva is enabled.”

  1. Ensure the log level is set to Debug in the web.config for Device Services (C:\AirWatch\\Websites\WanderingWiFi.AirWatch.DeviceServices\Web.config)

Verifying Workspace ONE Peer Distribution Enablement through Device log

  1. On the device, open the directory C:\ProgramData\Airwatch\UnifiedAgent\Logs\
  2. View the file: log
  3. List of log messages available:

Event

Log Message

Profile Assignment/Installation

Assigned profile XML cannot be parsed by agent.

“Unable to parse P2P BranchCache profile.”

Failed to execute powershell command to enable BranchCache on device.

“Unable to install P2P BranchCache profile. “

Failed to execute PowerShell command to disable BranchCache on device.

“Unable to uninstall P2P BranchCache Profile.”

BranchCache Configuration

BranchCache enabled with mode set in Console.

“Configuring BranchCache in ‘{Distributed/Hosted/Local}’ mode”

Failed to enable Hosted Mode on device as Hosted Cache Server is not provided.

“Unable to configure BranchCache Hosted Cache mode. Empty or missing hosted cache server list.”

BranchCache disk space allotment configured to value set in Console.

” Configuring BranchCache cache size to ‘{#ofDays}’ percent of disk space”

BranchCache may be set to Disabled or ‘Cache Size’ value set in console is out of bounds.

“Invalid cache size setting. Cache size setting will not be set.”

BranchCache cache segment expiry configured to value set in Console.

“Configuring BranchCache cache segment expiry to ‘{#ofDays}’ days”

BranchCache may be set to Disabled or ‘Cache Age’ set in console is out of bounds.

“Invalid cache age setting. Cache age setting will not be set.”

Assigned profile is set to BranchCache Disabled Mode.

“Uninstalling BranchCache profile with mode ‘{Distributed/Hosted/Local}’. Resetting BranchCache to default configuration.”