Software System
Software System
Table of Contents
i
Technical Manual Chapter 4
C&C08 Digital SPC Switching System Software System
A task is also called a process. It can be defined as a program unit that is dispatched by
the operating system and executed by the CPU. Task management is designed
according to each task's dynamic features, simultaneous features and the
asynchronous relevance between different tasks. With this concept, the process logic
involved in completing the various tasks in C&C08 can be clearly described.
C&C08 Software System can be divided into communication task, resource
management task, call processing task, database management task and maintenance
task. They are all carried out under the control and administration of the C&C08
Operating System.
I. Task status
4-1
Technical Manual Chapter 4
C&C08 Digital SPC Switching System Software System
Executing state
Time
Su
Call
sp
slot
en
e
d
l et
De
Ready state
te
ea E ve
Cr nt o
te c cu
D ele rs
Dormant state Suspended state
Delete
C&C08 Operating System adopts the preemptive dispatch scheduling strategy based
on task priority and event priority. High priority task in ready status is always executed
first by CPU. Tasks in the same priority level are executed according to the sequence of
the time when they enter the ready status. In C&C08 Switching System, each created
task is given a priority number (0-255). The smaller the number, the higher is the priority.
"0" stands for the highest priority in the system.
Sometimes a high priority task T1 is suspended and waits for necessary resource, but
the resource is occupied by a task T2 whose priority level is lower than T1, then the
high priority task is blocked by lower priority task. This is known as priority inversion. If
T2 has to repeat the execution several times, before the resource that has been
engaged can be released, the waiting time for T1 will be very long as the low priority T2
takes a long time to be scheduled each time. Thus, it is hard to guarantee the real-time
execution of a high priority task T1. C&C08 Operating System uses the priority
inheritance technology to solve this problem. When a high priority task is blocked by a
low priority task, the low priority level task can be promoted to a higher priority level so
that it can be scheduled fast and its resource occupying time can be shortened.
If a high priority task is triggered into ready state by some event when some task with
lower priority is being executed, the high priority task can interrupt the lower priority task
and make it suspended to seize the CPU control right, to fulfill the real time requirement
of the system.
In C&C08 Switching System, every created task is given a unique ID, named a task
number. Each task is made up of two parts: one is initialization and the other is event
process. "Event" mainly refers to message event; hence, it is also called message
process. Static task architecture description is as shown in Figure 4-2:
4-2
Technical Manual Chapter 4
C&C08 Digital SPC Switching System Software System
Initilization
Message process
In C&C08 Switching System, each task is formed by the above architecture. The
shaded area is the special part unique to each task's realization.
A task can be described as follows (with C language) according to this architecture:
{
Initialization ( ); /*initialization*/
While (TRUE)
{
Suspended ( ); /*suspended status, not occupy CPU resource */
Message process( ); /*executing status, occupying CPU resource */
}
}
Tasks are driven by events. When a task is created, it first completes self-initialization,
then suspends itself and waits for event happening. When some event happens, the
operating system sets the task to ready state. By task scheduling, task in ready status
can be executed and corresponding events be processed. When event processing is
completed, the task is suspended again, waiting for another event.
In C&C08 Switching System, events include: message event, timing event and
interruption event.
In C&C08 Operating System, there are many tasks, which operate in an asynchronous
way, but they are not completely independent to each other. The operating system must
manage these tasks to keep the whole system running in a coordinated way, since
there exists a constraint of the resources that are shared by these tasks.
In C&C08 Switching System, there are two kinds of task relationships, namely resource
exclusion and logical synchronization. Resource exclusion means that even though
certain resources are shared between some tasks, at any given moment, these
resources can be occupied by only one of these tasks. Logical synchronization means
that there is a certain sequential relationship among tasks, that is, when some task has
been executed to a certain point, then only, another task can be executed continuously.
In C&C08 Switching System, task exclusion is coordinated by semaphore or by on/off
interruption mode. Task synchronization is guaranteed by event message. When some
task has been executed to a certain point, some messages are sent to activate other
tasks.
Interrupt Service Request (ISR) includes:
z Clock interruption provides the system with real time clock and timer services.
4-3
Technical Manual Chapter 4
C&C08 Digital SPC Switching System Software System
z Port interruption receives the frames and other signals coming from the other
ports.
z Exception interruption is for system exception handling. The interruption process
can send message or set directly the semaphore for other tasks.
I. Message description
In C&C08 Switching System, message is managed with queue method. The three
types of message queues are, idle queue, application queue and ready queue. Each
queue is realized by linked list, as shown in Figure 4-3:
4-4
Technical Manual Chapter 4
C&C08 Digital SPC Switching System Software System
......
Idle queue head ...... .........
......
Application queue head ...... .........
......
Ready queue head ...... .........
There are only one idle queue and one application queue in the system, while ready
queue corresponds one to one to each task. Messages in the ready queue of a task are
organized according to their priority and sending sequence. Messages of the same
priority are organized by message sending time sequence. In ready message queue,
the message unit structure is as follows:
struct Msg_link
{
4-5
Technical Manual Chapter 4
C&C08 Digital SPC Switching System Software System
Idle queue
Alloc_message_block
Application queue
Free_message_block
Memory management is an important part of the operating system and it includes the
following:
z Memory allocation and release
z Memory test and protection
z Address conversion
z Memory expansion
With the embedded application feature of C&C08 Switching System, the memory
allocation and release is not so frequent, i.e. a memory once allocated will be used
generally for a rather long period. Hence, the system organizes memory by link table,
and allocate memory block by Best-Fit algorithm. Best-Fit algorithm searches for an
idle block on the idle link with the size nearest to the size that is applied, so that the
space occupied by memory fragments can be effectively decreased and the memory
utilization rate increased. A memory control block structure is as the following:
struct Memctrl_block
{
unsigned char flag[2]; //memory block mark
unsigned long next; //initial address of the next memory block
unsigned long prev; //initial address of the previous memory block
unsigned long size; //memory block length(byte)
unsigned char owner_task; //belongs to which task
unsigned char state; //memory block status(idle/used)
4-6
Technical Manual Chapter 4
C&C08 Digital SPC Switching System Software System
};
A memory link can be illustrated in Figure 4-5:
Next Next
next Next
… ..
In Figure 4-5, the blank part is the memory control block, and the green-colored area
followed is the usable memory block. The following example demonstrates by example,
how the memory block is applied for and how the memory space is split:
1) A 1024 bytes idle memory block (control block occupies 16 bytes):
16 1024 bytes
Control
Free
block
Control Control
Allocated block Free
block
16 1024
Control
Free
block
System call functions related with memory operation provided by C&C08 Operating
System are:
4-7
Technical Manual Chapter 4
C&C08 Digital SPC Switching System Software System
C&C08 Software adopts the flat mode, which means all the data and program codes
are stored in a single segment. Here, memory protection is the prevention of cross
boundary usage of memory. There is a memory block flag in the memory control block
which occupies 2 bytes, where two special letters, M or Z, are stored to indicate
whether this memory block is normal (not corrupted). If the flag content is different from
M or Z, it means that the memory block has been corrupted.
C&C08 Operating System checks the legality of each memory control block on memory
link regularly, for example, whether the flag is M or Z, whether the block content lies in
effective scope, etc. If something erroneous is found, then error-tolerance processing
must be activated. Tasks in the destroyed memory area will be stopped and rebuilt.
Memory expansion is also called virtual memory. System creates a memory space,
which is much larger than and not limited by the physical memory capacity. Thus the
programmer is not be restricted by the specific physical memory structure and capacity.
The two basic ideas to implement memory expansion are:
z To separate program address space and memory physical space;
z To relocate the program address to physical address;
The model of this process is illustrated in Figure 4-6.
4-8
Technical Manual Chapter 4
C&C08 Digital SPC Switching System Software System
Mapping table
a: Program address
a': Memory address
If a memory address cannot be found in the mapping table, it means that some
information in the program space is located in an external memory. In such a case, the
system loads external memory content into memory, modifies the address mapping
table, and converts the address. Memory expansion is realized through occupying
external disk space as memory and utilizing CPU to exchange the stored contents
between internal and external memories.
4-9
Technical Manual Chapter 4
C&C08 Digital SPC Switching System Software System
C&C08 Switching System increases the overall reliability and its self-recovery ability by
providing two important system recovery levels: 1) Restart and 2) Booting & Loading.
Restart executes the booting operation and depending on the restart level decides
whether to load the whole system again. Loading is a higher level system recovery
method, where program and data from BAM is reloaded into the memory, and the
whole system is reinitialized and loaded.
I. Restart
C&C08 Switching System provides the restart function at four levels to meet the needs
of various operation environments and terminal maintenance. The specific functions
and their effects are as follows:
1) Level 1 restart
z Does not affect tickets but affects the calls in connection
z Does not affect ongoing calls
z Does not load data or program
2) Level 2 restart: This restart initializes all module control variables and status
control variables, and does not affect tickets but affects the calls in connection
z Affects connected calls
z Does not load data or program
3) Level 3 restart: This restart reconstructs the whole system, loads only data and not
program from BAM.
4) Level 4 restart: This restart reconstructs the whole system, loads both data and
program from BAM.
C&C08 combines the programs for booting & loading and fixes them in the ROM. In
ROM, the Basic Input and Output System (BIOS) occupies 512 bytes, and following is
the loading program.
1) ROM BIOS booting
When system is powered on, the ROM BIOS will start first to initialize the MPU
hardware, including memory, clock and interruption, and shifts itself and the loading
program into low memory area, to continue with the software initialization. After that,
the loading program gets executed.
2) Loading
Loading program runs in protection mode for the convenience to access upper memory.
The execution process is as follows:
z Initializes global description symbol table, interruption description symbol table,
local description symbol table, and enters protection mode.
z Initiates timer interruption
4-10
Technical Manual Chapter 4
C&C08 Digital SPC Switching System Software System
z Reads hardware switch set (or software switch in remote control mode), to decide
whether to load from BAM or from FLASH memory. Either only data or program, or
both of them together can be loaded from BAM. The part, which is not loaded from
BAM, is to be loaded from FLASH. The capacity of program and data FLASH can
be configured through jumper settings on MPU card, to meet various operation
requirements. When the switch is set to the loading from FLASH position, loading
program will first verify whether the program and data in the FLASH memory are
usable. If not, then the loading program will request automatically, to load from
BAM.
z Chooses loading path: The capacity of a C&C08 Exchange can expand
effortlessly from 256 lines to 800,000 lines, and can be configured as either a
multi-SM exchange or a single-SM exchange. Different configurations need
different loading paths.
z Establishes connection with BAM.
z Loads program and data into appropriate memory locations.
z Checks the program and data, reloads if they are not correct.
z If correct, decides according to hardware switches setting, whether to copy the
program and data into FLASH memory or not. If yes, executes copying. Finally
loads them into memory.
z Executes the program, and the exchange becomes functional.
Protocol concept described in the normal usage language- is very vague. The Finite
State Machine (FSM) of communication protocol must be described accurately with
formula descriptive language, and be able to verify them. In C&C08 Communication
Protocol Software realization, Specification Description Language (SDL)
recommended by ITU-T is used to support the layered, modular and structured
software development. Communication protocol software is realized automatically on
the basis of formula descriptive SDL.
4-11
Technical Manual Chapter 4
C&C08 Digital SPC Switching System Software System
4-12
Technical Manual Chapter 4
C&C08 Digital SPC Switching System Software System
it guarantees that the subscribers can communicate with each other via unified
standards.
In testing, the side performing the test is called the main testing system (or testing
center), while the tested side is called implementation under test (IUT). Main testing
system and IUT jointly form the complete protocol testing system. To ensure protocol
completeness, main testing system not only uses protocol data and valid parameters at
various levels to test the system and check the responds, but also generates erroneous
and invalid data too and input them to the tested system to verify whether the system
can handle abnormal situations in comparison with the prescribed standards. The
tested side must possess the test responding function. Each layer serves for its upper
layer, and can be repetitively called by accepting the service primitives sent by its upper
layer. When the function of a certain layer is being tested, its adjacent-leveled layer
should also be added a test responding module to respond to the testing series sent
from the main testing system. Test responding module must be adaptable to the system
structure of the main testing system, as well as the testing methods and testing
functions required by it.
Actually, the test system structure decides the test methods. What is shown in Figure
4-7 is the standard test structure for OSI.RM. By this method, whenever a certain layer
is tested, it is under the assumption that all its lower layers have passed the
corresponding tests.
The testing system comprises 3 physical parts: active tester (AT), IUT and
communication media. AT is the key part of the testing center; it controls the whole work
of the testing system, which is shown in Figure 4-7 and checks for all the possible error
types in the tested system. It has functional modules, such as test control module,
communication media managing module, environment operation and monitoring
module, etc.
Test driver
Test driver Responding protocol Test respondent
Neighboring upper
Neighboring upper layer layer protocol tested protocol
Protocol + coder/decoder Error realization (IUT)
Current layer
Current layer protocol protocol Current layer protocol
realization error generator realization
Various switching functions in C&C08 are controlled and accomplished by the program.
While the introduction and deletion of these functions are realized by data stored in the
exchange, the data is usually stored and managed concentrically. This collective data
forms the database and data management is realized by Database Management
4-13
Technical Manual Chapter 4
C&C08 Digital SPC Switching System Software System
System (DBMS). All the data is extracted from BAM, by Man Machine Language (MML),
which conforms to the ITU-T Z.300 series recommendations.
Database in C&C08 is of a relative mode and it arranges its data using some
two-dimensional tables where storage of the data is done in relation to each other
through certain linkages. These tables are called relation tables. Each row in the
relation table is a tuple, and each column is a field. Each tuple forms a logical record,
whose number depends upon that table's property. For example, in equipment
description table, the number of tuples is equal to the total number of equipments. Field
number is according to the logical complexity of a table. With relation tables, it is easier
to program and carry out its application.
I. Data dictionary
Data definition in DBMS is described by the data dictionary, which is divided into
relation description table and field description table. Relation description table
describes the table structure, including:
z Table type: This defines the types of relation table, i.e. whether it is a sequence
table, sorted table or a direct index table.
z Tuple length: This gives the table tuple length in bytes.
z Maximum tuple in a table: This is the maximum number of tuples in a particular
relation table.
z Actual table tuple in working area: This is the actual table tuple number in the
working area.
z Actual table tuple in non-working area is the actual table tuple number in the
non-working area.
z Field number: This is the total number of fields in a relation table.
z Field definition pointer: This points to the field definition table. Field definition can
be found in field definition table with this pointer.
z Index field number is the number of the index fields (key fields) in a table
z Default tuple number: this is the number of the default tuples in a table
z Table lock mark is used to identify whether the table is in writing forbidden mode.
z Storage address of working area table is the relative address pointer of working
area table
z Storage address of non-working area table is the relative address pointer of
non-working area table
z Version number of working area table is the table version in working area
z Version number of non-working area is the table version in non-working area
z Checksum of working area table: is the table checksum of this working area
z Checksum of non-working area table is the table checksum of non-working area
z Table modification mode describes the modification mode of a relation table, and
there are such options as single item modification, whole table modification and
modification not allowed.
Field description table defines each field, including:
z Data type: It is the data type of a field
z Field length: It is the field length in bytes
4-14
Technical Manual Chapter 4
C&C08 Digital SPC Switching System Software System
z Sort mode is the type of mode in relation table, including ascending mode and
descending mode
z Sort sequence number is the sort sequence number of a field in relation table
z Wildcard: This is a wildcard of field value in relation table
Table type description is done in relation to description table of the data dictionary.
C&C08 database uses three types of relation tables:
z Direct index table: This table can be accessed directly through the tuple number.
As the tuple number is not a part of the relation table, insertion or deletion
operation of a tuple does not affect the table order.
z Sequence table: All tuples in a table are arranged in sequence. Searching of a
record begins from the first tuple and proceeds sequentially. A newly added tuple
is located at the end of the table.
z Sorted table: Tuples in relation table are sorted according to the value of key
words. There should not exist two tuples which are the same in sorted filed (key
field) values. If there are many key fields, each key field is assigned a sorting
mode (ascending or descending) and a sorting number and the key with the
smallest sorting sequence number is sorted first. The query for the sorted table
employs binary tree search method. Tuple insertion and deletion will cause the
movement of the following tuples.
1) System data is the data inherent in software itself, including software parameters,
timers and event description, etc.
2) Prefix data is related with call number prefix. It is used as number prefix analysis
data, reflecting ordinary number planning scheme, billing, new service number
format, number allocation and route scheme, etc.
3) Trunk data describes inter-exchange route, circuit and signaling coordination data,
including Common Channel Signaling and Channel Associated Signaling.
4) User data describes local office subscribers, PABX subscribers, the mapping
between subscriber number and equipment number, etc.
4-15
Technical Manual Chapter 4
C&C08 Digital SPC Switching System Software System
C&C08 DBMS uses distributed relation database. This feature "distributed" means that
in each module part of the data is stored, including global data, global link table and
private data. Data in the same module is stored in a relational mode and managed
uniformly by the relational database subsystem Relational database sub-systems
among modules are relatively independent and are consistent. From the physical point
of view, a sub-system is a separate part of the entire database system. From the logical
point of view, these database sub-systems are organic entities and make up the
distributed relational DBMS. Multiple local databases construct the global database
function by coordinating with each other. The database structure of each module is as
shown in Figure 4-8:
C&C08 AM/CM
database
DBMS DB
SM SM
DBMS DBMS
DB DB
Database Database
Relation model uses two-dimension tables that may be operated with algebraic
association to describe the correlation between entity properties and relationship
between entities. It sums up the data logical structure as a two-dimensional table,
which can satisfy certain conditions, and the table is called a "relation". The main
feature of the relation model is that not only data in the table but also data relation is
expressed by the two-dimensional table.
4-16
Technical Manual Chapter 4
C&C08 Digital SPC Switching System Software System
I. Database
Database consists of many relation tables, which are loaded into the MPU memory
from BAM and backed up in the FLASH memory. DBMS queries the database in RAM
without any disk file operation, thus ensuring that the query speed is very fast. Any
modification to data is backed up in FLASH immediately, to prevent data loss when
there is a power failure.
Database occupies a segment of continuous address space, paged by 128 bytes or
256 bytes. Its structure is shown in Figure 4-9.
System data (1024 byte)
Data dictionary
Data table
The data dictionary describes the relation table structure of C&C08 Database. Data
dictionary itself is a relation table. There are two data dictionary tables: one is table
description table, the other is field description table.
C&C08 Switching System uses modular distributed control mode. Each module owns
its related data according to the functions. C&C08 Switching System Database is the
data aggregation of all modules. The physical position of each relation table in the
database is arranged according to requirement.
Under certain circumstances, one module may need only a part of the data in a certain
relation table and some other module may need other parts of the data from the same
table. To avoid redundancy, the relation table is divided into different parts. Each
module stores only the needed tuples. In this way, the table is distributed in different
modules.
Under some other circumstances, a group of modules may need the same data from
one relation table. If only one relation table contains this data in the database, then it
takes a very long time to save and withdraw this data because all data requests are
sent to the module for processing. To avoid this, a data copy can be saved in the
module needing this data, that is, this relation table can be copied into different
modules.
4-17
Technical Manual Chapter 4
C&C08 Digital SPC Switching System Software System
and data maintenance module. Call processing module provides database query and
search for call processing. Data maintenance module works together with terminal
database management system to complete on-line data modification, query and other
database maintenance operations.
C&C08 Database has 3 search methods. Search method and related information of the
table can be found in data dictionary:
1) Sequence search
All tuples are arranged in sequence. Each search starts from the first tuple, then the
second until the needed tuple is found. Newly added tuple is put at the end of the table.
Frequently queried tuples are put in front.
2) Index access
A relation table is accessed through the index field of the index table. It is suitable for
direct index table. The index field of the index table is invisible and not the real part of
the table to be queried.
Usually, key field values are arranged in sequence to form an index. If there are too
many indices, they can be divided to set up several level indices.
3) Binary search
Binary search starts from mid-position in the table. If the conditional value (composed
of several key fields) is larger than entrance value, then it will compare the value with
mid-value of lower part (key fields arranged from small to large in dictionary order) and
continue with this kind of comparison until the needed tuple is located.
The binary searching is a very fast query algorithm. Its disadvantage is that it is
complicated to insert or delete a tuple because in these cases relation table needs to be
reorganized and sorted.
4-18
Technical Manual Chapter 4
C&C08 Digital SPC Switching System Software System
4-19
Technical Manual Chapter 4
C&C08 Digital SPC Switching System Software System
LOD
Idle Deactive
RMV
CFM
Running Active
4.
4-20