Thursday, 13 October 2022

BGP Lab topology for AS123 (part one 1)

 


> Topology Overview:

- Routers RG 31/32 - peering routers 

- Routers RR-10 / RR-20 - route reflectors

- Ps and PEs - core and customer connectivity


BGP CONCEPTS


> Pourpouse of BGP:

- interconnect between different AS (interdomain communication)

- widely used in Service Provider, Large Enterprise and Datacenter enviroments

- multihomed customers

- scalable 

- created with stability in mind


> Main considerations

- trust one one - eBGP filter advertisment in and out 

- policy based 

- multiprotocol support IPv4/6, VPNv4/6 and VXLAN

- reliable updates

- triggered updates only

- uses rich metrics/attributes


> Internal BGP

- neighbourship between two nodes in the same AS

- AS-PAth is not updated when sending to iBGP

- BGP Split-horizon is used to prevent the loops, iBGP updates are not forwarded to any other iBGP peer

- BGP next-hop is not changed

- used to carry partial of full table of internet routing prefixes


> External BGP

- neigborship between two nodes with different AS numbers

- when router receives a route with its own AS in the AS Path the information is discarded  (loop prevention)

- used to exchange prefixes with other ASes

- implements routing policies


> RFC 4456 / Route Reflectors

- removes the need for Full Mesh IBGP

- loop prevention is done using non-transitive attribute called CLUSTER_LIST and adding it is own ID to it

- when router receives update which CLUSTER_LIST contains router's own cluster ID the update is discarded.

- By default BGP Router ID value is used for cluster ID - has to be 32bit and can be changed i.e.: 0.0.0.1

- Multiple cluster IDs (MCID) feature allows to assign per-neighbor cluster IDs


> Possible scenarios of route reflection

- Between client and non-client

- Between clients in the same cluster (intra-cluster)

- Between clients in different clusters (inter-cluster)

Monday, 12 September 2022

Routing protocols - ISIS brief


What is IS-IS?

- it is a link state protocol which originates from ISO 10589 - Connectionless Network Protocol (CLNP)

- was originally designed to support CLNS, still uses CLNS for its transport

- supports both IPv4 and IPv6

- mostly popular in large ISP environments 

- similarly to OSPF it runs Dijkstra SPF algorithm

- use Hello packets to manage adjacencies (IIHs)

- use areas and two-level hierarchy, only two types of the areas 

- summarisation is only possible on ABRs between areas 

- elects designated router (DIS) similar to OSPF DR except no backup DR (backup DIS)


Sample lab diagram:



NOTE. It is essential to understand that the IS-IS connectivity between areas relays on the level-1-2 adjacencies. 

Concepts and Operations: 
- Router is an Intermediate System and host is End System
- SNPA - Subnetwork Point of Attachment - concept that relates to data link/data switch
- Frame is Data Link PDU / Packet is Network PDU
- LSP - Link State PDU - LSP is a packet itself
- two types of areas: Level 2 - backbone area and Level 1 - a non backbone area
- Level 1/2 routers (similar to OSPFs ABRs) must have databases for Level 1 and 2 areas 
- Virtual-Link not suported by many vendors, but it is possible to expand L1/2 adjacency  
- in general much simpler that OSPF
- supports two metric types: narrow(only IPv4) & wide (both IPv4 and IPv6 recommended)

Hierarchy:
Level 1 routing - routing within area
Level 2 routing - routing between areas - backbone 

Design concepts for IS-IS:
- good addressing schema to summerize on ABRs
- need to plan CLNP addressing (NET)
- two layer hierarchy to limit LSP flooding and point of subnet summarization
- need to use wide metrics
- all interfaces by default are cost of 10
- cost needs to be set manually (plan cost per link speed then assign)
- allows up to 1000 routers per area - great for scalability


Thursday, 16 June 2022

DevNet notes - Linux - Bash (2)

grep basics

grep is a command line tool for searching plain text to match a regular expression

grep use examples:


#grep 'import' test_requests.py - will display line in the file that contains word 'import'


