Network Monitoring with Ethereal
February 13th, 2006 by Dean Wilson in
We all hope that our networks simply do what they are supposed to do, but often that is not the case. Two systems that should talk to each other don't; a network becomes saturated with traffic for no apparent reason; you need to know what some non-Linux device is doing. In these and other networking situations, Ethereal may be the tool that saves the day.
A few years ago I set up a a wireless link for a project. It was relatively slow--a real data throughput of around 300Kbps--but it easily should have handled the system's traffic. It should have, but in reality, the network seemed saturated much of the time. On paper, everything was fine. The link capacity was significantly more than the traffic--but that was on paper.
The switch talking to the master radio did have a lot of blinking lights, but watching blinking lights to measure traffic is about as accurate as using your tongue as a battery tester. Starting up Ethereal, however, quickly identified the problem. A whole bunch of computers running some other operating system were sending broadcast packets over the network for such exciting events as a computer being turned on or the paper supply in a printer becoming low.
Once I had the problem identified, it was easy to correct. I simply moved the radio traffic to a subnet away from the chatty operating system, and performance was fine.
Ethereal's man page offers this synopsis of what the program does: "Interactively browse network traffic". My use of Ethereal described above occurred in real time, but Ethereal uses the same file format as tcpdump. Therefore, you can use Ethereal to analyze an old dump file. Besides this libpcap format, Ethereal can read many other dump formats, including those from capture tools used on other operating systems--even the chatty ones.
As with virtually all protocol analyzers, Ethereal shows you a summary line for a packet and a hex dump. It also gives you the ability to drill down through the protocol tree. In addition, you can define filters to select and display specifically the data you are interested in. In short, Ethereal offers quite a few command-line options. Unless you want to plant Ethereal in a script, though, it is easier to set it up interactively to do what you want.
A word of warning: if you are monitoring live traffic for a system other than the one Ethereal is running on, make sure you are connecting to it at a point where you can see the traffic. Ethereal sets your local Ethernet interface to promiscuous mode, which means it sees all the traffic. If, however, your system is connected to an Ethernet switch, only the traffic for your system appears and is analyzed. You may need to "splice in" to the place you want to monitor using a hub.
Besides basic monitoring, Ethereal offers a lot of analyzing options. In my example at the start of this article, I could have used a filter to pull out the expected traffic. For example, adding tcp.port != 80 to the filter window and clicking the Apply button would have excluded any port 80 (HTTP) traffic from the display.
The Colorize Display option is handy as well. Select Colorize Display from the Display menu, and Ethereal guides you through the setup. The steps are simple:
You name your new entry and enter an expression. For example, ip.addr == 64.12.24.5 would select any packets whose "from" or "to" IP address is equal to 64.12.24.5. Don't worry, you don't have to memorize all of these choices; the Add Expression button offers a list of all the options.
Select a background color for the new rule.
Select a foreground color for the new rule.
Click Apply.
Click Save if you want Ethereal to remember your rules.
That's all there is to it. If you are displaying in real time, you will see the packets appear in color immediately. If you don't like a rule, simply go back and edit it in the same menu.
Copyright (c) 2004, Dean Wilson. Originally published in Linux Gazette issue 98. Copyright (c) 2004, Specialized Systems Consultants, Inc.
Subscribe now!
Recently Popular
| What happens after TV's mainframe era ends next February? | Jul-05-08 |
| Why Python? | May-01-00 |
| Building a Call Center with LTSP and Soft Phones | Aug-25-05 |
| An Open Video to HP | Jul-02-08 |
| Chapter 16: Ubuntu and Your iPod | Aug-30-06 |
| Time to school the FCC on what "free" really means | Jul-02-08 |
Featured Video
From the Magazine
July 2008, #171
Heard of the Web? If not, read on. This month we talk with Matt Mullenweg about WordPress. If you want to get your hands dirty in Web code, take a look at the rest of our feature articles on WebKit, Dojo and OpenLaszlo.
In the rest of the issue, you'll find articles on OpenID, RDFa and Quanta Plus.
Kyle Rankin puts a new spin (as in "no" spin SSD) on hard drives and
also tells you how to migrate to that new disk (spinning or not).
Mick Bauer continues his series on customizing live CD's.
And, James Gray gives us a feel for the state of Linux in the enterprise.
After all that, you may need some TV time. If so, check out our review
on how to make that digital TV tuner card work in your Linux box.
Delicious
Digg
Reddit
Newsvine
Technorati






how to see the traffic
On May 25th, 2006 jacobson (not verified) says:
there are two easy possibilities
- use a HUB (not a switch)
if the hub is dual-speed, ALL must work at the same speed
- use a switch with PORT MIRRORING.
you need a MANAGEABLE switch
most MANAGEABLE switch offer port mirroring (but check)
now, if the traffic is very high, you will miss some packets !
why ?
let suppose you work at 100Mbps full duplex
this means the appliance sends for nearly 100Mbps of data and
receives as much.
but then you have to send 100+100=200Mbps to the mirroring port
and that one only handles 100Mbps unless the mirroring port is
gigabit
happy sniffing
I have used datascopes and payware sniffers.
Ethereal offers close to the same services for a great price :-)
(some commercial product offer pass-through capturing interfaces)
German tutorial
On April 1st, 2006 ethereal networker (not verified) says:
On my homepage you can find a little ethereal tutorial in german.
Mirko
Love the metaphore
On March 23rd, 2006 Aaron Paxson (not verified) says:
A great synopsis of Ethereal. But I just can't get over that metaphore; "...watching blinking lights to measure traffic is about as accurate as using your tongue as a battery tester."
Killer way of explaining it!
Tip - how to examine HTTP headers from a dump
On February 16th, 2006 Mark Foster (not verified) says:
Recently I needed to capture and analyze HTTP headers, but was unable to discern from the ethereal man page how to do so. You have to click one of the packets you know is part of the transaction, then right-click and choose Follow TCP Stream.
Ethereal Capture Filters
On February 13th, 2006 Mike (not verified) says:
In addition to the information you have provided here the site listed below provides from very valuable information for creating capture filters.
http://home.insight.rr.com/procana/
Network monitoring
On August 15th, 2006 Victor (not verified) says:
Try this tool that run on Linux.
Intelica IP Intelligence - a TiVo for IP networks that provides complete visibility by recording and reporting all your network traffic. It call provides VoIP call monitoring and playback for all major RTP codecs.
For more info visit:
www.intelicanetworks.com
Network monitoring
On August 15th, 2006 Victor (not verified) says:
Try this tools that run on Linux.
Intelica IP Intelligence - a TiVo for IP networks that provides complete visibility by recording and reporting all your network traffic. It call provides VoIP call monitoring and playback for all major RTP codecs.
For more info visit:
www.intelicanetworks.com