Network Monitoring with Ethereal

If you're familiar with network analysis tools but still haven't taken Ethereal for a spin, here's a quick look at what it can do.

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.

Dean Wilson is a system administrator and occasional updater of his Web pages.

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

how to see the traffic

jacobson's picture

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

ethereal networker's picture

On my homepage you can find a little ethereal tutorial in german.

Mirko

Love the metaphore

Aaron Paxson's picture

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!

The switch talking to the

Cristiano's picture

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.

Tip - how to examine HTTP headers from a dump

Mark Foster's picture

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.

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix