[SR-Users] Dispatcher module and xavp_dst

Julien Chavanton jchavanton at gmail.com
Thu Sep 1 15:06:37 CEST 2022


Hi, did you look at the documentation of  algorithm 13 ?

The priority is used in combination with the latency to determine the
preferred gateway.
Once you confirm that this is what you want "latency latency optimized
dispatching", we can help to clarify why and how this may not work as
expected.


Regards


https://kamailio.org/docs/modules/devel/modules/dispatcher.html
-

“13” - latency optimized dispatching

- The algorithm will load balance using round-robin prioritizing the
gateways with the highest priority.

- If ds_ping_latency_stats is active the algorithm will adjust the priority
of the gateway automatically, the priority will be lowered by 1 point every
time the latency ms is as high as the priority.

- If the attribute 'cc=1' is set, the latency used is congestion ms :
estimate (current latency ms) - average (normal condition latency ms).

*Example 1.46. latency_optimized_dispatching usage*

Using this simple formula :
    ADJUSTED_PRIORITY = PRIORITY - (ESTIMATED_LATENCY_MS/PRIORITY)

GATEWAY | PRIORITY | ESTIMATED | ADJUSTED | LOAD
   #    |          |  LATENCY  | PRIORITY | DISTRIBUTION
   1    |    30    |    21     |    30    | 33%
   2    |    30    |    91     |    27    | 0%
   3    |    30    |    61     |    28    | 0%
   4    |    30    |    19     |    30    | 33%
   5    |    30    |    32     |    29    | 0%
   6    |    30    |    0      |    30    | 33%
   7    |    30    |    201    |    24    | 0%


With congestion control the formula becomes :
    CONGESTION_MS = CURRENT_LATENCY_MS - NORMAL_CONDITION_LATENCY_MS
    ADJUSTED_PRIORITY = PRIORITY - (CONGESTION_MS/PRIORITY)


-



On Thu, Sep 1, 2022 at 2:38 AM Pyry Aaltonen <pyry.aaltonen at cuuma.com>
wrote:

> Hello,
>
>
>
> I’m quite new user with kamailio (heard first time about it a year ago and
> joined the list yesterday) and now wondering how the xavp_dst should work.
>
>
>
> I had read from the documentation that
>
> ”The first XAVP is the current selected destination.”
>
>
>
> I use ds_select_dst with alg 13. And my kamailio version is kamailio 5.5.3
> (x86_64/linux)
>
>
>
> So when my dispatcher list is like (I have also tried to differ the
> priority value like 10 and 1, but doesn’t make difference)
>
> 10 sip:1.2.3.4;transport=tcp 10 1 type=type1
>
> 10 sip:4.3.2.1;transport=tcp 10 1 type=type2
>
>
>
> If one of the destinations fails (dx/ip), and it happens to be the one
> with higher priority or the one that just gets higher position in the
> dispatcher list if the prio Is equal.
>
> My xavp_$xavp(dsdst=>attrs) get null value. And, if I try to seek
> $(xavp(dsdst[0]=>attrs) or $(xavp(dsdst[1]=>attrs) I also got nothing.
>
>
>
> If both destinations are up with equal priority, it selects them with
> round-robin, and the xavp_$xavp(dsdst=>attrs) has the type value of the
> selected destination as expected, also the $(xavp(dsdst[0]=>attrs) or
> $(xavp(dsdst[1]=>attrs) contains the destinations so that the selected is
> 0 and the other is at position 1.
>
> The $du is updated as I expect so if one fails the other one is selected
> always, why the xavp_dst isn’t working same way, or am I missing something?
>
>
>
> If needed I’ll try to provide more information,
>
> Thanks already in advance
>
>
>
> -Pyry
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions
>   * sr-users at lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to
> the sender!
> Edit mailing list options or unsubscribe:
>   * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20220901/6940d56a/attachment.htm>


More information about the sr-users mailing list