Study guide

11.2 EBGP/IBGP Sessions, State Machine and Messages

JNCIS-ENT Enterprise Routing and Switching Study Guide 2026 Exam

Track your progress as you read

Finished sections get a check mark.

1 Chapter 1: Exam Overview & Junos Enterprise Fundamentals

1.1 JNCIS-ENT Exam Logistics & Blueprint Breakdown 1.2 Junos CLI, Enterprise Platforms & Interface Families 1.3 Layer 2 Bridging Mechanics & Packet Forwarding

2 Chapter 2: VLANs & Inter-VLAN Routing

2.1 VLAN Segmentation and 802.1Q Tags 2.2 Access, Trunk, Native and Voice VLANs 2.3 IRB Architecture and Interface Families 2.4 IRB Configuration and Packet Walk 2.5 VLAN Configuration, Verification & Troubleshooting

3 Chapter 3: Spanning Tree Protocols

3.1 Layer 2 Loops and Root Bridge Election 3.2 STP Costs, Port Roles, States and BPDUs 3.3 RSTP Rapid Convergence & Link Types 3.4 MSTP Architecture & Spanning Tree Operations

4 Chapter 4: Layer 2 Security & Feature Protection

4.1 Edge BPDU and Root Protection 4.2 Loop Protection and Diagnostic States 4.3 Port Security, MAC Limiting & Persistent MAC Learning 4.4 DHCP Snooping, Dynamic ARP Inspection (DAI) & IP Source Guard 4.5 Layer 2 Firewall Filters: Types, Order and Actions

5 Chapter 5: Advanced Layer 2 Features & Storm Control

5.1 Storm Control & Broadcast/Multicast Suppression 5.2 MACsec Link Security and Key Agreement 5.3 LLDP and LLDP-MED Operations & Verification

6 Chapter 6: Protocol-Independent Routing & Load Balancing

6.1 Static, Aggregate, and Generated Routes 6.2 Routing Instances and RIB Groups 6.3 Junos Load Balancing & Filter-Based Forwarding (FBF) 6.4 Martian Routes and Route Acceptance

7 Chapter 7: Junos Routing Policy & Firewall Filters

7.1 Routing Policy Framework & Term Evaluation 7.2 Prefix Lists & Route Filters 7.3 Firewall Filters & Policers

8 Chapter 8: Open Shortest Path First (OSPF) Operation

8.1 OSPF Architecture & Neighbor Adjacency Formation 8.2 OSPF Areas & LSA Types 8.3 OSPFv2 & OSPFv3 Configuration and Verification

9 Chapter 9: Advanced OSPF Features & Routing Policies

9.1 OSPF Special Area Types 9.2 Route Summarization & OSPF Authentication 9.3 OSPF Diagnostics & Common Failure Scenarios

10 Chapter 10: Intermediate System to Intermediate System (IS-IS)

10.1 IS-IS Encapsulation and NET Identity 10.2 IS-IS Levels, Areas and Default Routing 10.3 IS-IS PDU Families and Neighbor Exchange 10.4 IS-IS Database Synchronization and DIS 10.5 IS-IS Configuration, Metrics & Troubleshooting

11 Chapter 11: Border Gateway Protocol (BGP)

11.1 BGP Roles, AS Numbers and TCP Transport 11.2 EBGP/IBGP Sessions, State Machine and Messages 11.3 BGP Attributes & Junos Path Selection Algorithm 11.4 BGP Configuration & Policy Implementation 11.5 BGP Scaling with Route Reflection & Diagnostics

12 Chapter 12: IP Tunneling & High Availability

12.1 GRE & IP-IP Tunneling Architecture 12.2 Link Aggregation (LAG/LACP) & Redundant Trunk Groups (RTG) 12.3 Virtual Chassis Roles and Elections 12.4 Virtual Chassis Links, Splits and Provisioning 12.5 Routing Engine Redundancy: GRES, NSR, NSB and GR 12.6 BFD Detection and VRRP Gateway Redundancy 12.7 Unified ISSU: Requirements and Verification

11.2 EBGP/IBGP Sessions, State Machine and Messages

Key Takeaways Explain This Topic AI

EBGP and IBGP differ in AS relationship, default TTL, next-hop handling and route readvertisement rules.

Connect/Active indicate TCP establishment work; Established is the state used for route exchange.

