We will dig inside BranchCache technology and describe how the content server will cut the data into blocks and generate hashes that are required for BranchCache to function.
The content servers (your Windows web server or file share) are the source of the data that need to be cached. Think of it as the SharePoint nodes or your WSUS server.
Content servers will divide data into Segments that are big in size, and then will generate hashes for each segment ( S1, S2…etc.) . Segments are unit of discovery, and when a BranchCache client wants to access any file, it will download those segment hashes, and uses them to ask neighbor peers or the hosted cache server : does anyone have a file that is structured from segments with hashes S1,S2….Sn? .
Segments are also divided to smaller units called Blocks, and hashes for those blocks are calculated on the content server and returned to the clients (B1,B2,,etc). Once a BranchCache client gets a reply from a source on his branch that it has data with segment hash S1 for example, it will download the blocks (B1, B2,,,Bn) that construct that segment.
Think of Segments as unit of discovery and Blocks as unit of download from neighbor clients.
So why do we have Segments and each segment is divided to Blocks?. We need the unit of discovery to be big in size so that we don’t flood the network with discovery packets. That is why we use hashes of Segments to describe data. For example, if a file is 100k in size, and the Segment size is 25k, then the file is divided to 4 Segments and we only need to send 4 multicast discovery packets in the local branch subnet to discover that data ( in case of distributed cache mode).
Once that 100k file is discovered, and assuming that the block size is 5k in size, then we will download the 5*4 blocks from the cache source in the branch (each segment contains 5 blocks and we have 4 segments).
The reason why we use blocks to download data instead of segments, in case a source cache machine went down for any reason, we will still download other blocks from another source without loosing much data because the block size is small in size.
If you are interested to know more about this nice technology, come here again and filter posts with (BranchCache) tag.