Shopping cart

Subtotal:

$0.00

JN0-351 BGP

BGP

Detailed list of JN0-351 knowledge points

BGP Detailed Explanation

BGP (Border Gateway Protocol) is a routing protocol specifically designed for routing between autonomous systems (ASes) on the internet. It is essential for both large-scale enterprise networks and service providers.

1. Basic Concepts

What is BGP?

  • BGP is classified as an External Gateway Protocol (EGP), primarily used for routing between autonomous systems (ASes).
  • Autonomous Systems (AS): Groups of IP networks managed by a single organization, identified by unique AS numbers (ASN).

Key Characteristics:

  • Path Vector Protocol: BGP advertises complete paths to destinations, using attributes to make routing decisions.
  • Scalability: Capable of handling the vast scale of the global internet.
  • Policy-Based: Routing decisions are based on configurable policies, not just metrics like hop count or bandwidth.

2. Detailed Knowledge

Key Components

Establishing and Maintaining Neighbor Relationships

  • BGP Peers:
    • Routers running BGP establish a relationship, known as a BGP session, with one another to exchange routing information.
  • Neighbor Establishment Process:
    1. TCP Connection: BGP uses TCP (port 179) to establish connections between peers.
    2. BGP Messages: The protocol exchanges messages to maintain the session and share routing updates.
  • BGP Neighbor States:
    • Idle: Initial state, waiting to establish a connection.
    • Connect: TCP connection is being attempted.
    • Active: TCP connection established, waiting for a response.
    • OpenSent: An OPEN message has been sent.
    • OpenConfirm: Waiting for KEEPALIVE messages.
    • Established: Fully operational; routing information is exchanged.

BGP Message Types

  1. OPEN:

    • Used to initiate a BGP session.
    • Includes parameters like AS number, BGP version, and Router ID.
  2. UPDATE:

    • Used to advertise new routes or withdraw previously advertised routes.
  3. KEEPALIVE:

    • Ensures the BGP session remains active. Sent periodically to confirm connectivity.
  4. NOTIFICATION:

    • Used to signal errors or terminate the session.

Path Selection Rules

BGP uses a set of rules to select the best path when multiple routes to the same destination are available. Below are the key criteria:

  1. AS-PATH Length:

    • Prefers the path with the shortest AS-PATH (fewest AS hops).
    • Example: Path AS100 → AS200 → AS300 is preferred over AS100 → AS400 → AS500 → AS300.
  2. Weight:

    • A Cisco-specific attribute that influences path selection within a router.
    • Higher weight is preferred.
  3. Local Preference:

    • Configured by network administrators to prioritize certain paths.
    • Higher local preference is preferred.
  4. Other Attributes:

    • MED (Multi-Exit Discriminator): Used to influence inbound traffic when multiple paths exist between two ASes.
    • Origin Type: Prefers routes originating from IGP over EGP or Incomplete routes.
    • Next-Hop: Ensures the next-hop address is reachable.

IBGP vs. EBGP

IBGP (Internal BGP):

  • Purpose: Used for routing within the same AS.
  • Key Features:
    • Requires full mesh connectivity between IBGP routers (all IBGP peers must communicate directly).
    • Does not modify the AS-PATH attribute.

EBGP (External BGP):

  • Purpose: Used for routing between different ASes.
  • Key Features:
    • Typically runs between edge routers of different ASes.
    • Prepends the local AS number to the AS-PATH attribute.

Route Attributes

BGP routes include several attributes that influence routing decisions:

  1. Community:

    • A flexible tag used to group routes and apply policies.
    • Common communities:
      • no-export: Do not advertise outside the local AS.
      • no-advertise: Do not advertise to any BGP peer.
      • local-AS: Do not advertise outside the confederation.
  2. MED (Multi-Exit Discriminator):

    • Indicates the preferred entry point into an AS when multiple links exist.
    • Lower MED values are preferred.
  3. AS-PATH:

    • Lists the ASes a route has traversed.
    • Prevents routing loops and influences path selection.
  4. Next-Hop:

    • Specifies the next-hop router to reach the destination.

