RFC 4678 - Server/Application State Protocol v1(4)

时间:2006-11-02 来源: 作者: 点击:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |SendWeightsType(0x1040)|SizeofSendWeightsTLV| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |GroupofWeightDataCo
  
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |    Send Weights Type(0x1040)  |    Size of Send Weights TLV   |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |  Group of Weight Data Count   |                               |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
      .                                                               .
      .             *Group of Weight Entry Data Components            .
      .                                                               .
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   * There will be as many Group of Weight Entry Data Components as
   "Group of Weight Data Count" has specified.

                                 Figure 18

   o  Group of Weight Entry Data Components: Each "Group of Weight Data"
      component is immediately followed by Group Data Components and its
      Weight Entry Data components (as described in Section 6.2).  In
      this case, where several "Group of Weight Data" components may be
      present, the second "Group of Weight Data" component only appears
      after all of the internal components that are referred to by the
      first "Group of Weight Data" component are listed.  The format is
      the same for all subsequent "Group of Weight Data" components in
      the message.

7.5.  Set Member State Request and Reply

   This is a special exchange that can take place between the load
   balancer and the Group Workload Manager or between the Member and the
   Group Workload Manager to pass information about the state of the
   member including placing the member in quiesced or non-quiesced
   states.  In particular, the load balancer/scheduler can use this
   message to quiesce a set of members.  Members can also use this
   message to quiesce themselves as well as to pass certain state
   information to the load balancer/scheduler that is opaque to the
   Group Workload Manager.  This opaque state information is passed to
   the load balancer/scheduler with the weights during get and send
   weight messages.

7.5.1.  Set Member State Request

       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      .                                                               .
      .                      SASP Header TLV                          .
      .                                                               .
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |SetMemberState Req.Type(0x1060)|Size of SetMemberState Req. TLV|
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |   Flag Field  | Group of MemberStateData Count|               |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+               +
      .                                                               .
      .        *Array of Group of Member State Data Components        .
      .                                                               .
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   *There will be as many Group of Member State Data Components as
   "Group of Member State Data Count" has specified.

                                 Figure 19

   o  Flag Field

      A.  Load Balancer Flag

          +  xxxx xxx1 The entity sending this message is the load
             balancer.

          +  xxxx xxx0 The entity sending this message is an
             Application.

      B.  Leftmost seven bits are reserved (0000 000x - 1111 111x).

   o  Group of Member State Data Count: The number of "Group of Member
      State Data" components immediately following the Set Member State
      Request TLV.

   o  Array of Group of Member Data Components: Each "Group of Member
      State Data" component is immediately followed by Group Data
      Components and its Member State Instance components (as described
      in Section 6.3).  In the case where several "Group of Member State
      Data" components may be present, the second "Group of Member State
      Data" component only appears after all of the internal components
      that are referred to by the first "Group of Member State Data"
      component are listed.  The format is the same for all subsequent
      "Group of Member State Data" components in the message.

7.5.2.  Set Member State Reply

      0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      .                                                               .
      .                      SASP Header TLV                          .
      .                                                               .
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      | Set Member State Reply(0x1025)|Size of SetMemberStateReply TLV|
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |  Return Code  |
      +-+-+-+-+-+-+-+-+

                                 Figure 20

   o  Return Code: A byte return code indicating the status of action
      taken.

      A.  General SASP return codes (0x00 - 0x3F)

          +  0x00 Successful

          +  0x10 Message not understood

          +  0x11 GWM will not accept this message from the sender.
             Reasons for this include the following:
             a. The message was not sent by a LB and trust flag is off
             b. LB attempted to address members of a different LB in the
                message
             c. Vendor specific criteria for this message type were not
                met.

      B.  Message-Specific return codes (0x40 - 0xFF)

          +  0x41 Application or System not registered

          +  0x42 Unknown Group Name

          +  0x43 Unknown LB UID

          +  0x44 Duplicate Member in Request

          +  0x46 Duplicate Group in Request

          +  0x50 Invalid Group Name Size (size == 0)

          +  0x51 Invalid LB UID Size (size == 0 or > than max)

          +  0x61 Member is setting state for itself, but LB hasn’t yet
             contacted the GWM.  This request will not be processed.

7.6.  Set Load Balancer State Request and Reply

   This is an exchange that can take place between the load balancer and
   the Group Workload Manager to pass information about the state (and
   partial configuration) of the load balancer.

