• 検索結果がありません。

Run-Based Trieから構成される 決定木の枝刈り法

N/A
N/A
Protected

Academic year: 2021

シェア "Run-Based Trieから構成される 決定木の枝刈り法"

Copied!
28
0
0

読み込み中.... (全文を見る)

全文

(1)

Run-Based Trie

から構成される

決定木の枝刈り法

原田崇司1 田中賢1 三河賢治2 1神奈川大学大学院理学研究科情報科学専攻 2新潟大学学術情報基盤機構情報基盤センター 2015 年 11 月 6 日

(2)

目次

パケットフィルタリング(モデルと既存の手法)

Run-Based Trie, Simple Search ,決定木探索(我々の提案手法)

Run-Based Trie から構成される 決定木の枝刈り法 実験結果

(3)

パケットフィルタリングとは

Network A Network B Network X Filtering Policy Rule Action Permit Deny Permit Deny Network A, K Network B Network C, D Default Packet Packet Router Figure : 入ってくるパケットをポリシーに従ってルータで分類

(4)

パケットフィルタリングとは

パケットフィルタリングを行う関数 f

f :

{ 0, 1 }

dW

→ { P, D }

パケットフィルタリングとは,長さ dW の 0, 1 のビット列に対して P, D の値を割り当てる関数

(5)

フィルタリングルールの形式

i 番目のルール Rvi = b1b2. . . bdW (bi ∈ {0, 1, ∗}, v ∈ {P, D}) Table : フィールドが一つの例 Filter F1 R1 0 ∗ 1 ∗ R2 ∗ 0 0 0 R3 1 1 0 1 R4 1 1 ∗ ∗ R5 0 ∗ ∗ 1 R6 ∗ 1 ∗ ∗ Table : フィールドが二つの例 Filter F1 F2 R1 ∗ 1 ∗ 0 ∗ 0 0 ∗ R2 1∗ 0 0 1 1∗ 1 R3 ∗ 1 1 ∗ 0 1 1 1 R4 0 1∗ ∗ ∗ 1 ∗ 1 R5 1 0 1 1 0 0 1 R6 ∗ 0 1 0 1 1 0 0

(6)

線型探索によるパケットフィルタリングの実装

RP 1 Rule Packet RD 2 Rule RD 3 Rule

permit Packet to pass deny Packet to pass deny Packet to pass

permit Packet to pass

deny Packet to pass RP

n−1

Rule

ifPacket match R1thenpermit Packetelse ifPacket match R2thendenyelse

ifPacket match R3thendenyelse

ifPacket match Rn−1thenpermitelse

deny Packet

if

Figure : 上位のルールから順番にパケットとルールをひとつひとつ比較

パケットは最後のデフォルトルール RD

(7)

パケットフィルタリングに対する理論的な研究

▶ フィルタリングルールリスト最適化

▶ SubGraph Merging(Tapdiya et al [1] 2009年)

▶ 昆金による方法(昆金ら[2] 2013年)

▶ 竹山による方法(竹山ら[3] 2013年)

▶ 到着パケットに合致する最優先ルールを高速に見つける

▶ 階層型トライ(Srinivassan et al [4] 1998年)

HiCuts, HyperCutsGupta et al [5], Singh et al [6] 2000, 2003年) ▶ Grouper(Ligatti et al [7] 2010年)

(8)

何故

Run-Based Trie

HiCuts,HyperCuts,階層型トライは,任意のビットマスクを含む ルール (0∗ 11 ∗ 00 ∗ 10∗ の様な歯抜けのルール) に対応しない

任意のビットマスクを含むルールに対応するデータ構造である Run-Based Trie を提案

(9)

どうして決定木

ルールは一旦追加されると危険性の有無を確認できない 追加したルールは消せないのでルール数は増える一方 ルール数が増えると探索時間が長くなる ルール数に依存しない探索法である決定木を用いた探索法を提案 (前掲の方法, Run-Based Trie の素朴な探索法はルール数に依存)

