SDK Your Net Corporation Equilibrium II: equilibrium2-mgmt Documentation

1.0

1 Overview

This is a sample application that is part of the sync-equilibrium2 package.

The Equilibrium II application overall consists of the development of a basic load-balancing system designed to operate quickly in the network data path on the Juniper Networks MultiServices PIC hardware module. The system function will be comparable to that of a reverse-proxy load balancer designed to be deployed adjacent to the server cluster for added performance and high availability.

The Equilibrium II application contains a manager running on RE and two services, classify service and balance service, running on MS-PIC.

The manager is responsible for reading CLI configuration, sending configuration to services and querying the status of services.

The purpose of classify and balance is to allow user access all kinds of Internet services with one single virtual IP address. The classify service classifies the traffic by TCP port and direct it to the proper virtual service gate. The balance service then balances the traffic to a group of real servers.

                                   |-> service
   user                 classify   |    gate     balance  |-> server 1
   traffic   virtual    service    |             service  |
 ----------> service --------------|-> service -----------|-> server 2
             address               |    gate              |
                                   |                      |-> server 3
                                   |-> service
                                        gate

2 Functionality

2.1 Configuration

2.1.1 Equilibrium II Configuration

Equilibrium II configuration is under [edit sync equilibrium2].

service-gate {
    gate-name {
        address service-gate-IP-address;
    }
server-group {
    group-name {
        servers {
            server-IP-address;
        }
    }
}
service-type {
    type-name {
        port TCP-port;
    }
}
balance-rules {
    rule rule-name {
        term term-name {
            from {
                service-gate service-gate-name;
            }
            then {
                server-group server-group-name;
            }
        }
    }
}
classify-rules {
    rule rule-name {
        term term-name {
            from {
                service-type service-type-name;
            }
            then {
                service-gate service-gate-name;
            }
        }
    }
}

[edit service-gate] specifies the virtual gate IP address of the service.
[edit service-type] specifies the type of Internet service.
[edit server-group] specifies the addresses of a group of servers.
[edit balance-rules] specifies the rules of balance service. Each rule contains a list of terms that consists of matching condition and action.
[edit classify-rules] specifies the rules of classify service.

2.1.2 Service-set Configuration

services {
    service-set svc-set-name {
        interface-service {
            service-interface service-interface-name;
        }
        extension-service equilibrium2-balance {
            rule balance-rule-name;
        }
        extension-service equilibrium2-classify {
            rule classify-rule-name;
        }
        service-order {
            forward-flow [ equilibrium2-classify equilibrium2-balance ];
            reverse-flow [ equilibrium2-balance equilibrium2-classify ];
        }
    }
}

[edit services service-set extention-service equilibrium2-balance] specifies the balance service rules that are defined in [edit sync equilibrium2 balance-rules].
[edit services service-set extention-service equilibrium2-classify] specifies the classify service rules that are defined in [edit sync equilibrium2 classify-rules].
[edit services service-set service-order] specifies the order of services for forwarding flow and reversed flow.

2.2 Read Configuration

After the CLI configuration was committed, the manager reads [edit sync equilibrium2], [services service-set extension-service equilibrium2-balance] and [services service-set extension-service equilibrium2-classify], if anything was changed in there.

2.2 Read Configuration

A JUNOS service daemon reads all service-set configuration, generates Service-Set Resolution Blob (SSRB) for each service-set and pushes them to kernel by gencfg. The Equilibrium II manager subscribes to receive SSRB.

2.4 Create Service-set Blob for Service

The Equilibrium II manager needs both CLI configuration and SSRB to create service-set blobs and send them to services. SSRB is received asynchronously. This means that some SSRBs may be received before reading configuration, and some my be received after.

After receiving a SSRB, the manager checks the services configured in this service-set first. The SSRB will be discarded if it doesn't contain Equilibrium II service. Then the manager checks the list of service-set blobs, that are created after reading configuration. If the service-set blob doesn't exist, which means this SSRB was received before reading configuration, then the manager just adds it to the SSRB list. Otherwise, the manager incorporate SSRB information into service-set blob and sends service-set blob to service.

After reading CLI configuration, when the manager creates service-set blob for service, it checks the SSRB list. If the SSRB exists, which means this SSRB has already been received, then the manager incoporate SSRB information into service-set blob and send it to service. After the service-set blob was sent out, it's removed from the list. If the SSRB doesn't exit, which means this SSRB was not received yet, then the manager leaves the service-set blob in the list.

2.4 Create Service-set Blob for Service

The service-set blob is sent to service by adding it to kernel with gencfg API. The service-set blob is for each service and contains only the specific service rules. For example, service-set svc-set-a is configured and it contains both classify and balance service rules. Then two service-set blobs will be created with the same service-set ID, one contains classify rules only, another contains balance rules only. They will be sent to the proper service respectively.

The service-set blob is only sent to the specified service interface.

Before sending service-set blob out, the manager compares the newly created blob and the blob already in kernel, and only updates the blob if anything was changed. To update a service-set blob, the manager has to delete it first, then add the new one.

2.6 Get Service Status

An operational CLI command can be used to get service status. For now, it shows the number of sessions connected to each server for each server group.

> show sync equilibrium2 status

  Server Group: server-group-name
      Address        Number of Sessions
    xxx.xxx.xxx.xxx        xxx

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:26:58 2010 for SDK Your Net Corporation Equilibrium II: equilibrium2-mgmt 1.0 by Doxygen 1.5.1