Sunday, May 31, 2020

Segment Routing - Topology Independent LFA

Combination of segment routing and Loop Free Alternate is known as Topology Independent LFA or Ti-LFA. The main reason for configuring LFA is to provide the protection against the destination prefixes. In case of failure of primary link, source node calculates the backup the path as described in the "Loop Free Alternate: IP Fast Reroute (FRR)". The biggest disadvantage of the existing RSVP-TE-Fast reroute, Loop Free Alternate (LFA) and remote LFA, which has seen wide adoption can't guarantee 100% coverage for all failure scenarios. As per the RFC 6571, section 4.3, simulation results proves that LFA provides average 89% coverage across various topologies.

Below are the various types of issues which can be seen with Loop Free Alternate(LFA) and Remote Loop Free Alternate(rLFA)

1. LFA has issue with topology more than 3 nodes. With 3 nodes topology it perfectly works good. If the topology has more than 3 nodes, micro loop can occur as per shown in the image.
2. Micro-Loop avoidance can be taken care by finding PQ node as per RFC 7490. XR-1 will create T-LDP session with XR-3, XR-3 has the best path to XR-5 via XR-4.
3. Now increase the metric to 100 between XR-3 and XR-4. In this case, if XR-1 creates T-LDP session XR-3, XR-3 will again finds XR-1 as best and forward the traffic back to XR-3. This will be same as of micro loop.
Implementing Segment Routing with Topology Independent LFA (TI-LFA) provides 100% loop-free guaranteed coverage against any link, SRLG and node failure. Ti-LFA protects both labelled as well as unlabelled traffic. Stay tuned for the upcoming post how Ti-LFA solves the above issues by leveraging Segment Routing.

Click Here To Read Rest Of The Post...

Sunday, May 24, 2020

What is data model - Yang ?

Data model provides the definition of any "anything" which can be easily understood and agreed upon. Using the generic data model, you can describe an individual in a way that is easy for others to understand.

Whatever the communication is done by using the API's are actually encoding in some data format and most of them uses the data model underneath. This is what we will be discussing in this post. Let's see how this can be understood by creating data model of car:
Module CAR
OEM: Ford, Volkswagen, Maruti
Engine: Diesel, Pertol
Color: Blue, Green,Black
Type: Sedan, Hatchback

Which language is used to define data models?
YANG is not name of any person but YANG (Yet Another Next Generation) is a data modelling language uses YANG language to write YANG models, providing a standardized way to model the operational and configuration data of a network device. YANG, being a language protocol independent, can then be converted into any data format encoding like XML or JSON. YANG is a language for describing any type of data models. But it was originally designed for networking data models. Below are good aspects of YANG to remember:
It is a very structured language
Every data model is a module
Containers are used to group related type of nodes.
Lists (It's same programming list) is used to identify nodes that are stored in sequence. 
Data types can be imported from another YANG module or defined within a module.
Each individual attribute of a node is represented by a leaf.

Where do these YANG models come from? Who writes these data models? Anyone having knowledge of YANG programming can easily write a YANG model. These data models mainly categorized into as open models and native models.
Open Models:  Designed to be platform and OEM independent models. These are mainly written by standard bodies like IETF and Open Config
Native Models: These models are mainly written by OEM and specific to platform or operating system. 

Open and Native data models can further classified into two different data models:
Device Data Models: Interfaces, Vlans, OSPF, ACL
Service Data Models: layer 3 vpn, layer 2 vpn, 

YANG model is made up from various components as shown in the image (Image copied from Cisco Live Dev Net Presentation)

Container - Infomration is logically grouped into form of containers. Such container is for configuration and one for state. List - Container contains list or even multiple lists. Such as a list of interfaces. Key - Each item within the list is references via a key (unique key). Leaf - Inside list we have leaf's. It contains information. Data Type - Each leaf is associated with a data type.

Click Here To Read Rest Of The Post...

Friday, May 22, 2020

What is Application Programming Interface?

As per wiki, "An application programming interface (API) is a computing interface which defines interactions between multiple software intermediaries. It defines the kinds of calls or requests that can be made, how to make them, the data formats that should be used, the conventions to follow, etc."

I also like one more definition from Kin Lane API 101 guide, "API allows your product or service to talk to other products or services".

APIs can work with any programming language, with the most popular approach to delivering web APIs being REST, or Representational State Transfer. REST is an API framework built on the top of HTTP protocol.By using REST API, request sent to the server and JSON and XML is received as response.

For network engineers, all need to understand that client(web app) will request the data in some data format from server. Server will send the response in particular data format to application.

Before moving ahead, need to understand the URI syntax as most of API calls will be in the given as per below format
IP address, Web Address and Port Numbers

Location of Interested Data On Server

What need to be fetched  

Below are the different type of HTTP requests which can be sent to server:
PostCreate RequestCreate New Object
GetRead RequestRead The Existing Object Or Fetch Existing Resources Details
PutUpdate RequestUpdate the Existing Resources
DeleteDelete RequestDelete Existing Resources

Once request is sent, we have to wait for the response. Response can have below mentioned codes which can be used to understand in case of successful response or unsuccessful response.
Status CodePurpose
200Create Request
404Not Found
500Internal Server Error
503Service Unavailable

Let's get our hands dirty. I am using CISCO always on apic controller sandbox for simulating restapi along with POSTMAN as restapi client. Open you postman client add the static info or if you want to use it for multiple requst during that case better you create enviorment varibles. I have already created a variable enviorment and sending the GET request to APIC controller: {{ apic}} = sandboxapicem. Replace apic with sandboxapicem

HTTP GET Request: After autnrication, this request is requesting server to share the list of network devices.

HTTP GET Response: The below response will come in JSON. Removed rest of the part due to brevity.
    "response": [
            "location": null,
            "type": "Cisco 3500I Unified Access Point",
            "serialNumber": "FGL1548S2YF",
            "errorCode": "null",
            "role": "ACCESS",
            "family": "Unified AP",
            "macAddress": "68:bc:0c:63:4a:b0",
            "softwareVersion": "",
            "lastUpdateTime": 1590153808018,
            "locationName": null,
            "tagCount": "2",
            "hostname": "AP7081.059f.19ca",
            "inventoryStatusDetail": "NA",
            "upTime": null,
            "series": "Cisco 3500I Series Unified Access Points",
            "errorDescription": null,
            "lastUpdated": "2020-05-22 13:23:28",
            "roleSource": "AUTO",
            "apManagerInterfaceIp": "",
            "bootDateTime": null,
            "collectionStatus": "Managed",
            "interfaceCount": null,
            "lineCardCount": null,
            "lineCardId": null,
            "managementIpAddress": "",
            "memorySize": "NA",
            "platformId": "AIR-CAP3502I-A-K9",
            "reachabilityFailureReason": "NA",
            "reachabilityStatus": "Reachable",
            "snmpContact": "",
            "snmpLocation": "default location",
            "tunnelUdpPort": "16666",
            "instanceUuid": "cd6d9b24-839b-4d58-adfe-3fdf781e1782",
            "id": "cd6d9b24-839b-4d58-adfe-3fdf781e1782"

Click Here To Read Rest Of The Post...