Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Network observability using TCP handshake round-trip time

February 27, 2024
Dushyant Behl Julien Pinsonneau Mohamed Mahmoud
Related products:
Red Hat OpenShiftRed Hat OpenShift Container Platform

    In Red Hat OpenShift Container Platform (RHOCP), ensuring efficient packet delivery is paramount for maintaining seamless communication between applications. However, challenges like network congestion, misconfigured systems, or hardware limitations can lead to slow connections, impacting overall performance. Round-trip time (RTT), typically measured in milliseconds, plays a crucial role in monitoring network health and diagnosing issues.

    Implementing smooth round-trip time (SRTT) with eBPF

    The RTT is the time it takes for a packet to travel from the sender to the receiver and back. In a network, RTT can vary due to factors like network congestion, varying route lengths, and other dynamic conditions. SRTT is introduced to provide a more consistent and less jittery representation of the RTT.

    In Transmission Control Protocol (TCP), RTT is a crucial metric.

    Our implementation leverages eBPF to register to fentry eBPF hook for tcp_rcv_established(). We extract the SRTT (smooth round-trip time) value from TCP sockets, correlating it to existing flows and enriching them with RTT values in nanoseconds.

    When a new NetObserv flow is created and the RTT feature is enabled, an initial RTT of 10usec is assigned. This initial value for RTT may be considered quite low.

    Upon triggering the eBPF socket, the flow RTT value is updated to reflect the maximum RTT value for that specific flow. See Figure 1.

    For more detailed explanation of smoothed RTT estimation, refer to Karn's algorithm paper.

    tcp RTT calculation
    TCP RTT calculation
    Figure 1: TCP RTT calculation.

    Why use fentry eBPF hook?

    The eBPF fentry programs have lower overhead as they trigger the hook before calling the kernel function of interest.

    In our implementation:

    1. Register and link fentry hook for kernel's tcp_rcv_established()
      SEC("fentry/tcp_rcv_established")
      int BPF_PROG(tcp_rcv_fentry, struct sock *sk, struct sk_buff *skb) {
          if (sk == NULL || skb == NULL) {
              return 0;
          }
          return calculate_flow_rtt_tcp(sk, skb);
      }
    2. Reconstruct the NetObserv flow key, including incoming interface Layer2, Layer3, and Layer4 info.

    3. Match existing flows in the PerCPU hashmap flow table and enrich them with SRTT info from TCP sockets. If multiple SRTT values exist for the same flow, we take the maximum value.

    Currently, our approach calculates RTT only for the TCP packets so flows, which are non-TCP, do not show RTT information.

    Potential use cases

    Flow RTT captured from eBPF flow_monitor hookpoints can serve various purposes.

    • Network monitoring: Gain insights into TCP handshakes, helping network administrators identify unusual patterns, potential bottlenecks, or performance issues.

    • Troubleshooting: Debug TCP-related issues by tracking latency and identifying misconfigurations.

    How to enable RTT

    To enable this feature, we need to create a FlowCollector object with the following fields enabled in eBPF config section as below.

    apiVersion: flows.netobserv.io/v1beta2
    kind: FlowCollector
    metadata:
      name: cluster
    spec:
      agent:
        type: eBPF
        ebpf:
          features:
            - FlowRTT

    A quick tour of the UI

    Once the FlowRTT feature is enabled, the RHOCP console plug-in automatically adapts to provide additional filter and show information across Netflow Traffic page views.

    Open your RHOCP console and move to Administrator view -> Observe -> Network Traffic page as usual.

    A new filter, Flow RTT is available in the common section. The FlowRTT filter will allow you to capture any flow that has an RTT more than a specific time in nanoseconds.

    For production users, filtering on the TCP protocol, Ingress direction, and looking for FlowRTT values greater than 10,000,000 nanoseconds (10ms) can help identify TCP flows with high latency. This filtering approach allows users to focus on specific network flows that may be experiencing significant delays. By setting a threshold of 10ms, you can efficiently isolate and address potential latency issues in your TCP traffic.

    Overview

    New graphs are introduced in the Advanced options -> Manage panels popup (Figure 2).

    advanced options
    advanced options
    Figure 2: Advanced options.
    • Top X average TCP handshake round-trip time with overall (donut or lines)
    • Bottom X minimum TCP handshake round-trip time with overall (donut or lines)
    • Top X maximum TCP handshake round-trip time with overall (donut or lines)
    • Top X 90th percentile TCP handshake round-trip time with overall (donut or lines)
    • Top X 99th percentile TCP handshake round-trip time with overall (donut or lines)

    These two graphs (see Figure 3) can help you to identify the slowest TCP flows and their trends over time. Use the filters to drill down into specific pods, namespaces, or nodes.

    RTT graphs
    RTT graphs
    Figure 3: RTT graphs.

    Traffic flows

    The table view (Figure 4) shows the Flow RTT in both column and side panel.

    RTT Table
    RTT Table
    Figure 4: RTT table.

    Topology

    Last but not least, the topology view displays min / max / avg / p90 / p99 RTT latency on edges. Clicking on a node or an edge will allow you to see per direction metrics and the related graph. See Figure 5.

    RTT topology
    RTT topology
    Figure 5: RTT topology.

    Future improvements

    Here is a non-exhaustive list of future improvements coming for a full featured round-trip time analysis:

    • Latest RTT in Topology view
    • Prometheus metrics and alerting

    Feedback

    We hope you liked this article!

    NetObserv is an open source project available on GitHub. Feel free to share your ideas, use cases, or ask the community for help.

    Related Posts

    • Network observability with eBPF on single node OpenShift

    • Secure your Kubernetes deployments with eBPF

    • Why you should use io_uring for network I/O

    • Network debugging with eBPF (RHEL 8)

    • How debugging Go programs with Delve and eBPF is faster

    • eBPF application development: Beyond the basics

    Recent Posts

    • Red Hat Enterprise Linux 10.2 and 9.8: Top features for developers

    • What GPU kernels mean for your distributed inference

    • Debugging image mode with Red Hat OpenShift 4.20: A practical guide

    • EvalHub: Because "looks good to me" isn't a benchmark

    • SQL Server HA on RHEL: Meet Pacemaker HA Agent v2 (tech preview)

    What’s up next?

    Share Image

    This cheat sheet gets you started using Ansible to automate tasks on Cisco Meraki, an enterprise-cloud managed networking solution for managing access points, security appliances, L2 and L3 switches, and more.

    Get the cheat sheet
    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    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
    © 2026 Red Hat

    Red Hat legal and privacy links

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

    Chat Support

    Please log in with your Red Hat account to access chat support.