LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 12-09-2008, 05:32 AM   #1
Larry James
Member
 
Registered: Jun 2000
Location: Buffalo, New York
Distribution: Ubuntu, Raspbian
Posts: 381

Rep: Reputation: 40
How to display IP connection usage?


My system is being bogged down something fierce. Can someone tell me of a program that I can install that will allow me to monitor what IP address is soaking up the bandwidth?

Thanks in advance for any suggestions and comments on this matter.

-- L. James

--
L. D. James
ljames@apollo3.com
www.apollo3.com/~ljames
 
Old 12-09-2008, 05:37 AM   #2
jimbo1954
Member
 
Registered: Oct 2006
Location: High Wycombe, Bucks, UK.
Distribution: Debian and Fedora Core in equal measure
Posts: 264

Rep: Reputation: 33
Try Wireshark, it will let you watch what is happening interactively as it comes in.
 
Old 12-09-2008, 05:47 AM   #3
Larry James
Member
 
Registered: Jun 2000
Location: Buffalo, New York
Distribution: Ubuntu, Raspbian
Posts: 381

Original Poster
Rep: Reputation: 40
Thanks, Jimbo. I'll let you know how it works out.

-- L. James

--
L. D. James
ljames@apollo3.com
www.apollo3.com/~ljames
 
Old 12-09-2008, 10:16 PM   #4
Larry James
Member
 
Registered: Jun 2000
Location: Buffalo, New York
Distribution: Ubuntu, Raspbian
Posts: 381

Original Poster
Rep: Reputation: 40
Hi, Jimbo. Thanks again for the quick advice. The installation went smooth. I’m studying all the parameters. I don’t use GUI and couldn’t get the wireshark command to function. It complains about the gtk display (Gtk-WARNING **: cannot open display). First study gave me the tshark.

I’m still experimenting.

Would you have a quick method to type in a few commands and get the most active IP’s sorted to the top? Any suggestions you might have in helping me to get started with is appreciated. I’m sure I’ll be in for a long haul learning all the features. It looks like a very powerful utility.

Thanks again for sharing.

-- L. James

--
L. D. James
ljames@apollo3.com
www.apollo3.com/~ljames
 
