1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

3way handshake

Last updated at Posted at 2016-11-09

TCPはヘッダ情報の中に、6つのフラグ情報を持っている

URG ACK PSH RST SYN FIN
0 1 0 0 1 0

それぞれ意味は

Flg Mean
URG Urgent 緊急フラグ
ACK Acknowledgement(確認応答)。相手からのデータを受け取った証として、確認応答番号と共に送られる
PSH Push 受信したデータを即時上位アプリへ送信する
RST Reset コネクション強制終了
SYN Synchronize コネクション確立要求
FIN Finish コネクション終了

3Way Handshake

1.ClientA(以下A)がServerB(以下B)と通信したい

2.AはBに、
SYN=1, ACK=0, SEQNo=111を送る
「BとシーケンスNo.111から始まる通信がしたい」

3.Bは受け取ったシーケンスNoに1を足して確認応答番号(ACKNo)とし、承認フラグ(ACK)を1にして送る。(これでA→B間の通信がうまくいっていることが保証された)
さらに、自分もAと通信したい旨を伝えるため、SYN=1に、SEQNo=300に設定した信号を送る
SYN=1,ACK=1,SEQNo=300
「Aからの通信はちゃんと届いています。こちらのSEQNoも確認してください」

4.AはBに、SYN=0,ACK=1,ACKNo=301を送る
「Bからの通信確認しました」

以上でハンドシェイク終了です。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?