Java Peer-to-peer computing practices: discovery based on IP multicast

Source: Internet
Author: User
To do useful work, P2P applications must be able to discover and interact with each other. This article provides an implementation of IP multicast-based discovery.
Before a software entity can participate in direct peer-to-peer interaction with P2P applications, the entity must discover the appropriate peer-to-peer points to interact. All feasible P2P architectures provide a solution for problem discovery. In this article, I will describe the implementation of one of the mechanisms. Let's start today's discussion through review. The P2P application's peer discovery allows P2P applications to locate and interact with each other. There are multiple methods for implementing peer-to-peer service discovery. The simplest mechanism is the explicit point-to-point configuration. This mechanism works by requiring each peer to know all other peers that it may interact with and connect them. The main advantage of point-to-point configuration is simplicity. Its main disadvantage is its lack of flexibility and the ability to expand to a large network of peer nodes.
Another common model found is to use a central directory as an intermediary. This model is popular among many traditional non-P2P distributed applications, and its advantage is that it is well understood. Register your presence with the central directory and use the central directory to locate other peers. The main advantage of this model is its ease of management and scalability. However, its centralized design will lead to single point of failure. Therefore, it lacks the ability to resist the dangers caused by its natural power or the increase in the number of online surfing users.
Many popular P2P applications use the network model instead of the central directory. In the network model, a single peer only knows the peer identity on the local network. Each peer is used as the Directory of the peer that is connected to it. Peer nodes collaborate by spreading directory queries to adjacent peer nodes and returning relevant responses. The main advantage of this model is that it is not centralized. Its main drawback is that propagation query consumes a lot of network and processing capabilities.
There are several variants of the above three mechanisms. Without discussing these variants, let's move on and study another discovery mechanism.
IP multicast discovery
The multicast model is similar to the network model for maintaining the directory of each peer. However, peer nodes do not cooperate to implement large-scale network queries. In addition, peer nodes use the features provided by the network (IP multicast) to locate and identify other peer nodes.
IP multicast is connectionless and unreliable (unlike TCP/IP, which is connection-oriented and reliable ). Although it uses IP datagram, multicast IP datagram can be sent from one host to another, unlike unicast IP datagram.
Peer nodes regularly use IP multicast to declare their own existence. The announcement contains their host names and a port for normal communication. The peer that is interested in the message detects the message, extracts the host name and port number, and uses the message to establish a communication channel.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.