Netstat command output

Matthew Seaman m.seaman at infracaninophile.co.uk
Fri Dec 19 18:07:59 UTC 2008


Karrj wrote:
> Hello - Warning -  I am new to FreeBSD. I am not sure this is the correct
> forum for this post - forgive me if it is not and please direct me to the
> correct area. I have installed FreeBSD on a HP Proliant DL380 G3 server with
> (2) NICs. I have also installed Dummynet and NetSNMP as my ultimate goal is
> to use this as a WAN emulator. I was doing some initial testing where the
> FreeBSD box acts as a router between two subnets where an ftp client is on
> one subnet and an ftp server is on the other. I kick off an ftp get of a 9
> MB file and at the same time initiate a netstat -w1 -Ibge0 command on the
> FreeBSD. The outputput of the command indicates a relatively small number of
> input errors (<10 per interval). The same command on the bge1 interface is
> all zeros. This is repeatable every time I perform the ftp get. I performed
> the same test without the FreeBSD box by having the client and server
> connected to the same subnet through the same switch ports and no errors
> according to the trace analysis - no retransmissions, etc shown in the
> trace. My questions are related to the meaning and interpretation of the
> output of the netstat command and how to resolve the errors. 1) What is the
> meaning of input errors? Is it bad CRC at layer 2? What would be meant by
> output errors in the command? The interface cannot see the packets after
> they have been transmitted. I would like a technical explanation of the
> output of this netstat command. 2) How to alleviate the errors? Is this a
> buffer issue? How to determine the NIC type? 
> Any feedback would be most appreciated.

Hmm... well, to determine the NIC type, look at the interface name.  In FreeBSD,
the i/f device depends on the chipset of the NIC.  There are manual pages for
all of the available types: bge(4) in your case.  If you need more detail, look
at the boot-time dmesg output -- ie /var/run/dmesg.boot -- or you can extract
PCI ID numbers etc. using 'pciconf -lv'.  

If you're only seeing errors on the input side on bge0, that sounds like
a duplex mismatch to me.  What's the output of 'ifconfig bge0'?  If it
claims the connection is running at 100Mb/s half duplex then you've almost
certainly got a mismatch between switch and server -- one is trying to autoneg,
and the other is wired to a fixed speed.  Either set them both to autoneg, or
wire them both down.  (100Mb half duplex is the default setting a NIC will
use when it fails to negotiate correctly with a switch.)

Same sort of effect /can/ be caused by a dodgy patch lead, but I assume
that's one of the first things you'ld have swapped out in trying to debug this.

To tell exactly what the errors are you're going to need some more sophisticated
analysis tools than netstat(1).  tcpdump(1) and/or wireshark (from ports) are
probably your best bet.  If you don't want to put an X environment on your
FreeBSD box, then use 'tcpdump -i bge0 -s 0 -w /some/filename' to capture the
packet flows, then copy the file to another machine where you have wireshark
running.

Note that some modern NICs with hardware checksum offloading can give false
checksum errors on locally generated traffic -- essentially tcpdump grabs a copy
of the outgoing packet before the NIC can calculate the checksum and insert it.
This will only affect programs like tcpdump(1). It won't cause the error counters
netstat(1) reports to be incremented.  If you do see this sort of thing, then
you just need another machine you can do packet capture on to prove to yourself
that the checksums are correct over the wire.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
                                                  Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20081219/82ad0024/signature.pgp


More information about the freebsd-questions mailing list