TNSDL

Last updated

TNSDL stands for TeleNokia Specification and Description Language. TNSDL is based on the ITU-T SDL-88 language. It is used exclusively at Nokia Networks, primarily for developing applications for telephone exchanges.

Contents

Purpose

TNSDL is a general-purpose procedural programming language. It is especially well-suited for developing highly concurrent, distributed systems. [1]

It was originally designed for programming circuit switched exchanges. As the world shifted towards packet-switched and internet-based telecommunication, TNSDL turned out to be an excellent fit for developing internet servers, too.

Design

TNSDL is a very simple, easy-to-learn programming language.

Basics

TNSDL is a strongly typed procedural programming language. Its basic capabilities are comparable to the C and Pascal languages.

Multi-processing

In TNSDL processes are created by the CREATE command. (It is somewhat similar to the POSIX fork or pthread_create commands.) The CREATE command creates either an operating system process or a cooperative task.

The process model can be selected by configuration. The source code itself does not reflect which scheduling method is used. Still, to avoid certain race conditions, developers may need to be prepared for parallel execution. TNSDL explicitly supports critical sections to be marked in the code.

In case of cooperative multitasking a program is scheduled as one operating system process. When a cooperative thread enters the state of waiting for asynchronous input, another thread of the program may run.

Message passing

The feature of TNSDL is the actor model. Processes are meant to be designed as event-driven finite state machines. Inter-process communication is done by asynchronous message passing. The OUTPUT command sends a message, while INPUT statements define the expected messages.

Timers, from TNSDL perspective, are delayed messages. Just like ordinary messages, timer expiration is handled by the INPUT statement. The SET command starts and the RESET command cancels a timer.

State machines can be optionally used, for example, to prevent accepting certain input messages at some stage of the processing.

The following code piece demonstrates a server, which receives a query signal (message), contacts a database process to obtain the necessary data and finally sends an answer signal.

DCLWITHWARMING/* Data to be live-migrated (on platforms supporting "warming") */query_processpid;/* PID of query_signal sender */CONSTANTtime_to_wait=10;/* Timeout of database response */TIMERdb_timeout_timer;/* Timer of database response */STATEidle;/* Idle state, wait for query signal */INPUTquery_signal(DCLinput_data);DCLdb_querydb_query_type;/* Local variable, stored on stack. */TASKquery_process:=SENDER;/* Sender address saved to specific memory area, which is preserved even on software update.*/TASKdb_query.field1:=some_procedure(input_data),db_query.field2:=input_data.field1;OUTPUTdb_request_signal(db_query)TOdb_process;/* Send request to database process */SET(NOW+time_to_wait,db_timeout_timer);/* Start database response timer */NEXTSTATEwait_db;/* Enter wait_db state where database response is expected */ENDSTATEidle;STATEwait_db;INPUTdb_response_signal(DCLanswer_data);RESET(db_timeout_timer)COMMENT'Databaseansweredintime';OUTPUTanswer_signal(answer_data.records)TOquery_process;NEXTSTATEidle;INPUTdb_timeout_timer;/* Timeout */OUTPUTerror_signal(error_constant)TOquery_process;NEXTSTATEidle;ENDSTATEwait_db;

Comments:

TNSDL allows inputs to be tied to several or all of the states. An input signal may have state-specific behavior, if needed.

STATEidleCOMMENT'Idlestate';INPUTare_you_busy;OUTPUTnoTOSENDER;NEXTSTATE-;/* No state change *//* ... other input handlers */ENDSTATEidle;STATE*(idle)COMMENT'Anystate,exceptidle';INPUTare_you_busy;OUTPUTyesTOSENDER;NEXTSTATE-;/* No state change */ENDSTATE*(idle);STATE*COMMENT'Anystate';INPUTare_you_alive;OUTPUTyesTOSENDER;NEXTSTATE-;/* No state change */ENDSTATE*;

Differences from SDL-88

Nokia has made several modifications to the language, [2] mainly including simplifications and additions, such as:

Compiling

TNSDL is not directly compiled to machine code. Instead, TNSDL programs are translated to C language source code. The responsibility of TNSDL is to allow message handling, state machine definitions, synchronizing parallel execution, "data warming" etc. easily and safely coded. The task of processor-specific code generation and low-level optimization is delegated to the C compiler used.

