0

I'm going to read some books on routing, but I'd like to have earlier correct big picture understanding. So:

(1) IP addresses are assigned globally by IANA and RIRS to Internet Service Providers. More strictly, these registries assign large ranges of IP addresses to Internet Service Providers,
(2) the most widespread/fundamental external routing protocol is BGP,
(3) although the ranges of IP addresses are formally assigned to ISPs as in (1), in fact in BGP technically the routers themselves broadcast (what's the correct word?) what IP addresses they know routes to. For this reason it is possible for a router to claim that it knows a route to specific IP range and then to direct this traffic not to the intended destination but to the computers under its direct control,
(4) the situations like that in (3) happen but they happen rarely because ISPs are large units and can be reasonably expected to be responsible. Also, if some ISP would do it persistently or on purpose, it is possible to throw out his routers from routes in another routers and problem'd be solved,
(5) the information from a router that it knows a route to such and such IP (IP range?) is redistributed to other routers (not only being the neighbours of the originally advertising router),
(6) something that I don't really know: I know that routers route packets using route tables. This route tables are basically built on the basis of the point (3) (in reality more complex algorithms are involved, but it doesn't matter much now). I wasn't able to find some meaningful BGP routing table, but is it like this:

route traffic to 1.1.x.x by router 2.5.55.18
route traffic to 2.5.x.x by router 7.19.255.30
route traffic to 18.15.210.x by router 3.90.34.42

or like this:

route traffic to 1.1.x.x by port 2
route traffic to 2.5.x.x by port 1
route traffic to 18.15.210.x by port 3

That is, if the routers are indicated by IPs (as in the first case), then I wonder how the router know what IPs the neighbouring routers have? 2.5.55.18 is meaningless to the router unless it knows to which "channel" it is connected. But how does the router establishes that? The advertisement described in (3) carries out this information and the router saves something like "I'm connected to 2.5.55.18 by port 2"? Or must they be configured statically?

Here: https://networklessons.com/bgp/how-to-read-the-bgp-table it seems like it is using IP addresses, not ports.

1
  • "IP addresses are assigned globally by IANA and RIRS to Internet Service Providers." IP addresses are assigned by the RIRs to companies. ISPs are companies, too, but you do not need to be an ISP to get IP address assignments from RIRs, you just need to justify your request (quantity) and pay the fees. Then, you have provider-independent addressing to connect to other companies and ISPs.
    – Ron Maupin
    Aug 6 at 19:32
2

First, to answer your last question, BGP neighbors are manually configured by the administrator. So when I configure my router to "peer" with your router, I know your router's IP address.

Second, your items 1-5 are generally correct. I might quibble with a few points, but you have a basic idea.

2
  • Thx, what happens in the situation if the administrator of a BGP router, let's call this router A, configured it such that according to this configuration it'd be connected to router (let's call it B) 2.5.55.18 by port 2 but in fact the router B has another IP address? The router A will send packets to the router B, but router B will inspect these packets, see that they are not actually addressed to its IP and drop them? Aug 6 at 18:54
  • That's correct. Generally, before I connect my BGP router to yours, we will agree on all the technical (and possibly financial) details, IP addresses being one of them. So if I have the wrong peer address, one of us made a mistake.
    – Ron Trunk
    Aug 6 at 18:59
1

(1) IP addresses are assigned globally by IANA and RIRS to Internet Service Providers. More strictly, these registries assign large ranges of IP addresses to Internet Service Providers,

Pretty much yes.

(2) the most widespread/fundamental external routing protocol is BGP,

Yes

(3) although the ranges of IP addresses are formally assigned to ISPs as in (1), in fact in BGP technically the routers themselves broadcast (what's the correct word?) what IP addresses they know routes to. For this reason it is possible for a router to claim that it knows a route to specific IP range and then to direct this traffic not to the intended destination but to the computers under its direct control,

Yes, though filters can be configured. If you are a small provider and go shopping for IP transit services you can expect to find your BGP sessions filtered.

(4) the situations like that in (3) happen but they happen rarely because ISPs are large units and can be reasonably expected to be responsible. Also, if some ISP would do it persistently or on purpose, it is possible to throw out his routers from routes in another routers and problem'd be solved,

The problem comes when you get a provider that is both large and sloppy. Simply cutting them off is impractical and filtering them is difficult.

There has been a push in recent years to introduce smarter filtering mechanisms that can be applied to even large providers.

(5) the information from a router that it knows a route to such and such IP (IP range?) is redistributed to other routers (not only being the neighbours of the originally advertising router),

Yes

(6) something that I don't really know: I know that routers route packets using route tables. This route tables are basically built on the basis of the point (3) (in reality more complex algorithms are involved, but it doesn't matter much now). I wasn't able to find some meaningful BGP routing table,

The BGP implementation will maintain a table which maps IP blocks to "BGP next hop" IPs.

The local interfaces of the router will have IP addresses and subnet masks assigned by the router's administrator. However the BGP next hop may not be reachable through any interface on the local router. So the router may have to use it's IGP tables to translate the BGP next hop to a local next hop which in turn can be translated to an interface.

1

IP addresses are assigned globally by IANA and RIRS

Public addresses are assigned by RIRs. Private addresses from RFC 1918 can be used at will, inside private networks.

it is possible for a router to claim that it knows a route to specific IP range and then to direct this traffic not to the intended destination but to the computers under its direct control,

Any router can use any routing, just like any host can (try to) use any gateway it desires. Routes can be configured manually or dynamically using a routing protocol (for routers) or DHCP (for end hosts).

BGP is the predominant external gateway protocol, there are also a few internal ones. BGP is largely based on trust but route filtering is quite common, ensuring that the most important routes cannot be hijacked (on purpose or by accident).

Routes are specified by prefix and length (e.g. 192.0.2.128/25), next-hop gateway, and often the interface toward the next hop (the interface can also be determined by its IP address and subnet mask).

Note that a route can also just point out of a plain point-to-point interface without addressing, e.g. a simple serial link.

2.5.55.18 is meaningless to the router unless it knows to which "channel" it is connected.

All gateways must be local (same L2 segment/IP subnet) to their respective interface. Each interface is defined by its IP address and subnet mask. For subnetting and masks see this excellent Q&A.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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