Erlang Open Telecom Platform - PowerPoint PPT Presentation

1 / 35
About This Presentation
Title:

Erlang Open Telecom Platform

Description:

Rev PA1. 2003-12-01. 1. Erlang Open Telecom Platform ... Enables non-stop operation. Simplifies testing. Examples... Rev PA1. 2003-12-01. 25. Erlang Example ... – PowerPoint PPT presentation

Number of Views:223
Avg rating:3.0/5.0
Slides: 36
Provided by: eabu
Category:

less

Transcript and Presenter's Notes

Title: Erlang Open Telecom Platform


1
Erlang Open Telecom Platform
  • EAB/UPD/S Ulf Wiger

2
Contents
  • Background
  • The Erlang Language
  • OTP
  • The Erlang/OTP Test Server
  • Experiences

3
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
4
Downloads since Open Source Launch 98
Grouping 6 months
5
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

6
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

7
Erlang Highlights
Solid concurrency modelScales to handle
complexconcurrencySimple abstractions
  • Declarative
  • Concurrency
  • Soft real-time
  • Robustness
  • Distribution
  • Hot code loading
  • External interfaces
  • Portability

8
Erlang Example
Creating a new process using spawn
-module(ex3). -export(activity/3). activity(Nam
e,Pos,Size) -gt
Pid spawn(ex3,activity,Joe,75,1024)
9
Erlang Example
Processes communicate by asynchronous message
passing
receive start -gt stop -gt
data,X,Y -gt end
receive start -gt stop -gt
data,X,Y -gt end
Pid ! data,12,13
10
Erlang Examples 4
Concurrency - Finite State Machine
Selective receive
ringing_B_side(PidA) -gt receive lim,
offhook -gt limstop_ringing(), PidA !
hc, connect, self(), speech(PidA) hc,
cancel, PidA -gt cancel(PidA) lim,
digit, _Digit -gt ringing_B_side(PidA) h
c, request_connection, Pid -gt Pid ! hc,
reject, self(), ringing_B_side(PidA) afte
r 30000 -gt cancel(PidA) end.
True encapsulationof sub-states
Asynchronoussend
Optional timeout
11
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

12
Process creation times (LOG/LOG scale)
gt 200,000processes
Source Joe Armstrong SICS
13
Message passing times (LOG/LOG scale)
gt 200,000processes
Source Joe Armstrong SICS
14
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

15
Erlang Example
Cooperating processes may be linked together
using spawn_link(,,) or link(Pid)
16
Erlang Example
When a process terminates, an exit signal is sent
to all linked processes
and the termination is propagated
17
Erlang Example
Exit signals can be trapped and received as
messages
process_flag(trap_exit,true),...
receive EXIT,Pid,... -gt ... end
18
Erlang Example
Robust systems can be built by layering
Supervisors
Workers
19
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!
20
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

21
Erlang Highlights
Explicit or transparent distribution Network-aware
runtime system
  • Declarative
  • Concurrency
  • Soft real-time
  • Robustness
  • Distribution
  • Hot code loading
  • External interfaces
  • Portability

22
Transparent Distribution
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
23
Simple RPC
rex, Node ! self(), apply, M, F,
A, receive rex, Node, What -gt What end
rex, Node ! self(), apply, M, F,
A, receive rex, Node, What -gt What end
rex, Node ! self(), apply, M, F,
A, receive rex, Node, What -gt What end
loop() -gt receive From, apply, M,
F, A -gt Answer (catch apply(M, F,
A)), From ! rex, node(), Answer
loop() _Other -gt loop() end.
loop() -gt receive From, apply, M,
F, A -gt Answer (catch apply(M, F,
A)), From ! rex, node(), Answer
loop() _Other -gt loop() end.
loop() -gt receive From, apply, M,
F, A -gt Answer (catch apply(M, F,
A)), From ! rex, node(), Answer
loop() _Other -gt loop() end.
loop() -gt receive From, apply, M,
F, A -gt Answer (catch apply(M, F,
A)), From ! rex, node(), Answer
loop() _Other -gt loop() end.
24
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

25
Erlang Example
Version 1
Version 2
26
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

27
Erlang Example
External process
Port
Port ! self(), command, 1,2,3
28
Erlang Example
A port can use e.g. a TCP, UDP, SSL socket,UNIX
pipe, or customtransport (e.g. SAAL)
External process
Port
receive Port, data, Info -gtend
29
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

30
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
31
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
  • ...

32
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

33
Principles of the OTP Test Server
34
Using Erlang as a Test Tool Language
  • Declarative style
  • Program for the correct case
  • Pattern matching used for compact "assertions"
  • EXIT indicates test case failure
  • Easy to spawn worker threads to test concurrency
    patterns
  • Test case cleanup is easy due to local variables,
    process linking and cascading EXITs

35
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

36
Questions?
Write a Comment
User Comments (0)
About PowerShow.com