Chapter 40Monitoring Network Performance (Tasks)
This chapter describes the how to monitor network performance.
The following is a list of the step-by-step instructions in this chapter.
Monitoring Network Performance
Table 40-1 describes the commands that are available
for monitoring network performance.
Table 40-1 Network Monitoring Commands
Command | Description |
ping | Look at the response of hosts on the
network. |
spray | Test the reliability of your packet
sizes. This command can tell you whether the network is delaying packets or
dropping packets. |
snoop | Capture packets from the network and
trace the calls from each client to each server. |
netstat | Display network status, including state
of the interfaces that are used for TCP/IP traffic, the IP routing table,
and the per-protocol statistics for UDP, TCP, ICMP, and IGMP. |
nfsstat | Display a summary of server and client
statistics that can be used to identify NFS problems. |
How to Check the Response of Hosts on the Network
Check the response of hosts on the network with the ping
command.
If you suspect a physical problem, you can use ping
to find the response time of several hosts on the network. If the response
from one host is not what you would expect, you can investigate that host.
Physical problems could be caused by the following:
For more information about this command, see ping(1M).
Examples--Checking the Response of Hosts on the Network
The simplest version of ping sends a single packet
to a host on the network. If ping receives the correct
response, the command prints the message host is alive.
$ ping elvis
elvis is alive
|
With the -s option, ping sends
one datagram per second to a host. The command then prints each response and
the time that was required for the round trip. An example follows.
$ ping -s pluto
64 bytes from pluto (123.456.78.90): icmp_seq=0. time=10. ms
64 bytes from pluto (123.456.78.90): icmp_seq=5. time=0. ms
64 bytes from pluto (123.456.78.90): icmp_seq=6. time=0. ms
^C
----pluto PING Statistics----
8 packets transmitted, 8 packets received, 0% packet loss
round-trip (ms) min/avg/max = 0/2/10
|
How to Send Packets to Hosts on the Network
Test the reliability of your packet sizes with the spray
command.
$ spray [ -c count -d interval -l packet_size] hostname
|
| -i count | Number of packets to send.
| | -d interval | Number of microseconds to pause between sending packets. If you do not use
a delay, you might deplete the buffers.
| | -l packet_size | Is the packet size.
| | hostname | Is the system to send packets.
|
For more information about this command, see spray(1M).
Example--Sending Packets to Hosts on the Network
The following example sends 100 packets to a host (-c 100),
with a packet size of 2048 bytes (-l 2048). The packets
are sent with a delay time of 20 microseconds between each burst (-d 20).
$ spray -c 100 -d 20 -l 2048 pluto
sending 100 packets of length 2048 to pluto ...
no packets dropped by pluto
279 packets/sec, 573043 bytes/sec
|
How to Capture Packets From the Network
To capture packets from the network and trace the calls from each client
to each server, use snoop. This command provides accurate
timestamps that enable some network performance problems to be isolated quickly.
For more information, see snoop(1M).
Dropped packets could be caused by insufficient buffer space or an overloaded
CPU.
How to Check the Network Status
To display network status information, such as statistics about the
state of network interfaces, routing tables, and various protocols, use the netstat command.
| -i | Displays the state of the TCP/IP interfaces
| | -r | Displays the IP routing table
| | -s | Displays statistics for the UDP, TCP, ICMP, and IGMP protocols
|
For more information, see netstat(1M).
Examples--Checking the Network Status
The following example shows output from the netstat -i
command, which displays the state of the interfaces that are used for TCP/IP
traffic.
$ netstat -i
Name Mtu Net/Dest Address Ipkts Ierrs Opkts Oerrs Collis Queue
lo0 8232 software localhost 1280 0 1280 0 0 0
le0 1500 loopback venus 1628480 0 347070 16 39354 0
|
This display shows the number of packets that a machine has transmitted
and has received on each interface. A machine with active network traffic
should show both Ipkts and Opkts continually
increasing.
Calculate the network collisions rate by dividing the number of collision
counts (Collis) by the number of out packets (Opkts). In the previous example, the collision rate is 11 percent.
A network-wide collision rate that is greater than 5 to 10 percent can indicate
a problem.
Calculate the error rate for the input packets by dividing the number
of input errors by the total number of input packets (Ierrs/Ipkts). The error rate for the output packets is the number of output
errors divided by the total number of output packets (Oerrs/Opkts). If the input error rate is high, at over 0.25 percent, the host
might be dropping packets.
The following example shows output from the netstat -s
command, which displays the per-protocol statistics for the UDP, TCP, ICMP, and IGMP protocols.
UDP
udpInDatagrams =196543 udpInErrors = 0
udpOutDatagrams =187820
TCP
tcpRtoAlgorithm = 4 tcpRtoMin = 200
tcpRtoMax = 60000 tcpMaxConn = -1
tcpActiveOpens = 26952 tcpPassiveOpens = 420
tcpAttemptFails = 1133 tcpEstabResets = 9
tcpCurrEstab = 31 tcpOutSegs =3957636
tcpOutDataSegs =2731494 tcpOutDataBytes =1865269594
tcpRetransSegs = 36186 tcpRetransBytes =3762520
tcpOutAck =1225849 tcpOutAckDelayed =165044
tcpOutUrg = 7 tcpOutWinUpdate = 315
tcpOutWinProbe = 0 tcpOutControl = 56588
tcpOutRsts = 803 tcpOutFastRetrans = 741
tcpInSegs =4587678
tcpInAckSegs =2087448 tcpInAckBytes =1865292802
tcpInDupAck =109461 tcpInAckUnsent = 0
tcpInInorderSegs =3877639 tcpInInorderBytes =-598404107
tcpInUnorderSegs = 14756 tcpInUnorderBytes =17985602
tcpInDupSegs = 34 tcpInDupBytes = 32759
tcpInPartDupSegs = 212 tcpInPartDupBytes =134800
tcpInPastWinSegs = 0 tcpInPastWinBytes = 0
tcpInWinProbe = 456 tcpInWinUpdate = 0
tcpInClosed = 99 tcpRttNoUpdate = 6862
tcpRttUpdate =435097 tcpTimRetrans = 15065
tcpTimRetransDrop = 67 tcpTimKeepalive = 763
tcpTimKeepaliveProbe= 1 tcpTimKeepaliveDrop = 0
IP
ipForwarding = 2 ipDefaultTTL = 255
ipInReceives =11757234 ipInHdrErrors = 0
ipInAddrErrors = 0 ipInCksumErrs = 0
ipForwDatagrams = 0 ipForwProhibits = 0
ipInUnknownProtos = 0 ipInDiscards = 0
ipInDelivers =4784901 ipOutRequests =4195180
ipOutDiscards = 0 ipOutNoRoutes = 0
ipReasmTimeout = 60 ipReasmReqds = 8723
ipReasmOKs = 7565 ipReasmFails = 1158
ipReasmDuplicates = 7 ipReasmPartDups = 0
ipFragOKs = 19938 ipFragFails = 0
ipFragCreates =116953 ipRoutingDiscards = 0
tcpInErrs = 0 udpNoPorts =6426577
udpInCksumErrs = 0 udpInOverflows = 473
rawipInOverflows = 0
ICMP
icmpInMsgs =490338 icmpInErrors = 0
icmpInCksumErrs = 0 icmpInUnknowns = 0
icmpInDestUnreachs = 618 icmpInTimeExcds = 314
icmpInParmProbs = 0 icmpInSrcQuenchs = 0
icmpInRedirects = 313 icmpInBadRedirects = 5
icmpInEchos = 477 icmpInEchoReps = 20
icmpInTimestamps = 0 icmpInTimestampReps = 0
icmpInAddrMasks = 0 icmpInAddrMaskReps = 0
icmpInFragNeeded = 0 icmpOutMsgs = 827
icmpOutDrops = 103 icmpOutErrors = 0
icmpOutDestUnreachs = 94 icmpOutTimeExcds = 256
icmpOutParmProbs = 0 icmpOutSrcQuenchs = 0
icmpOutRedirects = 0 icmpOutEchos = 0
icmpOutEchoReps = 477 icmpOutTimestamps = 0
icmpOutTimestampReps= 0 icmpOutAddrMasks = 0
icmpOutAddrMaskReps = 0 icmpOutFragNeeded = 0
icmpInOverflows = 0
IGMP:
0 messages received
0 messages received with too few bytes
0 messages received with bad checksum
0 membership queries received
0 membership queries received with invalid field(s)
0 membership reports received
0 membership reports received with invalid field(s)
0 membership reports received for groups to which we belong
0 membership reports sent
|
|