Skip to content
dhellstern edited this page Sep 23, 2021 · 9 revisions

Definitions

Term Definition
IX Internet Exchange
Transit Accessing a backbone which interconnects other networks
Peering Providing an interconnect between two or more networks
Tier 1 ISP Only peers with other ISPs, connecting to all tier 1 ISPs guarantees connectivity to the entire internet
Tier 2 ISP An ISP which uses a combination of peering and transit from Tier 1 ISPs
Tier 3 ISP A smaller ISP with a minimal network, very little peering, receiving transit from a tier 1 or 2 ISP
IGP Interior Gateway Protocol, a type of routing protocol used on smaller-scale, sometimes multi-site networks
EGP Exterior Gateway Protocol, a type of routing protocol used outside of a network for internetwork, not to be confused with the deprecated protocol by the same name
BGP Border Gateway Protocol, a routing protocol used for large-scale, internetworking applications
RIP Routing Information Protocol, a distance-vector routing protocol
OSPF Open Shortest Path First, a link-state routing protocol
AS Autonomous System, a value used by BGP to group routes

Routing

Typically, routers store a table of the possible routes for an IP packet to take. These tables are usually a combination of directly connected routes and routes that have been statically set to point at another gateway which is directly connected. An example routing table is below for reference:

| Route | Next Hop | Cost | | 10.0.0.0/16 | Directly Connected on interface eth0 | 0 | | 10.1.0.0/16 | Directly Connected on interface eth1 | 0 | | 10.2.0.0/16 | 10.1.25.4 | 10 |

In this scenario, a packet from 10.0.2.45 destined for 10.2.55.4 would be forwarded to the router at 10.1.25.4, which is directly available to the current router.

On larger and more complex networks, manually maintaining these routing tables becomes tedious, especially in complex network setups with multiple possible routes of varying cost. The solution to this problem is to use routing protocols, which automatically distribute routes and calculate cost to optimize routing.

Routing Protocols

The most basic of routing protocols is the distance-vector Routing Information Protocol, which periodically broadcasts the routes onto the specified broadcast domain, listening for other routers to share their routes, and forwarding received routes onto its other broadcast domains (in the process incrementing the cost). Notably, early versions of RIP predate Variable-Length Subnet Masks (VLSM), as they did not carry a subnet mask and instead used classful networking. A more powerful and complex alternative is Open Shortest Path First (OSPF). Unlike RIP and its newer alternatives, OSPF only sends updates when there is a change in the network, maintaining an internal topology map, and distributing limited updates to confirm that the router is still online. OSPF is therefore a link-state protocol, which calculates its cost metric based not just on the hop count but also the capacity of a particular link.

BGP is a distance-path protocol, which tracks more than just the hop count but does not attempt to maintain an internal topology map. Rather than using OSPF "areas", which group together routes to build an internal map, BGP makes use of Autonomous Systems (AS) numbers (or ASNs for short). BGP routing tables therefore contain ASNs, presuming that if a router can reach one network which is a part of that ASN, it can reach the rest as well. BGP routers only forward on the shortest routes it knows to a destination, but it can maintain multiple routes to a destination for fault tolerance.

BGP supports carrying routes of many types, including both classless and classful networks, and it even supports single IP addresses where the address is not a network or broadcast address. Since its creation in 1989, BGP has undergone 3 further revisions, adding support for AS identification, connection termination when two routers attempt to establish a TCP session with each other at the same time, and CIDR and aggregation support.

BGP Protocol

BGP uses TCP port 179, unlike most other routing protocols, which either run on top of IP directly or broadcast using UDP. With BGP, the peer addresses area already known, so TCP connections can be initiated directly. BGP packets use the following format:

Marker Length Type Data
16 bytes 2 bytes 1 byte 0 - 4077 bytes

Clone this wiki locally