I know that Autonomous Systems (ASes) used to be identified with a 16 bit number. It wasn't enough, so 32-bit ASNs were introduced.

The BGP routing table of BGP border router contains the IP address of the destination network and a series of numbers of ASes the packet will go through, starting from that router, in order to reach destination network.

If the BGP router R1 doesn't support 32-bit AS numbers, it will be represented as 23456 in the AS Path. Okay, but what if R1 is connected to multiple 32-bit ASes? If both are represented by the same number, 23456, how does it differentiate between them? It can't know where to send the packet because two distinct ASes have the same number in its routing table.

I think there's a new attribute, AS4_Path, ignored by 16-bit ASN-compatible BGP routers, that 32-bit routers take into account (brief explanation). But it doesn't explain how 16-bit ASN-compatible routers know the right way.

1 Answer 1


The number of hops is preserved, even if all the hops in the AS_PATH are all AS23456. Path prepending with the same AS number prepended is used to influence traffic all the time.

BGP will still send the traffic toward the neighbor with preferred route based on how it was configured, and, normally, the number of AS hops will determine the direction to send the traffic. It doesn't matter that every hop is the same AS number, what matters is the number of hops.

  • I think you answered a slightly different question. I asked essentially why are AS numbers even used by BGP routers, if it's possible to have different ASes with identical number (23456 in this case). They can't be used for any sort of AS identifiaction if two different ASes are labelled with the same number. If that's true, then I could say, well ok, let's change all ASNs in BGP routing tables to 0. It has to work, if it works with 23456. Nov 13, 2015 at 16:37
  • You talk about path prepending and AS Path length - okay, then why not just store the number of ASes on the path from src to dst, if the AS numbers are not used? If two ASes are assigned the same number in the router (23456), we lose all information this number could potentially carry - that's my point and that's what I'm asking here. Nov 13, 2015 at 16:42
  • 1
    @user5539357I think you're under the assumption that AS numbers are used for path selection -- they are not. It is only the path length that is (one of) the metrics used. So, in fact, all the AS numbers could be the same. The reason AS numbers are used at all is for loop prevention.
    – Ron Trunk
    Nov 13, 2015 at 17:01
  • @RonTrunk oh, okay, fine, but as you say they are used for loop prevention (=they can't be the same). I'm guessing the reason the loop prevention still works is that duplicate AS numbers (23456) are rare enough. Nov 13, 2015 at 17:21
  • 1
    @user5539357 I think you're still not clear on how BGP determines a route. The loop prevention mechanism only means that your AS can't appear in the path. If your AS is 1, the path could be 2,2,2,4,5,2,3 and that would be loop free as far as you're concerned (even though it may not be). So all the ASN could be 23456, as long as yours isn't. If you have a 32 bit ASN, that won't be the case.
    – Ron Trunk
    Nov 13, 2015 at 17:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.