{"id":4668,"date":"2025-10-12T16:53:22","date_gmt":"2025-10-12T16:53:22","guid":{"rendered":"https:\/\/geekmungus.co.uk\/?p=4668"},"modified":"2025-10-12T16:53:22","modified_gmt":"2025-10-12T16:53:22","slug":"bgp-as-number-conversion","status":"publish","type":"post","link":"https:\/\/geekmungus.co.uk\/?p=4668","title":{"rendered":"BGP AS Number Conversion"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">An Autonomous System Number (ASN) uniquely identifies a network or group of IP prefixes under a single administrative control that uses BGP to exchange routing information with other networks.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Each ASN is used to tag routes in BGP so that routers can make loop-prevention and policy decisions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When two networks peer, they exchange routes with their ASN attached.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Originally, ASNs were <strong>16-bit values<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Range: <strong>1 \u2013 65,535<\/strong><\/li>\n\n\n\n<li>Example: <code>AS64512<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Later, to handle growth, the IETF expanded ASNs to <strong>32-bit values<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Range: <strong>1 \u2013 4,294,967,295<\/strong><\/li>\n\n\n\n<li>Example: <code>AS65538<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">ASN Conversion Cheat Sheet (Asplain \u2194 Asdot)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">So let&#8217;s start with ASDot -> ASplain:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>64700.1 (ASDot -> Asplain)\n(64700 x 65536) + 1 = 4240179201<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">We have 65536 because that is the maximum number of values.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next let&#8217;s look at ASplain -> ASDot:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>4240179201 (Asplain -> ASDot)\n4240179201 \u00f7 65536 = 64700\n4240179201 mod 65536 = 1\n= 64700.1<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>An Autonomous System Number (ASN) uniquely identifies a network or group of IP prefixes under a single administrative control that uses BGP to exchange routing information with other networks. Each ASN is used to tag routes in BGP so that routers can make loop-prevention and policy decisions. When two networks peer, they exchange routes with &#8230; <a title=\"BGP AS Number Conversion\" class=\"read-more\" href=\"https:\/\/geekmungus.co.uk\/?p=4668\" aria-label=\"Read more about BGP AS Number Conversion\">Read more<\/a><\/p>\n","protected":false},"author":4,"featured_media":4390,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-4668","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-networking"],"_links":{"self":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4668","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4668"}],"version-history":[{"count":1,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4668\/revisions"}],"predecessor-version":[{"id":4669,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4668\/revisions\/4669"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/media\/4390"}],"wp:attachment":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4668"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4668"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4668"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}