• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
Xin chào ! Nếu đây là lần đầu tiên bạn đến với diễn đàn, xin vui lòng danh ra một phút bấm vào đây để đăng kí và tham gia thảo luận cùng VnPro.

Announcement

Collapse
No announcement yet.

Tính năng sla

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 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

  • #2
    tính năng mới nhung ma nhìn khó hiểu quá
    cong bo my pham, cong bo tieu chuan chat luong, giay phep website dịch vụ xin giấy phép của công ty Oceanlaw

    Comment


    • #3
      diễn tả tính năng này một cách đơn giản như sau. Một router muốn biết router ở đầu xa - bên kia của đường truyền còn sống hay chết. Định kỳ mỗi 5 giây, router sẽ gửi ra một gói tin ping. Nếu đường truyền tốt và nếu router đầu ở xa còn up, router của mình sẽ nhận được gói tin trả lời. Nếu router đầu xa đang bị down hoặc đường truyền bị down, router của mình sẽ không nhận được gói tin trả lời.

      bước kiểm tra này cứ lặp lại hoài, chừng nào router của mình còn hoạt động.

      Đặng Quang Minh, CCIEx2#11897 (Enterprise Infrastructure, Wireless), DEVNET, CCSI#31417

      Email : dangquangminh@vnpro.org
      https://www.facebook.com/groups/vietprofessional/

      Comment

      • Working...
        X