my cognition(旧)

移転しました。https://kitkatayama.hatenablog.com/ に移動します。

移転しました。移動します。

本日反省して調べたこと。(TCP切断時/root-servers/SSL/HTTPメソッド)

tl;drは無し。忘れないように、今日調べたことのメモを記載しておく。

TCP接続/切断時の挙動について

RFC793を参照する。

RFC 793 - Transmission Control Protocol

接続時

3ウェイハンドシェイクはありふれているので詳しいことは割愛。 SYN→SYN+ACK→ACKの流れ。

切断時

Client: send FIN(Established->Finwait-1)
Server: rcv FIN, send ACK of FIN(Established->Close wait)
Client: rcv ACK of FIN(Finwait-1->Finwait-2)
Server: send FIN(Close wait->Last-ack)
Client: rcv FIN, snd ACK of FIN(Finwait-2->Timewait)
Server: rcv ACK of FIN(Last-ack->Closed)
Client: Timeout(デフォルト60秒)経過 (Timewait->Closed)

大学の実験などで、TIMEWAITでsocketが解放されずなんでやねん!する経験が懐かしい。RHELの場合は、こちらに詳しい解説がある。
なんでも、TIMEWAITを再利用する実装もあるっぽい。

How to reduce the number of TIME WAIT sockets? - Red Hat Customer Portal

その他参照:The TCP/IP Guide - TCP Connection Termination

root-serversについて

ここに割と書いてある。.comだとか.orgの権威DNSサーバのIPを持ってる。a-mまである。

Root Server Technical Operations Assn

SSL検証

さすがにRFCは長すぎるのでIBMの記事を参照。

https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.1.0/com.ibm.mq.doc/sy10660_.htm

HTTPメソッド

RFCはここ。特にRFC7231に詳しい内容が記載。

RFC 7230 - Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing
RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content

RFC偶然みつけてほほーんって思った。

All general-purpose servers MUST support the methods GET and HEAD. All other methods are OPTIONAL.

各メソッドは以下の通り。一部割愛。

GET: Transfer a current representation of the target resource.
HEAD: Same as GET, but only transfer the status line and header section.
POST: Perform resource-specific processing on the request payload.
PUT: Replace all current representations of the target resource with the request payload.
DELETE: Remove all current representations of the target resource.

GETはURLに全部乗る。
POSTとPUTの違いは、冪等かどうかという視点で解釈されていることが多い。RFCの例を見てもパッとしない。PUTは同じステータスを保つ、POSTはどうなるかわからない。
英語的な意味でとらえると、投函するか、(場所を指定して)置くかという感じになるので、そこからたどると何となくしっくりくる。 どちらにしても、データはペイロードに書かれて、URLには表れない。

put post difference - Google 検索