Bandwidth is essential for all of us, if its not enough or over used then it will be a problem. Thats mean you need a network monitoring tools to keep an eye of. There’s a simple tool to diagnose TCP and UDP connection issues in real time. There are two that I have found that work very well for this type of debugging.
IPTraf is a console-based network statistics utility for Linux. It gathers a variety of figures such as TCP connection packet and byte counts, interface statistics and activity indicators, TCP/UDP traffic breakdowns, and LAN station packet and byte counts.
# An IP traffic monitor that shows information on the IP traffic passing over your network. Includes TCP flag information, packet and byte counts, ICMP details, OSPF packet types.
# General and detailed interface statistics showing IP, TCP, UDP, ICMP, non-IP and other IP packet counts, IP checksum errors, interface activity, packet size counts.
# A TCP and UDP service monitor showing counts of incoming and outgoing packets for common TCP and UDP application ports
# A LAN statistics module that discovers active hosts and shows statistics showing the data activity on them
# TCP, UDP, and other protocol display filters, allowing you to view only traffic you’re interested in.
# Supports Ethernet, FDDI, ISDN, SLIP, PPP, and loopback interface types.
# Utilizes the built-in raw socket interface of the Linux kernel, allowing it to be used over a wide range of supported network cards.
# Full-screen, menu-driven operation.
IPTraf which is a IP LAN monitor that generates various network statistics including TCP info, UDP counts, ICMP and OSPF information, Ethernet load info, and IP checksum errors. Type below command to install:
$ yum install iptraf
$ sudo apt-get install iptraf
Once installed, executing IPTraf from the command line will launch an ascii based menu system that will allow you to view IP traffic counts, detailed interface statistics, and protocol breakdowns per physical interface.
One nice feature of iftop is each flow represented as a bargraph relative to each flow’s utilization. This allows you to quickly identify a connection using a large amount of bandwidth. Type below command to install:
$ yum install iftop
$ sudo apt-get install iftop
If you have others network interface, you can use command like:
$ iftop -i eth1
These tools are very useful to provide you a glimpse into what types of traffic are flowing right now. I often use these tools to look at a server’s current bandwidth utilization, top flows by source and destination, and protocol breakdowns~