[lvs-users] IPVS SIP load balancing: real-server-started SIP dialog

Angaroni Marco marco.angaroni at italtel.com
Mon Jan 11 08:51:31 GMT 2016


I'm trying to use IPVS for load balancing SIP real-servers, since I recently discovered that IPVS has support for SIP protocol and balancing is done inspecting SIP header "Call-ID".
The scenario I'm working on is the following:

1) SIP client-1 sends message to IPVS load-balancer. The message has Call-ID-1.
2) IPVS load-balancer chooses one of the SIP real-servers and forward the message to it.
3) The SIP real-server acts as a B2B, closing the SIP dialog and re-opening a new one. So it sends out a SIP message with Call-ID-2 directed to client-2.
4) The IPVS should, from now on, send messages with Call-ID-1 or Call-ID-2 to the same real-server.

The problem is that it seems that only messages coming from external network have the Call-ID parsed and stored.
Messages in the opposite direction (real-server -> external client) seem not to change the state of the persistence-engine, so Call-ID-2 is seen (when client-2 sends back the response) as a new Call-ID and related message can go to the wrong real-server.

Any idea on how to solve this ?
I'm not familiar with the SW architecture of IPVS, but it seems that messages from inside to outside follow a different path inside IPVS "engine", and in particular they pass through function "ip_vs_out", where they are simply natted.

>From ip_vs_core.c:

1175         /*
1176          * Check if the packet belongs to an existing entry
1177          */
1178         cp = pp->conn_out_get(af, skb, &iph, 0);
1180         if (likely(cp))
1181                 return handle_response(af, skb, pd, cp, &iph);

Marco Angaroni

Internet Email Confidentiality Footer ******************************************************************************************************************************************** La presente comunicazione, con le informazioni in essa contenute e ogni documento o file allegato, e' rivolta unicamente alla/e persona/e cui e' indirizzata ed alle altre da questa autorizzata/e a riceverla. Se non siete i destinatari/autorizzati siete avvisati che qualsiasi azione, copia, comunicazione, divulgazione o simili basate sul contenuto di tali informazioni e' vietata e potrebbe essere contro la legge (art. 616 C.P., D.Lgs n. 196/2003 Codice in materia di protezione dei dati personali). Se avete ricevuto questa comunicazione per errore, vi preghiamo di darne immediata notizia al mittente e di distruggere il messaggio originale e ogni file allegato senza farne copia alcuna o riprodurne in alcun modo il contenuto. ***************** This e-mail and its attachments are intended for the addressee(s) only and are confidential and/or may contain legally privileged information. If you have received this message by mistake or are not one of the addressees above, you may take no action based on it, and you may not copy or show it to anyone; please reply to this e-mail and point out the error which has occurred. ********************************************************************************************************************************************

More information about the lvs-users mailing list