Tuesday, April 21, 2020

Segment Routing Deployment - Control and Data Plane


Basics Of Segment Routing covers that node steers a packet through an ordered list of instructions, called segments. A segment can represent any instruction, topological or service based. The advantage of using Segment Routing (SR-MPLS) over LDP and RSVP was clearly explained in earlier post of “Segment Routing Based MPLS Vs Classic MPLS”.

This post is used to learn and practice Segment Routing concepts and configuration on Cisco IOS-XR based platform. By the end of this example, one can easily understand how to enable SR with ISIS, SRGB, SIDs and it’s advertisements.

We will be using the below topology to understand how SR can be used in the network.

In the context of an IGP-based distributed control plane, two topological segments are defined: the IGP Adjacency segment and the IGP-Prefix segment. In the context of a BGP-based distributed control plane, two topological segments are defined: the BGP peering segment and the BGP-Prefix segment.
IGP-Adjacency Segment: an IGP-Adjacency segment is an IGP segment attached to a unidirectional adjacency or a set of unidirectional adjacencies. By default, an IGP-Adjacency segment is local (unless explicitly advertised otherwise) to the node that advertises it. Also referred to as "Adj-SID".

IGP-Prefix Segment: an IGP-Prefix segment, also referred to as "prefix-SID", is an IGP segment representing an IGP prefix. When an IGP-Prefix segment is global within the SR IGP instance/topology, it identifies an instruction to forward the packet along the path computed using the routing algorithm specified in the algorithm field, in the topology, and in the IGP instance where it is advertised. It is advertised as an index into the node specific SR Global Block or SRGB.

IGP-Node Segment: an IGP-Node segment is an IGP-Prefix segment that identifies a specific router (for example, a loopback). Also referred to as "Node Segment".

SR Global Block (SRGB): the set of global segments in the SR domain (the range of labels reserved for segment routing). In SR-MPLS, SRGB is a local property of a node and identifies the set of local labels reserved for global segments. In SR-MPLS, using identical SRGBs on all nodes within the SR domain is strongly recommended. Doing so eases operations and troubleshooting as the same label represents the same global segment at each node. The SRGB default value is 16000 to 23999.

SR Local Block (SRLB): local property of an SR node. In SR-MPLS, SRLB is a set of local labels reserved for local segments.

Enter the following commands to enable Segment Routing on Node S1, S2, L3, L4 and P5 as per above figure.
       

router isis 
address-family ipv4 unicast   
segment-routing mpls 
! 
interface Loopback0   
address-family ipv4 unicast    
prefix-sid index 
!  
segment-routing 
!
How does the SID encoding works:
Prefix SID
• Label form SR Global Block (SRGB)
• SRGB advertised within IGP via TLV
• Prefix-SID can be configured as an absolute value or an index
• In the protocol advertisement, Prefix-SID is always encoded as a globally unique index. Index represents an offset from SRGB base, zero-based numbering, i.e. 0 is 1st index E.g. index 1, SID is 16,000 + 1 = 16,001
       
Prefix-Sid index 1 means that S1 router will be having 16000+1=16001 prefix-sid. Similar way, S2 will have Prefix-Sid index 2 means S2 
router will be having 16000+2=16002 prefix-sid.
Adjacency SID - This is used for physical links
• Locally significant
• Automatically allocated by the IGP for each adjacency
• Always encoded as an absolute (i.e. not indexed) value

Below is the output on L4 node which clearly shows that every router is able to generate the SR value by using Prefix-Sid Index value

Show ipv4 interface brief


Output of Show route shows that the destination 5.5.5.5 is getting load balanced and no FRR is configured for the same.

Out of Show cef shows that destination 5.5.5.5 is using SR labeled stack.

Output of Show mpls forwarding plane - This is how the data plane is working. Isn't it like MPLS, the only difference is that under prefix-ID - SR Pfx is used.
       
Where possible, it is recommended that identical SRGBs be configured on all nodes in an SR domain.  This simplifies troubleshooting as the same 
label will be associated with the same prefix on all nodes. In addition, it simplifies support for anycast.

Output of show mpls forwarding labels 16005 detail


Output of "Traceroute sr-mpls" shows that SR label 16005 is used for forwarding and PHP is taken care by the second last node.

