TNSDL
Encyclopedia
TNSDL stands for TeleNokia Specification and Description Language
Specification and Description Language
Specification and Description Language is a specification language targeted at the unambiguous specification and description of the behaviour of reactive and distributed systems.- Overview :It is defined by the ITU-T...

. TNSDL is based on ITU-T
ITU-T
The ITU Telecommunication Standardization Sector is one of the three sectors of the International Telecommunication Union ; it coordinates standards for telecommunications....

 SDL
Specification and Description Language
Specification and Description Language is a specification language targeted at the unambiguous specification and description of the behaviour of reactive and distributed systems.- Overview :It is defined by the ITU-T...

-88 language. It is used exclusively at Nokia Siemens Networks
Nokia Siemens Networks
Nokia Siemens Networks is a global data networking and telecommunications equipment company headquartered in Espoo, Finland. It is a joint venture between Nokia of Finland and Siemens of Germany...

 for developing applications for telephone exchange
Telephone exchange
In the field of telecommunications, a telephone exchange or telephone switch is a system of electronic components that connects telephone calls...

s.

Purpose

TNSDL is a generic purpose procedural programming language. It is specially suited for developing highly concurrent, distributed applications.

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 a perfect tool for developing internet servers.

Basics

TNSDL is a strongly typed procedural programming language. Its basic capabilities are often compared to C
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

 and Pascal
Pascal (programming language)
Pascal is an influential imperative and procedural programming language, designed in 1968/9 and published in 1970 by Niklaus Wirth as a small and efficient language intended to encourage good programming practices using structured programming and data structuring.A derivative known as Object Pascal...

 languages'.

Multi-processing

In TNSDL processes are created by CREATE command. It is somewhat similar to POSIX
POSIX
POSIX , an acronym for "Portable Operating System Interface", is a family of standards specified by the IEEE for maintaining compatibility between operating systems...

 fork
Fork (operating system)
In computing, when a process forks, it creates a copy of itself. More generally, a fork in a multithreading environment means that a thread of execution is duplicated, creating a child thread from the parent thread....

 or pthread create
POSIX Threads
POSIX Threads, usually referred to as Pthreads, is a POSIX standard for threads. The standard, POSIX.1c, Threads extensions , defines an API for creating and manipulating threads....

 command. TNSDL CREATE command creates either an operating system process or cooperative task. It depends on settings how the new entity is created.

The source code itself does not reflect which scheduling method is used. Still, to avoid certain race condition
Race condition
A race condition or race hazard is a flaw in an electronic system or process whereby the output or result of the process is unexpectedly and critically dependent on the sequence or timing of other events...

s developers may need to be prepared for parallel execution. TNSDL explicitly supports critical section
Critical section
In concurrent programming a critical section is a piece of code that accesses a shared resource that must not be concurrently accessed by more than one thread of execution. A critical section will usually terminate in fixed time, and a thread, task or process will have to wait a fixed time to...

s 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

TNSDL supports actor model
Actor model
In computer science, the Actor model is a mathematical model of concurrent computation that treats "actors" as the universal primitives of concurrent digital computation: in response to a message that it receives, an actor can make local decisions, create more actors, send more messages, and...

 and processes to be designed as event-driven finite state machine
Event-driven finite state machine
In computation, a finite-state machine is event driven if the transition from one state to another is triggered by an event or a message...

s. Inter-process communication
Inter-process communication
In computing, Inter-process communication is a set of methods for the exchange of data among multiple threads in one or more processes. Processes may be running on one or more computers connected by a network. IPC methods are divided into methods for message passing, synchronization, shared...

 is done by asynchronous message passing
Message passing
Message passing in computer science is a form of communication used in parallel computing, object-oriented programming, and interprocess communication. In this model, processes or objects can send and receive messages to other processes...

. OUTPUT command sends a message, while INPUT statements define the expected messages.

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

State machines can be optionally used so that not to process 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.


DCL WITHWARMING /* Data to be live-migrated */
query_process pid; /* PID of query_signal sender */

