Instrumenting your first 5G Edge application

Log in to AWS
  • Learning how Verizon 5G Edge is built right with ultralow latency

    Have you just launched your first application on AWS Wavelength and are unsure what to do next? This tutorial covers popular techniques using open-source and AWS-developed techniques to monitor your application latency on Verizon’s 5G Ultra Wideband (UWB) network.


    What am I building?

    After launching your first instance, you might be questioning what the latency characteristics are from the application to the client. Moreover, you might be asking, How do I ping a remote endpoint from a mobile device? In this tutorial, you’ll learn how to run a lightweight Linux® distribution on the mobile device, with the appropriate configuration, to take advantage of all the network performance tools you may encounter from a laptop, virtual machine (VM) or container. 

    More specifically, we’ll cover two prominent measurement techniques and tools:

    • httpstat: To view the components that make up your E2E latency—from DNS and underlying TCP connection to the content transfer itself—consider using httpstat, a Python® script that reflects cURL statistics in a simple and well-defined way

    • iPerf3: To measure uplink and downlink bandwidth, consider using iPerf3, an open source tool to measure the maximum achievable bandwidth on IP networks for both TCP and UDP connections


    What am I measuring?

    Beyond the absolute end-to-end latency (ms) and bandwidth (Mbps) measurements, consider using these tools to benchmark performance to the parent region. Said differently, as you measure performance of your mobile UE to your 5G Edge infrastructure, make sure to also compare the performance of the same UE to the parent region.

    As a practical example, consider if you live in the Boston metropolitan area and launch an iPerf instance in us-east-1-wl1-bos-wlz-1 (Boston Wavelength Zone). After recording performance characteristics in the Wavelength Zone, consider launching an additional iPerf instance in the parent region,  us-east-1 (North Virginia), to understand the comparative benefits in 5G Edge vs. the parent region.

  • Getting Started

    For Android devices
    Navigate to the Google Play® Store and search for the app Termux. Termux is an Android® terminal emulator and Linux environment app that works directly with no rooting or setup required. To learn more, visit the Termux web page.

    Next, to install cURL and python, there are a couple of simple commands. Note that you may not have root (sudo) privileges on your device, especially on the Nova platform:

    pkg install curl
    pkg install python (installs the most recent version)
    pkg install wget

    For iOS devices

    Simply download the TestFlight app from the Apple® App Store®. Then open a browser and go to http://ish.app. Scroll down and click to join the TestFlight beta. Once iSH is installed on your iPhone®, install Python and cURL using the Alpine package manager using the following commands:

    apk add python3
    apk add curl

    Download and run iPerf.

    For your first performance testing, consider using iPerf3. iPerf3 is a tool for active measurements of the maximum achievable bandwidth on IP networks. It supports tuning of various parameters related to timing, buffers and protocols (TCP, UDP, SCTP with IPv4 and IPv6). For each test, it reports the bandwidth, loss and other parameters: 

    pkg install iperf #for Android
    apk add iperf #for iOS

    To run your own iPerf3 server on an EC2 instance, please follow the steps below:

    1. Connect to the launched EC2 instance via the process described above. Next, navigate to the instance’s security groups and open port 5201 for TCP traffic:
    2. sudo yum update
      sudo yum install iperf3 #RHEL/CentOS
      sudo iperf3 -s -D > iperf3log
      #Iperf3 will now be running on port 5201

    3. To check if iPerf is listening on port 5201, run the following command:
    4. netstat -ltn | grep -w ':5201'

    5. To run your first iPerf test, specify your iPerf server IP address to test TCP throughput and latency:
    6. iperf3 -c 155.146.10.171 -b 150M -t 30 -i 5 -P 25 -l 1400 -R

    7. To learn more about the configuration options on iPerf3, check out the documentation guide below:

    Command line option

    Description

    -c, --client host

    Run iPerf in client mode, connecting to an iPerf server running on host.

    -u, --udp

    Use UDP rather than TCP. See also the -b option.

    -b, --bandwidth n[KM]

    Set target bandwidth to n bits/sec (default 1 Mbit/sec for UDP, unlimited for TCP). If there are multiple streams (-P flag), the bandwidth limit is applied separately to each stream. You can also add a "/" and a number to the bandwidth specifier. This is called "burst mode." It will send the given number of packets without pausing, even if that temporarily exceeds the specified bandwidth limit.

    -t, --time n

    The time in seconds to transmit for. iPerf normally works by repeatedly sending an array of len bytes for time seconds. Default is 10 seconds. See also the -l-k and -n options.

    -n, --num n[KM]

    The number of buffers to transmit. Normally, iPerf sends for 10 seconds. The -n option overrides this and sends an array of len bytes num times, no matter how long that takes. See also the -l-k and -t options.

    -l, --length n[KM]

    The length of buffers to read or write. iPerf works by writing an array of len bytes a number of times. Default is 128 KB for TCP, 8 KB for UDP. See also the -n-k and -t options.

    -P, --parallel n

    The number of simultaneous connections to make to the server. Default is 1.

    -R, --reverse

    Run in reverse mode (server sends, client receives).

    -M, --set-mss n

    Attempt to set the TCP maximum segment size (MSS). The MSS is usually the MTU—40 bytes for the TCP/IP header. For Ethernet, the MSS is 1460 bytes (1500-byte MTU).

    -T, --title str

    Prefix every output line with this string.

    -C, --linux-congestion algo

    Set the congestion control algorithm (Linux only for iPerf 3.0, Linux and FreeBSD® for iPerf 3.1).

    Method 2: Download and run httpstat.

    To get started, for all mobile OS types, download the httpstat script by running the following command:

    wget https://raw.githubusercontent.com/reorx/httpstat/master/httpstat.py

    Now you’re all set! Just run the script, and be sure to include the IPv4 address (i.e., Carrier IP) of your web server.

    python httpstat.py [your_IP]