The purpose of the hellopics application is to pass hello messages in a cycle between the three components. The management component operates on a 60-second interval timer. It initiates a hello message carrying a sequence number as data upon the timer expiry event. The first hello message is sent to the data component, the second to the control component, and the direction remains alternating.
hellopics-mgmt is a small daemon running on the RE. It is a good starting point for beginners to the JUNOS MP-SDK. It demonstrates the usual RE-SDK libraries, and it provides the 'show sync hellopics statistics' command to show some basic statistics about the hello messages. It does a good job of demonstrating libconn to communicate between an MP-SDK application's components.
The management component in particular starts a server listening for a connection from the data component and from the control component. Upon establishing a session through this server connection, the session is unidentified. The first message it expects for a new session is the one containing the ID of the component that started the session. It will not process any messages from a connection (session) until it is identified. Once this happens, it responds to peer-information-request messages by sending the opposite peer's information. If a connection from the opposite peer has not been made, it will send the information when it connects. It also listens for messages indicating that the other components are ready to receive hello messages. The other components only send these when they are acting as clients for a connection and they are fully ready. When the management component has received a ready message from both components it starts the interval timer to start generating the hello messages.
If the management component is about to send a hello message before the last one was received, then it increments a messages-missed counter. Upon sending the hello message, it increments a messages-sent counter. If a hello message is received and its sequence number matches the last one sent, then it increments a messages-missed counter. Lastly, if a hello message is received and its sequence number does not match the last one sent, then it increments a messages-out-of-order counter. The messages received out of order would, therefore, also get counted as missed. These four statistics counters are reported by the command made available by this daemon.
High Availability functionality has been added to the management component. The purpose of this functionality is to demonstrate the continuation of RE service even after the Master RE fails or there is a mastership switchover. The management component on the Master RE is the master daemon (all the processing is done by this daemon) and the management component on the Backup RE is the backup daemon (this daemon remains passive). The backup daemon just synchronizes its state with the master daemon. If Routing Engine mastership switchover/failover takes place then the management component needs to be notified about the mastership switchover. Here the backup component takes over as master and the master becomes backup.
user@router> show sync hellopics statistics Hello PICs Cycled-Message Statistics: Sent Message: 2 Received Messages: 2 Dropped Messages: 0 Missed Messages Received Out of Order: 0