{"id":2343,"date":"2008-06-22T19:39:40","date_gmt":"2008-06-22T17:39:40","guid":{"rendered":"http:\/\/vasil.ludost.net\/blog\/?p=2343"},"modified":"2008-06-22T19:39:40","modified_gmt":"2008-06-22T17:39:40","slug":"2008-06-22-bgp-data-and-connections","status":"publish","type":"post","link":"https:\/\/vasil.ludost.net\/blog\/?p=2343","title":{"rendered":"2008-06-22 bgp data and connections"},"content":{"rendered":"<p>Small and useful thing, could get included in some of the courses:<\/p>\n<p>Let&#8217;s say you&#8217;re interested in the connections of an ISP &#8211; how many different transit providers it uses. For this tools and data from the <a href=\"http:\/\/www.ripe.net\/projects\/ris\/index.html\">RIS project<\/a> of RIPE are used.<\/p>\n<p>The first thing needed is to download the dump of the whole BGP routing table of some peer of the RIS project from the <a href=\"http:\/\/www.ripe.net\/projects\/ris\/rawdata.html\">rawdata archive<\/a> &#8211; I&#8217;m using the data from LINX because there&#8217;s the biggest number of peers and the view should be the best possible (in theory this could be done with the data from all 15 places, but I felt lazy).<\/p>\n<p>The second is <a href=\"http:\/\/www.ris.ripe.net\/source\/\">libbgpupdate<\/a>, to be able to understand the downloaded data. There&#8217;s a tool in the package, bgpdump, that can get the data from the rawdata stuff. Here&#8217;s one entry:<\/p>\n<pre>\r\nTIME: 06\/01\/08 07:59:54\r\nTYPE: TABLE_DUMP_V2\/IPV4_UNICAST\r\nPREFIX: 4.0.0.0\/8\r\nSEQUENCE: 2\r\nFROM: 195.66.224.54 AS286\r\nORIGINATED: 05\/29\/08 03:29:13\r\nORIGIN: IGP\r\nASPATH: 286 3549 3356\r\nNEXT_HOP: 195.66.224.54\r\nATOMIC_AGGREGATE\r\nAGGREGATOR: AS3356 4.69.130.82\r\n<\/pre>\n<p>We&#8217;re interested in the ASPATH. So for 8866 (BTC) we run the following:<\/p>\n<pre>\r\n.\/bgpdump  ~\/bview.20080601.0759 |grep 'ASPATH.* 8866$' |sed 's\/8866 8866\/8866\/g;s\/8866 8866\/8866\/g ' |sed 's\/.* \\([0-9]*\\) 8866$\/AS\\1\/'|sort|uniq\r\n<\/pre>\n<p>So what this does is to filter all the ASPATHs that end with this AS, and to remove everything prepended and get the previous autonomous system. The result looks like this:<\/p>\n<pre>\r\nAS1299\r\nAS3549\r\nAS6453\r\nAS702\r\nAS8400\r\nAS9050\r\n<\/pre>\n<p>If you add to it this<\/p>\n<pre> \r\n|xargs -n1 whois -h whois.ripe.net |grep as-name\r\n<\/pre>\n<p>the result will be this:<\/p>\n<pre>\r\nas-name:        TELIANET\r\nas-name:      GBLX\r\nas-name:        GLOBEINTERNET\r\nas-name:        AS702\r\nas-name:        TELEKOM-AS\r\nas-name:        RTD\r\n<\/pre>\n<p>Of course, this isn&#8217;t perfect &#8211; it&#8217;s possible that in this exact moment some announcement might have been withdrawn, etc., but the check in two separate dates should give pretty decent information.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Small and useful thing, could get included in some of the courses: Let&#8217;s say you&#8217;re interested in the connections of an ISP &#8211; how many different transit providers it uses. For this tools and data from the RIS project of RIPE are used. The first thing needed is to download the dump of the whole [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2343","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2343","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2343"}],"version-history":[{"count":0,"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2343\/revisions"}],"wp:attachment":[{"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2343"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2343"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2343"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}