Results 1 to 1 of 1

Thread: Tính năng sla

  1. #1
    Join Date
    Jul 2008
    Location
    TP.HCM
    Posts
    2,537
    Blog Entries
    1

    Default Tính năng sla

    TÍNH NĂNG SLA

    Yêu cầu:
    Dùng tính năng SLA để kiểm tra sự tồn tại của thiết bị đầu xa dùng gói tin ICMP

    Sơ đồ:



    Các bước thực hiện
    Cấu hình ban đầu:

    R1:
    R1#sh run
    Building configuration...

    Current configuration : 896 bytes
    !
    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
    dot11 syslog
    !
    !
    ip cef
    !
    !
    ip auth-proxy max-nodata-conns 3
    ip admission max-nodata-conns 3
    !
    multilink bundle-name authenticated
    !
    !
    voice-card 0
    no dspfarm
    !
    archive
    log config
    hidekeys
    !
    interface FastEthernet0/0
    ip address 10.10.10.1 255.255.255.0
    duplex auto
    speed auto
    !
    interface FastEthernet0/1
    no ip address
    shutdown
    duplex auto
    speed auto
    !
    interface Serial0/1/0
    no ip address
    shutdown
    !
    ip forward-protocol nd
    !
    !
    no ip http server
    no ip http secure-server
    !
    control-plane
    !
    line con 0
    exec-timeout 0 0
    logging synchronous
    line aux 0
    line vty 0 4
    login
    !
    scheduler allocate 20000 1000
    !
    end

    R2:
    R2#sh run
    Building configuration...

    Current configuration : 884 bytes
    !
    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 15
    !
    !
    ip cef
    !
    !
    !
    multilink bundle-name authenticated
    !
    !
    voice-card 0
    no dspfarm
    !
    interface FastEthernet0/0
    ip address 10.10.10.2 255.255.255.0
    duplex auto
    speed auto
    !
    interface FastEthernet0/1
    no ip address
    shutdown
    duplex auto
    speed auto
    !
    interface Serial0/1/0
    no ip address
    shutdown
    no fair-queue
    clock rate 2000000
    !
    interface Serial0/3/0
    no ip address
    shutdown
    clock rate 2000000
    !
    ip http server
    no ip http secure-server
    !
    control-plane
    !
    line con 0
    exec-timeout 0 0
    logging synchronous
    line aux 0
    line vty 0 4
    login
    !
    scheduler allocate 20000 1000
    !
    End

    Các bước thực hiện

    Vì các thiết bị đấu qua switch nên khi R2 bị đứt kết nối thì R1 không có khả năng biết được, trong trường hợp này sẽ dùng cơ chế SLA trên R1 và SLA responder trên R2 để bắt tay trong cơ chế SLA. Tính năng SLA responder dùng để đáp ứng các cơ chế yêu cầu của chủ thể thực hiện SLA giúp cho việc xác định thông tin liên quan chính xác và rõ ràng hơn

    Bước 1: kiểm tra thông giữa R1 và R2
    R1#ping 10.10.10.2

    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 10.10.10.2, timeout is 2 seconds:
    .!!!!
    Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/4 ms

    Bước 2: Cấu hình tính năng responder trên R2

    R2#conf t
    Enter configuration commands, one per line. End with CNTL/Z.
    R2(config)#ip sla responder
    R2(config)#

    Bước 3: cấu hình SLA trên R1 dùng gói tin ICMP echo định thời gửi qua R2 kiểm tra sự tồn tại của R2
    R1(config)#ip sla 1
    R1(config-ip-sla)#
    R1(config-ip-sla)#icmp-echo 10.10.10.2 source-interface f0/0
    R1(config-ip-sla-echo)#timeout 20 <-- thời gian chờ gói tin đáp ứng tối đa (s)
    R1(config-ip-sla-echo)#frequency 1 <-- 1 giây gửi 1 lần
    R1(config-ip-sla-echo)#request-data-size 100 <-- độ lớn gói gửi là 100 bytes
    R1(config-ip-sla-echo)#
    R1(config-ip-sla-echo)#exit
    R1(config)#
    R1(config)#ip sla schedule 1 life forever start-time now <-- định thời cho cơ chế này chạy bắt đầu ngay tức thời và chạy không có giờ kết thúc

    Kiểm tra
    Debug trên R2 để xem kết quả:

    R2(config)#access-list 100 permit icmp host 10.10.10.1 host 10.10.10.2
    R2(config)#end
    R2#debug ip packet 100

    Quan sát kết quả:

    Sep 24 03:26:08.055: IP: tableid=0, s=10.10.10.1 (FastEthernet0/0), d=10.10.10.2 (FastEthernet0/0), routed via RIB
    *Sep 24 03:26:08.055: IP: s=10.10.10.1 (FastEthernet0/0), d=10.10.10.2 (FastEthernet0/0), len 136, rcvd 3
    R2#
    *Sep 24 03:26:09.055: IP: tableid=0, s=10.10.10.1 (FastEthernet0/0), d=10.10.10.2 (FastEthernet0/0), routed via RIB
    *Sep 24 03:26:09.055: IP: s=10.10.10.1 (FastEthernet0/0), d=10.10.10.2 (FastEthernet0/0), len 136, rcvd 3
    R2#
    *Sep 24 03:26:10.055: IP: tableid=0, s=10.10.10.1 (FastEthernet0/0), d=10.10.10.2 (FastEthernet0/0), routed via RIB
    *Sep 24 03:26:10.055: IP: s=10.10.10.1 (FastEthernet0/0), d=10.10.10.2 (FastEthernet0/0), len 136, rcvd 3
    R2#
    *Sep 24 03:26:11.055: IP: tableid=0, s=10.10.10.1 (FastEthernet0/0), d=10.10.10.2 (FastEthernet0/0), routed via RIB
    *Sep 24 03:26:11.055: IP: s=10.10.10.1 (FastEthernet0/0), d=10.10.10.2 (FastEthernet0/0), len 136, rcvd 3
    R2#
    *Sep 24 03:26:12.055: IP: tableid=0, s=10.10.10.1 (FastEthernet0/0), d=10.10.10.2 (FastEthernet0/0), routed via RIB
    *Sep 24 03:26:12.055: IP: s=10.10.10.1 (FastEthernet0/0), d=10.10.10.2 (FastEthernet0/0), len 136, rcvd 3
    R2#
    *Sep 24 03:26:13.055: IP: tableid=0, s=10.10.10.1 (FastEthernet0/0), d=10.10.10.2 (FastEthernet0/0), routed via RIB
    *Sep 24 03:26:13.055: IP: s=10.10.10.1 (FastEthernet0/0), d=10.10.10.2 (FastEthernet0/0), len 136, rcvd 3
    R2#u
    *Sep 24 03:26:14.055: IP: tableid=0, s=10.10.10.1 (FastEthernet0/0), d=10.10.10.2 (FastEthernet0/0), routed via RIB
    *Sep 24 03:26:14.055: IP: s=10.10.10.1 (FastEthernet0/0), d=10.10.10.2 (FastEthernet0/0), len 136, rcvd 3

    R2#u all
    All possible debugging has been turned off
    R1#sh ip sla statistics

    Round Trip Time (RTT) for Index 1
    Latest RTT: 1 milliseconds
    Latest operation start time: *10:22:18.691 UTC Thu Sep 24 2009
    Latest operation return code: OK
    Number of successes: 282
    Number of failures: 0
    Operation time to live: Forever


    Bước 4: ngắt kết nối trên R2 đến switch, R1 bình thường sẽ không xác định được R2 không còn kết nối trừ phi người sử dụng chủ động kiểm tra. Tuy nhiên với cơ chế SLA thì R1 sẽ tự động biết được.

    R2#conf t
    Enter configuration commands, one per line. End with CNTL/Z.
    R2(config)#int f0/0
    R2(config-if)#sh
    R2(config-if)#
    *Sep 24 03:46:57.691: %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to administratively down
    *Sep 24 03:46:58.691: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to down
    R2(config-if)#

    Kiểm tra trên R1:
    R1#sh ip sla statistics

    Round Trip Time (RTT) for Index 1
    Latest RTT: NoConnection/Busy/Timeout
    Latest operation start time: *10:39:34.691 UTC Thu Sep 24 2009
    Latest operation return code: Timeout
    Number of successes: 1285
    Number of failures: 33
    Operation time to live: Forever


    R1#sh ip sla statistics

    Round Trip Time (RTT) for Index 1
    Latest RTT: NoConnection/Busy/Timeout
    Latest operation start time: *10:39:56.691 UTC Thu Sep 24 2009
    Latest operation return code: Timeout
    Number of successes: 1285
    Number of failures: 55
    Operation time to live: Forever


    Như vậy, trạng thái đứt kết nối của R2 đã được R1 xác định.

    Cấu hình cuối cùng của hệ thống:

    R1#sh run
    Building configuration...

    Current configuration : 1054 bytes
    !
    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
    dot11 syslog
    !
    !
    ip cef
    !
    !
    ip auth-proxy max-nodata-conns 3
    ip admission max-nodata-conns 3
    !
    multilink bundle-name authenticated
    !
    !
    voice-card 0
    no dspfarm
    !
    archive
    log config
    hidekeys
    !
    !
    interface FastEthernet0/0
    ip address 10.10.10.1 255.255.255.0
    duplex auto
    speed auto
    !
    interface FastEthernet0/1
    no ip address
    shutdown
    duplex auto
    speed auto
    !
    interface Serial0/1/0
    no ip address
    shutdown
    !
    ip forward-protocol nd
    !
    !
    no ip http server
    no ip http secure-server
    !
    ip sla 1
    icmp-echo 10.10.10.2 source-interface FastEthernet0/0
    request-data-size 100
    timeout 20
    frequency 1
    ip sla schedule 1 life forever start-time now
    !
    control-plane
    !
    !
    line con 0
    exec-timeout 0 0
    logging synchronous
    line aux 0
    line vty 0 4
    login
    !
    scheduler allocate 20000 1000
    !
    end

    R1#

    R2#sh run
    Building configuration...

    Current configuration : 946 bytes
    !
    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 15
    !
    !
    ip cef
    !
    !
    !
    multilink bundle-name authenticated
    !
    !
    voice-card 0
    no dspfarm
    !
    !
    !
    interface FastEthernet0/0
    ip address 10.10.10.2 255.255.255.0
    duplex auto
    speed auto
    !
    interface FastEthernet0/1
    no ip address
    shutdown
    duplex auto
    speed auto
    !
    interface Serial0/1/0
    no ip address
    shutdown
    clock rate 2000000
    !
    interface Serial0/3/0
    no ip address
    shutdown
    clock rate 2000000
    !
    ip http server
    no ip http secure-server
    !
    ip sla responder
    access-list 100 permit icmp host 10.10.10.1 host 10.10.10.2
    !
    control-plane
    !
    line con 0
    exec-timeout 0 0
    logging synchronous
    line aux 0
    line vty 0 4
    login
    !
    scheduler allocate 20000 1000
    !
    end
    Last edited by phamminhtuan; 11-07-2011 at 07:54 PM.
    Phạm Minh Tuấn

    Email : phamminhtuan@vnpro.org
    Yahoo : phamminhtuan_vnpro
    -----------------------------------------------------------------------------------------------
    Trung Tâm Tin Học VnPro
    149/1D Ung Văn Khiêm P25 Q.Bình thạnh TPHCM
    Tel : (08) 35124257 (5 lines)
    Fax: (08) 35124314

    Home page: http://www.vnpro.vn
    Support Forum: http://www.vnpro.org
    - Chuyên đào tạo quản trị mạng và hạ tầng Internet
    - Phát hành sách chuyên môn
    - Tư vấn và tuyển dụng nhân sự IT
    - Tư vấn thiết kế và hỗ trợ kỹ thuật hệ thống mạng

    Network channel: http://www.dancisco.com
    Blog: http://www.vnpro.org/blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
 
   TRUNG TÂM TIN HỌC VNPRO
