Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement support for the QUIC protocol and intelligent switching policy #37

Merged
merged 56 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
3541d20
Try to add quic-go for GT
DrakenLibra Sep 19, 2023
de89cdb
Try to add quic-go for GT
DrakenLibra Sep 19, 2023
25224f9
try
DrakenLibra Sep 19, 2023
f7f4faa
Try to add quic-go for GT
DrakenLibra Sep 19, 2023
86d2cfd
Try to add quic-go for GT
DrakenLibra Sep 19, 2023
43e69e0
Try to add quic-go for GT
DrakenLibra Sep 19, 2023
da463b7
Try to add quic-go for GT
DrakenLibra Sep 19, 2023
2180d30
Try to add quic-go for GT
DrakenLibra Sep 19, 2023
8633e98
Try to add quic-go for GT. Remove additional workflow check.
DrakenLibra Sep 21, 2023
3a5e672
Try to add quic-go for GT.
DrakenLibra Sep 21, 2023
682bde6
Try to add quic-go for GT.
DrakenLibra Sep 21, 2023
aa66fec
Try to add quic-go for GT.
DrakenLibra Sep 21, 2023
e60931a
Try to add quic-go for GT.
DrakenLibra Sep 21, 2023
dddf2eb
Try to add quic-go for GT.
DrakenLibra Sep 21, 2023
9fa3d60
Try to add quic-go for GT.
DrakenLibra Sep 21, 2023
843143d
Add quic-go for GT successfully.
DrakenLibra Sep 24, 2023
71669a5
Add 'Internal QUIC Penetration' description for GT.
DrakenLibra Sep 24, 2023
a6ee6d0
Add 'QUIC test' for GT.
DrakenLibra Sep 24, 2023
ea107ef
Fix.
DrakenLibra Sep 24, 2023
a57e397
Fix.
DrakenLibra Sep 24, 2023
5e36287
Add QUIC support for GT.
DrakenLibra Sep 25, 2023
e44abff
Add QUIC support for GT.
DrakenLibra Sep 26, 2023
03ec09b
Add QUIC support for GT.
DrakenLibra Sep 26, 2023
6938a5c
Add intelligent switch support for GT.
DrakenLibra Sep 26, 2023
f28aeb6
Add intelligent switch support for GT.
DrakenLibra Sep 27, 2023
0681758
Add intelligent switch support for GT.
DrakenLibra Sep 27, 2023
c0431cc
Try quic bbr for GT.
DrakenLibra Sep 27, 2023
9476917
Try quic bbr for GT.
DrakenLibra Sep 27, 2023
9c2bf1e
Try quic bbr for GT.
DrakenLibra Sep 27, 2023
be2499a
Try quic bbr for GT.
DrakenLibra Sep 28, 2023
4ebf571
Try quic bbr for GT.
DrakenLibra Sep 28, 2023
b9e0609
Try quic bbr for GT.
DrakenLibra Sep 28, 2023
3a3e40b
Try quic bbr for GT.
DrakenLibra Sep 28, 2023
2ec1641
Add quic bbr for GT.
DrakenLibra Sep 28, 2023
28a5129
Complete quic bbr for GT.
DrakenLibra Sep 28, 2023
ef2a894
Complete intelligent switch for GT.
DrakenLibra Sep 28, 2023
60aae8e
Complete guideline for GT.
DrakenLibra Sep 28, 2023
bf24b86
fix container.yaml
DrakenLibra Sep 28, 2023
339624a
fix .DS_Store caused by macbook finder
DrakenLibra Sep 28, 2023
f002e94
fix .DS_Store caused by macbook finder
DrakenLibra Sep 28, 2023
d75a5fb
.DS_Store banished!
DrakenLibra Sep 28, 2023
6a89a55
Delete .DS_Store
DrakenLibra Sep 28, 2023
dc4fd7a
Add explanations for xgboost model.
DrakenLibra Sep 30, 2023
fa27250
Finish intelligent switch strategy with multiple -remote support and …
DrakenLibra Oct 13, 2023
8cf7e71
Add msquic for gt to implement QUIC bbr.
DrakenLibra Oct 26, 2023
00ce0f9
Merge branch 'dev' of github.com:ao-space/gt
DrakenLibra Oct 28, 2023
2d0d9ec
Try github ci.
DrakenLibra Oct 28, 2023
e6c0802
fix cgo in go test and try to use github ci to build.
DrakenLibra Oct 29, 2023
8eea9fe
recovery github ci action.
DrakenLibra Oct 29, 2023
7015248
Merge branch 'dev' into dev
DrakenLibra Oct 29, 2023
54a5618
have fixed dockerfile for msquic.
DrakenLibra Oct 30, 2023
b15b56b
Try to fix libmsquic.a in arm64
DrakenLibra Oct 30, 2023
214e939
Try to use different ways to fix objcopy in arm64 for msquic
DrakenLibra Oct 30, 2023
a1fd4fd
rollback makefile
DrakenLibra Oct 31, 2023
61cbd57
success for arm64 build
DrakenLibra Oct 31, 2023
f3f17d8
fix wrong deletion
DrakenLibra Oct 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
build
release
.dockerignore

.DS_Store
# IDE files
.vscode
.idea
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@
url = https://git.mirror.iscas.ac.cn/ao-space/google-webrtc.git
branch = main
shallow = true
[submodule "dep/msquic"]
path = dep/msquic
url = https://github.com/microsoft/msquic
10 changes: 9 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ RUN apt-get install -y ca-certificates curl gnupg && \
apt-get update && \
apt-get install nodejs -y

# 安装msquic依赖
RUN apt-get update && \
apt-get install -y cmake build-essential liblttng-ust-dev lttng-tools libssl-dev && \
wget https://cmake.org/files/v3.23/cmake-3.23.0.tar.gz && \
tar -zxvf cmake-3.23.0.tar.gz && cd cmake-3.23.0 && ./configure && make -j8 && make install && \
cmake --version
# RUN apt-get install -y cmake build-essential liblttng-ust-dev lttng-tools

# golang 切换国内源并且提前安装好依赖
ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.cn
Expand All @@ -51,4 +59,4 @@ RUN if uname -m | grep aarch64; then \
file /usr/x86_64-linux-gnu/lib/libm.a | grep "ASCII text" && \
rm -f /usr/x86_64-linux-gnu/lib/libm.a && \
ln -s /usr/x86_64-linux-gnu/lib/libm-2.31.a /usr/x86_64-linux-gnu/lib/libm.a && echo "success"; \
fi
fi
52 changes: 43 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,16 @@ export GOOS?=$(shell go env GOOS)
export GOARCH?=$(shell go env GOARCH)
export CC=$(TARGET)-gcc -w
export CXX=$(TARGET)-g++ -w
export CGO_CXXFLAGS=-I$(shell pwd)/dep/_google-webrtc/src -I$(shell pwd)/dep/_google-webrtc/src/third_party/abseil-cpp -std=c++17 -DWEBRTC_POSIX
export CGO_LDFLAGS=$(shell pwd)/dep/_google-webrtc/src/out/release-$(TARGET)/obj/libwebrtc.a -ldl -pthread
export CGO_CXXFLAGS=-I$(shell pwd)/dep/_google-webrtc/src \
-I$(shell pwd)/dep/_google-webrtc/src/third_party/abseil-cpp \
-I$(shell pwd)/dep/msquic/src/inc \
-std=c++17 -DWEBRTC_POSIX -DQUIC_API_ENABLE_PREVIEW_FEATURES
export CGO_LDFLAGS= $(shell pwd)/dep/_google-webrtc/src/out/release-$(TARGET)/obj/libwebrtc.a \
$(shell pwd)/dep/msquic/$(TARGET)/bin/Release/libmsquic.a \
-ldl -pthread
export CGO_ENABLED=1