output:


    from turtle import title

    import requests

    from bs4 import BeautifulSoup


#grep -R 'import' . - will look for all files within the directory and subdirectories that contain word 'import'


output:


    ./test_urllib:import urllib3

    ./xml2-to-dict.py:import xmltodict

    ./xml-to-dict.py:import xmltodict

    ./eveng-request.py:import requests

    ./parse_yaml.py:import yaml

    ./test_requests.py:from turtle import title

    ./test_requests.py:import requests

    ./test_requests.py:from bs4 import BeautifulSoup

    ./automate-l1.py:from __future__ import print_function, unicode_literals

    ./automate-l1.py:import logging

    ./automate-l1.py:from netmiko import ConnectHandler, redispatch

    ./automate-l1.py:from netmiko import Netmiko

    ./automate-l1.py:from getpass import getpass

    ./json-test.py:import json

    ./parse_json.py:import json


other options:


'-i' - will make above search case sensitive, example:


#grep -R -i 'Cisco123' .


output:


    ./curl_get_token.sh:curl -X POST -u 'devnetuser:Cisco123!' -H 'Content-Type: application/json' https://sandboxdnac.cisco.com/dna/system/api/v1/auth/token


'-G' -indicates a standard regular expression, supports following metachracters:

     ^ beggining of the line

     $ end of the line

     . single character

     * zero or more occurences of the preceeding character

     [xyz] to match either 'x', 'y' or 'z'

     [d-f] or [1-3] to match character in the range between 'd-f' or '1-3'

     \< or \b to match beggining of the word

     \> to match end of the word

     \ escape character

     

'-E' -indicates extended regular expression, supports all above metacharacters used in standard expression and additionally:

     ? zero or one occurance of the proceeding character

     + one or more occurancess of the proceeding character

     {X} or {X,Y} strings with X repetition or X repetition but lower that Y repetition

     | operator 'OR'

     () capture group


'-F' -indicates fixed regular expression

'-P' -indicates Perl regular expression


Bash - echo command


echo " Hello! " - outputs the text inside quatation marks, also supports following escape characters:

    \n -new line

    \t -horizontal tab

    \v -vertical tab

    \b -backspace

    \\ -prints the backslash


echo - how to show variable/run command within quotation marks? use '$' sign, example:


lets set a variable:

#MY_VAR='0123456789'


use case:

#echo "my test variable is: $MY_VAR" 


output:

    my test variable is: 0123456789


another use example:

#echo "list of my files: $(ls)" - will return list of files in the current location


Monday, 9 May 2022

YANG Data Model (notes - part 1)

- YANG is defined in RFC 6020 

- defines hierarhy of data, structures data models in to modules and submodules

- used to model data for NETCONF

- permits the definition of reusable groupings of nodes

- RFC 6021 - describes common YANG types used in networking 

   these can be imported with import statment:

   

   import "ietf-yang-types" {

      prefix-yang;

   }

   - then as a reference when accessing definitions use "yang" as a prefix i.e.:

    type yang:port-number    


- Four types of nodes are used for data modeling:

   a) Leaf node(s) - smallest component, one value i.e. ipv4 address 

   b) Leaf-list - a sequence of leaf nodes with exactly one value of a

   particular type per leaf

   c) Container nodes - group related nodes in a subtree

   d) List nodes - defines a sequence of list entries


- examples of build-in YANG data types:

   a) binary

   b) bits

   c) boolean

   d) decimal64

   e) int8/16/32/64

   f) uint8/16/32/64

   g) empty

   h) string


- Derived Types (typedef)

   "typedef" statment can be used to define derived types, example:

     

       typedef listen-port {

         type uint16 {

         range "65520 .. 65530";

     }

     description "open ports for testing"

     }

   

   Derived type statments:

   a) default

   b) description

   c) status

   d) reference

   e) type

   f) units


- augment - is to add new schema nodes to a previously defined schema node

Plumbing... QoS

Rule no 1. QoS does not help in situations where there is no enough bandwidth but helps optimize performance by prioritization of the traffi...