Coder Social home page Coder Social logo

ios-xr / pathchecker Goto Github PK

View Code? Open in Web Editor NEW
5.0 4.0 2.0 50 KB

A python application that uses Netconf to cause OSPF path failover based on iperf's result for jitter, packet loss etc. Extended further with Ansible for larger topologies.

License: Other

Python 62.65% Ruby 25.04% Shell 12.31%

pathchecker's Introduction

pathchecker

Everything you need to know about running this application on a Vagrant setup with IOS-XR is documented in a hands-on fashion here:

https://xrdocs.github.io/application-hosting/tutorials/2016-07-09-pathchecker-iperf-netconf-for-ospf-path-failover/

This is essentially a quick & dirty netconf client script that changes ospf cost on an interface based on the result of an iperf session on a link through the same interface. Used with 2 Back-to-back paths between routers, it helps cause failover between paths based on iperf results. This is of course quite usecase specific, but is representative of how more complex failover applications may be designed and hosted on IOS-XR.

A representative test scenario is shown below:

topology

The usage of the application should be obvious based on the options it needs:

root@pod5:/home/ubuntu# ./pathchecker.py -h
usage: pathchecker.py [-h] --host HOST [-u USERNAME] [-p PASSWORD]
                        [--port PORT] [-c COST] [-o OSPF_PROCESS_NAME]
                        [-a AREA_ID] [-i INTERFACE] [-s IPERF_SERVER]
                        [-b BW_THRESHOLD] [-j JITTER_THRESHOLD]
                        [-l PKT_LOSS_THRESHOLD] [-t IPERF_INTERVAL] [-f] [-v]

Specify the parameters to influence interface cost for ospf:

optional arguments:
  -h, --help            show this help message and exit
  --host HOST           The device IP or DN
  -u USERNAME, --username USERNAME
                        Go on, guess!
  -p PASSWORD, --password PASSWORD
                        Yep, this one too! ;-)
  --port PORT           Specify this if you want a non-default port
  -c COST, --cost COST  Specify an interface cost
  -o OSPF_PROCESS_NAME, --ospf-process-name OSPF_PROCESS_NAME
                        Specify the ospf process name
  -a AREA_ID, --area-id AREA_ID
                        Specify the ospf area
  -i INTERFACE, --interface INTERFACE
                        Specify the ospf interface name
  -s IPERF_SERVER, --iperf-server IPERF_SERVER
                        Specify the iperf server ip address
  -b BW_THRESHOLD, --bw-threshold BW_THRESHOLD
                        Specify the BW threshold
  -j JITTER_THRESHOLD, --jitter-threshold JITTER_THRESHOLD
                        Specify the jitter threshold
  -l PKT_LOSS_THRESHOLD, --pkt-loss-threshold PKT_LOSS_THRESHOLD
                        Specify the pkt loss threshold
  -t IPERF_INTERVAL, --iperf_interval IPERF_INTERVAL
                        Specify the duration of an iperf run
  -f, --force-verdict   Force ospf cost change in case of iperf failure
  -v, --verbose         Do I really need to explain?
root@pod5:/home/ubuntu# 

Using Ansible

To solve this problem using Ansible and automate your steps in the same way as you would on actual routers, check out the ansible/ directory and the corresponind README.md

The topology we use with Ansible is:
topo

The relevant README.md: https://github.com/ios-xr/pathchecker/blob/master/ansible/README.md

For Larger Topologies

We reuse the Ansible playbook defined above to extend to larger topologies very easily. For this purpose a 6 router topology setup is used under the ansible/large_topology_example/ folder, as shown below: topo

The relevant README.md is here: https://github.com/ios-xr/pathchecker/blob/master/ansible/large_topology_example/README.md

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.