Understanding the Anatomy of a Wireless Connection
Join the DZone community and get the full member experience.Join For Free
consider your smartphone. this increasingly complicated mobile device drives internet usage around the globe. according to statista , mobile phones (and this excludes tablets) accounted for 17.4% of all web traffic in 2013, up from 11.1% in 2012. some of this traffic is derived from new web users, whose smartphones provided their first access to the internet, but another segment of the increased traffic represents a change in preference: namely, the preference to surf the web from mobile phones instead of desktops.
what is it that makes mobile phones so attractive? well, the fact that they’re mobile. a cellphone is untethered, unplugged, unwired; it’s internet on the go. using your smartphone to access the internet is no different than using your desktop, but you can put it in your pocket and walk down the street, right? well, that’s the hope, at least from a web developer’s perspective. web developers strive for a seamless transition where mobile end users perceive no change in performance, but many things change behind the scenes.
let’s take a look…
any device not physically connected to a network or router, but still capable of connecting with other network nodes (think other cellphones or apple tv) falls under the category of wireless. a very incomplete list of wireless networks includes wifi, 2g, 3g, and 4g lte. while each wireless network functions in its own specific manner, focusing in on one may be helpful to understand current advantages and limitations of wireless internet access. for instance, what happens on the 4g lte mobile network after you type a url into your smartphone browser and click “go”?
here in the u.s., smartphones communicate through radio waves and frequencies determined by the federal communications commission (fcc) and the national telecommunications and information administration (ntia) . the fcc and ntia allocate the radio spectrum for different purposes: lower frequencies (larger, farther traveling radio waves) better suit am radio, while two-way cellphone communication uses higher frequencies to transfer more data, but at the sacrifice of covering a smaller geographical area or cell.
cells are provided by cell sites, also called base stations, which are facilities that contain cellular telephone transmitters. the size of a cell can vary depending on a cell site’s transmission power and the surrounding terrain. typically, someone using their smartphone on the go will move through a honeycomb of cells and switch from cell site to cell site as they click around a website.
but making these radio connections comes at great expense to battery life, a valuable resource for mobile phones. for this reason, different states of ‘awakeness’ exist to mitigate power drain as much as possible. depending on recent activity, a smartphone’s state can range from disconnected to active or somewhere in between (idle); or in milliwatts, range from less than 15mw upwards of 3,500mw!
however, this, to a great extent, falls outside of the user’s control. instead, we place our trust in the radio resource controller (rrc), a protocol that masterminds all connections between your smartphone and a cell site, as well as dictates your device’s ‘awakeness’ state. so unlike a desktop computer, which enjoys a continuous network connection through an ethernet cable, wireless devices face a constant struggle to balance connection vs. battery life. in other words, a lower power state may prolong battery life, but it introduces unavoidable latency to reestablish a connection to the radio link. the rrc resides directly in the cell tower for 4g in effort to continue to reduce this latency.
[before we move on, a quick note to web developers: every radio transmission, regardless of size, transitions a smartphone into an active state. no amount of data is negligible because any transmission forces the device into the same battery-draining pace. therefore, best practices prescribe delivering as much data in one shot as possible, and keeping total transmissions to a minimum.]
following the initial negotiations of the rrc, a component named radio access network (ran) allocates radio spectrum and connects the hand-held device with the core network (cn), which in lte is called the evolved packet core (epc). the ran also speaks to the cn about the user’s location, a rather difficult and complicated duty since connections jump from tower to tower as a user moves or a cell saturates.
the cn carries the data packets from the ran to the worldwide web and back with the help of its own components: serving gateway (sgw) and packet data network gateway (pgw). sgw receives the packets from the cell tower and routes them to the pgw which assigns the device an ip address. the device can now communicate with the public internet and ultimately reach the servers housing the url’s content.
the desired data then begins its return journey. it first returns to the pgw, becomes encapsulated and receives scrubbing for quality of service. the packets continue back to the sgw, which in turn works with (this is last acronym, i promise!) the mobility management entity (mme) . the mme provides the serving gateway with location data, allowing the sgw to route the packets to the ran and, finally, to your phone.
one note on the return path: another battle between battery life and latency can occur if your smartphone settles into an idle state: as mentioned above, the sgw actually does not know the exact location of the device it must route the packets back to, but instead uses a logical grouping of cell towers to maintain only an idea of the user’s location, asking the mme to help it pinpoint the device. this is in order to avoid draining a device’s power.
in order to discern a device’s exact location, the radio base station must speak with the device, and as we know, that means an active state and many mw on behalf of the device. the sgw’s logical grouping process permits the smartphone to nap and save power, only waking periodically to listen for a broadcast from nearby towers. if the mme does not know the smartphone’s location, it pages the towers, asks them to broadcast, and once the device awakes, receives its exact location. the mme then informs the sgw and the packets continue on their way.
i point this out to emphasize the simple fact that tradeoffs exist, no matter how you choose to access the internet, be it via wire or via waves. although the mobile path progression laid out above is no way comprehensive, its purpose is to highlight several of the costs and benefits of choosing mobility.
so consider your smartphone, the wireless infrastructure it relies on, and the websites it surfs. these parts must work together; and if we understand the reasoning for their designs and functions, and the resulting latencies, it may help us improve mobile experience and better address the growing trend of mobile internet usage.
Published at DZone with permission of Mehdi Daoudi, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.