Let's consider a host A in an autonomous system AS100. Suppose it wants to communicate with host B in another AS, say, AS200. In AS100 there are several routers. Within one AS, the rotuing protocols used are Internal gateway protocols such as OSPF or RIP.

AS100 needs to know the path through other AS-es to AS200, so the edge routers in AS100 are BGP routers, BGP is an external gateway protocol used for routing between autonomous systems.

If AS100 is connected to, say, two ASes (it has two eBGP routers), how does host A inside AS100 know which BGP router to talk to, in order to communicate with host B in AS200? Host A tells its router that it wants to communicate with host B. Now, that router would need to know the path to host B. But host B is outside AS100.

Do eBGP routers send their routing tables to all routers (both BGP and IGP) in one AS? I mean, 'normal' routers inside AS have to know a lot, they have to choose the appropriate border router so that host A can calk to host B.

If all routers know the same thing, then why would anyone need iBGP? Generally BGP routing tables are big, so it's probably a false statement, but I'm not sure how could host A know the right path if its neighbour routers didn't know all the routes the border routers have.

4 Answers 4


There are multiple ways to do this.

The other ASes could be sending a default route, or the router in AS100 could just have a default route configured.

The other ASes could just advertise their own routes through BGP.

The other ASes could advertise full BGP routes to AS100.

BGP has many factors which could play into the decision of which way to switch traffic destined to another AS. This is the subject of entire books, and it is beyond the scope of this site. It is far more complicated than IGP routing protocols, and it may involve many steps to determine the best path. Often is just boils down to how many AS hops away it is to get to the other AS.

You may be confused about the role of iBGP. The distinction of iBGP and eBGP is whether or not the neighbor is in the same AS. An AS will almost always have more routers than just the routers connecting to other ASes. The routers internal to the AS would have the same AS number as their neighbors, so they would use iBGP.

It would also be a huge discussion about how design within an AS. Again, you could have default routes, full or partial routing tables, a combination, etc., or a mix of IGP and iBGP (which is involved because you could use a full-mesh, route reflectors, confederations, etc.).

What BGP neighbors send each other can be controlled. It could be full routing tables, or it could be whatever the AS owner decides is appropriate. there is no one answer to this question.

  • The problem I've attempted to describe is actually limited to the scope of one AS, namely AS100. In short: let's say AS100 has several eBGP routers. How does A know which eBGP router to talk to, in order to communicate with host B? The non-BGP routers, neighbours of A, would need to have the same information as the BGP routers in order to make the correct routing decision, right? But that way, all routers, no matter if BGP or not, would store identical routing tables. Maybe I just don't understand your answer - sorry in that case. Nov 6, 2015 at 19:34
  • No. The IGP routers in AS100 do not need to know specifically how to get to AS200. That can be handled through a default route. Routers do not need to have identical routing tables; I'm not sure where you came up with that. Routers can advertise what the AS owner wants them to advertise to each other, and that certainly does not mean the entire routing table.
    – Ron Maupin
    Nov 6, 2015 at 19:38
  • In fact, the BGP routers on the edge running eBGP with other ASes probably do not advertise much, or any of what they learn to other routers within the same AS.
    – Ron Maupin
    Nov 6, 2015 at 19:41
  • AS100 has two border BGP routers, B1 and B2. From router B1, you can eventually reach AS300 and AS301. From B2, you will get to AS200 and AS201. I'm host A, and would like to get to host B in AS200 (one of the networks in AS200 is network X, where the host B 'lives'). Then normal routers around host A need to know whether to send the packet to B1 or B2, right?Of course I didn't mean to say the routers around host A have the AS paths in them, but they probably contain the list of networks in other ASes - they need to know them! Otherwise, how would they know which BGP router to send packets to? Nov 6, 2015 at 19:45
  • Router don't need to know specific routes. They need to know the direction to switch for an address. This is often handled by route aggregation. For instance, if there are a bunch of network which can be aggregated to the prefix, a router only needs to know the aggregated route. The ultimate aggregated route is the default route of Most routers really only know relatively few routes.
    – Ron Maupin
    Nov 6, 2015 at 19:49

Do eBGP routers send their routing tables to all routers (both BGP and IGP) in one AS?

No, that's the whole point of running a separate protocol. BGP speakers redistribute a very small number of routes into the IGP. If you only have one link outside your AS, then the BGP router just needs to redistribute a default route. If you have more than one exit point, you may redistribute a few summary routes to steer traffic in the right direction.

Often, only a default route is advertised into the IGP by the BGP speakers, and the BGP speakers will route the traffic outside the AS based on their routing information.

In other words, A doesn't need to know everything, it only needs to know how to get to the border routers, who can then route traffic correctly.

  • 1
    A needs to know how to get to the border router, fine. But if there are several border routers, and host B can only be reached from one of them? How does A know which one to connect to? Nov 6, 2015 at 19:29
  • In that case, the border router has to redistribute or "leak" some routes into the igp so everyone knows how to get to B.
    – Ron Trunk
    Nov 6, 2015 at 20:10

BGP protocol is the routing protocol of the INTERNET. IT´s the way that all the autonomus systems are interconnected. The BGP is conformed by 2 types of peers, internal and external peers(from the AS point of view).

Then, you, like a network administrator, need to know the networks that you want to announce to the world(once that you have been approved by some HIGHER organization like ARIN, RIPE, and so on). Well, you need to know the networks that you are propietary and you want to "announce". That´s what AS100 and AS200 does, announcing the networks that host A and B are connected to.

You have adoubt about how the known of that networks travels accross 2 other autonomous system. That is the way that BGP works: One autonomus system is on charge to announce its own network and resend(it is permitted or needed) the networks that learned from it eBGP peers.

On that way, is something like a HUGE mesh of BGP peers.

Then, host A can communicate to host B, on different autonomus system, cause,eg: the AS200 knows to reach network_of_host_A located on AS100, and it´s reached across some_number_of_AS(known as AS_PATH).


If AS100 is connected to, say, two ASes (it has two eBGP routers), how does host A inside AS100 know which BGP router to talk to, in order to communicate with host B in AS200? Host A tells its router that it wants to communicate with host B. Now, that router would need to know the path to host B. But host B is outside AS100.

AIUI there are three basic approaches.

  1. Run iBGP for routers inside AS100, even if those routers have no eBGP connections.
  2. Use default routes to direct the traffic towards a router that knows how to handle it (and take care to avoid routing loops).
  3. Redistribute some BGP routes into the IGP.

Which approach is appropriate will depend on the situation.

You do NOT want to redistribute a full internet routing table into your IGP, but redistributing the odd route may be acceptable, say because you have a customer that speaks BGP, or because you want more efficient routing to a network you exchange a lot of traffic with.

Afaict what many ISPs do is divide their networks into "Core" and "Access" portions. In the core, routers are speaking BGP (both internal and external) and using that information to route external traffic to the correct destination, in the "Access" portion routers just send external traffic towards the core.

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.