GPRS Detached, Attached and a PDP Context

Over at Boy Genius Report there's been a post yesterday about how to keep a data connection alive on S60 devices over some time of inactivity. Unfortunately, the conclusions drawn there are technically not quite correct. So, as there is probably some interest in the community of how always-on connections work over GPRS and UMTS from a lower layer point of view, I've put together a summary to show what is really going on.

GPRS Detached

When you power up an S60 mobile for the first time, it is usually configured to only establish what is referred to as a "packet data connection" when needed. The term "packet data connection" however, is grossly misleading. When set this way, the mobile will only attach to the voice part of the network but will not make itself known to the GPRS packet switched side of the network. An S60 device shows this state, referred to as GPRS detached, by showing a little antenna symbol below the signal strength bars at the top left of the screen.

GPRS Attached

Screenshot0055 When the "packet data connection" option is set to "when available", the mobile performs a GPRS attach procedure as soon as it is switched on. This means that the mobile in addition to becoming known to the voice part of the network also becomes known to the GPRS part of the network. An S60 device shows this state to the user by showing two little dashed horizontal arrows below the signal strength bars. If the network supports EDGE, a little E is shown in addition above the arrows. This is shown in the picture on the left. If UMTS is supported, 3G is displayed above the arrows. In this state, and this is the crucial point here, the mobile device is NOT connected to the Internet, i.e. it has no IP address. Hence, the user is not charged and it has nothing to do with always-on connectivity.

So what's the use of this state? Not a lot actually. In the past, it was envisaged that applications from the Internet could trigger an IP connection being established to the mobile device when packets for it are received. However, to the best of my knowledge, no operator has ever made use of this functionality as it is pretty much obsolete due to the real always-on connectivity described just below. It's only real benefits are that the user sees on the display if EDGE is available or not, and that Internet connections are established faster in a subsequent step because the mobile is already registered.

In terms of power consumption, being GPRS attached should not require any more power than if one only attaches to GPRS when establishing an Internet connection if the network operator has configured the network accordingly. In practice, many network operators these days use an interface between the circuit and packet switched part of the network (the Gs interface between the MSC and the SGSN) so the mobile registers only once to the network when it is powered on and not to each part of the network individually. Also, periodic location update timers are set to the same value for the circuit and packet switched part so there is no additional signaling involved for being GPRS attached.

PDP Context Activated

Once an application wants to access the Internet for the first time, an IP address is requested from the network. This procedure is referred to as "PDP (Packet Data Protocol) context activation". Once an IP address has been acquired, the horizontal arrows at the top left of the screen changes from dashed to solid. The IP connection stays in place until one of two things happen. When the user closes an application that has requested an IP connection and no other applications are still running that use the connection as well, the IP address is released and the two arrows go back to their dashed state (GPRS Attached). But until this happens, the IP address remains assigned even if the application doesn't transfer any data. There is no technical limit of how long an IP address can stay assigned without exchanging data, it can persist for days, weeks or years. In practice, however, some (but not all) operators reset all IP connections once every 24h or after some time of inactivity. There are also operators who don't have their network properly configured so it can also happen that the IP connection is dropped when moving through the network and neighbor relationships are not properly set or if a core network component (SGSN or GGSN) malfunctions and is rebooted. However, those are exceptions.

A little Mystery

In the picture on the left there is a second option in that GPRS Attached/Detached configuration menu which is called "Access Point". I am a little bit puzzled what this option could be good for as it doesn't change the behavior of my N95 no matter whether it is set to "none" per default, to an APN or to a profile name.

Summary

The summary of this somewhat long text is that the description in the Boy Genius post is not accurate. The post suggest that by changing these options, the mobile will be switched to an always-on state and that the data connection will be kept. The only thing these options do is toggle between GPRS Detached and GPRS Attached state. The assignment of an IP address (PDP context activation) is a separate procedure, completely independent of these settings.

As a consequence, the "Packet Data Connection" option does not make anything better or worse if one has an unlimited data plan, or if one is billed per kilobyte or by the minute. Since it only speeds up getting an IP address when the first application that uses a connection requests data for the very first time, the setting should be the same for all kinds of data plans: "when available".

For more details, great places to look are the GPRS service description stage 2 (3GPP TS 23.060) or the GPRS introduction Chapter 2 in my book on mobile networks.

5 thoughts on “GPRS Detached, Attached and a PDP Context”

  1. The “Access point” is for use when tethered to a computer, dialling *#99# will access this APN. Usually something like “internet.operator.com”.

  2. I suspect Tormod to be correct. And even if you are tethered, there may be other reasons you are not seeing any difference whether or not you specify and APN here: a) the fact that you have the APN set in PC Suite, b) The operator has specified your APN in your HLR profile explicitly or c) you have a wildcard APN in the HLR profile and the SGSN uses a default APN when the APN is set to empty in your phone when tethered.

  3. Hi Tormod and Jarkko,

    Interesting! That would explain why it doesn’t change anything for on device applications.

    Thanks!
    Martin

  4. Does having the PDP context active use more power?

    I guess there are also likely to be active TCP connections which will send keep-alives and ACKs even if there is no application data-flow.

    Could there also be IP broadcast/multicast traffic that the handset receives (and hence consumes more power)?

    Thanks

  5. “Does having the PDP context active use more power?”

    Not if there’s no traffic. In this case the phone goes into PMM-IDLE state and doesn’t do any signalling or updating unless a) it moves from one routing area to another, b) sends data or c) receives data. So if there are keepalives, DNS queries and the like, it will consume more power while a context is open. Otherwise no.

    Broadcast traffic is a no as the mobile is effectively on a point-to-point host link. The same would be the case for multicast.

    TCP keepalives (at TCP level) won’t do much as the timers are quite long (120 minutes by default if I remember correctly).

Comments are closed.