컴퓨터 네트워크

3.1 Transport Layer

SWSEODONG 2021. 6. 12. 15:11

Chapter 3: Transport Layer

대표적인 프로토콜로 TCP와 UDP

goals:

  • understnad principles behind transport layer services:
    • multiplexing, demultiplexingdata link(2)계층이 해주는 일은 한 hop 이동하기network(3)계층이 해주는 가장 중요한 일은 routingtransport(4)계층이 해주는 일은 process(socket) 찾기= support process to process connection
    • IP address 하나에서 실행 중인 여러 process들이 물린 port를 찾는 것이 mux
    • 즉, application(5)계층에서 실행 중인 여러 process 중 dest process를 찾는 것
    • = support host to host connection
    • = support one hop delivery
    • 한 link의 대역폭에 여러 user의 대역폭을 실어 보내는 것
    • reliable data transfer
    • flow control
    • congestion control
  • learn about Internet transport layer protocols:
    • UDP: connectionless transport
    • TCP: connection-oriented reliable transport
    • TCP congestion control

Transport services and protocols

  • provide logical communication between app processes running on different hosts
  • transport protocols run in end systems (전부 TCP 얘기)
    • send side: breaks app messages into segments, passes to network layer
    • receive side: reassembles segments into messages, passes to app layer이러한 쪼개짐은 호스트에서 일어날 수도 있고 중간 라우터에서도 (IPv4 라우터인 경우에만) 일어날 수 있다.(IPv4) 라우터: outgoing link의 R 값이 incoming link의 R 값보다 작은 경우 IP 계층에서 하나의 패킷을 다시 여러 개의 패킷을 쪼개서 전송한다.
    • 호스트: transport 계층이 TCP를 사용한다면 TCP가/ UDP를 사용한다면 IP 계층에서 이 메시지를 R 크기에 맞게 break down한다.
    • L5 application 에서 내려온 message 크기가 네트워크와 연결된 링크의 transmission rate R 보다 큰 경우, 쪼개져서 전송되어야 하는데 그러한 작업을 하는 계층이 L4의 TCP와 L3의 IP 프로토콜이다.

⇒ TCP Segmentation과 IP fragmentation 두 가지. 쪼개는 이유는 나가는 link의 capacity가 한계가 있기 때문에

Transport vs. network layer

network layer: end(host) to end routing using IP address

transport layer: process to process connection using port #

Internet transport-layer protocols

  • service not available:
    • delay guarantees
    • bandwidth guarantees

Multiplexing/demultiplexing

client, server와 상관없이 sender는 mux, receiver는 demux

  • p1 p2가 하나의 IP address에서 Internet으로 나간다.

→ 하나의 IP address에 서로 다른 port number을 이용해 보낼 수 있기 때문에 mux (헤더-각각의 포트번호를 보유-를 붙인다)

  • transport 계층에서 받은 메시지를 바탕으로 어떤 process와 통신해야 할지 결정 → demux (헤더를 떼어서 읽고 dest를 찾아준다)

How demultiplexing works

TCP와 UDP 모두 헤더를 사용해 mux/demux. but 다른 헤더 필드가 다름

UDP는 TCP에 비해 기능이 많지 않아 헤더가 짧음

  • host receives IP datagrams
  • each datagram has src IP address, dest IP address (내 주소)

→ in layer3 header

  • each datagram carries one transport-layer segment
  • each segment has source, destination port number

UDP connection process

UDP에서는 여러 프로세스가 하나의 소켓과 통신하므로, 소켓에 나(sender)의 IP address와 나의 port number를 소켓에 알려줘야함

TCP connection process

TCP에서는 connection setup 시 end to end 사이에 dedicated 된 소켓을 사용하기 때문에 내 소켓에 receiver socket 정보도 담음. 반대도 마찬가지