This is done via ASNs (Autonomous Systems Numbers), like 32150 (my old ASN). Each hop along the way gets their ASN tacked on. It's like a flood-fill to all the BGP routers in the world.
When you "traceroute", you see IP hops along the way, but the ISPs routers choose links based on this list of autonomous paths (among other things). Basically, a AS-level traceroute is built into the BGP routing information. At it's most basic, a path is selected based on the shortest AS path (traceroute, but at the organization level rather than IP level); the fewest number of networks the traffic has to traverse.
If a link goes down (either because of a network failing, or because of administrative reasons), traffic will eventually switch over to another way of reaching the destination. You can also do things like pad the AS path with multiple copies of your AS to cause traffic to switch to another link more frequently, as a kind of primitive load balancing.
There is really need to do this is many cases though. If all you are looking for is connectivity redundancy you can just take the default routes from two ISPs and configure floating static routes on your router and not worry about BGP at all.
>"This is done via ASNs (Autonomous Systems Numbers), like 32150 (my old ASN). Each hop along the way gets their ASN tacked on. It's like a flood-fill to all the BGP routers in the world."
Each hop does not get its own ASN tacked on. This only happens when crossing an AS boundary i.e at eBGP speaker. There are generally many hops inside an AS.
That only gives you outgoing redundancy. You can talk to the world with one of the links down, but the world can't necessarily talk to your IPs with the link down.
BGP lets you advertise IPs to the world and what links they're reachable on. You can announce the same IPs on multiple links to multiple ISPs. This is what makes the internet "route around damage".
Correct if we are talking about IP hops (router 1 to router 2 to router 3), the AS does get tacked on (possibly multiple times) for each AS hop (Level-3 to Cogent to Zayo). Thanks for clarifying that.
The primary benefit if fully-realized and is not about "is multiple paths via different carriers."
An AS is an administrative entity. Route prefixes belong to an AS. All routes with an AS have a common routing policy that is managed by a single entity. I can look up a prefix to find it's AS and then I can look up that AS's routing policies. Here is an example for Tier 1 ISP Spring:
https://www.sprint.net/policies/bgp
I could have single ISP that I buy transit from and I might have multiple links with them. If I want to understand how to take advantage of that for example with traffic engineering then I would look the policies for ISPs AS. I would then use those BGP community attributes on my BGP links to them in order to accomplish my own routing goals.
The TL;DR:
Yes, BGP allows you to advertise addresses.
Ergo, it is allows you to build resilience, i.e. you can connect to multiple independent ISPs and advertise the same addresses. Hence traffic will always be able to reach you even if one ISP goes FUBAR.
By the same token, it makes pretty much zero sense to have BGP on a home connection (or, in technical speak, a "single-homed connection"). Since really BGP is a zero-sum game on single-homed connections (no real benefit, much added complexity).