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.