GSM Phone Anatomy Latest
GSM Phone Anatomy Latest
GSM Phone Anatomy Latest
Abstract
Billions of cell phones are being used every day by an almost equally large number of users. The
majority of those phones are built according to the GSM protocol specifications and interoperate with
GSM networks of hundreds of carriers.
Despite being an openly published international standard, the architecture of GSM networks and its
associated protocols are only known to a relatively small group of R&D engineers.
Even less public information exists about the hardware architecture of the actual mobile phones
themselves, at least as far as it relates to that part of the phone implementing the GSM protocols and
facilitating access to the public GSM networks.
This paper is an attempt to serve as an introductory text into the hardware architecture of contempo-
rary GSM mobile phone hardware anatomy. It is intended to widen the technical background on mobile
phones within the IT community.
1 Foreword
This document is the result of my personal research on mobile phone hardware and system-level software
throughout the last six years.
Despite my past work for Openmoko Inc., I have never been professionally involved in any aspect of the
actual GSM related hardware of any phone. Nevertheless I have the feeling that in the wider information
technology industry, I am part of a very, very small group of people who actually understand mobile phones
down to the lowest layer.
I hope it is useful for any systems level engineer with an interest in understanding more about how mobile
phone hardware actually works.
There are no guarantees for accuracy or correctness of any part of the document. I happily receive your
feedback and corrections.
1
This document will define the terms (only for the purpose of this document) along a very clear border
in hardware architecture, as will be described in the following sections:
2.2 Smartphone
A smartphone is a phone that has a dedicated processor for the GSM protocol stack, and another (potentially
multi-core) general purpose processor for the user interface and applications. This processor is known as the
application processor (AP).
The first hardware generations of smartphones did nothing else but to put the feature phone and a PDA
into one case. The keypad and display of the baseband processor is removed. What remains of the feature
phone is a GSM modem, controlled by AT commands sent from the AP.
Each processor has its own memory (RAM and Flash), peripherals, clocking, etc. So this setup is not to
be confused with the symmetric multi-processor setups like those seen in the personal computer industry.
Later generations of smartphones have exchanged the AT command interface by various proprietary
protocols. Also, the serial line was replaced by a higher-bandwidth hardware connection such as USB, SPI
or a shared memory interface.
Due to market pressure for ever smaller phones with ever more functions, the industry has produced highly
integrated products, uniting the AP and BP inside one physical package. Further pressure on reducing cost
and PCB footprint has led to products where there is no need to have independent RAM and Flash chips for
AP and BP. Rather, a single RAM and Flash chip is divided by assigning portions of the RAM and Flash
to each of the two processors.
However, the fundamental separation between the AP and BP, each with their own memory address
space and software, remains present in all smartphones until today.
2
CALYPSO RFCLK TRF6151 GSM RF3166
Digital Baseband DCS/PCS
CLK13M
TWL3025 Transceiver RF PA
CLK32K
ABB Mixers
DSP VCO
MCU I/Q Analog PLL
DCS/PCS
GSM
SRAM BDL
BUL
Mask ROM
UART, SPI, I2C AFC Analog GSM ASM4532
I/Q Digital DCS
BSP
PCS Antenna
SPI Switch
USP
APC Analog
TSP TSP
TSP Serial
TSP Parallel
By mixing the LO frequency with the received RF signal, it generates an analog baseband signal that is
passed to the Analog Baseband (ABB) part of the modem. By mixing the output of the ABB with the LO
frequency, it generates a RF signal that is to be transmitted in the GSM frequency band.
As the receive and transmit framing has an offset of 3 TDMA frames, there is no need for a frequency
duplexer. Instead, an antenna switch is used. The switch typically is implemented using a MEMS or diode
switch. For a quad-band phone, typically a single-pole 6-throw (SP6T) switch is used: 4 for the four Rx bands
(one for each band), and 2 for Tx (where 850+900 and 1800+1900 each share one PA output, respectively).
The antenna picks up the GSM radio signal as it is sent from a GSM cell tower (properly called a Base
Transceiver Station, or abbreviated as BTS). The antenna signal first hits the antenna switch, which connects
the antenna with the Rx path for the GSM band of the to-be-received radio frequency. It is then filtered by
a bandpass to block out-of-band signals before entering a low-noise amplifier for increasing signal amplitude.
After passing the LNA, the RF signal is mixed with a frequency generated by the LO. Depending on the
LO signal, either an intermediate frequency (IF) or a direct baseband signal is produced. In modern GSM
modems, zero-IF designs with immediate down-conversion to analog baseband signals are most common.
The baseband signal is then filtered to remove unwanted images and sent as analog I/Q signals (repre-
senting amplitude and phase) to the ABB.
The ABB generates analog I/Q signals, which are filtered and passed into the mixer, where they are mixed
with the LO frequency and thus up-converted to the GSM RF band. From there, they are sent to the
transmit amplifier (RF PA) for amplification. After amplification, they traverse the antenna switch and are
transmitted by the antenna.
The LO of a GSM modem has to be synchronized very closely to that of the cell (BTS). To achieve the
required precision, a Voltage-Controlled, Temperature-Compensated Crystal Oscillator (VCTCXO) is used.
Common frequencies for this VCTCXO are 26MHz or 13MHz, as the GSM bit clock (270,833 Hz) is an
integral division (/96 or /48, respectively) of those frequencies. The tuning range of the VCTCXO is several
kHz to compensate for temperature drift.
3
3.2 The Analog Baseband (ABB)
The ABB part of a GSM modem is responsible to interface between the digital domain and the analog
domain of the GSM modem.
The analog baseband I/Q signals are potentially filtered again and digitized by an Analog-Digital converter
(ADC). The sample clocks used are typically integral multiples of the GSM bit-clock. The sample clock itself
is derived by dividing the VCTCXO of the RF frontend.
The digital I/Q samples are passed to the Digital Signal Processor (DSP) in the Digital Baseband (DBB).
To reduce the number of traces to be routed on the PCB, the samples are typically sent over some kind of
synchronous serial link.
The choice of DSP architecture largely depends on the DBB chipset vendor. Often they already have a line
of DSP cores in-house and will of course want to reuse that in their DBB chip designs. Every major DSP
architecture can be found (TI, Analog Devices, ...).
The DSP performs the primary tasks such as Viterbi equalization, demodulation, decoding, forward error
correction, error detection, burst (de)interleaving.
Of course, if actual speech data is to be communicated over the GSM network, the DSP will also have
the auxiliary task to perform the computation of the lossy speech codec used to compress the speech.
Communication between the DSP and MCU happens most commonly by a shared memory interface.
The shared memory contains both actual data that is to be processed, as well as control information and
parameters describing what to be done with the respective data.
For the receive side, the MCU will instruct the DSP to perform decoding for a particular GSM burst type,
after which the DSP will receive I/Q samples from the ABB, perform detection/demodulation/decoding and
report the result of the operation (including any decoded data) back to the MCU.
For the transmit path, the MCU will present the to-be-transmitted data and auxiliary information to
the DSP, which then takes care of encoding and sends the corresponding burst bits to the ABB (remember,
most ABB devices take care of the modulation to reduce DSP load).
4
The detailed programming information (API) of the DSP shared memory interface is a closely-guarded
secret of the baseband chip maker and is not commonly disclosed even to their customers (the actual phone
making companies).
In doing so, the baseband chip makers create a close dependency between the GSM Layer1 software
(running on the MCU) driving/implementing this API and the actual baseband chip. Whoever buys their
chip will also have to license their GSM protocol stack software.
It is thus almost impossible for an independent software vendor to get access to the DSP API documen-
tation, which the author of this paper finds extremely anti-competitive.
The specifications of the GSM proprietary On-air encryption A5/1 and A5/2 are only made available to GSM
baseband chip makers who declare their confidentiality. Implementing the algorithm in software is apparently
considered as breach of that confidentiality. Thus, the encryption algorithms are only implemented in
hardware - despite them being reverse-engineered and publicly disclosed by cryptographers as early as 1996.
Thus, the DSP in a DBB commonly has a integrated peripheral implementing the A5 encryption.
Further integrated DSP peripherals may include a viterbi hardware accelerator, a DMA capable serial
interface to the ABB and others.
The programming of those peripherals is highly device-specific and there are no industry standards.
Every DBB architecture of every supplier has its own custom register set and programming interface.
The register-level documentation for those proprietary peripherals is (like all documentation on DBB
chipsets) closely guarded by NDAs, effectively preventing the development of Free Software / Open Source
drivers for them, unless such documents are leaked by third parties.
5
However, as opposed to the DSP API documentation, the register-level documentation to the MCU
peripherals is normally provided to the cellphone manufacturers.
The synchronous part is executed synchronously to the GSM TDMA frame clock. Both CPU and DSP are
interrupted by some hardware GSM timer every TDMA frame.
The L1 synchronous part typically runs inside IRQ or FIQ context of the MCU, taking care of retrieving
data from and providing data to the DSP API.
The asynchronous part is scheduled as a normal task, potentially with high or even real-time priority. It
picks up the information provided by the L1 Sync and schedules its next actions.
The L1 async typically communicates via a message queue with the Layer2 above. Common primitives
for L1 control are described (as non-normative parts) of the GSM specifications.
6
5 Synchronization and Clocking
The author of this paper has been quoted saying GSM is a synchronous TDMA nightmare. This is by no
means intended as an insult to the technology itself or to its inventors. It merely serves as evidence how
hard it is to get into the synchronous TDMA mindset, especially for engineers who have spent most of their
career in the world of packet switched networks.
GSM is synchronous in multiple ways between cell (BTS) and phone (MS):
• Synchronization of the carrier clock to tune the receiver and transmitter to the correct frequency
• Synchronization of the bit clock in order to perform sampling at the most optimal sample intervals
• Synchronization of the frame clock (and thus timeslots) to know when a TDMA frame and its 8
timeslots start
• Synchronization of the TDMA multiplex to correctly (de)multiplex the logical channels that are sent
over each timeslots
As all those clocks are related to each other, they can (and should) all be derived from the same master
clock: The VCTCXO present in each GSM phone.
7
bits). By using this received GSM time and incrementing it every time the GSM bit-clock timer wraps at
the beginning of a new TDMA frame, the GSM time is synchronized.
Understanding the multiple layers of time multiplex such as the 26/51 multiframe, superframe and
hyperframe, the L1 can multiplex and demultiplex all the logical channels of GSM.
6 Miscellaneous Topics
6.1 GPRS
GPRS was the first packet switched extension to GSM. In fact, it is much more its entirely own mobile
network, independent of GSM. The only parts shared are the GSM modulation scheme (GMSK) and time
multiplex, in order to ensure peaceful coexistence between them.
The L1 and L2 protocols are very different (and much more complex) than GSM.
So while the phone baseband hardware did not need any modifications for a basic GPRS enabled phone,
the software needed to be extended quite a lot.
6.2 EDGE
EDGE is a very small incremental set of changes from GPRS. It reuses all of the time multiplex and protocol
stack, but introduces a new modulation: Offset 8-PSK instead of GMSK to increase the bandwidth that can
be transmitted. Offset 8-PSK is used (as opposed to simple 8-PSK) to avoid zero-crossings in the modulator
output.
So while the software modifications from GPRS to EDGE are minimal, the 8PSK modulation scheme
has a significant impact on the DSP, ABB and even RF PA design.
6.3 UMTS
UMTS (sometimes called WCDMA) is an entirely separate cellular network technology. Its physical layer,
modulation schemes, encoding, frequency bands, channel spacing are entirely different, as is the Layer1.
UMTS Layer2 has some resemblance to the GPRS Layer2.
UMTS Layer3 for Mobility Management and Call Control are very similar to GSM.
Given the vast physical layer and L1 differences, a UMTS phone hardware design significantly differs
from what has been described in this document.
Notwithstanding, all known commercial UMTS phone chipsets as of today still include a full GSM modem
in hardware and software to remain backwards-compatible.
8
Triple-SIM phones often combine the two approaches, i.e. they contain two complete GSM baseband
chips, but three SIM slots that can be switched among the base bands. Only two SIMs can be active at the
same time.
The International Mobile Equipment Identifier (IMEI) uniquely identifies a GSM phone. It is a globally
unique serial number which is programmed into the phone non-volatile memory (Flash or EEPROM) during
the production process. There are no particular security features used to store the IMEI. Once you are able
to write to flash and have found it, it can be changed.
The SIM card is a cryptographic smart card that stores the secret key used for authenticating the user to
the GSM network (Ki). The Ki is never released by the card, and as such copying (cloning) of the SIM is
prevented. Some early implementations of the SIM card had cryptographic weaknesses that inadvertently
permitted cloning until the late 1990s.
Furthermore, the SIM stores the International Mobile Subscriber Identity (IMSI). The IMSI is not en-
crypted or protected in any way.
There is no security channel on the connection between the SIM card and the baseband MCU. Further-
more, there is no way how the MCU can securely identify/authenticate the SIM itself. Physical access to the
SIM card slot allows sniffing and/or modification of the communications between the MCU and the SIM.
GSM is an international standard. This ensures interoperability, i.e. any phone can be used on any network.
However, in some cases, the vendors of a GSM phone want to restrict this interoperability and lock a
phone to one specific network, or even lock it to a particular SIM.
Those locks are implemented by software only, i.e. the MCU software will instruct the GSM protocol
stack not to register with a network unless its network operator code is a certain factory-programmed network
number.
9
As such, techniques for circumventing those locks have become commonplace. It’s somewhat of an ongoing
race between the phone makers and the phone-unlockers. The industry invents ever more complex methods
of obfuscating their locks in the software, while the phone-unlockers reverse engineer those bits for each and
every phone model after some time.
In order to protect the operator and phone manufacturers peculiar business models based on SIM or operator
locking, some vendors extended their baseband software with cryptographic signatures. Only if the correct
signature is present in a software update, the bootloader program will accept the new software.
However, there are more or less invasive hardware-related approaches in circumventing those signature
checks, such as hardware debugging interfaces like JTAG, or replacing the external flash memory components.
More recently, GSM chipset vendors introduced features such as hardware-assisted software signature
checks. In this case a master key hash might be present in DBB-internal fuses, together with a signature-
verifying boot loader in DBB-internal mask ROM. As the root of the chain of trust is moving deeper into
the hardware, it becomes more difficult for anyone to make software modifications to the DBB.
Especially with tighter integration, where RAM and FLASH are no longer present as discrete components
but part of a multi-chip-package, the number of options are becoming more limited.
On the other hand, an ever more complex baseband software stack is opening up many more options
for exploiting software vulnerabilities. Given the lack of a proper/modern operating system with privilege
separation and virtual memory, such exploits immediately give away full access to all aspects of the respective
DBB.
10
be so secretive?
Having spent a significant part of the last 6 years with reverse engineering of various aspects of mobile
phones in order to understand them better and to write software tools for security analysis, I still don’t
understand this secrecy.
All the various vendors do more or less the same. The fundamental architecture of a GSM baseband
chip is the same, whether you buy it from TI, Infineon or from MediaTek. They all cook with water, like
we Germans tend to say. The details like the particular DSP vendor or whether you use a traditional IF,
zero-IF or low-IF analog baseband differ. But from whom do they want to hide it? If people like myself with
a personal interest in the technical aspects of mobile phones can figure it out in a relatively short time, then
I’m sure the competition of those chipset makers can, too. In much less time, if they actually care.
This closedness of the cellular industry is one of the reasons why there has been very little innovation in
the baseband firmware throughout the last decades. Innovation can only happen by very few players. Source
code bugs can only be found and fixed by very few developers at even fewer large corporations. There is
little to no chance for a small start-up to innovate, like they can in the sphere of the internet.
It is fundamentally also the reason why the traditional phone makers have been losing market share to
newcomers to the mobile sphere like Apple with its iPhone or Google with its Android platform.
Those innovations really only happened on the application processor on high-end smartphones. The
closed GSM baseband processor had to be accompanied by an independent application processor running
a real operating system, with real processes, memory management, shared libraries, memory protection,
virtual memory spaces, user-installable applications, etc.
They still don’t happen on the baseband processor, which is as closed as it was 15 years ago.
11