Erlang open telecom platform
Download
1 / 35

Erlang Open Telecom Platform - PowerPoint PPT Presentation


  • 244 Views
  • Uploaded on

Erlang Open Telecom Platform. EAB/UPD/S Ulf Wiger. Contents. Background The Erlang Language OTP The Erlang/OTP Test Server Experiences. History of Erlang. 1998: Open Source Erlang. How to design SW for future telecoms systems?. 1995: Several new projects. 1987: Early Erlang

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Erlang Open Telecom Platform' - dillan


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Erlang open telecom platform

Erlang Open Telecom Platform

EAB/UPD/S Ulf Wiger


Contents
Contents

  • Background

  • The Erlang Language

  • OTP

  • The Erlang/OTP Test Server

  • Experiences


History of erlang
History of Erlang

1998:

Open Source

Erlang

How to design SW for futuretelecoms systems?

1995:

Several

new projects

1987:

Early Erlang

Prototype projects

1996:

Open Telecom Platform

AXD and GPRS started

1984-86:

Experiments

programming

POTS with

several languages

1993:

Distributed

Erlang

1991:

First fast

implementation



Erlang based products as of today

Ericsson:AXD 301, GPRS, (NetSim), LCS

Nortel: SSL Accelerator, SSL VPN gateway + others

TMobile: IN applications

Vail Systems: Computer Telephony Apps Service Prov.

Erlang Financial Systems: Banking & Lottery systems

Mobile Arts: Presence & Messaging for GSM/UMTS

Synap.se: Billing & device configuration

Blue Position: Bluetooth Location Information System

Motivity: Answer Supervision Generator, Signalling Gateway

Telia: CTI Platform

Corelatus: Signalling gateways & cross-connects

Bluetail/TeleNordia: Robust SMTP Mail Server

Univ. of Coruña: VoD Cluster

Erlang-based Products as of today


Erlang highlights
Erlang Highlights

Functional programming language

High abstraction level

Pattern matching

Concise readable programs

  • Declarative

  • Concurrency

  • Soft real-time

  • Robustness

  • Distribution

  • Hot code loading

  • External interfaces

  • Portability


Erlang highlights1

Examples...

Erlang Highlights

Solid concurrency modelScales to handle complexconcurrencySimple abstractions

  • Declarative

  • Concurrency

  • Soft real-time

  • Robustness

  • Distribution

  • Hot code loading

  • External interfaces

  • Portability


Erlang example

activity(Joe,75,1024)

Erlang Example

Creating a new process using spawn

-module(ex3).

-export([activity/3]).

activity(Name,Pos,Size) ->

…………

Pid = spawn(ex3,activity,[Joe,75,1024])


Erlang example1
Erlang Example

Processes communicate by asynchronous

message passing

receive

{start} -> ………

{stop} -> ………

{data,X,Y} -> ………

end

receive

{start} -> ………

{stop} -> ………

{data,X,Y} -> ………

end

Pid ! {data,12,13}


Erlang examples 4
Erlang Examples 4

Concurrency - Finite State Machine

Selective receive

ringing_B_side(PidA) ->

receive

{lim, offhook} ->

lim:stop_ringing(),

PidA ! {hc, {connect, self()}},

speech(PidA);

{hc, {cancel, PidA}} ->

cancel(PidA);

{lim, {digit, _Digit}} ->

ringing_B_side(PidA);

{hc, {request_connection, Pid}} ->

Pid ! {hc, {reject, self()}},

ringing_B_side(PidA)

after 30000 ->

cancel(PidA)

end.

True encapsulationof sub-states

Asynchronoussend

Optional timeout


Erlang highlights2

Numbers...

Erlang Highlights

Lightweight processesFast message passingResponse times in the

order of milliseconds

efficient garbage collection

  • Declarative

  • Concurrency

  • Soft real-time

  • Robustness

  • Distribution

  • Hot code loading

  • External interfaces

  • Portability


Process creation times log log scale

1,000

erlang

java

C#

100

Microseconds/process

10

1

10

100

1,000

10,000

100,000

Number of processes

Process creation times (LOG/LOG scale)

> 200,000processes

Source:

Joe Armstrong

SICS


Message passing times log log scale

100,000

erlang

java

10,000

C#

1,000

Microseconds/message

100

10

1

1

10

100

1,000

10,000

100,000

Number of processes

Message passing times (LOG/LOG scale)

> 200,000processes

Source:

Joe Armstrong

SICS


Erlang highlights3

Examples...

Erlang Highlights

Simple and consistent

error recovery

Supervision hierarchies

"Program for the correct case"

  • Declarative

  • Concurrency

  • Soft real-time

  • Robustness

  • Distribution

  • Hot code loading

  • External interfaces

  • Portability


Erlang example2
Erlang Example

Cooperating processes may be linked together

using

spawn_link(…,…,…)

or

link(Pid)


Erlang example3
Erlang Example

When a process terminates, an exit signal is sent to all linked processes

… and the termination is propagated


Erlang example4
Erlang Example

Exit signals can be trapped and received as messages

process_flag(trap_exit,true),...

receive

{‘EXIT’,Pid,...} -> ...

end


Erlang example5
Erlang Example

Robust systems can be built by layering

“Supervisors”

“Workers”


