IP性能配置

介绍了IP性能优化所需的相关参数和功能、配置过程和配置举例。

5.1 简介
了解与IP性能相关的参数和概念。
5.2 配置IP性能优化
在特定的网络环境里,通过设置IP的一系列参数以达到最佳的效果。
5.3 维护IP性能优化
清除IP/TCP/UDP的统计信息或调试IP/TCP/UDP。

5.4

配置举例
举例说明IP性能的具体配置。
5.1 简介
了解与IP性能相关的参数和概念。

5.1.1 IP性能概述
5.1.2 S-switch支持的IP性能
5.1.1 IP性能概述

IP性能的优化需要配置一些相关参数或相关功能。例如配置ICMP属性、配置TCP属性等。
其中,Internet控制报文协议ICMP(Internet Control Message Protocol)报文通常被IP层或更高层协议(TCP或UDP)使用,它传递差错报文以及其他需要注意的信息。
5.1.2 S-switch支持的IP性能

ICMP
ICMP主机不可达报文
如果S-switch在转发报文时发现报文同时满足以下条件:
报文的目的地址没有对应的路由。
该报文也不是到本机的报文。
那么S-switch将丢弃该报文,同时向源地址返回一个ICMP主机不可达报文,以通知源主机停止发送到该目的地的报文。
ICMP报文开关的作用
在正常情况下,以上报文能够确保业务报文的正确发送。但是,当网络流量较大时,如果以上的现象出现较多,则S-switch会因此发送大量的ICMP报文,增大网络的流量负担。尤其是当遇到恶意攻击时,容易产生恶性循环,从而加剧网络的拥塞。
解决上述问题的办法是在ICMP报文的出接口增加控制开关,用来打开或关闭ICMP主机不可达报文的发送开关。如果关闭这个开关,则S-switch不会发送该报文,从而起到减小网络流量负担、防止遭到恶意攻击的作用。
广播报文转发
广播报文转发功能用来控制是否在指定接口上对广播报文进行转发。在接口上执行ip forward-broadcast命令后,当从该接口发送报文时,如果发现报文是本接口的广播报文且不是本机发送的,则将在回送一份给本机后再转发该报文。
如果在该命令中指定了ACL规则,则必须对符合ACL规则的广播报文进行转发,对不符合ACL规则的广播报文只回送本机,不转发出去。
S-switch一般不转发定向广播报文,但在某些应用场合中,用户可能需要S-switch也转发定向广播报文,因此可通过该功能的命令进行控制,由用户来决定是否让接口转发定向广播报文,使组网更加灵活。
5.2 配置IP性能优化
在特定的网络环境里,通过设置IP的一系列参数以达到最佳的效果。

5.2.1 建立配置任务
5.2.2 配置IP源地址校验
5.2.3 配置广播报文转发
5.2.4 配置ICMP属性
5.2.5 配置TCP属性
5.2.6 检查配置结果
5.2.1 建立配置任务

应用环境
在一些特定的网络环境里,需要微调IP的参数,以便达到最佳的效果。优化IP性能涉及到设置一系列的参数。
前置任务
在配置IP性能优化之前,需完成以下任务:
连接接口并配置接口的物理参数,使接口的物理层状态为Up
配置接口的链路层协议参数,使接口的链路协议状态为Up
配置接口的IP地址
配置ACL
数据准备
在配置IP性能优化之前,需准备以下数据。
序号
数据
1
接口的编号
2
需要进行源地址校验的接口编号
3
需要转发广播报文的接口编号以及用于指定广播报文的ACL编号
4
需要配置ICMP主机不可达功能的接口编号
5
SYN-Wait定时器、FIN-Wait定时器、Socket收发缓冲区的大小
5.2.2 配置IP源地址校验

背景信息
请在S-switch上进行以下配置。
操作步骤
执行命令system-view,进入系统视图。
执行命令interface vlanif vlan-id,进入VLANIF接口视图。
执行命令ip verify source-address,使能接口对接收报文的IP源地址校验功能。
缺省情况下,接口不对接收的报文进行源地址合法性检查。
5.2.3 配置广播报文转发

背景信息
请在路由器上进行以下配置。
操作步骤
执行命令system-view,进入系统视图。
执行命令interface vlanif vlan-id,进入VLANIF接口视图。
执行命令ip forward-broadcast [ acl acl-number ],配置接口转发广播报文。
缺省情况下,接口不转发广播报文。
5.2.4 配置ICMP属性

背景信息
缺省情况下,系统ICMP重定向报文发送功能和系统ICMP主机不可达报文发送功能是打开的。
华为Quidway S3300系列以太网交换机-IP性能配置 注意:
如果关闭ICMP主机不可达报文发送功能,则S-switch在任何情况下都不会再发出ICMP主机不可达报文。
请在S-switch上进行以下配置。
操作步骤
执行命令system-view,进入系统视图。
执行命令interface interface-type interface-number,进入接口视图。
接口为VLANIF接口。
执行命令icmp host-unreachable send,打开系统ICMP主机不可达报文发送功能。
5.2.5 配置TCP属性

背景信息
可以配置的TCP属性包括:
SYN-Wait定时器:当发送SYN报文时,TCP启动SYN-Wait定时器,若SYN-Wait超时前未收到回应报文,则TCP连接将被终止。SYN-Wait定时器的取值范围是2秒~600秒,缺省值是75秒。
FIN-Wait定时器:当TCP的连接状态由FIN_WAIT_1变为FIN_WAIT_2时启动FIN-Wait定时器,若FIN-Wait定时器超时前仍未收到FIN报文,则TCP连接被终止。FIN-Wait定时器的取值范围是76秒~3600秒,缺省值是675秒。
面向连接Socket的接收和发送缓冲区的大小window-size:取值范围是1k~32k字节,缺省值是8k字节。
在系统视图下多次配置TCP的各个属性,只有最后一次配置生效。
请在S-switch上进行如下配置。
操作步骤
执行命令system-view,进入系统视图。
执行命令tcp timer syn-timeout interval,配置TCP连接建立SYN-Wait定时器时间。
执行命令tcp timer fin-timeout interval,配置TCP的FIN-WAIT(FIN_WAIT_2)定时器时间。
执行命令tcp window window-size,配置TCP的Socket接收和发送缓冲区的大小。
5.2.6 检查配置结果

完成上述配置后,请执行下面的命令检查配置结果。
操作
命令
查看TCP连接状态
display tcp status [ [ task-id task-id ] [ socket-id socket-id ] | [ local-ip ip-address ] [ local-port local-port-number ] [ remote-ip ip-address ] [ remote-port remote-port-number ] ]
查看TCP流量统计信息
display tcp statistics
查看UDP流量统计信息
display udp statistics
查看IP层接口信息
display ip interface [ interface-type interface-number ]
display ip interface brief [ interface-type [ interface-number ] ]
查看IP流量统计信息
display ip statistics
查看ICMP流量统计信息
display icmp statistics
查看RawLink统计信息
display rawlink statistics
查看转发信息表
display fib
过滤显示FIB信息
display fib acl acl-number [ verbose ]
按照目的地址进行匹配显示FIB表项
display fib destination-address1 [ desinationt-mask1 ] [ longer ] [ verbose ]
查看目的地址在输入的destination-address1 destination-mask1到destination-address2 destination-mask2范围内的FIB表项
display fib destination-address1 destination-mask1 destination-address2 destination-mask2 [ verbose ]
根据所输入的prefix-name名字,把通过了该过滤规则的FIB表项按照一定格式显示出来
display fib ip-prefix prefix-name [ verbose ]
根据所输入的接口类型和编号,把通过了该过滤规则的FIB表项按照一定格式显示出来
display fib interface interface-type interface-number
根据所输入的下一跳IP地址,把通过了该过滤规则的FIB表项按照一定格式显示出来
display fib next-hop ip-address
查看FIB表项的总数目
display fib statistics
转发信息表摘要信息
display fib [ | { begin | exclude | include } regular-expression ]
查看系统当前所有的套接口信息
display ip socket [ monitor ] [ task-id task-id | sock-type sock-type ]
执行命令display tcp status,可以查看TCP连接状态信息。
display tcp status
TCPCB Tid/Soid Local Add:port Foreign Add:port VPNID State
0dcdd3c0 30 /1 0.0.0.0:21 0.0.0.0:0 0 Listening
0f63b34c 40 /1 0.0.0.0:23 0.0.0.0:0 14849 Listening
0dcde398 40 /2 100.1.1.235:23 100.1.1.156:3589 0 Establishe
d
0dce0348 40 /3 100.1.1.235:23 100.1.1.156:3596 0 Establishe
d
0dce0e40 40 /4 100.1.1.235:23 100.1.1.156:3750 0 Establishe
d
0dce22f8 40 /5 100.1.1.235:23 100.1.1.156:3762 0 Establishe
d
执行命令display tcp statistics,可以查看TCP流量统计信息。
display tcp statistics
Received packets:

 Total: 0                                                                   
 packets in sequence: 0 (0 bytes)                                           
 window probe packets: 0, window update packets: 0                          
 checksum error: 0, offset error: 0, short error: 0                         
                                                                            
 duplicate packets: 0 (0 bytes), partially duplicate packets: 0 (0 bytes)   
 out-of-order packets: 0 (0 bytes)                                          
 packets of data after window: 0 (0 bytes)                                  
 packets received after close: 0                                            
                                                                            
 ACK packets: 0 (0 bytes)                                                   
 duplicate ACK packets: 0, too much ACK packets: 0                          
                                                                            

Sent packets:

 Total: 0                                                                   
 urgent packets: 0                                                          
 control packets: 0 (including 0 RST)                                       
 window probe packets: 0, window update packets: 0                          
                                                                            
 data packets: 0 (0 bytes),data packets retransmitted: 0 (0 bytes)          
 ACK-only packets: 0 (0 delayed)                                            
                                                                            

Retransmitted timeout: 0, connections dropped in retransmitted timeout: 0
Keep alive timeout: 0, keep alive probe: 0, Keep alive timeout, so connections d
isconnected : 0
Initiated connections: 0, accepted connections: 0, established connections: 0
Closed connections: 0 (dropped: 0, initiated dropped: 0)
Packets dropped with MD5 authentication: 0
Packets permitted with MD5 authentication: 0
执行命令display udp statistics,可以查看UDP流量统计信息。
display udp statistics
Received packets:

 Total: 0
 checksum error: 0
 shorter than header: 0, data length larger than packet: 0
 unicast(no socket on port): 0
 broadcast/multicast(no socket on port): 0
 not delivered, input socket full: 0
 input packets missing pcb cache: 0

Sent packets:

 Total: 0

执行命令display ip interface,可以查看IP层接口信息。
display ip interface vlanif 1
Vlanif1 current state : DOWN
Line protocol current state : DOWN
The Maximum Transmit Unit : 1500 bytes
input packets : 0, bytes : 0, multicasts : 0
output packets : 0, bytes : 0, multicasts : 0
Directed-broadcast packets:
received packets: 0, sent packets: 0
forwarded packets: 0, dropped packets: 0
Internet Address is 172.18.255.1/24
Broadcast address : 172.18.255.255
TTL invalid packet number: 0
ICMP packet input number: 0
Echo reply: 0
Unreachable: 0
Source quench: 0
Routing redirect: 0
Echo request: 0
Router advert: 0
Router solicit: 0
Time exceed: 0
IP header bad: 0
Timestamp request: 0
Timestamp reply: 0
Information request: 0
Information reply: 0
Netmask request: 0
Netmask reply: 0
Unknown type: 0
DHCP packet deal mode: global
执行命令display ip statistics,可以查看IP流量统计信息。
display ip statistics
Input: sum 10153 local 10153

       bad protocol       0      bad format           0
       bad checksum       0      bad options          0
       TTL exceeded       0

Output: forwarding 0 local 11589

       dropped            0      no route             0

Fragment: input 0 output 0

       dropped            0
       fragmented         0      couldn't fragment    0

Reassembling:sum 0 timeouts 0
执行命令display icmp statistics,可以查看ICMP流量统计信息。
display icmp statistics
Input: bad formats 0 bad checksum 0

   echo              4      destination unreachable     0
   source quench     0      redirects                   0
   echo reply        5      parameter problem           0
   timestamp         0      information request         0
   mask requests     0      mask replies                0
   time exceeded     0

Output:echo 5 destination unreachable 0

   source quench     0      redirects                   0
   echo reply        4      parameter problem           0
   timestamp         0      information reply           0
   mask requests     0      mask replies                0
   time exceeded     0

执行命令display rawlink statistics,可以查看RawLink统计信息。
display rawlink statistics
Received packets:

 Total: 0
 ifnet is null: 0
 input packets missing pcb cache: 0
 not pass multicast: 0
 no join multicast: 0
 full sock and pstMBuf to be freed: 0
 full sock and nothing to be freed: 0
 full sock and other reason: 0

Send packets:

 Total: 0

执行命令display fib,可以查看转发信息表摘要信息。
display fib
FIB Table:
Total number of Routes : 7

Destination/Mask Nexthop Flag TimeStamp Interface TunnelID
127.0.0.1/32 127.0.0.1 HU t[57] InLoop0 0x0
127.0.0.0/8 127.0.0.1 U t[57] InLoop0 0x0
172.16.255.6/32 127.0.0.1 HU t[86] InLoop0 0x0
172.16.255.4/30 172.16.255.6 U t[86] Vlanif2002 0x0
0.0.0.0/0 172.16.255.5 GSU t[86] Vlanif2002 0x0
192.168.0.0/16 172.16.255.5 GSU t[86] Vlanif2002 0x0
172.16.255.5/32 172.16.255.5 HLU t[650] GE0/0/1 0x0
display fib acl 2010
Route entry matched by access-list 2010:
Summary counts: 1
Destination/Mask Nexthop Flag TimeStamp Interface TunnelID
127.0.0.0/8 127.0.0.1 U t[0] InLoopBack0 0x0
5.3 维护IP性能优化
清除IP/TCP/UDP的统计信息或调试IP/TCP/UDP。

5.3.1 清除统计信息
5.3.2 监控运行状况
5.3.3 调试
5.3.1 清除统计信息

华为Quidway S3300系列以太网交换机-IP性能配置 注意:
清除IP/TCP/UDP的统计信息后,以前的统计信息将无法恢复,务必仔细确认。
在确认需要清除IP/TCP/UDP的运行信息后,请在用户视图下执行下面的reset命令。
操作
命令
清除IP统计信息
reset ip statistics [ interface interface-type interface-number ]
清除Socket Monitor中的信息
reset ip socket monitor
清除TCP流量统计信息
reset tcp statistics
清除UDP流量统计信息
reset udp statistics
清除RawLink统计信息
reset rawlink statistics
5.3.2 监控运行状况

在日常维护工作中,可以执行以下命令,监控运行状况。
操作
命令
查看TCP连接状态
display tcp status [ [ task-id task-id ] [ socket-id socket-id ] | [ local-ip ip-address ] [ local-port local-port-number ] [ remote-ip ip-address ] [ remote-port remote-port-number ] ]
查看TCP流量统计信息
display tcp statistics
查看UDP流量统计信息
display udp statistics
查看IP层接口信息
display ip interface [ interface-type interface-number ]
display ip interface brief [ interface-type [ interface-number ] ]
查看IP流量统计信息
display ip statistics
查看ICMP流量统计信息
display icmp statistics
查看RawLink统计信息
display rawlink statistics
查看转发信息表
display fib
过滤显示FIB信息
display fib acl acl-number [ verbose ]
按照目的地址进行匹配显示FIB表项
display fib [ slot-id ] destination-address1 [ desinationt-mask1 ] [ longer ] [ verbose ]
查看目的地址在输入的destination-address1 destination-mask1到destination-address2 destination-mask2范围内的FIB表项
display fib [ slot-id ] destination-address1 destination-mask1 destination-address2 destination-mask2 [ verbose ]
根据所输入的prefix-name名字,把通过了该过滤规则的FIB表项按照一定格式显示出来
display fib ip-prefix prefix-name [ verbose ]
根据所输入的接口类型和编号,把通过了该过滤规则的FIB表项按照一定格式显示出来
display fib interface interface-type interface-number
根据所输入的下一跳IP地址,把通过了该过滤规则的FIB表项按照一定格式显示出来
display fib next-hop ip-address
查看FIB表项的总数目
display fib statistics
转发信息表摘要信息
display fib [ | { begin | exclude | include } regular-expression ]
查看系统当前所有的套接口信息
display ip socket [ monitor ] [ task-id task-id | sock-type sock-type ]
5.3.3 调试

