18 May 2011
Francesco Cesarini, Technical Director of Erlang Solutions, discusses the benefits of the Erlang Open Telecom Platform and how it can be used in product development for writing software for telecommunications systems.
Prior to its release as open source, OTP was used to develop many turnkey telecom solutions with millions of lines of code, including the AXD301 ATM switch, the GGSN IP gateway node and SGSN support node, two components handling core functionality in GPRS networks.
This approach resulted in a well tested code base proven fit for the most demanding soft real-time systems.
But what exactly is OTP?
OTP can be seen as a control system platform for developing, deploying and running Erlang-based systems. Design principles provide software engineering guidelines that enable systems to be developed in a uniform way. Consequently, different programs that do completely different things in the network will have a common structures and functions.
When developing Erlang-based systems, it is not mandatory to use some or any parts of OTP when writing Erlang code. Using it, however, enhances productivity, reduces the overall code base and increases the code quality. It ensures developers do not reinvent the wheel for common design patterns and problems that have already been solved, hiding many of the tricky issues with concurrent and parallel programming.
OTP is made up of three components:
The Erlang programming language
A set of libraries, including tools, interfaces and reusable applications
A set of design principles and patterns describing the system’s architecture
OTP’s design principles provide software engineering guidelines that enable developers to structure systems in a scalable and fault tolerant way. Different programs that execute completely different tasks will do so using common design patterns. While it is not mandatory to follow these design patterns, it is very advantageous to do so.
OTP building blocks
Java’s key components are code threads which are mapped to the OS threads. While the key component when writing an Erlang program is known as a process, they are independent of OS threads. As a result, processes take microseconds to create and use little memory. They can be created and replicated with little overhead, enabling millions to interact concurrently on any system.
In Erlang, the most frequently used process patterns have been implemented in library modules, commonly referred to as OTP behaviours. They contain the generic code framework for concurrency and error handling, simplifying the complexity of concurrent programming and protecting the developer from many common pitfalls.

Reusable architectures using OTP applications
Behaviours are monitored by supervisors, themselves a behaviour, and grouped together in supervision trees. A supervision tree is packaged in an application, creating a building block of an Erlang program.
Ready-made components are packaged as applications. They include databases, management protocol stacks, interfaces towards other languages, monitoring tools; components that can be reused in-between projects.
OTP applications that come with the standard Erlang distribution include the Systems Architecture Support Libraries (SASL), answering common maintenance and operations requirements including packaging, deploying and system upgrade during runtime.
Mnesia, a distributed, soft real-time database management system written in the Erlang programming language, enables transactions across hosts is another very popular application, alongside implementations of protocols and standards such as the simple network management protocol (SNMP), the Common Object Request Broker Architecture (CORBA) or the Interface Definition Language (IDL). For telecom systems, protocols such as Megaco H248 protocol stack are often complemented with proprietary components such as SIP or Diameter stacks.
A complete Erlang system such as the AXD301 switch or the SGSN and GGSN nodes is a set of loosely coupled applications that interact with each other. Some of these applications have been written by the developer, some are part of the standard Erlang/OTP distribution, and some may be other open source components. They are sequentially loaded and started by a boot script generated from a list of applications and versions. Take care not confuse OTP applications with the more general concept of an application, which usually refers to a more complete system that solves a high-level task.
Page 2 of 3 | < Previous | Next >
About the author

Francesco Cesarini is Technical Director of Erlang Solutions Ltd, a company specialised in high availability, massively concurrent soft real time systems. He has been programming Erlang since 1995 and was on the team who worked on the OTP R1 release. Francesco has worked with start-ups and blue chip companies alike helping them with all the aspects of Erlang based projects - from coding, reviews and architecture designs to setting up development centres. He has taught Erlang to hundreds of developers, testers, support staff and university students. He documented these experiences in Erlang Programming, a book published by O'Reilly Media in 1999. Francesco is also a frequent speaker at conferences worldwide and teaches graduates and undergraduates at the IT University of Gothenburg in Sweden and Oxford University in the UK.
Erlang Solutions specialises in supporting businesses with the creation, integration, delivery and lifetime support of products and services based on the Erlang programming language, from small developers to Fortune 500 corporations. Erlang Solutions is the only company of its kind totally focused on Erlang and the Erlang community, offering industry-leading research, development, training and worldwide support for businesses using Erlang. Erlang Solutions helps its customers to realise the potential of Erlang-based solutions, with all the inherent benefits offered by the shorter time to market, low lifetime cost, extreme reliability and scalability of Erlang. Erlang Solutions has offices in London, Stockholm and Krakow.
Most popular articles in Telecoms & networks
Open Telecommunications Platform, OTP for Open CommunicationsOptical Wireless Communications: An Overview
Measuring Jitter on Synchronous Ethernet Networks
