+ All Categories
Home > Documents > Free / Open Source Software for...

Free / Open Source Software for...

Date post: 21-Feb-2021
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
54
Free / Open Source Software for GSM Harald Welte gnumonks.org OpenBSC airprobe.org osmocom.org hmw-consulting.de December 2010, Taiwan 1 / 54 Harald Welte Free / Open Source Software for GSM
Transcript
Page 1: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

Free / Open Source Software for GSM

Harald Welte

gnumonks.orgOpenBSC

airprobe.orgosmocom.org

hmw-consulting.de

December 2010, Taiwan

1 / 54 Harald Welte Free / Open Source Software for GSM

Page 2: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

Part I - Open Source GSM Tools1 OpenBSC

OpenBSC Network In The BoxOpenBSC BSC-only modeOpenBSC GPRS supportOpenBTS

2 OsmocomBB ProjectOsmocomBB IntroductionOsmocomBB SoftwareOsmocomBB Hardware SupportOsmocomBB Project Status

3 wireshark Protocol Analyzer4 Osmocom SIMtrace

Debugging SIM drivers and STK appsOsmocom SIMtrace IntroductionOsmocom SIMtrace Hardware

2 / 54 Harald Welte Free / Open Source Software for GSM

Page 3: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OpenBSC Network In The BoxOpenBSC BSC-only modeOpenBSC GPRS supportOpenBTS

OpenBSC software

OpenBSC is a Open Source implementation of (not only) theBSC features of a GSM network.

Support A-bis interface over E1 and IPSupport for BTS vendor/model is modular, currentlySiemens BS-11 and ip.access nanoBTSMultiple BTS models/vendorrs can be mixed!Can work as a pure BSC or as a full network in a boxSupports mobility management, authentication, intra-BSChand-over, SMS, voice calls (FR/EFR/AMR)GPRS + EDGE support if combined with OsmoSGSN andOpenGGSN

3 / 54 Harald Welte Free / Open Source Software for GSM

Page 4: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OpenBSC Network In The BoxOpenBSC BSC-only modeOpenBSC GPRS supportOpenBTS

OpenBSC

Supports Siemens BS-11 BTS (E1) and ip.accessnanoBTS (IP based)Has classic 2G signalling, voice and SMS supportImplements various GSM protocols like

A-bis RSL (TS 08.58) and OML (TS 12.21)TS 04.08 Radio Resource, Mobility Management, CallControlTS 04.11 Short Message Service

Telnet console with Cisco-style interface

4 / 54 Harald Welte Free / Open Source Software for GSM

Page 5: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OpenBSC Network In The BoxOpenBSC BSC-only modeOpenBSC GPRS supportOpenBTS

OpenBSC software architecture

Implemented in pure C, similarities to Linux kernelLinked List handling, Timer API, coding style

Single-threaded event-loop / state machine designTelnet based command line interface Cisco-styleInput driver abstraction (mISDN, Abis-over-IP)

5 / 54 Harald Welte Free / Open Source Software for GSM

Page 6: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OpenBSC Network In The BoxOpenBSC BSC-only modeOpenBSC GPRS supportOpenBTS

OpenBSC: GSM network protocolsThe A-bis interface

Layer 1 Typically E1 line, TS 08.54Layer 2 A variant of ISDN LAPD with fixed TEI’s, TS 08.56Layer 3 OML (Organization and Maintenance Layer, TS

12.21)Layer 3 RSL (Radio Signalling Link, TS 08.58)

Layer 4+ transparent messages that are sent to the MS via Um

6 / 54 Harald Welte Free / Open Source Software for GSM

Page 7: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OpenBSC Network In The BoxOpenBSC BSC-only modeOpenBSC GPRS supportOpenBTS

OpenBSC: Field Test at HAR2009

7 / 54 Harald Welte Free / Open Source Software for GSM

Page 8: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OpenBSC Network In The BoxOpenBSC BSC-only modeOpenBSC GPRS supportOpenBTS

OpenBSC in NITB modeNetwork In a Box Mode

The bsc_hack programimplements the A-bis interface towards any number of BTSprovides most typical features of a GSM network in onesoftwareno need for MSC, AuC, HLR, VLR, EIR, ...

