oreilly.comSafari Books Online.Conferences.


Linux Network Administration

Creating Network Diagrams


The complexity of network administration increases with the size of the network being managed. It's relatively easy to keep a good deal of information about a small network in your head, but when your network grows in size beyond about six routers or so, it makes good sense to maintain documentation that describes it.

The most important piece of network documentation is the network diagram. It is possible to capture a wide variety of important information on a diagram including the topology of the network, network device types, assigned network addresses, names of routers and important hosts, physical location of hosts and network equipment, contact telephone numbers, and on and on.

As a diagnostic resource the network diagram is essential. So I thought this month I'd take a quick look at some useful open-source tools available for Linux that will allow you to create and maintain useful network diagrams.

Things to look for in network diagramming tools

Also in Linux Network Administration

Dynamic Address Assignment

Exploring the /proc/net/ Directory

Building High Performance Linux Routers

Traffic Shaping

What is a Network Administrator Anyway?

If you're in a hurry you can use any sort of drawing package to produce network diagrams, but if you're going to be keeping them up to date, there are a few features that I believe are pretty much essential. I'm not a graphics wizard so the descriptions are simple and I hope the purists will forgive any terminology errors.

  • Icon or graphic symbol library
    You'll want a standard way of representing different classes of entities on your diagram. Ideally you'll want the ability to modify existing images and to add images you've created yourself. You might for example want a standard symbol that represents an IP router, but also want to be able to differentiate a Linux-based router from a Cisco router from a Lucent router.

  • Object-based interface
    This allows you to do things such as connect router icons with network icons and attach descriptive text that stays with an icon as you move it. You will want to be able to easily move items around on your diagram without losing their associations in order to rearrange the layout of your diagram easily.

  • Export to graphic file or printer
    A diagram is useless if you can't consume it. You must be able to print the diagram legibly to paper, and be able to export it to a common image format such as PNG, JPEG, or GIF if you wish to publish the diagram electronically.

  • Hierarchical or embedded views
    It's convenient to be able to embed diagrams within diagrams and have some means of switching from one diagram to another, double-clicking on an icon for example. This saves you from being forced to maintain multiple image files that all relate to the same network and helps ensure some consistency among diagrams.

  • Well-documented diagram file format
    You may want to generate your diagrams programmatically. For example, you might wish to read device and interface data from an SNMP data-collector and generate network diagrams directly from it. In the same way you may want to use the drawing package as a means of data input, perhaps generating configuration data directly from a diagram where it was initially input. You will need to understand the image format and have it be convenient to work with. A well-documented plain-text format can make it easy to develop scripts to process the image file data.

What's out there?

I've selected four common packages that are each reasonable choices for network diagramming purposes. While packages like GIMP are wonderful, they're designed for a completely different purpose and so it wouldn't be fair to include them.

I'll describe each in alphabetical order and then assess their relative merits for our network diagramming task.

While I've included URLs from where you can obtain the software, most of this software will be available in pre-packaged form from any modern Linux distribution, so check there first.


Copyright: Alexander Larsson, James Henstridge,
License: GPL
Version: 0.83
Available at:

Dia is a nicely presented drawing program designed to simplify the task of preparing a variety of different types of diagrams including UML, entity relationship, flowchart, electronic circuit, and network diagrams.

The user interface is well designed, iconic in nature and makes Dia very easy to use. It comes with a limited library of network diagram shapes, but you'll almost certainly want to add your own. Fortunately this is possible as Dia implements a means of adding new shapes to the library using XML encoded SVG, the Scalable Vector Graphic format. Dia shapes support connection points enabling the convenient drag-to-rearrange-diagram capability. The process for adding shapes isn't documented, but I worked out how to do it after about 20 minutes of poking around.

Probably the biggest weaknesses of Dia are its export formats and its lack of support for encapsulated diagrams. You can export to Computer Graphics Metaformat (CGM), Scalable Vector Graphics (SVG), Encapsulated PostScript, or the Dia native file format, but you cannot export to GIF, PNG, or JPG file formats. I suppose there are tools available to convert CGM or SVG into something more common but I haven't found any.

At first glance Dia diagram files look to be in a binary format, but there is a simple trick being played out here. The .dia files that Dia creates are compressed with gzip. If you uncompress them you'll find they're actually XML encoded plain-text files. This makes them particularly easy to read, interpret, and generate.

The Dia tool window showing some Network shapes
Figure 1. The Dia tool window showing some network shapes.


Copyright: William Chia-Wei Cheng
License: BSD-like
Version: 4.1.34
Available at:

The Tgif drawing program has some unique and interesting features that make it useful for network diagrams. The diagrams created are vector-based allowing smooth scaling, and the interface is object-based, providing the ability to build composite group objects but lacking any notion of connection points so rearranging diagrams can be a little laborious if you have lots of links.

There are no icons or drawing symbols provided with Tgif by default but unlike most of the other packages described you can create new symbols and store them in a library from within the Tgif application. This makes it quite quick and easy to develop your own symbol set. The symbols in Figure 2 are some that I created in about 15 minutes of playing (and probably look like it too!).

A snapshot of Tgif and a simple drawing.
Figure 2. A snapshot of Tgif and a simple drawing.

Tgif provides direct export capability to a number of useful and common formats including encapsulated PostScript, PNG, GIF, JPEG, and even to HTML imagemaps. Printing direct to printer is supported.

One of the real strengths of Tgif as compared to other packages described in this column is that of hierarchical view. Tgif provides very powerful and flexible mechanisms with which to build complex navigable diagrams. You could for example provide a high-level network diagram that shows a whole wide area network with icons representing each site or building. A middle-click on the mouse on any of these icons could change your view to that of a detailed view of the network of just that site. It is possible to use Tgif directly as a browser capable of navigating network accessible diagrams. You can pass Tgif a URL when you launch it, and it will retrieve the diagram at that location and move from diagram to diagram in the same way you'd move from web page to web page.

It is possible to add automation to your diagrams, such that a middle-click on an symbol in your diagram can launch a command. Each symbol in a Tgif diagram may have text attributes attached and these may be passed automatically as command-line arguments to the launched program.

The native Tgif file format is plain-text and looks pretty easy to understand. Although the syntax of the file isn't well documented, with appropriate reference to the source code and some simple sample files, you can work most of it out.

Pages: 1, 2

Next Pagearrow

Linux Online Certification

Linux/Unix System Administration Certificate Series
Linux/Unix System Administration Certificate Series — This course series targets both beginning and intermediate Linux/Unix users who want to acquire advanced system administration skills, and to back those skills up with a Certificate from the University of Illinois Office of Continuing Education.

Enroll today!

Linux Resources
  • Linux Online
  • The Linux FAQ
  • Linux Kernel Archives
  • Kernel Traffic

  • Sponsored by: