Skip to content

Commit

Permalink
[+] Add new case test & Merge master change into interop branch (#347)
Browse files Browse the repository at this point in the history
* [+] QUIC datagram (RFC9221), sending datagrams and bytestreams on http3 connections (non-standard extensions), and bugfix (#307)

*[!] fix vulnerabilities on parsing STREAM and CRYPTO frame;

* [+] update contributor

* [!] fix test case errors on ubuntu latest

* [+] Export SSL handler of HTTP/3 connection for ssl_protocol, ssl_cipher, etc. (#310)

* [+] Export SSL handler of HTTP/3 connection for ssl_protocol, ssl_cipher, etc.

* [!] fix format of function return

* [+] support standard stateless reset (#313)

* [+] update multipath to draft-04; (#317)

* [+] support pmtu;

* fix complie error: specified bound depends on the length of the source argument (#312)

* fix complie error: specified bound depends on the length of the source argument

* fix stringop-overflow complie error

* fix stringop-overflow complie error

* Doc/rfc9114 (#223)

* Update draft-ietf-quic-http-34-zh.md

* Update draft-ietf-quic-http-34-zh.md

* Update draft-ietf-quic-http-34-zh.md

* Create rfc9114-http3-zh.md

* [=] add usage specifications for test_client and test_server (#318)

* [+] support multipath interop (#320)

* [+] add no_crypto and serrial options for mpquic interop (#321)

* Update doc (and comment) multipath-[01|02] => 04 (#326)

* demo: fix typo (xuqic -> xquic) (#328)

* [+] add .gitignore (#329)

* fix: use off_t instead of int for filesize (#332)

* [!] fix http3 deadloop and segmentation fault, fix stream compose error (#338)


* [+]Enable multipath-05 etc. (#340)

* [=] fix README-zh-CN doc link (#341)

* [!] fix interop testcase: antiamplication, multiplexing, zerortt, recovery, keyupdate

* [~]Fix error during rebase

* [+]Add new testcase in run endpoint

---------

Co-authored-by: Wu Zhao <zhaowu.zw@alibaba-inc.com>
Co-authored-by: lianglli <liangli.liliang@alibaba-inc.com>
Co-authored-by: Bobo <cppbreak@qq.com>
Co-authored-by: robinhzp <9974622@qq.com>
Co-authored-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Co-authored-by: Yanmei Liu <miaoji.lym@alibaba-inc.com>
Co-authored-by: Marcel <marcel.kempf@tum.de>
Co-authored-by: RuiqiZhou <dangdang.zrq@alibaba-inc.com>
  • Loading branch information
9 people authored Oct 20, 2023
1 parent 66224a8 commit f49b64d
Show file tree
Hide file tree
Showing 126 changed files with 19,966 additions and 6,772 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
SSL_LIB_PATH_STR="${PWD}/third_party/boringssl/build/ssl/libssl.a;${PWD}/third_party/boringssl/build/crypto/libcrypto.a"
mkdir -p build
cd build
cmake -DGCOV=on -DCMAKE_BUILD_TYPE=Debug -DXQC_ENABLE_TESTING=1 -DXQC_SUPPORT_SENDMMSG_BUILD=1 -DXQC_ENABLE_EVENT_LOG=1 -DXQC_ENABLE_BBR2=1 -DXQC_DISABLE_RENO=0 -DSSL_TYPE=${SSL_TYPE_STR} -DSSL_PATH=${SSL_PATH_STR} -DSSL_INC_PATH=${SSL_INC_PATH_STR} -DSSL_LIB_PATH=${SSL_LIB_PATH_STR} ..
cmake -DGCOV=on -DCMAKE_BUILD_TYPE=Debug -DXQC_ENABLE_TESTING=1 -DXQC_SUPPORT_SENDMMSG_BUILD=1 -DXQC_ENABLE_EVENT_LOG=1 -DXQC_ENABLE_BBR2=1 -DXQC_ENABLE_RENO=1 -DSSL_TYPE=${SSL_TYPE_STR} -DSSL_PATH=${SSL_PATH_STR} -DSSL_INC_PATH=${SSL_INC_PATH_STR} -DSSL_LIB_PATH=${SSL_LIB_PATH_STR} ..
make -j
- name: Test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
SSL_LIB_PATH_STR="${PWD}/third_party/boringssl/build/ssl/libssl.a;${PWD}/third_party/boringssl/build/crypto/libcrypto.a"
mkdir -p build
cd build
cmake -DGCOV=on -DCMAKE_BUILD_TYPE=Debug -DXQC_ENABLE_TESTING=1 -DXQC_SUPPORT_SENDMMSG_BUILD=1 -DXQC_ENABLE_EVENT_LOG=1 -DXQC_ENABLE_BBR2=1 -DXQC_DISABLE_RENO=0 -DSSL_TYPE=${SSL_TYPE_STR} -DSSL_PATH=${SSL_PATH_STR} -DSSL_INC_PATH=${SSL_INC_PATH_STR} -DSSL_LIB_PATH=${SSL_LIB_PATH_STR} ..
cmake -DGCOV=on -DCMAKE_BUILD_TYPE=Debug -DXQC_ENABLE_TESTING=1 -DXQC_SUPPORT_SENDMMSG_BUILD=1 -DXQC_ENABLE_EVENT_LOG=1 -DXQC_ENABLE_BBR2=1 -DXQC_ENABLE_RENO=1 -DSSL_TYPE=${SSL_TYPE_STR} -DSSL_PATH=${SSL_PATH_STR} -DSSL_INC_PATH=${SSL_INC_PATH_STR} -DSSL_LIB_PATH=${SSL_LIB_PATH_STR} ..
make -j
- name: Perform CodeQL Analysis
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ build/
bss/
*.swp
third_party/
.idea/
cmake-build-debug/
69 changes: 51 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ set (xquic_VERSION_MAJOR 0)
set (xquic_VERSION_MINOR 1)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

# build type
option (XQC_ENABLE_BBR2 "enable bbr2" ON)
option (XQC_ENABLE_COPA "enable copa" ON)
option (XQC_ENABLE_RENO "enable reno" ON)
option (XQC_ENABLE_UNLIMITED "enable unlimited cc" ON)
option (XQC_ENABLE_MP_INTEROP "enable MPQUIC interop" ON)

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
Expand Down Expand Up @@ -74,6 +79,9 @@ if(XQC_COMPAT_DUPLICATE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DXQC_COMPAT_DUPLICATE")
endif()

if(XQC_COMPAT_GENERATE_SR_PKT)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DXQC_COMPAT_GENERATE_SR_PKT")
endif()

# print only error log
if(XQC_ONLY_ERROR_LOG)
Expand Down Expand Up @@ -116,8 +124,8 @@ endif()

# configure file
configure_file (
xqc_configure.h.in
xqc_configure.h
"${CMAKE_CURRENT_SOURCE_DIR}/xqc_configure.h.in"
"${CMAKE_CURRENT_SOURCE_DIR}/include/xquic/xqc_configure.h"
)

include_directories(
Expand All @@ -127,8 +135,6 @@ include_directories(
"${CMAKE_CURRENT_BINARY_DIR}/include"
)



# http3/qpack source
set(
HTTP3_SOURCES
Expand All @@ -148,6 +154,8 @@ set(
"src/http3/qpack/xqc_ins.c"
"src/http3/qpack/stable/xqc_stable.c"
"src/http3/qpack/dtable/xqc_dtable.c"
"src/http3/xqc_h3_ext_dgram.c"
"src/http3/xqc_h3_ext_bytestream.c"
)

# Transport source
Expand All @@ -160,6 +168,7 @@ set(
"src/transport/xqc_packet_parser.c"
"src/transport/xqc_frame_parser.c"
"src/transport/xqc_stream.c"
"src/transport/xqc_datagram.c"
"src/transport/xqc_packet_out.c"
"src/transport/xqc_packet_in.c"
"src/transport/xqc_send_ctl.c"
Expand All @@ -175,12 +184,23 @@ set(
"src/transport/xqc_quic_lb.c"
"src/transport/xqc_timer.c"
"src/transport/xqc_reinjection.c"
"src/transport/reinjection_control/xqc_reinj_xlink.c"
"src/transport/reinjection_control/xqc_reinj_default.c"
"src/transport/reinjection_control/xqc_reinj_deadline.c"
"src/transport/reinjection_control/xqc_reinj_dgram.c"
"src/transport/scheduler/xqc_scheduler_minrtt.c"
"src/transport/scheduler/xqc_scheduler_common.c"
"src/transport/scheduler/xqc_scheduler_backup.c"
"src/transport/scheduler/xqc_scheduler_rap.c"
)

if(XQC_ENABLE_MP_INTEROP)
set(
TRANSPORT_SOURCES
${TRANSPORT_SOURCES}
"src/transport/scheduler/xqc_scheduler_interop.c"
)
endif()

# TLS source
set (
TLS_SOURCE
Expand Down Expand Up @@ -237,9 +257,7 @@ set(
"src/congestion_control/xqc_sample.c"
)

if(XQC_DISABLE_RENO)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DXQC_DISABLE_RENO ")
else()
if(XQC_ENABLE_RENO)
set(
CONGESTION_CONTROL_SOURCES
${CONGESTION_CONTROL_SOURCES}
Expand All @@ -248,18 +266,33 @@ else()
endif()

if(XQC_ENABLE_BBR2)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DXQC_ENABLE_BBR2 ")
set(
CONGESTION_CONTROL_SOURCES

${CONGESTION_CONTROL_SOURCES}
"src/congestion_control/xqc_bbr2.c"
)
endif()

if(XQC_ENABLE_COPA)
set(
CONGESTION_CONTROL_SOURCES
${CONGESTION_CONTROL_SOURCES}
"src/congestion_control/xqc_copa.c"
)
endif()

if(XQC_ENABLE_UNLIMITED)
set(
CONGESTION_CONTROL_SOURCES
${CONGESTION_CONTROL_SOURCES}
"src/congestion_control/xqc_unlimited_cc.c"
)
endif()


# xquic source
set (
XQC_SOURCE
XQC_SOURCE
${HTTP3_SOURCES}
${TRANSPORT_SOURCES}
${TLS_SOURCE}
Expand Down Expand Up @@ -383,13 +416,13 @@ if (XQC_ENABLE_TESTING)
endif()

if(PLATFORM STREQUAL "mac32")
target_link_libraries(test_server xquic -lm ${CMAKE_CURRENT_SOURCE_DIR}/../libevent32/lib/libevent.dylib)
target_link_libraries(test_client xquic -lm ${CMAKE_CURRENT_SOURCE_DIR}/../libevent32/lib/libevent.dylib)
target_link_libraries(test_server xquic-static ${SSL_LIB_PATH} -ldl -lpthread -lm ${CMAKE_CURRENT_SOURCE_DIR}/../libevent32/lib/libevent.dylib)
target_link_libraries(test_client xquic-static ${SSL_LIB_PATH} -ldl -lpthread -lm ${CMAKE_CURRENT_SOURCE_DIR}/../libevent32/lib/libevent.dylib)
target_link_libraries(demo_server xquic -lm ${CMAKE_CURRENT_SOURCE_DIR}/../libevent32/lib/libevent.dylib)
target_link_libraries(demo_client xquic -lm ${CMAKE_CURRENT_SOURCE_DIR}/../libevent32/lib/libevent.dylib)
elseif(PLATFORM STREQUAL "mac")
target_link_libraries(test_server xquic -lm -L/usr/local/lib -levent)
target_link_libraries(test_client xquic -lm -L/usr/local/lib -levent)
target_link_libraries(test_server xquic-static ${SSL_LIB_PATH} -ldl -lpthread -lm -L/usr/local/lib -levent)
target_link_libraries(test_client xquic-static ${SSL_LIB_PATH} -ldl -lpthread -lm -L/usr/local/lib -levent)
target_link_libraries(demo_server xquic -lm -L/usr/local/lib -levent)
target_link_libraries(demo_client xquic -lm -L/usr/local/lib -levent)
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
Expand All @@ -398,8 +431,8 @@ if (XQC_ENABLE_TESTING)
target_link_libraries(demo_server xquic ${EVENT_LIB_PATH} -lm)
target_link_libraries(demo_client xquic ${EVENT_LIB_PATH} -lm)
else()
target_link_libraries(test_server xquic -levent -lm)
target_link_libraries(test_client xquic -levent -lm)
target_link_libraries(test_server xquic-static ${SSL_LIB_PATH} -ldl -lpthread -levent -lm)
target_link_libraries(test_client xquic-static ${SSL_LIB_PATH} -ldl -lpthread -levent -lm)
target_link_libraries(demo_server xquic -levent -lm)
target_link_libraries(demo_client xquic -levent -lm)
endif()
Expand Down
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ In no particular order, thanks to these excellent individuals who contributed co
* 曾柯(毅丝)
* 徐盟欣(象谦)
* Bai Shi(白石)
* 周瑞琪(凼凼)
* 李亮(海苍)
* @chinsyo
* @L1MeN9Yu
* @flx413
Expand All @@ -217,5 +219,7 @@ In no particular order, thanks to these excellent individuals who contributed co
* @yunwei37
* @keengo99
* @ruanshanshan
* @alagoutte
* @MPK1

This list will be continuously updated. Contributions are welcome!
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/485e758edd98409bb7a51cbb803838c4)](https://www.codacy.com/gh/alibaba/xquic/dashboard?utm_source=github.com&utm_medium=referral&utm_content=alibaba/xquic&utm_campaign=Badge_Coverage)
![Platforms](https://img.shields.io/badge/platform-Android%20%7C%20iOS%20%7C%20Linux%20%7C%20macOS-blue)

> [简体中文文档 README-zh-CN](./docs/docs-zh/README-zh.md)
> [简体中文文档 README-zh-CN](https://github.com/alibaba/xquic/blob/main/docs/docs-zh/README-zh.md)
## Introduction

Expand All @@ -30,7 +30,8 @@ XQUIC Library released by Alibaba is …


[![](https://img.shields.io/static/v1?label=draft-13&message=QUIC-LB&color=9cf)](https://tools.ietf.org/html/draft-ietf-quic-load-balancers-13)
[![](https://img.shields.io/static/v1?label=draft-01&message=Multipath-QUIC&color=9cf)](https://tools.ietf.org/html/draft-ietf-quic-multipath-01)
[![](https://img.shields.io/static/v1?label=draft-04&message=Multipath-QUIC&color=9cf)](https://tools.ietf.org/html/draft-ietf-quic-multipath-04)
[![](https://img.shields.io/static/v1?label=draft-05&message=Multipath-QUIC&color=9cf)](https://tools.ietf.org/html/draft-ietf-quic-multipath-05)

#### Standardized Features

Expand All @@ -40,7 +41,7 @@ XQUIC Library released by Alibaba is …

#### Not Yet Standardized Features

* [Multipath QUIC](https://tools.ietf.org/html/draft-ietf-quic-multipath-02)
* [Multipath QUIC](https://tools.ietf.org/html/draft-ietf-quic-multipath-04)

* [QUIC-LB](https://tools.ietf.org/html/draft-ietf-quic-load-balancers-13)

Expand Down Expand Up @@ -89,7 +90,7 @@ cd ../..
# build XQUIC with BoringSSL
git submodule update --init --recursive
mkdir -p build; cd build
cmake -DGCOV=on -DCMAKE_BUILD_TYPE=Debug -DXQC_ENABLE_TESTING=1 -DXQC_SUPPORT_SENDMMSG_BUILD=1 -DXQC_ENABLE_EVENT_LOG=1 -DXQC_ENABLE_BBR2=1 -DXQC_DISABLE_RENO=0 -DSSL_TYPE=${SSL_TYPE_STR} -DSSL_PATH=${SSL_PATH_STR} -DSSL_INC_PATH=${SSL_INC_PATH_STR} -DSSL_LIB_PATH=${SSL_LIB_PATH_STR} ..
cmake -DGCOV=on -DCMAKE_BUILD_TYPE=Debug -DXQC_ENABLE_TESTING=1 -DXQC_SUPPORT_SENDMMSG_BUILD=1 -DXQC_ENABLE_EVENT_LOG=1 -DXQC_ENABLE_BBR2=1 -DXQC_ENABLE_RENO=1 -DSSL_TYPE=${SSL_TYPE_STR} -DSSL_PATH=${SSL_PATH_STR} -DSSL_INC_PATH=${SSL_INC_PATH_STR} -DSSL_LIB_PATH=${SSL_LIB_PATH_STR} ..
make -j
```

Expand All @@ -114,7 +115,7 @@ cd -
# build XQUIC with BabaSSL
git submodule update --init --recursive
mkdir -p build; cd build
cmake -DGCOV=on -DCMAKE_BUILD_TYPE=Debug -DXQC_ENABLE_TESTING=1 -DXQC_SUPPORT_SENDMMSG_BUILD=1 -DXQC_ENABLE_EVENT_LOG=1 -DXQC_ENABLE_BBR2=1 -DXQC_DISABLE_RENO=0 -DSSL_TYPE=${SSL_TYPE_STR} -DSSL_PATH=${SSL_PATH_STR} -DSSL_INC_PATH=${SSL_INC_PATH_STR} -DSSL_LIB_PATH=${SSL_LIB_PATH_STR} ..
cmake -DGCOV=on -DCMAKE_BUILD_TYPE=Debug -DXQC_ENABLE_TESTING=1 -DXQC_SUPPORT_SENDMMSG_BUILD=1 -DXQC_ENABLE_EVENT_LOG=1 -DXQC_ENABLE_BBR2=1 -DXQC_ENABLE_RENO=1 -DSSL_TYPE=${SSL_TYPE_STR} -DSSL_PATH=${SSL_PATH_STR} -DSSL_INC_PATH=${SSL_INC_PATH_STR} -DSSL_LIB_PATH=${SSL_LIB_PATH_STR} ..
make -j
```

Expand Down
63 changes: 56 additions & 7 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ if (XQC_DISABLE_LOG)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DXQC_DISABLE_LOG")
endif()

if(XQC_COMPAT_GENERATE_SR_PKT)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DXQC_COMPAT_GENERATE_SR_PKT")
endif()

if (XQC_ONLY_ERROR_LOG)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DXQC_ONLY_ERROR_LOG")
endif()
Expand Down Expand Up @@ -121,7 +125,11 @@ else()
endif()


configure_file (xqc_configure.h.in include/xquic/xqc_configure.h @ONLY)
configure_file (
"${CMAKE_CURRENT_SOURCE_DIR}/xqc_configure.h.in"
"${CMAKE_CURRENT_SOURCE_DIR}/include/xquic/xqc_configure.h"
@ONLY
)

include_directories(
include/
Expand Down Expand Up @@ -149,6 +157,8 @@ set(
"src/http3/qpack/xqc_ins.c"
"src/http3/qpack/stable/xqc_stable.c"
"src/http3/qpack/dtable/xqc_dtable.c"
"src/http3/xqc_h3_ext_dgram.c"
"src/http3/xqc_h3_ext_bytestream.c"
)

# Transport source
Expand All @@ -161,6 +171,7 @@ set(
"src/transport/xqc_packet_parser.c"
"src/transport/xqc_frame_parser.c"
"src/transport/xqc_stream.c"
"src/transport/xqc_datagram.c"
"src/transport/xqc_packet_out.c"
"src/transport/xqc_packet_in.c"
"src/transport/xqc_send_ctl.c"
Expand All @@ -176,12 +187,23 @@ set(
"src/transport/xqc_quic_lb.c"
"src/transport/xqc_timer.c"
"src/transport/xqc_reinjection.c"
"src/transport/reinjection_control/xqc_reinj_xlink.c"
"src/transport/reinjection_control/xqc_reinj_default.c"
"src/transport/reinjection_control/xqc_reinj_deadline.c"
"src/transport/reinjection_control/xqc_reinj_dgram.c"
"src/transport/scheduler/xqc_scheduler_minrtt.c"
"src/transport/scheduler/xqc_scheduler_common.c"
"src/transport/scheduler/xqc_scheduler_backup.c"
"src/transport/scheduler/xqc_scheduler_rap.c"
)

if(XQC_ENABLE_MP_INTEROP)
set(
TRANSPORT_SOURCES
${TRANSPORT_SOURCES}
"src/transport/scheduler/xqc_scheduler_interop.c"
)
endif()

# TLS source
set (
TLS_SOURCE
Expand Down Expand Up @@ -238,25 +260,51 @@ set(
"src/congestion_control/xqc_sample.c"
)

if (XQC_DISABLE_RENO)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DXQC_DISABLE_RENO")
else()
if(XQC_ENABLE_RENO)
set(
CONGESTION_CONTROL_SOURCES
${CONGESTION_CONTROL_SOURCES}
"src/congestion_control/xqc_new_reno.c"
)
endif()

if (XQC_ENABLE_BBR2)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DXQC_ENABLE_BBR2")
if(XQC_ENABLE_BBR2)
set(
CONGESTION_CONTROL_SOURCES
${CONGESTION_CONTROL_SOURCES}
"src/congestion_control/xqc_bbr2.c"
)
endif()

if(XQC_ENABLE_COPA)
set(
CONGESTION_CONTROL_SOURCES
${CONGESTION_CONTROL_SOURCES}
"src/congestion_control/xqc_copa.c"
)
endif()

if(XQC_ENABLE_UNLIMITED)
set(
CONGESTION_CONTROL_SOURCES
${CONGESTION_CONTROL_SOURCES}
"src/congestion_control/xqc_unlimited_cc.c"
)
endif()


if(XQC_ENABLE_TH3)
set(XQC_ENABLE_TUNNEL 1)
set(
TH3_SOURCES
"tunnel/tunnel_h3/th3_ctx.c"
"tunnel/tunnel_h3/th3_vconn.c"
)
endif()

)
endif()

if (XQC_NO_SHARED)
set(XQC_BINARY_TYPE STATIC)
endif()
Expand Down Expand Up @@ -298,3 +346,4 @@ if (XQC_BUILD_SAMPLE)
target_link_libraries(test_client xquic event)
target_link_libraries(test_server xquic event)
endif()

6 changes: 3 additions & 3 deletions demo/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
#define CIPHER_SUIT_LEN 256
#define TLS_GROUPS_LEN 64

#define PATH_LEN 512
#define RESOURCE_LEN 256
#define PATH_LEN 1024
#define RESOURCE_LEN 1024
#define AUTHORITY_LEN 128
#define URL_LEN 512
#define URL_LEN 1024

/* the congestion control types */
typedef enum cc_type_s {
Expand Down
Loading

0 comments on commit f49b64d

Please sign in to comment.