HLR/VLR as SQLite3 tableAuthentication + Ciphering supportGSM voice calls, MO/MT SMSHand-over between all BTSMultiple Location Areas within one BSC

8 / 54 Harald Welte Free / Open Source Software for GSM

Page 9: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OpenBSC Network In The BoxOpenBSC BSC-only modeOpenBSC GPRS supportOpenBTS

OpenBSC NITB features

OpenBSC NITB featuresRun a small GSM network with 1-n BTS and OpenBSCNo need for MSC/HLR/AUC/...No need for your own SIM cards (unless crypto/auth rqd)Establish signalling and voice channelsMake incoming and outgoing voice calls between phonesSend/receive SMS between phonesConnect to ISDN PBX or public ISDN via Linux Call Router

9 / 54 Harald Welte Free / Open Source Software for GSM

Page 10: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OpenBSC Network In The BoxOpenBSC BSC-only modeOpenBSC GPRS supportOpenBTS

OpenBSC in NITB modeNetwork In a Box Mode

The bsc_hack programdoes not implement any other GSM interfaces apart fromA-bisno SS7 / TCAP / MAP based protocolsno integration (roaming) with existing traditional GSMnetworkswired telephony interfacing with ISDN PBX lcr (Linux CallRouter)Has been tested with up to 800 subscribers on 5 BTSIntended for R&D use or private PBX systems

10 / 54 Harald Welte Free / Open Source Software for GSM

Page 11: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OpenBSC Network In The BoxOpenBSC BSC-only modeOpenBSC GPRS supportOpenBTS

OpenBSC LCR integrationInterfacing with wired telephony

OpenBSC (NITB mode) can be linked into Linux Call Router(lcr)

OpenBSC is compiled as libbsc.alibbsc.a includes full OpenBSC NITB mod codelinking the library into lcr results in GSM line interfaces tobecome available inside lcr

OpenBSC no longer takes care of call control, but simplyhands everything off to lcr

Dialling plan, etc. is now configure in lcr like for any otherwired phones

11 / 54 Harald Welte Free / Open Source Software for GSM

Page 12: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OpenBSC Network In The BoxOpenBSC BSC-only modeOpenBSC GPRS supportOpenBTS

OpenBSC in BSC-only mode

The osmo-bsc programbehaves like a classic GSM BSCuses SCCP-Lite (ip.access multipex) to any SoftMSC likeADCused in production/commercial deployments ( 75 BSCs)mainly intended to replace proprietary BSC in traditionalGSM networks

12 / 54 Harald Welte Free / Open Source Software for GSM

Page 13: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OpenBSC Network In The BoxOpenBSC BSC-only modeOpenBSC GPRS supportOpenBTS

OpenBSC

Demonstration

13 / 54 Harald Welte Free / Open Source Software for GSM

Page 14: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OpenBSC Network In The BoxOpenBSC BSC-only modeOpenBSC GPRS supportOpenBTS

GPRS and OpenBSC

The BSC doesn’t really do anything related to GPRSGPRS implemented in separate SGSN and GGSN nodesGPRS uses its own Gb interface to RAN, independent ofA-bisOpenBSC can configure the nanoBTS for GPRS+EDGEsupport via OMLActual SGSN and GGSN implemented as OsmoSGSN andOpenGGSN programs

14 / 54 Harald Welte Free / Open Source Software for GSM

Page 15: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OpenBSC Network In The BoxOpenBSC BSC-only modeOpenBSC GPRS supportOpenBTS

OsmoSGSN

The Osmocom SGSN program implementsbasic/minimal SGSN functionalitythe Gb interface (NS/BSSGP/LLC/SNDCP)mobility management, session management

It’s a work in progress, many missing featuresno HLR integration yetno paging coordination with MSC/BSCno encryption support yet

15 / 54 Harald Welte Free / Open Source Software for GSM

Page 16: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OpenBSC Network In The BoxOpenBSC BSC-only modeOpenBSC GPRS supportOpenBTS

OpenGGSN

GPL licensed Linux program implementing GGSN nodeImplements GTP-U protocol between SGSN and GGSNUser-configurable range/pool of IPv4 addresses for MSUses tun device for terminating IP tunnel from MSprovides GTP implementation as libgtpExperimental patches for IPv6 support

