Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Okay I was searching now for quite some time and I can't believe it. Is there no traceroute that shows me the hops on a world map? And maybe in a 64bit version

I found xtraceroute, grace, GTrace... but they are all a little bit rusty.

Maybe I'm just too stupid

Anybody knows something

share|improve this question

migrated from Oct 11 '10 at 7:34

This question came from our site for professional and enthusiast programmers.

Assuming there are freely downloadable GeoIP databases, free bindings for such databases for almost any programming language and libraries that allow to plot dots on a world map, you could try to implement your own visual traceroute. This is a great idea for a small project.

Edit: while this answer is more suitable for StackOverflow, here's a very raw visual traceroute app written in Python. While it works for me on Linux, it won't work for everyone, because it has a lot of drawbacks:

  • it uses quite a few third-party Python libraries, which need to be installed. You'll get Import Error if you don't have them
  • it doesn't bundle the world map image it uses [ I grabbed a free image from wikipedia :) ]
  • it doesn't bundle the geoip database it uses [ I'm using the free one from ]
  • it it is supposed to be run on Linux which has mtr installed
  • it uses hardcoded filenames for temporary files

Here is the code:

#!/usr/bin/env python

"""visual traceroute"""

import subprocess
import sys
import time

from PyQt4.QtCore import *
from PyQt4.QtGui import *

import pygeoip

import wugeo

GEOIPDB = "GeoLiteCity.dat"

class MyForm(QDialog):

    """Main app window"""

    def __init__(self, parent = None):


        super(MyForm, self).__init__(parent)
        self.setWindowTitle("Visual Route")
        self.image_label = QLabel(self)
        self.image_label.setMinimumSize(800, 600)
        self.ip_edit = QLineEdit(self)
        self.tr_button = QPushButton("Traceroute", parent=self)
        layout = QVBoxLayout()

        self.connect(self.tr_button, SIGNAL("clicked()"), self.traceroute)

    def load_image(self, file_name):

        """Loads an image"""

        image = QImage(file_name)

    def traceroute(self):

        """Do the traceroute thing"""

        ip = self.ip_edit.text()
        p = subprocess.Popen(["sudo", "/usr/sbin/mtr", "-n", "-c", "1",
            "--raw", ip], stdout=subprocess.PIPE)
        output = p.communicate()[0]
        lines = output.split("\n")
        ip_lines = lines[::2][:-1] # filter odds, skip last
        ips = [x.split()[2] for x in ip_lines]
        coords = self.get_coords(ips)

    def get_coords(ips):

        """Get coords using pygeoip"""

        coords = []
        geoip = pygeoip.GeoIP(GEOIPDB, pygeoip.MMAP_CACHE)
        for ip in ips:
            record = geoip.record_by_addr(ip)
            latitude = record["latitude"]
            longitude = record["longitude"]
            location = (latitude, longitude, 1, "red")

        return coords

    def draw_dots(self, coords):

        """Draws dots on the world map
           Uses temporary files (ugly!)"""

        infile = "map.jpg"
        outfile = "/tmp/outmap.jpg"
        for coord in coords:
            wugeo.geo_marker([coord], infile, outfile)
            infile = outfile

def main():

    """Main function"""

    app = QApplication(sys.argv)
    form = MyForm()

if __name__ == "__main__":
share|improve this answer

visualroute may have a linux version ? Not sure, google seems to say yes, their site seems like no. - Its shareware anyhow though.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .