Starting with Resilio Connect v3.2, network policy is available to shape connections across the Agents located in different arears. Shaping is based on the Agents' tags and shall be configured in the Job profile. Only Agents of version 3.2 and newer can follow such a rule.
The idea about the network policy rules is that there's a set of preferred connections that the Agents can establish and a number of such possible connections. Each rule is configured on a separate line in the Job profile and are prioritized from top to the bottom.
A rule can be edited, moved up and down or deleted. If a rule is changed or a tag is edited, the rule is re-evaluated and all connections in this rule are re-established. Connections are also re-established if an Agent that fits a rule goes offline or online on the MC, or a new Agent is connected.
Tags need to be assigned on Agents in advance. In the examples below there will be a special tag AGENT - it is an implicit tag created and used by MC specifically for the network policy. It helps MC to uniquely identify an Agent. Don't use this tag elsewhere in scripts or jobs.
Rule syntax and connectivity
The rule is based on the tags of the Agents and the number of connections that the Agents with such tags can establish.
Two possible rule types are:
Agents with same value of a TAG_NAME are virtually split into a kind of a set. In the rule, the number defines the number of total connections that Agents from set TAG_NAME before dash can establish to other Agents from set TAG_NAME after dash, in total; or to the Agents with same TAG_VALUE.
Only online Agents can establish such connections. MC chooses such an Agents from each of the sets randomly, but balanced.
In the example from the image above, and a few more possible examples, the rules are :
It means that each Agent will establish 3 connections to three other Agents with same value of tag LAN as self.
Agents with a unique value of tag LAN will establish two connections to Agents with another (different) value of tag LAN than self. In other words, each of LANs will have two connections to another LAN. If you know that you have more LAN groups (unique values of this tag) than you configured possible connections, only the allowed number of connections will be established. In this example, if you have 4 LAN groups, some of them may not be able to connect directly, but only thought a hop. See it illustrated below. LAN groups (offices) = London, NY, Paris, Berlin. Connections may be distributed the following way:
One agent from London is connected to one agent in NY and another Agent from London is connected to one Agent Paris (totaling two allowed connections)
NY is connected to London and Paris accordingly
Paris is connected to London and NY accordingly
Berlin - is not connected to any other LAN, as all others already have 2 established connections. This is the unlikely scenario though.
Each group of Agents with same value of tag LAN will establish only one connection to Agents with tag CLOUD (any) in total, i.e. each of the LAN groups will have one connection to a cloud. In the example above, only one connection from each office (i.e. by one Agent only) will be established to a cloud storage. The choice of connected CLOUDs is random.
No connections will be established at all, if none of the Agents match the rule, for example, if a job has rule LAN-LAN:1, but all Agents have the same LAN tag.
If the network policy rules are deleted from the job, all Agents switch to standard peer discovery mechanism to discover and connect to all available Agents.
If an Agent is not connected to any other Agent in the job with a configured network rule, it reports the error "There are no other Agents to connect to within the configured network policy map. Please review the network policy rule and make sure that the configured Agents are online".
Review the rule
Administrator can check the built connections topology from a job run's overview tab. Download a json file with the topology.
Also, information about connections per the network rule policy can be seen in the Agents' connectivity matrix inside the job run.