BGP message types are OPEN 1, UPDATE 2, NOTIFICATION 3 and KEEPALIVE 4; route refresh is a negotiated extension.

Last updated: October 2026

4. EBGP vs. IBGP Architectural Differences

BGP behaves differently depending on whether peers belong to the same Autonomous System or different Autonomous Systems: +---------------------------------------------------------------------------------------------------+

  • | EBGP VS. IBGP COMPARATIVE SPECIFICATIONS |
  • +-----------------------------+-----------------------------+---------------------------------------+
  • | Operational Parameter | External BGP (EBGP) | Internal BGP (IBGP) |
  • +-----------------------------+-----------------------------+---------------------------------------+
  • | AS Relationship | Distinct ASNs | Identical ASN |
  • | | (local-as != peer-as) | (local-as == peer-as) |
  • +-----------------------------+-----------------------------+---------------------------------------+
  • | Default IP TTL | 1 | 255 |
  • +-----------------------------+-----------------------------+---------------------------------------+
  • | Peering IP Address | Physical interface subnet | Loopback address (lo0.0) via IGP |
  • +-----------------------------+-----------------------------+---------------------------------------+
  • | Next-Hop Modification | Automatically reset to self | Preserved unchanged from EBGP |
  • | | (local peering IP) | (Requires 'then next-hop self' policy)|
  • +-----------------------------+-----------------------------+---------------------------------------+
  • | Route Re-advertisement | Allowed to all EBGP & IBGP | Prohibited to other IBGP peers |
  • | | peers (subject to policy) | (IBGP Split-Horizon rule) |
  • +-----------------------------+-----------------------------+---------------------------------------+
  • | Junos Route Preference | 170 | 170 |
  • +-----------------------------+-----------------------------+---------------------------------------+
  • EBGP Mechanics: Direct Connection & Multihop

Because EBGP runs between different administrative organizations, routers are typically connected over a dedicated physical point-to-point circuit. By default, EBGP packets are generated with an IP Time-To-Live (TTL) of 1 .

Loopback peering uses a destination that is not the directly connected interface address. Junos normally requires multihop and a usable route to that address, plus a matching local-address on the peer. A router does not decrement TTL merely when originating a packet onto its own interface; transit routers decrement TTL when forwarding. The direct-neighbor check and actual transit hop count are separate reasons to configure multihop. [edit protocols bgp group EBGP-PEER]

  • set type external
  • set peer-as 64500
  • set neighbor 192.0.2.1 multihop ttl 5
  • set neighbor 192.0.2.1 local-address 198.51.100.1
  • IBGP Mechanics: Next-Hop Preservation & Split-Horizon

Inside an enterprise AS, IBGP routers typically peer between loopback interfaces ( lo0.0 ) rather than physical links. This ensures that the BGP session remains active as long as the underlying IGP (OSPF or IS-IS) can route traffic around physical link failures.

Two critical operational behaviors govern IBGP:

Next-Hop Preservation : When an edge router learns an external prefix via EBGP and reflects that route to internal IBGP peers, BGP does not change the next-hop IP address . The next-hop remains the IP address of the external peer in the neighboring AS. If internal core routers do not possess an IGP route to that external next-hop subnet, the route becomes unresolved and is hidden from inet.0 . To correct this, enterprise edge routers apply an export policy containing then next-hop self to all IBGP peering sessions.

The IBGP Split-Horizon Rule : To prevent routing loops within an AS without altering the AS_PATH , BGP dictates that a route learned from an IBGP peer must never be re-advertised to another IBGP peer . Consequently, all routers participating in IBGP must form a full logical mesh of peering sessions ( N ( N − 1 ) / 2 N(N-1)/2 N ( N − 1 ) /2 ), or implement Route Reflectors.

Junos Route Preference Note : In Junos OS, both EBGP and IBGP routes receive an identical administrative route preference of 170 in the default routing table ( inet.0 ). This contrasts with other network vendors that assign disparate administrative distances (such as 20 for EBGP and 200 for IBGP).

5. The BGP Finite State Machine (FSM)