华为Quidway S3300系列以太网交换机-IP性能配置 注意:
打开调试开关将影响系统的性能。调试完毕后,应及时执行undo debugging all命令关闭调试开关。
在出现IP/TCP/UDP/RAWIP/RAWLINK运行故障时,请在用户视图下执行下面的debugging命令对IP/TCP/UDP/RAWIP/RAWLINK进行调试,查看调试信息,定位故障并分析故障原因。
操作
命令
打开IP报文调试信息开关
debugging ip packet [ error ] [ acl acl-number ]
打开ICMP调试信息开关
debugging ip icmp
打开UDP报文的调试信息
debugging udp packet [ local-ip ip-address ] [ local-port local-port ] [ remote-ip ip-address ] [ remote-port remote-port ]
debugging udp packet [ task-id task-id ] [ socket-id socket-id ]
打开TCP报文的调试开关
debugging tcp packet [ local-ip ip-address ] [ local-port local-port ] [ remote-ip ip-address ] [ remote-port remote-port ] [ flag flag-number ]
debugging tcp packet [ task-id task-id ] [ socket-id socket-id ] [ flag flag-number ]
打开TCP事件的调试开关
debugging tcp event [ local-ip local-address ] [ local-port local-port ] [ remote-ip remote-address ] [ remote-port remote-port ]
debugging tcp event [ task-id task-id ] [ socket-id socket-id ]
打开TCP MD5认证的调试开关
debugging tcp md5 [ local-ip local-address ] [ local-port local-port ] [ remote-ip remote-address ] [ remote-port remote-port ]
debugging tcp md5 [ task-id task-id ] [ socket-id socket-id ]
打开RAWIP报文的调试开关
debugging rawip packet [ local-ip ip-address ] [ remote-ip ip-address ] [ protocol protocol-number ] [ verbose verbose-number ]
debugging rawip packet [ task-id task-id ] [ socket-id socket-id ] [ verbose verbose-number]
打开RAWLINK报文的调试开关
debugging rawlink packet [ local-mac local-mac ] [ remote-mac remote-mac ] [ verboseverbose-number ]
debugging rawlink packet [ task-id task-id ] [ socket-id socket-id ] [ verbose verbose-number ]
5.4 配置举例
举例说明IP性能的具体配置。

5.4.1 配置ICMP属性主机不可达报文示例
5.4.1 配置ICMP属性主机不可达报文示例

组网需求
如图5-1所示,为测试主机不可达报文的限制发送需要S-switch-A、S-switch-B、S-switch-C三台设备,并且这三台设备通过各自的VLANIF接口相连。
图5-1 配置ICMP属性主机不可达报文组网图
华为Quidway S3300系列以太网交换机-IP性能配置
配置思路
配置限制发送ICMP主机不可达报文的思路如下:
在各S-switch的相应接口上配置IP地址。
配置到达非直连设备的静态路由。
在接口上使能限制发送ICMP主机不可达报文的功能。
数据准备
完成此配置,需准备如下的数据:
到达非直连设备的静态路由
接口的IP地址
配置步骤
配置S-switch-A

在S-switch-A上配置静态路由。

system-view
[Quidway] sysname S-switch-A
[S-switch-A] ip route-static 2.2.2.2 24 1.1.1.2

配置接口VLANIF1的IP地址。

[S-switch-A] interface vlanif 1
[S-switch-A-Vlanif1] ip address 1.1.1.1 24
[S-switch-A-Vlanif1] quit
配置S-switch-B

在S-switch-B配置上取消主机不可达的报文发送功能,并配置接口VLANIF1的IP地址。

system-view
[Quidway] sysname S-switch-B
[S-switch-B] interface vlanif 1
[S-switch-B-Vlanif1] undo icmp host-unreachable send
[S-switch-B-Vlanif1] ip address 1.1.1.2 24
[S-switch-B-Vlanif1] quit
[S-switch-B] quit
配置S-switch-C

在S-switch-C上配置接口VLANIF1的IP地址。

system-view
[Quidway] sysname S-switch-C
[S-switch-C] interface vlanif 1
[S-switch-C-Vlanif1] ip address 2.2.2.2 24
[S-switch-C-Vlanif1] quit
验证配置结果。

打开S-switch-B的ICMP报文调试开关。

debugging ip icmp

在S-switch-A上运行ping 2.2.2.2,可以看到S-switch-B不发送主机不可达报文。

[S-switch-A] ping 2.2.2.2
配置文件
S-switch-A的配置文件

sysname S-switch-A

interface Vlanif1
ip address 1.1.1.1 255.255.255.0

ip route-static 2.2.2.2 255.255.255.0 1.1.1.2

S-switch-B的配置文件

sysname S-switch-B

interface Vlanif1
ip address 1.1.1.2 255.255.255.0
undo icmp host-unreachable send

S-switch-C的配置文件

sysname S-switch-C

interface Vlanif1
ip address 2.2.2.2 255.255.255.0

宁波 赛诺网络 专业销售华为Quidway S3300系列

标签: 华为QuidwayS9306

添加新评论