01-05 IP Performance Optimization Configuration
01-05 IP Performance Optimization Configuration
5 IP Performance Optimization
Configuration
Licensing Requirements
IP performance optimization is a basic feature of a switch and is not under license
control.
Version Requirements
NOTE
To know details about software mappings, see Hardware Query Tool.
Feature Limitations
A device can only forward ICMPv4 packets with the Option field at Layer 3. Other
IPv4 packets with the Option field will be discarded.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The interface view is displayed.
Step 3 Run ip verify source-address
Source IP address verification is configured.
By default, an interface does not check validity of source IP addresses of received
packets.
The interface only checks validity of source IP addresses of the packets that need
to be forwarded to the CPU, and does not check validity of source IP addresses of
the packets that will be directly forwarded according to the FIB table.
If the mask in the IP address of the received packet is of 31 bits, the receiver
considers it as a valid source address without checking the broadcast address of
the subnet.
----End
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The interface view is displayed.
Step 3 Run clear ip df
NOTE
This command takes effect only for the packets that are forwarded by the CPU but not for
the packets that are forwarded by the chip.
----End
Context
If flow-based load balancing is used, the hash algorithm is used to calculate a
value for selecting a link to forward packets. The value is calculated based on the
protocol type, source IP address, destination IP address, source port number, and
destination port number.
Procedure
Step 1 Run system-view
----End
Context
IP packets can carry route options including the route-alert option, route-record
option, source-route option, and timestamp option. These route options are used
to diagnose network paths and temporarily transmit special services. These
options, however, may be used by attackers to spy on the network structure for
initiating attacks, degrading network security and switch performance. To solve
this problem, you can configure the switch to discard the IP packets that carry the
route options.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The interface view is displayed.
Step 3 Do as follows according to different route options in IP packets:
● Run discard ra
The interface is configured to discard IP packets with route-alert options.
● Run discard rr
The interface is configured to discard IP packets with record-route options.
● Run discard srr
The interface is configured to discard IP packets with source-route options.
● Run discard ts
The interface is configured to discard IP packets with time-stamp options.
By default, the device processes packets sent to the CPU based on route options
contained in these packets.
NOTE
The discard { ra | rr | srr | ts } command only takes effect for the packets on inbound
interfaces.
The discard { ra | rr | srr | ts } command only takes effect for packets sent to the CPU. For
packets that are not sent to the CPU, the device processes and forwards them using the
same method of processing packets without route options regardless of whether the
discard { ra | rr | srr | ts } command is configured or not.
----End
Figure 5-1 Configuring the interface to forward directed broadcast packets in the
WOL scenario
GE 0/0/1 GE 0/0/2
10.1.1.1/24 10.2.2.1/24
10.1.1.2/24 10.2.2.2/24
NOTE
By default, the device identifies directed broadcast packets as malformed packets, and
intercepts and discards them because the attack defense function of malformed packets is
enabled on the device. In this case, the interface on the device cannot forward the directed
broadcast packets.
To solve this problem, use either of the following methods:
● Run the anti-attack abnormal disable command to disable the attack defense function
of malformed packets. However, after this command is configured, other malformed
packets will not be intercepted and discarded, which brings certain security risks. Use
this command with caution.
● Run the anti-attack disable command to disable all attack defense functions. However,
after this command is configured, not only malformed packets but also fragmented, tcp-
syn, udp-flood, and icmp-flood attack packets will not be intercepted and discarded,
which brings certain security risks. Use this command with caution.
The device can also be enabled to receive and forward a certain type of directed
broadcast packets based on ACLs. For example, if the basic ACL is used, run the
acl (system view) and rule (basic ACL view) commands to define the directed
broadcast packets to be received and forwarded as permit, and then run the ip
forward-broadcast command to bind this ACL.
Procedure
Step 1 Configure the basic or advanced ACL. For details, see Configuring and Applying a
Basic ACL or Configuring and Applying an Advanced ACL in "ACL Configuration" in
the S600-E V200R011C10 Configuration Guide - Security.
Only broadcast packets that match the permit action defined in the ACL are
forwarded. Broadcast packets that match the deny action defined in the ACL or do
not match any ACL rules are not forwarded.
----End
Context
When the link type of an interface is QinQ or the VLAN mapping or VLAN
stacking function is configured on the interface, the system checks IP packets so
that the switch cannot transparently transmit IP error packets. In addition, during
Layer 2 forwarding, devices cannot transparently transmit packets with the same
source and destination IP addresses. To enable the switch to transparently transmit
IP error packets, you can disable the IP packet checking function.
NOTE
When the IP packet checking function is disabled, the IP subnet-based VLAN assignment ,
policy-based VLAN assignment do not take effect. Therefore, confirm your action before
disabling this function.
Procedure
Step 1 Run system-view
----End
Context
The Internet Control Message Protocol (ICMP) is a protocol of the TCP/IP protocol
suite. It exchanges messages between hosts and routing devices. When receiving
an ICMP packet, the device sends the packet to the CPU. When a device receives a
large number of ICMP packets, the forwarding performance of the device
degrades. Therefore, you need to set related ICMP properties to optimize IP
performance.
Procedure
● Set ICMP properties in the system view to optimize IP performance.
a. Run system-view
The system view is displayed.
b. Set ICMP properties as required to optimize IP performance.
The icmp host-unreachable send command can be run in the system view
or VLANIF interface view.
● After the function of sending ICMP Host Unreachable packets is disabled
in the system view, all VLANIF interfaces do not send ICMP Host
Unreachable packets. Even if the function is enabled on a VLANIF
interface, the VLANIF interface does not send ICMP Host Unreachable
packets.
● After the function of sending ICMP Host Unreachable packets is enabled
in the system view, all VLANIF interfaces send ICMP Host Unreachable
packets because the function is enabled on all interfaces by default. You
can run the undo icmp host-unreachable send command in VLANIF
interface view to disable the function on a specified VLANIF interface.
If the function of sending ICMP Host Unreachable packets is disabled, the
switch does not send ICMP Host Unreachable packets in any situations.
NOTE
The icmp port-unreachable send command can be run in the system view
or VLANIF interface view.
● After the function of sending ICMP Port Unreachable packets is disabled
in the system view, all VLANIF interfaces do not send ICMP Port
Unreachable packets. Even if the function is enabled on a VLANIF
interface, the VLANIF interface does not send ICMP Port Unreachable
packets.
● After the function of sending ICMP Port Unreachable packets is enabled
in the system view, all VLANIF interfaces send ICMP Port Unreachable
packets because the function is enabled on all interfaces by default. You
can run the undo icmp port-unreachable send command in VLANIF
interface view to disable the function on a specified VLANIF interface.
If the function of sending ICMP Port Unreachable packets is disabled, the
switch does not send ICMP Port Unreachable packets in any situations.
If the function of sending ICMP Redirect packets is disabled, the switch does
not send ICMP Redirect packets in any situations.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run tcp timer syn-timeout interval
The SYN-Wait timer of TCP connections is configured.
By default, the value of the TCP SYN-Wait timer is 75s.
Step 3 Run tcp timer fin-timeout interval
The FIN-WAIT timer of TCP connections is configured.
By default, the value of the TCP FIN-Wait timer is 675s.
Step 4 Run tcp window window-size
The size of the receive or send buffer of a connection-oriented socket is
configured.
NOTE
The maximum MSS value configured using the tcp max-mss command must be greater
than the minimum MSS value configured using the tcp min-mss command.
----End
NOTICE
The IP/TCP/UDP traffic statistics cannot be restored after being cleared. Therefore,
confirm your action before clearing the IP performance statistics.
Procedure
● After you are determined to clear IP statistics, run the reset ip statistics
[ interface interface-type interface-number ] command in the user view.
● After you are determined to clear statistics in a socket monitor, run the reset
ip socket monitor [ task-id task-id socket-id socket-id ] command in the
user view.
● After you are determined to clear statistics on the dual receive buffer of the
socket, run the reset ip socket pktsort task-id task-id socket-id socket-id
command in the user view.
● After you are determined to clear RawIP statistics, run the reset rawip
statistics command in the user view.
● After you are determined to clear TCP statistics, run the reset tcp statistics
command in the user view.
● After you are determined to clear UDP statistics, run the reset udp statistics
command in the user view.
----End
Context
In routine maintenance, you can run the following commands in any view to
check the running status of IP performance.
Procedure
● Run the display icmp statistics command to check ICMP traffic statistics.
● Run the display ip interface [ interface-type interface-number ] or display ip
interface brief [ interface-type [ interface-number ] | slot slot-id [ card card-
number ] ] command to check interface-related IP information.
● Run the display ip socket [ monitor ] [ task-id task-id socket-id socket-id |
socket-type socket-type ] command to check information about the created
IPv4 sockets.
● Run the display ip socket register-port command to check non-well-known
port numbers that have been assigned to services.
● Run the display ip statistics command to check IP traffic statistics.
● Run the display load-balance mode [ packet | flow | slot slot-number ]
command to check the load balancing mode on a switch.
● Run the display network status { all | tcp | udp | port port-number }
command to check the network status.
● Run the display rawip statistics command to check RawIP traffic statistics.
● Run the 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 ] ] command to check TCP
connection status.
● Run the display tcp statistics command to check TCP traffic statistics.
● Run the display udp statistics command to check UDP traffic statistics.
----End
Figure 5-2 Networking diagram for configuring the ICMP security function
Internet
BRAS
Switch
DSLAM
User
network
Enterprise Individual
user user
Configuration Roadmap
The configuration roadmap is as follows:
Configure the switch to discard ICMP packets whose TTL value is 1, ICMP packets
that carry options, and ICMP Destination Unreachable packets to reduce its
burden in processing a large number of ICMP packets.
Procedure
Step 1 Configure the switch to discard certain ICMP packets.
# Configure the switch to discard ICMP packets whose TTL value is 1.
<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] icmp ttl-exceeded drop all
# Configure the switch to discard ICMP packets whose destination addresses are
unreachable.
[Switch] icmp unreachable drop
----End
Configuration Files
Switch configuration file
#
sysname Switch
#
icmp unreachable drop
icmp ttl-exceeded drop slot 0
icmp with-options drop slot 0
#
return