Old 12-09-2008, 10:36 PM   #5
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
For a check of what is happening on your box for a 30 second window the following can be used:
Code:
tshark -i eth0 -a duration:30 -f "tcp and not port 22"
I told it to skip port 22 because I was connected to the box via SSH and didn't want that traffic cluttering the output. At the time I was connected to port 80 via telnet and had issued GET / HTTP1.1. The (incomplete) output was:
Code:
Capturing on eth0
  0.000000 192.168.1.50 -> 192.168.1.20 TCP 9498 > http [SYN] Seq=0 Win=64512 Len=0 MSS=1460
  0.000008 192.168.1.20 -> 192.168.1.50 TCP http > 9498 [SYN, ACK] Seq=0 Ack=1 Win=5840 Len=0 MSS=1460
  0.000161 192.168.1.50 -> 192.168.1.20 TCP 9498 > http [ACK] Seq=1 Ack=1 Win=64512 Len=0
  1.047246 192.168.1.50 -> 192.168.1.20 HTTP Continuation or non-HTTP traffic
  1.047281 192.168.1.20 -> 192.168.1.50 TCP http > 9498 [ACK] Seq=1 Ack=2 Win=5840 Len=0
  1.103207 192.168.1.50 -> 192.168.1.20 HTTP Continuation or non-HTTP traffic
  1.103221 192.168.1.20 -> 192.168.1.50 TCP http > 9498 [ACK] Seq=1 Ack=3 Win=5840 Len=0
  1.327248 192.168.1.50 -> 192.168.1.20 HTTP Continuation or non-HTTP traffic
  1.327260 192.168.1.20 -> 192.168.1.50 TCP http > 9498 [ACK] Seq=1 Ack=4 Win=5840 Len=0
  1.407230 192.168.1.50 -> 192.168.1.20 HTTP Continuation or non-HTTP traffic
  1.407243 192.168.1.20 -> 192.168.1.50 TCP http > 9498 [ACK] Seq=1 Ack=5 Win=5840 Len=0
  2.079248 192.168.1.50 -> 192.168.1.20 HTTP Continuation or non-HTTP traffic
  2.079275 192.168.1.20 -> 192.168.1.50 TCP http > 9498 [ACK] Seq=1 Ack=6 Win=5840 Len=0
  2.207250 192.168.1.50 -> 192.168.1.20 HTTP Continuation or non-HTTP traffic
  2.207277 192.168.1.20 -> 192.168.1.50 TCP http > 9498 [ACK] Seq=1 Ack=7 Win=5840 Len=0
  3.287279 192.168.1.50 -> 192.168.1.20 HTTP Continuation or non-HTTP traffic
  3.287330 192.168.1.20 -> 192.168.1.50 TCP http > 9498 [ACK] Seq=1 Ack=8 Win=5840 Len=0
  3.447203 192.168.1.50 -> 192.168.1.20 HTTP Continuation or non-HTTP traffic
  3.447234 192.168.1.20 -> 192.168.1.50 TCP http > 9498 [ACK] Seq=1 Ack=9 Win=5840 Len=0
  3.615184 192.168.1.50 -> 192.168.1.20 HTTP Continuation or non-HTTP traffic
  3.615212 192.168.1.20 -> 192.168.1.50 TCP http > 9498 [ACK] Seq=1 Ack=10 Win=5840 Len=0
  3.871262 192.168.1.50 -> 192.168.1.20 HTTP Continuation or non-HTTP traffic
  3.871290 192.168.1.20 -> 192.168.1.50 TCP http > 9498 [ACK] Seq=1 Ack=11 Win=5840 Len=0
  4.231223 192.168.1.50 -> 192.168.1.20 HTTP Continuation or non-HTTP traffic
  4.231254 192.168.1.20 -> 192.168.1.50 TCP http > 9498 [ACK] Seq=1 Ack=12 Win=5840 Len=0
  4.367261 192.168.1.50 -> 192.168.1.20 HTTP Continuation or non-HTTP traffic
  4.367287 192.168.1.20 -> 192.168.1.50 TCP http > 9498 [ACK] Seq=1 Ack=13 Win=5840 Len=0
  4.455340 192.168.1.50 -> 192.168.1.20 HTTP Continuation or non-HTTP traffic
  4.455363 192.168.1.20 -> 192.168.1.50 TCP http > 9498 [ACK] Seq=1 Ack=14 Win=5840 Len=0
  4.647215 192.168.1.50 -> 192.168.1.20 HTTP Continuation or non-HTTP traffic
  4.647243 192.168.1.20 -> 192.168.1.50 TCP http > 9498 [ACK] Seq=1 Ack=16 Win=5840 Len=0
31 packets captured
If you're not using X, but have ncurses installed I recommend iptstate. The screenshots page will give you an idea whether it will do what you want though.
 
Old 12-10-2008, 05:42 AM   #6
jimbo1954
Member
 
Registered: Oct 2006
Location: High Wycombe, Bucks, UK.
Distribution: Debian and Fedora Core in equal measure
Posts: 264

Rep: Reputation: 33
Whoops, Sorry Larry!

I made the unjustified assumption that you would have a GUI running, just because its my practice to do so even on my Servers. However, I see Gilead has come up with a better way of running wireshark for your environment, and iptstate looks more than a bit interesting, so we both benefited...Thanks Gilead
 
Old 12-10-2008, 10:38 AM   #7
Larry James
Member
 
Registered: Jun 2000
Location: Buffalo, New York
Distribution: Ubuntu, Raspbian
Posts: 381

Original Poster
Rep: Reputation: 40
Quote:
Originally Posted by jimbo1954 View Post
I made the unjustified assumption that you would have a GUI running, just because its my practice to do so even on my Servers. However, I see Gilead has come up with a better way of running wireshark for your environment, and iptstate looks more than a bit interesting, so we both benefited...Thanks Gilead
I had mentioned that I was running the tshark. My question was some type of parameter or method to sort the output in such a way as to display the IP's on top that's hogging the most bandwidth.

I guess if there isn't anything obvious that I'm missing, I will presume that the only way of knowing the amount of bandwidth going to an IP is to count the IP's and tally up the "len="'s. Almost all of the IP's are "0". My system get's bogged down a few times a day. I haven't caught it happening since the installation of the wireshark program (thought looking at the logs it did happen a couple of times for a few minutes at a time when I wasn't at the system.

