読者です 読者をやめる 読者になる 読者になる

quic_clientとquic_serverを試してみる

chromiumリポジトリにquic_clientとquic_serverというツールがある。
ubuntu 12.04でこれらを試してみた。


もしかしたら色々間違ってるところがあるやもしれませんが、とりあえず動いた...

事前準備

最低限のパッケージを入れる
apt-get install subversion git pkg-config
ソースコードの取得

Chromium/ソースからビルドする」こちらのサイトを参考に進める。
参考サイト同様に.gclientの編集をしたほうが早くなります。

mkdir Chromium
cd Chromium
export CHROMIUM_ROOT=`pwd`
svn co http://src.chromium.org/svn/trunk/tools/depot_tools
export PATH=`pwd`/depot_tools:"$PATH"
gclient config http://src.chromium.org/svn/trunk/src
gclient sync
必要なパッケージを入れる
cd ${CHROMIUM_ROOT}/src
./build/install-build-deps.sh

ビルドする

cd ${CHROMIUM_ROOT}/src
build/gyp_chromium -DWerror=""

ninja -C out/Debug/ quic_client quic_server

これでquic_clientとquic_serverが出来上がる

quic_server用のデータの準備

mkdir /tmp/quic-data
cd /tmp/quic-data
wget -p --save-headers http://google.com

取得したindex.htmlのHTTPヘッダ部分を編集する

quic_client、quic_serverを試す

quic_serverの起動
cd ${CHROMIUM_ROOT}/src
sudo ./out/Debug/quic_server --port=80 --quic_in_memory_cache_dir=/tmp/quic-data/ &
quic_clientで接続する
./out/Debug/quic_client --v=1 --port=80 --address=127.0.0.1 --hostname http://www.google.com


なんかめっちゃ色々でる

[0515/122816:VERBOSE1:quic_client_bin.cc(73)] server port: 80 address: 127.0.0.1 hostname:  secure: 0
[0515/122816:VERBOSE1:quic_flow_controller.cc(32)]  Client: Created flow controller for stream 0, setting initial receive window offset to: 145200, max receive window to: 145200, setting send window offset to: 16384
[0515/122816:VERBOSE1:quic_connection.cc(261)]  Client: Created connection with connection_id: 16360703711162145960
[0515/122816:VERBOSE1:quic_connection.cc(1913)]  Client: last packet 13044630496504987 now:13044630496505098 delta:111 network_timeout: 120000000
[0515/122816:VERBOSE1:quic_connection.cc(1930)]  Client: connection time: 0 overall timeout: 5000
[0515/122816:VERBOSE1:quic_flow_controller.cc(32)]  Client: Created flow controller for stream 3, setting initial receive window offset to: 145200, max receive window to: 145200, setting send window offset to: 16384
[0515/122816:VERBOSE1:quic_flow_controller.cc(32)]  Client: Created flow controller for stream 1, setting initial receive window offset to: 145200, max receive window to: 145200, setting send window offset to: 16384

...

[0515/122816:VERBOSE1:quic_packet_creator.cc(409)] Adding frame: type { ACK_FRAME } sent info { entropy_hash: 24 least_unacked: 5 } received info { entropy_hash: 48 is_truncated: 0 largest_observed: 14 delta_time_largest_observed: 590 missing_packets: [  ] revived_packets: [  ] }

[0515/122816:VERBOSE1:quic_packet_creator.cc(409)] Adding frame: type { CONGESTION_FEEDBACK_FRAME } type: 0 receive_window: 256000
[0515/122816:VERBOSE1:quic_packet_creator.cc(409)] Adding frame: type { STOP_WAITING_FRAME } entropy_hash: 24 least_unacked: 5
[0515/122816:VERBOSE1:pacing_sender.cc(109)] Sending packet now
[0515/122816:VERBOSE1:quic_packet_creator.cc(409)] Adding frame: type { CONNECTION_CLOSE_FRAME } error_code { 16 } error_details {  }

[0515/122816:VERBOSE1:quic_framer.cc(742)] Appending header: { connection_id: 16360703711162145960, connection_id_length:8, sequence_number_length:1, reset_flag: 0, version_flag: 0, fec_flag: 0, entropy_flag: 0, entropy hash: 0, sequence_number: 11, is_in_fec_group:0, fec_group: 0}

[0515/122816:VERBOSE1:quic_connection.cc(1408)]  Client: Sending packet 11 : data bearing , encryption level: ENCRYPTION_FORWARD_SECURE, length:30, encrypted length:42
[0515/122816:VERBOSE1:quic_connection.cc(1527)]  Client: time of last sent packet: 13044630496579398
[0515/122816:VERBOSE1:quic_connection.cc(1991)] Leaving Batch Mode.