logo Netzschleuder network catalog, repository, and centrifuge

History of caida_as

The changes to the source code of this entry in the repository, newest first, each with the differences it made to the entry's files. They are also listed on GitLab.

[entries] Fix parse bugs and improve descriptions and metadata by Tiago de Paula Peixoto 6bb6851
- parse fixes from the review of the descriptions, e.g. us_patents
  (directed), celegans_2019 (synapse direction), ecoli_transcription and
  yeast_transcription (regulator to target), bitcoin (direction, phantom
  node), ego_social (Google+ features and circles), scotus_majority,
  arxiv_authors and social_location (as in SNAP), caida_as, dnc, dom,
  mist, reuters and bibsonomy (names on the right nodes), uci_zoo
- every description now states explicitly what the nodes and edges
  represent; corrected titles, years, tags, citations and licences
- the "Hypergraph" tag is removed; very large entries are marked
  `huge = True` (see --skip-huge)
- ICON ids of partial duplicates added (hiv_transmission, congress_bills,
  openflights, dutch_school)
diff --git a/entries/caida_as/__init__.py b/entries/caida_as/__init__.py
index ffc737b..dd69143 100644
--- a/entries/caida_as/__init__.py
+++ b/entries/caida_as/__init__.py
@@ -19,13 +19,19 @@
 from .. import *
 
 title = "CAIDA AS graphs (2004-2007)"
-description = """A sequence of 122 network snapshots denoting Autonomous System (AS) relationships on the Internet, from 2004-2007, inferred using the Serial-1 method from RouteViews BGP table snapshots and a set of heuristics.[^icon]
-[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
+description = r"""A sequence of 122 snapshots of the network of relationships between Autonomous Systems (AS) of the Internet, from January 2004 to November 2007, from the CAIDA AS Relationships Dataset as compiled by J. Leskovec and collaborators. An autonomous system is a network or group of networks under a single administrative policy (such as an Internet service provider, university or company), and the AS graph describes which of them exchange traffic. Each snapshot is derived from a set of RouteViews BGP routing table snapshots, and the business relationship of each pair of connected ASes (customer–provider, peer–peer, or sibling, i.e. belonging to the same organization) was inferred by CAIDA with the Serial-1 method and a set of heuristics. Snapshots are approximately weekly in 2006 and later, and monthly before, and are named by their date (YYYYMMDD).
+
+Nodes are ASes, and an undirected edge connects two ASes that have a business relationship (i.e. exchange traffic), with one edge for each pair of connected ASes (the source lists each relationship in both directions).
+
+The networks have the following properties:
+
+- Nodes: `as_id`, the AS number.
+- Edges: `relationship`, the type of relationship, as seen from the source node of the edge: $-1$ (the source is a customer of the target), $0$ (peers) or $2$ (siblings). Customer–provider edges are always stored with the customer as the source node."""
 tags = ['Technological', 'Communication', 'Unweighted', 'Temporal']
 url = 'http://snap.stanford.edu/data/as-caida.html'
 citation = [('"The CAIDA AS Relationships Dataset"', 'http://www.caida.org/data/as-relationships/')]
 icon_hash = '56a85c8e26855e083a2f78a7'
-ustream_license = None
+upstream_license = None
 upstream_prefix = 'https://snap.stanford.edu/data'
 
 dates = ["20071112", "20071105", "20071029", "20071022", "20071015", "20071008",
@@ -68,9 +74,25 @@ def parse(alts=None):
         if isinstance(fnames, str):
             fnames = [fnames]
         with ExitStack() as stack:
-            fs = [stack.enter_context(open_upstream_file(name, fn, "rb")) for fn in fnames]
-            g = parse_graph(fs, fmt, directed=True)
-            g.vp.as_id = g.vertex_index.copy()
-            vs = [v for v in g.vertices() if v.in_degree() + v.out_degree() == 0]
-            g.remove_vertex(vs, fast=True)
+            fs = [stack.enter_context(open_upstream_file(name, fn, "r")) for fn in fnames]
+
+            # Each relationship is listed in both directions, with codes -1
+            # (customer of), 1 (provider of), 0 (peers) or 2 (siblings). Each
+            # relationship is kept once: customer-provider relationships from
+            # the customer's line (code -1), and the others from the line
+            # where the first AS has the smaller number.
+            def get_edges():
+                for line in fs[0]:
+                    if line.startswith("#"):
+                        continue
+                    u, v, r = [int(x) for x in line.split()]
+                    if r == -1 or (r in (0, 2) and u < v):
+                        yield u, v, r
+
+            g = Graph(directed=False)
+            g.ep.relationship = g.new_ep("int")
+            g.vp.as_id = g.add_edge_list(get_edges(), hashed=True,
+                                         hash_type="int",
+                                         eprops=[g.ep.relationship])
+            g = Graph(g, vorder=g.vp.as_id)
         yield alt, g
Update copyright information by Tiago de Paula Peixoto 73a4f0d
diff --git a/entries/caida_as/__init__.py b/entries/caida_as/__init__.py
index d40ae1e..ffc737b 100644
--- a/entries/caida_as/__init__.py
+++ b/entries/caida_as/__init__.py
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2020-2024 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2020-2026 Tiago de Paula Peixoto <tiago@skewed.de>
 #
 # This program is free software: you can redistribute it and/or modify it under
 # the terms of the GNU Affero General Public License as published by the Free
Update copyright information by Tiago de Paula Peixoto 3d288ea
diff --git a/entries/caida_as/__init__.py b/entries/caida_as/__init__.py
index 0910d77..d40ae1e 100644
--- a/entries/caida_as/__init__.py
+++ b/entries/caida_as/__init__.py
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2020-2023 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2020-2024 Tiago de Paula Peixoto <tiago@skewed.de>
 #
 # This program is free software: you can redistribute it and/or modify it under
 # the terms of the GNU Affero General Public License as published by the Free
Update copyright information by Tiago de Paula Peixoto 8d005ae
diff --git a/entries/caida_as/__init__.py b/entries/caida_as/__init__.py
index d67ba78..0910d77 100644
--- a/entries/caida_as/__init__.py
+++ b/entries/caida_as/__init__.py
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2021 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2020-2023 Tiago de Paula Peixoto <tiago@skewed.de>
 #
 # This program is free software: you can redistribute it and/or modify it under
 # the terms of the GNU Affero General Public License as published by the Free
Update copyright info by Tiago de Paula Peixoto db2efcc
diff --git a/entries/caida_as/__init__.py b/entries/caida_as/__init__.py
index ad41880..d67ba78 100644
--- a/entries/caida_as/__init__.py
+++ b/entries/caida_as/__init__.py
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2020 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2021 Tiago de Paula Peixoto <tiago@skewed.de>
 #
 # This program is free software: you can redistribute it and/or modify it under
 # the terms of the GNU Affero General Public License as published by the Free
Update citations to use DOIs by Tiago de Paula Peixoto e878874
diff --git a/entries/caida_as/__init__.py b/entries/caida_as/__init__.py
index d9baad8..ad41880 100644
--- a/entries/caida_as/__init__.py
+++ b/entries/caida_as/__init__.py
@@ -23,7 +23,7 @@ description = """A sequence of 122 network snapshots denoting Autonomous System
 [^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
 tags = ['Technological', 'Communication', 'Unweighted', 'Temporal']
 url = 'http://snap.stanford.edu/data/as-caida.html'
-citation = [('The CAIDA AS Relationships Dataset 2004-2007. http://www.caida.org/data/as-relationships/', 'http://www.caida.org/data/as-relationships/')]
+citation = [('"The CAIDA AS Relationships Dataset"', 'http://www.caida.org/data/as-relationships/')]
 icon_hash = '56a85c8e26855e083a2f78a7'
 ustream_license = None
 upstream_prefix = 'https://snap.stanford.edu/data'
Change license from GPLv3 to AGPLv3 by Tiago de Paula Peixoto d754be5
diff --git a/entries/caida_as/__init__.py b/entries/caida_as/__init__.py
index 06d3fb4..d9baad8 100644
--- a/entries/caida_as/__init__.py
+++ b/entries/caida_as/__init__.py
@@ -3,18 +3,18 @@
 #
 # Copyright (C) 2020 Tiago de Paula Peixoto <tiago@skewed.de>
 #
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# This program is free software: you can redistribute it and/or modify it under
+# the terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
 #
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
+# details.
 #
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU Affero General Public License along
+# with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 from .. import *
 
Add explicit attribution to descriptions obtained from ICON by Tiago de Paula Peixoto 1645314
diff --git a/entries/caida_as/__init__.py b/entries/caida_as/__init__.py
index 6b23179..06d3fb4 100644
--- a/entries/caida_as/__init__.py
+++ b/entries/caida_as/__init__.py
@@ -19,7 +19,8 @@
 from .. import *
 
 title = "CAIDA AS graphs (2004-2007)"
-description = "A sequence of 122 network snapshots denoting Autonomous System (AS) relationships on the Internet, from 2004-2007, inferred using the Serial-1 method from RouteViews BGP table snapshots and a set of heuristics."
+description = """A sequence of 122 network snapshots denoting Autonomous System (AS) relationships on the Internet, from 2004-2007, inferred using the Serial-1 method from RouteViews BGP table snapshots and a set of heuristics.[^icon]
+[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
 tags = ['Technological', 'Communication', 'Unweighted', 'Temporal']
 url = 'http://snap.stanford.edu/data/as-caida.html'
 citation = [('The CAIDA AS Relationships Dataset 2004-2007. http://www.caida.org/data/as-relationships/', 'http://www.caida.org/data/as-relationships/')]
Initial commit by Tiago de Paula Peixoto cc85872
diff --git a/entries/caida_as/__init__.py b/entries/caida_as/__init__.py
new file mode 100644
index 0000000..6b23179
--- /dev/null
+++ b/entries/caida_as/__init__.py
@@ -0,0 +1,75 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2020 Tiago de Paula Peixoto <tiago@skewed.de>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+from .. import *
+
+title = "CAIDA AS graphs (2004-2007)"
+description = "A sequence of 122 network snapshots denoting Autonomous System (AS) relationships on the Internet, from 2004-2007, inferred using the Serial-1 method from RouteViews BGP table snapshots and a set of heuristics."
+tags = ['Technological', 'Communication', 'Unweighted', 'Temporal']
+url = 'http://snap.stanford.edu/data/as-caida.html'
+citation = [('The CAIDA AS Relationships Dataset 2004-2007. http://www.caida.org/data/as-relationships/', 'http://www.caida.org/data/as-relationships/')]
+icon_hash = '56a85c8e26855e083a2f78a7'
+ustream_license = None
+upstream_prefix = 'https://snap.stanford.edu/data'
+
+dates = ["20071112", "20071105", "20071029", "20071022", "20071015", "20071008",
+         "20071001", "20070924", "20070917", "20070910", "20070903", "20070827",
+         "20070820", "20070813", "20070806", "20070730", "20070723", "20070716",
+         "20070709", "20070702", "20070625", "20070618", "20070611", "20070604",
+         "20070528", "20070521", "20070514", "20070507", "20070430", "20070423",
+         "20070416", "20070409", "20070402", "20070326", "20070319", "20070312",
+         "20070305", "20070226", "20070219", "20070212", "20070205", "20070129",
+         "20070122", "20070115", "20070108", "20070101", "20061225", "20061218",
+         "20061211", "20061204", "20061127", "20061120", "20061113", "20061106",
+         "20061030", "20061023", "20061016", "20061009", "20061002", "20060925",
+         "20060918", "20060911", "20060904", "20060828", "20060821", "20060814",
+         "20060807", "20060731", "20060724", "20060717", "20060710", "20060703",
+         "20060626", "20060619", "20060612", "20060605", "20060529", "20060522",
+         "20060515", "20060508", "20060501", "20060424", "20060417", "20060410",
+         "20060403", "20060327", "20060320", "20060313", "20060306", "20060227",
+         "20060220", "20060213", "20060206", "20060130", "20060123", "20060116",
+         "20060109", "20060102", "20051205", "20051107", "20051003", "20050905",
+         "20050801", "20050704", "20050606", "20050502", "20050404", "20050307",
+         "20050207", "20050103", "20041206", "20041101", "20041004", "20040906",
+         "20040802", "20040705", "20040607", "20040503", "20040405", "20040301",
+         "20040202", "20040105"]
+
+files = [(f"as-caida.tar.gz:as-caida{d}.txt" , d, "snap") for d in dates]
+
+def fetch_upstream(force=False):
+    return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
+                                force)
+
+@cache_network()
+@coerce_props()
+@annotate()
+def parse(alts=None):
+    global files
+    name = __name__.split(".")[-1]
+    for fnames, alt, fmt in files:
+        if alts is not None and alt not in alts:
+            continue
+        if isinstance(fnames, str):
+            fnames = [fnames]
+        with ExitStack() as stack:
+            fs = [stack.enter_context(open_upstream_file(name, fn, "rb")) for fn in fnames]
+            g = parse_graph(fs, fmt, directed=True)
+            g.vp.as_id = g.vertex_index.copy()
+            vs = [v for v in g.vertices() if v.in_degree() + v.out_degree() == 0]
+            g.remove_vertex(vs, fast=True)
+        yield alt, g