After translating TNSDL to C, any standard-compliant C compiler, linker, coverage measurement and profiling tool can be used. To make source-level debugging possible TNSDL puts line number references to the generated C code.

TNSDL code can call routines implemented in other languages, if objects or libraries are present for them. Even C language macros can be used, if C header files are present. External declarations must be made available to the TNSDL translator.

The TNSDL translator is a proprietary tool. A source code (reachability) analyser has also been developed specifically for TNSDL. [3]

Use

TNSDL is commonly used on the DX 200, IPA 2800 and Linux platforms for high-performance, high-availability applications.

TNSDL is an actively used and developed programming language used by thousands of developers (in 2010).[ citation needed ]

TNSDL is mainly used at Nokia Networks for developing software for SGSNs, BSCs, mobile switching centers, application servers both in traditional setups and as virtual network functions (VNF) of NFV solutions.

Similar programming languages

Despite the difference in syntax, probably one of the closest relative of TNSDL is Go language. Both languages has light-weight processes in their focus. Go's channel are similar to TNSDL INPUTs and Go's select statement on channels allows very similar program design. There are differences, though. TNSDL uses asynchronous message passing between actors, while channels in Go can either be synchronous or asynchronous (buffered). TNSDL allows message passing between processes running on the same or separate computer nodes. In that aspect TNSDL is a relative of Erlang.

Even though in TNSDL one can define operators for types and protect structure attributes to be accessible via those operators only, TNSDL is not an object-oriented language. In that aspect it belongs to the family of non-OOP procedural programming languages, such as C language.

History

1980s: In the beginning, ITU-T SDL had a graphical syntax. Textual syntax was introduced later. A corresponding graphical tool and code generator were developed within Nokia.

1990: ITU-T SDL shifted towards text-based representation. Based on the SDL-88 specification TNSDL was born. TNSDL is a simplified and heavily customized variant of SDL-88.

Related Research Articles

Interrupt signal to the processor emitted by hardware or software indicating an event that needs immediate attention

In digital computers, an interrupt is a response by the processor to an event that needs attention from the software. An interrupt condition alerts the processor and serves as a request for the processor to interrupt the currently executing code when permitted, so that the event can be processed in a timely manner. If the request is accepted, the processor responds by suspending its current activities, saving its state, and executing a function called an interrupt handler to deal with the event. This interruption is temporary, and, unless the interrupt indicates a fatal error, the processor resumes normal activities after the interrupt handler finishes.

In automata theory, sequential logic is a type of logic circuit whose output depends not only on the present value of its input signals but on the sequence of past inputs, the input history as well. This is in contrast to combinational logic, whose output is a function of only the present input. That is, sequential logic has state (memory) while combinational logic does not.

In computer science, message queues and mailboxes are software-engineering components typically used for inter-process communication (IPC), or for inter-thread communication within the same process. They use a queue for messaging – the passing of control or of content. Group communication systems provide similar kinds of functionality.

Watchdog timer electronic timer used to detect and recover from computer malfunctions

A watchdog timer is an electronic or software timer that is used to detect and recover from computer malfunctions. During normal operation, the computer regularly resets the watchdog timer to prevent it from elapsing, or "timing out". If, due to a hardware fault or program error, the computer fails to reset the watchdog, the timer will elapse and generate a timeout signal. The timeout signal is used to initiate corrective actions. The corrective actions typically include placing the computer system in a safe state and restoring normal system operation.

Code injection is the exploitation of a computer bug that is caused by processing invalid data. Injection is used by an attacker to introduce code into a vulnerable computer program and change the course of execution. The result of successful code injection can be disastrous, for example by allowing computer worms to propagate.

In computer science, message passing is a technique for invoking behavior on a computer. The invoking program sends a message to a process and relies on that process and its supporting infrastructure to then select and run some appropriate code. Message passing differs from conventional programming where a process, subroutine, or function is directly invoked by name. Message passing is key to some models of concurrency and object-oriented programming.

A delay-insensitive circuit is a type of asynchronous circuit which performs a digital logic operation often within a computing processor chip. Instead of using clock signals or other global control signals, the sequencing of computation in delay-insensitive circuit is determined by the data flow.

