Skip to content

Commit

Permalink
Merge pull request #62 from n-hop/update_binary_0828
Browse files Browse the repository at this point in the history
chore: update binary and add quic
  • Loading branch information
penglei0 authored Aug 28, 2024
2 parents 8665c90 + d018776 commit 14bda20
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 11 deletions.
4 changes: 2 additions & 2 deletions bats/bats_protocol
Git LFS file not shown
14 changes: 14 additions & 0 deletions src/config/predefined.protocols.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
14 changes: 12 additions & 2 deletions src/config/protocol-docker-azure/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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/*

Expand Down
2 changes: 1 addition & 1 deletion src/config/protocol-first-rtt-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/config/protocol-single-hop-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/protosuites/proto.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']


Expand Down
7 changes: 5 additions & 2 deletions src/protosuites/std_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion src/testsuites/test_iperf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "":
Expand Down
2 changes: 1 addition & 1 deletion src/testsuites/test_rtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "":
Expand Down

0 comments on commit 14bda20

Please sign in to comment.