.PHONY: all build docker_build_linux_arm64 fmt build_client docker_build_linux_arm64_client gofumpt build_server docker_build_linux_arm64_server golangci-lint check_webrtc_dependencies docker_release_linux_amd64 release clean docker_release_linux_amd64_client release_client compile_webrtc docker_release_linux_amd64_server release_server docker_create_image docker_build_linux_amd64 docker_release_linux_arm64 revive docker_build_linux_amd64_client docker_release_linux_arm64_client test docker_build_linux_amd64_server docker_release_linux_arm64_server update_submodule build_web_server build_web_client release_web_server release_web_client check_npm front_release duplicate_dist_server clean_duplication_client clean_web clean_dist clean_duplication clean_duplication_server clean_duplication_client
.PHONY: all build docker_build_linux_arm64 fmt build_client docker_build_linux_arm64_client gofumpt build_server docker_build_linux_arm64_server golangci-lint check_webrtc_dependencies docker_release_linux_amd64 release clean docker_release_linux_amd64_client release_client compile_webrtc docker_release_linux_amd64_server release_server docker_create_image docker_build_linux_amd64 docker_release_linux_arm64 revive docker_build_linux_amd64_client docker_release_linux_arm64_client test docker_build_linux_amd64_server docker_release_linux_arm64_server update_submodule build_web_server build_web_client release_web_server release_web_client check_npm front_release duplicate_dist_server clean_duplication_client clean_web clean_dist clean_duplication clean_duplication_server clean_duplication_client check_msquic_dependencies compile_msquic

all: gofumpt golangci-lint test release

Expand All @@ -71,9 +76,9 @@ gofumpt:
gofumpt --version || go install mvdan.cc/gofumpt@latest
gofumpt -l -w $(shell find . -name '*.go' | grep -Ev '^\./bufio|^\./client/std|^\./logger/file-rotatelogs|^\./dep')

test: compile_webrtc
test: compile_webrtc compile_msquic
$(eval CGO_CXXFLAGS+=-O0 -g -ggdb)
go test -race -cover -count 1 ./...
go test -race -cover -count 1 ./bufio ./client ./config ./server ./test ./util

golangci-lint:
golangci-lint --version || go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
Expand All @@ -90,6 +95,24 @@ golangci-lint:
update_submodule:
git config --global --add safe.directory /go/src/github.com/isrc-cas/gt
git config --global --add safe.directory /go/src/github.com/isrc-cas/gt/dep/_google-webrtc
git config --global --add safe.directory /go/src/github.com/isrc-cas/gt/dep/msquic
git config --global --add safe.directory /go/src/github.com/isrc-cas/gt/dep/msquic/submodules/clog
git config --global --add safe.directory /go/src/github.com/isrc-cas/gt/dep/msquic/submodules/googletest
git config --global --add safe.directory /go/src/github.com/isrc-cas/gt/dep/msquic/submodules/openssl
git config --global --add safe.directory /go/src/github.com/isrc-cas/gt/dep/msquic/submodules/openssl/boringssl
git config --global --add safe.directory /go/src/github.com/isrc-cas/gt/dep/msquic/submodules/openssl3
git config --global --add safe.directory /go/src/github.com/isrc-cas/gt/dep/msquic/submodules/openssl3/gost-engine
git config --global --add safe.directory /go/src/github.com/isrc-cas/gt/dep/msquic/submodules/openssl/krb5
git config --global --add safe.directory /go/src/github.com/isrc-cas/gt/dep/msquic/submodules/openssl3/gost-engine/libprov
git config --global --add safe.directory /go/src/github.com/isrc-cas/gt/dep/msquic/submodules/openssl/pyca-cryptography
git config --global --add safe.directory /go/src/github.com/isrc-cas/gt/dep/msquic/submodules/openssl3/krb5
git config --global --add safe.directory /go/src/github.com/isrc-cas/gt/dep/msquic/submodules/openssl/wycheproof
git config --global --add safe.directory /go/src/github.com/isrc-cas/gt/dep/msquic/submodules/openssl3/oqs-provider
git config --global --add safe.directory /go/src/github.com/isrc-cas/gt/dep/msquic/submodules/openssl3/pyca-cryptography
git config --global --add safe.directory /go/src/github.com/isrc-cas/gt/dep/msquic/submodules/openssl3/python-ecdsa
git config --global --add safe.directory /go/src/github.com/isrc-cas/gt/dep/msquic/submodules/openssl3/tlsfuzzer
git config --global --add safe.directory /go/src/github.com/isrc-cas/gt/dep/msquic/submodules/openssl3/tlslite-ng
git config --global --add safe.directory /go/src/github.com/isrc-cas/gt/dep/msquic/submodules/openssl3/wycheproof
$(UPDATE_SUBMODULE_COMMAND)

