Haskell
This article is my annual report of 2022FY(fiscal year in Japan; from April 2022 to March 2023). My mission in IIJ is contribute to standardizations of new network protocols by their implementations. As you may know, I maintain some networ…
遅延評価、何も分からん。— 山本和彦 (@kazu_yamamoto) 2023年2月18日 Haskellの並行プログラミングの奥義であるatomicModifyIORef'の歴史。内容は予告なく修正される。 atomicModifyIORef'は「IORef」と「関数」を引数に取る。その関数は、IORefが現在指し…
While Haskell quic version 0.0.1 or earlier supports the x86_64 architecture only, version 0.0.2 or later will supports non-x86_64 architectures. cryptonite When I started implementing the quic library in Haskell, I used cryptonite as cryp…
これは、Haskell Advent Calendar 2021の2日目を埋めるために書いた記事です。実は単に僕が作った「関数プログラミングの入門」の資料の宣伝です。 ちなみに、僕の関数プログラミングの定義は「不変データプログラミング」であり、おそらく最も厳しい定義で…
これは、Haskell Advent Calendar 2021 の8日目の記事です。 Haskellのコンパイラとして事実上一択となったGHCには、「軽量スレッド」が実装されています。軽量スレッドは、ネイティブスレッドよりも軽量なスレッドで、他の言語では「グリーンスレッド」とも…
As I described in The Current Plan for Haskell QUIC, I have released the followings: tls http2 quic http3 warp-quic mighttpd2 tls tls v1.5.5 provides the Network.TLS.QUIC module. If you are interested in how this module has been improved, …
If I understand correctly, most QUIC implementations of clients and servers uses unconnected UDP sockets with sendto()/sendmsg() and recvfrom()/recvmsg(). For the server side, this is probably because they adopt event-driven programming. T…
My open server of Haskell QUIC on Linux sometimes got segfaults. I saw two types of segfaults. One is a simple segfault by accessing a wrong address: mighty: segmentation fault The other is relating to free(): *** Error in `mighty': corrup…
For security reasons, the typical boot process of HTTPS servers is as follows: Executed by a root. Reading a TLS private key and open a listen socket on TCP port 443. Switching the root user to nobody (or something). Since accept() can cre…
h2spec is an excellent test tool to check if HTTP/2 servers can handle error cases correctly. When I was developing HTTP/2 server library in Haskell, I used to utilize Firefox and Chrome for normal cases and h2spec for error cases. h2spec …
In recent days, QUIC is hot. As the following blog posts describe, the standardization of QUIC is now in the final stage and h3-29 (HTTP/3 over QUIC of draft 29) is out there: Chrome is deploying HTTP/3 and IETF QUIC How Facebook is bringi…
In "Implementation status of QUIC in Haskell", I briefly described QUIC APIs of the TLS library in Haskell. I first invented APIs based on static functions but switched to the thread-based approach to follow Olivier Chéron's recommendation…
For last two months, I have been trying to implement "QUIC Loss Detection and Congestion Control" in Haskell. This blog article describes a brief summary on what I have done. ACK handling Before loss detection and congestion control were d…
Mew.org is now speaking HTTP/3 (HTTP/2 over QUIC). If you gain access to the site using Firefox Nightly, the first connection would be HTTP/2 then the following connections should be HTTP/3 led by Alt-Svc:. Firefox Nightly This article exp…
After implementing HTTP/2 in Haskell and TLS 1.3 in Haskell, I have been working for IETF QUIC. This article explains what I have done in 2019 fiscal year of Japan to report our sponsor, Internet Initiative Japan (IIJ). I have both titles …
Closing connections gracefully is an old and new problem in network programming. In the HTTP/1.1 days, this did not get attention since HTTP/1.1 is a synchronous protocol. However, as Niklas Hambüchen concretely and completely explained, H…
プログラミングHaskell第2版の翻訳とレビューが完了し、ラムダノートから発売されました。レビューしてくださった5名の方に、改めてお礼を申し上げたいと思います。閉じられたissueは177個ですが、複数の指摘を含むissueもあるので、大雑把に言って250箇所ぐ…
I'm trying to develop QUIC in Haskell. In short, QUIC is a fast and reliable transport protocol based on UDP. You can think of it as TCP2. HTTP/2 over QUIC is now called HTTP/3. Two level dispatchings are necessary for QUIC: Dispatching QU…
私的なメモ。GHCを生でインストールし、cabalのラッパーであるcabを使っている。stackはたまに使うことがある程度。 例外が起きた場所を探す 以下で例外が起きたときにスタックトレースが取れる。 % prog +RTS -xc GHCiを使う方法もある。 ボトルネックを探…
Haskell TLS library version 1.4.1 or earlier support SSL 2.0, SSL 3.0, TLS 1.0, TLS 1.1 and TLS 1.2. Here is brief summary of their security: SSL 2.0 is insecure and obsoleted by RFC 6176 SSL 3.0 is insecure and obsoleted by RFC 7568 TLS 1…
Monadとは、Applicativeであるデータ構造で、(>>=)演算子を提供し、それがMonad法則を満たすものである。 正確に表現するとこうなんですが、「はぁ?」っ感じですよね。「満たすべき法則」とか言われると、まったく理解できません。でも、オススメの形に持っ…
Haskellがとっつきにくい原因の一つに遅延評価がある。入門書では、無限リストと遅延評価がことさら強調される。しかし、Haskellを業務で使ってみると、遅延評価が煩わしくなってくる。遅延評価なしでもほとんどのことは実現できるし、メモリーの使用量は推…
Brief history The first commit of the network library in Haskell was created by Simon Marlow in 2001. It says: Package 'net' moved over. URI & CGI still missing because they have dependencies on other bits that haven't made it over yet. So…
QUICや ああQUICや QUICや 詠み人知らず。QUICの実装の難しさに絶望した心境が詠まれたと伝う。 序章 2017年の7月ごろ、QUICの実装を始めました。Haskellの有名なシリアライザ/デシリアライザである binary や cereal では、バッファ操作ができないので、パ…
NewSessionTicketをいつ送るかの議論です。 まず、TLS 1.3 開発日記 その9 NewSessionTicketをお読み下さい。 Haskell TLS の実装では、Client Finished の値を予測して NewSessionTicket を作成し、handshake() API が送信していました。このときは、クライ…
復習 Semigroup 結合則 (a・b)・c = a・(b・c) class Semigroup a where (<>) :: a -> a -> a Monoid 結合則 (a・b)・c = a・(b・c) 単位元 e・a = a・e = a class Semigroup a => Monoid a where mempty :: a mappend :: a -> a -> a mappend = (<>) 本題 H…
TLS 1.2で暗号路の鍵を更新する場合は、ハンドシェイクをやり直す(再ネゴシエーションする)必要があった。実装の視点からいうと、鍵更新はハンドシェイクに対して同期的だった訳だ。 TLS 1.3では、サーバやクライアントがハンドシェイクをし直すことなく、い…
はてなダイアリーからはてなブログに移行しました。今後も、細々とブログを書いていきます。 2018年8月、TLS 1.3がRFC8446になりました!(TLSのRFCは、伝統的にXX46という番号になります。) RFC8446の貢献者リストに僕の名前が載っていることを聞きつけたIIJ…
自分で定義するデータの中には、足し算したくなるようなデータがある。たとえば、送信と受信のカウンターを定義したとしよう。 data Metrics = Metrics { rx :: Int , ts :: Int } deriving (Eq, Show) これは以下のように足し算できると嬉しいだろう。 > Me…
kazuho さんが実装を進めている picotls を使う方法のまとめ。picotls は TLS 1.3 のみを実装している。またデフォルトで利用できる ECDHE は P256 のみである。 インストール cmakeが必要なので、あらかじめインストールしておく。master ブランチが draft …