Login
升级VIP 登录 注册 安全退出
当前位置: 首页 > word文档 > 合同模板 > SIPSTUN协议

SIPSTUN协议

收藏

本作品内容为SIPSTUN协议,格式为 docx ,大小 615129 KB ,页数为 14页

SIPSTUN协议


('STUN协议目录1介绍..............................................................................................................................................................22原理..............................................................................................................................................................23组网示意......................................................................................................................................................34格式..............................................................................................................................................................3Header...............................................................................................................................................3MessageTypes......................................................................................................................4Payload.............................................................................................................................................4AttributeTypes.....................................................................................................................45Client............................................................................................................................................................4Register.............................................................................................................................................4RegisterSTUNRequest........................................................................................................5RegisterSTUNResponse......................................................................................................5Register.................................................................................................................................6Invitecaller.......................................................................................................................................7InviteSTUNRequest............................................................................................................7InviteSTUNResponse.........................................................................................................8Invite.....................................................................................................................................9RTP.......................................................................................................................................9Invitecallee.....................................................................................................................................106Server..........................................................................................................................................................11BindingLifetimeDetermination.....................................................................................................12BindingAcquisitionProcedure.......................................................................................................127STUN优缺点.............................................................................................................................................13stun的优势....................................................................................................................................13stun的限制....................................................................................................................................138附录............................................................................................................................................................13NAT类型.........................................................................................................................................13ConeNat(FullCone)-完全透明NAT...............................................................................13RestrictedNat(RestrictedCone)–受限型的NAT.............................................................14PortRestrictedNat(PortRestrictedCone)–Port受限型的NAT.......................................14SymNat(Symmetric)–对称型NAT.................................................................................14参考................................................................................................................................................151介绍SimpleTraversalofUserDatagramProtocol(UDP)ThroughNetworkAddressTranslators(NATs)(STUN)isalightweightprotocolthatallowsapplicationstodiscoverthepresenceandtypesofNATsandfirewallsbetweenthemandthepublicInternet.ItalsoprovidestheabilityforapplicationstodeterminethepublicInternetProtocol(IP)addressesallocatedtothembytheNAT.STUNworkswithmanyexistingNATs,anddoesnotrequireanyspecialbehaviorfromthem.Asaresult,itallowsawidevarietyofapplicationstoworkthroughexistingNATinfrastructure.2原理私人网络通过某种机制,先取得ip然后再对应到NAT上的对外ip,如此就能够够跟PublicInternet的ip进行沟通!那么,stun的Header+Payload的内容通过NAT就不需要被修改,只需要依照NAT流程来转换Header的ipaddress即可.现在,Payload的IPAddress跟Header的IPAddress是一致的!!stun的协议确实是基于这原理来解决应用层地址转换的问题.3组网示意4格式4.1Header4.1.1MessageTypes0x0001:BindingRequest0x0101:BindingResponse0x0111:BindingErrorResponse0x0002:SharedSecretRequest0x0102:SharedSecretResponse0x0112:SharedSecretErrorResponse4.2Payload4.2.1AttributeTypes0x0001:MAPPED-ADDRESS0x0002:RESPONSE-ADDRESS0x0003:CHANGE-REQUEST0x0004:SOURCE-ADDRESS0x0005:CHANGED-ADDRESS0x0006:USERNAME0x0007:PASSWORD0x0008:MESSAGE-INTEGRITY0x0009:ERROR-CODE0x000a:UNKNOWN-ATTRIBUTES0x000b:REFLECTED-FROM5Client5.1Register1.请求注册公网地址和端口2.设置SIP头3.发起注册注意要保证注册时刻距离小于防火墙UDP包超时释放时刻。5.1.1RegisterSTUNRequest注册地址穿透防火墙后的IP:port地址请求5.1.2RegisterSTUNResponse注册地址穿透防火墙后的IP:port地址为别离设置Via,Call-ID和Contact字段5.2Invitecaller1.请求RTP和RTCP公网地址和端口2.设置SDP3.发起呼唤5.2.1InviteSTUNRequestRTP语音接收地址穿透防火墙后的IP:port地址请求5.2.2InviteSTUNResponseRTP语音接收地址穿透防火墙后的IP:port地址为设置SDPo,c和m字段5.2.3RTP5.3RTP语音接收地址callee4.收到呼唤5.请求RTP和RTCP公网地址和端口6.设置SDP7.响应呼唤方6Server从上图其实能够明白,Server会有两组ip跟port.注意,请看TestII的"绿色箭头"部份!另外,STUN的Server必然若是Public的IPAddress(实体IPAddress),如此才能够达到测试的目的.依照上图就可明白Test的进程,和哪些部份的Test需要用到Server两组ip与port做BindingRequest/Response.6.1BindingLifetimeDetermination6.2BindingAcquisitionProcedure7STUN优缺点7.1stun的优势stun协议最大的优势是不需要对现有的NAT/FW设备做任何改动.由于实际的网络环境中已有大量的NAT/FW,而且这些NAT/FW并非支持VoIP的应用,因此假设采纳MIDCOM或NAT/ALGs方式来解决此问题,那么需要改换现有的NAT/FW,这是不太容易实行的方案.除此之外,stun方式还可在多个NAT串联的网络环境中利用.这也是MIDCOM方式无法做到的.7.2stun的限制1.需要应用的程序中支持stunclient的功能.2.不适合支持TCP协议的穿越3.不支援应用协议4.无法对防火墙进行的穿越5.不支持对称型NAT(SymmetricNAT)8附录8.1NAT类型NAT细分的型态之概念说明与实例:8.1.1ConeNat(FullCone)-完全透明NAT概念说明:一个内部IP对应到相同的一个外部IP与PORT,外界可藉由另外部IP与PORT与内部IP沟通。实例说明:ClientA内部IPConeNat(FullCone)外部IPPORT1008.1.2RestrictedNat(RestrictedCone)–受限型的NAT概念说明:一个内部IP对应到相同的一个外部IP与PORT,可是内部IP需先主动对目的端的IP传送资料,目的端才能够藉由另外部IP与PORT与内部IP沟通。实例说明:ClientA内部IP外部IPPORT100外界BIP外界CIP若是B要和ClientA沟通,A需要先送封包至B的IP,然后B只需将数据送至即可。若是C要和ClientA沟通,A需要先送封包至C的IP,然后C只需将数据送至即可。8.1.3PortRestrictedNat(PortRestrictedCone)–Port受限型的NAT概念说明:一个内部IP对应到相同的一个外部IP与PORT,可是内部IP需先主动对目的端的IP与PORT传送数据,目的端才能够藉由另外部IP与PORT与内部IP沟通。实例说明:ClientA内部IP外部IPPORT100外界BIPPORT200外界CIPPORT300若是B要和ClientA沟通,A需要先送封包至B的IP及PORT(200),然后B只需将数据送至即可。若是C要和ClientA沟通,A需要先送封包至C的IP及PORT(200),然后C只需将数据送至即可。8.1.4SymNat(Symmetric)–对称型NAT概念说明:内部IP对应到一个外部IP与PORT,内部IP需先主动对目的端的IP与PORT传送资料,目的端才能够藉由另外部IP与PORT与内部IP沟通,可是只能对同一个目的端的IP与PORT。若是目的端的IP与PORT不同,内部IP对应到的外部IP与PORT也会变更,从头对应到不同的外部IP与PORT。实例说明:ClientA内部IP外部IPPORT100外部IPPORT102……外界BIPPORT200外界CIPPORT300若是B要和ClientA沟通,A需要先送封包至B的IP及PORT(200),然后B只需将数据送至即可。8.2参考rfc3489',)


  • 编号:1700665729
  • 分类:合同模板
  • 软件: wps,office word
  • 大小:14页
  • 格式:docx
  • 风格:商务
  • PPT页数:615129 KB
  • 标签:

广告位推荐

相关合同模板更多>