Priority-based routing (also called weight-based routing) is one of the simplest ways to select a route for the traffic.
Sometimes it is called static routing, because the call order is set by simple priority/weight metrics and does not change as frequently as the other types of routing (least cost routing, quality, etc).
Call routing by priority means that a call is routed according to a predetermined order, not by the cheapest price for the destination (that is, unlike least cost routing, or LCR).
This method of routing is used when it is known that a provider provides better quality for some destinations, or when for some other reason (quality, regulatory, legal, contractual, etc) a call should go in some special order.
Use case example
For example, we could configure a routing plan of the best possible quality and name it PREMIUM. In such a case, the highest-quality routes would be the most expensive, and we cannot use LCR because to do so would mean that the cheapest, lowest-quality routes would be selected first. In this particular case, priority-based or weight-based routing is the simplest solution.
Another way is to use the more complicated quality-based routing, which makes more intensive use of the system‘s resources, takes more CPU, etc, and might not be necessary in most cases.
We group our providers in the sequence which we think will give us the best quality for our PREMIUM plan. The best-quality providers are placed first. Only when they fail will the system try to route the call over the cheaper, lower-quality providers, thus giving the customer the best possible quality and a high probability that calls will still be routed, even when best providers fail. This is usually better than to drop the call if it fails on the first provider.
Usually, a smaller number for the priority/weight means the higher-quality choice—the provider which will be selected before the others.
In the example, the routing order to 34/Spain would be: Provider 3, Provider 1, Provider 2.
There could be a case when two or more providers have the same priority/weight. Here is an example.
In this example, Providers 1 and 2 both have priority/weight numbers of 2. Whenever a call over Provider 3 fails, either Provider 1 or Provider 2 will be selected randomly. When there are many calls, the probability of selecting Provider 1 or Provider 2 will be almost 50% each. It is important to note that if not many calls are being made, Providers 1 and 2 will not usually be selected alternately, like 1-2-1-2-1-2. This is because systems are usually stateless and do not remember the previous choice. This is done to conserve resources. In most cases, it is not necessary, and it consumes system resources and slows it down. When systems are processing many calls, a near-random order is achieved with almost a 50%–50% distribution.
The same rules apply when there are even more providers with the same weight/priority number. For example, if there are three providers with the same priority/weight number, then with a large volume of calls the distribution would be 1/3 + 1/3 + 1/3 or 33.33% + 33.33% + 33.33%. And so on.
Priority-based or weight-based routing is available in Kolmisoft softswitches and it could be considered one of the simplest routing algorithms. The benefits are a strict routing order, a low system overhead, a high degree of control, and simplicity. In some use cases, it is the best tool for the job.
- Photo by David Rangel on Unsplash