DynagenでCCIEを目指す
Custom Queueing
最終更新:
it_certification
-
view
1. 目的
- Custom Queueingの設定方法について確認します。
2. 構成
2.1. 設定概要
- 初期設定はIPアドレスのみです。
- Host OS側でApacheを起動させます。
- Guest OS, R1間は10Mで接続する事で、わざと輻輳を発生させます。
2.2. 構成図

2.3. netファイル
model = 3620 [localhost] [[3620]] image = C:\Program Files\Dynamips\images\c3620-j1s3-mz.123-18.bin ram = 128 [[ROUTER R1]] f0/0 = NIO_gen_eth:\Device\NPF_{8B89D910-5ED3-4A43-9DE9-6A272A3D7592} e1/0 = NIO_gen_eth:\Device\NPF_{5933302A-7AAA-475C-A8FE-A6B82B0C0F98}
2.4. 初期設定
- R1
! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R1 ! boot-start-marker boot-end-marker ! ! no aaa new-model ip subnet-zero ! ! no ip domain lookup ! ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface FastEthernet0/0 ip address 192.168.200.1 255.255.255.0 duplex auto speed auto ! interface Ethernet1/0 ip address 192.168.201.1 255.255.255.0 half-duplex ! interface Ethernet1/1 no ip address shutdown half-duplex ! interface Ethernet1/2 no ip address shutdown half-duplex ! interface Ethernet1/3 no ip address shutdown half-duplex ! ip http server ip classless ! ! no cdp run ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
2.5. Apache 設定
ホストOSにApacheをインストールし、ポートベースのバーチャルホストを定義します。構築方法はトップページ/手順書 サーバ系/Apache HTTP Server バーチャルホストの設定を参考にして下さい。
この検証例で実際に使用したhttpd.confの要所となる部分を以下に記載します。
この検証例で実際に使用したhttpd.confの要所となる部分を以下に記載します。
Listen 10880 Listen 10881 Listen 10882 NameVirtualHost *:10880 NameVirtualHost *:10881 NameVirtualHost *:10882 <VirtualHost *:10880> DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs" </VirtualHost> <VirtualHost *:10881> DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs10881" </VirtualHost> <VirtualHost *:10882> DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs10882" </VirtualHost>
2.6. サーバ側 ルーティング設定
- Host OS
route add 192.168.201.0 mask 255.255.255.0 192.168.200.1
- Guest OS
route add -net 192.168.200.0/24 gw 192.168.201.1
3. [検証] priority queue 基本設定
3.1. 概要
Custom Queueingとは、ラウンドロビンで各キューに送信権を与える方式です。各キューにはバイトカウントが定義でき、バイトカウントの値に基づいて出力インターフェースに転送する事ができます。
話を具体的に進めるため、以下のバイトカウントの定義を想定します。
話を具体的に進めるため、以下のバイトカウントの定義を想定します。
queue | byte count |
---|---|
1 | 1000 |
2 | 2000 |
3 | 3000 |
4 | 4000 |
上記の例の場合、まずキュー1に送信権が与えられます。キュー1の送信量が1000byteを超えると、送信権がキュー2に移ります。キュー2の送信量が2000byteを超えると送信権がキュー3に移ります。
3.2. チューニング
custom queueingはルータに流れるパケットをキャプチャし、実際のパケット長に基づいて設定する必要があります。
実際のパケット長に基づいた設定を行わないと、想定通りのラウンドロビンにならない事があります。設定失敗例を以下に示します。
宛先 | パケット長 | queue | byte counte | パケット数 |
---|---|---|---|---|
Webサーバ1 | 580 | 1 | 500 | 2 |
Webサーバ2 | 580 | 1 | 1000 | 2 |
Webサーバ3 | 580 | 1 | 1500 | 3 |
Webサーバ1, 2, 3を1:2:3でラウンドロビンするために、byte countを500, 1000, 1500と定義したとします。しかし、実際は、キュー1は2パケット送信した後に、送信権をキュー2に渡します。キュー2は2パケット送信した後に、送信権をキュー3に渡します。このように、byte countは実際のパケット長を考慮しないと、想定外のラウンドロビンになってしまう事があります。
3.3. パケットキャプチャ
本シナリオで実際に流れるパケットの長さを計測します。
Gust OSからHost OSへの以下wgetコマンドを実行し、その時のパケットをキャプチャします。
Gust OSからHost OSへの以下wgetコマンドを実行し、その時のパケットをキャプチャします。
[root@localhost ~]# wget -O /dev/null http://192.168.200.100:10880/large.html --2010-11-02 17:01:34-- http://192.168.200.100:10880/large.html Connecting to 192.168.200.100:10880... connected. HTTP request sent, awaiting response... 200 OK Length: 23016000 (22M) [text/html] Saving to: `/dev/null' 73% [===================================> ] 16,973,824 19.1K/s eta 2m 22s
私の検証環境では、殆どのHTTPパケットが576byteである事が分かりました。
#ref error :ご指定のファイルが見つかりません。ファイル名を確認して、再度指定してください。 (100%)
3.4. 設定投入
以下のqueueingを定義します。
通信 | queue | byte count |
---|---|---|
SSH | 1 | 400 |
tcp10880を使用したHTTP | 2 | 576 * 1 |
tcp10881を使用したHTTP | 3 | 576 * 2 |
tcp10882を使用したHTTP | 4 | 576 * 3 |
投入するconfigは以下の通りです。
R1(config)#access-list 100 permit tcp any any eq 22 R1(config)# R1(config)# R1(config)#queue-list 2 protocol ip 1 list 100 R1(config)#queue-list 2 protocol ip 2 tcp 10880 R1(config)#queue-list 2 protocol ip 3 tcp 10881 R1(config)#queue-list 2 protocol ip 4 tcp 10882 R1(config)# R1(config)# R1(config)#queue-list 2 queue 1 byte-count 400 R1(config)#queue-list 2 queue 2 byte-count 576 R1(config)#queue-list 2 queue 3 byte-count 1152 R1(config)#queue-list 2 queue 4 byte-count 1728 R1(config)# R1(config)# R1(config)#interface Ethernet 1/0 R1(config-if)#custom-queue-list 2
3.5. テストトラフィックの送信
Host OSからGuest OSへssh接続い、以下要領のwgetコマンドを3つ同時に実行します。
送信権の割当が少ないtcp10880宛てのHTTP通信が一番遅い事を確認します。
送信権の割当が少ないtcp10880宛てのHTTP通信が一番遅い事を確認します。
[root@localhost ~]# wget -O /dev/null http://192.168.200.100:10882/large.html --2010-11-03 17:17:28-- http://192.168.200.100:10882/large.html Connecting to 192.168.200.100:10882... connected. HTTP request sent, awaiting response... 200 OK Length: 23016000 (22M) [text/html] Saving to: `/dev/null' 17% [=======> ] 4,062,804 12.5K/s eta 28m 29s [root@localhost ~]# wget -O /dev/null http://192.168.200.100:10881/large.html --2010-11-03 17:17:21-- http://192.168.200.100:10881/large.html Connecting to 192.168.200.100:10881... connected. HTTP request sent, awaiting response... 200 OK Length: 23016000 (22M) [text/html] Saving to: `/dev/null' 17% [=======> ] 3,932,684 9.51K/s eta 32m 27s [root@localhost ~]# wget -O /dev/null http://192.168.200.100:10880/large.html --2010-11-03 17:17:07-- http://192.168.200.100:10880/large.html Connecting to 192.168.200.100:10880... connected. HTTP request sent, awaiting response... 200 OK Length: 23016000 (22M) [text/html] Saving to: `/dev/null' 13% [=====> ] 3,080,716 4.54K/s eta 46m 40s
3.6. showコマンドによる確認
show queueingコマンドでqueueingの設定を確認する事ができます。
(複数のqueueingが定義されている場合は、show queueing customと入力する事でcustom queueのみを表示させる事ができます)
(複数のqueueingが定義されている場合は、show queueing customと入力する事でcustom queueのみを表示させる事ができます)
R1#show queueing custom Current custom queue configuration: List Queue Args 2 1 protocol ip list 100 2 2 protocol ip tcp port 10880 2 3 protocol ip tcp port 10881 2 4 protocol ip tcp port 10882 2 1 byte-count 400 2 2 byte-count 576 R1#
show queueing interfaceコマンドで各queueを通過したパケット数を確認する事ができます。
R1#show queueing interface Ethernet 1/0 Interface Ethernet1/0 queueing strategy: custom Output queue utilization (queue/count) 0/118 1/2570 2/4944 3/6534 4/7365 5/0 6/0 7/0 8/0 9/0 10/0 11/0 12/0 13/0 14/0 15/0 16/0 R1#
priority queueingの場合、show queueコマンドで現在queueに格納されているパケットを確認する事ができましたが、custom queueingの場合は何も表示されないようです。
R1#show queue Ethernet 1/0 R1#
show interfaceコマンドで各queueに何パケット格納されているかを確認する事ができます。
R1#show interfaces Ethernet 1/0 Ethernet1/0 is up, line protocol is up Hardware is AmdP2, address is cc00.0b3c.0010 (bia cc00.0b3c.0010) Internet address is 192.168.201.1/24 MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec, reliability 255/255, txload 6/255, rxload 1/255 Encapsulation ARPA, loopback not set Keepalive set (10 sec) ARP type: ARPA, ARP Timeout 04:00:00 Last input 00:09:29, output 00:00:00, output hang never Last clearing of "show interface" counters never Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: custom-list 2 Output queues: (queue #: size/max/drops) <- queueに格納されたパケットを確認できます。 0: 0/20/0 1: 0/20/0 2: 0/20/0 3: 5/20/0 4: 0/20/0 5: 0/20/0 6: 0/20/0 7: 0/20/0 8: 0/20/0 9: 0/20/0 10: 0/20/0 11: 0/20/0 12: 0/20/0 13: 0/20/0 14: 0/20/0 15: 0/20/0 16: 0/20/0 5 minute input rate 33000 bits/sec, 46 packets/sec 5 minute output rate 239000 bits/sec, 62 packets/sec 22968 packets input, 2087661 bytes, 0 no buffer Received 9 broadcasts, 0 runts, 0 giants, 0 throttles 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored 0 input packets with dribble condition detected 30633 packets output, 15600437 bytes, 0 underruns 0 output errors, 0 collisions, 5 interface resets 0 babbles, 0 late collision, 0 deferred 0 lost carrier, 0 no carrier 0 output buffer failures, 0 output buffers swapped out R1#
4. [検証] custom queueingの詳細設定
4.1. queueのサイズ変更
各queueに格納できるパケット数を変更する事もできます。設定例は以下の通りです。
R1(config)#queue-list 2 queue 3 limit 30 R1(config)#queue-list 2 queue 4 limit 40 R1(config)#^Z R1# *Mar 1 00:38:24.207: %SYS-5-CONFIG_I: Configured from console by console R1# R1#show queueing custom Current custom queue configuration: List Queue Args 2 1 protocol ip list 100 2 2 protocol ip tcp port 10880 2 3 protocol ip tcp port 10881 2 4 protocol ip tcp port 10882 2 1 byte-count 400 2 2 byte-count 576 2 3 byte-count 1152 limit 30 <- queueのサイズが定義された事を確認します 2 4 byte-count 1728 limit 40 <- queueのサイズが定義された事を確認します R1# R1# R1#show interfaces Ethernet 1/0 Ethernet1/0 is up, line protocol is up Hardware is AmdP2, address is cc00.0b3c.0010 (bia cc00.0b3c.0010) Internet address is 192.168.201.1/24 MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec, reliability 255/255, txload 6/255, rxload 1/255 Encapsulation ARPA, loopback not set Keepalive set (10 sec) ARP type: ARPA, ARP Timeout 04:00:00 Last input 00:04:11, output 00:00:00, output hang never Last clearing of "show interface" counters never Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: custom-list 2 Output queues: (queue #: size/max/drops) <- queueのサイズが変更された事を確認します。 0: 0/20/0 1: 0/20/0 2: 0/20/0 3: 0/30/0 4: 4/40/0 5: 0/20/0 6: 0/20/0 7: 0/20/0 8: 0/20/0 9: 0/20/0 10: 0/20/0 11: 0/20/0 12: 0/20/0 13: 0/20/0 14: 0/20/0 15: 0/20/0 16: 0/20/0 5 minute input rate 33000 bits/sec, 47 packets/sec 5 minute output rate 252000 bits/sec, 59 packets/sec 39889 packets input, 3607470 bytes, 0 no buffer Received 10 broadcasts, 0 runts, 0 giants, 0 throttles 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored 0 input packets with dribble condition detected 52923 packets output, 27109779 bytes, 0 underruns 0 output errors, 0 collisions, 5 interface resets 0 babbles, 0 late collision, 0 deferred 0 lost carrier, 0 no carrier 0 output buffer failures, 0 output buffers swapped out R1#
添付ファイル