JGroups Protocol PING: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 7: Line 7:


* [[JGroups#Protocols|JGroups]]
* [[JGroups#Protocols|JGroups]]


=TODO=
=TODO=
Line 15: Line 14:
</font>
</font>


=Overview=


!!!Internal
PING performs the initial (dirty) discovery of members, by multicasting PING request to an IP multicast address. The PING request is a Message with a <tt>PingHeader.GET_MBRS_REQ</tt> header. Each member replies with a (C, A) packet where C = coordinator address and A its own address. After a set number of milliseconds ('<tt>timeout</tt>') or replies ('<tt>num_initial_members</tt>'), the joiner determines the coordinator from responses, and sends a JOIN to it. The JOIN request is handled by the [[JGroups Protocol GMS|GMS]] layer. If nobody responds, the joiner assumes it's the first member of a group.
 
|[MPING]
|[TCPPING]
|[MERGE2]
 
!!!Overview
 
PING performs the initial (dirty) discovery of members, by multicasting PING request to an IP multicast address (or connecting to a GossipRouter). The PING request is a Message with a {{PingHeader.GET_MBRS_REQ}} header. Each member replies with a (C, A) packet where C = coordinator address and A its own address. After a set number of milliseconds ('{{timeout}}') or replies ('{{num_initial_members}}'), the joiner determines the coordinator from responses, and sends a JOIN to it. The JOIN request is handled by the [GMS] layer. If nobody responds, the joiner assumes it's the first member of a group.
 
!!!Sample Configuration
 
{{{


    <PING timeout="2000" num_initial_members="3"/>
=Configuration=
   
}}}


<pre>
  <PING timeout="2000" num_initial_members="3"/>
</pre>


!!!Difference between PING and MPING
=Difference between PING and MPING=


MPING, unlike PING, uses its own IP multicast socket to send discovery requests. PING simply sends a discover event down the stack to be sent by the underlying transport protocol.
MPING, unlike PING, uses its own IP multicast socket to send discovery requests. PING simply sends a discover event down the stack to be sent by the underlying transport protocol.

Revision as of 06:46, 2 March 2016

External

Internal

TODO

  • Next time I dive into this, come up with a full explanation for 'num_initial_members' below.

Overview

PING performs the initial (dirty) discovery of members, by multicasting PING request to an IP multicast address. The PING request is a Message with a PingHeader.GET_MBRS_REQ header. Each member replies with a (C, A) packet where C = coordinator address and A its own address. After a set number of milliseconds ('timeout') or replies ('num_initial_members'), the joiner determines the coordinator from responses, and sends a JOIN to it. The JOIN request is handled by the GMS layer. If nobody responds, the joiner assumes it's the first member of a group.

Configuration

  <PING timeout="2000" num_initial_members="3"/>

Difference between PING and MPING

MPING, unlike PING, uses its own IP multicast socket to send discovery requests. PING simply sends a discover event down the stack to be sent by the underlying transport protocol.

Periodic GET_MBRS_REQ Requests

The super-type Discovery protocol is in charge with sending GET_MBRS_REQ (get members) requests upon receiving a FIND_INITIAL_MBRS event. FIND_INITIAL_MBRS events are sent either by the [GMS] protocol, when initializing, or periodically by the FindSubgroupsTask of the [MERGE2] protocol.

The discovery requests are generated by the PingSenderTask, in the form of OOB messages with PingHeader.GET_MBRS_REQ headers. PingSenderTask sends these messages in a delayed loop. The delay between requests is Template:Timeout/Template:Num ping requests where Template:Timeout and Template:Num ping requests are configuration parameters described below. Normally that should be about 1.5 sec (1,500 ms).

The loop is interrupted either after a 'timeout' milliseconds (which means that all 'num_ping_requests' discovery requests have been sent), or after the first valid response - which allows determining who the coordinator is - is received. Further clarifications needed as to how 'num_initial_members' works.

A new PingSenderTask - and the loop - will be started again when a new GET_MBRS_REQ message needs to be sent.

!!Stack Boot Time Factor

The whole stack is waiting while the first discovery loop is running, setting the 'timeout' to a smaller value can reduce the stack boot time.


!!!Configuration

!timeout

The timeout to wait for the initial members. Default is 3000 ms.

!num_initial_members

!num_ping_requests

Number of discovery requests to be sent distributed over Template:Timeout. Default is 2.


!Filtering Out

If you want to filter these messages out, the header id is __6__.


__Referenced by:__\\ [{INSERT com.ecyrd.jspwiki.plugin.ReferringPagesPlugin WHERE max=20, maxwidth=50}]