oreilly.comSafari Books Online.Conferences.


Creating Network Diagrams
Pages: 1, 2


Copyright: Juergen Schoenwaelder
License: BSD-like
Version: 1.5.0
Available at:

Tkined is the only open-source software package I'm aware of that was specifically designed for drawing network diagrams. While its user interface looks a little dated and old fashioned, Tkined is quite easy to use. Typically Tkined comes packaged with Scotty which is a set of very useful tools that can be invoked from within Tkined to provide a wide range of network-related automation for diagrams. We'll talk more about Scotty in a moment.

Tkined comes with a generous library of network-device type icons. To my eye many of them look a little obscure or dated, but it's a relatively simple process to add or edit icons should you wish to, so no real cause for complaint there. Again the process isn't documented and there is a small trick to be aware of. Each of the graphic icons is comprised of two X bitmaps (.xbm). The first is simply the black and white image that you wish to display in your diagrams. The second is a black and white image of precisely the same overall dimensions as the first, that is used to act as a mask when determining how to handle overlap. The mask will usually be a solid filled version of the first image. Take a look at the examples supplied with tkined for more explanation.

A snapshot of Tkined and a simple drawing.
Figure 3. A snapshot of Tkined and a simple drawing.

Export formats are quite limited with Tkined. You really only have a choice of PostScript or "TNM Map" formats. PostScript, of course, is ideal for printing purposes, so that's useful. TNM Map is a format native to a particular TCL language library that Scotty uses. I don't know anything more about them than that so at least for me they're not useful at all.

Tkined was designed for network diagramming purposes and therefore provides direct support for the idea of grouping of network elements into single symbols on a diagram. It is possible for example, to develop a diagram that provides a high-level view of an IP wide-area network that has cloud symbols representing a sub-network or geographical area. When you double-click on these symbols tkined will replace the symbol with another level of detail so you can "zoom-in" on the diagram on a particular area of interest. All of the detail is stored in a single Tkined drawing file which is very convenient. One shortcoming in the approach Tkined takes is that the exploded view simply replaces the original icon on the same diagram -- there is no concept of layers, or different views. To prepare an appropriately detailed diagram, it is first necessary to arrange all symbols with no grouping at all, and then to apply grouping later. This is the only reasonable way of ensuring there will be no overlap on the diagram after a group, or groups have been expanded.

One of the most powerful features of Tkined is the ease with which its functionality may be extended. Tkined was written using the TCL language and has been designed with extensibility in mind. A software package called Scotty illustrates this very effectively. Scotty provides a suite of network management tools including comprehensive SNMP support, IP, DNS, and other diagnostic tools and tools that automate the layout of network diagrams. Dynamic elements such as graphs of particular SNMP variables may be included on network diagrams. For small- to medium-sized networks Scotty can be quite a boon. Bringing network diagramming and network monitoring functions together can make for a simple but effective management solution.

To some extent, the automation features of Tkined obviate the need for an easily manipulated native file format as you can write a TCL module to export or import diagrams in whatever format you like. Despite this, the Tkined native file format (.tki) is very easy to understand. It's a plain ASCII format that again isn't well documented, but examining the syntax of a few simple examples will tell you most of what you need to know with little effort.


Copyright: Supoj Sutanthavibul, Brian V. Smith, Paul King
License: BSD-like
Version: 3.2.3a
Available at:

The Xfig drawing package is a general-purpose vector drawing package. Its interface provides all the sorts of features I think are important for network diagramming packages including a "Smart Links" features which allows lines/links between symbols to be move when either symbol moves. The Xfig interface is clean and easy to learn once you become accustomed to the lack of a "select" tool; each tool has an built-in select function.

There are a good supply of drawing symbols supplied with the Xfig package, but the network icons seem better suited to presentation graphics rather than network diagrams. Nevertheless you can create and use your own. The library symbols are easily generated, they're simply Xfig drawings stored in a relevant subdirectory of a Xfig library directory.

A grab of Xfig showing part of the tool menu and a diagram.
Figure 4. A grab of Xfig showing part of the tool menu and a diagram.

A wide range of export formats are supported. Just about everything you could need is there including PostScript, HPGL, JPEG, GIF, and HTML imagemap. Some external programs are required to support some formats, but they're neatly integrated.

There is no support for hierarchically structured diagrams that I could find, but Xfig does support layered diagrams, so you could perhaps achieve a similar effect by placing each diagram at a different layer and simply turning or off the layers that you're interested in.

The Xfig native file format is documented! Some text files included in the source distribution describe the file format, and differences between each of the many versions of Xfig (the file format has changed a number of times as new features have been added). Xfig files are a plain-text format that will be very easy to manipulate and write, but would be very difficult to understand without a reference handy. Additionally the Xfig file format is pretty well supported by a number of other third-party applications including Gnuplot which can export graphs into Xfig diagrams.

How do they rate?

The following table summarizes my assessment of how well each of the packages meets the needs of a network diagram package.

All of these packages are readily available so the rule of thumb should be: If in doubt, try it out.

Package OO Interface Icon Library Export Hierarchical Views Open Format Rating
Dia 9 6 3 0 8 26
Tgif 3 1 8 8 7 27
Tkined 8 8 3 7 7 33
Xfig 9 7 9 5 9 39

My picks are Xfig and Tkined, but you should take a look at the others too. It's easy enough to try different tools, so use the one that best suits your needs. If you find a package that you think does a better job than the packages described here, please let me know.

If you want to assist any of the software projects described in this column, a good place to start if you're graphically inclined might be to contribute a set of symbols for the libraries to the source distribution.

Terry Dawson is the author of a number of network-related HOWTO documents for the Linux Documentation Project, a co-author of the 2nd edition of O'Reilly's Linux Network Administrators Guide, and is an active participant in a number of other Linux projects.

Read more Linux Network Administration columns.

Discuss this article in the O'Reilly Network Linux Forum.

Return to the Linux DevCenter.

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: