An IP address is a 32-bit address allocated
to a device connected to the Internet. It consists of two fields: net-id and
host-id. To facilitate IP address management, IP addresses are divided into
five classes, as shown in Figure 1-1.

Figure 1-1 Five classes of IP addresses
Class A, Class B, and Class C IP addresses
are unicast addresses. Class D IP addresses are multicast addresses and Class E
addresses are reserved for future special use. The first three types are
commonly used.
IP addresses are in the dotted decimal
notation. Each IP address contains four decimal integers, with each integer corresponding
to one byte (for example,10.110.50.101).
Some IP
addresses are reserved for special use. The IP address ranges that can be used
by users are listed in Table
1-1.
Table 1-1 Classes and ranges of IP
addresses
|
Network type
|
Address range
|
IP network range available for users
|
Description
|
|
A
|
0.0.0.0 to 127.255.255.255
|
1.0.0.0 to 126.0.0.0
|
l
An IP address with all 0s host ID is a
network address and is used for network routing.
l
An IP address with all 1s host ID is a broadcast
address and is used for broadcast to all hosts on the network.
l
The IP address 0.0.0.0 is used by hosts when they
are booted but is not used afterward.
l
An IP address with all 0s network ID
represents a specific host on the local network and can be used as a source address
but cannot be used as a destination address.
l
All the IP addresses in the format of
127.X.Y.Z are reserved for loopback test and the packets sent to these
addresses will not be output to lines; instead, they are processed internally
and regarded as incoming packets.
|
|
B
|
128.0.0.0 to 191.255.255.255
|
128.0.0.0 to 191.254.0.0
|
l
An IP address with all 0s host ID is a network
address and is used for network routing.
l
An IP address with all 1s host ID is a
broadcast address and is used for broadcast to all hosts on the network.
|
|
C
|
192.0.0.0 to 223.255.255.255
|
192.0.0.0 to 223.255.254.0
|
l
An IP address with all 0s host ID is a network
address and is used for network routing.
l
An IP address with all 1s host ID is a
broadcast address and is used for broadcast to all hosts on the network.
|
|
D
|
224.0.0.0 to 239.255.255.255
|
None
|
Class D addresses are multicast
addresses.
|
|
E
|
240.0.0.0 to 255.255.255.254
|
None
|
These IP addresses are reserved for
future use.
|
|
Others
|
255.255.255.255
|
255.255.255.255
|
255.255.255.255 is used as a LAN
broadcast address.
|
The traditional IP address classification method
wastes IP addresses greatly. In order to make full use of the available IP
addresses, the concepts of mask and subnet were introduced.
A mask is a 32-bit number corresponding to an IP address. The number
consists of 1s and 0s. These 1s and 0s can be arbitrarily combined in
principle. However, a mask is usually defined as follows: the bits of the
network number and subnet number are set to 1, and the bits of the host number are
set to 0. The mask divides the IP address into two parts: subnet address and
host address. In an IP address, the part corresponding to the "1" bits
in the mask is the subnet address, and the part corresponding to the remaining
"0" bits in the mask is the host address. If there is no subnet
division, the subnet mask uses the default value. In this case, the length of 1s
in the mask is equal to the net-id length. Therefore, for IP addresses of
classes A, B and C, the default values of the corresponding subnet masks are
255.0.0.0, 255.255.0.0 and 255.255.255.0 respectively.
The mask can be used to divide a Class A
network containing more than 16,000,000 hosts or a Class B network containing
more than 60,000 hosts into multiple small networks. Each small network is
called a subnet. For example, for the Class B network address 138.38.0.0, the
mask 255.255.224.0 can be used to divide the network into eight subnets:
138.38.0.0, 138.38.32.0, 138.38.64.0, 138.38.96.0, 138.38.128.0, 138.38.160.0,
138.38.192.0 and 138.38.224.0 (see Figure 1-2). Each subnet can contain more than 8000 hosts.

Figure 1-2 Subnet division of the IP address
For a VLAN interface, an IP address can be
obtained in one of the three ways:
l
Manually configured by using the IP address
configuration command
l
Allocated by the BOOTP server
l
Allocated by the DHCP server
The three methods are mutually exclusive
and the use of a new method will result in the IP address obtained by the old
method being released. For example, if you obtain an IP address by using the IP
address configuration command, and then use the ip address bootp-alloc
command to apply for an IP address, the originally configured IP address is
deleted and a new IP address will be allocated by BOOTP for the VLAN interface.
This chapter only introduces how to
configure an IP address with the IP address configuration command. For the other
two methods, refer to the “Management VLAN Configuration” module.
Generally, it is enough to configure one
IP address for a VLAN interface. However, you can configure up to five IP
addresses for a VLAN interface so that the interface can be connected to
several subnets. Among these IP addresses, one is the primary IP address and the
others are secondary ones.
Table 1-2
Configure an IP address for a VLAN interface
|
Operation
|
Command
|
Description
|
|
Enter system view
|
system-view
|
—
|
|
Enter VLAN interface view
|
interface Vlan-interface vlan-id
|
—
|
|
Configure an IP address for a VLAN
interface
|
ip address
ip-address { mask | mask-length } [ sub ]
|
Required
By default, a VLAN interface has no IP
address.
After an IP address is assigned to the
VLAN interface through BOOTP or DHCP, you cannot configure a secondary IP
address for the VLAN interface.
|
After the above configuration, you can execute the display
command in any view to display the operating status and configuration on the
interface to verify your configuration.
Table 1-3
Display IP address configuration
|
Operation
|
Command
|
Description
|
|
Display VLAN interface information
|
display ip interface [ brief [ interface-type [ interface-number ]
] | [ interface-type interface-number ] ]
|
You can execute the display command
in any view.
|
I. Network requirements
Set the IP address and subnet mask of VLAN-interface1
to 129.2.2.1 and 255.255.255.0 respectively.
II. Network diagram

