What is a BGP session?
On the Internet, data packets travel across a complex mesh of routers and autonomous systems to reach their destination. This global routing relies on routing protocols, and at the heart of that system is the Border Gateway Protocol (BGP).
A BGP session is the connection established between two routers (peers) to exchange routing information. Thanks to these sessions, networks advertise IP prefixes to each other and traffic finds a viable path from one end of the Internet to the other.
In short: BGP is the “postal service” of the Internet. A BGP session is the secure conversation between two post offices (routers) agreeing on which paths to use.
What is BGP?
BGP (Border Gateway Protocol) lets the Internet operate as interconnected networks. Unlike interior gateway protocols (IGPs) that handle routing inside a single autonomous system (AS), BGP works between ASes.
BGP drives IPv4 and IPv6 routing. Without it, the Internet would be a collection of isolated networks unable to communicate efficiently at global scale.
BGP session and peering
For BGP to work, two routers must:
- Open a TCP connection (port 179)
- Authenticate (often MD5 / TCP-AO)
- Exchange routing tables (prefix advertisements)
- Keep the session alive (KEEPALIVE messages)
This relationship is called peering. Each BGP neighbor is a peer. Attributes on each route (AS_PATH, LOCAL_PREF, MED, COMMUNITIES…) then guide best-path selection.
Why BGP matters for the Internet
BGP is critical because routers can exchange reachability information even on highly complex topologies. It provides:
Global reachability
Any correctly peered network can reach (and be reached by) the rest of the Internet.
Network stability
By continuously updating routes, BGP adapts to failures, congestion, and topology changes.
Traffic optimization
Operators influence flow (multi-homing, traffic engineering, transit preference) through BGP attributes and policies.
Key functions of a BGP session
Routes and routing tables
A BGP route describes how to reach a prefix (e.g. 203.0.113.0/24). Routes live in the RIB, then the selected paths enter the forwarding table.
BGP session (peering)
Without an Established session, no routes are exchanged. Typical states: Idle → Connect → OpenSent → OpenConfirm → Established.
Path selection
When multiple routes exist to the same destination, BGP’s decision process (LOCAL_PREF, AS_PATH, ORIGIN, MED, etc.) picks the best path.
How BGP works
Peering explained
Two routers agree to exchange routes, open TCP, authenticate, then sync tables. Each BGP attribute influences selection.
Autonomous Systems (AS)
An AS is a set of networks under one administrative policy, identified by an ASN (e.g. AS212477). ISPs, cloud providers, and large enterprises each run their own AS.
Advertising and filtering
Peers advertise reachable prefixes. On receive, you filter (prefix-lists, as-path filters, RPKI) to accept only legitimate announcements — essential against hijacks and leaks.
[Your AS / router] ---- eBGP session ---- [HolyCloud edge] ----> Transit / Internet peering
│ │
Your prefix ads Filtering + RPKI
BGP configuration types
Internal BGP (iBGP)
Sessions inside the same AS. They sync the internal view. iBGP routes are generally not re-advertised to other iBGP peers (loop prevention), hence full-mesh, route reflectors, or confederations.
External BGP (eBGP)
Sessions between different ASes. This underpins Internet routing and most customer BGP sessions with a hosting or transit provider.
iBGP vs eBGP
| ----------- | ------ | ------ |
|---|---|---|
| Hop / TTL | Often internal multi-hop | Often adjacent (TTL 1) |
| Typical use | Operator core | Internet / customer interconnect |
Benefits of a BGP session
Scalability
BGP handles tens/hundreds of thousands of prefixes — suitable for ISPs and large networks.
Control and reliability
Granular policies, multiple paths, automatic failover if a transit fails.
Traffic management
Communities, AS-path prepend, LOCAL_PREF: tools to balance or prefer links.
Challenges and security best practices
Preventing BGP hijacking
An attacker advertises a prefix they do not own. Mitigations:
- Strict filtering (only authorized prefixes)
- RPKI / ROA origin validation
- Continuous route monitoring
Limiting route leaks
Accidentally re-advertising learned routes can disrupt the Internet. Use aggregation, communities (no-export), and clear export policies.
Securing the session itself
- MD5 / TCP-AO authentication
- ACLs limiting sources on port 179
- Regular audits of prefix-lists and peers
Common use cases
Multi-homing
Connect to multiple providers for redundancy. BGP selects (or balances) paths.
Load distribution
Influence inbound/outbound traffic across transit or peering links.
Announcing your own prefixes (BYOIP / ASN)
With an ASN and PI/PA prefixes, a BGP session at HolyCloud announces them to the Internet with anti-DDoS and dual-stack.
BGP session at HolyCloud
HolyCloud offers BGP sessions Dual Stack (IPv4 + IPv6) or IPv6 Only, with:
- eBGP peering to our ASN
- GRE / VXLAN support depending on design
- Anti-DDoS protection
- Fast delivery and support
For deeper technical parameters (peer IP, prefix-lists, communities), see BGP concepts for customers.
FAQ — BGP session
What is a BGP session in one sentence?
It is the TCP/BGP connection between two routers that continuously exchange Internet (or internal) routes.
Do I need an ASN for a BGP session?
Usually yes: a public ASN (or private, depending on design) and prefixes you are allowed to announce. HolyCloud helps with technical scoping.
Difference between a BGP session and a GRE tunnel?
GRE/VXLAN carries packets; the BGP session decides which routes are advertised and preferred. They are often combined.
iBGP or eBGP for my dedicated server?
Between your gear and HolyCloud, it is almost always eBGP (different ASes).
How to get started with HolyCloud?
- Request or order a BGP session
- Provide ASN, prefixes, ROA/IRR
- Receive peer parameters and bring the session up
- Validate advertisements with network support