16 / 54 Harald Welte Free / Open Source Software for GSM

Page 17: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OpenBSC Network In The BoxOpenBSC BSC-only modeOpenBSC GPRS supportOpenBTS

What is OpenBTS?

is NOT a BTS in the typical GSM senseis better described as a GSM-Um to SIP gatewayimplements the GSM Um (air interface) as SDRuses the USRP hardware as RF interfacedoes not implement any of BSC, MSC, HLR, etc.bridges the GSM Layer3 protocol onto SIPuses SIP switch (like Asterisk) for switching calls + SMSis developed as C++ program and runs on Linux + MacOS

17 / 54 Harald Welte Free / Open Source Software for GSM

Page 18: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OpenBSC Network In The BoxOpenBSC BSC-only modeOpenBSC GPRS supportOpenBTS

What is OpenBTS?

Open implementation of Um L1 & L2, an all-software BTS.L1/L2 design based on an object-oriented dataflowapproach.Includes L3 RR functions normally found in BSC.Uses SIP PBX for MM and CC functions, eliminating theconventional GSM network. L3 is like an ISDN/SIPgateway.Intended for use in low-cost and rapidly-deployedcommunications networks, but can be used forexperiments (including by Chris Pagent at Def Con).

18 / 54 Harald Welte Free / Open Source Software for GSM

Page 19: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OpenBSC Network In The BoxOpenBSC BSC-only modeOpenBSC GPRS supportOpenBTS

OpenBTS Hardware

OpenBTS supports the following SDR hardwareEttus USRP(1) with two RFX 900 or RFX 1800 daughterboards

Modification for external clock input recommendedExternal 52 MHz precision clock recommended

Kestrel Signal Processing / Range Networks custom radioClose Haul Communications / GAPfiller (work in progress)Ported to other radios by other clients.

19 / 54 Harald Welte Free / Open Source Software for GSM

Page 20: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OpenBSC Network In The BoxOpenBSC BSC-only modeOpenBSC GPRS supportOpenBTS

OpenBTS History + Tests

Started work in Aug 2007, first call in Jan 2008, first SMSin Dec 2008.First public release in September 2008, assigned to FSF inOct 2008.Ran 3-sector 3-TRX system with 10,000-20,000 handsetsat Sept 2009 Burning Man event in Nevada.Ran 2-sector 5-TRX system with 40,000 handsets at Sept2010 Burning Man event in Nevada.Release 2.5 is about 13k lines of C++.Part of GNU Radio project, distributed under AGPLv3.Range Networks launched in Sept 2010 to producecommercial products and distributions.

20 / 54 Harald Welte Free / Open Source Software for GSM

Page 21: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OpenBSC Network In The BoxOpenBSC BSC-only modeOpenBSC GPRS supportOpenBTS

Burning Man 2010 Tower Base

21 / 54 Harald Welte Free / Open Source Software for GSM

Page 22: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OsmocomBB IntroductionOsmocomBB SoftwareOsmocomBB Hardware SupportOsmocomBB Project Status

Requirements for GSM security analysis

What do we need for protocol-level security analysis?A GSM MS-side baseband chipset under our controlA Layer1 that we can use to generate arbitrary L1 framesA Layer2 protocol implementation that we can use + modifyA Layer3 protocol implementation that we can use + modify

None of those components existed, so we need to create them!

22 / 54 Harald Welte Free / Open Source Software for GSM

Page 23: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OsmocomBB IntroductionOsmocomBB SoftwareOsmocomBB Hardware SupportOsmocomBB Project Status

A GSM baseband under our control

The two different DIY approachesBuild something using generic components (DSP, CPU,ADC, FPGA)

No reverse engineering requiredA lot of work in hardware design + debuggingHardware will be low-quantity and thus expensive

Build something using existing baseband chipsetReverse engineering or leaked documents requiredLess work on the ’Layer 0’Still, custom hardware in low quantity

23 / 54 Harald Welte Free / Open Source Software for GSM

Page 24: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OsmocomBB IntroductionOsmocomBB SoftwareOsmocomBB Hardware SupportOsmocomBB Project Status

A GSM baseband under our control

Alternative ’lazy’ approachRe-purpose existing mobile phone

Hardware is known to be workingNo prototyping, hardware revisions, etc.Reverse engineering requiredHardware drivers need to be writtenBut: More time to focus on the actual job: Protocol software

Searching for suitable phonesAs cheap as possibleReadily available: Many people can play with itAs old/simple as possible to keep complexity lowBaseband chipset with lots of leaked information

24 / 54 Harald Welte Free / Open Source Software for GSM

Page 25: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OsmocomBB IntroductionOsmocomBB SoftwareOsmocomBB Hardware SupportOsmocomBB Project Status

Baseband chips with leaked information

Texas Instruments CalypsoDBB Documentation on cryptome.org and other sitesABB Documentation on Chinese phone developer websitesSource code of GSM stack / drivers was on sf.net (tsm30project)End of life, no new phones with Calypso since about 2008No cryptographic checks in bootloader

Mediatek MT622x chipsetsLots of Documentation on Chinese sitesSDK with binary-only GSM stack libraries on Chinese sites95 million produced/sold in Q1/2010

Initial choice: TI Calypso (GSM stack source available)

25 / 54 Harald Welte Free / Open Source Software for GSM

Page 26: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OsmocomBB IntroductionOsmocomBB SoftwareOsmocomBB Hardware SupportOsmocomBB Project Status

OsmocomBB Introduction

Project was started only in January 2010 (9 months ago!)Implementing a GSM baseband software from scratchThis includes

GSM MS-side protocol stack from Layer 1 through Layer 3Hardware drivers for GSM Baseband chipsetSimple User Interface on the phone itselfVerbose User Interface on the PC

Note about the strange project nameOsmocom = Open Source MObile COMmunicationBB = Base Band

26 / 54 Harald Welte Free / Open Source Software for GSM

Page 27: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OsmocomBB IntroductionOsmocomBB SoftwareOsmocomBB Hardware SupportOsmocomBB Project Status

OsmocomBB Software Architecture

Reuse code from OpenBSC where possible (libosmocore)We build libosmocore both for phone firmware and PC

Initially run as little software in the phoneDebugging code on your host PC is so much easierYou have much more screen real-estateHardware drivers and Layer1 run in the phoneLayer2, 3 and actual phone application / MMI on PCLater, L2 and L3 can me moved to the phone

27 / 54 Harald Welte Free / Open Source Software for GSM

Page 28: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OsmocomBB IntroductionOsmocomBB SoftwareOsmocomBB Hardware SupportOsmocomBB Project Status

OsmocomBB Software Interfaces

Interface between Layer1 and Layer2 called L1CTLFully custom protocol as there is no standardImplemented as message based protocol overSercomm/HDLC/RS232

Interface between Layer2 and Layer3 called RSLmsIn the GSM network, Um Layer2 terminates at the BTS butis controlled by the BSCReuse this GSM 08.58 Radio Signalling LinkExtend it where needed for the MS case

28 / 54 Harald Welte Free / Open Source Software for GSM

Page 29: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OsmocomBB IntroductionOsmocomBB SoftwareOsmocomBB Hardware SupportOsmocomBB Project Status

OsmocomBB Target Firmware

Firmware includes software likeDrivers for the Ti Calypso Digital Baseband (DBB)Drivers for the Ti Iota TWL3025 Analog Baseband (ABB)Drivers for the Ti Rita TRF6151 RF TransceiverDrivers for the LCD/LCM of a number of phonesCFI flash driver for NOR flashGSM Layer1 synchronous/asynchronous partSercomm - A HDLC based multiplexer for the RS232 tohost PC

29 / 54 Harald Welte Free / Open Source Software for GSM

Page 30: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OsmocomBB IntroductionOsmocomBB SoftwareOsmocomBB Hardware SupportOsmocomBB Project Status

OsmocomBB Host Software

Current working name: layer23Includes

Layer 1 Control (L1CTL) protocol APIGSM Layer2 implementation (LAPDm)GSM Layer3 implementation (RR/MM/CC)GSM Cell (re)selectionSIM Card emulationSupports various ’apps’ depending on purpose