Error handling language safety
Error-handling -- Language Safety

  • No global variables -- fewer side-effects

  • No direct memory access -- no pointer errors

  • No malloc/free bugs

  • Solid concurrency model -- reduces synchronization problems, reduces the state space (simpler programs)

  • Fault isolation -- memory-protected lightweight processes

  • Built-in error recovery support -- more consistency

Concurrency & Fault Tolerance were designedinto the language from the start!


Debugging and profiling support
Debugging and Profiling Support

  • Symbolic crash reports

    • Usually sufficient info to locate bugs within minutes

  • Built-in trace support

    • Function calls (ability to filter on module name, function and args)

    • Messages (+ sequence trace)

    • Process events (context switch, spawn, link, exit)

    • Garbage collections

    • Optionally with timestamps (can be used for profiling, benchmarks)

    • Trace to process, file, or port (network socket)

    • Also available on live systems


Erlang highlights4

Examples...

Erlang Highlights

Explicit or transparent distribution

Network-aware runtime system

  • Declarative

  • Concurrency

  • Soft real-time

  • Robustness

  • Distribution

  • Hot code loading

  • External interfaces

  • Portability


Transparent distribution
Transparent Distribution

A

B

C

B ! Msg

C ! Msg

Erlang Run-Time System

Erlang Run-Time System

network

Message passing between processes in different computer is just as easy as between processes in the same computer


Simple rpc
Simple RPC

{rex, Node} ! {self(), {apply, M, F, A}},

receive

{rex, Node, What} -> What

end

{rex, Node} ! {self(), {apply, M, F, A}},

receive

{rex, Node, What} -> What

end

{rex, Node} ! {self(), {apply, M, F, A}},

receive

{rex, Node, What} -> What

end

loop() ->

receive

{From, {apply, M, F, A}} ->

Answer = (catch apply(M, F, A)),

From ! {rex, node(), Answer}

loop();

_Other -> loop()

end.

loop() ->

receive

{From, {apply, M, F, A}} ->

Answer = (catch apply(M, F, A)),

From ! {rex, node(), Answer}

loop();

_Other -> loop()

end.

loop() ->

receive

{From, {apply, M, F, A}} ->

Answer = (catch apply(M, F, A)),

From ! {rex, node(), Answer}

loop();

_Other -> loop()

end.

loop() ->

receive

{From, {apply, M, F, A}} ->

Answer = (catch apply(M, F, A)),

From ! {rex, node(), Answer}

loop();

_Other -> loop()

end.


Erlang highlights5

Examples...

Erlang Highlights

Easily change code in a

running system

Enables non-stop operation

Simplifies testing

  • Declarative

  • Concurrency

  • Soft real-time

  • Robustness

  • Distribution

  • Hot code loading

  • External interfaces

  • Portability


Erlang example6

change_code

Erlang Example

Version 1

Version 2


Erlang highlights6

Examples...

Erlang Highlights

"Ports" to the outside world

behave as Erlang processes(c.f. UML ports)

  • Declarative

  • Concurrency

  • Soft real-time

  • Robustness

  • Distribution

  • Hot code loading

  • External interfaces

  • Portability


Erlang example7
Erlang Example

External

process

Port

Port ! {self(), {command, [1,2,3]}}


Erlang example8

A port can use e.g. a TCP, UDP, SSL socket,UNIX pipe, or customtransport (e.g. SAAL)

Erlang Example

External

process

Port

receive{Port, {data, Info}} ->end


Erlang highlights7

Illustration...

Erlang Highlights

Erlang runs on any UNIX,

Windows, VxWorks, OSE Delta

Supports heterogeneous

networks

  • Declarative

  • Concurrency

  • Soft real-time

  • Robustness

  • Distribution

  • Hot code loading

  • External interfaces

  • Portability


Systems overview
Systems Overview

Applications written

in Erlang

OTP Components

Applications

written in C,

C++ or Java

Standard Libraries

Erlang Run-Time System

Hardware and Operating System


Erlang otp open telecom platform
Erlang/OTP (Open Telecom Platform)

  • Middleware for Erlang development

  • Designed for fault tolerance and portability

  • Behaviors: A formalization of design patterns

  • Components

    • Error handling, reporting and logging

    • Mnesia, distributed real-time database management system

    • CORBA, IDL Compiler, Java & C Interface Support

    • HTTP Server + Client, FTP Client

    • SNMP Agent + ASN.1 Compiler

    • H.248

    • XML

    • ...


Otp behaviors
OTP Behaviors

  • "A formalization of design patterns"

    • A framework + generic code to solve a common problem

    • Built-in support for debugging and software upgrade

    • Makes it easier to reason about the behavior of a program

  • Examples of OTP behaviors

    • application defines how an application is implemented

    • supervisor used to write fault-tolerant supervision trees

    • gen_server for writing client-server applications

    • gen_event for writing event handlers

    • gen_fsm for finite state machine programming


Principles of the otp test server

Erlang VM

Test suite

Test server

library

Adaptation

library

Erlang rpc,

"socket rpc",

Corba, ...

erl

erl

erl

Corba, SNMP, ...

erl

Application

being tested

Application

being tested

Application

being tested

Principles of the OTP Test Server


Experiences from erlang in large projects
Experiences from Erlang in Large Projects

  • Easy to build a first runnable application

  • Easy to debug

  • Easy to maintain

  • Very strong support for fault tolerance

  • Suitable for large systems/projects

  • Great for prototyping

  • Impressive performance/scalability in real applications

  • Outstanding tool for test automation

  • High programmer satisfaction



ad