[Users] NAT ping best methods

Jerome Martin jmartin at longphone.fr
Fri Apr 27 17:40:43 CEST 2007


Hi Jayesh,

By default, nathelper will not send a SIP message but a 4-bytes quick
probe. This is not supported by many CPE devices.

In order to use the bigger/more expensive OPTIONS ping, use the
following nathelper options :

modparam("nathelper", "natping_interval", 30)
modparam("nathelper", "ping_nated_only", 1)
modparam("nathelper", "sipping_method", "OPTIONS")
modparam("nathelper", "sipping_from", "sip:pinger at OPENSER_DOMAIN")

Of course, replace the vbalues according to your own settings.
According to the RFCs, the UACs should respond 200 OK to the options
message, so this validates the NAT in both directions. I confirm that
this is the case in my settings, both linksys PAP2 or audiocodes MPXXX
gateways that we use respond 200OK to the OPTIONS keepalive. In that
scenario, it is useless to make your CPE devices send their own
keepalive messages.

Note that the traffic can be very high when you're pinging the devices
with OPTIONS messages, because all the keepalive messages are triggered
at the same time. So be carefull to select a reasonnable
natping_interval. Here, 30 seconds is really expensive in my situation,
but my openser is hacked so the keepalives are spread out in time.

If you need the keepalive to be spread out in time and not sent all at
once, look at this message thread in devel ML :

                           Subject: 
Re: [Devel] [Fwd: [Serdev]
CVS:commitlog:
sip_router/modules/nathelper
nathelper.c nathelper.h natping.c]
                              Date: 
Tue, 24 Apr 2007 19:18:06 +0300
(18:18 CEST)

Also, take a look at nathelper module documentation, because you need to
set the NAT flag so nathelper can ping NATed contacts only.

Hope this helps,
Cheers,
Jerome






More information about the Users mailing list