30 / 54 Harald Welte Free / Open Source Software for GSM

Page 31: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OsmocomBB IntroductionOsmocomBB SoftwareOsmocomBB Hardware SupportOsmocomBB Project Status

OsmocomBB Supported Hardware

Baseband ChipsetsTI Calypso/Iota/RitaSome early research being done on Mediatek (MTK)MT622x

Actual PhonesCompal/Motorola C11x, C12x, C13x, C14x and C15xmodelsMost development/testing on C123 and C155GSM modem part of Openmoko Neo1973 and Freerunner

All those phones are simple feature phones built on aARM7TDMI based DBB

31 / 54 Harald Welte Free / Open Source Software for GSM

Page 32: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OsmocomBB IntroductionOsmocomBB SoftwareOsmocomBB Hardware SupportOsmocomBB Project Status

The Motorola/Compal C123

32 / 54 Harald Welte Free / Open Source Software for GSM

Page 33: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OsmocomBB IntroductionOsmocomBB SoftwareOsmocomBB Hardware SupportOsmocomBB Project Status

OsmocomBB Project Status: Working

Hardware Drivers for Calypso/Iota/Rita very completeDrivers for Audio/Voice signal pathLayer1

Power measurementsCarrier/bit/TDMA synchronizationReceive and transmit of normal bursts on SDCCHTransmit of RACH burstsAutomatic Rx gain control (AGC)Frequency Hopping

Layer2 UI/SABM/UA frames and ABM modeLayer3 Messages for RR / MM / CCCell (re)selection according GSM 03.22

33 / 54 Harald Welte Free / Open Source Software for GSM

Page 34: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OsmocomBB IntroductionOsmocomBB SoftwareOsmocomBB Hardware SupportOsmocomBB Project Status

OsmocomBB Project Status: Working (2/2)

OsmocomBB can now do GSM Voice calls (08/2010)Very Early Assignment + Late AssignmentA3/A8 Authentication of SIMA5/1 + A5/2 EncryptionFull Rate (FR) and Enhanced Full Rate (EFR) codec

34 / 54 Harald Welte Free / Open Source Software for GSM

Page 35: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OsmocomBB IntroductionOsmocomBB SoftwareOsmocomBB Hardware SupportOsmocomBB Project Status

OsmocomBB Project Status: Not working

Fully-fledged SIM card reader inside phone (WIP)Layer1

Neighbor Cell MeasurementsIn-call hand-over to other cells

Actual UI on the phoneCircuit Switched Data (CSD) callsGPRS (packet data)

35 / 54 Harald Welte Free / Open Source Software for GSM

Page 36: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

OsmocomBB IntroductionOsmocomBB SoftwareOsmocomBB Hardware SupportOsmocomBB Project Status

OsmocomBB Project Status: Executive Summary

We can establish control/signalling channels to bothhopping and non-hopping GSM cells

Control over synthesizer means we can even go to GSM-Rband

We can send arbitrary data on those control channelsRR messages to BSCMM/CC messages to MSCSMS messages to MSC/SMSC

TCH (Traffic Channel) support for voice callsDieter Spaar and Andreas Eversberg have made multiple20 minute call with current master branchSome people have tried alpha code on real networks forreal 30+ minute calls!

36 / 54 Harald Welte Free / Open Source Software for GSM

Page 37: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

The wireshark protocol analyzer

Software protocol analyzer for plethora of protocolsPortable, works on most flavors of Unix and WindowsDecode, display, search and filter packets with configurablelevel of detailOver 1000 protocol decodersOver 86000 display filtersLive capturing from many different network mediaImport files from other capture programsUsed to be called ethereal, but is now called wiresharkhttp://www.wireshark.org/

http://www.wireshark.org/download/docs/user-guide-a4.pdf

37 / 54 Harald Welte Free / Open Source Software for GSM

Page 38: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

The wireshark protocol analyzer

GSM protocol dissectors in wiresharkTCP/IP (transport layer for Abis/IP)E1 Layer 2 (LAPD)GSM Um Layer 2 (LAPDm)GSM Layer 3 (RR, MM, CC)A-bis Layer 3 (RSL)

A-bis OML for Siemens and ip.access in OpenBSC git

