[Devel] stateless sip loadbalancer
Marcus Hunger
hunger at sipgate.de
Sun Jan 28 15:12:54 CET 2007
Hi,
following Andreas Granigs proposal
(http://www.openser.org/pipermail/users/2006-March/003289.html) for creating
a loadbalanced/redundant sip-proxy-environment, it seems to me, that it is
not possible to create a scenario with loadbalancers being stateless and
clients being behind a nat. Establishing an INVITE-dialog went well until the
callee's 200 OK had to be ACKed. At this point of the session, messages are
not routed anymore using path's information but only relying on
record-routing and record-routes lack information about natted clients. So
the only out of the box solution I am aware of is keeping the loadbalancer
stateful.
In order to circumvent this problem and enable the lb to be stateless, I
introduced a record-route uri-parameter which stores the ip-address of the
client's nat-gateway. These parameters are created by the outgoing lb, are
kept when the loose-routing sets are created by the uac and the information
there is then used to route the sip message to the client correctly by the
lb. The parameter's name is "nat_recv". When it returns in the loose routing,
it gets translated to "received" so it gets routed correctly. I am doing this
instead of naming it "received" in first place because "received" would be
interpreted by the incoming lb immediatly, so that messages would get bounced
back to the sender in some cases.
I created a patch for openser 1.1.1 which implements the described
functionality. It introduces a function for openser.cfg called
add_rr_received_param, which adds ";nat_recv=sip:[dst_ip:dst_port]" to
current record-route header field. Also it includes a function which
translates that nat_recv-parameter to "received", when it occurs in a route
header field so the packet can then be routed according to the included
information. The function hooks via register_rrcb.
Please find that patch attached. I would appreciate any comments on that very
much and would also like to hear about alternative strategies realizing the
described scenario.
Best regards, Marcus
--
Marcus Hunger - hunger at sipgate.de
Telefon: +49 (0)211-63 55 55-61
Telefax: +49 (0)211-63 55 55-22
indigo networks GmbH - Gladbacher Str. 74 - 40219 Düsseldorf
HRB Düsseldorf 39841 - Geschäftsführer: Thilo Salmon, Tim Mois
www.sipgate.de - www.sipgate.at - www.sipgate.co.uk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openser_nat_recv.patch
Type: text/x-diff
Size: 6117 bytes
Desc: not available
Url : http://openser.org/pipermail/devel/attachments/20070128/80de9d0b/openser_nat_recv.bin
More information about the Devel
mailing list