diff --git a/bats/bats_protocol b/bats/bats_protocol index 6ed0c24..9fd5b9e 100755 --- a/bats/bats_protocol +++ b/bats/bats_protocol @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5c3f04f61a7ddef75e18d08804fe4dfa3d9705bef1554b38b51fe5133b55ae22 -size 1365830 +oid sha256:10edb09b022fee7ea8f22ef1d07903ae1c490c3ab61c9ebd53136ef6783b6127 +size 1379702 diff --git a/src/config/predefined.protocols.yaml b/src/config/predefined.protocols.yaml index 4fa2230..dc057dc 100644 --- a/src/config/predefined.protocols.yaml +++ b/src/config/predefined.protocols.yaml @@ -44,3 +44,17 @@ protocols: path: bin/kcp/server_linux_amd64 args: - "-l :4000 -t 127.0.0.1:10100" # by default, it forwards the traffic to localhost:10100 + - name: quic + type: none_distributed + args: {} # global args for quic + port: 8006 + protocols: # iterative + - name: quic_client + path: /go/bin/gost + args: + - "-L tcp://:8006/%s:8006" + - "-F http+quic://%s:8443" + - name: quic_server + path: /go/bin/gost + args: + - "-L http+quic://:8443" diff --git a/src/config/protocol-docker-azure/Dockerfile b/src/config/protocol-docker-azure/Dockerfile index d6a35f4..a12345a 100644 --- a/src/config/protocol-docker-azure/Dockerfile +++ b/src/config/protocol-docker-azure/Dockerfile @@ -15,8 +15,9 @@ RUN apt-get install --yes \ iperf3 \ iputils-ping \ python3-pip \ - iptables - + iptables \ + curl \ + wget RUN pip3 install \ PyYAML==6.0.1 \ @@ -29,6 +30,15 @@ RUN apt-get install --yes \ linux-tools-azure \ linux-cloud-tools-azure + +# Install go +RUN curl -L https://go.dev/dl/go1.23.0.linux-amd64.tar.gz | tar -C /usr/local -xz +ENV GOPATH=/go +ENV PATH=$PATH:/usr/local/go/bin:$GOPATH/bin + +# Install go-gost +RUN go install github.com/go-gost/gost/cmd/gost@latest + # Cleanup RUN rm -rf /var/lib/apt/lists/* diff --git a/src/config/protocol-first-rtt-test.yaml b/src/config/protocol-first-rtt-test.yaml index 5ffa3e8..702dca9 100644 --- a/src/config/protocol-first-rtt-test.yaml +++ b/src/config/protocol-first-rtt-test.yaml @@ -10,7 +10,7 @@ tests: topology: config_name: linear_network_1 config_file: config/predefined.topology.yaml - target_protocols: [btp, brtp, brtp_proxy, kcp, tcp-bbr] + target_protocols: [btp, brtp, brtp_proxy, kcp, tcp-bbr, quic] route: static_route test_tools: rtt: diff --git a/src/config/protocol-single-hop-test.yaml b/src/config/protocol-single-hop-test.yaml index b3a8e06..d8fe03b 100644 --- a/src/config/protocol-single-hop-test.yaml +++ b/src/config/protocol-single-hop-test.yaml @@ -10,7 +10,7 @@ tests: topology: config_name: linear_network_1 config_file: config/predefined.topology.yaml - target_protocols: [btp, brtp, brtp_proxy, kcp, tcp-bbr] + target_protocols: [btp, brtp, brtp_proxy, kcp, tcp-bbr, quic] route: static_route test_tools: iperf: diff --git a/src/protosuites/proto.py b/src/protosuites/proto.py index 55d9ee8..ba9822e 100644 --- a/src/protosuites/proto.py +++ b/src/protosuites/proto.py @@ -31,7 +31,7 @@ class ProtoConfig: default=None) # type: ignore -SupportedProto = ['btp', 'brtp', 'brtp_proxy', 'tcp', 'kcp'] +SupportedProto = ['btp', 'brtp', 'brtp_proxy', 'tcp', 'kcp', 'quic'] SupportedBATSProto = ['btp', 'brtp', 'brtp_proxy'] diff --git a/src/protosuites/std_protocol.py b/src/protosuites/std_protocol.py index 37337d7..c585131 100644 --- a/src/protosuites/std_protocol.py +++ b/src/protosuites/std_protocol.py @@ -78,9 +78,12 @@ def get_protocol_version(self) -> str: return self.config.version or "" def get_protocol_args(self, hosts) -> str: - if "%s" in self.protocol_args and 'kcp' in self.config.name: + if "%s" in self.protocol_args: receiver_ip = hosts[-1].IP() # ?fixme - return self.protocol_args % receiver_ip + if 'kcp' in self.config.name: + return self.protocol_args % receiver_ip + if 'quic_' in self.config.name: + return self.protocol_args % (receiver_ip, receiver_ip) return self.protocol_args def __set_protocol_version(self, network: INetwork, version: str): diff --git a/src/testsuites/test_iperf.py b/src/testsuites/test_iperf.py index 25a5bf9..528789f 100644 --- a/src/testsuites/test_iperf.py +++ b/src/testsuites/test_iperf.py @@ -43,7 +43,7 @@ def _run_test(self, network: INetwork, proto_info: IProtoInfo): client = hosts[self.config.client_host] server = hosts[self.config.server_host] receiver_ip = None - if proto_info.get_protocol_name().upper() == "KCP": + if (proto_info.get_protocol_name().upper() == "KCP") or (proto_info.get_protocol_name().upper() == "QUIC"): # kcp tun like a proxy, all traffic will be forwarded to the proxy server tun_ip = proto_info.get_tun_ip(network, self.config.client_host) if tun_ip == "": diff --git a/src/testsuites/test_rtt.py b/src/testsuites/test_rtt.py index b05660b..5da39f2 100644 --- a/src/testsuites/test_rtt.py +++ b/src/testsuites/test_rtt.py @@ -58,7 +58,7 @@ def _run_test(self, network: INetwork, proto_info: IProtoInfo): client = hosts[self.config.client_host] server = hosts[self.config.server_host] receiver_ip = None - if proto_info.get_protocol_name().upper() == "KCP": + if (proto_info.get_protocol_name().upper() == "KCP") or (proto_info.get_protocol_name().upper() == "QUIC"): # kcp tun like a proxy, all traffic will be forwarded to the proxy server tun_ip = proto_info.get_tun_ip(network, self.config.client_host) if tun_ip == "":