Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


The public suffix library can be found here:

The ITDK can be found mounted at /data/topology/ITDK on apollo. You want to use the
midar-iff.nodes.bz2 and midar-run-20140421-dns-names.txt.bz2 files. 

midar-iff.nodes.bz2 - lists the sets of IP addresses which belong to each router
    format: node N<node id>: <ip0> <ip1> ...

    Each lines indicates that a node node_id has interfaces i_1 to i_n.
    Interface addresses in (IANA reserved space for multicast)
    are not real addresses.  They were artificially generated to identify
    potentially unique non-responding interfaces in traceroute paths. Since
    these placeholder IP addresses do not have hostnames, they aren't so 
    important to you.

       NOTE: In ITDK release 2013-04 and earlier, we used addresses in
    instead of for these non-real addresses.
midar-run-20140421-dns-names.txt.bz2 - map between
    format:<timestamp>    <ip> <hostname>
    Hostnames * should be ignored. These show that no hostname
    was found.

Project: Router Naming

High level goal: Given a set of IP addresses, determine which belong to the same router.

Samle application: Determine which IPv4 and IPv6 addresses belong to the same router/host.

Data sets: provided on's MIDAR project (
- Node file (midar-iff.nodes)
	This file contains a series of node ids along with their associated traced IPs. All IP addresses mapped to the same node ID are suggested to be on the same router.
- Host file (midar-run-20140421-dns-names.txt)
	This file contains a series of timestamps and IP addresses mapped to their respective hostnames. The timestamps will be ignored while studying the data and the hostnames will be 'sanitized' using a library called publicsuffix ( 

1. Extract data
- Related files:, midar-iff.nodes, midar-run-20140421-dns-names.txt
	A. Runs through the hostfile and creates a mapping of IP addresses to their respective hostnames
	B. Runs through the nodefile and for each node ID:
		- runs through this node's list of associated IP addresses and for each of these IP addresses:
			- insert into a sqlite3 database a relation called NodeHost with the following schema 
			IP address | hostname (sanitized with publicsuffix) | hostname (original) | node ID | node ID (int)
		- insert into a sqlite3 database a relation called NodeDegree with the following schema
		# of IP addresses on this node | # of IP addresses that are also in the mapping in A. | node ID | node ID (int)
	C. The resulting database is called router-naming.db

2. Determine most quality data to further examine
- Related files:, router-naming.db
	A. Runs through the database and count the frequencies of each hostnames
	B. Map these hostnames to their frequencies and sort by descending frequencies. Output this list of most popular hostnames (note that this only needs to be run once after the list is obtained)
	C. From the list of most popular hostnames, runs through the database and retrive all record that correspond to the selected hostname. The query needs to be modified everytime a different hostname input changes. Output into a text file for further examination.
	Ex: find all records for
	Change the SQL query to only look for records whose public suffix is ''
	python > yahoo.txt

3. Derive regex from quality data
- Related files:, *.txt
- This is the primary challenge of this project. For each host, study the naming convention of the hostnames and attempt to derive a regular expression that matches with such a convention. The ultimate goal is a set of good regular expressions that could take any set of unknown IP addresses and determine which originate from the same router. 
	A. Reads in the data text files to study
	B. Come up with a regular expression to match the naming convention. The regular expression(s) should be able to capture as many hostnames of the same host as possible and also distinguish those hostnames that originate from the same router. 

	This is validated by deriving a router ID from the regular expression. Router ID should be unique to a router; all of the interfaces on the same routers should have the same router ID. 
	C. Creates 4 mappings:
		- Router ID to Node ID (rid_nid), obtained after running the regex on the original data
		- Node ID to Router ID (nid_rid), obtained after running the regex on the original data
		- Node ID to host count original (count how many hostnames this Node ID has in the original data)
		- Node ID to host count from supposed regex (count how many hostnames this Node ID has as a result of the reg ex)
	D. Validate the quality of regular expression by counting the following:
		- Perfect: when # of hostnames count from original data equals # of hostnames count from supposed regex for the same Node ID
                - Partial: when # of hostnames count from original data less than # of hostnames count from supposed regex for the same Node ID
		- Missed: when node ID has no routers associated with it (nid_rid[key] == 0)
		- Mixed: when a router ID is mapped to more than one Node ID
		- Split: when a Node ID is mapped to more than one Router ID
		- No router: when a router ID is not mapped to any Node ID
		- Accuracy: perfect / (perfect + partial + missed + mixed + split + no router)

4. Observations from data examnination (93.1%):
- There are obvious inconsistency in the naming convention on several nodes. This causes a a good amount of split and partial errors. 
It is clear that the last interface's hostname doesn't correspond to the naming convention for the majority of the other interfaces. This is usally due to an unupdated interface for this router. I have decided to ignore these cases since there is not likely a regex that could take care of these irregular hostnames. In addition, when cases like this happen, it is often easy to identify the obsolete interface (usually the only different interface). (84.92%):
- There are a few unknowns hostnames for about 27 routers. This causes the partial error to be relatively high. I haven't decided whether to ignore these in the validation process. 
The regular expression can match all of these hostnames, but the router ID for the latter two will be (clr2-a-sat, ne1) and for the unknown will be (98, 138). This happens throughout the dataset, dropping accuracy by a good amount. Next step is to try to ignore these unknowns to see if a better result could be obtained. (77%):
- Working on this. (99.47%):
- Host with best result. The only partial error observed is most likely due to an unupdated naming convention in the dataset.


No description, website, or topics provided.



No releases published


No packages published


You can’t perform that action at this time.