Thursday, April 29, 2010

Kamailio 3.0.x - DYK-08 - udp mtu

Fallback to other transport protocol based on UDP

See also: Kamailio 3.0.x - DYK - Table of Content

Kamailio 3.0.0 offers several options to control the outgoing transport protocol based on MTU of UDP packets.

Although the RFC3261 requires to use TCP (or TLS or SCTP) if the size of UDP payload exceeds 1300 bytes, this may bring some issues with SIP UA not supporting something else than UDP. Following the high-flexibility policy with the SER and Kamailio applications, this setting is customizable as global parameter or per SIP request.

Here are the parameters if you want to control globally:
  • pmtu_discovery - set the bit for non-fragmentation to outbound packets, to enforce MTU if needed
  • udp_mtu - the size in bytes when to switch to the fallback protocol if exceeded
  • udp_mtu_try_proto - set the new transport protocol to be used if udp_mtu is exceeded
To set it on a per SIP request manner, you can use the core function:
  • udp_mtu_try_proto(proto)
Example:
pmtu_discovery = yes
udp_mtu = 1400
udp_mtu_try_proto = TCP
...
route {
...
if($rU=~"^\+49")
udp_mtu_try_proto(SCTP);
...
}
For more about this topic, see the Core Cookbook.

No comments:

Post a Comment