What Happens To The PDP context when going to WiFi?

I was recently asked by a colleague if a mobile device keeps its PDP context with the UMTS network or the Default Bearer with the LTE network when it goes to Wifi. In the past the question was easily answered but today there are a number of different scenarios. As I'm sure that I will be asked again in the future I decided to write down a note here for easy reference.

Let's start with UMTS to Wi-Fi. Most devices on the market today deactivate the PDP context once a connection with a Wi-Fi network has been established. In practice this means that the IP address goes away and a new one is assigned when the device establishes a new PDP context again. You can easily check this as follows: While connected to UMTS go to a web pages such as "whatismyip.com" to find out your current IP address. Then switch to Wi-Fi, reload the page and you will see a different IP address. Once done, disable Wi-Fi again, wait until 3G connectivity has been reestablished and again reload the page. Again the IP address has changed. While this behavior can be observed with most smartphones and tablets, some keep the PDP context when changing to Wi-Fi so the IP address that was assigned before switching to Wi-Fi is shown again after disabling it again.

With LTE things are different in most mobile networks. Unlike UMTS that could live with a device not having a PDP context due to its dual circuit switched / packet switched nature, LTE requires a device to always have a default bearer, i.e. an IP address. Even if data connectivity is disabled in the menu or Wi-Fi is used the device keeps the IP address in the baseband chip for future use. Again, this can be easily verified with reloading pages such as "whatismyip.com" after changing networks. Some networks however, assign two default bearers for various reasons. In such cases the second default bearer is usually used for Internet connectivity. In such a configuration the second default bearer is disconnected when switching to Wi-Fi so one will observe different IP addresses before and after using a Wi-Fi network.

Not as straight forward anymore than it used to be.