[NW] 4th : Transport Layer

seunghyunยท2023๋…„ 3์›” 1์ผ
0

๐Ÿ’ป

๋ชฉ๋ก ๋ณด๊ธฐ
10/16

Introduction

Transport Layer ๐Ÿ›œ

๋ชฉ์ ์ง€ ํ”„๋กœ์„ธ์Šค์— ์•Œ๋งž๊ฒŒ ๋ฐฐ๋‹ฌํ•ด์ฃผ๋Š” ์ผ์ด Transport Layer ์˜ ๊ธฐ๋ณธ์ ์ธ ์—ญํ• ์ด๋‹ค.

Multiplexing/Demultiplexing

โœ”๏ธ multiplexing as sender: ๋‹ค์ˆ˜์˜ ์ž…๋ ฅ์„ ํ•˜๋‚˜๋กœ ์ถœ๋ ฅ

  • handle data from multiple sockets, add transport header (later used for demultiplexing)

โœ”๏ธ demultiplexing as receiver: ๋ชฉ์ ์ง€ ํ”„๋กœ์„ธ์Šค์— ์•Œ๋งž๊ฒŒ ๋ณด๋‚ด์ฃผ๋Š” ๊ฒƒ

  • use header info to deliver received segments to correct socket

Connection-oriented demultiplexing: example

โœ”๏ธ TCP socket identified by 4-tuple
TCP ์†Œ์ผ“์€ ๊ณ ์œ ์˜ id ๋ฅผ ๊ฐ€์ง„๋‹ค. id ์˜ 4๊ฐ€์ง€ ๊ตฌ์„ฑ์š”์†Œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.

  • source IP address
  • source port number
  • dest IP address
  • dest port number

โœ”๏ธ demux: receiver uses all four values (4-tuple) to direct segment to appropriate socket

UDP segment header

  • checksum ๐Ÿ‘‰ error detection
  • ์ˆœ์„œ ๊ฐœ๋…์€ ์—†๊ณ  error ๊ฐ€ ์—†์œผ๋ฉด ์ „๋‹ฌํ•œ๋‹ค. ์œ ์‹ค๋˜๋”๋ผ๋„ ์–ด์ฉ” ์ˆ˜ ์—†๋‹ค.
  • ์œ ์‹ค ๊ฐ€๋Šฅ์„ฑ์€ ์žˆ์„์ง€์–ธ์ • ์ •ํ™•ํžˆ ์ „๋‹ฌํ•˜๋ ค๋˜ ํ”„๋กœ์„ธ์Šค์—๊ฒŒ ์ „๋‹ฌํ•  ์ˆ˜ ์žˆ๋‹ค.

TCP

Overview

โœ”๏ธ point-to-point:

  • one sender, one receiver

โœ”๏ธ reliable ๐ŸŽฏ, in-order byte stream:

  • no "message boundaries"

โœ”๏ธ pipelined:

  • TCP congestion and flow control set window size

โœ”๏ธ a send & receive buffers

โœ”๏ธ full duplex data:

  • bi-directional data flow in same connection
  • MSS: maximum segment size

โœ”๏ธ connection-oriented:

  • handshaking (exchange of control msgs) init's sender, receiver state before data exchange

โœ”๏ธ flow controlled: ๐ŸŽฏ

  • sender will not overwhelm receiver

TCP segment structure

3 Way Hand Shaking

Closing TCP Connection

Congestion control ๐ŸŽฏ

๐Ÿ’ก too many sources sending too much data too fast for network to handle.

  • lost packets (buffer overflow at routers)
  • long delays (queueing in router buffers)

๋„คํŠธ์›Œํฌ ์ƒํ™ฉ์— ๋งž์ถฐ์„œ, ํ˜ผ์žก ์ƒํ™ฉ์„ ๊ณ ๋ คํ•ด์„œ ๋ณด๋‚ด๋Š” ์–‘์„ ์กฐ์ ˆํ•ด์ฃผ๋Š” ๊ฒƒ.
๋„คํŠธ์›Œํฌ ํ˜ผ์žก ์ƒํ™ฉ์„ ์–ด๋–ป๊ฒŒ ์•Œ ์ˆ˜ ์žˆ์„๊นŒ?

(์ฐธ๊ณ ! UDP ๋Š” no congestion control)

๋„คํŠธ์›Œํฌ ์ƒํ™ฉ์ด ์ข‹์œผ๋ฉด MSS๊ฐ€ ์ฆ๊ฐ€ํ•œ๋‹ค. ์œ ์‹คํ•  ๊ฐ€๋Šฅ์„ฑ์ด ์žˆ์œผ๋ฉด ์ค„์ธ๋‹ค


๐Ÿ”— Reference

์ž˜๋ชป๋œ ๋‚ด์šฉ์ด ์žˆ๋‹ค๋ฉด ๋Œ“๊ธ€๋กœ ์•Œ๋ ค์ฃผ์‹œ๋ฉด ๊ฐ์‚ฌํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค ๐Ÿ˜Š

profile
๐Ÿ‘ฉ๐Ÿปโ€๐Ÿ’ป๐ŸŽฎ

0๊ฐœ์˜ ๋Œ“๊ธ€