3. Key Takeaways

  • BGP is essential for internet routing and manages inter-AS connectivity efficiently.
  • Key Components: BGP peers exchange routing information using OPEN, UPDATE, and KEEPALIVE messages.
  • Path Selection: BGP uses AS-PATH, Weight, Local Preference, and other attributes to determine the best route.
  • IBGP vs. EBGP: IBGP operates within an AS, while EBGP manages routing between ASes.
  • Attributes: Community, MED, and AS-PATH provide flexibility and control over routing policies.

BGP (Additional Content)

1. IBGP Full Mesh Requirement and Route Reflectors (RRs)

In standard IBGP deployments, all IBGP-speaking routers must form a full mesh, meaning every IBGP router must peer with every other IBGP router. This is because IBGP does not advertise routes learned from one IBGP peer to another by default.

To overcome this scalability limitation, Junos supports the use of Route Reflectors (RRs).

To scale IBGP networks and avoid full-mesh limitations, Route Reflectors (RRs) are used to relay updates among IBGP peers.

Example Configuration Snippet:

set protocols bgp group RR_CLIENT type internal
set protocols bgp group RR_CLIENT local-as 65001
set protocols bgp group RR_CLIENT neighbor 192.0.2.2 route-reflector-client

Exam Tip:
You might be asked:

“Which BGP feature allows an IBGP speaker to forward routes to other IBGP peers?”
Correct answer: Route Reflector

2. BGP Next-Hop Reachability Requirement

In Juniper’s implementation of BGP, a received route will not be added to the routing table unless its next-hop IP address is resolvable via the local routing table, typically through IGP protocols like OSPF or IS-IS.

BGP relies on IGPs (like OSPF or IS-IS) to resolve next-hop addresses; routes with unreachable next-hops are considered invalid.

This is true for both IBGP and EBGP routes. Even if a route is valid from a BGP perspective, it is not installed unless the next-hop is reachable.

Exam Tip:
A classic trap question might ask:

“Why is a BGP-learned route not appearing in the routing table?”
Correct answer: Its next-hop address is not reachable via an IGP.

3. BGP Community Attribute – Junos Policy Example

Communities are used to tag routes with metadata and apply policy decisions based on those tags. Common well-known communities include no-export, no-advertise, and internet.

In Junos, community-based routing policies are configured under the policy-options hierarchy.

Example: Match and Apply Community Policy

set policy-options community NO_EXPORT members no-export

set policy-options policy-statement BLOCK_EXPORT term MATCH_COMM {
    from community NO_EXPORT
    then reject
}

This example creates a named community called NO_EXPORT, matches routes tagged with it, and applies a rejection policy.

Exam Tip:
You might see a config block and be asked:

“What does this policy do to routes with the no-export community?”
Correct answer: Rejects them before advertising to external peers.

4. BGP is a Path Vector Protocol, Not Link-State

Unlike OSPF or IS-IS, BGP does not use Dijkstra's SPF algorithm to build a network topology. Instead, it maintains AS-level path information and uses attributes to choose the best route.

BGP is a path vector protocol, not a link-state protocol, and does not use SPF (Dijkstra).

Core Selection Attributes:

  1. Weight (local, Cisco only)

  2. Local Preference (higher is better)

  3. AS-PATH length (shorter is better)

  4. Origin (IGP < EGP < Incomplete)

  5. MED (lower is better)

  6. EBGP over IBGP

  7. Shortest IGP path to next-hop

Exam Tip:
If you are given a list of protocols and asked which uses Dijkstra’s algorithm, do not pick BGP.

5. Common Juniper BGP Commands and Configuration Recognition

While you may not be asked to write full CLI configurations in JN0-351, you will need to interpret or validate existing config fragments.

