Documente Academic
Documente Profesional
Documente Cultură
Li Yuanyuan2, Deng Wu 3
Xiao Peng1
Software College
Information Science& Engineering College
Dalian Jiaotong University
Dalian Polytechnic University
Dalian, China
Dalian, China
e-mail: lyy3232312@tom.com, dw7689@163.com
e-mail: forkp@tom.com
Abstract—With the increasingly widespread application of the only includes socket. There are still other distributed process
network, a distributed operating system based on Linux cluster communication systems, as RPC and RMI[2].
has been developing rapidly. This paper presents a kernel level Socket is very complicated to use, not only because that
distributed interprocess communication system model with there are many reduplicate codes to be written, but also
support for distributed process synchronization and
brings trouble to the maintenance. On the other side, socket
communication. This system model uses the System V
interprocess communication programming interface and method needs IP address and port number to build TCP link,
enhances it to provide functionality in distributed or send UDP message, so the transparency can’t be
environments. A key feature of this system model is the use of matched.
the semaphore interface to support distributed synchronization If we want to use RPC or RMI system, we should install it
and the implementation is done at the Linux kernel level to additionally. The system needs high performance hardwares
reduce the overhead. Finally, we realized this model and we must pay for the communication system. The
introduced in this paper in redhat Linux cluster and test result programmers also have to learn new transport mechanism
show it is a good solution of distributed processes and how to use the transport system. RPC and RMI system
communication. Compared with other similar systems, the
are fit for large scale enterprise application system.
advantage of this system is that the implementation is done at
the Linux kernel level to reduce the overhead and System V So we need a new communication mechanism, which
IPC API is easy to extend. User is easy to call the application should have simple C interfaces just like the interfaces of
interface of the distributed operating system, without process communication in a single node, and guarantee the
considering any details of the network. transparency of distributed system.
System V IPC API is one of the most commonly used
distributed system;interprocess communication;Linux kernel application programming interfaces for interprocess
communication. Most Unix and Linux systems provide the
I. INTRODUCTION ipcs command. This command lists the status of various
How to maintain the communication channels between POSIX interprocess communication mechanisms, including
the distributed processes is the key technology to realize the shared-memory segments. Much of the information for the
distributed operating systems. For software programmers in command comes from the data structure struct shmid_ds,
a distributed environment, a practical distributed which is available in the /usr/include/sys/shm.h file. While
interprocess communication system should have the System V IPC API only works for processes running on a
following features[1]. Firstly it is transparent, it must provide single machine, we extend System V IPC application
programming interface for the software programmers in programming interface (API) to support distributed
distributed environments. User is easy to call the application semaphores and Linux cluster. In this implementation the
interface of a distributed operating system, without communication mechanisms and the used methods are
considering any details of the network. Secondly, it should hidden from the programmer.
support the communication of processes in distributed user user user
Application
environment. Finally, it should provide calling interface Layer process1 process2 process3
such as the C Language. In view of the above three
requirements, This paper presents a kernel level distributed Interlayer Distributed Processes Communication system
interprocess communication system based on Linux cluster
with support for distributed process synchronization and Linux Linux Linux
communication. Platform
Linux system provides several process communication hardware hardware hardware
mechanisms; it can be classified into two kinds: process
communication in one node, and process communication in node1 node2 network
network environment. Process communication in one node Figure 1. Distributed Interprocess Communication System Software
includes: signal, pipe and FIFO, shared memory, message Architecture Model
queue etc. Process communication in network environment
Local Daemon
277
the NS_table records user process’s information including 4) NS_Daemon will search the relevant records in
pid_d, IP and pid. NS_table by pid_d and delete it.
5) Then NS_daemon will return pid_d to Subp_reg in 5) Then NS_daemon will return the result to
node 1 by network. Subp_ureg in node 1 by network.
6) Finally, Subp_reg return pid_d to user process 1, 6) Finally, Subp_ureg return result to user process 1,
which is the unique identifier of user process 1 in the user process 1 is separated from the Distributed Interprocess
distributed system. Communication System.
Figure 5 shows a cancellation process: Figure 6 describes a typical communication between two
1) User process 1 running in node 1 sends a request of distributed processes: A process named user process 1 send
cancellation to local_Daemon and provides it own pid_d kill signal to another process running in another machine by
and pid. the Distributed Interprocess Communication System.
2) Local_Daemon of node 1 creates another child The whole communication procedure is: user process
process named subp_ureg. register itself first, then call the signal_d ( ) function to send
3) Subp_ureg sends the structure {pid_d, IP, pid} to signal. The system queries the IP address and port number
NS_Daemon in Name Server machine by network. to Name Server by the pid_d. After receiving the response
from Name Server, the local Daemon encodes the pid of
node 1 Name Server(NS) destination process and signal value, then sends it to the
destination node. And the local Daemon on the destination
local_Daemon
NS_table node calls kill( ) to send the signal to destination process. At
last, when exit from our system, the user process log out
②fork()
④{pid_d, IP ,pid} from the Distributed Interprocess Communication System.
⑤pid_d
①pid subp_reg
278
V. IMPLEMENTATION AND TEST REFERENCES
Finally, we realized the system by GCC in redhat9 linux [1] George Coulouris, Distributed Systems:Concepts and
cluster. To improve the performance of the system and to Design 3rdn ed, New York: Addison Wesley, 2000.
make the overhead acceptable for distributed systems, the [2] William Stallings, Operating Systems:Internals and
functionality is implemented as part of the kernel. How to Design Principles 4th ed, Prentice Hall, 2001.
[3] Andrew S.Tanenbaum, Distributed Operating Systems,
measure the real time of sending signal by the Distributed Prentice Hall, 2006.
Interprocess Communication System? We designed a sender [4] E.M. Ammann, “DIPC-a monitor for distributed inter-
process and a receiver process and let the sender process process communication,” in 3rd Euromicro Workshop on
send 100 signals to the receiver every time continuously. Parallel and Distributed Processing, pp.272.
One way of measuring time is to use the Linux library call [5] A.F. Diaz , J. Ortega , F.J. Fernandez , M. Anguita , A.
gettimeofday. This method has a theoretical maximum Canas , A. Prieto, “An Efficient OS Support for
resolution of one microsecond and the time is a total of Communication on Linux Clusters,” in 2001 International
seconds from 1900-01-01 00:00:00. Table 1 shows some Conference on Parallel Processing Workshops, pp.0397.
experiment data, 100 signals transmission takes 3 seconds [6] Jin-Soo Kim , Kangho Kim , Sung-In Jung, “Building a
high-performance communication layer over virtual
on average, thus send a signal takes 0.03 seconds. interface architecture on Linux clusters,” in Proceedings
According to the result of test, we conclude that the speed of the 15th international conference on Supercomputing,
of transport is close to socket mechanism, and the system pp.30092b.
has simple call interface, can guarantee the transparency of [7] Jiong Zhao, A heavily commented Linux kernel source
distributed system. code, Machine industry publishing house, 2004.
[8] DeCao Mao,XiMing Hu, Analysis Linux kernel source,
University of Zhejiang, 2001.
VI. CONCLUSION [9] W.Richard Stevens, UNIX Network Programming
With development of computer networks, especially the Volume 2: Interprocess Communications 2nd ed, Prentice
development of the Internet, distributed systems have been Hall, 2002.
[10] Avi Silberschatz ,Peter Baer Galvin,Greg Gagne,
applied to all kinds of fields. It has played an important role
Operating System Concepts Problem Solutions (Seventh
in people’s daily life. It is necessary for a distributed system Edition ), John Wiley & Sons, Inc,2005
to offer a powerful and flexible inter process
communication function, and to effectively release and get
information in a wide area of computing environment.
Hence, interprocess communication of the distributed
computing systems becomes an important question for
discussion. Compared with other distributed IPC systems,
the system in this paper has the following features:
1) A key feature of the Distributed Interprocess
Communication System is the use of the interlayer on Linux
kernel to support distributed IPC. The implementation is
done at the Linux kernel level to reduce the overhead. It is
also easy to transplant to other UNIX systems;
2) It resolves the communication problems of
distributed processes perfectly;
3) It is based on linux cluster, which is low cost and
easy to realize. Its implementation is simple, practical and
efficient;
4) It provides the simple interface for users and
programmers.
The Distributed Interprocess Communication System can
be used as part of large scale distributed system, to provide
signal sending service. And it can also be used singly to
content the request of sending signal between different
nodes. This system provides theory and practical foundation
of the implementation of distributed system. The advantage
of this system is that the implementation is done at the
Linux kernel level to reduce the overhead and System V
IPC API is easy to extend.
279