In digital electronics, an asynchronous circuit, or self-timed circuit, is a sequential digital logic circuit which is not governed by a clock circuit or global clock signal. Instead it often uses signals that indicate completion of instructions and operations, specified by simple data transfer protocols. This type of circuit is contrasted with synchronous circuits, in which changes to the signal values in the circuit are triggered by repetitive pulses called a clock signal. Most digital devices today use synchronous circuits. However asynchronous circuits have the potential to be faster, and may also have advantages in lower power consumption, lower electromagnetic interference, and better modularity in large systems. Asynchronous circuits are an active area of research in digital logic design.

In computer science, asynchronous I/O is a form of input/output processing that permits other processing to continue before the transmission has finished.

Specification and Description Language (SDL) is a specification language targeted at the unambiguous specification and description of the behaviour of reactive and distributed systems.

Concurrent computing is a form of computing in which several computations are executed concurrently—during overlapping time periods—instead of sequentially, with one completing before the next starts.

In computer science, the event loop is a programming construct or design pattern that waits for and dispatches events or messages in a program. The event loop works by making a request to some internal or external "event provider", then calls the relevant event handler. The event loop is also sometimes referred to as the message dispatcher, message loop, message pump, or run loop.

Polling, or polled operation, in computer science, refers to actively sampling the status of an external device by a client program as a synchronous activity. Polling is most often used in terms of input/output, and is also referred to as polled I/O or software-driven I/O.

Functional reactive programming (FRP) is a programming paradigm for reactive programming using the building blocks of functional programming. FRP has been used for programming graphical user interfaces (GUIs), robotics, games, and music, aiming to simplify these problems by explicitly modeling time.

In programming and software design, an event is an action or occurrence recognized by software, often originating asynchronously from the external environment, that may be handled by the software. Computer events can be generated or triggered by the system, by the user, or in other ways. Typically, events are handled synchronously with the program flow; that is, the software may have one or more dedicated places where events are handled, frequently an event loop. A source of events includes the user, who may interact with the software through the computer's peripherals - for example, by typing on the keyboard. Another source is a hardware device such as a timer. Software can also trigger its own set of events into the event loop, e.g. to communicate the completion of a task. Software that changes its behavior in response to events is said to be event-driven, often with the goal of being interactive.

PROMELA is a verification modeling language introduced by Gerard J. Holzmann. The language allows for the dynamic creation of concurrent processes to model, for example, distributed systems. In PROMELA models, communication via message channels can be defined to be synchronous, or asynchronous. PROMELA models can be analyzed with the SPIN model checker, to verify that the modeled system produces the desired behavior. An implementation verified with Isabelle/HOL is also available, as part of the Computer Aided Verification of Automata project. Files written in Promela traditionally have a .pml file extension.

In computing, input/output or I/O is the communication between an information processing system, such as a computer, and the outside world, possibly a human or another information processing system. Inputs are the signals or data received by the system and outputs are the signals or data sent from it. The term can also be used as part of an action; to "perform I/O" is to perform an input or output operation.

The POSIX terminal interface is the generalized abstraction, comprising both an Application Programming Interface for programs, and a set of behavioural expectations for users of a terminal, as defined by the POSIX standard and the Single Unix Specification. It is a historical development from the terminal interfaces of BSD version 4 and Seventh Edition Unix.

Join-patterns provides a way to write concurrent, parallel and distributed computer programs by message passing. Compared to the use of threads and locks, this is a high level programming model using communication constructs model to abstract the complexity of concurrent environment and to allow scalability. Its focus is on the execution of a chord between messages atomically consumed from a group of channels.

Asynchrony, in computer programming, refers to the occurrence of events independent of the main program flow and ways to deal with such events. These may be "outside" events such as the arrival of signals, or actions instigated by a program that take place concurrently with program execution, without the program blocking to wait for results. Asynchronous input/output is an example of the latter cause of asynchrony, and lets programs issue commands to storage or network devices that service these requests while the processor continues executing the program. Doing so provides a degree of parallelism.

References

  1. Jeannette M. Wing; Jim Woodcook; Jim Davies, eds. (1999). FM'99 - Formal Methods: World Congress on Formal Methods, 1999, Proceedings. Springer. ISBN   3540665870.
  2. Jyrinki, Tero (1997). "Dynamical analysis of SDL programs with Predicate/Transition nets". Helsinki University of Technology, Digital Systems Laboratory: 22.Cite journal requires |journal= (help)
  3. Husberg, Nisse; Malmqvist, Markus; Jyrinki, Tero (1996). "Emma: A Tool For Analysis of SDL Programs". CiteSeerX   10.1.1.30.3240 .Cite journal requires |journal= (help)