在IMS/SIP支持的VOLTE等業(yè)務(wù)中經(jīng)常要進(jìn)行控制面和用戶面數(shù)據(jù)的傳遞,那么這些數(shù)據(jù)在IP網(wǎng)絡(luò)的傳遞時(shí)就會遇到TCP/UDP端口的選擇問題,本文根據(jù)實(shí)際舉例其選擇過程:
1.TCP/UDP應(yīng)用
如下圖所示:用戶A(UA1)首先通過CSCF發(fā)送TCP請求給用戶B(UA2),再通過CSCF發(fā)送UDP請求給用戶B(UA2)
2.場景1(注冊和應(yīng)答)
(A) Transmission Control Protocol, (B) Src Port: 50000 , (C) Dst Port: 55062 ,
REGISTER sip:one.att.net SIP/2.0
Via: SIP/2.0/TCP [3000::2:5547:21cb:7edf:9962]:(D)50001;
branch=z9hG4bK44ccabd6a7f33104360e9ae78ce1ac0d;rport
Max-Forwards: 70
Contact: <sip:310410123456789@[3000::2:5547:21cb:7edf:9962]:(E)50001;(F) transport=tcp>;
+g.3gpp.smsip;
+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel";
+sip.instance="<urn:gsma:imei:00440224-264925-0>"
To: <sip:310410123456789@one.att.net>
From: <sip:310410123456789@one.att.net>;tag=4887461765a4b2fc-d90ef734.0
Call-ID: 54df046e-10604c38-9f947b79@3000::2:5547:21cb:7edf:9962
CSeq: 2 REGISTER
Expires: 600000
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
User-Agent: IM-client/OMA1.0 TEST-IMS
Authorization: Digest username="310410123456789@private.att.net", realm="one.att.net",
nonce="1XcMbTY+MMNkpAePG/jtOm4yOzbFNdVV1XYObjNi45E=", uri="sip:one.att.net", response="7a87c22410c409ffef55ea37b41bfe4c",
algorithm=AKAv1-MD5,
cnonce="b4972c8ee817300a7ff36ed1cbd59be", opaque="09e88aef2....", qop=auth, nc=00000001
Security-Verify: ipsec-3gpp; ealg=null; alg=hmac-sha-1-96; spi-c=98765431; spi-s=87654321;
(G)port-c=55063;
(H)port-s=55062;
q=0.9,ipsec-3gpp; ealg=null; alg=hmac-md5-96; spi-c=98765431; spi-s=87654321;
(I)port-c=55063;
(J)port-s=55062;
q=0.7
P-Access-Network-Info: 3GPP-E-UTRAN-FDD; utran-cell-id-3gpp=31041000040000004
Supported: sec-agree, path
Proxy-Require: sec-agree
Security-Client: ipsec-3gpp; ealg=aes-cbc;
alg=hmac-sha-1-96; spi-c=41064354; spi-s=34933966;
(K)port-c=50000;
(L)port-s=50001;
prot=esp; mod=trans, ipsec-3gpp;
ealg=aes-cbc; alg=hmac-md5-96; spi-c=41064354; spi-s=34933966;
(M)port-c=50000;
(N)port-s=50001;
prot=esp; mod=trans, ipsec-3gpp; ealg=des-ede3-cbc;
alg=hmac-sha-1-96; spi-c=41064354; spi-s=34933966;
(O)port-c=50000;
(P)port-s=50001;
prot=esp; mod=trans, ipsec-3gpp; ealg=des-ede3-cbc; alg=hmac-md5-96;
spi-c=41064354; spi-s=34933966;
(Q)port-c=50000;
(R)port-s=50001;
prot=esp; mod=trans, ipsec-3gpp;
ealg=null; alg=hmac-sha-1-96; spi-c=41064354; spi-s=34933966;
(S)port-c=50000;
(T)port-s=50001;
prot=esp; mod=trans, ipsec-3gpp; ealg=null; alg=hmac-md5-96;
spi-c=41064354; spi-s=34933966;
(U)port-c=50000;
(V)port-s=50001;
prot=esp; mod=trans
Require: sec-agree
Content-Length: 0
(1)Transmission Control Protocol, (2)Src Port: 55062, (3)Dst Port: 50000, Seq: 1, Ack: 2279, Len: 655
SIP/2.0 200 OK
Via: SIP/2.0/TCP [3000::2:5547:21cb:7edf:9962]:(4)50001;
branch=z9hG4bK44ccabd6a7f33104360e9ae78ce1ac0d;rport
To: <sip:310410123456789@one.att.net>; tag=ATL2604_d9bc654771cd
From: <sip:310410123456789@one.att.net>;tag=4887461765a4b2fc-d90ef734.0
Call-ID: 54df046e-10604c38-9f947b79@3000::2:5547:21cb:7edf:9962
CSeq: 2 REGISTER
Contact: <sip:310410123456789@[3000::2:5547:21cb:7edf:9962]:(5)50001;(6)transport=tcp>; expires=1200
P-Associated-URI: <tel:+14251234567>
P-Associated-URI: <sip:+14251234567@one.att.net>
Service-Route: <sip:scscf.anyims.test.3gpp.com;lr>
Path: <sip:[fd29:cc43:7fb9:2:20c:29ff:fe66:b4c7];lr>
Content-Length: 0
3.數(shù)據(jù)傳遞及應(yīng)答
3.1小數(shù)據(jù)(<1300)傳遞及響應(yīng)
3.2大數(shù)據(jù)據(jù)(>1300)傳遞及響應(yīng)
3.3.被叫注冊應(yīng)答
4.場景2數(shù)據(jù)傳遞端口信息
Transmission Control Protocol, (A) Src Port: 50000 , (B) Dst Port: 55062 , Seq: 2264924161, Ack: 354, Len: 312
REGISTER sip:one.att.net SIP/2.0
Via: SIP/2.0/TCP [3000::2:5547:21cb:7edf:9962]:(C)50001;
branch=z9hG4bK44ccabd6a7f33104360e9ae78ce1ac0d;rport
Max-Forwards: 70
Contact: <sip:310410123456789@[3000::2:5547:21cb:7edf:9962]:(D)50001;(E) transport=tcp>;
+g.3gpp.smsip;
+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel";
+sip.instance="<urn:gsma:imei:00440224-264925-0>"
To: <sip:310410123456789@one.att.net>
From: <sip:310410123456789@one.att.net>;tag=4887461765a4b2fc-d90ef734.0
Call-ID: 54df046e-10604c38-9f947b79@3000::2:5547:21cb:7edf:9962
CSeq: 2 REGISTER
Expires: 600000
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
User-Agent: IM-client/OMA1.0 TEST-IMS
Authorization: Digest username="310410123456789@private.att.net", realm="one.att.net",
nonce="1XcMbTY+MMNkpAePG/jtOm4yOzbFNdVV1XYObjNi45E=", uri="sip:one.att.net", response="7a87c22410c409ffef55ea37b41bfe4c",
algorithm=AKAv1-MD5,
cnonce="b4972c8ee817300a7ff36ed1cbd59be", opaque="09e88aef2....", qop=auth, nc=00000001
Security-Verify: ipsec-3gpp; ealg=null; alg=hmac-sha-1-96; spi-c=98765431; spi-s=87654321;
(F)port-c=55063;
(G)port-s=55062;
q=0.9,ipsec-3gpp; ealg=null; alg=hmac-md5-96; spi-c=98765431; spi-s=87654321;
(H)port-c=55063;
(I)port-s=55062;
q=0.7
P-Access-Network-Info: 3GPP-E-UTRAN-FDD; utran-cell-id-3gpp=31041000040000004
Supported: sec-agree, path
Proxy-Require: sec-agree
Security-Client: ipsec-3gpp; ealg=aes-cbc;
alg=hmac-sha-1-96; spi-c=41064354; spi-s=34933966;
(J)port-c=50000;
(K)port-s=50001;
prot=esp; mod=trans, ipsec-3gpp;
ealg=aes-cbc; alg=hmac-md5-96; spi-c=41064354; spi-s=34933966;
(L)port-c=50000;
(M)port-s=50001;
prot=esp; mod=trans, ipsec-3gpp; ealg=des-ede3-cbc;
alg=hmac-sha-1-96; spi-c=41064354; spi-s=34933966;
(N)port-c=50000;
(O)port-s=50001;
prot=esp; mod=trans, ipsec-3gpp; ealg=des-ede3-cbc; alg=hmac-md5-96;
spi-c=41064354; spi-s=34933966;
(P)port-c=50000;
(Q)port-s=50001;
prot=esp; mod=trans, ipsec-3gpp;
ealg=null; alg=hmac-sha-1-96; spi-c=41064354; spi-s=34933966;
(R)port-c=50000;
(S)port-s=50001;
prot=esp; mod=trans, ipsec-3gpp; ealg=null; alg=hmac-md5-96;
spi-c=41064354; spi-s=34933966;
(T)port-c=50000;
(U)port-s=50001;
prot=esp; mod=trans
Require: sec-agree
Content-Length: 0
(1)Transmission Control Protocol, (2) Src Port: 55063, (3) Dst Port: 50001, Seq: 1302, Ack: 1, Len: 341
INVITE sip:310410123456789@[3000::2:5547:21cb:7edf:9962]:(4)50001;(5)transport=tcp SIP/2.0
Via: SIP/2.0/TCP [fd29:cc43:7fb9:2:20c:29ff:fe66:b4c7]:(6)55062; branch=z9hG4bK62b4a2938807
Via: SIP/2.0/TCP scscf.anyims.test.3gpp.com; branch=z9hG4bK74eddae782b9
Max-Forwards: 69
To: <tel:+14251234567>
From: <sip:+18472733800@one.att.net;user=phone>; tag=ATL2604_06f4d629ece8
Call-ID: 551fe04688e4
CSeq: 1 INVITE
Via: SIP/2.0/TCP caller.3gpp.org:6543;branch=z9hG4bK87ee715641bd
Record-Route: <sip:scscf.anyims.test.3gpp.com;lr>
Record-Route: <sip:[fd29:cc43:7fb9:2:20c:29ff:fe66:b4c7]:(7)55062;lr>
Supported: 100rel,precondition
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,PRACK,MESSAGE,REFER,NOTIFY
P-Asserted-Identity: <sip:+18472733800@one.att.net;user=phone>
P-Called-Party-ID: <tel:+14251234567>
Contact: <sip:+18472733800@[3000:0:0:2::1]:(8)5160>;
+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel";video
P-Asserted-Service: urn:urn-7:3gpp-service.ims.icsi.mmtel
Accept-Contact: *;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel";video
Accept: application/sdp, application/3gpp-ims+xml
Content-Length: 486
Content-Type: application/sdp
原文來自:http://www.sharetechnote.com
整理:kangguoying20201009
"按比特計(jì)流量的日子,你還記得嗎?---Byte與Bit”已在微信公眾號"跟著老康學(xué)5G"中推出,敬請關(guān)注!