Wednesday, 17 April 2019

OSPF Series 2: OSPF Neighbor States, OSPF Interface States and OSPF Neighborship Formation Requirements

OSPF NEIGHBOR STATES:

    • The below are the neighbour OSPF states:

\1. Down: no OSPF neighbors detected at this moment.

\2. Init: Hello packet received.

\3. Two-way: own router ID found in received hello packet. Then, DR and BDR determined

\4. Exstart: master and slave roles determined.

Thursday, 11 April 2019

OSPF Series 1: OSPF Introduction, and Different OSPF Packet Types and Formats

OSPF Introduction:

  • OSPF RFC- 2328 https://www.ietf.org/rfc/rfc2328.txt
  • To start the OSPF connection, we only need the directly connected connection .ie. only to the neighbour on the same network
  • So, on both the routers, we should run #network 10.0.0.1/24 and on the other #network 10.0.0.2/24 .
    • img

OSPF PACKET TYPES:

  • OSPF Packet Header:

    • The OSPF Packet Header is same for all the types of OSPF packets

Thursday, 28 March 2019

BGP Series 18: BGP Address-family Configuration

bgp complete

BGP Address-family Configuration:

.

  • The technical name of BGP is MBGP (multiprotocol BGP) which means it was designed from ground up to advertise multiple L3 protocol to its neighbors (independent of IPv4 or IPv6)...though it was initially used for IPv4

  • BGP doesn’t consider the routes as a route, for BGP, all routes whether IPv4 or IPv6 are all NLRI. So, in the same BGP update, we could have NLRI for IPv4 routes, NLRI for IPv4 multicast and IPv6 routes

  • Multiprotocol because BGP can advertise reachability to many different ‘routes’:

    • IPv4 unicast routes
    • IPv4 multicast routes
    • IPv6 unicast routes
    • VPNv4 routes (used in MPLS VPNs)
  • By default, BGP only advertises IPv4 prefixes

  • Address-families are used to inform BGP that it needs to advertise other types of NLRI. In the Open message, BGP will tell that it supports the additional NLRI capabilities as well when address-families are configured

  • By default, when we type in the ‘network’ command in router BGP it will consider it under IPv4 address-family automatically. We couldn’t type in IPv6 network even if we wanted to.

    • img
  • Say we have two routers R1 and R2 and the link between them is only configured with IPv4, but, we have both IPv4 and IPv6 links behind us--> theoretically, we could send IPv6 routes over to the neighbor along with the IPv4 routes. But, it doesn’t make sense since I don’t know if you understand IPv6 at all in this link. So, an IPv4 network and an IPv6 network must be configured on the link the both routers share

    • This point is because if we have to advertise IPv4 routes over the wire, we need to be able to speak IPv4 across the wire
    • Similarly, if we need to exchange IPv6 routes over this wire, we need to be able to speak IPv6 across this wire
    • So, we need to configure both IPv4 and IPv6 on the same link between the two routers
  • The main question to be answered (this is a design question, both are good):

    • Do you want two (2) BGP sessions-per-peer?

      • One IPv4 session and another IPv6 session?
    • Or only a single BGP session per peer?

      • Peering done via IPv4, and a single BGP update carries both IPv4 and Ipv6 prefixes, or….
      • Peering done via IPv6, and a single BGP update carries both IPv4 and Ipv6 prefixes
  • Thus, we have 3 options:

    • Two sessions- one for Ipv4, one for Ipv6
    • One session- IPv6 over IPv4
    • One session- IPv4 over IPv6
  • In the second methods above, we could have only one BGP session and save CPU/memory and that one session will have IPv4 section and IPv6 section...This is implemented via the number of neighbor statements we have under the router bgp

  • OPTION 1: One for IPv4, One for Ipv6:

Thursday, 14 March 2019

BGP Series 17: Other BGP Attributes: Origin Code, IGP Metric to Next-hop, BGP Multipath :

Other BGP Attributes: Origin Code, IGP Metric to Next-hop, BGP Multipath :

  • Origin Code:

    • BGP routes with origin attribute of ‘i’ > ‘e’ > ‘?’ is the order of preference

    • Usually, we will never see any routes with ‘e’ as origin code since that meant the routes originated on the old EGP routing protocol which is unused

    • In modern scenarios, we will see either routes having Origin code as

      • ‘i’ which means the routes originated via IGP and was injected into BGP via “network” command or “aggregate-address” command or “neighbor default-originate” command
      • ‘?’ which means the origin is unclear as the routes were redistributed into BGP

Wednesday, 6 March 2019

BGP Series 16: BGP Attributes: AS_PATH and MED

BGP Attributes: AS_PATH and MED:

.

  • AS_PATH Attribute:

    • It is a BGP attribute

    • Shortest length of AS_PATH is preferred when weight and local preference is same

    • It can be used to influence both inbound and outbound traffic

    • With AS_PATH prepending, we can make the AS_PATH longer for a path that is less preferred. Ideally, the local AS is prepended

    • Example:

      • In below example, we own AS-1 and both our routers ‘a’ and ‘b’ are advertising net-X to downstream neighbor...But, we want the downstream neighbor to choose ‘b’ .

      • Since I can’t change Weight in router ‘c’ which is not owned by me and I cant use local-pref since it is in a different AS