GSMTAP pseudo-header (airprobe, OpenBTS,OsmocomBB)

38 / 54 Harald Welte Free / Open Source Software for GSM

Page 39: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

wireshark integration in OsmocomBB

OsmocomBB L1 runs on phoneOsmocomBB L23 runs on host PCOsmocomBB L23 encapsulates 23byte L2 message inGSMTAPGSMTAP includes information not present in L2, such as

ARFCN, TimeslotGSM Frame NumberRx Signal Level / SNR

OsmocomBB L23 sends GSMTAP message over UDPsocketwireshark captures UDP packet like any UDP/IP

39 / 54 Harald Welte Free / Open Source Software for GSM

Page 40: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

wireshark integration in OpenBTS and airprobe

airprobe software runs on host PCimplements Rx-only GSM L1 as SDRairprobe L23 encapsulates 23byte L2 message inGSMTAPwireshark captures UDP packet like any UDP/IPOpenBTS wireshark intergration similar, but for Rx + Tx

40 / 54 Harald Welte Free / Open Source Software for GSM

Page 41: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

The wireshark protocol analyzer

Demonstration

41 / 54 Harald Welte Free / Open Source Software for GSM

Page 42: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

Debugging SIM drivers and STK appsOsmocom SIMtrace IntroductionOsmocom SIMtrace Hardware

Debugging SIM toolkit applications is hard

Regular end-user phone does not give much debuggingSIM card itself has no debug interface for printing errormessages, warnings, etc.However, as SIM-ME interface is unencrypted, sniffing /tracing is possibleCommercial / proprietary solutions exist, but are expensive

42 / 54 Harald Welte Free / Open Source Software for GSM

Page 43: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

Debugging SIM drivers and STK appsOsmocom SIMtrace IntroductionOsmocom SIMtrace Hardware

Introducing Osmocom SIMtrace

Osmocom SIMtrace is a passive (U)SIM-MEcommunication snifferInsert SIM adapter into actual phoneInsert (U)SIM into SIMtrace hardwareSIMtrace hardware provides USB interface to host PCsimtrace program on PC encapsulates APDU inGSMTAPGSMTAP is sent via UDP to localhostwireshark dissector for GSM TS 11.11 decodes APDUs

43 / 54 Harald Welte Free / Open Source Software for GSM

Page 44: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

OpenBSCOsmocomBB Project

wireshark Protocol AnalyzerOsmocom SIMtrace

Debugging SIM drivers and STK appsOsmocom SIMtrace IntroductionOsmocom SIMtrace Hardware

Osmocom SIMtrace Hardware

Hardware is based around AT91SAM7S controllerSAM7S Offers two ISO 7816-3 compatible USARTsUSARTs can be clock master (SIM reader) or slave (SIMcard)Open Source Firmware on SAM7S implementing APDUsniffingAuto-bauding depending CLK signal, PPS supportedOnly prototype hardware right, but will be manufactured inQ1/2011

44 / 54 Harald Welte Free / Open Source Software for GSM

Page 45: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

Open Source GSM tools for Debugging + TestingSingle-Core Android smart phone

Linux development and the community

Part II - MTK and Free / Open Source Software

5 Open Source GSM tools for Debugging + Testing

6 Single-Core Android smart phone

7 Linux development and the community

45 / 54 Harald Welte Free / Open Source Software for GSM

Page 46: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

Open Source GSM tools for Debugging + TestingSingle-Core Android smart phone

Linux development and the community

Possible use cases for OpenBSC

OpenBSC or OpenBTS in R&DInexpensive simulation of GSM network for R&DFlexible since any aspect can be modified by alteringsource codeComplex and more exotic parts of GSM protocol spec canbe testedMuch more functionality than CMD 55 / Racal 6103 orsimilarAbility to send malformed L3 messages (fuzzing) for MTKMS stack security improvement

46 / 54 Harald Welte Free / Open Source Software for GSM

Page 47: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

Open Source GSM tools for Debugging + TestingSingle-Core Android smart phone

Linux development and the community

Possible use cases for airprobe

airprobe in R&Dairprobe: Tracing of Um air interfaceSIMtrace: Tracing of SIM card interface