CONSTANT time_to_wait = 10; /* Timeout of database response */

TIMER db_timeout_timer; /* Timer of database response */

STATE idle; /* Idle state, wait for query signal */
INPUT query_signal(DCL input_data);
DCL
db_query db_query_type; /* Local variable, stored on stack. */
TASK query_process := SENDER; /* Sender address saved to specific memory area, which is preserved even on software update.*/
TASK db_query.field1 := some_procedure(input_data),
db_query.field2 := input_data.field1;
OUTPUT db_request_signal(db_query) TO db_process; /* Send request to database process */
SET(NOW + time_to_wait, db_timeout_timer); /* Start database response timer */
NEXTSTATE wait_db; /* Enter wait_db state where database response is expected */
ENDSTATE idle;

STATE wait_db;
INPUT db_response_signal(DCL answer_data);
RESET(db_timeout_timer) COMMENT 'Database answered in time';
OUTPUT answer_signal(answer_data.records) TO query_process;
NEXTSTATE idle;

INPUT db_timeout_timer; /* Timeout */
OUTPUT error_signal(error_constant) TO query_process;
NEXTSTATE idle;
ENDSTATE wait_db;


Comments:
  • State machine prevents any new query_signal to be processed while waiting for database program answer.
  • WITHWARMING means that when another computer takes over the role of the current computer, then copy that data (variable) to the new computer. Therefore if hardware change or software update happens while waiting for database answer, the address of the query sender is not lost and the answer can be delivered properly.


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


STATE idle COMMENT 'Idle state';
INPUT are_you_busy;
OUTPUT no TO SENDER;
NEXTSTATE -; /* No state change */
/* ... other input handlers */
ENDSTATE idle;

STATE *(idle) COMMENT 'Any state, except idle';
INPUT are_you_busy;
OUTPUT yes TO SENDER;
NEXTSTATE -; /* No state change */
ENDSTATE *(idle);

STATE * COMMENT 'Any state';
INPUT are_you_alive;
OUTPUT yes TO SENDER;
NEXTSTATE -; /* No state change */
ENDSTATE *;

Compiling

TNSDL does not have a compiler. Instead, the code is translated to C language
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

. The sole purpose of TNSDL is to make message handling, state machine definition and data warming easy to be coded. Processor specific optimization is the task of the C compiler used.

After translating TNSDL to C, generic C compilers, linkers, coverage measurement and profiling tools can be used. To make source level debugging possible TNSDL puts line number references to generated C code.

TNSDL code can call routines implemented in other languages, if objects or libraries are present for them. Even C language macros
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

 can be used, if C header files are present. Declarations must be made available for TNSDL translator.

TNSDL translator is a proprietary tool.

Use

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

TNSDL is actively used and developed programming language used by thousands of developers (in 2010).

TNSDL is mainly used in Nokia Siemens Networks for developing software for SGSN, BSC etc.

History

1980s: At the beginning ITU-T
ITU-T
The ITU Telecommunication Standardization Sector is one of the three sectors of the International Telecommunication Union ; it coordinates standards for telecommunications....

 SDL
Specification and Description Language
Specification and Description Language is a specification language targeted at the unambiguous specification and description of the behaviour of reactive and distributed systems.- Overview :It is defined by the ITU-T...

 had a graphical syntax. Textual syntax was introduced later. Similarly, a graphical tool and code generator was developed within Nokia
Nokia
Nokia Corporation is a Finnish multinational communications corporation that is headquartered in Keilaniemi, Espoo, a city neighbouring Finland's capital Helsinki...

.

1990: ITU-T
ITU-T
The ITU Telecommunication Standardization Sector is one of the three sectors of the International Telecommunication Union ; it coordinates standards for telecommunications....

 SDL
Specification and Description Language
Specification and Description Language is a specification language targeted at the unambiguous specification and description of the behaviour of reactive and distributed systems.- Overview :It is defined by the ITU-T...

shifted towards text-based representation. Based on SDL-88 specification TNSDL was born. TNSDL is a simplified and heavily customized variant of SDL-88.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK