DynagenでCCIEを目指す
20100813 IP SAL
最終更新:
it_certification
-
view
1. 目的
- IP SLAの設定方法を確認します。
2. 構成
2.1. 設定概要
- ルータの初期設定はIPアドレスのみです。
- トップページ/手順書 サーバ系に基づいて、coLinuxがインストールされているものとします。
- トップページ/手順書 サーバ系に基づいて、ホストOS上にApacheがインストールされているものとします。
2.2. 構成図

2.3. netファイル
model = 3660 [localhost] [[3660]] image = C:\Program Files\Dynamips\images\c3660-ik9o3s-mz.124-6.T.bin ram = 128 [[ROUTER R1]] f0/0 = NIO_gen_eth:\Device\NPF_{Host OS Loopback 0} f0/1 = R2 f0/1 [[ROUTER R2]] f0/0 = NIO_gen_eth:\Device\NPF_{Guest OS eth 1}
2.4. 初期設定
- R1
! version 12.4 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 ! resource policy ! memory-size iomem 5 ! ! ip cef no ip domain lookup ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface Loopback0 ip address 1.1.1.1 255.255.255.255 ! interface FastEthernet0/0 ip address 192.168.200.1 255.255.255.0 duplex auto speed auto ! interface FastEthernet0/1 ip address 192.168.12.1 255.255.255.0 duplex auto speed auto ! router ospf 1 log-adjacency-changes passive-interface default no passive-interface FastEthernet0/1 network 1.1.1.1 0.0.0.0 area 0 network 192.168.12.1 0.0.0.0 area 0 network 192.168.200.1 0.0.0.0 area 0 ! ip http server no ip http secure-server ! ! ! no cdp run ! ! ! control-plane ! ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
- R2
! version 12.4 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R2 ! boot-start-marker boot-end-marker ! ! no aaa new-model ! resource policy ! memory-size iomem 5 ! ! ip cef no ip domain lookup ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface Loopback0 ip address 2.2.2.2 255.255.255.255 ! interface FastEthernet0/0 ip address 192.168.201.2 255.255.255.0 duplex auto speed auto ! interface FastEthernet0/1 ip address 192.168.12.2 255.255.255.0 duplex auto speed auto ! router ospf 1 log-adjacency-changes passive-interface default no passive-interface FastEthernet0/1 network 2.2.2.2 0.0.0.0 area 0 network 192.168.12.2 0.0.0.0 area 0 network 192.168.201.2 0.0.0.0 area 0 ! ip http server no ip http secure-server ! ! ! no cdp run ! ! ! control-plane ! ! ! ! ! ! ! ! ! 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 route add 192.168.12.0 mask 255.255.255.0 192.168.200.1
- Guest OS
route add -net 192.168.200.0/24 gw 192.168.201.2 route add -net 192.168.12.0/24 gw 192.168.201.2
3. [検証] HTTPの測定
3.1. 設定投入
Host OS上に構築したApacheに対してhttp getを定期的に実行する設定を投入します。
R2(config)#ip sla 20 R2(config-ip-sla)#http get http://192.168.200.100:10880/index.html cache disable R2(config-ip-sla-http)#frequency 60 <- 単位は秒です。 R2(config-ip-sla-http)#exit R2(config)# R2(config)# R2(config)#ip sla schedule 20 life forever start-time now
3.2. 設定確認
以下のコマンドでSLAを満たしているかどうかを確認できます。http getが成功/失敗した回数やラウンドトリップタイムなどを確認する事ができます。
R2#show ip sla statistics 20 Round Trip Time (RTT) for Index 20 Latest RTT: 933 milliseconds Latest operation start time: *00:16:20.607 UTC Fri Mar 1 2002 Latest operation return code: OK Latest DNS RTT: 0 ms Latest TCP Connection RTT: 120 ms <- TCPラウンドトリップタイム Latest HTTP Transaction RTT: 813 ms <- HTTPラウンドトリップタイム Number of successes: 3 <- 成功回数 Number of failures: 0 <- 失敗回数 Operation time to live: Forever R2#
4. [検証] ジッタの測定
4.1. 設定投入
R1, R2間のジッタを測定します。HTTPの測定と異なり、「どれくらい揺らぎがあるのかを相手のルータは返答しなければならない」ので、R2をresponderとして設定する必要があります。
R1(config)#ip sla 10 R1(config-ip-sla)#udp-jitter 192.168.12.2 16384 R1(config-ip-sla-jitter)#tos 160 <- 省略すると0になってしまうので、明示的に指定した方が良いです。 R1(config-ip-sla-jitter)#exit R1(config)# R1(config)# R1(config)#ip sla schedule 10 life forever start-time now R2(config)#ip sla responder
4.2. 設定確認
どの程度のジッタが生じているのかは以下の要領で確認する事ができます。
R1#show ip sla statistics 10 Round Trip Time (RTT) for Index 10 Latest RTT: 37 milliseconds Latest operation start time: *00:28:35.647 UTC Fri Mar 1 2002 Latest operation return code: OK RTT Values: Number Of RTT: 10 RTT Min/Avg/Max: 21/37/61 milliseconds Latency one-way time: Number of Latency one-way Samples: 0 Source to Destination Latency one way Min/Avg/Max: 0/0/0 milliseconds Destination to Source Latency one way Min/Avg/Max: 0/0/0 milliseconds Jitter Time: Number of Jitter Samples: 9 Source to Destination Jitter Min/Avg/Max: 3/14/28 milliseconds Destination to Source Jitter Min/Avg/Max: 3/5/12 milliseconds Packet Loss Values: Loss Source to Destination: 0 Loss Destination to Source: 0 Out Of Sequence: 0 Tail Drop: 0 Packet Late Arrival: 0 Voice Score Values: Calculated Planning Impairment Factor (ICPIF): 0 Mean Opinion Score (MOS): 0 Number of successes: 2 Number of failures: 1 Operation time to live: Forever R1#
5. [検証] SNMP trapの設定
5.1. 設定投入
IP SLAによって測定した結果が閾値を超えた場合にtrapを送信する事も可能です。以下はR2からHostOSへのhttpラウンドトリップタイムが1200msecを超えた場合にtrapを送信する設定です。
R2(config)#ip sla reaction-configuration 20 react rtt threshold-value 1200 1 R2(config)# R2(config)#snmp-server host 192.168.201.101 RO_CCIE R2(config)#snmp-server enable traps
5.2. trapの確認
Host OS上Apacheにサイズの大きいHTMLファイルを配置します。以下のコマンドを発行し、わざと回線を輻輳させます。
wget -O /dev/null http://192.168.200.100:10880/large.html
デバッグコマンドによりSNMP trapが送信された事を確認します。
R2#debug snmp packets SNMP packet debugging is on R2# R2# *Mar 1 00:49:41.031: SNMP: Queuing packet to 192.168.201.101 *Mar 1 00:49:41.035: SNMP: V1 Trap, ent ciscoConfigManMIB.2, addr 192.168.201.2, gentrap 6, spectrap 1 ccmHistoryEventEntry.3.11 = 1 ccmHistoryEventEntry.4.11 = 3 ccmHistoryEventEntry.5.11 = 2 *Mar 1 00:49:41.287: SNMP: Packet sent via UDP to 192.168.201.101 R2#
サーバ側にtrapが届いている事を確認します。
[root@localhost ~]# tail -f /var/log/messages Aug 13 09:39:04 localhost snmptrapd[2626]: 2010-08-13 09:38:54 192.168.201.2(via UDP: [192.168.201.2]:52640->[192.168.201.101]) TRAP, SNMP v1, community RO_CCIE#012#011SNMPv2-SMI::enterprises.9.9.43.2 Enterprise Specific Trap (1) Uptime: 0:45:44.66#012#011SNMPv2-SMI::enterprises.9.9.43.1.1.6.1.3.8 = INTEGER: 1#011SNMPv2-SMI::enterprises.9.9.43.1.1.6.1.4.8 = INTEGER: 2#011SNMPv2-SMI::enterprises.9.9.43.1.1.6.1.5.8 = INTEGER: 3 Aug 13 09:39:14 localhost snmptrapd[2626]: 2010-08-13 09:39:04 192.168.201.2(via UDP: [192.168.201.2]:52640->[192.168.201.101]) TRAP, SNMP v1, community RO_CCIE#012#011SNMPv2-SMI::enterprises.9.9.43.2 Enterprise Specific Trap (1) Uptime: 0:47:29.95#012#011SNMPv2-SMI::enterprises.9.9.43.1.1.6.1.3.9 = INTEGER: 1#011SNMPv2-SMI::enterprises.9.9.43.1.1.6.1.4.9 = INTEGER: 3#011SNMPv2-SMI::enterprises.9.9.43.1.1.6.1.5.9 = INTEGER: 2 Aug 13 09:40:40 localhost snmptrapd[2626]: 2010-08-13 09:40:30 192.168.201.2(via UDP: [192.168.201.2]:52640->[192.168.201.101]) TRAP, SNMP v1, community RO_CCIE#012#011SNMPv2-SMI::enterprises.9.9.43.2 Enterprise Specific Trap (1) Uptime: 0:49:20.82#012#011SNMPv2-SMI::enterprises.9.9.43.1.1.6.1.3.10 = INTEGER: 1#011SNMPv2-SMI::enterprises.9.9.43.1.1.6.1.4.10 = INTEGER: 3#011SNMPv2-SMI::enterprises.9.9.43.1.1.6.1.5.10 = INTEGER: 2 Aug 13 09:41:00 localhost snmptrapd[2626]: 2010-08-13 09:40:50 192.168.201.2(via UDP: [192.168.201.2]:52640->[192.168.201.101]) TRAP, SNMP v1, community RO_CCIE#012#011SNMPv2-SMI::enterprises.9.9.43.2 Enterprise Specific Trap (1) Uptime: 0:49:41.02#012#011SNMPv2-SMI::enterprises.9.9.43.1.1.6.1.3.11 = INTEGER: 1#011SNMPv2-SMI::enterprises.9.9.43.1.1.6.1.4.11 = INTEGER: 3#011SNMPv2-SMI::enterprises.9.9.43.1.1.6.1.5.11 = INTEGER: 2 Aug 13 09:41:37 localhost snmptrapd[2626]: 2010-08-13 09:41:27 192.168.201.2(via UDP: [192.168.201.2]:52640->[192.168.201.101]) TRAP, SNMP v1, community RO_CCIE#012#011SNMPv2-SMI::enterprises.9.9.43.2 Enterprise Specific Trap (1) Uptime: 0:50:17.16#012#011SNMPv2-SMI::enterprises.9.9.43.1.1.6.1.3.12 = INTEGER: 1#011SNMPv2-SMI::enterprises.9.9.43.1.1.6.1.4.12 = INTEGER: 3#011SNMPv2-SMI::enterprises.9.9.43.1.1.6.1.5.12 = INTEGER: 2 Aug 13 09:42:11 localhost snmptrapd[2626]: 2010-08-13 09:42:01 192.168.201.2(via UDP: [192.168.201.2]:52640->[192.168.201.101]) TRAP, SNMP v1, community RO_CCIE#012#011SNMPv2-SMI::enterprises.9.9.43.2 Enterprise Specific Trap (1) Uptime: 0:50:51.16#012#011SNMPv2-SMI::enterprises.9.9.43.1.1.6.1.3.13 = INTEGER: 1#011SNMPv2-SMI::enterprises.9.9.43.1.1.6.1.4.13 = INTEGER: 2#011SNMPv2-SMI::enterprises.9.9.43.1.1.6.1.5.13 = INTEGER: 3
添付ファイル