I'm still at the drawing board. If there isn't any standard methods the people are already using to sort the output, then again, I'm continuing to study and figure things out with time.

By the way, I notice lots of input options that wireshark has. So, initially, I thought one would use tcpdump (or the tshark output), then use the utility to analyze it.

By the way, thanks Gilead for chiming in. When you use tshark, do you have some routine for sorting out the output?

-- L. James

--
L. D. James
ljames@apollo3.com
www.apollo3.com/~ljames
 
Old 12-10-2008, 01:21 PM   #8
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
I usually use iptstate for that sort of output. Below is a sample output. The B column is bytes and the P column is packets:
Code:
                                                  IPTState - IPTables State Top
Version: 2.2.1        Sort: SrcIP           b: change sorting   h: help
Source                                         Destination                                   Proto State       TTL       B     P
62.162.62.141:11837                            203.211.113.8:25                              tcp   SYN_RECV      0:00:46 48    1
62.162.62.141:11838                            203.211.113.8:25                              tcp   SYN_RECV      0:00:49 48    1
94.50.85.109:4412                              203.211.113.8:80                              tcp   ESTABLISHED 114:34:09 204   4
116.71.20.6:2674                               203.211.113.8:80                              tcp   ESTABLISHED  97:19:16 200   4
119.30.103.187:4469                            203.211.113.8:80                              tcp   ESTABLISHED 109:58:01 200   4
119.30.110.116:4542                            203.211.113.8:80                              tcp   ESTABLISHED 112:06:50 200   4
192.168.0.20:55005                             192.168.0.20:993                              tcp   ESTABLISHED 119:59:29 1884  24
192.168.0.20:54999                             192.168.0.20:993                              tcp   ESTABLISHED 119:59:25 8537  102
192.168.0.20:55000                             192.168.0.20:993                              tcp   ESTABLISHED 119:59:25 8567  103
192.168.0.20:55003                             192.168.0.20:993                              tcp   ESTABLISHED 119:59:31 7279  94
192.168.0.20:55004                             192.168.0.20:993                              tcp   ESTABLISHED 119:59:31 6846  89
192.168.0.20:12299                             192.168.0.20:993                              tcp   ESTABLISHED 119:59:24 12695 177
192.168.0.20:12298                             192.168.0.20:993                              tcp   ESTABLISHED 119:59:30 13155 184
192.168.0.20:55002                             192.168.0.20:993                              tcp   ESTABLISHED 119:59:24 2163  27
192.168.0.20:55006                             192.168.0.20:993                              tcp   ESTABLISHED 119:59:29 2243  29
192.168.0.20:55001                             192.168.0.20:993                              tcp   ESTABLISHED 119:59:24 2163  27
 
Old 12-10-2008, 01:47 PM   #9
malaprop
LQ Newbie
 
Registered: Dec 2008
Location: TX
Distribution: Ubuntu 8.10
Posts: 26

Rep: Reputation: 16
Check out "iftop"

It'll give you a display (in terminal) of the bandwidth usage.
I think it'll do exactly what you're looking for.
 
Old 12-11-2008, 02:14 AM   #10
jimbo1954
Member
 
Registered: Oct 2006
Location: High Wycombe, Bucks, UK.
Distribution: Debian and Fedora Core in equal measure
Posts: 264

Rep: Reputation: 33
Could be a broadcast storm...

Quote:
Originally Posted by Larry James View Post
Almost all of the IP's are "0".
The IP Addresses in the packet (source and destination) should be real addresses in the majority. If you are seeing lots of IP addresses set to "0", this could indicate excessive broadcast activity, either from a broken NIC, a mis-configured interface, or possibly malware activity
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
c++ - how to find memory footprint of a GL display list (or mem usage on a GPU)? BrianK Programming 3 03-17-2008 01:14 PM
Memory usage display problem swaroop.tata Linux - General 1 01-18-2006 01:38 PM
what's the usage of variable DISPLAY? hongxing Linux - Software 3 12-02-2005 11:31 PM
CPU usage display? phsythax Linux - Software 6 11-03-2005 07:15 AM
how to determine cpu usage, memory usage, I/O usage by a particular user logged on li rags2k Programming 4 08-21-2004 04:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 12:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration