'IP Multi-Pathing)'에 해당되는 글 1건

  1. 2008.08.29 ref_ipmp
2008. 8. 29. 17:27

ref_ipmp

          

     
  IPMP(Internet Protocol Multi-Pathing, IP Multi-Pathing)
     



INDEX
_____________________

1. IPMP Feature
2. IPMP Overview
3. IPMP Configuration Type
4. IPMP Implementation
5. Reference



현재 썬에서는 (a)IPMP, (b)Sun Trunking Software 등을 제공함으로써 썬 고객들의 네트워
크 대역폭에 대한 요구를 충족시키고 있다. IPMP Software는 운영체제에 기본 내장 되어
있지만 Sun Trunking Software는 기본 내장되어 있지 않다.



0. IPMP의 필요성
______________________

현재 사용하고 있는 방식의 NIC 카드의 문제점은 Hub, Switch 같은 장치와 연결되는 케이
블에 이상이 있는 경우 서버의 통신은 문제가 발생되게 된다. 그리고 NIC 카드가 노후화로
인해 이상이 있다고 하더라도 문제가 발생된다.

이런 문제점을 해결하기 위해서는 같은 네트워크에 여러개의 네트워크 인터페이스(NIC)를
달고 IPMP 설정을 통해서 높은 대역폭을 제공하면서 각 NIC의 Failover 기능을 수행할 수
있도록 설정하면 문제가 해결된다.


------+-----+-----+-----+-----------------+-----------
      |     |     |     |                 |
      |     |     |     |                 |
  +--qfe0--qfe1--qfe2--qfe3--+          CLINET
  |                          |
  |          SERVER          |
  |                          |
  +--------------------------+

       [그림] IP Multipath Configuration


[Ref.] Sun Trunking Software
Sun Trunking Software는 솔라리스 운영체제에 기본 내장되어 있는 프로그램이 아니므로
라이센스 비용을 들여서 사야 한다.

Sun Trunking software is not part of the Solaris OE and must be purchased separately.
Sun Trunking software is an aggregation technology that:

* Up to eight full-duplex ports on two Sun Quad FastEthernet™ (qfe) adapters to 
  obtain 800-Mbps full-duplex performance
* Links up to two full-duplex ports on a Sun™ Gigabit Ethernet Adapter (ge) to
  obtain 2-Gbps full-duplex performance between a Sun server and a Sun Trunking
  compatible switch.


                        SERVER

                       ||||||||
                       ||||||||
                       ||||||||        Network links are aggreagted
                       ||||||||  ----> in to a fat network pipe.
                       ||||||||
                       ||||||||
                       ||||||||

                        Switch

                           |
   ------------------------+---------------------------
         |       |       |       |       |      |
       ClientA ClientB ClientC ClientD ......



1. IPMP Feature
______________________

솔라리스 9버전부터 내장되기 시작했는데 9버전이 나올당시에 출시 되었던 8버전에도 기술
이 내장되었다.


(1). IPMP Feature

■ Eliminates a single network adapter as a single point-of-failure in these cases:
   * Network adapter failure detection (failover)
   * Network adapter repair detection  (failback)

■ Provides outbound load spreading when traffic is flowing to multiple destinations.

■ Enables interfaces to failover within approximately 10 seconds when using the
   default configuration.

■ Can be configured by adjusting the parameters in the /etc/default/mpathd file.

■ Can be configured for both IPv4 and IPv6.

■ Allows interfaces to be configured as Standby Interfaces. These types of
   interfaces are only used for failover and are not used for outbound load
   spreading, unless they are explicitly chosen by an application.


(2). IPMP Requirements

■ The Solaris 8 10/00 OE, as a minimum.

■ Unique media access control (MAC) addresses must be configured on each network
   interface.

   - The default configuration for most Sun network adapters has all network
     interfaces on a specific server using the same MAC address.
   - IPMP requires that all interfaces exist on the same network. Switched
     configurations use MAC addresses when making network decisions.
   - Therefore, you must change the system’s default configuration for MAC
     addresses to avoid a MAC address conflict.

■ Multiple network adapter interfaces must be connected on each subnet.
   - You can configure IPMP with a single network interface to take advantage of
     network failure detection. To use the full benefit ofIPMP, make sure that two
     or more network interfaces are connected to the same subnet.

■ A network adapter group name must be assigned to IPMP interfaces.

   - Interfaces that are to be deployed as multipath interfaces must belong to a
     multipath group. The in.mpathd multipath process uses the multipath group.
     Use a meaningful name that does not include spaces when you choose a group
     name. The multipath name is local to the system and is not used across the
     network.

■ A test address is assigned to an interface.

   - The multipath process uses test addresses, which must be routable addresses,
     to monitor the status of each individual interface. Use the test addresses to
     detect failure and recovery of an interface. These addresses are deprecated at
     configuration time to make sure that they cannot be used to pass network
     traffic from other applications.

■ Additional hosts must exist on the same subnet.

    - The test interfaces use ICMP echo request, reply, or both to hosts that they
      reach by addressing the 224.0.0.1 multicast group or the default router, as
      listed in the /etc/defaultrouter file.


솔라리스 8 10/00(2000.10) 버전부터 이 기능이 내장 되었습니다.
■ SUNWcsr(운영체제 core 패키지)에 포함되어 있습니다.
■ 각 NIC는 유일한 MAC 주소를 가져야 한다.
■ in.mpathd 데몬의해서 동작 된다.
■ 각 NIC에 Test Address가 존재해야 한다.
■ Test NIC는 각 NIC와 224.0.0 또는 동일한 Default router 접근할수 있
  어야 한다.


(3). Interface Failure Detection and Repair

The in.mpathd process can detect both the failure and the repair of an interface by:

* Sending and receiving ICMP echo requests and responses through the interface.
* Monitoring the internal IFF_RUNNING flag on the interface.



2. IPMP Overview
_______________________

IPMP는 다음과 같은 2가지 기능을 갖습니다.
- Failover
- Failback

(1). Failover
는 하나의 시스템에 여러개의 NIC(Network Interface Card)를 사용할때 NIC 카드를
Grouping 해서 그 중 하나의 NIC가 통신 실패(Fail)하는 경우 이를 점검하고 정상적인
다른 NIC로 Failover 해 주는 기능입니다.

(2). Failback
장애(통신 실패, Fail)가 발생한 NIC를 복구한 후(Failover 기능), 관리 자의 특별한 설
정 없이 자동으로 원래 설정으로 돌려 주는 기능입니다.



3. IPMP Configuration Type
______________________________

IPMP를 설정 하는 방법은 다음과 같이 2가지가 존재합니다.
- Standby NIC 갖는 환경     (Active-Standby)
- Standby NIC 갖지 않는 환경(Active-Active)


(1). Standby NIC 갖는 IPMP 환경
서비스를 하는 NIC와 서비스를 하지 않는 NIC를 그룹으로 묶고(Grouping) 실제 서비스를
하지 않는 NIC로 서비스를 하고 있는 NIC에 대해 Failover 기능을 제공해 주기 위한 환경
입니다. 다시 말해서 서비스를 안정적으로 가지고 가기 위해서 백업 NIC를 갖는 것과 같
습니다.


(2). Standby NIC 갖지 않는 IPMP 환경
그룹으로 묶여있는 NIC들이 네트워크 서비스를 각각하고 있다가 그룹내의 NIC 하나가 통신
실패(Fail)이 발생한 경우 남아있던 정상적인 NIC로 Failover 하는 환경입니다. 다시 말해
서 서비스를 안정적으로 가지고 가기 위해서 그룹내의 모든 NIC가 활성화 상태에 있다가
하나의 NIC가 이상이 있지만 다른 NIC가 정상 서비스를 하는 것입니다.


(3). 두 가지 방법의 차이점
<Standby NIC 갖지 않는 IPMP 환경>
- 그룹내의 하나의 NIC가 이상이 있는 경우(통신 실패가 있는 경우) 다른 NIC가 다른 NIC
  들이 서로 Failover 기능을 제공한다.

<Standby NIC 갖는 IPMP 환경>
- 그룹내의 NIC 중 Standby NIC가 서비스 NIC의 Failover 기능을 제공하지만 반대로
  Standby NIC에 대한 Failover 기능은 제공되지 않는다.


[Ref.] Failover, Failback 기능을 사용하기 위해서는 Test NIC(Logical Interface) 필요
<Standby NIC 갖지 않는 IPMP 환경>
- 그룹내 모든 NIC에 Test NIC(Logical Interface) 필요
 
<Standby NIC 갖는 IPMP 환경>
- Test NIC(Interfaec)로만 설정한다.



4. IPMP Implementation
______________________________

(1). Standby NIC 갖는 IPMP 설정

    +=======HOSTA=======+
    |                   |
    |               hme0   (192.168.8.100)
    |               hme0:1 (192.168.8.101)
    |
    |               hme1   (192.168.8.200)
    |               hme1:1 (192.168.8.201)
    |                   |
    +===================+

    Grouping : hme0, hme1 (testgroup)
    Test NIC : hme0:1(For hme0), hme1:1(For hme1)



