Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Open Virtual Network unidling

January 27, 2020
Lorenzo Bianconi
Related topics:
ContainersKubernetesEvent-Driven

Share:

    Open Virtual Network (OVN) is a project born as a sub-component of Open vSwitch (OVS), which is a performant, programmable, multi-platform virtual switch. OVN allows OVS users to natively create overlay networks by introducing virtual network abstractions such as virtual switches and routers. Moreover, OVN provides methods for setting up Access Control Lists (ACLs) and network services such as DHCP. Many Red Hat products, like Red Hat OpenStack Platform, Red Hat Virtualization, and Red Hat OpenShift Container Platform, rely on OVN to configure network functionalities.

    In this article, I will cover the OVN unidling issue and how the proposed solution can be used to forward events to a CMS (e.g., OpenStack or OpenShift).

    Unidling problem: OpenShift use case

    A simplified OVN-Kubernetes deployment is shown in Figure 1. The overlay network is connected to an external one through a localnet port (ln-public, in this case):

     

    OVN-Kubernetes deployment network diagram
    Figure 1: A simplified OVN-Kubernetes deployment.">

    Below is the related OVN NB database network configuration:

    switch e2564770-8658-4086-8f41-9995d5ff0da2 (sw1)  
       port sw1-p0  
       addresses: ["00:00:00:00:00:33 192.168.2.11"]  
       port lrp1-attachment  
       type: router  
       addresses: ["00:00:00:ff:00:02"]  
       router-port: lrp1  
    switch 512be578-1c95-4ac0-b196-8f5ef38a1517 (sw0)  
       port sw0-p0  
       addresses: ["00:00:00:00:00:11 192.168.1.11"]  
       port sw0-p1  
       addresses: ["00:00:00:00:00:12 192.168.1.12"]  
       port lrp0-attachment  
       type: router  
       addresses: ["00:00:00:ff:00:01"]  
       router-port: lrp0  
    switch ee2b44de-7d2b-4ffa-8c4c-2e1ac7997639 (public)  
       port ln-public  
           type: localnet  
           addresses: ["unknown"]  
       port lrp2-attachment  
           type: router  
           addresses: ["00:00:00:00:ff:03"]  
           router-port: lrp2  
    router 681dfe85-6f90-44e3-9dfe-f1c81f4cfa32 (lr0)  
       port lrp2  
           mac: "00:00:00:00:ff:03"  
           networks: ["192.168.3.254/24"]  
       port lrp1  
           mac: "00:00:00:00:ff:02"  
           networks: ["192.168.2.254/24"]  
       port lrp0  
           mac: "00:00:00:00:ff:01"  
           networks: ["192.168.1.254/24"]  
    

    OVN Load Balancer (LB) services are used to demultiplex traffic between running pods. LB configuration is stored in the OVN Northd (OVN-NB) database's Load_Balancer table:

    _uuid               : 7381bdc2-cb26-40e9-93db-d7f733c8afbd  
    external_ids        : {}  
    health_check        : []  
    ip_port_mappings    : {}  
    name                : lb0  
    protocol            : tcp  
    vips                : {"192.168.1.100:80"="192.168.1.11:80,192.168.1.12:80"}  
    

    However, after an inactivity timeout, a given pod can be powered down by OpenShift and the related backends are removed from the load balancer configuration, resulting in a Virtual IP (VIP) with no backends:

    _uuid               : f93bca28-87b4-4d98-9193-b49644f15ee6  
    external_ids        : {}  
    health_check        : []  
    ip_port_mappings    : {}  
    name                : lb0  
    protocol            : tcp  
    vips                : {"192.168.1.100:80"=""}  
    

    As a consequence, the system results in a deadlock state, because a new packet for the suspended service will not be forwarded by OVN to the related pod without a proper network configuration.

    Proposed solution: Controller_Event

    In order to overcome this limitation, a solution has been proposed by which a new table, Controller_Event, has been added to the OVN Southbound database. Moreover, new trigger_event logical flows have been introduced into OVN pipelines in order to generate a controller event whenever an IP packet for an LB rule with no backends is received by OVN:

     table=4 (ls_in_pre_lb       ), priority=130  , match=(ip4.dst == 192.168.1.100 && tcp && tcp.dst == 80), action=(trigger_event(event = "empty_lb_backends", meter = "event-elb", vip = "192.168.1.100:80", protocol = "tcp", load_balancer = "38350663-862f-4aae-94e7-c0149e11d293");)
    

    The OVN trigger_event action will convert an unsolicited event into a new row in the Controller_Event table, allowing the CMS to be notified about the request for the "suspended" service:

    _uuid               : c4d5493a-a630-47f8-adbb-e20a402e69de  
    chassis             : 24852cd2-bea6-48fd-b77a-95d2e47c836c  
    event_info          : {load_balancer="9d6542eb-6533-4d3c-b0a5-4e54826968b6", protocol=tcp, vip="192.168.1.100:80"}  
    event_type          : empty_lb_backends  
    seq_num             : 1
    

    Recently, Controller Event has been also integrated into ovn-kubernetes.

    Future development

    Since the proposed framework is not tied just to the unidling scenario, a possible future enhancement to the described methodology could be to extend the trigger_event action in order to report more unsolicited events to the attention of the CMS in order to allow it to take necessary actions.

    Additional resources

    Check out these other articles related to OVN and OVS:

    • How to create an Open Virtual Network distributed gateway router
    • Dynamic IP address management in Open Virtual Network (OVN): Part One
    • Dynamic IP address management in Open Virtual Network (OVN): Part Two
    • Non-root Open vSwitch in RHEL
    • Open vSwitch-DPDK: How Much Hugepage Memory?
    • Open vSwitch: QinQ Performance
    • IP packet buffering in OVN
    Last updated: June 29, 2020

    Recent Posts

    • How to run AI models in cloud development environments

    • How Trilio secures OpenShift virtual machines and containers

    • How to implement observability with Node.js and Llama Stack

    • How to encrypt RHEL images for Azure confidential VMs

    • How to manage RHEL virtual machines with Podman Desktop

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue