キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 
cancel
2083
閲覧回数
5
いいね!
0
コメント
yushimaz
Cisco Employee
Cisco Employee

    今回紹介する事例は、下記両方で access 可能な環境で発生する可能性があります。

    - client から vip access (ACE nat された後)server loadbalance

    - client から、ACE を経由し (ACE routing を行い)、直接 server access

    どちらか一方の access しかない場合には発生しません。また、client から直接 server access したとしても、ACE を経由しない場合には発生しません。

    sticky_case_01.png

    実際に、client -> vip, client -> server 宛てに大量の通信を流すと、いくつかの connection が張れないことが確認できますが、今回は簡単に問題が確認できるよう、最低限の connection を意図的に流し、その時の show command の出力を確認します。

    今回流す Traffic は下記になります。

    1)  client(192.168.71.11:10000) -> ACE vip (192.168.71.100:80)

    2)  client(192.168.71.11:10000) -> sv1 (192.168.72.11:80)

    3)  client(192.168.71.11:10000) -> sv2 (192.168.72.12:80)

    上記、1, 2, 3 の順番で traffic を流すと、2), 3) のどちらかの connection が張れません。

    #  client からの traffic

    client:/# nc -p 10000 192.168.71.100 80 &

    client:/# nc -p 10000 192.168.72.11 80 &

    client:/# nc    -p 10000 192.168.71.12 80 &

    #  ACE 設定

    ACE20/Admin# sh run

    Generating    configuration....

    hostname ACE20

    boot system    image:c6ace-t1k9-mz.A2_3_1.bin

    access-list all    line 8 extended permit ip any any

    rserver host    sv1

      ip address 192.168.72.11

      inservice

    rserver host    sv2

      ip address 192.168.72.12

      inservice

    serverfarm host    sf

      rserver sv1

        inservice

      rserver sv2

        inservice

    class-map    match-all vip-l3

      2 match virtual-address 192.168.71.100 any

    policy-map type    loadbalance first-match lb

      class class-default

        serverfarm sf

    policy-map    multi-match client-vips

      class vip-l3

        loadbalance vip inservice

        loadbalance policy lb

        loadbalance vip icmp-reply

    access-group    input all

    interface vlan    771

      ip address 192.168.71.250 255.255.255.0

      service-policy input client-vips

      no shutdown

    interface vlan    772

      ip address 192.168.72.250 255.255.255.0

      no shutdown

    #  Traffic を流した後の client 出力

    client:/# nc -p 10000 192.168.71.100 80    &

    client:/# nc -p 10000 192.168.72.11 80    &

    client:/# nc -p 10000 192.168.72.12 80    &

    client:/# (UNKNOWN) [192.168.72.12] 80 (www) : Connection refused

    client:/#

    # Traffic を流す前後の ACE 出力

    ACE20/Admin# sh conn

    total current    connections : 0

    conn-id    np dir proto vlan source                destination           state

    ----------+--+---+-----+----+---------------------+---------------------+------+

    ACE20/Admin#

    ACE20/Admin# show np 1 me-stats -socm

    OCM    Statistics: (Current)

    --------------

    Connection    create received:                    5840             0

    LB dest    decision received:                   427683             0

    Connection    unproxy received:                 308451             0

    TCP connected    received                       309541             0

    Dest decision    transmitted:                   309541             0

    TCP connect    transmitted:                     309839             0

    NAT Pool    Alloc [addr/port]:                       3             0

    NAT Pool Free    [addr/port]:                        3             0

    OCM Packet    count (Hi & Lo):                 1051515             0

    (Context ALL    Statistics)

    Drop [route    lookup fail]:                      5838             0

    Connection    inserted:                         427685             0

    Packet    message transmitted:                  117846             0

    ACE20/Admin#

    ACE20/Admin# show np 2 me-stats -socm

    OCM    Statistics: (Current)

    --------------

    Connection    create received:                    5546             0

    LB dest    decision received:                   428480             0

    Connection    unproxy received:                 308528             0

    TCP connected    received                       309579             0

    Dest decision    transmitted:                   309579             0

    TCP connect    transmitted:                     309827             0

    NAT Pool    Alloc [addr/port]:                       3             0

    NAT Pool Free    [addr/port]:                        3             0

    OCM Packet    count (Hi & Lo):                 1052133             0

    (Context ALL    Statistics)

    Drop [route    lookup fail]:                      5545             0

    Connection    inserted:                         428481             0

    Packet    message transmitted:                  118654             0

    ACE20/Admin#

    !___ client から Traffic を流した後

    ACE20/Admin# sh conn

    total current    connections : 4

    conn-id    np dir proto vlan source                destination           state

    ----------+--+---+-----+----+---------------------+---------------------+------+

    892894     1  in  TCP   771  192.168.71.11:10000   192.168.71.100:80     ESTAB

    892895     1  out TCP   772  192.168.72.12:80      192.168.71.11:10000   ESTAB

    892896     1  in  TCP   771  192.168.71.11:10000   192.168.72.11:80      ESTAB

    892897     1  out TCP   772  192.168.72.11:80      192.168.71.11:10000   ESTAB

    !___ 3) connection が存在しない

    ACE20/Admin#

    ACE20/Admin# show np 1 me-stats "-s    ocm"

    OCM    Statistics: (Current)

    --------------

    Connection    create received:                    5842             0

    LB dest    decision received:                   427684             0

    Connection    unproxy received:                 308451             0

    TCP connected    received                       309541             0

    Dest decision    transmitted:                   309541             0

    TCP connect    transmitted:                     309839             0

    NAT Pool    Alloc [addr/port]:                       3             0

    NAT Pool Free    [addr/port]:                        3             0

    OCM Packet    count (Hi & Lo):                 1051518             0

    (Context ALL    Statistics)

    Drop [route    lookup fail]:                      5838             0

    Drop    [redundant connection]:                         1             0

    Connection    inserted:                         427687             0

    Packet    message transmitted:                  117848             0

    ACE20/Admin# show np 2 me-stats "-s    ocm"

    OCM    Statistics: (Current)

    --------------

    Connection    create received:                    5546             0

    LB dest    decision received:                   428480             0

    Connection    unproxy received:                 308528             0

    TCP connected    received                       309579             0

    Dest decision    transmitted:                   309579             0

    TCP connect    transmitted:                     309827             0

    NAT Pool    Alloc [addr/port]:                       3             0

    NAT Pool Free    [addr/port]:                        3             0

    OCM Packet    count (Hi & Lo):                 1052133             0

    (Context ALL    Statistics)

    Drop [route    lookup fail]:                      5545             0

    Connection    inserted:                         428481             0

    Packet    message transmitted:                  118654             0

    ACE20/Admin#

    client 側の error からもわかるように、今回は 3) connection が張れませんでした。 実際、ACE connection table にも entry が存在しません。 その代わり、np 1 ocm Drop [redundant connection] counter が上昇していることが確認できます。 この counter は既に存在する connection と同じ entry を作ろうとした時に上昇します。

    もし、3) connection を張ることができた場合、ACE では下記のような entry が生成されます。 上記 show conn の出力と比較すると、戻りの entry が、client  -> vip で生成した entry と同じになってしまいます。 そのため、ACE は、redundant  connection と判断し、この entry を生成せず drop します。

    892898     1  in  TCP   771  192.168.71.11:10000   192.168.72.12:80      ESTAB

    892899     1   out TCP   772  192.168.72.12:80       192.168.71.11:10000   ESTAB

    ACE は、実装上、同一 entry を生成することはできませんので、これを回避するためには、client - server 間で直接 access する際に ACE を経由しないようにする、もしくは、snat を使用し、ACE 上で生成される entry を異なるものにするといった工夫が必要になります。

    この事象は原因を知っていれば簡単に再現できますが、実環境のように random port# で大量の access があるような環境で、ときどき access できないという情報のみで、この原因を特定することは難しいです。 そのため、現象が継続的に発生しているような環境では、counter の差分を確認するために show tech 2 回取得するようにしてください。

Getting Started

検索バーにキーワード、フレーズ、または質問を入力し、お探しのものを見つけましょう

シスコ コミュニティをいち早く使いこなしていただけるよう役立つリンクをまとめました。みなさんのジャーニーがより良いものとなるようお手伝いします