Cisco IOS マルチキャスト Multicast LoadBalaceの設定方法

スポンサーリンク

マルチキャストルーティングそのものは負荷分散をサポートしていません。マルチキャストを負荷分散させるたいならば、負荷分散された状態のGRE tunnel内をマルチキャストパケットを通す事で負荷分散を実現します。

h2>コマンド一覧

このシナリオで重要なコマンド一覧は以下の通りです。

Router(config)# interface <interface>
Router(config-if)# ip load-sharing {[ per-destination | per-packet ]}

構成図

以下構成にて動作確認を行います。

                              e0/1      e0/0
                              .2+--------+.2
                    e0/1  ┌----+   R2   +----┐  e0/0
            +--------+.4  │    +--------+    │  .1+--------+
        ----+   R4   +----┤  e0/1      e0/0  ├----+   R1   +----
            +--------+    │  .3+--------+.3  │    +--------+
                          └----+   R3   +----┘
                                +--------+
192.168.4.0/24     192.168.234.0/24     192.168.123.0/24    192.168.1.0/24

       R4 Loopback0      R3 Loopback0     R2 Loopback0     R1 Loopback0
       10.4.4.4/32       10.3.3.3/32      10.2.2.2/32      10.1.1.1/32
 [R1]
router ospf 1
 network 10.1.1.1 0.0.0.0 area 0
 network 192.168.1.1 0.0.0.0 area 0
 network 192.168.123.1 0.0.0.0 area 0

 [R2]
router ospf 1
 network 10.2.2.2 0.0.0.0 area 0
 network 192.168.123.2 0.0.0.0 area 0
 network 192.168.234.2 0.0.0.0 area 0

 [R3]
router ospf 1
 network 10.3.3.3 0.0.0.0 area 0
 network 192.168.123.3 0.0.0.0 area 0
 network 192.168.234.3 0.0.0.0 area 0

 [R4]
router ospf 1
 network 10.4.4.4 0.0.0.0 area 0
 network 192.168.4.4 0.0.0.0 area 0
 network 192.168.234.4 0.0.0.0 area 0

設定全文は下記ファイルです。詳細設定は下記を参照ください。

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
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 10.1.1.1 255.255.255.255
!
interface Ethernet0/0
 ip address 192.168.123.1 255.255.255.0
 half-duplex
!
interface Ethernet0/1
 no ip address
 shutdown
 half-duplex
!
interface Ethernet0/2
 ip address 192.168.1.1 255.255.255.0
 half-duplex
 no keepalive
!
interface Ethernet0/3
 no ip address
 shutdown
 half-duplex
!
!
router ospf 1
 log-adjacency-changes
 network 10.1.1.1 0.0.0.0 area 0
 network 192.168.1.1 0.0.0.0 area 0
 network 192.168.123.1 0.0.0.0 area 0
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
line aux 0
line vty 0 4
 login
!
!
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
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 10.2.2.2 255.255.255.255
!
interface Ethernet0/0
 ip address 192.168.123.2 255.255.255.0
 half-duplex
!
interface Ethernet0/1
 ip address 192.168.234.2 255.255.255.0
 half-duplex
!
interface Ethernet0/2
 no ip address
 shutdown
 half-duplex
!
interface Ethernet0/3
 no ip address
 shutdown
 half-duplex
!
!
router ospf 1
 log-adjacency-changes
 network 10.2.2.2 0.0.0.0 area 0
 network 192.168.123.2 0.0.0.0 area 0
 network 192.168.234.2 0.0.0.0 area 0
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
line aux 0
line vty 0 4
 login
!
!
end
R3
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 10.3.3.3 255.255.255.255
!
interface Ethernet0/0
 ip address 192.168.123.3 255.255.255.0
 half-duplex
!
interface Ethernet0/1
 ip address 192.168.234.3 255.255.255.0
 half-duplex
!
interface Ethernet0/2
 no ip address
 shutdown
 half-duplex
!
interface Ethernet0/3
 no ip address
 shutdown
 half-duplex
!
!
router ospf 1
 log-adjacency-changes
 network 10.3.3.3 0.0.0.0 area 0
 network 192.168.123.3 0.0.0.0 area 0
 network 192.168.234.3 0.0.0.0 area 0
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
line aux 0
line vty 0 4
 login