7.6.1.  Set LB State Request

      0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      .                                                               .
      .                      SASP Header TLV                          .
      .                                                               .
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |Set LB State Req. Type (0x1050)| Size of Set LB State Req. TLV |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      | LB UID Length |                                               |
      +-+-+-+-+-+-+-+-+                                               +
      .                                                               .
      .                             LB UID                            .
      .                                                               .
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |    LB Health  |    LB Flags   |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                                 Figure 21

   o  LB UID Length: one-byte length field describing the size of the
      following LB UID.

   o  LB UID: This should be the same unique identifier given when
      registering group members for this particular load balancer.

   o  LB Health: This field gives the load balancer a chance to pass in
      a metric describing its own health or state.

         0x00 - 0x7F Least Healthy - Most Healthy

         0x80 - 0xFF Reserved

   o  LB Flags:

      A.  Push Flag

          +  xxxx xxx1 The load balancer should receive weights through
             the Send Weights message (GWM pushes weights to load
             balancer).  Even if this flag is set, the GWM must still
             respond accordingly to any Get Weights messages from the
             load balancer.

          +  xxxx xxx0 The load balancer will send a Get Weights message
             to get the new weights.  This is the default behavior.
             (load balancer pulls weights from GWM).

      B.  Trust Flag

          +  xxxx xx1x Trust any member-initiated registration,
             deregistration, or set state message.  Immediately reflect
             the registration, deregistration, or new state in the
             weights sent.

          +  xxxx xx0x Do not trust any member-initiated registration,
             deregistration, or set state message.  Registration,
             Deregistration, and State Setting of members can only occur
             from the load balancer.  Discard any member-initiated
             registration, deregistration, or set state message.  This
             is the default behavior.

      C.  No Change / No Send Flag

          +  xxxx x1xx The GWM must not include members whose weights
             and state (i.e., contact and quiesce flags) have not
             changed since they were last sent.

          +  xxxx x0xx The GWM must include the weights of all group
             members when sending the weights to this load balancer
             (including members whose weights and state have not
             changed).  This is the default behavior.

      D.  Leftmost five bits are reserved (0000 0xxx - 1111 1xxx).

7.6.2.  Set LB State Reply

      0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      .                                                               .
      .                      SASP Header TLV                          .
      .                                                               .
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |   Set LB State Reply (0x1025) | Size of Set LB State Reply TLV|
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |  Return Code  |
      +-+-+-+-+-+-+-+-+

                                 Figure 22

   o  Return Code: A byte return code indicating the status of action
      taken.

      A.  General SASP return codes (0x00 - 0x3F)

          +  0x00 Successful

          +  0x10 Message not understood

          +  0x11 GWM will not accept this message from the sender.
             Reasons for this include the following:
             a. LB attempted to address the state of a different LB
             b. Vendor specific criteria for this message type were not
                met.

      B.  Message-Specific return codes (0x40 - 0xFF)

          +  0x51 Invalid LB UID Size (size == 0 or > max)

