Ways to debug network performance using tools under Linux

  
                

Linux system network performance can be tested with tools. The main test tools are route, netstat, tcpdump. This article will introduce the methods of debugging network performance using these three tools under Linux system.

a: route

When configuring the network, the packet to specify the path to go through the machine to receive data packets. On Linux systems, a command route is provided. This command can set a static route for the NIC configured by the ifconfig command. This setup is usually introduced in /etc/rc.d/rc.inet1 and is done at system boot time.

We use a few examples to illustrate how to use the route command:

route add -net 127.0.0.0

This command will add a specified address or network to the routing table. Routing. Note that the network is a Class A address and the mask is set to 255.0.0.0. This newly added entry is connected to the lo device.

route add -net xxx.xxx.xxx.xxx netmask 255.255.255.0 dev eth0

This command adds a route to the host with the IP address xxx.xxx.xxx.xxx, its The netmask is set to 255.255.255.0.

route del -net xxx.xxx.xxx.xxx

This command will delete the route of the network xxx.xxx.xxx.xxx.

Using the route command, you can easily manage the routing information of the entire network. The output is the routing table of the network. As shown below:

---------------------------------------- -------------------------

[root@lee /root]#route

Kernel IP routing table

Destination Gateway Genmask Flags Metric Ref Use Iface

10.10.8.224 * 255.255.255.255 UH 0 0 0 eth0

10.10.8.0 * 255.255.255.0 U 0 0 0 eth0

127.0.0.0 * 255.0.0.0 U 0 0 0 lo

default dgc8.njupt.edu 0.0.0.0 UG 0 0 0 eth0

default dgc8.njupt.edu 0.0.0.0 UG 1 0 0 eth0

[root@lee /root]#

---------------------- -------------------------------------------

Output The meaning of each field in the result is:

· Destination indicates the destination IP address of the route.

· Gateway indicates the host name or IP address used by the gateway. The above output “*” indicates no gateway.

· Genmask represents the network mask of the route. Before comparing it to the destination address of the route, the kernel uses the Genmask and the IP address of the packet to perform a bitwise "and" operation to set the route.

· Flags are flags that represent routes. The available flags and their meanings are: U indicates that the route is started, H indicates that the target is a host, G indicates that the gateway is used, R indicates that the dynamic route is reset, D indicates dynamic routing, and M indicates that the route is modified! Indicates that the route is rejected.

· Metric represents the unit cost of the route.

· Ref represents the number of other routes that depend on the current state of the route.

· Use indicates the number of routing table entries being used.

· Iface represents the destination network of the packets sent by the route.

By looking at these output information, we can easily manage the routing table of the network. Previous123Next page Total 3 pages

Copyright © Windows knowledge All Rights Reserved