Figure 1-3 IP address configuration
III. Configuration procedure
# Configure an IP address for VLAN-interface1.
<H3C> system-view
[H3C] interface Vlan-interface 1
[H3C-Vlan-interface1] ip address
129.2.2.1 255.255.255.0
Symptom: The
switch cannot ping the host directly-connected to a port.
Solution:
You can perform troubleshooting as follows:
l
Check the configuration of the switch, and then
use the display arp command to check whether the host has an
corresponding ARP entry in the ARP table maintained by the Switch.
l
Check the VLAN that includes the switch port
connecting the host. Check whether the VLAN has been configured with the VLAN
interface. Then check whether the IP addresses of the VLAN interface and the
host are on the same network segment.
l
If the configuration is correct, enable ARP
debugging on the switch, and check whether the switch can correctly send and
receive ARP packets. If it can only send but cannot receive ARP packets, errors
may occur at the Ethernet physical layer.
IP performance configuration mainly refers
to TCP attribute configuration. The TCP attributes that can be configured
include:
l
synwait timer: This timer is started when TCP sends
a syn packet. If no response packet is received before the timer times out, the
TCP connection will be terminated. The timeout time of the synwait timer ranges
from 2 to 600 seconds and is 75 seconds by default.
l
finwait timer: This timer is started when the
TCP connection turns from the FIN_WAIT_1 state to the FIN_WAIT_2 state. If no FIN
packet is received before the timer times out, the TCP connection will be
terminated. The timeout time of the finwait timer ranges from 76 to 3,600
seconds and is 675 seconds by default.
l
The connection-oriented socket receive/send
buffer size ranges from 1 to 32 KB and is 8 KB by default.
Every switch stores a forwarding
information base (FIB). FIB is used to store the forwarding information of the
switch and guide Layer 3 packet forwarding.
You can know the forwarding information of
the switch through the FIB table. Each FIB entry includes: destination
address/mask length, next hop, current flag, timestamp, and outbound interface.
When the switch is running normally, the
contents of the FIB and the routing table are the same. For routing and routing
tables, refer to the “Routing Protocol” module of this manual.
Table 2-1
Configure TCP attributes
|
Operation
|
Command
|
Description
|
|
Enter system view
|
system-view
|
—
|
|
Configure timeout time for the synwait timer
in TCP
|
tcp timer syn-timeout time-value
|
Required
By default, the timeout time of the TCP
synwait timer is 75 seconds.
|
|
Configure timeout time for the finwait
timer in TCP
|
tcp timer fin-timeout time-value
|
Required
By default, the timeout time of the TCP
finwait timer is 675 seconds.
|
|
Configure the socket receive/send buffer
size of TCP
|
tcp window window-size
|
Required
By default, the receive/send buffer size is
8 KB.
|
Broadcast packets include the general
broadcast packets and the subnet-directed broadcast packets. For a subnet-directed
broadcast packet, its destination IP address is a sub network address, but its
source IP address is not in this sub network segment.
You can perform the following configuration
to determine whether to receive the subnet-directed broadcast packets.
Table 2-2
Configure to receive subnet-directed broadcast packets
|
Operation
|
Command
|
Description
|
|
Enter system view
|
system-view
|
—
|
|
Receive subnet-directed broadcast packets
|
ip forward-broadcast
|
Optional
By default, the subnet-directed packets
will be suppressed.
|
After the above configurations, you can execute
the display command in any view to display the running status to verify
your IP performance configuration.
Table 2-3
Display IP performance
|
Operation
|
Command
|
Description
|
|
Display
TCP connection status
|
display
tcp status
|
You can
execute the display command in any view.
|
|
Display
TCP connection statistics
|
display
tcp statistics
|
|
Display
UDP traffic statistics
|
display
udp statistics
|
|
Display IP
traffic statistics
|
display
ip statistics
|
|
Display
ICMP traffic statistics
|
display
icmp statistics
|
|
Display
the current socket information of the system
|
display
ip socket [ socktype sock-type ] [ task-id socket-id ]
|
|
Display the forwarding information base
(FIB) entries
|
display fib
|
|
Display the FIB entries matching the
destination IP address
|
display fib
ip_address1 [ { mask1 | mask-length1 } [ ip_address2
{ mask2 | mask-length2 } | longer ] | longer ]
|
|
Display the FIB entries filtering through
a specific ACL
|
display fib
acl number
|
|
Display the FIB entries in the buffer which
begin with, include or exclude the specified character string.
|
display fib
| { begin | include | exclude } text
|
|
Display the FIB entries filtering through
a specific prefix list
|
display fib
ip-prefix listname
|
|
Display the total number of the FIB
entries
|
display fib statistics
|
Use the reset command in user view
to clear the IP, TCP, and UDP traffic statistics.
Table 2-4
Maintain IP performance
|
Configuration
|
Command
|
Description
|
|
Clear IP traffic statistics
|
reset ip statistics
|
You can execute the reset command
in user view.
|
|
Clear TCP traffic statistics
|
reset tcp statistics
|
|
Clear UDP traffic statistics
|
reset udp statistics
|
Symptom: IP
packets are forwarded normally, but TCP and UDP cannot work normally.
Solution:
Enable the corresponding debugging information output to view the debugging
information.
l
Use the display command to display the IP
performance and check whether the PC runs normally.
l
Use the terminal debugging command to enable
debugging information to be output to the console.
l
Use the debugging udp packet command to
enable the UDP debugging to trace UDP packets.
<H3C> terminal debugging
<H3C> debugging udp packet
The UDP packets are shown in the following
format:
UDP output packet:
Source IP address:202.38.160.1
Source port:1024
Destination IP Address 202.38.160.1
Destination port: 4296
l
Use the debugging tcp packet command to
enable the TCP debugging to trace TCP packets.
<H3C> terminal debugging
<H3C> debugging tcp packet
Then the TCP packets received or sent will
be displayed in the following format in real time:
TCP output packet:
Source IP address:202.38.160.1
Source port:1024
Destination IP Address 202.38.160.1
Destination port: 4296
Sequence number :4185089
Ack number: 0
Flag :SYN
Packet length :60
Data offset: 10