introduction)
Inter-process communication involves a lot of content, such as for the implementation of inter-process communication needs to use many protocols provided by the API, in the process of remote method calls on the need for a certain data format, which is derived from the data set a way of grouping. There are also multicast network technologies and virtual networking technologies for specific applications.
Protocol-related APIs)
In order to implement interprocess communication, the system has different APIs and classes according to different types of communication methods. Interprocess communication is inseparable from the send process, and the 2 main roles of receive process. There are several characteristics in interprocess communication.
1. With synchronous communication and asynchronous communication, synchronous communication is much simpler to design than asynchronous operation, but sometimes the efficiency is not too good, because it will be blocked.
2. The communication of the destination message has 2 very important requirements, 1 is the reliability of the message delivery, and the other is the order of the message delivery.
3. API implementations for interprocess communication such as can be implemented through the socket, there is a special class in Java, there is a special datagram datagram for UDP packet propagation, TCP uses the flow pattern propagation, and the form of UDP is different. TCP streaming has several characteristics different from UDP, 1 because there is no data boundaries, so before transmission to determine how much data, 2. Because TCP is reliable transmission, each packet will be received with an ACK corresponding reply, otherwise it will be re-transmitted, the error control is better, 3. There will be flow Transmission control, will make some changes depending on the speed of the reception. Of course, there are some problems in the TCP stream transmission: 1. Data matching problem, if the data is read in advance to agree the order of the line. 2. Blocking issues. 3. Multithreading problem, the server creates a new connection for each client, placed in a different thread, the load is huge. Data Integration)
In the remote invocation of data transfer, it is necessary to integrate and regulate the information, such as declaring good data storage, data types and so on. Here are 4 examples of
1.CORBA, public request object agent. This is a relatively early framework that applies to multiple languages. In CORBA, he has predetermined the form of the data, so the sender and receiver are only responsible for receiving the value of the transfer, in CORBA, an object is marked with contiguous bytes stored, through {length: value, Length: Value ...} Similar to this form.
2.Serialization, serialization technology, and the above method has a little difference, he not only deposit the value, but also his type, package name and other a series of possible information are deposited, if a class is a subclass, then his parent class information will be serialized into the information, Because the information of the last object is serialized into a binary file, it is divided into the transport of convenient objects, and the mechanism of specific serialization can read an article in my blog post.
3.XML, extended Markup Language. The advent of XML makes the possibility of data stronger, and the typical use of soap is to use this for transmission, with XML tagged with attributes, namespaces, and XML schemas.
4.Remote Object Reference, references to remote objects. Interprocess communication is often invoked in the form of an object on the server side, so a reference design is crucial, first of all he must be unique, and this undoubtedly saves the object from being deleted and on your other object, which can be disastrous. Here is a way of doing this, reference = Internet Address + port number + Time +object # (this is the first few create object) + object interfaces, enough to It's a uniqueness.
Multicast communication)
To communicate with a process group, if the sender of a pair of paired with the receiver of the exchange of information, the efficiency is very low, so there is a concept of multicast.
1. Some features of multicasting and the applicable scenarios. 1. Send multicast confidence to search for services. 2. Can do data backup, when the data changes. 3. To do an event notification, the publish subscription pattern is an implementation of this function.
2. Similarly, there is support for IP multicasting in Java, called Mulitycastsocket.
3. In multicasting, there are also 2 issues that are very important, reliability, and transport ordering, which is very important in the multicast process because your receivers are a group of groups. Overlay Network)
With the rapid development of information technology, more and more network-based distributed applications began to emerge, such as Peer-to-peer file sharing applications. However, due to the limitations of the design of the network itself and the fixed nature of the network protocol, it is not very good to support the application of some specific requirements, so there is a concept of network virtualization.
1. Network virtualization aims at the current network conditions in a few months, without changing the core structure, in the above to build a unique level to support the required applications, which is called network virtualization, such as the support of a multimedia distributed streaming music.
2. Here we mention a typical virtual network instance is called Overlay networks, which covers the network, it is a virtual network by some nodes and virtual connection, built on the underlying network of a facility.
3. Overlay network There have been many types, there are distributed hash tables, stored a large number of key-value pairs of mapping, or a multicast network environment, in this environment, there is no multicast router exists. Learning examples)
The concept of an MPI, commonly known as the messaging interface, is generated in the field of high-performance computing, where there are many special designs.
References: <<distributed sysytems Concepts and design>> original version fifth, Author:george Coulouris,jean Dollimore, Tim Kindberg,gordon Blair