47 / 54 Harald Welte Free / Open Source Software for GSM

Page 48: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

Open Source GSM tools for Debugging + TestingSingle-Core Android smart phone

Linux development and the community

General advantages of FOSS based solution

MTK has full access to source codeNew features can be added on any level of the protocolstackNo dependency on a single supplierLower cost means available to more MTK engineersLower cost means available to more MTK customers(factory testing, field tests with OEM customers, ...)

48 / 54 Harald Welte Free / Open Source Software for GSM

Page 49: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

Open Source GSM tools for Debugging + TestingSingle-Core Android smart phone

Linux development and the community

MTK feature phone vs. smart phone

MTK’s advantage so far: Low cost sigle-core feature phone

Baseband processor runs Nucleus, GSM stack, UI and richapplication stack (Camera, H.264, GPRS, TCP/IP, ...)Other suppliers have to use dual core

However, MTKs Nucleus based OS has custom/proprietaryAPIsNot many 3rd party applications can be installed on thephoneAndroid, iPhone, Windows Mobile have standard API /environmentThus, MTK needs to offer ’standard’ smart phone solution

49 / 54 Harald Welte Free / Open Source Software for GSM

Page 50: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

Open Source GSM tools for Debugging + TestingSingle-Core Android smart phone

Linux development and the community

Proposal: Single core Android smart phone

Android, WinMobile, etc. have dual-core architectureGSM/3G protocol stack on baseband processorUI + applications on application processor

If MTK now goes for Android smart phone, why go dualcore?

Simply port L1 code into Linux kernel (IRQ/FIQ driven)Make sure you follow the GPL and release L1 as OpenSourceRun your L2/L3/L4 as proprietary userspace process onLinux

Single-core Android phone has less ARM core licensingcost and less silicon size

50 / 54 Harald Welte Free / Open Source Software for GSM

Page 51: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

Open Source GSM tools for Debugging + TestingSingle-Core Android smart phone

Linux development and the community

SoC vendors and Linux ports

A number of SoC vendors have been used with Linux formany yearsPort of Linux / BSP has originally been done by 3rd partyor communitySoC vendors started to become more active in the last 5yearsOriginal: Create port, ship it to customer, done.SoC customers end up with vendor-specific code

51 / 54 Harald Welte Free / Open Source Software for GSM

Page 52: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

Open Source GSM tools for Debugging + TestingSingle-Core Android smart phone

Linux development and the community

Disadvantages of vendor ports

Fast progress in mainline Linux kernel developmentCustomers want latest kernel for latest features /performanceVendor port (not in mainline) always behind mainlinePorting out-of-mainline vendor port into new mainline islots of workCustomers end up with old vendor-specific code

52 / 54 Harald Welte Free / Open Source Software for GSM

Page 53: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

Open Source GSM tools for Debugging + TestingSingle-Core Android smart phone

Linux development and the community

SoC vendors need to include their port mainline

Major SoC vendors now work together with mainlinedevelopersSupport SoC in latest mainline developer versionActively submit port into mainline Linux kernelPort in mainline stays automatically current/up-to-dateContinued maintenance effort is shared by all parties

53 / 54 Harald Welte Free / Open Source Software for GSM

Page 54: Free / Open Source Software for GSMgit.gnumonks.org/cgit/laforge-slides/plain/2010/gsm_foss...mobility management, session management It’s a work in progress, many missing features

SummaryFurther Reading

Further Reading

Open source Software on a GSM protocol levelOpenBSC http://openbsc.osmocom.org/OpenBTS http://openbts.org/

OsmocomBB http://bb.osmocom.org/airprobe http://airprobe.org/

A5 security related publicationsA5 public http://groups.google.com/group/uk.telecom/msg/ba76615fef32ba32Biham2003 http://cryptome.org/gsm-crack-bbk.pdfBiham2006 http://www.cs.technion.ac.il/users/wwwb/cgi-bin/tr-get.cgi/2006/CS/CS-2006-07.pdf

HAR2009 https://har2009.org/program/attachments/119_GSM.A51.Cracking.Nohl.pdfrainbow tables http://reflextor.com/trac/a51/wiki

54 / 54 Harald Welte Free / Open Source Software for GSM


Recommended