# OSD Toolkit & well connected sites

The OSD Toolkit is designed to allow Peer-to-peer (P2P) at background speeds as well as high speeds using the Turbo features. However, in some cases the speed is not enough or cannot be used as intended. A download from a unused local server will typically run at around 1000Mb/s, which is very fast, therefore a speed that we have gotten used to. If this server is shared across 10 concurrent downloads though, the theoretical speed is divided by 10, which is 100Mb/s. This speed is typically lower than the P2P speed that can be achieved, so when speed is this low, it makes sense to use P2P and not hammer the server.

The OSD Toolkit has advanced logic which is designed for allowing;

1. Use the server directly for locations where there are servers, still filling up BranchCache or other P2P technologies, but using them in a local mode instead, which improves speed.
2. Detect when speeds from local servers are low, then dynamically enabling peer-to-peer.

This allows for the following scenarios to be improved;

1. A single machine is built at a main office/build center with good local servers, but the machine is to be shipped to a location where no servers are available, so we want to fill up the BranchCache cache. In  this case the machine uses local BranchCache mode, and just fills up it's own disk, but still downloading at close to wire speed.
2. In a situation where 500 machines are to be built at the same time, in this case the local P2P speeds will greatly outnumber any server capabilities, so here we dynamically enable peer-to-peer.
3. It allows the best of both worlds, fast server speeds when available and P2P when required as the server is busy.

### What is well connected anyway?

Well connected is a term borrowed from the StifleR product set which means a "well connected site" either has good enough bandwidth to servers that are typically locally to the site itself. But even a site with 200Mb/s can be considered "well connected".

#### How can I determine if a site has local servers?

In our world, this is done by StifleR, in your world, we don't know, but you can still benefit from the functionality by setting the right task sequence values if you find out when you have local servers or not.

### Local Mode

The local mode means the client does not query the network, instead it builds it's own cache over time, just like a read only file cache. Once the machine is switched to any other mode, this cached data can be served to other peers.

### How do I control this?

The following task sequence variables control this behavior.&#x20;

#### The WellConnected2PS Task Sequence Variable

If the task sequence variable: **WellConnected2PS**  variable is set to "true" the binaries will treat this location as well connected by default and set BranchCache to local mode for any download. If the speed from the server goes below 100Mb/s after 5s of transfer time, the machine switches to distributed mode.

If the package has more than 100 files, local mode is automatically enabled as 100 files will never peer to peer well.

#### What if you do not want the mode to be switched from Local to Distributed mode?

1. Set the task sequence variable **WellConnected2PSDisable** to **"true".** \
   **or**&#x20;
2. Set the task sequence variable **WellConnected2PSKiloBitLimit** to something under the value of 100 \* 1024.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.2pintsoftware.com/osd-toolkit/introduction/the-2pint-alternate-content-provider/osd-toolkit-and-well-connected-sites.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
