JGroups Protocol PING
External
- JGroups Manual http://www.jgroups.org/manual/html/protlist.html#d0e4501
- JGroups Wiki http://community.jboss.org/wiki/JGroupsPING
Internal
TODO
- Next time I dive into this, come up with a full explanation for 'num_initial_members' below.
!!!Internal
|[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 Template: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 ('Template:Timeout') or replies ('Template: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"/>
}}}
!!!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}]