Giter Site home page Giter Site logo

quic-network-simulator's Introduction

Network Simulator for QUIC benchmarking

This project builds a test framework that can be used for benchmarking and measuring the performance of QUIC implementations under various network conditions. It uses the ns-3 network simulator for simulating network conditions and cross-traffic, and for bridging the real world with the simulated world. It uses docker for isolating and coercing traffic between the client and server to flow through the simulated network.

Framework

The framework uses docker-compose to compose three docker images: the network simulator (as found in the sim directory), and a client and a server (as found in the individual QUIC implementation directories, or for a simple shell, the endpoint directory).

The framework uses two networks on the host machine: leftnet (IPv4 193.167.0.0/24, IPv6 fd00:cafe:cafe:0::/64) and rightnet (IPv4 193.167.100.0/24, IPv6 fd00:cafe:cafe:100::/64). leftnet is connected to the client docker image, and rightnet is connected to the server. The ns-3 simulation sits in the middle and forwards packets between leftnet and rightnet.

      +-----------------------+
      |      client eth0      |
      |                       |
      |     193.167.0.100     |
      | fd00:cafe:cafe:0::100 |
      +----------+------------+
                 |
                 |
      +----------+------------+
      |     docker-bridge     |
      |                       |
      |      193.167.0.1      |
      |  fd00:cafe:cafe:0::1  |
+-----------------------------------+
|     |         eth0          |     |
|     |                       |     |
|     |      193.167.0.2      |     |
|     |  fd00:cafe:cafe:0::2  |     |
|     +----------+------------+     |
|                |                  |
|                |                  |
|     +----------+------------+     |
|     |         ns3           |     |
|     +----------+------------+     |
|                |                  |
|                |                  |
|     +----------+------------+     |
|     |         eth1          |     |
|     |                       |     |
|     |     193.167.100.2     |     |
|     | fd00:cafe:cafe:100::2 |  sim|
+-----------------------------------+
      |     docker-bridge     |
      |                       |
      |     193.167.100.1     |
      | fd00:cafe:cafe:100::1 |
      +----------+------------+
                 |
                 |
      +----------+------------+
      |      server eth0      |
      |                       |
      |    193.167.100.100    |
      |fd00:cafe:cafe:100::100|
      +-----------------------+

Building your own QUIC docker image

The endpoint directory contains the base Docker image for an endpoint Docker container. The pre-built image of this container is available on dockerhub.

Follow these steps to set up your own QUIC implementation:

  1. Create a new directory for your implementation (say, my_quic_impl). You will create two files in this directory: Dockerfile and run_endpoint.sh, as described below.

  2. Copy the Dockerfile below and add the commands to build your QUIC implementation.

    FROM martenseemann/quic-network-simulator-endpoint:latest
    
    # download and build your QUIC implementation
    # [ DO WORK HERE ]
    
    # copy run script and run it
    COPY run_endpoint.sh .
    RUN chmod +x run_endpoint.sh
    ENTRYPOINT [ "./run_endpoint.sh" ]
  3. Now, copy the script below into run_endpoint.sh, and add commands as instructed. Logs should be recorded in /logs for them to be available after simulation completion (more on this later).

    #!/bin/bash
    
    # Set up the routing needed for the simulation
    /setup.sh
    
    # The following variables are available for use:
    # - ROLE contains the role of this execution context, client or server
    # - SERVER_PARAMS contains user-supplied command line parameters
    # - CLIENT_PARAMS contains user-supplied command line parameters
    
    if [ "$ROLE" == "client" ]; then
        # Wait for the simulator to start up.
        /wait-for-it.sh sim:57832 -s -t 30
        [ INSERT COMMAND TO RUN YOUR QUIC CLIENT ]
    elif [ "$ROLE" == "server" ]; then
        [ INSERT COMMAND TO RUN YOUR QUIC SERVER ]
    fi

For an example, have a look at the quic-go setup or the quicly setup.

Running a Simulation

  1. From the quic-network-simulator directory, first build the necessary images:

    CLIENT=[client directory name] \
    SERVER=[server directory name] \
    docker-compose build
    

    Note that you will need to run this build command any time you change the client or server implementation, Dockerfile, or run_endpoint.sh file.

    For instance:

    CLIENT="my_quic_impl" \
    SERVER="another_quic_impl" \
    docker-compose build
    
  2. You will want to run the setup with a scenario. The scenarios that are currently provided are listed below:

    You can now run the experiment as follows:

    CLIENT=[client directory name] \
    CLIENT_PARAMS=[params to client] \
    SERVER=[server directory name] \
    SERVER_PARAMS=[params to server] \
    SCENARIO=[scenario] \
    docker-compose up
    

    SERVER_PARAMS and CLIENT_PARAMS may be omitted if the corresponding QUIC implementations do not require them.

    For instance, the following command runs a simple point-to-point scenario and specifies a command line parameter for only the client implementation:

    CLIENT="my_quic_impl" \
    CLIENT_PARAMS="-p /10000.txt" \
    SERVER="another_quic_impl" \
    SCENARIO="simple-p2p --delay=15ms --bandwidth=10Mbps --queue=25" \
    docker-compose up
    

    A mounted directory is provided for recording logs from the endpoints. docker-compose creates a logs/server and logs/client directory from the directory from which it is run. Inside the docker container, the directory is available as /logs.

Debugging and FAQs

  1. With the server (similarly for the client) up and running, you can get a root shell in the server docker container using the following:

    docker exec -it server /bin/bash

quic-network-simulator's People

Contributors

ghedo avatar janaiyengar avatar larseggert avatar marten-seemann avatar tatsuhiro-t avatar wesleyrosenblum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quic-network-simulator's Issues

Timeout from Network Simulator

Hello, community and @marten-seemann

I am trying to simulate the communication of my HTTP3/QUIC implementation between a client and a server using the ns-3 through the Network Simulator for QUIC, such as the instructions from this repository: https://github.com/marten-seemann/quic-network-simulator

The server is running at 193.167.100.100:4433 and the client is running at 193.167.0.100. The client is call the server's endpoint through the Simulator's network, requesting 193.167.0.1:4433, but the client receives a timeout message from the Network Simulator (sim).

If I run the client requesting directly to the server, skipping the Network Simulator, all works fine!.

Setup:

  • Ubuntu 22.04
  • Docker version 23.0.1, build a5ee5b1
  • Go 1.19.6

Someone can help me to understand if the network configuration is correct? And how can I solve this problem?

Captura de tela de 2023-02-25 22-24-44

Bandwidth setting

When the bandwidth parameter is setting as 1000Mbps, the average throughput of iperf is only about 220Mbps, why it can not reach to 1000Mbps. My setting is as follow:
SCENARIO="simple-p2p --delay=15ms --bandwidth=1000Mbps --queue=250"

Bug in run.sh caused from latest merged commit pr #110

I found a bug introduced with #110

{"log":"./run.sh: line 25: ./scratch/droplist: No such file or directory\r\n","stream":"stdout","time":"2024-01-08T23:06:00.950207463Z"}

I am currently am trying to debug this as this is breaking our CI, but I thought I would post this issue just so people know the problem is out there.

We are using the sim for context

Address collision issue

Hi @marten-seemann ,

I have configured tcp-cross-traffic to run over the network shaper between client and server, but it fails stating that

"[2Ksim | 2024-05-09T17:26:13.842535476Z Using scenario: tcp-cross-traffic --delay=15ms --bandwidth=10Mbps --queue=25
�[2Ksim | 2024-05-09T17:26:13.930512428Z msg="Ipv4AddressGeneratorImpl::Add(): Address Collision: 193.167.50.1", +0.000000000s -1 file=/ns3/src/internet/model/ipv4-address-generator.cc, line=384
�[2Ksim | 2024-05-09T17:26:13.930523054Z NS_FATAL, terminating"

which makes the server doesn't show up and the URL doesn't fetch anything.

I have used the already built traffic-shaper with scenario : tcp-cross-traffic keeping the image same i.e martenseemann/quic-network-simulator

Say which packet was dropped

Instead of simply logging "Dropping packet", it would be helpful if QNS logged some more details, such as direction (server->client or vice versa), ports, etc.

19.04 repos got moved

so using martenseemann/quic-network-simulator-endpoint:latest as base images doesn't build anymore. I found this fix in the mvfst Dockerfile:

RUN sed -i -re 's/([a-z]{2}.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list

Bump ubuntu base image in endpoint image

simulator image got a upgrade to use ubuntu 22.04, but endpoint image is still 20.04.
Is there any chance to upgrade the base image of endpoint Dockerfile to 22.04 as well?

Packet that elicits a Version Negotiation packet is too small

The packet that is sent initially to elicit a Version Negotiation packet from the server is too small to be considered a valid QUIC packet.

From QUIC Transport §10.3:

Endpoints MUST discard packets that are too small to be valid QUIC packets. With the set of AEAD functions defined in [QUIC-TLS], packets that are smaller than 21 bytes are never valid.

And QUIC Transport §5.2.2:

Servers MUST drop smaller packets that specify unsupported versions.

Could the packet payload for this initial packet be filled such that the total packet length is at least 21 bytes?

Traffic generation in a real network

Hi community,

I would know if your tool also can generate some QUIC traffic between a client and a server in a real-world network (repeating the process for multiple QUIC Implementations, whereas the client and server use the same implementation) so that the throughput and some numbers can be measured?
Thanks in advance!

Scenario error

Hello,

while I tried using new pull docker quic-newtowk-simulator, it's show :

./run.sh: line 35: 12 Illegal instruction (core dumped)

all of the scenario facing this issue

PCAP recording is unreliable

It looks like #58 didn't really solve the issue completely.
While the Version Negotiation test mostly works on OSX, it always fails on Ubuntu, because the pcap is missing the VNP.

change IP addresses

Using 192.168.x.x has the disadvantage that this can collide with people's home network configuration.
We might want to consider switching to something esoteric (like 193.167.x.x) to avoid such collisions. Unfortunately, everybody will have to rebuild their endpoint images then.

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.