Important Commands:

  • show route protocol bgp
    Displays all BGP-learned routes currently in the routing table.

  • show bgp summary
    Shows BGP peer states, number of prefixes received, and session status.

  • show route receive-protocol bgp <neighbor>
    Lists the routes received from a specific peer (regardless of RIB installation).

Configuration Recognition Example:

set protocols bgp group EBGP type external
set protocols bgp group EBGP peer-as 65100
set protocols bgp group EBGP neighbor 203.0.113.1

Exam Tip:
A question might present this configuration and ask whether this is an EBGP or IBGP session based on the peer-as.

Summary – Critical Juniper BGP Knowledge for Exam Success

Topic Key Exam Insight
IBGP Full Mesh & RR Route Reflectors prevent the full-mesh requirement among IBGP peers
Next-Hop Reachability BGP routes are rejected if the next-hop isn’t resolvable via IGP
Community Attribute Control Communities are matched in policy-options and applied via policy-statements
Path Selection Logic BGP uses attributes; it is not link-state and does not use SPF
CLI Interpretation Be able to interpret set protocols bgp group ... and analyze common show cmds

Frequently Asked Questions

What attribute is evaluated first during the BGP best-path selection process?

Answer:

The highest local preference is evaluated first.

Explanation:

When multiple BGP routes exist for the same prefix, routers apply a decision process to determine the best path. The first commonly evaluated attribute is local preference, which indicates the preferred outbound path inside an autonomous system.

Higher local preference values are preferred. Network administrators often modify this value to influence outbound traffic flow between different Internet providers.

Demand Score: 95

Exam Relevance Score: 94

What is the difference between iBGP and eBGP?

Answer:

iBGP exchanges routes within the same autonomous system, while eBGP exchanges routes between different autonomous systems.

Explanation:

External BGP (eBGP) is used for routing between organizations or service providers. Internal BGP (iBGP) distributes those routes within the same autonomous system.

A key rule in iBGP is the full-mesh requirement, meaning every router must form a BGP session with every other router unless route reflectors are used.

Demand Score: 90

Exam Relevance Score: 92

What is the purpose of the AS-Path attribute?

Answer:

The AS-Path attribute records the sequence of autonomous systems a route has traversed.

Explanation:

Every time a route passes through an autonomous system, the AS number is appended to the AS-Path attribute.

This attribute provides loop prevention and is also used during route selection. In general, routes with shorter AS-Paths are preferred because they represent shorter paths through the Internet.

Demand Score: 88

Exam Relevance Score: 90

What is a BGP route reflector?

Answer:

A route reflector allows routers to share iBGP routes without requiring a full mesh.

Explanation:

In large networks, establishing BGP sessions between every router becomes complex. A route reflector reduces this requirement by redistributing routes between client routers.

Clients send routes to the route reflector, which then advertises them to other clients. This design greatly simplifies large enterprise and service-provider networks.

Demand Score: 87

Exam Relevance Score: 90

Why might a BGP route appear in the BGP table but not in the routing table?

Answer:

Another route may have a better preference or metric.

Explanation:

Routers often learn routes from multiple sources such as OSPF, static routes, and BGP. Even if a BGP route is present in the BGP table, it may not be installed in the routing table if another route has a better preference value.

Troubleshooting requires checking both the BGP table and the main routing table.

Demand Score: 85

Exam Relevance Score: 91

What does the NEXT_HOP attribute indicate in BGP?

Answer:

It identifies the next router that should receive traffic toward the destination.

Explanation:

The NEXT_HOP attribute specifies the IP address of the router that should be used to reach a specific network. In iBGP deployments, this value often remains unchanged, which may cause reachability issues if routers cannot reach that address.

Administrators frequently configure next-hop self to ensure proper routing.

Demand Score: 84

Exam Relevance Score: 89

JN0-351 Training Course