|
目前,国内主流运营商纷纷上马volte。而volte采用了开放的sip协议作为主要通信协议,因此了解sip对掌握volte是非常重要的。
小编特此原创整理了一篇分析文档,教新手怎么去分析一个volte的invite请求消息。希望对新手有所帮助。
这个INVITE消息是从实际网络的pcap抓包中,替换了运营商的一些隐私信息后得到的。
以下是该txt文档的全部内容:
Frame 1: 1473 bytes on wire (11784 bits), 1473 bytes captured (11784 bits)
Ethernet II, Src: 1a:04:96:a9:72:47 (1a:04:96:a9:72:47), Dst: CiscoInc_41:52:ca (00:22:56:41:52:ca)
Internet Protocol Version 4, Src: 10.1.1.88, Dst: 200.1.1.1
User Datagram Protocol, Src Port: 5060 (5060), Dst Port: 5080 (5080)
Session Initiation Protocol (INVITE)
Request-Line: INVITE tel:+8613901054321 SIP/2.0
Method: INVITE
Request-URI: tel:+8613901054321
Request-URI Host Part: \n
[Resent Packet: False]
Message Header
Content-Length:394
From:<sip:+8613901012345@ims.mnc00x.mcc460.51xuetongxin.com;user=phone>;tag=e_cC73ZDU77Z3Xhb
SIP from address: sip:+8613901012345@ims.mnc00x.mcc460.51xuetongxin.com;user=phone
SIP from address User Part: +8613901012345
SIP from address Host Part: ims.mnc00x.mcc460.51xuetongxin.com
SIP From URI parameter: user=phone
SIP from tag: e_cC73ZDU77Z3Xhb
To:<tel:+8613901054321>
Via:SIP/2.0/UDP 10.1.1.88:5060;branch=z9hG4bKghC676Vi82_2X39A
Transport: UDP
Sent-by Address: 10.1.1.88
Sent-by port: 5060
Branch: z9hG4bKghC676Vi82_2X39A
Call-ID:ACD5714EAFF9E37FF90FA260@0170ffffffff
CSeq:1 INVITE
Sequence Number: 1
Method: INVITE
Max-Forwards: 70
Route:<sip:cscf1.bj.51xuetongxin.com:5080;lr>
Route URI: sip:cscf1.bj.51xuetongxin.com:5080;lr
Route Host Part: cscf1.bj.51xuetongxin.com
Route Host Port: 5080
Route URI parameter: lr
Record-Route:<sip:AAQAAAVJwAABwAAAAugAAfFsK@10.1.1.88:5060;lr>
Record-Route URI: sip:AAQAAAVJwAABwAAAAugAAfFsK@10.1.1.88:5060;lr
Record-Route Userinfo: AAQAAAVJwAABwAAAAugAAfFsK
Record-Route Host Part: 10.1.1.88
Record-Route Host Port: 5060
Record-Route URI parameter: lr
Request-Disposition:no-fork
P-Asserted-Identity:<sip:+8613901012345@ims.mnc00x.mcc460.51xuetongxin.com;user=phone;cpc=ordinary>,<tel:+8613901012345;cpc=ordinary>
SIP PAI Address: sip:+8613901012345@ims.mnc00x.mcc460.51xuetongxin.com;user=phone;cpc=ordinary
SIP PAI User Part: +8613901012345
SIP PAI Host Part: ims.mnc00x.mcc460.51xuetongxin.com
SIP PAI URI parameter: user=phone
SIP PAI URI parameter: cpc=ordinary
Session-Expires:600;refresher=uac
Min-SE:600
Contact:sip:10.1.1.88:5060
Contact URI: sip:10.1.1.88:5060
Contact URI Host Part: 10.1.1.88
Contact URI Host Port: 5060
Require:precondition
Supported:100rel,precondition,timer,norefersub
Allow:ACK,BYE,CANCEL,INFO,INVITE,OPTIONS,PRACK,REFER,UPDATE
P-Charging-Vector:icid-value=aDFHYQnMuIQnAAAAAD~MBQFwYQA-;icid-generated-at=10.1.1.88;orig-ioi=ims.mnc00x.mcc460.51xuetongxin.com
P-Early-Media:supported
Content-Type:application/sdp
Content-Disposition:session;handling=required
Message Body
Session Description Protocol
Session Description Protocol Version (v): 0
Owner/Creator, Session Id (o): - 0 0 IN IP4 172.24.9.2
Owner Username: -
Session ID: 0
Session Version: 0
Owner Network Type: IN
Owner Address Type: IP4
Owner Address: 172.24.9.2
Session Name (s): -
Connection Information (c): IN IP4 172.20.11.2
Connection Network Type: IN
Connection Address Type: IP4
Connection Address: 172.20.11.2
Time Description, active time (t): 0 0
Session Start Time: 0
Session Stop Time: 0
Media Description, name and address (m): audio 1226 RTP/AVP 96 97
Media Type: audio
Media Port: 1226
Media Protocol: RTP/AVP
Media Format: DynamicRTP-Type-96
Media Format: DynamicRTP-Type-97
Bandwidth Information (b): AS:29
Bandwidth Modifier: AS [Application Specific (RTP session bandwidth)]
Bandwidth Value: 29 kb/s
Media Attribute (a): rtpmap:96 AMR/8000
Media Attribute Fieldname: rtpmap
Media Format: 96
MIME Type: AMR
Sample Rate: 8000
Media Attribute (a): fmtp:96 mode-set=0,1,2,3,4,5,6,7; mode-change-period=2; mode-change-neighbor=1; max-red=0
Media Attribute Fieldname: fmtp
Media Format: 96 [AMR]
Media format specific parameters: mode-set=0,1,2,3,4,5,6,7
Media format specific parameters: mode-change-period=2
Media format specific parameters: mode-change-neighbor=1
Media format specific parameters: max-red=0
Media Attribute (a): rtpmap:97 telephone-event/8000
Media Attribute Fieldname: rtpmap
Media Format: 97
MIME Type: telephone-event
Sample Rate: 8000
Media Attribute (a): ptime:20
Media Attribute Fieldname: ptime
Media Attribute Value: 20
Media Attribute (a): maxptime:20
Media Attribute Fieldname: maxptime
Media Attribute Value: 20
Media Attribute (a): curr:qos local none
Media Attribute Fieldname: curr
Media Attribute Value: qos local none
Media Attribute (a): curr:qos remote none
Media Attribute Fieldname: curr
Media Attribute Value: qos remote none
Media Attribute (a): des:qos mandatory local sendrecv
Media Attribute Fieldname: des
Media Attribute Value: qos mandatory local sendrecv
Media Attribute (a): des:qos none remote sendrecv
Media Attribute Fieldname: des
Media Attribute Value: qos none remote sendrecv
分析技巧及关键字段解析:
一:SIP包头
1)Max-Forwards: 70 :说明这是UE发给P-CSCF的,该值类似于TTL用于防止环路,初始值是70。结合Method=INVITE,知道这是一个UE发出的初始Invite消息。
2)Request-Line tel:+8613901054321:这是用于路由的被叫号码,tel-uri格式。后续需要发给eNUM服务器翻译成SIP-URI完成IMS网络中的路由。
3)Route:<sip:cscf1.bj.51xuetongxin.com:5080;lr>:代表INVITE消息的路由的下一跳是发给cscf1.bj.51xuetongxin.com这个节点,这是一个sip-uri,经过DNS解析后得到的应该是P-CSCF的IP地址,也就是目的IP:200.1.1.1。
4)Via:SIP/2.0/UDP 10.1.1.88:5060。UE把自己的地址写到Via头域,Via头域决定Invite消息的响应(1xx、2xx等)如何路由。
5)Call-ID:可以用于作为过滤条件,过滤一个完整的该用户的Dialog。
6)Record-Route: 10.1.1.88:5060,发送方(这里是UE)将自己的地址写进去,决定了后续的SIP请求消息应如何路由。接收端给发送方发后续的SIP请求消息时,会把从接收端收到的Record-Route头域中的值复制到Route头域,并根据该地址进行路由。(所以,Via头域用于SIP响应消息的路由,Record-Route头域用于SIP请求消息的路由,这是根本的不同)。
7)Contact:sip:10.1.1.88:5060 是UE的联系地址。用于标明直接联系请求发送方或应答方的URI地址,使以后的请求能正确路由。Contact消息头中可以包含可选参数“display-name”,用于用户界面的显示名呈现。
8)Require和Supported头域都包含了Precondition,说明UE要求启用Precondition机制在被叫振铃前提前预留好资源(专有承载),以避免鬼振铃现象。同时隐含说明了一点,就是后续收到的第一个响应一定是带SDP的183响应而不是
180。同时前面的Supported头域包含了100rel,代表对1xx的可靠响应支持,所以针对后面收到的183,主叫UE应该回PRACK,用于对183进行确认。
9)Allow头域说明了UE侧所支持的SIP请求。
二:SDP部分
1)c line=172.20.11.2,是UE侧的RTP媒体流收发地址,现网是IPv6地址。
2)m line=audio 1226 RTP/AVP 96 97,是UE侧所期望的编码方案,写在前面代表的96优先级更高。96和97的具体内容由下面的a line来描述。1226是端口号。
3)b line=29,代表期望的媒体流的带宽是29 kb/s
4)a line=rtpmap:96 AMR/8000,代表AMR编码,采样率8000。
5)和Precondition资源预留相关的a line如下:
- curr:qos local none
- curr:qos remote none
- des:qos mandatory local sendrecv
- des:qos none remote sendrecv
curr是当前的SDP资源预留状态,none代表没准备好。资源预留好的最终状态应该是:curr:qos local sendrecv和curr:qos remote sendrecv
des是期望的SDP资源预留状态。资源预留好的最终状态应该是:qos mandatory local sendrecv和qos mandatory remote sendrecv。
分析完毕,希望这部分内容对您的VoLTE学习有用哦。
更多通信资料与视频,关注微信公众号51学通信(woyaoxuetongxin)哦。小编在那等你哦。 |
扫描并关注51学通信微信公众号,获取更多精彩通信课程分享。
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|