- 在线时间
- 241 小时
- 最后登录
- 2015-12-10
- 威望
- 241
- 金钱
- 118937
- 贡献
- 3011
- 注册时间
- 2011-1-20
- 阅读权限
- 200
- 主题
- 1529
- 帖子
- 4004
- 分享
- 3
- 精华
- 8
- 积分
- 126474
- 相册
- 32
|
本贴中,我们通过一个实例来了解一下GPRS网络中一个Primary PDP Context(即MS激活的第一个PDP上下文)的信令流程。通过激活PDP上下文可以建立到GPRS网络的会话连接即常说的通过GPRS网络上网。这里仅根据抓包文件进行讲解。详细的流程请参考规范TS23.060的9.2.2.1章节。同时,本论坛也会在TS23.060规范版块进行相应的翻译。 #1 MS发送Activate PDP Context Request消息给SGSN,附带的信息主要有:NSAPI=5代表是第一个PDP上下文,请求的QOS profile代表MS侧认为要访问某个应用所需要的QOS(这是由终端厂家预置的),请求的PDP地址代表请求外部PDN网络为MS分配PDP地址(如果PDP网络为IP网络,则请求的PDP地址即为IP地址,这在里面的PDP Type number=33可以看出请求的是一个IPV4地址),请求的APN代表MS想要访问的外部网络。最后是PCO字段,这是个可选字段,如果分配IP地址的方式不是由GGSN来分配,那这个PCO字段还可以携带用于分配用户地址做鉴权的用户名和口令。 #2 SGSN收到MS发过来的请求后,首先要做一个核对。因为在附着过程中,SGSN已经从HLR拿到了关于这个MS的签约数据,这个签约数据里面就有用户允许访问的APN等信息,如果SGSN发现MS请求的APN不在签约数据中,将直接拒绝这个PDP上下文的激活。流程到此就终结了。如果SGSN核对用户权限没有问题,就给GGSN发送Create PDP Context Request消息,消息中的很多IE是直接从#1中MS的激活请求消息中复制过来,并且根据规范,在Create PDP Context Request消息中,只有Tunnel Endpoint Identifier Data I、NSAPI、SGSN Address for signalling、SGSN Address for user traffic、Quality of Service Profile这4个IE为必选IE。分别为用户面TEID、NSAPI、控制面SGSN地址、用户面SGSN地址和QOS Profile。这里的TEID和SGSN地址信息均为SGSN分配,关于TEID的实例,可以参考另一篇实例帖子“GTP协议循序渐进(三)----通过实例了解TEID http://www.gprshome.com/forum.php?mod=viewthread&tid=61&extra=page%3D1 ”在包中你可以看到,有两个地址都是192.169.100.1,其实一个是用户面、一个是控制面。NSAPI=5是从MS侧复制过来的,QOS Profile并不是从MS侧的激活请求中复制过来,而是在MS请求的、HLR签约的、SGSN所能提供的三者QOS Profile中取最小值发给GGSN。其他很多IE都是有条件的或是可选的。但比较重要的还有APN、请求的用户地址等信息。另外,有些IE可发送给GGSN用于计费目的。例如RAT Type(3G用户资费高些)、IMSI、MSISDN等。 #3 GGSN在收到SGSN的激活请求后,也要做一个检查核对。包括选择模式(Selection Mode)的检查(请参考另一篇帖子Selection Mode的用途及在PDP上下文激活中的影响 http://www.gprshome.com/forum.php?mod=viewthread&tid=189&highlight=selec)、APN的检查、PDP地址类型检查等等,如果这些信息不匹配的话,GGSN将直接拒绝激活。如果检查都通过,则GGSN回送Create PDP Context Response消息给SGSN。这里最重要的就是给MS分配IP地址。携带在End User Address IE中。此例为192.168.252.130。除此以外,GGSN还会将自己所能支持的QOS Profile发给SGSN,同SGSN进行协商。Cause IE为128,代表请求接受。另外,还有一些其他的可选和有条件产生的IE,比较重要的包括NSAPI=5、用户面和控制面地址和TEID、Charging ID等。 #4 SGSN收到GGSN的激活响应后,如果是3G的话,会请求RNC建立一个用户的RAB(Radio Access Bearer)用于后续用户payload的传递,但没有抓到包省略了。在RAB建立后,SGSN给MS发送Activate PDP Context Accept消息,将分配给用户的IP地址告知MS,并且下发一个QOS Profile,这个Profile叫做协商的QOS Profile,就是MS和网络侧各节点协商的一个结果(最小值)。MS收到后将IP 地址等信息存入手机中。接下来MS就可以发起对外部PDN网络的访问了。所能享用的QOS则由得到的这个协商的QOS Profile里的参数来指定。
And here are the English version:
#1 MS send the Activate PDP context
Request message to the SGSN, with the information: NSAPI=5 on behalf of the first PDP context, the requested QOS profile on behalf of a certain QOS required by an application (preset by the terminal factory), with the MS side believing that QOS should be accessed. The requested PDP address representative shall require the external PDN network to allocate the PDP address for the MS (if the PDP is an IP network, the requested PDP address is the IP address, with the requested IPV4 address can be known as the PDP Type number = 33), requested APN represent the external network that the MS wants to access. Finally, the PCO field is an optional field, if IP adress is not assigned by the GGSN, then the PCO field can also bring the user name and password whick can be used to assign user address authentication.
# 2 SGSN on the receiving of the request sent by MS, will do a check first. Since during the attachment process, the SGSN has already got the subscription data of the MS from the HLR, with the subscription data containing the APN allowed to access by the users and other information, if the SGSN found that the MS requested APN is not in the data, PDP context
activation will be rejected. This is the end of the process. If the SGSN has checked user permissions and finds no problem, will send GGSN the Create PDP Context Request message, many IEs are directly copied from the activation of the MS # 1 request message, and according to the specifications, in the Create PDP Context Request message, only the Tunnel Endpoint Identifier Data I, NSAPI, the SGSN Address for signaling, the SGSN Address for user traffic and Quality of the
Service the Profile are Required IE. Respectively are the user plane TEID,NSAPI, control plane SGSN adress and QOS profile. Here the TEID and SGSN address infromation are allocated by SGSN, you can refer to a separate instance for the
TEID <GTP Protocol step by step (III) – instance to learn the TEID http://www.gprshome.com/forum.php?mod=viewthread&tid=61&extra=page%3D1".
In the package, you can see that there are two addresses of 192.169.100.1, in fact one is a user plane, and another the control plane. The NSAPI = 5 is copied from the MS side, while the QOS the Profile is not copied from the MS side of the activation request, but the minimum value of the QOS profile among the MS requested, the HLR signed and the SGSN provided to send to GGSN. Many other IEs are conditional or optional. But the APN, user requested address and other information are important as well. In addition, some IEs can be sent to the GGSN for billing purposes. For example, the RATs Type (3G user charges higher), IMSI, MSISDN, etc..
# 3 GGSN upon receiving the activation request of SGSN will also do a check, including the selection mode check (please refer to the <Use of Selection Mode and influence in the PDP context activation>,
http://www.gprshome.com/forum.php?mod=viewthread&tid=189&highlight=selec", APN check , and the PDP address type check, etc., if this information does not match, GGSN will directly refuse to activate. If the checks are passed, then the GGSN echo the Create the PDP Context Response message to the SGSN,. The most important thing is to assign IP addresses to MS, attached in the End User Address IE. In this case is the 192.168.252.130. Besides, the GGSNs
also will send the QOS Profile supported to SGSN, in consultation with the SGSN.Cause IE of128, on behalf of the request to accept. In addition, there are some other optional and conditional IE, including the NSAPI = 5, the user plane and control plane address and The Tunnel Endpoint Identifier, Charging ID, etc..
# 4 SGSN on receiving in activation response sent by GGSN, if it is 3G, then will ask the RNC to establish a user RAB (Radio Access Bearer) for the transfer of the follow-up user payload, but if no package caught, then omitted. After the RAB is established, the SGSN sends to the MS the Activate PDP Context Accept message, tell the MS the IP address assigned to the user, and issue the QOS Profile, which is called consultation QOS profile, that is the minimum result of consultation of each node of the MS and network side. MS on receiving the IP Address and other information will store it in the phone.
Next, the MS can initiate access to the external PDN network. The QOS that can be used will be specified by the QOS Profile parameters consulted.
|
|