A BGP neighbor session progresses through six discrete states defined in RFC 4271: +---------------------------------------------------------------------------------------------------+

  • | BGP FINITE STATE MACHINE (FSM) TRANSITION SEQUENCE |
  • | |
  • | [1. IDLE] ------(Start Event)-----> [2. CONNECT] <-----(ConnectRetry Expired)----+ |
  • | ^ | | |
  • | | (TCP Fails) (TCP Fails) |
  • | (Error/ | | | | |
  • | Notification) v +-------------> [3. ACTIVE] ------------+ | |
  • | | (TCP OK) | |
  • | | | (TCP OK) |
  • | | v | |
  • | +----------------------- [4. OPENSENT] <---------------+ |
  • | | | |
  • | | (Open Msg Validated) |
  • | | v |
  • | +--------------------- [5. OPENCONFIRM] |
  • | | | |
  • | | (Keepalive Received) |
  • | | v |
  • | +-------------------- [6. ESTABLISHED] |
  • +---------------------------------------------------------------------------------------------------+

Idle : The initial state. BGP allocates local resources, ignores incoming connection attempts, and waits for a Start event (manual activation, configuration commit, or interface up). Upon the Start event, BGP resets the ConnectRetry timer, initiates a TCP handshake to the remote peer, and transitions to Connect .

Connect : BGP waits for the TCP three-way handshake to complete. If TCP successfully connects, BGP clears the ConnectRetry timer, sends an Open message to the peer, and transitions to OpenSent . If the TCP connection attempt fails or the ConnectRetry timer expires, BGP drops to Active .

Active : BGP attempts to restart the TCP connection. If the connection completes, BGP transmits an Open message and moves to OpenSent . If the ConnectRetry timer expires while in Active, BGP transitions back to Connect . A peer cycling indefinitely between Connect and Active typically indicates a physical connectivity failure, firewall blocking port 179, incorrect neighbor IP address, or missing multihop configuration.

OpenSent : BGP has transmitted its Open message and is actively awaiting the peer's Open message. Once received, the local router validates the BGP version, Autonomous System number, BGP Router ID, and negotiated Hold Time. If parameters match, BGP sends a Keepalive packet and transitions to OpenConfirm . If a mismatch occurs (e.g., peer AS mismatch), BGP sends a Notification message and returns to Idle .

OpenConfirm : BGP waits for a Keepalive or Notification message from the peer. Receipt of a Keepalive message transitions the session to Established .

Established : The BGP session is fully up and functional. Peers exchange Update messages containing Network Layer Reachability Information (NLRI), Keepalive messages, and optional route refresh requests.

6. BGP Protocol Message Types

All BGP messages share a standardized 19-byte header comprising a 16-byte Marker field (synchronization and authentication), a 2-byte Length field (19-byte header and a baseline maximum message length of 4096 bytes; negotiated Extended Message capability is an explicit exception), and a 1-byte Type field defining four packet types:

Type Message Name Primary Function & Packet Structure Default Transmission Interval

1 Open Negotiates operational parameters: BGP Version (4), Local ASN, Hold Time (Junos default 90s), BGP Identifier (32-bit RID), and Optional Parameters (Capabilities: 4-byte ASN, Multiprotocol Extensions, Route Refresh, Graceful Restart) Sent once immediately upon successful TCP connection

2 Update Transports routing information. Can advertise a single new path with multiple path attributes alongside Network Layer Reachability Information (NLRI prefixes), and/or withdraw multiple unreachable prefixes simultaneously Triggered dynamically when routing topology changes

4 Keepalive Maintains session liveness and prevents Hold Timer expiration when no Update packets are being exchanged. Consists purely of the standard 19-byte BGP header with no payload Sent periodically every 30 seconds (1/3 of the 90s Hold Time in Junos)

3 Notification Transmitted immediately when an operational error is detected (e.g., Hold Timer expired, bad peer ASN, authentication failure, malformed Update). Contains an Error Code, Error Subcode, and diagnostic data. Instantly closes the TCP connection and resets FSM to Idle Sent only upon unrecoverable protocol error conditions

Operational Gotcha: The Hold Timer Negotiation

During the Open message exchange, each peer proposes its configured Hold Time. The operational Hold Time is negotiated to the lower value between the two peers. In Junos, the default Hold Time is 90 seconds, and Keepalives are sent at one-third of this value (30 seconds). If a router fails to receive a Keepalive or Update before the Hold Timer reaches zero, it generates a Notification (Hold Timer Expired), tears down the session, drops all associated BGP routes, and reverts to Idle.

Loading diagram... BGP Finite State Machine Transitions & Message Exchange