cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
737
Views
1
Helpful
0
Comments
adelaluz
Cisco Employee
Cisco Employee


Introduction

This document describes how to implement the iperf Docker container in XR Platforms running eXR (x86-64) code versions.

The iperf tool is a network testing utility that measures performance by generating and analyzing TCP and UDP data streams.

We will guide you on utilizing iperf within an eXR device using the built-in Docker engine for network testing and troubleshooting.

Contributed by Adan De La Luz and Daniel Gomez, Cisco TAC Engineers.

Prerequisites

Requirements

Before proceeding with the steps outlined in this article, ensure the following prerequisites are met:

  • A development setup with Docker installed.
  • Basic knowledge of working with Docker containers.
  • Access to the eXR device's command-line interface (CLI) with appropriate administrative privileges.
  • Familiarity with networking concepts such as TCP and UDP protocols
  • Knowledge of eXR (x86-64) devices and their configuration
  • Understanding of network performance testing and troubleshooting techniques

Components Used

The information in this document is based on these software and hardware versions:

  • NCS-5504 running 7.8.2 eXR code version
  • NCS-5504 running 7.6.2 eXR code version
  • eXR built-in Docker version 19.03.8-ce

The information in this document was created from the devices in a specific lab environment. All of the devices used in
this document started with a cleared (default) configuration. If your network is live, ensure that you understand the
potential impact of any command.

Related Products

This document can also be used with these hardware and software versions:

  • From IOS-XR Release 6.1.1, Cisco introduced support for the 64-bit Linux-based IOS XR operating system.
  • Any XR platform running eXR (x86-64) will have the Docker engine installed to enable the creation of containers.

Background Information

Docker technology revolutionizes the world of software deployment and containerization. At its core, Docker simplifies
application management by encapsulating applications and their dependencies into lightweight, portable containers.


These containers can run consistently across diverse environments, ensuring that applications behave predictably,
regardless of the underlying infrastructure. Docker achieves this through the use of Docker images, which serve as
templates for containers. These images are not only stackable and versioned but are also easily distributable and
shareable. Docker Hub, a prominent cloud-based repository, plays a pivotal role by hosting an extensive library of
Docker images. Developers and system administrators leverage Docker Hub to discover, download, and collaborate on
pre-built images, accelerating the development and deployment process. To create these Docker images, Dockerfiles are
employed, which are simple text files containing a series of instructions for configuring the containerized environment
and application. Dockerfiles empower users to craft custom Docker images tailored to their specific needs, providing
flexibility and efficiency in the world of containerization.

Configure

Network Diagram

App hosting.png

Step 1: Setting Up the Development Environment.

1. Ensure that you have Docker installed on your development machine. Refer to the Docker documentation for installation instructions specific to your operating system.

 