Click Here To Read Rest Of The Post...

Monday, April 20, 2020

gRPC - Quick Refresher


gRPC is a high performance, open source RPC framework initially developed by Google. It helps in eliminating boilerplate code and helps in connecting multiple services in and across data centers. It’s open-source, free-to-use and available on many different development platforms.

The framework is based on a client-server model of remote procedure calls. A client application can directly call methods on a server application as if it was a local object.

gRPC embraces HTTP semantics over HTTP/2, allows for client-server and duplex streaming of data and relies on protocol buffers(protobuf) as a serialization mechanism that allows it to be efficient. It provides low-latency and highly distributed systems such as microservices due to its efficiency, we can call remote methods the same way we call normal methods.

A number of different organizations have adopted gRPC, such as Square, Netflix, CoreOS, Docker, CockroachDB, Cisco, Nokia and Juniper Network and many more for streaming network telemetry instead of using SNMP. Stay tuned for the next post covering telemetry uses cases by using gRPC in networking.


Click Here To Read Rest Of The Post...

Sunday, April 19, 2020

Basics of HTTP: HTTP/1.1 and HTTP/2.0 - Required For Telemetry


Remote Procedure Calls (RPC) is not a protocol, it's a principle that is also used in SOAP. SOAP is an application protocol that uses HTTP for transport. HTTP (Hypertext Transfer Protocol) is the most popular client-server application-level protocol used in the Internet. As from RFC2616: "The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems. It is a generic, stateless, protocol which can be used for many tasks beyond its use for hypertext, such as name servers and distributed object management systems, through extension of its request methods, error codes and headers".

Being stateless, the new request doesn't know what has been sent in the previous request. It is purely based on pull model, which means server will only share that information what is being requested by client. It negotiates of data type and it's representation, so as to allow systems to be built independently of the data being transferred.

It typically runs over a TCP/IP connection and requires a reliable transport. But any transport protocols that provide such reliable delivery can be used.

There are 2 classes of HTTP Protocol. HTTP/1.0 is the initial major version of HTTP network protocol. HTTP/2 (originally names HTTP/2.0) is subsequent major version of HTTP. HTTP 1.0 was sensitive to high latency connections, as every request had to be made sequentially. If two requests made simultaneously, you had to wait until the first was completed before making the second.

HTTP 1.1 improved this, by enabling pipelining. If the user wanted to make simultaneously two requests, they could send off both requests and then receive the responses back in order. However this suffered from head-of-line blocking problem, consequences intensive or slow request completed.

HTTP/2 aims to address these issues by changing how the client and server communicate over the wire. To do this it introduces two new concepts: frames and streams:
Frames: The smallest unit of communication in HTTP/2, each containing a frame header, which at a minimum identifies the stream to which the frame belongs.
Stream: A bidirectional flow of bytes within an established connection, which may carry one or more messages.
Message: A complete sequence of frames that map to a logical request or response message.

The utmost focus of HTTP/2 is performance, especially latency as perceived by the end-user while using a browser, with a secondary focus on network and server resource usage. One large benefit of HTTP/2 is the ability to use a single TCP connection from a browser to a website as compared to multiple TCP connections in HTTP/1.1. HTTP/2 uses push model as compared to pull model used by HTTP/1.1. A single TCP connection is all that’s required because HTTP/2 leverages multiplexing and allows asynchronous (parallel) requests. Image credit goes to stackoverflow.


Excerpt from High Performance Browser Networking: HTTP/2 does not modify the application semantics of HTTP in any way. All the core concepts, such as HTTP methods, status codes, URIs, and header fields, remain in place. Instead, HTTP/2 modifies how the data is formatted (framed) and transported between the client and server, both of which manage the entire process, and hides all the complexity from our applications within the new framing layer. As a result, all existing applications can be delivered without modification.

It is important to note that HTTP/2 is extending, not replacing, the previous HTTP standards. The application semantics of HTTP are the same without having any changes in the core HTTP concept. While the high-level API remains the same, it is important to understand how the low-level changes address the performance limitations of the previous protocols. Let’s take a brief tour of the binary framing layer and its features.


Click Here To Read Rest Of The Post...