docker_create_image: update_submodule
Expand Down Expand Up @@ -127,19 +150,19 @@ docker_release_linux_arm64_server: docker_create_image

build: build_server build_client
release: release_server release_client
build_client: $(SOURCES) Makefile compile_webrtc build_web_client
build_client: $(SOURCES) Makefile compile_msquic compile_webrtc build_web_client
$(eval CGO_CXXFLAGS+=-O0 -g -ggdb)
$(eval NAME=$(GOOS)-$(GOARCH)-client)
go build $(DEBUG_OPTIONS) -o build/$(NAME)$(EXE) ./cmd/client
release_client: $(SOURCES) Makefile compile_webrtc release_web_client
release_client: $(SOURCES) Makefile compile_msquic compile_webrtc release_web_client
$(eval CGO_CXXFLAGS+=-O3)
$(eval NAME=$(GOOS)-$(GOARCH)-client)
go build $(RELEASE_OPTIONS) -o release/$(NAME)$(EXE) ./cmd/client
build_server: $(SOURCES) Makefile compile_webrtc build_web_server
build_server: $(SOURCES) Makefile compile_msquic compile_webrtc build_web_server
$(eval CGO_CXXFLAGS+=-O0 -g -ggdb)
$(eval NAME=$(GOOS)-$(GOARCH)-server)
go build $(DEBUG_OPTIONS) -o build/$(NAME)$(EXE) ./cmd/server
release_server: $(SOURCES) Makefile compile_webrtc release_web_server
release_server: $(SOURCES) Makefile compile_msquic compile_webrtc release_web_server
$(eval CGO_CXXFLAGS+=-O3)
$(eval NAME=$(GOOS)-$(GOARCH)-server)
go build $(RELEASE_OPTIONS) -o release/$(NAME)$(EXE) ./cmd/server
Expand Down Expand Up @@ -224,3 +247,14 @@ compile_webrtc: check_webrtc_dependencies update_submodule
sed -i 's| [^ ]*g++ | $(CXX) |g' ./dep/_google-webrtc/src/out/release-$(TARGET)/toolchain.ninja
sed -i 's|"ar"|$(TARGET)-ar|g' ./dep/_google-webrtc/src/out/release-$(TARGET)/toolchain.ninja
ninja -C ./dep/_google-webrtc/src/out/release-$(TARGET)

check_msquic_dependencies:
sh -c "command -v cmake"

compile_msquic: check_msquic_dependencies update_submodule
mkdir -p ./dep/msquic/$(TARGET)
sed -i 's|\(^ *msquic_lib\)$$|\1 ALL|g' ./dep/msquic/src/bin/CMakeLists.txt
cmake -B./dep/msquic/$(TARGET) -S./dep/msquic -DQUIC_BUILD_SHARED=OFF -DCMAKE_TARGET_ARCHITECTURE=$(TARGET_CPU)
make -C./dep/msquic/$(TARGET) -j$(shell nproc)
$(eval renameSymbols=$(shell objdump -t ./dep/msquic/$(TARGET)/bin/Release/libmsquic.a | awk -v RS= '/_YB80VJ/{next}1' | grep -E 'g +F .text' | grep -Evi ' (ms){0,1}quic' | awk '{print " --redefine-sym " $$NF "=" $$NF "_YB80VJ"}'))
@objcopy $(renameSymbols) ./dep/msquic/$(TARGET)/bin/Release/libmsquic.a
Loading
Loading