!
!
end
R4
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R4
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 10.4.4.4 255.255.255.255
!
interface Ethernet0/0
 no ip address
 shutdown
 half-duplex
!
interface Ethernet0/1
 ip address 192.168.234.4 255.255.255.0
 half-duplex
!
interface Ethernet0/2
 ip address 192.168.4.4 255.255.255.0
 half-duplex
 no keepalive
!
interface Ethernet0/3
 no ip address
 shutdown
 half-duplex
!
!
router ospf 1
 log-adjacency-changes
 network 10.4.4.4 0.0.0.0 area 0
 network 192.168.4.4 0.0.0.0 area 0
 network 192.168.234.4 0.0.0.0 area 0
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
line aux 0
line vty 0 4
 login
!
!
end

仕様説明

cef load balance algorithm

cefによる負荷分散の方法は以下のコマンドで変更する事ができます。

Router(config)# interface <interface>
Router(config-if)# ip load-sharing {[ per-destination | per-packet ]}

cefの負荷分散は以下のshowコマンド(隠しコマンド)で確認する事ができます。デフォルト設定は以下の通りです。tunnel経由のパケットを負荷分散させるにはper-packetに変更する必要があります。

Router#show ip cef 10.4.4.4 internal
10.4.4.4/32, version 31, epoch 0, per-destination sharing
0 packets, 0 bytes
  via 192.168.123.3, Ethernet0/0, 0 dependencies
    traffic share 1
    next hop 192.168.123.3, Ethernet0/0
    valid adjacency
  via 192.168.123.2, Ethernet0/0, 0 dependencies
    traffic share 1
    next hop 192.168.123.2, Ethernet0/0
    valid adjacency

  0 packets, 0 bytes switched through the prefix
  tmstats: external 0 packets, 0 bytes
           internal 0 packets, 0 bytes
  Load distribution: 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 (refcount 1)

  Hash  OK  Interface                 Address         Packets
  1     Y   Ethernet0/0               192.168.123.3         0
  2     Y   Ethernet0/0               192.168.123.2         0
  3     Y   Ethernet0/0               192.168.123.3         0
  4     Y   Ethernet0/0               192.168.123.2         0
  5     Y   Ethernet0/0               192.168.123.3         0
  6     Y   Ethernet0/0               192.168.123.2         0
  7     Y   Ethernet0/0               192.168.123.3         0
  8     Y   Ethernet0/0               192.168.123.2         0
  9     Y   Ethernet0/0               192.168.123.3         0
  10    Y   Ethernet0/0               192.168.123.2         0
  11    Y   Ethernet0/0               192.168.123.3         0
  12    Y   Ethernet0/0               192.168.123.2         0
  13    Y   Ethernet0/0               192.168.123.3         0
  14    Y   Ethernet0/0               192.168.123.2         0
  15    Y   Ethernet0/0               192.168.123.3         0
  16    Y   Ethernet0/0               192.168.123.2         0
  refcount 6
R1#

Multicast 基本設定

設定投入

R1 e0/2(192.168.1.1)からR4 e0/2(192.168.4.4)へのmulticastが疎通可能になるようにします。設定を簡単にするために、全物理interfaceをdense modeとして設定します。

 [R1]
ip multicast-routing
!
interface Ethernet0/0
 ip pim dense-mode
interface Ethernet0/2
 ip pim dense-mode

 [R2, R3]
ip multicast-routing
!
interface Ethernet0/0
 ip pim dense-mode
interface Ethernet0/1
 ip pim dense-mode

 [R4]
ip multicast-routing
!
interface Ethernet0/1
 ip pim dense-mode
interface Ethernet0/2
 ip pim dense-mode
 ip igmp join-group 239.4.4.4

動作確認

R1 e0/2(192.168.1.1)からR4 e0/2(192.168.4.4)へpingを送信します。最初の1発目だけ2度のecho replyを受信し、2発目以降は1度のecho replyを受信しています。

 [R1]
R1#ping 239.4.4.4 repeat 10 source 192.168.1.1

Type escape sequence to abort.
Sending 10, 100-byte ICMP Echos to 239.4.4.4, timeout is 2 seconds:
Packet sent with a source address of 192.168.1.1

Reply to request 0 from 192.168.234.4, 84 ms
Reply to request 0 from 192.168.234.4, 84 ms
Reply to request 1 from 192.168.234.4, 68 ms
Reply to request 2 from 192.168.234.4, 100 ms
Reply to request 3 from 192.168.234.4, 104 ms
Reply to request 4 from 192.168.234.4, 36 ms
Reply to request 5 from 192.168.234.4, 80 ms
Reply to request 6 from 192.168.234.4, 60 ms
Reply to request 7 from 192.168.234.4, 36 ms
Reply to request 8 from 192.168.234.4, 116 ms
Reply to request 9 from 192.168.234.4, 32 ms
R1#

PIM Assertにより重複したパケットがPruneされ、パケットはロードバランスではなくR3経由で転送されている事を確認します。

 [R2]
R2#show ip mroute 192.168.1.1 239.4.4.4

 <omitted>

(192.168.1.1, 239.4.4.4), 00:00:15/00:02:46, flags: PT
  Incoming interface: Ethernet0/0, RPF nbr 192.168.123.1
  Outgoing interface list:
    Ethernet0/1, Prune/Dense, 00:00:15/00:02:44

R2#

 [R3]
R3#show ip mroute 192.168.1.1 239.4.4.4

 <omitted>

(192.168.1.1, 239.4.4.4), 00:00:25/00:02:50, flags: T
  Incoming interface: Ethernet0/0, RPF nbr 192.168.123.1
  Outgoing interface list:
    Ethernet0/1, Forward/Dense, 00:00:25/00:00:00, A

R3#

tunnel

設定投入

ロードバランスの前提作業として、IGPによる負荷分散とtunnelの作成があります。初期設定の時点でIGPによる負荷分散がなされております。残りの前提作業であるtunnelの作成を行います。

 [R1]
interface Tunnel14
 ip address 172.16.14.1 255.255.255.0
 ip pim dense-mode
 tunnel source Loopback0
 tunnel destination 10.4.4.4

 [R4]
ip mroute 192.168.1.1 255.255.255.255 172.16.14.1
!
interface Tunnel14
 ip address 172.16.14.4 255.255.255.0
 ip pim dense-mode
 tunnel source Loopback0
 tunnel destination 10.1.1.1

設定投入

tunnel経由で疎通可能な事を確認します。

R1#ping 239.4.4.4 repeat 10 source 192.168.1.1

Type escape sequence to abort.
Sending 10, 100-byte ICMP Echos to 239.4.4.4, timeout is 2 seconds:
Packet sent with a source address of 192.168.1.1

Reply to request 0 from 172.16.14.4, 112 ms
Reply to request 1 from 172.16.14.4, 108 ms
Reply to request 2 from 172.16.14.4, 108 ms

 <omitted>

cef load balance algorithm

設定投入

tunnelを作成しただけではload balanceされません。なぜならば、CEFのデフォルト設定は宛先のIPアドレスによってロードバランスされるため、gre tunnelの通る経路はロードバランスではなく、常に同じ経路を通ります。

cefによるload balancing algorithmをper-packetに変更する事ではじめてロードバランスされるようになります。

 [R1]
interface Ethernet0/0
 ip load-sharing per-packet

 [R4]
interface Ethernet0/1
 ip load-sharing per-packet

動作確認

cefによるload balancing algorithmが変わった事を確認します。

 [R1]
R1#show ip cef 10.4.4.4 internal
10.4.4.4/32, version 31, epoch 0, per-packet sharing
0 packets, 0 bytes
  via 192.168.123.3, Ethernet0/0, 0 dependencies
    traffic share 1, current path
    next hop 192.168.123.3, Ethernet0/0
    valid adjacency
  via 192.168.123.2, Ethernet0/0, 0 dependencies
    traffic share 1
    next hop 192.168.123.2, Ethernet0/0
    valid adjacency

  0 packets, 0 bytes switched through the prefix
  tmstats: external 0 packets, 0 bytes
           internal 0 packets, 0 bytes
  Load distribution: 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 (refcount 1)

  Hash  OK  Interface                 Address         Packets
  1     Y   Ethernet0/0               192.168.123.3         0
  2     Y   Ethernet0/0               192.168.123.2         0

 <omitted>

タイトルとURLをコピーしました