• Post author:Bhaskar Soni
  • Post published:
  • Post category:Networking
  • Post comments:1 Comment
  • Reading time:3 mins read

The internet is not one network. It is tens of thousands of separately managed networks that agree to exchange traffic. To make that work, routing protocols fall into two main categories: protocols used inside one organization’s network, and protocols used between organizations. Understanding these routing protocol categories, and the idea of an autonomous system, makes it much easier to see how traffic crosses the internet.

Autonomous systems

An autonomous system (AS) is a network, or group of networks, under one administrative control with a single, clearly defined routing policy. ISPs, cloud providers, large companies and universities usually run their own AS.

Each public AS has a unique autonomous system number (ASN):

  • 16-bit ASNs range from 1 to 65535;
  • 32-bit ASNs extend the range to about 4.29 billion;
  • private ranges, 64512 to 65534 and 4200000000 to 4294967294, are for internal use only.

In India, organizations get ASNs and IP addresses through IRINN or APNIC.

What is a routing policy?

An AS decides which routes it accepts, which it advertises and which paths it prefers. For example, an ISP might prefer routes from paying customers over routes from peers, and never pass routes between two upstream providers.

Interior gateway protocols (IGPs)

IGPs exchange routes inside one autonomous system. Their goal is to find the fastest or shortest path, and they trust all routers in the network.

IGPTypeNotes
RIPDistance vectorSimple; maximum 15 hops; mostly legacy
EIGRPAdvanced distance vectorFast convergence; mainly Cisco
OSPFLink stateOpen standard; most common in enterprises
IS-ISLink statePopular in large ISP networks

Read more about OSPF and EIGRP.

Exterior gateway protocols (EGPs)

EGPs exchange routes between autonomous systems. Here, the goal is not just the shortest path but control: each AS applies its own policies and does not trust others blindly.

The term also refers to a specific historical protocol called EGP, used in the early internet. It could not handle the internet’s growth and complex topology, so BGP replaced it.

IGP routing inside an autonomous system and BGP between autonomous systems

BGP: the protocol of the internet

The Border Gateway Protocol (BGP), version 4, is today’s only exterior gateway protocol in practical use. It is a path vector protocol: each route carries the list of autonomous systems it has passed through. Routers use this AS path to avoid loops and to apply policy.

BGP has two forms:

  • eBGP runs between different autonomous systems, such as between a company and its ISP.
  • iBGP runs inside one AS to share external routes between its own border routers.

BGP runs over TCP port 179 and chooses paths using attributes such as local preference, AS path length and the multi-exit discriminator (MED). The global BGP table now holds more than a million IPv4 prefixes. For a detailed guide, see what is BGP.

IGP vs EGP at a glance

IGPEGP (BGP)
ScopeInside one ASBetween ASes
GoalFast, efficient pathsPolicy control and scale
TrustTrusts internal routersFilters and validates neighbours
SizeThousands of routesOver a million routes
ExamplesOSPF, IS-IS, EIGRP, RIPBGP-4

Why it matters for security

Because BGP relies on networks trusting each other’s announcements, mistakes or attacks can redirect traffic. These are called route leaks and BGP hijacks. Defences include route filtering, RPKI route origin validation and following the MANRS best practices.

Sources

Need help with network security? We test routers, firewalls, ACLs and segmentation as part of our VAPT services and hardening audits. Contact us for a quote.

Post author avatar

Bhaskar Soni

Bhaskar Soni is a Security Engineer and the founder of Youngster Company, based in Ahmedabad, Gujarat. He works hands-on with Linux server hardening, vulnerability assessment and penetration testing (VAPT), ISO 27001 compliance and OSINT investigations. He writes practical, tested guides for IT professionals and Indian businesses, and every article on this site is written or reviewed by him.

This Post Has One Comment

Leave a Reply