{"id":443092,"date":"2024-12-26T05:00:23","date_gmt":"2024-12-26T05:00:23","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=443092"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=443092","title":{"rendered":"<span>WireGuard \u0438 QUIC<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/93a\/335\/218\/93a335218f8f6e658b802b189a08da1b.jpg\" width=\"748\" height=\"860\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/93a\/335\/218\/93a335218f8f6e658b802b189a08da1b.jpg\" data-blurred=\"true\"\/><\/figure>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043c\u044b \u043f\u0440\u0438\u0431\u0435\u0433\u0430\u0435\u043c \u043a \u043f\u043e\u043c\u043e\u0449\u0438 VPN. \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0440\u043e\u0439 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0441\u043a\u0440\u044b\u0442\u044c \u0434\u0430\u0436\u0435 \u0441\u0430\u043c \u0444\u0430\u043a\u0442 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u0422\u0430\u043a \u0441\u0438\u043b\u044c\u043d\u043e \u043c\u044b \u0437\u0430\u0431\u043e\u0442\u0438\u043c\u0441\u044f \u043e \u0441\u0432\u043e\u0435\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438!\ud83d\ude0a<\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 WireGuard \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0430 \u043f\u0438\u043a\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u0438, \u0430 \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 UDP, \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u0438\u0434\u0435\u044f \u0437\u0430\u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0442\u0440\u0430\u0444\u0438\u043a \u043f\u043e\u0434 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u043d\u0430 \u0431\u0430\u0437\u0435 UDP \u2014 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/QUIC\" rel=\"noopener noreferrer nofollow\">QUIC<\/a>. QUIC \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 TCP \u0438 TLS, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u044b\u043b\u043e \u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0442\u0440\u0430\u0444\u0438\u043a WireGuard \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u043a\u0430\u043a \u0442\u0440\u0430\u0444\u0438\u043a QUIC. \u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0439 \u0438\u0434\u0435\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 WireGuard \u0432 \u044f\u0434\u0440\u0435 Linux. \u041f\u0430\u0442\u0447 \u0434\u043b\u044f \u044f\u0434\u0440\u0430 Linux \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 <a href=\"https:\/\/github.com\/karen07\/QUICWireGuard\" rel=\"noopener noreferrer nofollow\">QUICWireGuard<\/a>.<\/p>\n<h2>\u0412\u044b\u0431\u043e\u0440 \u043f\u043e\u0440\u0442\u0430<\/h2>\n<p>\u0422\u0440\u0430\u0444\u0438\u043a QUIC \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0442\u043e\u0442 \u0436\u0435 \u043f\u043e\u0440\u0442, \u0447\u0442\u043e \u0438 HTTPS \u2014 443. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 WireGuard \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u0440\u0442\u0443. \u041e\u0434\u043d\u0430\u043a\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0434\u0430\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u043d\u0430 Linux, \u043c\u044b \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043d\u0430 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u043e\u0440\u0442\u0430\u0445. \u041c\u0438\u043c\u0438\u043a\u0440\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u043e\u0440\u0442\u0430 443 \u0434\u043b\u044f WireGuard \u043b\u0438\u0431\u043e \u043f\u0440\u0438 \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0438 \u043d\u0430 \u044d\u0442\u043e\u0442 \u043f\u043e\u0440\u0442. \u0412\u043e \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 WireGuard \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043d\u0430 Arch, Ubuntu, OpenWRT<\/h2>\n<p>\u0414\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0431\u044b\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u043d\u044b \u0434\u0432\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430:<\/p>\n<p><a href=\"https:\/\/github.com\/karen07\/QUICWireGuard\/blob\/main\/linux_auto_install.sh\" rel=\"noopener noreferrer nofollow\">linux_auto_install.sh<\/a> &#8212; \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u044f wireguard.ko \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0435\u0433\u043e.<\/p>\n<p><a href=\"https:\/\/github.com\/karen07\/QUICWireGuard\/blob\/main\/openwrt_auto_install.sh\" rel=\"noopener noreferrer nofollow\">openwrt_auto_install.sh<\/a>  &#8212; \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u044f wireguard.ko \u0434\u043b\u044f OpenWRT \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438, \u043a\u0430\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043d\u0430\u0434\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0438\u043b\u0438 ssh \u0438\u043c\u044f \u0440\u043e\u0443\u0442\u0435\u0440\u0430 \u0438\u043b\u0438 xxxx@x.x.x.x<\/p>\n<p>\u041e\u0431\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043d\u0435 \u0443\u0434\u0430\u043b\u044f\u044e\u0442 \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c <strong>wireguard.ko<\/strong>. \u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f, \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 WireGuard \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0432\u0440\u0443\u0447\u043d\u0443\u044e. \u0427\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f, \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0432\u044b\u0432\u043e\u0434 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>dmesg | grep -i wireguard<\/code>.<\/p>\n<pre><code class=\"cpp\">[    8.975692] wireguard: QUICWireGuard 1.0.0 loaded. See https:\/\/github.com\/karen07\/QUICWireGuard for information. [    8.975694] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;. All Rights Reserved. [    8.975695] wireguard: Copyright (C) 2024 Karen.<\/code><\/pre>\n<p>\u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 <code>QUICWireGuard<\/code>. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043c\u0430\u0448\u0438\u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 WireGuard, \u0431\u0443\u0434\u044c\u0442\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b \u043f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435: \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0440\u0438\u0441\u043a \u0441\u0431\u043e\u044f \u044f\u0434\u0440\u0430 \u0438\u043b\u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u043c\u043e\u0435\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u043e.<\/p>\n<p>\u0414\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c, \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0445 \u043e\u0442 Arch, Ubuntu \u0438 OpenWRT, \u0441\u043a\u0440\u0438\u043f\u0442 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c, \u043e\u0434\u043d\u0430\u043a\u043e \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043d\u0435\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u044f\u0434\u0440\u0430 \u043f\u043e\u0434 \u0432\u0430\u0448 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432.<\/p>\n<h2>\u0424\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 WireGuard<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043a\u043e\u0434 <a href=\"https:\/\/github.com\/torvalds\/linux\/tree\/master\/drivers\/net\/wireguard\" rel=\"noopener noreferrer nofollow\">WireGuard<\/a> \u0432 \u044f\u0434\u0440\u0435 Linux. \u0422\u0430\u043c \u0435\u0441\u0442\u044c \u0444\u0430\u0439\u043b <a href=\"https:\/\/github.com\/torvalds\/linux\/blob\/master\/drivers\/net\/wireguard\/messages.h\" rel=\"noopener noreferrer nofollow\">messages.h<\/a>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0434\u0432\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b:<\/p>\n<pre><code class=\"cpp\">struct message_handshake_initiation { struct message_header header; __le32 sender_index; u8 unencrypted_ephemeral[NOISE_PUBLIC_KEY_LEN]; u8 encrypted_static[noise_encrypted_len(NOISE_PUBLIC_KEY_LEN)]; u8 encrypted_timestamp[noise_encrypted_len(NOISE_TIMESTAMP_LEN)]; struct message_macs macs; };<\/code><\/pre>\n<pre><code class=\"cpp\">struct message_handshake_response { struct message_header header; __le32 sender_index; __le32 receiver_index; u8 unencrypted_ephemeral[NOISE_PUBLIC_KEY_LEN]; u8 encrypted_nothing[noise_encrypted_len(0)]; struct message_macs macs; };<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u044d\u0442\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u0438 WireGuard handshake \u0432 \u0444\u0430\u0439\u043b\u0435 <a href=\"https:\/\/github.com\/torvalds\/linux\/blob\/master\/drivers\/net\/wireguard\/send.c\" rel=\"noopener noreferrer nofollow\">send.c<\/a> \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 <code>wg_packet_send_handshake_initiation<\/code> \u0438 <code>wg_packet_send_handshake_response<\/code>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e <code>packet<\/code>, \u0430 \u0435\u0449\u0435 \u0438 <code>QUIC header<\/code>, \u0442\u043e WireGuard handshake \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 QUIC handshake.<\/p>\n<pre><code class=\"cpp\">struct message_handshake_initiation packet; wg_socket_send_buffer_to_peer(peer, &amp;packet, sizeof(packet),       HANDSHAKE_DSCP);<\/code><\/pre>\n<pre><code class=\"cpp\">struct message_handshake_response packet; wg_socket_send_buffer_to_peer(peer, &amp;packet,       sizeof(packet),       HANDSHAKE_DSCP);<\/code><\/pre>\n<h2>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 QUIC header<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 WireShark, \u0442\u043e <code>QUIC init header<\/code> \u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u0435\u043c\u0438 \u043f\u043e\u043b\u0435\u0439.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/128\/048\/e43\/128048e43bfb782c1e44f606b4f0f2d8.png\" alt=\"\u041f\u043e\u043b\u044f init header\" title=\"\u041f\u043e\u043b\u044f init header\" width=\"721\" height=\"41\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/128\/048\/e43\/128048e43bfb782c1e44f606b4f0f2d8.png\"\/><\/p>\n<div><figcaption>\u041f\u043e\u043b\u044f init header<\/figcaption><\/div>\n<\/figure>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"348\" width=\"348\">\n<p align=\"center\">\u041f\u043e\u043b\u0435<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"348\" width=\"348\">\n<p align=\"center\">Flags<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u0411\u0438\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435, \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u044e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c <code>0xC0<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"348\" width=\"348\">\n<p align=\"center\">Version<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u0412\u0435\u0440\u0441\u0438\u044f, \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u0441\u0435\u0433\u0434\u0430 <code>0x1<\/code> \u0432 BE \u043f\u043e\u0440\u044f\u0434\u043a\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"348\" width=\"348\">\n<p align=\"center\">DCID len<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u0414\u043b\u0438\u043d\u0430 DCID \u0432 \u0431\u0430\u0439\u0442\u0430\u0445, \u0434\u043b\u044f init header \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>0x8<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"348\" width=\"348\">\n<p align=\"center\">DCID<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u041d\u043e\u043c\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"348\" width=\"348\">\n<p align=\"center\">SCID len<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u0414\u043b\u0438\u043d\u0430 SCID \u0432 \u0431\u0430\u0439\u0442\u0430\u0445, \u0434\u043b\u044f init header \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>0x0<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"348\" width=\"348\">\n<p align=\"center\">Token len<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u0414\u043b\u0438\u043d\u0430 SCID \u0432 \u0431\u0430\u0439\u0442\u0430\u0445, \u0434\u043b\u044f init header \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>0x0<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"348\" width=\"348\">\n<p align=\"center\">Data len<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u0421\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0447\u0430\u0441\u0442\u0435\u0439, \u043f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0430 \u0431\u0438\u0442\u0430, \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0431\u0430\u0439\u0442\u0430 \u044d\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043e\u0431\u0449\u0435\u0439 \u0434\u043b\u0438\u043d\u044b Data len, \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 0b01(0x4), \u0430 \u043a 0x4 \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u043b\u0438\u043d\u0443 <code>init header<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0415\u0441\u043b\u0438 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 WireShark, \u0442\u043e <code>QUIC response header<\/code> \u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u0435\u043c\u0438 \u043f\u043e\u043b\u0435\u0439.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/02d\/4f8\/e3b\/02d4f8e3b0e9923183078b414a5316f1.png\" alt=\"\u041f\u043e\u043b\u044f response header\" title=\"\u041f\u043e\u043b\u044f response header\" width=\"721\" height=\"41\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/02d\/4f8\/e3b\/02d4f8e3b0e9923183078b414a5316f1.png\"\/><\/p>\n<div><figcaption>\u041f\u043e\u043b\u044f response header<\/figcaption><\/div>\n<\/figure>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"342\" width=\"342\">\n<p align=\"center\">\u041f\u043e\u043b\u0435<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"342\" width=\"342\">\n<p align=\"center\">Flags<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u0411\u0438\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435, \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u044e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c <code>0xC0<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"342\" width=\"342\">\n<p align=\"center\">Version<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u0412\u0435\u0440\u0441\u0438\u044f, \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u0441\u0435\u0433\u0434\u0430 <code>0x1<\/code> \u0432 BE \u043f\u043e\u0440\u044f\u0434\u043a\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"342\" width=\"342\">\n<p align=\"center\">DCID len<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u0414\u043b\u0438\u043d\u0430 DCID \u0432 \u0431\u0430\u0439\u0442\u0430\u0445, \u0434\u043b\u044f response header \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>0x0<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"342\" width=\"342\">\n<p align=\"center\">SCID len<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u0414\u043b\u0438\u043d\u0430 SCID \u0432 \u0431\u0430\u0439\u0442\u0430\u0445, \u0434\u043b\u044f response header \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>0x8<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"342\" width=\"342\">\n<p align=\"center\">SCID<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u041d\u043e\u043c\u0435\u0440 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044f<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"342\" width=\"342\">\n<p align=\"center\">Token len<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u0414\u043b\u0438\u043d\u0430 SCID \u0432 \u0431\u0430\u0439\u0442\u0430\u0445, \u0434\u043b\u044f response header \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>0x0<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"342\" width=\"342\">\n<p align=\"center\">Data len<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0447\u0430\u0441\u0442\u0435\u0439, \u043f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0430 \u0431\u0438\u0442\u0430, \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0431\u0430\u0439\u0442\u0430 \u044d\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043e\u0431\u0449\u0435\u0439 \u0434\u043b\u0438\u043d\u044b Data len, \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 0b01(0x4), \u0430 \u043a 0x4 \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u043b\u0438\u043d\u0443 <code>response header<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 \u0441\u043f\u0435\u0440\u0435\u0434\u0438 \u043a <code>struct message_handshake_initiation packet<\/code> \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <code>QUIC init header<\/code>, \u0442\u043e \u043d\u0430\u0447\u0430\u043b\u043e \u0441\u0435\u0441\u0441\u0438\u0438 WireGuard \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u043e \u0441\u0435\u0441\u0441\u0438\u0438 QUIC. \u0422\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u0435\u0441\u043b\u0438 \u0441\u043f\u0435\u0440\u0435\u0434\u0438 \u043a <code>struct message_handshake_response packet<\/code> \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <code>QUIC response header<\/code>, \u0442\u043e \u043d\u0430\u0447\u0430\u043b\u043e \u0441\u0435\u0441\u0441\u0438\u0438 WireGuard \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u043e \u0441\u0435\u0441\u0441\u0438\u0438 QUIC.<\/p>\n<h3>\u041f\u0440\u0438\u0435\u043c \u043f\u0430\u043a\u0435\u0442\u0430 WireGuard<\/h3>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432 \u043a\u043e\u0434 <a href=\"https:\/\/github.com\/torvalds\/linux\/tree\/master\/drivers\/net\/wireguard\" rel=\"noopener noreferrer nofollow\">WireGuard<\/a> \u0432 \u044f\u0434\u0440\u0435 Linux, \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u0444\u0430\u0439\u043b <a href=\"https:\/\/github.com\/torvalds\/linux\/blob\/master\/drivers\/net\/wireguard\/receive.c\" rel=\"noopener noreferrer nofollow\">receive.c<\/a>, \u0433\u0434\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0435\u043c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432. \u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>prepare_skb_header<\/code> \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 UDP \u0438\u0437 \u0431\u0443\u0444\u0435\u0440\u0430 skb. \u041d\u0430\u043c \u0436\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a QUIC. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430 \u043d\u043e\u043c\u0435\u0440 \u043f\u043e\u0440\u0442\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u0447\u0442\u0435\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 \u043f\u0430\u043a\u0435\u0442\u044b WireGuard \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0441 \u0447\u0438\u0441\u043b\u0430, \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u044e\u0449\u0435\u0433\u043e \u0447\u0435\u0442\u044b\u0440\u0435, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a QUIC \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 <code>0xC0<\/code>. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0431\u0430\u0439\u0442\u0430 \u043f\u0430\u043a\u0435\u0442\u0430, \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u044b \u0442\u0438\u043f\u0430 <code>initiation response<\/code> \u0438 <code>data<\/code>.<\/p>\n<h2>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h2>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/914\/200\/91a\/91420091a89a99f713b5596a995b73fb.png\" alt=\"Wireshark\" title=\"Wireshark\" width=\"487\" height=\"193\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/914\/200\/91a\/91420091a89a99f713b5596a995b73fb.png\"\/><\/p>\n<div><figcaption>Wireshark<\/figcaption><\/div>\n<\/figure>\n<p>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a Wireshark \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u0442 \u0440\u0443\u043a\u043e\u043f\u043e\u0436\u0430\u0442\u0438\u0435 WireGuard. Wireshark \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043a\u0430\u043a QUIC. \u041c\u044b \u0434\u043e\u0441\u0442\u0438\u0433\u043b\u0438 \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/867102\/\"> https:\/\/habr.com\/ru\/articles\/867102\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043c\u044b \u043f\u0440\u0438\u0431\u0435\u0433\u0430\u0435\u043c \u043a \u043f\u043e\u043c\u043e\u0449\u0438 VPN. \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0440\u043e\u0439 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0441\u043a\u0440\u044b\u0442\u044c \u0434\u0430\u0436\u0435 \u0441\u0430\u043c \u0444\u0430\u043a\u0442 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u0422\u0430\u043a \u0441\u0438\u043b\u044c\u043d\u043e \u043c\u044b \u0437\u0430\u0431\u043e\u0442\u0438\u043c\u0441\u044f \u043e \u0441\u0432\u043e\u0435\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438!\ud83d\ude0a<\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 WireGuard \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0430 \u043f\u0438\u043a\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u0438, \u0430 \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 UDP, \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u0438\u0434\u0435\u044f \u0437\u0430\u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0442\u0440\u0430\u0444\u0438\u043a \u043f\u043e\u0434 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u043d\u0430 \u0431\u0430\u0437\u0435 UDP \u2014 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/QUIC\" rel=\"noopener noreferrer nofollow\">QUIC<\/a>. QUIC \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 TCP \u0438 TLS, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u044b\u043b\u043e \u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0442\u0440\u0430\u0444\u0438\u043a WireGuard \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u043a\u0430\u043a \u0442\u0440\u0430\u0444\u0438\u043a QUIC. \u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0439 \u0438\u0434\u0435\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 WireGuard \u0432 \u044f\u0434\u0440\u0435 Linux. \u041f\u0430\u0442\u0447 \u0434\u043b\u044f \u044f\u0434\u0440\u0430 Linux \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 <a href=\"https:\/\/github.com\/karen07\/QUICWireGuard\" rel=\"noopener noreferrer nofollow\">QUICWireGuard<\/a>.<\/p>\n<h2>\u0412\u044b\u0431\u043e\u0440 \u043f\u043e\u0440\u0442\u0430<\/h2>\n<p>\u0422\u0440\u0430\u0444\u0438\u043a QUIC \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0442\u043e\u0442 \u0436\u0435 \u043f\u043e\u0440\u0442, \u0447\u0442\u043e \u0438 HTTPS \u2014 443. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 WireGuard \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u0440\u0442\u0443. \u041e\u0434\u043d\u0430\u043a\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0434\u0430\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u043d\u0430 Linux, \u043c\u044b \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043d\u0430 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u043e\u0440\u0442\u0430\u0445. \u041c\u0438\u043c\u0438\u043a\u0440\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u043e\u0440\u0442\u0430 443 \u0434\u043b\u044f WireGuard \u043b\u0438\u0431\u043e \u043f\u0440\u0438 \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0438 \u043d\u0430 \u044d\u0442\u043e\u0442 \u043f\u043e\u0440\u0442. \u0412\u043e \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 WireGuard \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043d\u0430 Arch, Ubuntu, OpenWRT<\/h2>\n<p>\u0414\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0431\u044b\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u043d\u044b \u0434\u0432\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430:<\/p>\n<p><a href=\"https:\/\/github.com\/karen07\/QUICWireGuard\/blob\/main\/linux_auto_install.sh\" rel=\"noopener noreferrer nofollow\">linux_auto_install.sh<\/a> &#8212; \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u044f wireguard.ko \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0435\u0433\u043e.<\/p>\n<p><a href=\"https:\/\/github.com\/karen07\/QUICWireGuard\/blob\/main\/openwrt_auto_install.sh\" rel=\"noopener noreferrer nofollow\">openwrt_auto_install.sh<\/a>  &#8212; \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u044f wireguard.ko \u0434\u043b\u044f OpenWRT \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438, \u043a\u0430\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043d\u0430\u0434\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0438\u043b\u0438 ssh \u0438\u043c\u044f \u0440\u043e\u0443\u0442\u0435\u0440\u0430 \u0438\u043b\u0438 xxxx@x.x.x.x<\/p>\n<p>\u041e\u0431\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043d\u0435 \u0443\u0434\u0430\u043b\u044f\u044e\u0442 \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c <strong>wireguard.ko<\/strong>. \u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f, \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 WireGuard \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0432\u0440\u0443\u0447\u043d\u0443\u044e. \u0427\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f, \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0432\u044b\u0432\u043e\u0434 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>dmesg | grep -i wireguard<\/code>.<\/p>\n<pre><code class=\"cpp\">[    8.975692] wireguard: QUICWireGuard 1.0.0 loaded. See https:\/\/github.com\/karen07\/QUICWireGuard for information. [    8.975694] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;. All Rights Reserved. [    8.975695] wireguard: Copyright (C) 2024 Karen.<\/code><\/pre>\n<p>\u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 <code>QUICWireGuard<\/code>. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043c\u0430\u0448\u0438\u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 WireGuard, \u0431\u0443\u0434\u044c\u0442\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b \u043f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435: \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0440\u0438\u0441\u043a \u0441\u0431\u043e\u044f \u044f\u0434\u0440\u0430 \u0438\u043b\u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u043c\u043e\u0435\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u043e.<\/p>\n<p>\u0414\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c, \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0445 \u043e\u0442 Arch, Ubuntu \u0438 OpenWRT, \u0441\u043a\u0440\u0438\u043f\u0442 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c, \u043e\u0434\u043d\u0430\u043a\u043e \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043d\u0435\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u044f\u0434\u0440\u0430 \u043f\u043e\u0434 \u0432\u0430\u0448 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432.<\/p>\n<h2>\u0424\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 WireGuard<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043a\u043e\u0434 <a href=\"https:\/\/github.com\/torvalds\/linux\/tree\/master\/drivers\/net\/wireguard\" rel=\"noopener noreferrer nofollow\">WireGuard<\/a> \u0432 \u044f\u0434\u0440\u0435 Linux. \u0422\u0430\u043c \u0435\u0441\u0442\u044c \u0444\u0430\u0439\u043b <a href=\"https:\/\/github.com\/torvalds\/linux\/blob\/master\/drivers\/net\/wireguard\/messages.h\" rel=\"noopener noreferrer nofollow\">messages.h<\/a>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0434\u0432\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b:<\/p>\n<pre><code class=\"cpp\">struct message_handshake_initiation { struct message_header header; __le32 sender_index; u8 unencrypted_ephemeral[NOISE_PUBLIC_KEY_LEN]; u8 encrypted_static[noise_encrypted_len(NOISE_PUBLIC_KEY_LEN)]; u8 encrypted_timestamp[noise_encrypted_len(NOISE_TIMESTAMP_LEN)]; struct message_macs macs; };<\/code><\/pre>\n<pre><code class=\"cpp\">struct message_handshake_response { struct message_header header; __le32 sender_index; __le32 receiver_index; u8 unencrypted_ephemeral[NOISE_PUBLIC_KEY_LEN]; u8 encrypted_nothing[noise_encrypted_len(0)]; struct message_macs macs; };<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u044d\u0442\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u0438 WireGuard handshake \u0432 \u0444\u0430\u0439\u043b\u0435 <a href=\"https:\/\/github.com\/torvalds\/linux\/blob\/master\/drivers\/net\/wireguard\/send.c\" rel=\"noopener noreferrer nofollow\">send.c<\/a> \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 <code>wg_packet_send_handshake_initiation<\/code> \u0438 <code>wg_packet_send_handshake_response<\/code>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e <code>packet<\/code>, \u0430 \u0435\u0449\u0435 \u0438 <code>QUIC header<\/code>, \u0442\u043e WireGuard handshake \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 QUIC handshake.<\/p>\n<pre><code class=\"cpp\">struct message_handshake_initiation packet; wg_socket_send_buffer_to_peer(peer, &amp;packet, sizeof(packet),       HANDSHAKE_DSCP);<\/code><\/pre>\n<pre><code class=\"cpp\">struct message_handshake_response packet; wg_socket_send_buffer_to_peer(peer, &amp;packet,       sizeof(packet),       HANDSHAKE_DSCP);<\/code><\/pre>\n<h2>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 QUIC header<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 WireShark, \u0442\u043e <code>QUIC init header<\/code> \u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u0435\u043c\u0438 \u043f\u043e\u043b\u0435\u0439.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u043e\u043b\u044f init header<\/figcaption><\/div>\n<\/figure>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"348\" width=\"348\">\n<p align=\"center\">\u041f\u043e\u043b\u0435<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"348\" width=\"348\">\n<p align=\"center\">Flags<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u0411\u0438\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435, \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u044e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c <code>0xC0<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"348\" width=\"348\">\n<p align=\"center\">Version<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u0412\u0435\u0440\u0441\u0438\u044f, \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u0441\u0435\u0433\u0434\u0430 <code>0x1<\/code> \u0432 BE \u043f\u043e\u0440\u044f\u0434\u043a\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"348\" width=\"348\">\n<p align=\"center\">DCID len<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u0414\u043b\u0438\u043d\u0430 DCID \u0432 \u0431\u0430\u0439\u0442\u0430\u0445, \u0434\u043b\u044f init header \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>0x8<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"348\" width=\"348\">\n<p align=\"center\">DCID<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u041d\u043e\u043c\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"348\" width=\"348\">\n<p align=\"center\">SCID len<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u0414\u043b\u0438\u043d\u0430 SCID \u0432 \u0431\u0430\u0439\u0442\u0430\u0445, \u0434\u043b\u044f init header \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>0x0<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"348\" width=\"348\">\n<p align=\"center\">Token len<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u0414\u043b\u0438\u043d\u0430 SCID \u0432 \u0431\u0430\u0439\u0442\u0430\u0445, \u0434\u043b\u044f init header \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>0x0<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"348\" width=\"348\">\n<p align=\"center\">Data len<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u0421\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0447\u0430\u0441\u0442\u0435\u0439, \u043f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0430 \u0431\u0438\u0442\u0430, \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0431\u0430\u0439\u0442\u0430 \u044d\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043e\u0431\u0449\u0435\u0439 \u0434\u043b\u0438\u043d\u044b Data len, \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 0b01(0x4), \u0430 \u043a 0x4 \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u043b\u0438\u043d\u0443 <code>init header<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0415\u0441\u043b\u0438 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 WireShark, \u0442\u043e <code>QUIC response header<\/code> \u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u0435\u043c\u0438 \u043f\u043e\u043b\u0435\u0439.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u043e\u043b\u044f response header<\/figcaption><\/div>\n<\/figure>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"342\" width=\"342\">\n<p align=\"center\">\u041f\u043e\u043b\u0435<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"342\" width=\"342\">\n<p align=\"center\">Flags<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u0411\u0438\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435, \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u044e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c <code>0xC0<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"342\" width=\"342\">\n<p align=\"center\">Version<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u0412\u0435\u0440\u0441\u0438\u044f, \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u0441\u0435\u0433\u0434\u0430 <code>0x1<\/code> \u0432 BE \u043f\u043e\u0440\u044f\u0434\u043a\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"342\" width=\"342\">\n<p align=\"center\">DCID len<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u0414\u043b\u0438\u043d\u0430 DCID \u0432 \u0431\u0430\u0439\u0442\u0430\u0445, \u0434\u043b\u044f response header \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>0x0<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"342\" width=\"342\">\n<p align=\"center\">SCID len<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u0414\u043b\u0438\u043d\u0430 SCID \u0432 \u0431\u0430\u0439\u0442\u0430\u0445, \u0434\u043b\u044f response header \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>0x8<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"342\" width=\"342\">\n<p align=\"center\">SCID<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u041d\u043e\u043c\u0435\u0440 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044f<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"342\" width=\"342\">\n<p align=\"center\">Token len<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u0414\u043b\u0438\u043d\u0430 SCID \u0432 \u0431\u0430\u0439\u0442\u0430\u0445, \u0434\u043b\u044f response header \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>0x0<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"342\" width=\"342\">\n<p align=\"center\">Data len<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0447\u0430\u0441\u0442\u0435\u0439, \u043f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0430 \u0431\u0438\u0442\u0430, \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0431\u0430\u0439\u0442\u0430 \u044d\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043e\u0431\u0449\u0435\u0439 \u0434\u043b\u0438\u043d\u044b Data len, \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 0b01(0x4), \u0430 \u043a 0x4 \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u043b\u0438\u043d\u0443 <code>response header<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 \u0441\u043f\u0435\u0440\u0435\u0434\u0438 \u043a <code>struct message_handshake_initiation packet<\/code> \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <code>QUIC init header<\/code>, \u0442\u043e \u043d\u0430\u0447\u0430\u043b\u043e \u0441\u0435\u0441\u0441\u0438\u0438 WireGuard \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u043e \u0441\u0435\u0441\u0441\u0438\u0438 QUIC. \u0422\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u0435\u0441\u043b\u0438 \u0441\u043f\u0435\u0440\u0435\u0434\u0438 \u043a <code>struct message_handshake_response packet<\/code> \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <code>QUIC response header<\/code>, \u0442\u043e \u043d\u0430\u0447\u0430\u043b\u043e \u0441\u0435\u0441\u0441\u0438\u0438 WireGuard \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u043e \u0441\u0435\u0441\u0441\u0438\u0438 QUIC.<\/p>\n<h3>\u041f\u0440\u0438\u0435\u043c \u043f\u0430\u043a\u0435\u0442\u0430 WireGuard<\/h3>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432 \u043a\u043e\u0434 <a href=\"https:\/\/github.com\/torvalds\/linux\/tree\/master\/drivers\/net\/wireguard\" rel=\"noopener noreferrer nofollow\">WireGuard<\/a> \u0432 \u044f\u0434\u0440\u0435 Linux, \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u0444\u0430\u0439\u043b <a href=\"https:\/\/github.com\/torvalds\/linux\/blob\/master\/drivers\/net\/wireguard\/receive.c\" rel=\"noopener noreferrer nofollow\">receive.c<\/a>, \u0433\u0434\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0435\u043c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432. \u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>prepare_skb_header<\/code> \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 UDP \u0438\u0437 \u0431\u0443\u0444\u0435\u0440\u0430 skb. \u041d\u0430\u043c \u0436\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a QUIC. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430 \u043d\u043e\u043c\u0435\u0440 \u043f\u043e\u0440\u0442\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u0447\u0442\u0435\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 \u043f\u0430\u043a\u0435\u0442\u044b WireGuard \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0441 \u0447\u0438\u0441\u043b\u0430, \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u044e\u0449\u0435\u0433\u043e \u0447\u0435\u0442\u044b\u0440\u0435, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a QUIC \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 <code>0xC0<\/code>. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0431\u0430\u0439\u0442\u0430 \u043f\u0430\u043a\u0435\u0442\u0430, \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u044b \u0442\u0438\u043f\u0430 <code>initiation response<\/code> \u0438 <code>data<\/code>.<\/p>\n<h2>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h2>\n<figure class=\"\">\n<div><figcaption>Wireshark<\/figcaption><\/div>\n<\/figure>\n<p>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a Wireshark \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u0442 \u0440\u0443\u043a\u043e\u043f\u043e\u0436\u0430\u0442\u0438\u0435 WireGuard. Wireshark \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043a\u0430\u043a QUIC. \u041c\u044b \u0434\u043e\u0441\u0442\u0438\u0433\u043b\u0438 \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/867102\/\"> https:\/\/habr.com\/ru\/articles\/867102\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-443092","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/443092","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=443092"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/443092\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=443092"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=443092"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=443092"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}