(10)

Run-Based Trie

Table : 任意のビットマスクを含むルールのルールリスト Filter F1 Filter F1 R1 ∗ 0 ∗ 1 R7 ∗ ∗ 1 0 R2 0 0 0 0 R8 0 1 ∗ ∗ R3 0 ∗ 0 0 R9 ∗ 1 1 ∗ R4 0 ∗ 1 ∗ R10 ∗ 0 0 0 R5 1 1 0 0 R11 ∗ 1 ∗ 1 R6 ∗ 0 1 ∗ R12 ∗ ∗ ∗ 1 上記のルールリストのルール中に存在する連の例: R1の 2 ビット目からの 0,4 ビット目からの 1 R3の 1 ビット目からの 0,3 ビット目からの 00

(11)

Run-Based Trie

R1 2 R15 0 0 0 R1 3R14 T1 0 1 R1 8 T4 1 R2 4 R2 1 R211R112 R2 3 R 1 7 T3 0 0 1 0 R1 10 R1 9 R1 6 0 1 0 1 R1 1 0 T2 1 R1 11 1 0 0 1

Figure : Run-Based Trie

ルールリスト中の各連の開始位置 i ビット毎にトライ Tiを構成 ルールを構成する連の中で最後の連には下線を引く

(12)

Simple Search

R1 2 R15 0 0 0 R1 3R14 T1 0 1 R1 8 T4 1 R2 4 R2 1R 2 11R 1 12 R2 3 R 1 7 T3 0 0 1 0 R1 10 R1 9 R1 6 0 1 0 1 R1 1 0 T2 1 R1 11 1 0 0 1

Figure : パケット0011でRun-Based Trieを辿る

R6, R4, R1, R12に合致.この中で優先度の一番高い R1を返す. 探索時間計算量:O(NdW + (dW)2) (ルール数 N に依存)

(13)

集合族

各トライ Tiを辿った際に得られるパケットと連との合致パタンの集 合を Siで表す. S1={ {R13, R 1 4}, {R 1 2, R 1 3, R 1 4}, {R 1 3, R 1 4, R 1 8}, {R 1 5}, ϕ } S2={ {R11}, {R 1 1, R 1 10}, {R 1 1, R 1 6}, {R 1 11}, {R 1 9, R 1 11}, ϕ } S3={ {R23}, {R 2 4}, {R 2 4, R 1 7}, ϕ } S4={ {R21, R 2 11, R 1 12}, ϕ }

(14)

決定木

Decision Tree ϕ S1 3 R1R3R1R4 S12 S2 3 S33 ϕ S1 4ϕ S14ϕ S14ϕS14ϕ R1R4R1 S1 3 R1R3R1R4 S32 S2 3 S33 ϕ S1 4ϕ S14ϕ S14ϕS14ϕ R1R4R1 S1 3 R12 R12 ϕ S2 3 S33 ϕ S1 4ϕ S14ϕ S14ϕ S14ϕ R7R7R12 S11 R6 S1 3 R1R3R1R4 S32 S2 3 S33 ϕ S1 4ϕ S14ϕ S14ϕS14ϕ R1R4R1R10 Figure : 決定木 Run-Based Trie を用いて決定木を降りるだけで探索終了 探索時間計算量:O((dW)2) (ルール数 N に依存しない)

(15)

決定木はメモリを食いすぎ

探索時間は O((dW)2) だが空間計算量が O(NdW) 空間計算量が膨大で全く実用的でない 決定木の枝刈りアルゴリズムが必要 「T1, T2, . . . , Tkでの合致の仕方から Tk+1での合致の仕方としてあり得 ないものを排除」という方針で枝刈りを実行

(16)

集合族の元の表記

