如何处理大型SIP数据包?
网络将对负载大于1480字节的UDP数据包进行分段,以确保通过数据包的传输不会超过MTU。
阻止分段的UDP数据包是常用的路由器策略。路由器必须将UDP消息的每个数据段保留在内存中,直到收到最后一个数据段后,才能将消息转发到。这可以通过向路由器发送不完整消息来加以利用,直到其内存已满导致路由器发生故障。因此,不包含此情况修复的路由器通常不允许分段UDP数据包。
对于不(或不能)处理UDP分段的路由器,解决方法是转换为SIP over TCP。BroadWorks可以在不同位置设置,以便在UDP、TCP或(未指定)上发送和/或期望接收。 以下是进行这些设置的不同位置:
AS_CLI/Interface/SIP> get
[…]
supportTcp = true
AS_CLI/System/Device/NetworkServers/Routing> get
Net Address Port Transport Poll OpState Description
=====================================================================
ns1.ihs.broadsoft.com tcp false enabled ns1
ns2.ihs.broadsoft.com tcp false enabled ns2
AS_CLI/System/CallP/Routing/MediaServerSelection/MediaServerDevice> get
Net Address Port Transport Description
=====================================================
ms1.ihs.broadsoft.com 5060 tcp ms1
ms2.ihs.broadsoft.com 5060 tcp ms2
NS_CLI/System/Device/RoutingNE/Address> get
About to access 22 entries. Continue?
Please confirm (Yes, Y, No, N): y
Retrieving data... Please wait...
Routing NE Address Cost Weight Port Transport
=======================================================================
[…]
test3 10.2.2.2 1 99 5060 tcp
test1 10.6.6.6 1 90 5060 tcp
test2 10.1.1.1 1 90 5060 tcp
22 entries found.
许多SBC也支持UDP和TCP。某些SBC甚至可以将UDP转换为TCP。以下是ACME SD的示例配置(可指定协议的不同位置)。
sip-interface
state enabled
realm-id access
description Public to IHS ACCESS SIP Interface
sip-port
address 64.212.220.94
port 5060
transport-protocol UDP
tls-profile
allow-anonymous all
sip-port
address 64.212.220.94
port 5060
transport-protocol TCP
tls-profile
allow-anonymous all
session-agent
hostname 10.48.7.56
ip-address 10.48.7.56
port 5060
state enabled
app-protocol SIP
app-type
transport-method TCP
设备也可设置为指定协议。例如,Polycom可以设置为TCPonly、TCPpreffered,甚至允许DNS响应指定协议(DNSnaptr)
大型SIP UDP消息示例
2010.08.17 08:22:44:815 EDT | Info | Sip | +12403645153 | callhalf-171159287:1
udp 1580 Bytes OUT to 10.10.10.1:5060
INVITE sip:2403640001@10.10.10.1:5060;user=phone;transport=udp SIP/2.0
Via:SIP/2.0/UDP 10.10.10.2;branch=z9hG4bKBroadWorks.11l7pom-10.10.10.1V5060-0-13480-1064780560-1282047764815-
From:\"test-cc1 travis\";tag=1064780560-1282047764815-
To:\"Mike - Test Acct Inmon\"
Call-ID:BW082244815170810-243190739@10.10.10.2
CSeq:13480 INVITE
Contact:
Remote-Party-ID:\"test-cc1 travis\";screen=yes;party=calling;privacy=off;id-type=subscriber
RPID-Privacy:party=calling;privacy=off;id-type=subscriber
Proxy-Require:privacy
Diversion:\"Mike - Test Acct Inmon\";privacy=off;diversion-inhibited;reason=follow-me;counter=5,\"Mike - Test Acct Inmon\";privacy=off;reason=follow-me;counter=1,\"test-cc1 travis\";privacy=off;hg-cc;delay-ccm;reason=unknown;counter=1
Supported: Allow:ACK,BYE,CANCEL,INFO,INVITE,OPTIONS,PRACK,REFER,NOTIFY,UPDATE
Accept:multipart/mixed,application/dtmf-relay,application/media_control+xml,application/sdp,application/x-broadworks-call-center+xml
Max-Forwards:5
Content-Type:application/sdp
Content-Length:283
v=0
o=BroadWorks 1618137 1 IN IP4 10.10.10.2
s=-
c=IN IP4 10.10.10.2
t=0 0
m=audio 16580 RTP/AVP 0 8 18 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=rtpmap:101 telephone-event/8000
a=silenceSupp:on - - - -
a=fmtp:101 0-15
a=ptime:20
a=sendrecv