[컴퓨터네트워크] 전송계층 1

백은진·2021년 4월 13일
0

강의

목록 보기
2/7

복습

  • What can happen over unreliable channel?
    • Packet error, packet loss
  • Packet error mechanisms
    • Error detection
    • feedback
    • retransmission
    • sequence number
  • Packet loss mechanisms
    • Timeout
  • We built simple reliable data transfet protocol
    • Real-world protocol(TCP 등) is more complex, but with same principles.
  • Stop-and-wait Protocol and Pipelineing Protocol

본 학습

Pipeline 방식의 protocol

  • Pipelining이란? sender allows multiple, "in-flight", yet-to-be-acknowledged packets.
    - range of sequence numbers must be increased
    - buffering at sender and/or receiver
  • Two generic forms of pipelined protocols
    - go-Back-N
    - selective repeat

Go-Back-N 방식

  • window size (which is N) 만큼 한 번에 packet을 보낼 수 있다.

  • ACK(n): "n 번 까지 잘 받았다는 메세지"를 receiver가 sender에게 보내준다.

  • reveiver는 기다리고 있는 packet만 받기 때문에, 기다리지 않고 있는 packet이 전송되면 모두 버린다.

  • 즉, window size가 4라고 했을 때, sender는 0부터 3까지 보내고, receiver는 0을 받은 후 ACK(n)을 sender에게 피드백한다. 이때 중간 패킷(예를 들어 6번 패킷)이 유실되었다면, sender는 [6~9] 패킷을 계속 receiver에게 전송하지만, receiver는 이를 받지 못한다. 결국 timeout이 발생하고, sender는 [6~9] 패킷을 새로 재전송한다.
    - 이를 패킷 넘버로 나열하자면 다음과 같다.
    - 0 → 1 → 2 → 3 → 4 → 5 → 6 → 7 → 8 → 9 → 6' → 7' → 8' → 9' → 10 → ...
    - 즉, packet loss가 발생하면 n개(window size)만큼 패킷넘버가 되돌아온다.

  • window 내에 있는 패킷들은 아직 receiver가 잘 받았는지 확인되지 않은 데이터이기 때문에, 버퍼에 저장을 해두고 있어야 한다.

Selective Repeat 방식

  • receiver individually acknowledges all correctly received packets
    - buffers packets, as needed, for eventual in-order delivery to upper layer
  • sender only resends packets for which ACK not received
    - sender timer for each unACKed packet
  • sender window
    - N consecutive sequence numbers
    - again limits sequence numbers of sent, unACKed packets

- GBN은 유실된 패킷이 있을 때, 전체 n을 재전송하는 반면, Selective Repeat은 유실된 패킷만 선택적으로 재전송한다는 점이 보다 효율적이다.
- Selective repeat: dilemma

- 이 문제는 새로운 패킷과 복제된 패킷이 구별될 수 있는 만큼 sequence number를 늘리는 것으로 해결할 수 있다. 구별될 수 있는 만큼의 범위는 window size와 밀접한 관련이 있다.
- 오늘날 GBN이 selective repeat 보다 더 사용된다.

정리

  • 다음주 학습 내용
    • TCP는 GNB와 Selective repeat의 장점을 조합한 protocol이다.
profile
💡 Software Engineer - F.E

0개의 댓글