S1={ {R13, R 1 4}, {R 1 2, R 1 3, R 1 4}, {R 1 3, R 1 4, R 1 8}, {R 1 5}, ϕ } S2={ {R11}, {R 1 1, R 1 10}, {R 1 1, R 1 6}, {R 1 11}, {R 1 9, R 1 11}, ϕ } S3={ {R23}, {R24}, {R24, R17}, ϕ } S4={ {R21, R 2 11, R 1 12}, ϕ } 集合族の元を,その元を得るパケットのビットパタンに置き換える. S1={ 0, 0000, 01, 1100, ϕ } S2={ 0, 000, 01, 1, 11, ϕ } S3={ 00, 1, 10, ϕ } S4={ 1, ϕ }

(17)

集合族内の不要な元の消去

R

110

R

19

R

16

0

1

0

1

R

11

0

T

2

1

R

111 Figure : トライT2 S2の元 ϕ は,T2のトライを辿る際 にいずれの連にも合致しないこと を意味するが,{R1 1} (0) と {R111} (1) の連が存在するので,いずれの連に も合致しないということはない. S2から ϕ を削除 S2 ={{R11}, {R 1 1, R 1 10}, {R 1 1, R 1 6}, {R 1 11}, {R 1 9, R 1 11}, ϕ }

(18)

親のビット列と比較

Decision Tree

0000

0

/

000 01

//

1

/

11

//

Figure : 親のビット列と比較 上位のトライ (T1) を 0000 と 辿るパケットは,現在のトライ (T2) を ▶ 0 としか辿れないというこ とはない ▶ 01 とは辿らない ▶ 1 とは辿らない ▶ 11 とは辿らない 0000 の子は 000 のみ

(19)

親の兄弟のビット列との比較による枝刈り

Decision Tree

0

0

//// 01

000

1

/

11

//

0

1

0

000

Figure : 親の兄弟ノードとの比較 パケットが T1で 0 のパタンに合 致することは T1を ▶ 01 と辿れなかった ▶ 0000 と辿れなかった ことを意味するので,そのよう なパケットは T2を 1 とは辿らな い.また 000 とも辿らない. 0 の子ノードとして 1 と 000 か ら始まるものを消去

(20)

子孫に枝刈り情報を伝える

Decision Tree

0000 01

0

11

00

ϕ

0

/

000

//// 01

//

11

//

00

1

/

10

//

//

ϕ

1(

00)

Figure : 子孫に枝刈り情報を伝える(祖父母のレベルの枝刈り情報が必要)

(21)

枝刈り法を適用した決定木

ϕ Decision Tree 00 10 000 0000 01 0 1100 ϕ 11 1 1 ϕ ϕ 1 ϕ 1 1 ϕ ϕ 000 01 ϕ ϕ ϕ 1 1 ϕ 1 1 1 00 00 10 1 0 11 1 1 10 1 00 ϕ 10 ϕ 01 ϕ 0 R2 R4 R4 R3 R8 R4 R1 R1 R5 R10 R6 R1 R1 R7 R9 R11 Figure : あり得ない辺を取り除いた決定木 ノード数: 396→ 48

(22)

枝刈り法を適用した決定木

Decision Tree 0000 01 0 1100 ϕ 11 000 01 10 1 0 11 1 1 10 1 00 ϕ 10 ϕ 01 0 R2 R4 R3 R8 R4 R1 R1 R5 R10 R6 R1 R1 R7 R9 R11 Figure : 枝分かれしないパスを短縮した決定木 ノード数: 48→ 23

(23)

実験環境

OS : CentOS Release 6.2

CPU : Intel Core i7-980X 3.33 GHz 主記憶容量 : 24GB

実装言語 : C++

(24)

実験結果(

100

ルール)

1 10 100 1000 10000 Memory (MB) Length of bit (dW) 16 14 pruned Decision Tree

Decision Tree 12 10 8 6 2 4 Figure : 決定木の構築に要するメモリ

(25)

実験結果(

100

ルール)

0 1 2 3 4 5 6 7 2 4 6 8 10 12 14 16 Create time (s) Length of bit (dW)