8.  Example of SASP Message Encoding

   This section provides an example of the actual SASP message encoding.
   For this example, we will look at a sample GetWeights Reply in which
   two webservers are registered to a serverfarm called FARM1.  The IP
   addresses of the two webservers are 10.10.10.1 and 10.10.10.2.
   Currently the GWM has a weight of 40 for 10.10.10.1 and 20 for
   10.10.10.2.  The load balancer has a unique Identifier of "LB1" and
   the message example was sent by the GWM in response to a request
   (MessageID: 0x32000000) for FARM1’s weights.

   The TLVs necessary for this message are shown in the following list.

   1.  SASP Header TLV

   ------------------------------------
   | | Field   |  Size   |   Value    |
   |-----------|---------|------------|
   |T| Type    | 2 bytes | 0x2010     |
   |-----------|---------|------------|
   |L| Length  | 2 bytes | 0x000D     |
   |-----------|---------|------------|
   | | Version | 1 byte  | 0x01       |
   | |---------|---------|------------|
   |V| Mesg Len| 4 bytes | 0x0000 006A|
   | |---------|---------|------------|
   | | Mesg ID | 4 bytes | 0x3200 0000|
   ------------------------------------

                                   Figure 23

   2.  Get Weights Reply TLV

   ------------------------------------
   | | Field   |  Size   |   Value    |
   |-----------|---------|------------|
   |T| Type    | 2 bytes | 0x1035     |
   |-----------|---------|------------|
   |L| Length  | 2 bytes | 0x0009     |
   |-----------|---------|------------|
   | | RetCode | 1 byte  | 0x00       |
   | |---------|---------|------------|
   |V| Interval| 2 bytes | 0x0040     |
   | |---------|---------|------------|
   | |GWD Count| 2 bytes | 0x0001     |
   ------------------------------------
   *GWD Count = Group of Weight Data Count

                                   Figure 24

   3.  Group of Weight Data TLV

   ------------------------------------
   | | Field   |  Size   |   Value    |
   |-----------|---------|------------|
   |T| Type    | 2 bytes | 0x4011     |
   |-----------|---------|------------|
   |L| Length  | 2 bytes | 0x0006     |
   |-----------|---------|------------|
   |V| WE Count| 2 bytes | 0x0002     |
   ------------------------------------
   *WE Count = Weight Entry Count

                                   Figure 25

   4.  Group Data TLV

   ------------------------------------
   | | Field   |  Size   |   Value    |
   |-----------|---------|------------|
   |T| Type    | 2 bytes | 0x3011     |
   |-----------|---------|------------|
   |L| Length  | 2 bytes | 0x000E     |
   |-----------|---------|------------|
   | |LBUID len| 1 byte  | 0x03       |
   | |---------|---------|------------|
   | |  LBUID  | 3 bytes | "LB1" or   |
   | |         |         | 0x4C 42 31 |
   |V|---------|---------|------------|
   | |GroupName| 1 byte  | 0x05       |
   | | Length  |         |            |
   | |---------|---------|------------|
   | |  Group  |         | "FARM1" or |
   | |  Name   | 5 bytes | 0x46 41 52 |
   | |         |         |   4D 31    |
   ------------------------------------

                                   Figure 26

   5.  Member Data TLV

   ------------------------------------
   | | Field   |  Size   |   Value    |
   |-----------|---------|------------|
   |T| Type    | 2 bytes | 0x3010     |
   |-----------|---------|------------|
   |L| Length  | 2 bytes | 0x0018     |
   |-----------|---------|------------|
   | | Protocol| 1 byte  | 0x06       |
   | |---------|---------|------------|
   | |  Port   | 2 bytes | 0x0050     |
   | |---------|---------|------------|
   |V|   IP    |16 bytes | 0x0000 0000|
   | | Address |         |   0000 0000|
   | |         |         |   0000 0000|
   | |         |         |   0A0A 0A01|
   | |---------|---------|------------|
   | |Label Len| 1 byte  | 0x00       |
   | |---------|---------|------------|
   | |  Label  | 0 bytes |            |
   ------------------------------------

                                   Figure 27

   6.  Weight Entry Data TLV

   ------------------------------------
   | | Field   |  Size   |   Value    |
   |-----------|---------|------------|
   |T| Type    | 2 bytes | 0x3012     |
   |-----------|---------|------------|
   |L| Length  | 2 bytes | 0x0008     |
   |-----------|---------|------------|
   | | State   | 1 byte  | 0x00       |
   | |---------|---------|------------|
   |V| Flags   | 1 byte  | 0x0D       |
   | |---------|---------|------------|
   | | Weight  | 2 bytes | 0x0028     |
   ------------------------------------

                                   Figure 28

   7.  Member Data TLV

   ------------------------------------
   | | Field   |  Size   |   Value    |
   |-----------|---------|------------|
   |T| Type    | 2 bytes | 0x3010     |
   |-----------|---------|------------|
   |L| Length  | 2 bytes | 0x0018     |
   |-----------|---------|------------|
   | | Protocol| 1 byte  | 0x06       |
   | |---------|---------|------------|
   | |  Port   | 2 bytes | 0x0050     |
   | |---------|---------|------------|
   |V|   IP    |16 bytes | 0x0000 0000|
   | | Address |         |   0000 0000|
   | |         |         |   0000 0000|
   | |         |         |   0A0A 0A02|
   | |---------|---------|------------|
   | |Label Len| 1 byte  | 0x00       |
   | |---------|---------|------------|
   | |  Label  | 0 bytes |            |
   ------------------------------------

                                   Figure 29

   8.  Weight Entry Data TLV

   ------------------------------------
   | | Field   |  Size   |   Value    |
   |-----------|---------|------------|
   |T| Type    | 2 bytes | 0x3012     |
   |-----------|---------|------------|
   |L| Length  | 2 bytes | 0x0008     |
   |-----------|---------|------------|
   | | State   | 1 byte  | 0x00       |
   | |---------|---------|------------|
   |V| Flags   | 1 byte  | 0x0D       |
   | |---------|---------|------------|
   | | Weight  | 2 bytes | 0x0014     |
   ------------------------------------

                                   Figure 30

   A hex stream representing this same message is below:

      20 10 00 0D 01 00 00 00 6A 32 00 00 00 10 35 00 09 00 00 40

      00 01 40 11 00 06 00 02 30 11 00 0E 03 4C 42 31 05 46 41 52

      4D 31 30 10 00 18 06 00 50 00 00 00 00 00 00 00 00 00 00 00

      00 0A 0A 0A 01 00 30 12 00 08 00 0D 00 28 30 10 00 18 06 00

      50 00 00 00 00 00 00 00 00 00 00 00 00 0A 0A 0A 02 00 30 12

      00 08 00 0D 00 14

   (106 bytes)

9.  Protocol Flow

   This section describes the expected general flow of the SASP
   messages.

9.1.  Normal Protocol Flow

   SASP first starts with a connection from an LB to the GWM.  This is
------分隔线----------------------------
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
最新评论 查看所有评论
发表评论 查看所有评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 密码: 验证码:
推荐内容