ここでは、L3/L4 設定と L7 設定を行った場合の ACE の内部処理の違い及び、proxy/unproxy について簡単に説明します。
architecture の詳細については Connection Handling within the Cisco Application Control Engine Module Hardware をご参照ください。
ACE module は下記のような architecture となっています。
ACE を管理するのが Control Plane で、Traffic を処理するのが Data Plane です。
Data Plane は CDE(Classification Distribution Engine), 2 つの Network Processor(IXP2800), crypto processor (NITROX II) からなります。
CDE でどの processor を使用するかを決定し、np で loadbalancing 処理を行います。
実際に、Loadbalancing を行うのは np です。
np は 16 個の Micro Engine と、Xscale からなります。
Receive : 入力 packet を受信するための MicroEngine
FastPath : MAC address の書き換え, NAT, TCP normalization 等を行う ME
ICM : 入力 connection の管理を行う ME
OCM : 出力 connection の管理を行う ME
CCM : Connection の close 管理を行う ME
TCP : TCP connection を terminate するための ME
HTTP : HTTP の文字列処理を行う ME
SSL Record Layer : SSL Record Layer の処理を行う ME
IP Fragmentation/Timers : Fragment 処理や timer 処理を行う ME
DNS and ICMP Inspection : DNS や ICMP の Inspection を行う ME
Xscale : 下記処理を担当します
- Load-balancing algorithm
- SSL handshake
- FTP, RTSP inspection
- HTTP inspection
- HA
- connection 関連 command の統計情報管理
# L3/L4 通信時の内部処理
L3/L4 処理を行う場合、ACE 内部では上記手順で処理され connection が生成されます。
一旦、connection が生成されると、それ以降、connection table を参照し、NAT 処理を行うだけでよいので、後続 packet は下記手順で処理されるようになります。
# L7 通信時の内部処理
L7 処理を行う場合、ACE で connection が終端されるため、L3/L4 では使用されなかった TCP ME が使用されます。また、header を check するため、HTTP ME も使用されます。
client からの syn packet は
CDE -> FastPath -> ICM -> TCP (syn/ack) -> FastPath -> CDE -> client (ack & http request) -> CDE -> FastPath -> TCP
の順に処理され、client - ACE 間で connection が確立されます。 そして、client に代わって server と connection を確立することから ACE ではこの処理のことを proxy と呼んでいます。
一旦、connection が生成されると、それ以降、connection table を参照し、NAT 処理を行うだけでよいので、後続 packet は下記手順で処理されるようになります。(この処理は L3/L4 と同様です。)
ACE は、resource 節約のため、いつまでも proxy するということはしません。
具体的には、http response 受信後に不要となった proxy を unproxy します。
これは、show command で確認できます。
c2801a#telnet 192.168.71.102 80 Trying 192.168.71.102, 80 ... Open !___ この状態 (GET request 送信前) で log 取得 |
ACE20/Admin# sh conn total current connections : 1 conn-id np dir proto vlan source destination state ----------+--+---+-----+----+---------------------+---------------------+------+ 104 2 in TCP 771 192.168.71.1:12776 192.168.71.102:80 ESTAB -- - - -- -- -- -- -- !___ client 側の connection のみ確立し、GET request を待っている状態 !___ この connection は np 2 を使用しているので、以降の command では np 2 の状態を確認 ACE20/Admin# sh np 2 me-stats -stcp | i proxy Unproxy req. message received: 2 0 Unproxy rsp. message received: 2 0 Connections unproxying: 2 0 Connections unproxying flush retransq: 2 0 Connections unproxying flush inputq: 2 0 ACE20/Admin# sh np 2 me-stats -shttp | i proxy TCP proxy rx msgs received: 2 0 Unproxy msgs sent: 2 0 Unproxy conns: 2 0 !___ client から GET request を送信 ACE20/Admin# sh conn total current connections : 2 conn-id np dir proto vlan source destination state ----------+--+---+-----+----+---------------------+---------------------+------+ 104 2 in TCP 771 192.168.71.1:12776 192.168.71.102:80 ESTAB 105 2 out TCP 772 192.168.72.2:80 192.168.71.1:12776 ESTAB ACE20/Admin# ACE20/Admin# sh np 2 me-stats -stcp | i proxy Unproxy req. message received: 3 0 Unproxy rsp. message received: 3 0 Connections unproxying: 3 0 Connections unproxying flush retransq: 3 0 Connections unproxying flush inputq: 3 0 ACE20/Admin# sh np 2 me-stats -shttp | i proxy TCP proxy rx msgs received: 3 0 Unproxy msgs sent: 3 0 Unproxy conns: 3 0 ACE20/Admin# |