pruned Decision Tree Decision Tree

(26)

実験結果(

16

ビット)

0 0.1 0.2 0.3 0.4 0.5 1 10 100 1000 10000 Search Time (s) Number of Rule (N)

pruned Decision Tree

(27)

まとめと今後の課題

まとめ

▶ Run-Based Trieを探索するのに用いる決定木の空間計算量が O(NdW)なので決定木の枝刈り法を提案 ▶ 提案した枝刈り法の有効性を実装実験により16ビットまで確認

今後の課題

▶ 枝刈り法の時間,空間計算量の算出 ▶ 提案した枝刈り法が無駄のない決定木を構成することの証明 ▶ より長いビット長での枝刈り法の有効性の確認 

(28)

▶ A. Tapdiya, and E. Fulp, “Towards optimal firewall rule ordering utilizing directed acyclical graphs,” Computer Communications and Networks, 2009. ICCCN 2009. Proceedings of 18th Internatonal Conference on, pp.1-6, Aug 2009.

▶ K. TANAKA, K. MIKAWA, and M. HIKIN, “A heuristic algorithm for reconstructing a packet filter with dependent rules,” IEICE Trans. Commun., vol.96, no.1, pp.155-162, Jan 2013. ▶ K. Tanaka, K. Mikawa, and K. Takeyama, “Optimization of packet filter with maintenance of

rule dependencies,” IEICE Communications Express, vol.2, no.2, pp.80-85, Feb 2013.

▶ V. Srinivasan, G. Varghese, S. Suri, and M. Waldvogel, “Fast and scalable layer four switching,” SIGCOMM Comput. Commun. Rev., vol.28, no.4, pp.191–202, Oct. 1998.

▶ P. Gupta, and N. McKeown, “Classifying packets with hierarchical intelligent cuttings,” Micro, IEEE, vol.20, no.1, pp.34-41, Jan 2000.

▶ S. Singh, F. Baboescu, G. Varghese, and J. Wang, “Packet classification using multidimensional cutting,” Proceedings of the 2003 Conference on Applications, Technologies, Architectures, and Protocols for Computer Communications, pp.213–224, New York, NY, USA, 2003, ACM. ▶ J. Ligatti, J. Kuhn, and C. Gage, “A packet-classification algorithm for arbitrary bitmask rules,

with automatic time-space tradeoffs,” Proceedings of the International Conference on Computer Communication Networks (ICCCN), pp.145–150, Aug. 2010.

▶ K. MIKAWA, and K. TANAKA, “Run-based trie involving the structure of arbitrary bitmask rules,” IEICE Transactions on Information and Systems, vol.E98.D, no.6, pp.1206-1212, 2015.

Figure : Run-Based Trie
Figure : パケット 0011 で Run-Based Trie を辿る
Figure : 決定木の構築に要する時間
Figure : 決定木探索の探索時間

参照

関連したドキュメント

of ISE

Although the holonomy gives infinitely many tight contact structures up to isotopy (fixing the boundary), this turns out to be a special feature of the nonrotative case. This

This section will show how the proposed reliability assessment method for cutting tool is applied and how the cutting tool reliability is improved using the proposed reliability

Wang, Oscillation of delay difference equations with several delays, Journal of Mathematical Analysis and Applications 286 (2003), no.. Zhou, Oscillation and nonoscillation for

de la CAL, Using stochastic processes for studying Bernstein-type operators, Proceedings of the Second International Conference in Functional Analysis and Approximation The-

この課題のパート 2 では、 Packet Tracer のシミュレーション モードを使用して、ローカル

For the image-coding applications, we had proposed an efficient scheme to organize the wavelet packet WP coefficients of an image into hierarchical trees called WP trees 32.. In

Amount of Remuneration, etc. The Company does not pay to Directors who concurrently serve as Executive Officer the remuneration paid to Directors. Therefore, “Number of Persons”