[tester@devtestenv ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux release 9.1 (Plow)

[tester@devtestenv ~]$ docker --version
Docker version 24.0.5, build ced0996

 

Step 2: Verifying Docker Status on the eXR Device.

1. Log in to the eXR device's CLI.

 

RP/0/RP0/CPU0:NCS-5504-B#show version | i Version
Wed Sep 20 00:11:29.046 JST
Cisco IOS XR Software, Version 7.8.2
 Version      : 7.8.2

 

2. Check the status of the Docker service by running the following command:

 

RP/0/RP0/CPU0:NCS-5504-B#bash
Wed Sep 20 00:08:49.375 JST
[NCS-5504-B:~]$ systemctl status docker
● docker.service - Docker Application Container Engine
     Loaded: loaded (/etc/systemd/system/docker.service; disabled; vendor preset: enabled)
     Active: inactive (dead) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com

 

Step 3: Starting the Docker Service

1. Start the Docker service on the eXR device by running the following command:

 

[NCS-5504-B:~]$ systemctl start docker

 

Step 4: Validating Docker Status and Imported Images.
1. Check the status of the Docker service on the eXR device to ensure it is running by executing the following command:

 

[NCS-5504-B:~]$ systemctl status docker
● docker.service - Docker Application Container Engine
     Loaded: loaded (/etc/systemd/system/docker.service; disabled; vendor preset: enabled)
     Active: active (running) since Wed 2023-09-20 00:09:13 JST; 2s ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 39980 (dockerd)
      Tasks: 35 (limit: 4915)
     Memory: 196.3M
     CGroup: /system.slice/libvirtd.service/system.slice/docker.service
             ├─39980 /usr/bin/dockerd --cgroup-parent=/machine/tp_app.partition/docker --bridge=none -H=unix:///misc/app_host/docker.sock --pidfile=/misc/app_host/docker.pid --data-root=/misc/app_host/docker --iptables=fa>
             └─40039 containerd --config /var/run/docker/containerd/containerd.toml --log-level info

Sep 20 00:09:13 NCS-5504-B exr_systemd_docker_start.sh[39980]: time="2023-09-20T00:09:13.572466976+09:00" level=warning msg="Your kernel does not support cgroup blkio throttle.read_bps_device"
Sep 20 00:09:13 NCS-5504-B exr_systemd_docker_start.sh[39980]: time="2023-09-20T00:09:13.572474723+09:00" level=warning msg="Your kernel does not support cgroup blkio throttle.write_bps_device"
Sep 20 00:09:13 NCS-5504-B exr_systemd_docker_start.sh[39980]: time="2023-09-20T00:09:13.572482249+09:00" level=warning msg="Your kernel does not support cgroup blkio throttle.read_iops_device"
Sep 20 00:09:13 NCS-5504-B exr_systemd_docker_start.sh[39980]: time="2023-09-20T00:09:13.572489666+09:00" level=warning msg="Your kernel does not support cgroup blkio throttle.write_iops_device"
Sep 20 00:09:13 NCS-5504-B exr_systemd_docker_start.sh[39980]: time="2023-09-20T00:09:13.574029686+09:00" level=info msg="Loading containers: start."
Sep 20 00:09:13 NCS-5504-B exr_systemd_docker_start.sh[39980]: time="2023-09-20T00:09:13.577648355+09:00" level=info msg="Loading containers: done."
Sep 20 00:09:13 NCS-5504-B exr_systemd_docker_start.sh[39980]: time="2023-09-20T00:09:13.669041669+09:00" level=info msg="Docker daemon" commit=afacb8b7f0d8d4f9d2a8e8736e9c993e672b41f3 graphdriver(s)=overlay2 version=19.0>
Sep 20 00:09:13 NCS-5504-B exr_systemd_docker_start.sh[39980]: time="2023-09-20T00:09:13.669295662+09:00" level=info msg="Daemon has completed initialization"
Sep 20 00:09:13 NCS-5504-B exr_systemd_docker_start.sh[39980]: time="2023-09-20T00:09:13.685182808+09:00" level=info msg="API listen on /misc/app_host/docker.sock"
Sep 20 00:09:13 NCS-5504-B systemd[1]: Started Docker Application Container Engine.

 

2. To verify the imported Docker images on the eXR device, use the command:

 

RP/0/RP0/CPU0:NCS-5504-B#bash
Wed Sep 20 00:13:19.653 JST
[NCS-5504-B:~]$ docker image ls
REPOSITORY           TAG                 IMAGE ID            CREATED             SIZE

 

Step 5: Getting the iperf Docker Image.
1. Identify a Docker image that supports the amd64/x86-64 architecture compatible with eXR platforms.

Note: Docker images can be designed to run on multiple architectures, which is crucial for supporting diverse hardware
environments. When you pull a multi-platform image from a Docker registry, such as Docker Hub, the image may contain
multiple architecture-specific layers, and Docker handles the selection of the appropriate layers based on your
system's architecture, so if your dev environment is x86-64, the image will inherit the architecture.

 

[tester@devtestenv ~]$ docker search iperf 
NAME                           DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
networkstatic/iperf3           IPerf3 Docker Build for Network Performance …   196                  [OK]  <<<<<<<<<<<<<

[tester@devtestenv ~]$ docker pull networkstatic/iperf3
Using default tag: latest
latest: Pulling from networkstatic/iperf3
1d5252f66ea9: Pull complete 
832b3072ce67: Pull complete 
Digest: sha256:79afcd17d056897a7a1d5948b32d9557ca03c2e52a0bbe759388a7c1aa807851
Status: Downloaded newer image for networkstatic/iperf3:latest
docker.io/networkstatic/iperf3:latest

[tester@devtestenv ~]$ docker inspect docker.io/networkstatic/iperf3:latest | grep "Architecture"
        "Architecture": "amd64",

 

Step 6: Exporting the Docker Image.

1. Export the chosen Docker image as a tar file on your development machine by running the following command:

 

[tester@devtestenv ~]$ docker save -o ubuntu-iperf-image.tar networkstatic/iperf3
[tester@devtestenv ~]$ ll ubuntu-iperf-image.tar 
-rw-------. 1 tester tester 85332992 Sep 19 11:28 ubuntu-iperf-image.tar

 

Step 7: Uploading the Docker Image to the eXR Device.

1. Transfer the iperf-image.tar file to your eXR device using the appropriate file transfer method, such as SCP or SFTP.

 

[tester@devtestenv ~]$scp ./ubuntu-iperf-image.tar dangome2@172.18.104.14:/harddisk: 
ubuntu-iperf-image.tar                                                                                                                                                                        100%   81MB   5.8MB/s   00:13 $ 

 

Step 8: Importing the Docker Image on the eXR Device.

1. Log in to the eXR device's CLI.

 

RP/0/RP0/CPU0:NCS-5504-B#dir harddisk:ubuntu-iperf-image.tar
Wed Sep 20 00:42:36.599 JST

Directory of harddisk:ubuntu-iperf-image.tar
162 -rw-------. 1 3866624 Sep 20 00:39 ubuntu-iperf-image.tar

35944064 kbytes total (15782772 kbytes free)

 

2. Import the Docker image from the transferred tar file by executing the following command:

 

RP/0/RP0/CPU0:NCS-5504-B#bash
Wed Sep 20 00:48:32.672 JST

[NCS-5504-B:~]$ docker load -i /misc/disk1/ubuntu-iperf-image.tar
8ce178ff9f34: Loading layer [==================================================>]  84.03MB/84.03MB
1b9aa83ebcfe: Loading layer [==================================================>]  1.291MB/1.291MB
Loaded image: ubuntu-iperf-image:latest

[NCS-5504-B:~]$ docker image ls
REPOSITORY             TAG                 IMAGE ID            CREATED             SIZE
ubuntu-iperf-image   latest              f2633a30407f        15 mins ago         81.8MB

 

Step 9: Starting the iperf client/server containers.

1. Launch the iperf containers on the eXR devices using the following command:

 

iPerf CLIENT
============
RP/0/RP0/CPU0:NCS-5504-B#bash
Wed Sep 20 00:43:36.599 JST
[NCS-5504-B:~]$ docker run  --net host --rm -t ubuntu-iperf-image -c 10.222.252.40 
Connecting to host 10.222.252.40, port 5201
[  5] local 22.22.22.22 port 62036 connected to 10.222.252.40 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  5.63 MBytes  47.3 Mbits/sec  216   1.40 KBytes       
[  5]   1.00-2.00   sec  2.45 MBytes  20.6 Mbits/sec  141   2.79 KBytes       
[  5]   2.00-3.00   sec  2.95 MBytes  24.7 Mbits/sec  155   25.1 KBytes       
[  5]   3.00-4.00   sec  2.95 MBytes  24.7 Mbits/sec  144   8.38 KBytes       
[  5]   4.00-5.00   sec  2.70 MBytes  22.7 Mbits/sec  141   6.98 KBytes       
[  5]   5.00-6.00   sec  2.70 MBytes  22.7 Mbits/sec  137   4.19 KBytes       
[  5]   6.00-7.00   sec  2.45 MBytes  20.6 Mbits/sec  130   2.79 KBytes       
[  5]   7.00-8.00   sec  2.70 MBytes  22.7 Mbits/sec  131   6.98 KBytes       
[  5]   8.00-9.00   sec  2.95 MBytes  24.7 Mbits/sec  128   47.5 KBytes       
[  5]   9.00-10.00  sec  2.95 MBytes  24.7 Mbits/sec  153   14.0 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  30.4 MBytes  25.5 Mbits/sec  1476             sender
[  5]   0.00-10.00  sec  29.9 MBytes  25.1 Mbits/sec                  receiver

iperf Done.

 

2. Analyze the results of the iperf tests to measure network performance and identify any issues or bottlenecks.

 

iPerf SERVER
=============
[NCS-5504-A:/]$ docker run -it --rm --net host --name iperf3-server -p 5201:5201 ubuntu-iperf-image -s
WARNING: Published ports are discarded when using host network mode
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 22.22.22.22, port 62034
[  5] local 10.222.252.40 port 5201 connected to 22.22.22.22 port 62036
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  5.08 MBytes  42.6 Mbits/sec                  
[  5]   1.00-2.00   sec  2.63 MBytes  22.1 Mbits/sec                  
[  5]   2.00-3.00   sec  2.71 MBytes  22.8 Mbits/sec                  
[  5]   3.00-4.00   sec  3.16 MBytes  26.5 Mbits/sec                  
[  5]   4.00-5.00   sec  2.60 MBytes  21.8 Mbits/sec                  
[  5]   5.00-6.00   sec  2.62 MBytes  22.0 Mbits/sec                  
[  5]   6.00-7.00   sec  2.59 MBytes  21.7 Mbits/sec                  
[  5]   7.00-8.00   sec  2.59 MBytes  21.7 Mbits/sec                  
[  5]   8.00-9.00   sec  3.09 MBytes  25.9 Mbits/sec                  
[  5]   9.00-10.00  sec  2.80 MBytes  23.5 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.00  sec  29.9 MBytes  25.1 Mbits/sec                  receiver
-----------------------------------------------------------
Server listening on 5201
----------------------------------------------------------- 

 

Step 10: Cleaning up.

1. Optionally, remove the imported Docker image from the eXR device using the command:

 

[NCS-5504-B:~]$ docker image rm ubuntu-iperf-image
Untagged: networkstatic/iperf3:latest
Deleted: sha256:f2633a30407fcde63ffd23a4a0ba4bb8c7551c3e2b2d75b753d8cec4b5cf1452
Deleted: sha256:aec414c3206c046e08148eb96fd958a54d0fc68732464385751830e47f924795
Deleted: sha256:8ce178ff9f343a37169f68dd0df03099524afb71a879551c5f17e493c7b1d3ec

 

2. Optionally, deactivate the docker daemon to save memory resources in your eXR environment.

 

[NCS-5504-B:~]$ systemctl stop docker

[NCS-5504-B:~]$ systemctl status docker
● docker.service - Docker Application Container Engine
     Loaded: loaded (/etc/systemd/system/docker.service; disabled; vendor preset: enabled)
     Active: inactive (dead)
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com

 

Conclusion:

In this article, we explored how to use the iperf tool within an eXR device using the built-in Docker container. By
leveraging Docker, you can conveniently conduct network performance testing and troubleshooting directly from your eXR
device. We covered the setup of the development environment, verification of Docker status, importing and running the
iperf Docker image, executing iperf tests, and cleaning up the environment. By following these steps, you can gain
valuable insights into your network's performance and resolve any performance-related issues effectively.

Next Steps:

Now that you have learned how to use iperf with Docker on an eXR device, you can further enhance your network testing
skills by exploring advanced iperf features and experimenting with different test scenarios. Additionally, consider
exploring other Docker-based network tools like implementing a tcpdump container or bringing up a TIG telemetry

stack.

Related Information

 

 

 

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links