(현재 설정)
# cat /etc/release
솔라리스 8 버전 이상(Solaris 8 10/00 이상)

# eeprom local-mac-address?=true

# ifconfig hme0 down unplumb
# ifconfig hme1 down unplumb

# ifconfig hme0 plumb 192.168.8.100 group testgroup up
# ifconfig hme0 addif 192.168.8.101 deprecated -failover up
(# ifconfig hme0 addif 192.168.8.101 deprecated netmask + broadcast + -failover up)

# ifconfig hme1 plumb 192.168.8.200 group testgroup up
# ifconfig hme1 addif 192.168.8.201 deprecated -failover up
(# ifconfig hme1 addif 192.168.8.201 deprecated netmask + broadcast + -failover up)

# pgrep -lf in.mpathd

(주의) 만약 in.mpathd 데몬이 떠 있지 않은 경우 띄워 준다.
# ps -ef | grep in.mpathd
# /sbin/in.mpathd


-------------------------- Solaris 9 x86 on VMWare TEST ---------------------------
[EX] Active-Active IPMP 설정(Solaris 9 x86 on VMWare)

    +=======HOSTA=======+
    |                   |
    |               pcn0   (192.168.8.100)
    |               pcn0:1 (192.168.8.101)
    |
    |               pcn1   (192.168.8.200)
    |               pcn1:1 (192.168.8.201)
    |                   |
    +===================+

    Grouping : pcn0, pcn1 (testgroup)
    Test NIC : pcn0:1(For pcn0), pcn1:1(For pcn1)


0. 전제 조건
- NIC 2장 모두 NAT Device에 연결한다.


1. 작업 순서
- NIC1 -> (Bridge -> NAT)
- IPMP 설정
 pcn0   (192.168.10.100)
 pcn0:1 (192.168.10.101)
 pcn1   (192.168.10.200)
 pcn1:1 (192.168.10.201)
- TEST

(a) NIC1 (Bridge -> NAT)

(b). IPMP Configuration
# cat /etc/release
                         Solaris 9 9/05 s9x_u8wos_05 x86
           Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                            Assembled 01 August 2005

# ifconfig pcn0 down unplumb
# ifconfig pcn1 down unplumb

# ifconfig pcn0 plumb 192.168.10.100 group testgroup up
# ifconfig pcn0 addif 192.168.10.101 deprecated -failover up

# ifconfig pcn1 plumb 192.168.10.200 group testgroup up
# ifconfig pcn1 addif 192.168.10.201 deprecated -failover up

# pgrep -lf in.mpathd


(c). TEST

(At Clinet)
# ping -s 192.168.10.100
-> 메세지 확인

(At Server)
# if_mpadm -d pcn0
-> Clinet 확인
# ifconfig -a
-> pcn0 설정 값 확인

# if_mpadm -r pcn0
-> Client 확인
# ifconfig -a
-> pcn0 설정 값 확인

(At Client)
# ping -s 192.168.10.200

(At Server)
# if_mpadm -d pcn1
-> Client 확인
# ifconfig -a
-> pcn1 설정 값 확인

# ip_mpadm -r pcn0
-> Client 확인
# ifconfig -a
-> pcn0 설정 값 확인

------------------------------------------------------------------------------------




(부팅시 설정)
# cat /etc/release
# eeprom local-mac-address?=true

# cat /etc/hosts
.....
192.168.8.100      solaris100        # Data address for hme0
192.168.8.101      solaris100-hme0   # hme0:1 Test address for hme0
192.168.8.200      solaris200        # Data address for hme1
192.168.8.201      solaris200-hme1   # hme1:1 Test address for hme1


# cat /etc/hostname.hme0
192.168.8.100 broadcast + netmask + group testgroup up \
addif 192.168.8.101 deprecated netmask + broadcast + -failover up

# cat /etc/hostname.hme1
192.168.8.200 broadcast + netmask + up group testgroup \
addif 192.168.8.201 deprecated netmask + broadcast + -failover up


* 192.168.8.XXX or solarisXXX    Assigns the address associated with the solarisXXX
                                 name.

* netmask +                      Looks up the mask in the netmasks database.

* broadcast +                    Results in a default broadcast address appropriate
                                 for the address and netmask.

* group testgroup                Assigns testgroup as the name for a IPMP group.

* up                             Marks the interface as “up,” and initializes the
                                 hardware.

* addif 192.168.8.XXX            Creates the next unused logical interface, and
                                 assigns it the IP address associated with the
                                 solarisXXX-hmeX name.

* deprecated                     Marks the address as a deprecated address.
                                 Addresses that are marked as deprecated are not
                                 used as source addresses for outbound packets
                                 unless either there are no other addresses
                                 available on this interface or the application is
                                 bound to this address explicitly. The output from
                                 the ifconfig -a command shows DEPRECATED as
                                 one of the flags associated with this interface.

* -failover                      Marks the address as a non-failover address.
                                 Addresses that are marked in this way do not fail
                                 over when the interface fails. The output from the
                                 ifconfig -a command shows NOFAILOVER as
                                 one of the flags associated with this interface.


(2). Test (Failover, Failback)


    ======= HOSTA =======      |      ======= HOSTB =======
         Active    hme0 -------|------hme0  # ping -s HOSTA       
                   hme0:1      |
         Active    hme1 -------|
                   hme1:1      |
    =====================      |      =====================

(a). HOSTB에서 HOSTA로 ping 명령어에 -s 옵션을 사용하여 hme0(192.168.8.100)
     으로 연속적인 ICMP echo reply 신호를 받는다.
(b). HOSTA에서 hme0의 NIC의 LAN 선을 뽑는다.
(c). HOSTB에서 계속된 ping 시도가 되고 있는지 확인한다.
     (잠시 끊김현상이 발생하기는 하지만 바로 복구되는 것을 확인한다.)
(d). HOSTA에서 ifconfig 명령어를 사용하여 hme0에 대한 IP 설정값을 확인한다.
     (0.0.0.0 으로 설정된것을 확인할수 있다.)
(e). 잠시후에 HOSTA에서 ifconfig 명령어를 사용하여 hme0에 대한 IP 설정값을
     확인한다.(Failback 기능으로 인해 IP가 원래대로 설정이 돌아 온것을 확인
     한다.)
   


(3). Standby NIC를 갖는 IPMP 설정

(현재 설정)
부팅시의 설정 사항을 보면 알수 있을 것이다.

(부팅시 설정)
* /etc/hostname.hme0
192.168.8.100 netmask + broadcast + group testgroup deprecated -failover up

* /etc/hostname.hme1
192.168.8.200 netmask + broadcast + group testgroup up \
addif 192.168.8.201 deprecated netmask + broadcast + standby up


(4). Test(Failover, Failback)
테스트도 "4.(2)" 테스트와 비슷하게 수행한다.



5. /etc/default/mpathd & in.mpathd
____________________________________


The starting of the in.mpathd daemon is controlled by the
TRACK_INTERFACES_ONLY_WITH_GROUPS parameter in the
/etc/default/mpathd file.

If the TRACK_INTERFACES_ONLY_WITH_GROUPS variable is set to yes, the
ifconfig utility’s group option starts the in.mpathd process
automatically. That is, as soon as you use the ifconfig utility with the
group option in the command, the in.mpathd process starts. If the
TRACK_INTERFACES_ONLY_WITH_GROUPS variable is set to no, the
/etc/rcS.d/S30network.sh run control script starts the in.mpathd
process at boot time.

# cat /etc/default/mpathd
#
#pragma ident   "@(#)mpathd.dfl 1.2     00/07/17 SMI"
#
# Time taken by mpathd to detect a NIC failure in ms. The minimum time
# that can be specified is 100 ms.
#
FAILURE_DETECTION_TIME=10000
#
# Failback is enabled by default. To disable failback turn off this option
#
FAILBACK=yes
#
# By default only interfaces configured as part of multipathing groups
# are tracked. Turn off this option to track all network interfaces
# on the system
#
TRACK_INTERFACES_ONLY_WITH_GROUPS=yes



6. TEST 하기 위한 명령어
_________________________

To verify the system’s failover configuration, or to change the operational
status of IPMP interfaces, use the if_mpadm utility. You can use this utility
to take an interface offline (detach), by forcing a failover, and verifying
that an alternate interface takes over as expected. If configuration errors
occur, they appear at this stage. Also, use the if_mpadm utility to reattach
a detached interface.

# if_mpadm -d hme0  (Detach an online interface)
# if_mpadm -r hme0  (Reattach an offline interface)

[Ref.] 메세지 모니터링을 위해서 console window를 띄어 놓고 테스트 하면 좋다.
# dtterm -C &



7. Reference
________________

Sun Book : Network Administration for the Solaris 9 Operating Environment
           (SA-399) "Modules 6" Reference