SDK Your Net Corporation Equilibrium II: equilibrium2-balance Documentation

1.0

1 Overview

This is the balance service of Equilibrium II application. It balances the traffic load to a group of servers.

The service plugin exists as a dynamic object. It consists of three components, entry, control event handler and data event handler.

The entry is called when the plugin is loaded as a dynamic object by management daemon. It registers plugin information and gets a plugin ID.

The control event handler is called when there is a control event distributed to the service.

The data event handler is called when there is a data event distributed to the service.

2 Functionality

2.1 Register

The entry function is called when the service is loaded as a dynamic object by the management daemon. It registers the control event handler, data event handler and some other plugin information to the management daemon, then it gets a plugin ID.

2.2 Control Event Handler

The control event handler is called when there is a control event distributed to the service. For external service plguin, there are two control events need to be processed, initialization event and configuration blob event.

The initializtion event is received at only once at the beginning, the control event handler initializes the environment when it received this event.

The configuration blob event is received when there is a configuration blob comming to this service. Two types of configuration blobs are for balance service and two operations are for the blob as below.

Adding server group blob, the handler unpacks the blob and updates the server group list.

Deleteing server group blob, the handler doesn't do anything.

Adding service-set blob, the handler unpacks the blob and adds all service-set rules to policy database for data event handler to use. The data event handler will receive packet belonging to certain service-set only after all registered plugins added their rules to the policy database of that service-set.

Deleting service-set blob, the handler marks it inactive, but not remove it from policy database. Because once the policy is removed from policy database for certain service-set, the data event handler won't receive packet of that service-set and this will break the session in the middle. During this transit period, when the old policy is still being used and new policy came in, the data event handler doesn't accept any new session (because the new policy is not active yet), and once all the existing sessions are close, the old policy is removed from policy database and the new policy is activated.

2.3 Data Event Handler

MSVCS_DATA_EV_SM_INIT event is for initializing shared memory for packet process.

MSVCS_DATA_EV_INIT event is for initializing plugin data event handler environment.

MSVCS_DATA_EV_FIRST_PKT_PROC event is for processing the first packet of a session. When receiving the first packet, the handler goes through all rules and looks for the proper action applying to this session. Then the handler creates an action data structure and attaches it to the session, so the same action will apply to all the rest packets in this session without going through all rules again.

MSVCS_DATA_EV_PKT_PROC event is for processing the rest packets in the session. The handler just retrieves the action from the session and apply it to the packet.

MSVCS_DATA_EV_SESSION_OPEN is received when the session is open. This event is received after MSVCS_DATA_EV_FIRST_PKE_PROC.

MSVCS_DATA_EV_SESSION_CLOSE is received when the session is closed.


2007-2009 Juniper Networks, Inc. All rights reserved. The information contained herein is confidential information of Juniper Networks, Inc., and may not be used, disclosed, distributed, modified, or copied without the prior written consent of Juniper Networks, Inc. in an express license. This information is subject to change by Juniper Networks, Inc. Juniper Networks, the Juniper Networks logo, and JUNOS are registered trademarks of Juniper Networks, Inc. in the United States and other countries. All other trademarks, service marks, registered trademarks, or registered service marks are the property of their respective owners.
Generated on Sun May 30 20:27:08 2010 for SDK Your Net Corporation Equilibrium II: equilibrium2-balance 1.0 by Doxygen 1.5.1