149/1D Ung Văn Khiêm, P. 25, Q.Bình Thạnh
Phone:(08) 35124257
Fax: (08) 35124314
Email: vnpro@vnpro.org
Powered by vBulletin Version 4.2.1
Copyright 2000 - 2011, Jelsoft Enterprises Ltd.
License owned by : VietProfessional Co.,Ltd
 

Ve may bay |Ve may bay gia re |Ve may bay di Ha Noi |Ve may bay di Nha Trang |Ve may bay di Da Nang |Ve may bay di Da Lat |Ve may bay di Vinh |Ve may bay di Hue |Ve may bay di Con Dao |Ve may bay di TP HCM |Air Asia |Tiger Airways |Vietnam Airlines |Lion Air |Aeroflot |Jetstar |Vietjet Air |Asiana |Delta Airlines |Singapore Airlines |Thai Airways |quantas |Turkish Airlines |China Southern Airlines |Air China |Ve may bay gia re |Ve may bay di Anh |Ve may bay di Canada |Ve may bay di Ha Lan |Ve may bay di Han Quoc |Ve may bay di Hong Kong |Ve may bay di Y |Ve may bay di Italia |Ve may bay di Malaysia |Ve may bay di Nga |Ve may bay di Phap |Ve may bay di Philippines |Ve may bay di Singapore |Ve may bay di Thai Lan |Ve may bay di Trung Quoc |Ve may bay di Uc |Ve may bay di Ukraina |Ve may bay di Duc |Ve may bay di My |Ve may bay di My