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

Nén tcp header

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

  • Nén tcp header

    NÉN TCP HEADER

    Tóm tắt chức năng
    Chức năng nén tcp header có khả năng làm giảm kích cỡ các header TCP xuống nhằm làm giảm kích cỡ của gói TCP, cải thiện thời gian chuyển thông tin chuỗi bit của gói tin xuống môi trường truyền dẫn. Chức năng này phải thực hiện theo link, theo từng vùng liên kết (hop by hop). Chỉ nên dùng tính năng này trên những đường truyền có tốc độ truyền thấp (nhỏ hơn 768 kbps); khi dùng lưu ý do việc nén có liên quan đến thao tác nén và giải nén nên sẽ làm tăng thời gian xử lý trên thiết bị định tuyến. Ngữ cảnh nén (context) chứa đầy đủ thông tin của header bị nén và được cập nhật định kỳ giữa 2 bên.

    Sơ đồ

    Yêu cầu
    Cấu hình nén TCP header trên đường liên kết serial giữa R1 và R2. Đảm bảo số phiên đồng thời cho phép nén là 16.

    Cấu hình ban đầu của hệ thống:
    R1#sh run
    Building configuration...

    Current configuration : 1090 bytes
    !
    version 12.4
    service timestamps debug datetime msec
    service timestamps log datetime msec
    no service password-encryption
    !
    hostname R1
    !
    !
    ip cef
    !
    no ip domain lookup
    !
    interface FastEthernet0/0
    ip address 155.1.1.1 255.255.255.0
    duplex auto
    speed auto
    !
    interface Serial0/3/1
    ip address 155.1.12.1 255.255.255.0
    clock rate 2000000
    !
    ip forward-protocol nd
    ip route 0.0.0.0 0.0.0.0 Serial0/3/1
    !
    ip http server
    no ip http secure-server
    !
    control-plane
    !
    line con 0
    logging synchronous
    line aux 0
    line vty 0 4
    login
    !
    scheduler allocate 20000 1000
    !
    end


    R2#sh run
    Building configuration...

    Current configuration : 991 bytes
    !
    version 12.4
    service timestamps debug datetime msec
    service timestamps log datetime msec
    no service password-encryption
    !
    hostname R2
    !
    !
    ip cef
    !
    !
    interface FastEthernet0/0
    ip address 155.1.2.1 255.255.255.0
    duplex auto
    speed auto
    !
    interface FastEthernet0/1
    no ip address
    shutdown
    duplex auto
    speed auto
    !
    interface Serial0/3/1
    ip address 155.1.12.2 255.255.255.0
    !
    ip route 155.1.1.0 255.255.255.0 Serial0/3/1
    !
    ip http server
    no ip http secure-server
    !
    control-plane
    !
    line con 0
    line aux 0
    line vty 0 4
    privilege level 15
    no login
    !
    scheduler allocate 20000 1000
    !
    end

    R2#

    Các bước thực hiện
    Bước 1: Cấu hình TCP header compression trên cổng serial s0/3/1
    R1(config)#int s0/3/1
    R1(config-if)#ip tcp header-compression
    !Bật tính năng nén tcp header
    R1(config-if)#ip tcp compression-connections 16
    !Chọn số lượng kết nối cho phép là 16 phiên, khi đạt đến giá trị !này, các lưu lượng mới sẽ không bị nén

    Bước 2: Tương tự cấu hình cho R2
    R2(config)#int s0/3/1
    R2(config-if)#ip tcp header-compression
    R2(config-if)#ip tcp compression-connections 16
    R2(config-if)#end
    Kiểm tra cấu hình
    Khi chưa gửi lưu lượng TCP qua cổng

    R1#sh ip tcp header-compression
    TCP/IP header compression statistics:
    Interface Serial0/3/1 (compression on, VJ)
    Rcvd: 0 total, 0 compressed, 0 errors, 0 status msgs
    0 dropped, 0 buffer copies, 0 buffer failures
    Sent: 0 total, 0 compressed, 0 status msgs, 0 not predicted
    0 bytes saved, 0 bytes sent
    Connect: 16 rx slots, 16 tx slots,
    0 misses, 0 collisions, 0 negative cache hits, 16 free contexts

    R1#

    R2#sh ip tcp header-compression
    TCP/IP header compression statistics:
    Interface Serial0/3/1 (compression on, VJ)
    Rcvd: 0 total, 0 compressed, 0 errors, 0 status msgs
    0 dropped, 0 buffer copies, 0 buffer failures
    Sent: 0 total, 0 compressed, 0 status msgs, 0 not predicted
    0 bytes saved, 0 bytes sent
    Connect: 16 rx slots, 16 tx slots,
    0 misses, 0 collisions, 0 negative cache hits, 16 free contexts

    R2#


    Tiến hành telnet từ PC qua R2 đến thiết bị switch để gửi lưu lượng TCP






    R1#sh ip tcp header-compression
    TCP/IP header compression statistics:
    Interface Serial0/3/1 (compression on, VJ)
    Rcvd: 46 total, 43 compressed, 0 errors, 0 status msgs
    0 dropped, 0 buffer copies, 0 buffer failures
    Sent: 167 total, 134 compressed, 0 status msgs, 0 not predicted
    4804 bytes saved, 2704 bytes sent
    2.77 efficiency improvement factor
    Connect: 16 rx slots, 16 tx slots,
    13 misses, 1 collisions, 0 negative cache hits, 16 free contexts
    92% hit ratio, five minute miss rate 0 misses/sec, 0 max
    !Các số liệu thống kê bao nhiêu gói tin nén thành công, mức độ hiệu !quả trong việc nén (improvement factor) được hiển thị

    R1#sh ip tcp header-compression s0/3/1 detail
    TCP/IP header compression statistics:
    Configured:
    Max Header 168 Bytes, Max Time 5 Secs, Max Period 256 Packets, Feedback On
    Negotiated:
    Max Header 168 Bytes, Max Time 5 Secs, Max Period 256 Packets, Feedback On
    TX contexts:

    RX contexts:

    Connection 0:
    IP source: 155.1.2.2, IP destination: 155.1.1.2
    TCP source: 23, TCP destination: 2491
    Last packet received is VJcompressed-tcp and last sequence received is 0
    R1#
    ! RX context trong ví dụ trên là nội dung của thông tin được nén, !nội dung này được gửi định kỳ giữa 2 thiết bị tham gia nén – giải !nén.

    R2#sh ip tcp header-compression
    TCP/IP header compression statistics:
    Interface Serial0/3/1 (compression on, VJ)
    Rcvd: 45 total, 40 compressed, 0 errors, 0 status msgs
    0 dropped, 0 buffer copies, 0 buffer failures
    Sent: 46 total, 43 compressed, 0 status msgs, 0 not predicted
    1504 bytes saved, 545 bytes sent
    3.75 efficiency improvement factor
    Connect: 16 rx slots, 16 tx slots,
    2 misses, 0 collisions, 0 negative cache hits, 16 free contexts
    95% hit ratio, five minute miss rate 0 misses/sec, 0 max

    R2#

    R2#sh ip tcp header-compression s0/3/1 detail
    TCP/IP header compression statistics:
    Configured:
    Max Header 168 Bytes, Max Time 5 Secs, Max Period 256 Packets, Feedback On
    Negotiated:
    Max Header 168 Bytes, Max Time 5 Secs, Max Period 256 Packets, Feedback On
    TX contexts:

    RX contexts:

    Connection 1:
    IP source: 155.1.1.2, IP destination: 155.1.2.2
    TCP source: 2491, TCP destination: 23
    Last packet received is VJcompressed-tcp and last sequence received is 0
    R2#



    Tiến hành ping từ PC đến thiết bị đầu xa và kiểm tra thông số, gói tin icmp echo request không thuộc giao thức TCP nên các giá trị thống kê không tăng.

    R1#sh ip tcp header-compression s0/3/1
    TCP/IP header compression statistics:
    Interface Serial0/3/1 (compression on, VJ)
    Rcvd: 46 total, 43 compressed, 0 errors, 0 status msgs
    0 dropped, 0 buffer copies, 0 buffer failures
    Sent: 167 total, 134 compressed, 0 status msgs, 0 not predicted
    4804 bytes saved, 2704 bytes sent
    2.77 efficiency improvement factor
    Connect: 16 rx slots, 16 tx slots,
    13 misses, 1 collisions, 0 negative cache hits, 16 free contexts
    92% hit ratio, five minute miss rate 0 misses/sec, 0 max

    R2#sh ip tcp header-compression s0/3/1
    TCP/IP header compression statistics:
    Interface Serial0/3/1 (compression on, VJ)
    Rcvd: 45 total, 40 compressed, 0 errors, 0 status msgs
    0 dropped, 0 buffer copies, 0 buffer failures
    Sent: 46 total, 43 compressed, 0 status msgs, 0 not predicted
    1504 bytes saved, 545 bytes sent
    3.75 efficiency improvement factor
    Connect: 16 rx slots, 16 tx slots,
    2 misses, 0 collisions, 0 negative cache hits, 16 free contexts
    95% hit ratio, five minute miss rate 0 misses/sec, 0 max


    Tiếp tục tiến hành telnet sẽ thấy thông tin tăng lên




    R1#sh ip tcp header-compression s0/3/1
    TCP/IP header compression statistics:
    Interface Serial0/3/1 (compression on, VJ)
    Rcvd: 65 total, 60 compressed, 0 errors, 0 status msgs
    0 dropped, 0 buffer copies, 0 buffer failures
    Sent: 187 total, 149 compressed, 0 status msgs, 0 not predicted
    5307 bytes saved, 3016 bytes sent
    2.75 efficiency improvement factor
    Connect: 16 rx slots, 16 tx slots,
    14 misses, 1 collisions, 0 negative cache hits, 16 free contexts
    92% hit ratio, five minute miss rate 0 misses/sec, 0 max

    R2#sh ip tcp header-compression s0/3/1
    TCP/IP header compression statistics:
    Interface Serial0/3/1 (compression on, VJ)
    Rcvd: 65 total, 55 compressed, 0 errors, 0 status msgs
    0 dropped, 0 buffer copies, 0 buffer failures
    Sent: 65 total, 60 compressed, 0 status msgs, 0 not predicted
    2098 bytes saved, 922 bytes sent
    3.27 efficiency improvement factor
    Connect: 16 rx slots, 16 tx slots,
    3 misses, 0 collisions, 0 negative cache hits, 16 free contexts
    95% hit ratio, five minute miss rate 0 misses/sec, 0 max

    Cấu hình cuối cùng của hệ thống
    R1#sh run
    Building configuration...

    Current configuration : 1148 bytes
    !
    version 12.4
    service timestamps debug datetime msec
    service timestamps log datetime msec
    no service password-encryption
    !
    hostname R1
    !
    ip cef
    !
    !
    no ip domain lookup
    !
    interface FastEthernet0/0
    ip address 155.1.1.1 255.255.255.0
    duplex auto
    speed auto
    !
    !
    interface Serial0/3/1
    ip address 155.1.12.1 255.255.255.0
    ip tcp header-compression
    clock rate 2000000
    !
    ip forward-protocol nd
    ip route 0.0.0.0 0.0.0.0 Serial0/3/1
    !
    ip http server
    no ip http secure-server
    !
    control-plane
    !
    alias exec t telnet 155.1.12.2
    !
    line con 0
    logging synchronous
    line aux 0
    line vty 0 4
    login
    !
    scheduler allocate 20000 1000
    !
    end

    R1#


    R2#sh run
    Building configuration...

    Current configuration : 1018 bytes
    !
    version 12.4
    service timestamps debug datetime msec
    service timestamps log datetime msec
    no service password-encryption
    !
    hostname R2
    !
    !
    interface FastEthernet0/0
    ip address 155.1.2.1 255.255.255.0
    duplex auto
    speed auto
    !
    interface Serial0/3/1
    ip address 155.1.12.2 255.255.255.0
    ip tcp header-compression
    !
    ip route 155.1.1.0 255.255.255.0 Serial0/3/1
    !
    ip http server
    no ip http secure-server
    !
    control-plane
    !
    line con 0
    line aux 0
    line vty 0 4
    privilege level 15
    no login
    !
    scheduler allocate 20000 1000
    !
    end

    R2#
    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
Working...
X