-
Notifications
You must be signed in to change notification settings - Fork 31
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
東京Ruby会議12レポート sylph01担当分 #567
Open
sylph01
wants to merge
4
commits into
rubima:0065-tokyo12
Choose a base branch
from
sylph01:0065-tokyo12
base: 0065-tokyo12
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,9 +129,19 @@ created_on: 2025-01-27 | |
|
||
* 録画: https://example.com/ | ||
|
||
レポート。レポート。レポート。レポート。レポート。 | ||
RubyKaigiのNOCチームを長く担当されている花月かすみさんによる、DNSの暗号化の自動構成を行うためのプロトコルの紹介と、その検証のためにQUICライブラリのラッパーを実装した、という話です。 | ||
|
||
(your name) | ||
Domain Name System(DNS)は最も身近にはドメイン名からIPアドレスを得るための方法として用いられていますが、実際にはドメイン名にあらゆるデータを紐付けられるキーバリューストア、階層型分散データベースとしてインターネットに欠かせない存在となっています。しかしDNSは一般に使われている方式(UDPポート53でクエリを行う、通称「Do53」)では暗号化されておらず、カンファレンスのネットワークを含む公衆WiFiでは盗聴に対して脆弱であるということが知られています。カンファレンスにおいてはWiFiどころかそのへんを転がしているケーブルに対してMan-in-the-Middle攻撃することも容易です。そこで現代ではDNS over TLS(DoT), DNS over HTTPS(DoH; この中にはHTTP/2を使うものとHTTP/3を使うものがある), DNS over QUIC(DoQ)といった、クライアントとリゾルバ[^note-on-resolver]の間の通信を暗号化することで盗聴に対して保護する方式が提案されています。 | ||
|
||
[^note-on-resolver]: 正確にはRFC 9499 Section 6でいう"Recursive Resolver"のこと。「フルサービスリゾルバー」、「キャッシュDNSサーバー」と呼ばれることもある | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (nit) この下にもセクションがいくつか挟まる都合、脚注にすると物理的にかなり離れてしまうので、本文中は There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 068eeaf にて直しました! |
||
|
||
DNSの暗号化を行うにあたって、クライアントに対してこのサーバーはDNSクエリの暗号化に対応しています、という情報を伝えることで自動構成を行いたい、という要望があります。これを実現するためにAdaptive DNS Discovery(ADD)というワーキンググループがIETFで活動しており、標準として提案されたプロトコルとしてDiscovery of Designated Resolvers(DDR; RFC 9462)、DHCP and Router Advertisement Options for the Discovery of Network-designated Resolvers (DNR; RFC 9463)があります。前者はmacOSやiOS、後者は一部のWindowsで使われているそうです。RubyKaigi 2023以降ではDoT, DoH, DDRを提供しており、だいたい半分くらいのDNSクエリが暗号化されていたそうです。 | ||
|
||
DNSは動作するプロトコルの組み合わせが非常に多く、また「少し壊れててもそれっぽく動いちゃう」ので、検証プログラムを実装することにしたそうです。RubyでDNS over QUICを検証するにあたってRubyのQUIC実装がほとんどなかったことから、ngtcp2というCで書かれたQUIC実装にRubyバインディングを実装しました。この実装の工夫として、Ruby本体で進行中の並行処理の機能に影響されないようI/Oまですべてをngtcp2に任せるのではなくI/OはRubyで引き取るようにした、という点が挙げられていました。QUICは通常のTCPではカーネルが行う再送処理をアプリケーション側で巻き取ることで高速化を得ていますが、代わりにアプリケーションはその実装を頑張らなければいけないという性質があり、QUICの約束する効率化を実現するためには単にラッパーを書くだけでは足りず考えることが多い、ということを実感できました。 | ||
|
||
なかなかRubyの文脈でネットワークの裏側の話を聞くことがなかったのでとても新鮮でした。「動いて当たり前」と思われているネットワークの裏にこのような努力が埋まっているということを多くの人が感じていただければ、プロトコル実装仲間としてはとても嬉しいです。 | ||
|
||
(sylph01) | ||
|
||
|
||
## 『Regional.rb and the Tokyo Metropolis』 | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ほぼ興味からの質問なんですが、Do53 って言ったときには 53/tcp へのフォールバック挙動は含まないものですか?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://www.nic.ad.jp/ja/materials/iw/2020/proceedings/c33/c33-yamaguchi.pdf の4ページ目を見る限り、含む、という理解でよさそうですね。ここ「UDP/TCPポート53」っていう言い方をするのか、それともフォールバック挙動も言及したほうがいいのかどうしよう…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(UDPポート53(場合によってはTCPにフォールバック)でクエリを行う、通称「Do53」) と表記することにしました @ 8230109