jdiameter icon indicating copy to clipboard operation
jdiameter copied to clipboard

jDiameter Extension - traffic load balancing among peers & failover

Open gfigiel opened this issue 9 years ago • 14 comments

Enhancement of the jDiameter stack according to https://telestax.zendesk.com/hc/en-us/requests/33156

Basic functionality is to add load balancing among peers and failover of Diamtere traffic in case peer is not available. Failover for protocols errors according to RFC 6733, failover for ongoing session according to RFC 4006.

gfigiel avatar May 02 '16 11:05 gfigiel

For peer load balancing, we simply extended RouterImpl and did a override of method selectPeer(List<IPeer> availablePeers). A new router can be configured per stack by setting the following extension point:

  <Extensions>
     <RouterEngine value="net.toscale.jdiameter.WeightedRoundRobinRouter" />
  </Extensions>

To do AVP-based balancing, one could simply override getPeer(IMessage message, IPeerTable manager) additionally and reading the required AVPs before selecting the final peer.

If anyone is interested, I could of course share some details.

nsowen avatar May 06 '16 14:05 nsowen

@nsowen definitely interested. Can you share more details ? Do you want to contribute your extensions back to jDiameter so it benefits others ?

deruelle avatar May 06 '16 15:05 deruelle

Absolutely! I will submit some code to Github very soon

nsowen avatar May 06 '16 15:05 nsowen

Thanks @nsowen. looking forward to the pull request then ! Can you sign our Contributor License Agreement as well at https://telestax.com/open-source/#Contribute as described in our Open Source Playbook so we can accept the contribution ?

deruelle avatar May 06 '16 15:05 deruelle

Done!

nsowen avatar May 06 '16 20:05 nsowen

@nsowen received. Thanks ! Looking forward to the Pull Request !

deruelle avatar May 06 '16 20:05 deruelle

@nsowen any tentative ETA for the Pull request ?

deruelle avatar May 13 '16 10:05 deruelle

@nsowen as we started implemntation we are definitly interested in combining our requirements with your implementation. Did you have chance to go through the requirements list attached to the case mentioned by me in the issue description? As not to do the same implementation twice we will look into failover functionality while waiting for you Pull Request.

gfigiel avatar May 19 '16 21:05 gfigiel

@gfigiel Sorry to let you guys wait. I'm still facing issues on a router implementation (WeightedLeastConnectionsRouter) which currently relies on Peer-Statistics being enabled, which does not work perfect. Nevertheless, I'm not happy with it, but I will share my current progress with a pull request by lunchtime if that's ok.

nsowen avatar May 20 '16 06:05 nsowen

Great :-) We will still need some time to go deeply into jDiameter implementetion and algorithms so any help/code from you would be really greatfull :-)

gfigiel avatar May 20 '16 09:05 gfigiel

Added pull request #40 - happy to contribute at least a little bit of work ;-)

nsowen avatar May 20 '16 09:05 nsowen

Hello, Please feel free to review the further extension implementation as for PR: https://github.com/RestComm/jdiameter/pull/82

RA extension will follow.

gfigiel avatar Jan 13 '17 17:01 gfigiel

During another session of internal test I found an issue with loadbalancing algorithm. The fix will follow after next testing session is finished (this week).

gfigiel avatar Feb 14 '17 16:02 gfigiel

For peer load balancing, we simply extended RouterImpl and did a override of method selectPeer(List availablePeers). A new router can be configured per stack by setting the following extension point: <Extensions> <RouterEngine value="net.toscale.jdiameter.WeightedRoundRobinRouter" /> </Extensions>

To do AVP-based balancing, one could simply override getPeer(IMessage message, IPeerTable manager) additionally and reading the required AVPs before selecting the final peer. If anyone is interested, I could of course share some details.

Hi @nsowen , We've supplemented the WeightedRoundRobinRouter to resubmit failures due to a 3002 or 3004 Result Code to an alternate peer in the realm, while respecting the Weighted Round Robin routing algorithm. All peers are tried until the list becomes exhausted and they all returned a similar Result Code, or until one peer returns a Result Code other than 3002 or 3004.

I'd like to get this Pull Request merged, but it's just sat waiting. Perhaps if you're interested, you could give it a first review, then feed back any comments you have to me.

I'm hoping if I can get someone to review this, the barrier to getting it merged might be lowered.

Thanks so much. The Pull Request in question is #156 and this should fix #150 .

stevedwyer-nasstar avatar Jun 09 '20 16:06 stevedwyer-nasstar