1. build(centos 8)
1. Powershell
# Register the Microsoft RedHat repository
curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
# Install PowerShell
sudo yum install -y powershell
# Start PowerShell
pwsh
# Stop PowerShell
exit
2. .NET Core
# add the Microsoft package repository
sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
# Install the SDK
sudo yum install dotnet-sdk-5.0
# Install the runtime
sudo yum install aspnetcore-runtime-5.0
sudo yum install dotnet-runtime-5.0
3. Install Other Dependencies
git submodule update --init --recursive (安装包已执行完此操作)
yum install libatomic libatomic-static
pwsh
./scripts/prepare-machine.ps1 -Configuration Dev
4. CMake和gcc(支持c++17,最少gcc7)
./bootstrap
make
make install
5. Running a Build
(1)powershell
./scripts/build.ps1 -TlsSecretsSupport -Config Debug
(2)cmake
mkdir build && cd build
cmake -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX=/usr -DQUIC_TLS_SECRETS_SUPPORT=ON -DCMAKE_BUILD_TYPE=Debug ..
make
开启日志:
-DQUIC_ENABLE_LOGGING=ON
默认路径:
set(main_lib_dest msquic/lib):/usr/local/msquic/lib
set(include_dest msquic/include):/usr/local/msquic/include
2. quicsample
server 准备好cert_pem和priv_key cd msquic/build/bin/Release cd msquic/build/bin/Debug ./quicsample -server -cert_file:cert_pem -key_file:priv_key
client ./quicsample -client -target:127.0.0.1 -unsecure ./quicsample -client -target:172.16.1.1 -unsecure
<a name="a4DVS"></a>
## 2.1 server输出
[conn][0x7fa858000b60] Connected [strm][0x7fa85401bf90] Peer started [strm][0x7fa85401bf90] Data received [strm][0x7fa85401bf90] Peer shut down (收到FIN) [strm][0x7fa85401bf90] Sending data… (发送FIN) [strm][0x7fa85401bf90] Data sent [strm][0x7fa85401bf90] All done [conn][0x7fa858000b60] Successfully shut down on idle. [conn][0x7fa858000b60] All done
<a name="gBQml"></a>
## 2.2 client输出
[conn][0x14db290] Connecting… [conn][0x14db290] Connected [strm][0x7f9078027770] Starting… [strm][0x7f9078027770] Sending data… [strm][0x7f9078027770] Data sent (发送FIN) [conn][0x14db290] Resumption ticket received (2088 bytes): 01000000013147EF010243E8030245C00404810000000504800080000604800080000704800080000801010E0104C0000000FF02DE1A0243E82D2D2D2D2D424547494E2053534C2053455353494F4E20504152414D45544552532D2D2D2D2D0A4D4949466E774942415149434177514541684D434243412F435768796956624B6B55316D347865735453594D6B36715464374D783765672F2F7434424A4878380A4C515177336E765651474C5732462F456150365031725A67506137677156435A4E6D2B5676582B754F685257414B716C765A507466387536374848634D6B50510A794648636F5159434247457678344F69424149434843436A676750724D494944357A434341732B67417749424167494A414C654D594345487254744A4D4130470A435371475349623344514542437755414D49474A4D517377435159445651514745774A56557A454C4D416B474131554543417743513045784554415042674E560A4241634D43464E686269424B62334E6C4D513477444159445651514B4441564461584E6A627A454F4D41774741315545437777465A6D517561573878466A41550A42674E5642414D4D4458526C6333523062484D755A6D517561573878496A416742676B71686B6947397730424351455745335A776343316B5A585A4162476C7A0A64484D755A6D5175615738774868634E4D5467774D7A41314D6A45784E5445795768634E4D6A67774D7A41794D6A45784E544579576A43426954454C4D416B470A4131554542684D4356564D78437A414A42674E564241674D416B4E424D52457744775944565151484441685459573467536D397A5A54454F4D417747413155450A4367774651326C7A59323878446A414D42674E564241734D42575A6B4C6D6C764D5259774641594456515144444131305A584E306447787A4C6D5A6B4C6D6C760A4D5349774941594A4B6F5A496876634E41516B4246684E32634841745A475632514778706333527A4C6D5A6B4C6D6C764D494942496A414E42676B71686B69470A397730424151454641414F43415138414D49494243674B43415145413443316B386131447553746767677154346F3039665039734A3264433534627868532F580A6B3256456661495A32323257536F34582F7379525666567939596168637049317A4A2F524478615A53466867412B6E505A4272464D7372554C6B7264414F704F0A566A3865444570394A7557644F324F44536F466E43764C78635957425963356B4872794A704561474A6C317346515365736E7A4D4674792F353974613073746B0A3046703872354E68496A5776536F76477A506F3642687A2B565332636562495A6834783174326848614663676D30714A6F4A36446365526557435738772B794F0A566F76546F6C4747712B62706232486E374D6E52535A324B324E644C2B614C58706B5A62532F414F44503146463276544F316D594C3239304C4F372F3531764A0A6D50584E4B5344594D79354576494C72352F5671746A73464377524C51346A634D2F2B4765485341465778347149763042774944415141426F314177546A41640A42674E564851344546675155576131534F423337786D543533745A516158754C4C68524937553877487759445652306A42426777466F4155576131534F4233370A786D543533745A516158754C4C68524937553877444159445652305442415577417745422F7A414E42676B71686B6947397730424151734641414F43415145410A6F55687431335734796132374E567A5175434D767150574C33564D3433786250466B30324661477A2F57757050753237367A476C7A4A415A7262754463516F770A777755314E6931597967786C3936733163324D3572484454724F4B47724B3068626B5346426F2B693649387534486969513472596D47304876362B73586E336F0A66304873627444504767575A6F69705057446C6A5059455552753365334852652F4474736A3943616B426F53447A73386E64576142522B6634734D39546B31630A6A443436477132542F7170535058714B784555586C7A686443416E347477756231374271326B796B4870707043775067354D2B7633307448472F5232476F31350A4D65465762454A7468466B33545A4D6A4B4C375546733766482B783277536F6E58622B2B6A592B4B6D43623933432B736F414242697A453537672F4B6D6952320A4978512F4C4D6A44696B303152535549614D306C4C4B51434241436C4177494245716B4541674963494B714341525145676745513044593676795947444D6E6F0A645731356F484D6A6566564A52774F6F7130567736633666752B32706F486F4E305645465236576F73463051344342354650337343425547644765596857555A0A335257314A6430415A664551626B6F36417245394C2F5A7A6935455261734E6D79376D4639305A3238354851535573576E4D777954766646597742536367322B0A4151676B33476A735A716762426C5231644273657371377663582F377277356776777662764C6B7575316D68525938432F71747170666B72554F7033507075380A4644696C7A3176326B6F53504D71584A38794652766E514D647076716E6939614C342B2B4B306B515858662B2F656455715442535649584738303244304D554F0A3576766C5356466F3141676549712B346A4C5776355630307A6C6C70396C6D6E716C53527A32367367323241586352725159753078304A734D717972306C34700A3571536B746D546C653174714D733831426C7732792B6633743847395551617542774946414B486D5A6B4F764277494641502F2F2F2F2B7743415147633246740A6347786C0A2D2D2D2D2D454E442053534C2053455353494F4E20504152414D45544552532D2D2D2D2D0A [strm][0x7f9078027770] Data received [strm][0x7f9078027770] Peer shut down [strm][0x7f9078027770] All done [conn][0x14db290] Successfully shut down on idle. [conn][0x14db290] All done
<a name="fyQDk"></a>
## 2.3 截图
【client】<br /><br />【server】<br />
<a name="cPz0o"></a>
# 3. quicinterop
显示所有用例
./quicinterop -list
运行指定target
./quicinterop -sslkeylogfile:./quiche.log -target:quiche
运行所有target
./quicinterop
测试脚本所有用例:test_quicinterop.sh
!/bin/bash
target=”aioquic,akamaiquic,applequic,ats,f5,gquic,haskell,lsquic,mvfst,msquic,ngtcp2,ngx_quic,Pandora,picoquic,quant,quinn,quic-go,quiche,quicker,quicly-quic,quicly-h20” arrayTarget=(${target//,/ })
PCAP_DIR=”quic_pcap” SSL_DIR=”quic_log” rm -rf ${PCAP_DIR} ${SSL_DIR} mkdir ${PCAP_DIR} ${SSL_DIR}
for i in ${arrayTarget[@]}; do
tcpdump -i ens192 -w ${PCAPDIR}/quic${i}.pcap & tid=pgrep tcpdump
./quicinterop -target:${i} -sslkeylogfile:${SSLDIR}/quic${i}.log
if [ -n “${tid}” ]; then
echo ${tid}
killall tcpdump
fi
done
<a name="hli3x"></a>
## 3.1 输出
执行结果: enum QuicTestFeature { VersionNegotiation = 0x0001, Handshake = 0x0002, StreamData = 0x0004, ConnectionClose = 0x0008, Resumption = 0x0010, ZeroRtt = 0x0020, StatelessRetry = 0x0040, PostQuantum = 0x0080, KeyUpdate = 0x0100, CidUpdate = 0x0200, NatRebinding = 0x0400, Datagram = 0x0800, ChaCha20 = 0x1000 };
TARGET VHDCRZSQUMBG2 VERSION ALPN
============================================ aioquic VHD—-SQU—G2 0x00000001 h3 akamaiquic VH-CR—QU—-2 0x00000001 h3 applequic ——————- ats ——————- f5 VH-CR-SQU—— 0x00000001 h3 gquic ——————- haskell ——————- lsquic VH-CR-SQU—-2 0x00000001 h3 mvfst ——————- msquic ——————- ngtcp2 VH-C—SQU—-2 0x00000001 h3 ngx_quic VH-CR—Q——2 0x00000001 h3 Pandora ——————- picoquic VHDCRZSQUMBG2 0x00000001 hq-interop quant -H—RZ-Q——2 0x00000001 hq-interop quinn ——————- quic-go ——————- quiche VHDCRZ-Q——2 0x00000001 hq-interop quicker ——————- quicly-quic ——————- quicly-h20 -H-C—-Q——2 0x00000001 h3
Total execution time: 22.728s
<a name="t2hnI"></a>
## 3.2 截图

<a name="cX5uG"></a>
## 3.3 解码
wireshark解码:<br />编辑>>首选项>>协议>>TLS>>(Pre)-Master-Secret log filename<br />加入文件路径。
<a name="RR3We"></a>
# 4. 与quiche demo通信
line:65 const QUIC_BUFFER Alpn = { sizeof(“hq-interop”) - 1, (uint8_t*)”hq-interop” };
line:402 ServerLoadConfiguration函数 Settings.PeerBidiStreamCount = 100; ```