1 / 22

SIP 体系架构

SIP 体系架构. Agenda. 对 SIP 方方面面的回顾 SIP 在协议栈中的位置 SIP 梯形和 SIP 实体 SIP URI tel URI SIP 分层方法 dialog session 安全. SIP 标准. 核心标准: RFC 3261 SIP: Session Initiation Protocol SIP 扩展标准: RFC 2976 The SIP INFO Method RFC 3263 Locating SIP Servers

Télécharger la présentation

SIP 体系架构

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SIP 体系架构

  2. Agenda • 对SIP方方面面的回顾 • SIP在协议栈中的位置 • SIP梯形和SIP实体 • SIP URI • tel URI • SIP 分层方法 • dialog • session • 安全

  3. SIP标准 核心标准: RFC 3261 SIP: Session Initiation Protocol SIP扩展标准: RFC 2976 The SIP INFO Method RFC 3263 Locating SIP Servers RFC 3265 SIP-Specific Event Notification RFC 3311 UPDATE Method RFC 3326 The Reason Header Field RFC 3372 SIP for Telephones (SIP-T): Context and Architectures RFC 3398 ISUP to SIP Mapping RFC 3428 SIP Extension for Instant Messaging ……

  4. SIP在协议栈中的位置

  5. SIP梯形 一个典型的网络结构,SIP trapezoid SIP UA或终端构成对话的端点:它发送或接收SIP请求和响应。UA由以下两部分构成: UA Client: 发起请求的主叫方应用; UA Server:接收、重定向或拒绝请求,代表用户给到来的请求发送响应。 SIP中间服务器是SIP消息在到达其最终目的地前所经过的逻辑实体,这些中间服务器用于对请求路由和重定向。服务器包括代理服务器(Proxy Server),重定向服务器(Redirect Server)和注册服务器(Registrar)。

  6. SIP实体-重定向服务器 重定向服务器(Redirect Server) 目的:为了减少负责路由请求的代理服务器的负荷,提高信令路径的鲁棒性 实现:只是返回用户有可能出现的位置列表,由用户代理去进行用户定位的所有尝试。 位置列表将放置在Contact头域中。 响应的3XX类有: "300" ; Multiple Choices "301" ; Moved Permanently "302" ; Moved Temporarily "305" ; Use Proxy "380" ; Alternative Service

  7. SIP实体-重定向服务器 INVITE sip:victor@ultrapower.com.cn SIP/2.0Via: SIP/2.0/UDP wt100.chinamobile.com:5060From: helen li <sip:helen@chinamobile.com>To: zheng <sip:victor@ultrapower.com.cn>Call-ID: 12345678@wt100.chinamobile.comCSeq: 1 INVITEContact: helen li <sip:helen@wt100.chinamobile.com> 查询 victor@add.ultrapower.com.cn sip:helen@chinamobile.com SIP/2.0 302 Moved TemporarilyVia: SIP/2.0/UDP 192.168.0.10Via: SIP/2.0/UDP wt100.chinamobile.com:5060Call-ID: 12345678@wt100.chinamobile.comCSeq: 1 INVITEContact: victor <sip:victor@add.ultrapower.com.cn>; expires=3600 INVITE sip:victor@add.ultrapower.com.cn SIP/2.0Via: SIP/2.0/UDP wt100.chinamobile.com:5060From: helen li <sip:helen@chinamobile.com>To: zheng <sip:victor@ultrapower.com.cn>Call-ID: 12345678@wt100.chinamobile.comCSeq: 1 INVITEContact: helen li <sip:helen@wt100.chinamobile.com> SIP Request SIP Response 非SIP协议包

  8. SIP实体-代理服务器 代理服务器(Proxy Server) 目的:接收请求,决定将这些请求传送到何处,并且将它们传送到下一服务器(使用下一跳路由原理)。 • 3类代理: • 保留呼叫状态代理(Call Stateful Proxy): • 存储从INVITE到BYE的一个会话所有状态信息; • 保留状态代理((Transaction) Stateful Proxy): • 事务状态代理,存储一个指定事务相关的状态信息直到这个事务结束; • 不保留状态代理

  9. SIP实体-代理服务器 INVITE sip:victor@bjums.com SIP/2.0Via: SIP/2.0/UDP 218.80.0.10:5060From: flora <sip:flora@ultrapower.com.cn>To: zheng <sip:victor@bjums.com>Call-ID: 12345678@211.80.0.10CSeq: 1 INVITEContact: flora <sip:flora@ultrapower.com.cn>Content-Type: application/sdpv=0o=flora 2891293921 2891293921 IN IP4 211.80.0.10s=meeting INVITE sip:victor@211.136.85.58 SIP/2.0Via: SIP/2.0/UDP 211.136.1.110:5060 Via: SIP/2.0/UDP 218.80.0.10:5060From: flora <sip:flora@ultrapower.com.cn>To: zheng <sip:victor@bjums.com>Call-ID: 12345678@211.808.0.10CSeq: 1 INVITEContact: flora <sip:flora@ultrapower.com.cn>Content-Type: application/sdpv=0o=flora 2891293921 2891293921 IN IP4 192.168.0.10s=meeting SIP/2.0 180 RingingVia: SIP/2.0/UDP 211.136.1.110:5060 Via: SIP/2.0/UDP 218.80.0.10:5060 From: flora <sip:flora@ultrapower.com.cn>To: zheng <sip:victor@bjums.com>;tag=314159Call-ID: 12345678@wt100.chinamobile.comCSeq: 1 INVITEContact: victor <sip:victor@211.136.85.58> SIP/2.0 180 RingingVia: SIP/2.0/UDP 218.80.0.10:5060 SIP/2.0 200 OKVia: SIP/2.0/UDP 211.136.1.110:5060 Via: SIP/2.0/UDP 218.80.0.10:5060 From: flora <sip:flora@ultrapower.com.cn>To: zheng <sip:victor@bjums.com>;tag=314159Call-ID: 12345678@wt100.chinamobile.comCSeq: 1 INVITEContact: victor <sip:victor@211.136.85.58>Content-Type: application/sdp SIP/2.0 200 OKVia: SIP/2.0/UDP 218.80.0.10:5060 ACK sip:victor@211.136.85.58 SIP/2.0Via: SIP/2.0/UDP 218.80.0.10:5060From: flora <sip:flora@ultrapower.com.cn>To: zheng <sip:victor@bjums.com>;tag=314159Call-ID: 12345678@211.80.0.10CSeq: 1 ACKContact: flora <sip:flora@wt100.ultrapower.com.cn> SIP Request SIP Response 非SIP协议包 BYE sip:victor@211.136.85.58 SIP/2.0CSeq: 2 BYE SIP/2.0 200 OKCSeq: 2 BYE

  10. SIP实体-注册服务器(Registrar) 目的:接收UA的注册/注销请求,从位置服务器中将UA的地址信息添加/删除。 SIP特性User Mobility:用户通过将自己的AOR与某个主机地址进行明确绑定,使自己可以被联络到,从而使用户移动性成为可能。 • 注册机制 • 当UA要向注册服务器添加一个地址映射记录时,Contact域包含要增加的联系地址信息,通过Expires头部域或该地址信息的expires 参数来声明该联系地址的生命期。用户可通过一个REGISTER请求消息同时增加多个地址映射记录。 • 注销机制 • 当UA要删除一个映射记录时,可在Contact域中填写要删除的联系地址信息,并将expires参数置0, 注册服务器收到后就会删除该映射记录。 • 如果将Contact域设为“*”,且Expires头部域设为0,将会删除该用户的所有联系地址映射记录。

  11. SIP实体-注册服务器(Registrar) • 创建多个绑定的方法: • 从每一个设备发送一个REGISTER请求; • 从同一个设备发送一个与AOR有多个绑定的REGISTER请求。 刷新机制: Contact头域指明了过期参数,默认是1小时。UA应该每隔一段时间后重注册。如果UA没有刷新或明确清除该绑定,则当绑定过期时,Registrar将其直接删除。 构造注册请求消息: Request-URI: 包含注册服务器的域名信息; To : 要注册或注销的用户的逻辑地址; From: 发送注册消息者的地址记录; Contact: 要注册的联系地址信息。

  12. SIP实体-注册服务器(Registrar) REGISTER sip:add.ultrapower.com.cn SIP/2.0 Via: SIP/2.0/TCP 192.168.5.39:15926 Max-Forwards: 70 From: <sip:yun.zheng@add.ultrapower.com.cn>;tag=98ef1;epid=ea8 To: <sip:yun.zheng@add.ultrapower.com.cn> Call-ID: 7d0ec36123594451967f7e74cbee9c43 CSeq: 1 REGISTER Contact: <sip:192.168.5.39:15926;transport=tcp> Content-Length: 0 非SIP协议;比如采用LDAP,添加用户的绑定信息到位置服务器 SIP/2.0 401 Unauthorized WWW-Authenticate: NTLM realm="SIP Communications Service", targetname="helen.add.ultrapower.com.cn" WWW-Authenticate: Kerberos realm="SIP Communications Service", targetname="sip/helen.add.ultrapower.com.cn" Via: SIP/2.0/TCP 192.168.5.39:15926 From: <sip:yun.zheng@add.ultrapower.com.cn>;tag=98ef1;epid=ea8 To: <sip:yun.zheng@add.ultrapower.com.cn>;tag=C48A21874 Call-ID: 7d0ec36123594451967f7e74cbee9c43 CSeq: 1 REGISTER Content-Length: 0 SIP安全机制协定部分略去, 将在以后章节演示 SIP/2.0 200 OKVia: SIP/2.0/TCP 192.168.5.39:15926;ms-received-port=1048;ms-received-cid=4100 From: <sip:yun.zheng@add.ultrapower.com.cn>;tag=98ef1;epid=ea8 To: <sip:yun.zheng@add.ultrapower.com.cn>;Call-ID: 7d0ec36123594451967f7e74cbee9c43 CSeq: 2 REGISTERContact: <sip:192.168.5.39:1048;transport=tcp>;expires=7200 SIP Request SIP Response 非SIP协议包

  13. SIP URI • 格式:sip:用户信息@主机端口[参数][消息头] • 用户信息:用户名或电话号码 • 主机端口:域名或数字形式的网络地址和端口 • 参数:定义具体的URI参数,例如传输协议、生存时间等 • 消息头:用来传递额外信息 • 两种SIP URI: • Address-of-Record(AOR): 用于标示一个用户,例如sip:bob@nokia.com(需要DNS SRV记录来定位nokia.com域的SIP服务器) • 主机的FQDN或IP地址:例如,sip:bob@211.136.85.58,或sip:bob@workstation1.nokia.com(不需要路由解析)

  14. tel URI • 格式:一个全球号码或者本地号码 • 全球号码:遵从E.164号码规则,以”+”开始 • 本地号码:需要有电话上下文(phone-context)参数来标识号码范围 • 例如: • 全球号码:tel:+358-9-123-45678 • 具有域名上下文的本地号码:tel:45678;phone-context=example.com • 具有全球号码上下文的本地号码:tel:45678;phone-context=+358-9-123

  15. SIP分层方法 IETF坚持分层,不同模块功能相对独立,各层之间松散耦合 事务用户层(Transaction User) 事务层(Transaction) 传输层(Transport) 语法和编码层(Syntax and Encoding)

  16. SIP分层方法-事务层 事务的定义:指客户端发送到服务器的一条请求,以及服务器回送客户端的所有对该请求的响应。 目的:事务层处理应用层重传,匹配响应到请求,以及应用 层超时,以实现消息的可靠传输。 • 四个事务状态机: • INVITE客户端事务 • 非INVITE客户端事务 • INVITE服务端事务 • 非INVITE服务端事务

  17. SIP分层方法-事务层-INVITE事务 UA和Proxy都有责任保证INVITE到达下一跳。 临时应答用于阻止逐跳INVITE重传。 (1)INVITE (2)100尝试 (3)INVITE (4)INVITE (5) 100尝试 重传INVITE直到临时应答到来

  18. SIP分层方法-事务层-INVITE事务 对于非成功最终应答,每个服务器保证前一跳接收到应答并且前一跳保证承担处理应答的责任。 (1)404 Not Found (2)ACK (3)404 Not Found (4) 404 Not Found (5) ACK 重传404直到ACK到来

  19. SIP分层方法-事务用户层 目的: 当一个TU希望发送SIP请求时,它创建一个客户端事务实例,并把目的IP地址、端口号和传输协议等放在请求中一起发送。TU负责把消息可靠地发送到目的地。

  20. dialog 定义: a peer-to-peer SIP relationship between two user agents that persists for some time。 目的: 提供在通信双方之间进行路由和消息排序时所依据的必要的状态信息。 标识: 由 call identifier、local tag和remote tag组成。 对于UAC来说,本地标签就是创建对话的初始请求的From头中的tag,远端标签就是创建对话的响应的From头中的tag。UAS则相反。

  21. session 定义: A multimedia session is aset of multimedia senders and receivers and the data streams flowing from senders to receivers. 在同一个session中,一个会话者可以被不同的call邀请多次。

  22. 谢谢!

More Related