5
2

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 3 years have passed since last update.

webブラウザのタブが開ける仕組みは?

Posted at

確認前の疑問

httpは80番ポート、httpsは443番ポート。
webブラウザでタブをいっぱい開いていたら、80,443ポートに別々のタブのアクセスが来てごっちゃにならないの?

調査

参考サイト

ポイント

  • webサーバが受信するときの宛先ポートは80番,443番と決まっている
  • webブラウザ側のポート番号は任意
  • webブラウザはTCPのコネクションを確立する際にwebサーバに(エフェメラルポートの範囲で)任意のポート番号を知らせる

要するに

下記のようにwebブラウザでタブを開いてたとする
1.png

  • YouTubeタブ ... [webサーバ]443ポート ←→ [クライアントPC]50000ポート
  • Facebookタブ ... [webサーバ]443ポート ←→ [クライアントPC]50001ポート
  • Googleタブ ... [webサーバ]443ポート ←→ [クライアントPC]50002ポート
  • Qiitaタブ ... [webサーバ]443ポート ←→ [クライアントPC]50003ポート

おまけ

  • ポートの範囲
ポート番号 説明
0番 - 1023番 ウェルノウンポート
1024番 - 49151番 登録済みポート番号
49152番 - 65535番 ダイナミックポート、エフェメラルポート クライアント側で使用されるポート番号

確認後の認識

httpは80番ポート、httpsは443番ポート → これはサーバ側
webブラウザでタブをいっぱい開いても、クライアント側のポートはかぶらないようになっているので、ごっちゃにならない

5
2
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
5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?