Credit: 3
Status: In progress
시험 범위 챕터 3 ~ 5 (일부 제외되어 있음)
챕터 3 : Transport Layer
챕터 4 : Network Layer : Data Plane
챕터 5 : Network Layer : Control Plane
챕터 4 → 챕터 5 → 3 장 순서로 공부 → 책 내용 (extra 시험범위)
Quick access
Sender : encapsulates segments into datagrams, passes to link layer
Receiver : delivers segments to transport layer protocol
forwarding : router’s input link → appropriate router output link
routing : source → destination
Data plane
local, per-router function
Control plane
Network-wide logic
Internet “best effort” service model
No guarantees on:
When looking for forwarding table entry for given destination address, use longest address prefix that matches destination address.
transfer packet from input link to appropriate output link
swithcing rate : rate at which packets can be tranfer from inputs to outputs
Three major types of switching fabrics
First generation routers:
Memory가 input port 와 output port 사이의 중간지점이다.
Speed limited by memory bandwidth (2 bus crossing per datagram)
Datagram goes direct from input port memory to output port memory via a shared bus
bus connection : switching speed limited by bus badnwidth
32 Gbps bus, Cisco 5600 : sufficien4t speed for access routers
Interconnection nets initially developed to connect processor in multiprocessor
If bus speed is R, this switch can get 3R data through
Crosspoint : can be open and closed by switch fabric controller
Note that : if two packets from two different input ports are destined to the same output port, then on will have to wait at the input, since only one packet can be sent over any given bus at time.
More sophisticated interconnection networks use ****multiple stages**** of swithcing
Allow **packets from different input port** to proceed towards the ****same output port at the same time**** through the switching fabric.
queueing **delay** and **loss** due to input **buffer** overflow !
Buffering required when datagrams arrive from fabric faster than link transmission rate
Three things to decide here
with N flows, C link capacity, buffering equal to
해석 하면 : RTT (네트워크 사이즈) * C (output buffer에 물린 link capacity) / √N (TCP Conn. 개수)
Drop : which packet to add, drop when buffers are full / 종류 : tail drop, priority drop
marking : whcih packets to mark to signal congestion
packet scheduling : deciding which packet to send next on link
각 network link별로 MTU (Maximum Transmission unit = R) 상이함 → 각 라우터에서 다음 link의 MTU 보다 현제 datagram의 크기가 크면 쪼개서 보내야함. 즉 들어오는 R보다 나가는 R이 작은 경우
Reassembly는 final destination “host”에서만 하지 중간 router에서는 하지 않는다.
이유
fragmentation 시에는 헤더 (20byte)는 똑같이 복사되어 각 서브 패킷에 붙음
vs IPv6
IP version 6에서는 애초에 fragmentation하지 않는다 → 일단 전송하고 만약 MTU 초과 시, 호스트 단에서 fragmentation을 수행하여 다시 보냄
device interfaces that can physically reach each other ****without passing through an intervening router****
where are the subnets?
what are the /24 subnet address?
CIDR : Classless InterDomain Routing
subnet portion of address of arbitrary length
address format : **a.b.c.d/x,** where x is # bits in subnet portion of address
well-known port 사용
server : 67번 포트
client : 68번 포트
src : source (출발지)
dest : destination (도착지)
시나리오 순서
→ 메세지를 주고 받을 때 끝까지 broadcast를 사용
NAT: all devices in local network share just one IPv4 address as far as outside world is concerned
어떻게 바꿀 것이냐? local network를 떠나 Internet으로 가는 애들은 이 주소를 달고 갈 수 없기 때문에 공식적인 IP주소를 딱 하나만 받아(138.76.29.7) 나갈 때 무조건 이 주소를 대표로 바뀌어서 나감.
다 똑같은 주소로 나가면 어떻게 구별? 내가 가진 라우터가 NAPT를 지원하여(middle ware의 부가기능) port로 구별을 시킴
사용이유
NAT : 사설 ip를 사용하기 때문에 ip가 노출되지 않아 보안에 강하다.
IPv6 : NAT는 이를 수행하는 장비가 필요 하지만 IPv6는 필요하지 않다. QoS 보장, 무결성 보장
example
Algorithm complexity : n nodes
Message complexity:
Route oscillations problem
① 링크 비용 = 전송되는 트래픽 양
② 초기에는 시계반대방향 경로 선택
③ 링크 상태 알고리즘을 한 번 더 수행하면 시계방향 선택
④ 다시 수행하면 시계반대방향, 또 다시 수행하면 시계방향 경로를 선택하여 진동
iterative, asynchronous
distributed, self-stopping
lonk cost changes:
node detects local link cost change
“bad news travels slow” - count-to-infinity problem
LS | DV | |
---|---|---|
message complexity | n routers, O(n^2) messages sent | exchange between neighbors; convergence time varies |
speed of convergence | O(n^2) algorithm, O(n^2) messages → may have oscillations | convergence time varies; may have routing loops; count-to-infinity problem |
robustness | router can advertise incorrect link cost; each router computes only its own table | DV router can advertise incorrect path cost : black-holing; each router’s table used by others: error propagate thru network |
message 단위 : segment
logical communication between **processes**
multiplexing : handle data from multiple sockets, add transport header (위 → 아래, sender)
demultiplexing : use header info to deliver recieved segments to correct socket (아래 → 위, receiver)
TCP demultiplexing by 4 tuple:
UDP : User Datagram Protocol
UDP segment header
UDP demultiplexing using destination port number (only)
checksum
기본적인 명령어
송신 측
수신 측
재전송을 기반으로 하는 신뢰적인 프로토콜을 자동재전송요구 프로토콜인 ARQ(Automatic Repeat reQuest) 사용
ARQ의 기능
이 때 송신 측이 ACK 또는 NAK를 기다리는 오른쪽 상태에 있는 중에는 상위 계층으로부터 더 이상의 데이터를 전달받을수 없음 → Stop-and-Wait 프로토콜
치명적인 결함 : ACK/NAK 패킷의 손상가능성을 무시함 → 패킷에 순서번호 (sequence number)를 붙여서 해결 함(rdt 2.1)
NAK 대신에, 가장 최근에 잘 받은 패킷에 대한 ACK를 보냄으로써 NAK를 보내는 것과 동일한 효과를 얻을 수 있음
어떻게 패킷손실을 검출하며, 패킷 손실이 발생하였을 때 어떤 핸동을 해야하는지 중요 → 체크섬, sequence number, ACK
패킷 손실의 검출을 Timer로 진행
rdt 3.0은 기능적으로 매우 정확하지만, 오늘날의 고속 네트워크에서 stop-and-wait 방식이므로 만족스러운 성능을 보여주지 못함
예시)
RTT = 30msec
전송률 R = 1Gbps (10^9)
패킷 크기 (L) = 헤더와 데이터를 포함하여 패킷 당 1000byte (8000bit)
패킷 전송 시간은?
즉, 8마이크로 sec 동안 송신측은 8000비트의 첫 비트 부터 마지막 비트 까지 수신측으로 보냄.
보낸 패킷들은 15msec(RTT/2) 이동하며, 수신측이 바로 ACK를 보낸다는 가정 하에 또 다른 15msec 후에 ACK가 송신 측으로 도착하기 때문에, 결국 송신 측은 30.008msec 후에 ACK받음
즉, 30.008msec 동안 송신측은 데이터 전송에 0.008msec만 사용 하였음.
따라서 이용률이 매우 낮다.
이에 대한 해결방안 : Pipelining
ACK를 기다리지 않고, 여러 패킷을 전송하는 방법
하지만 다음과 같은 사항을 고려해야함
이러한 고려사항들을 만족시키기 위해 GBN(Go-Back-N, N부터 반복)과 SR(Selective Repeat, 선택적 반복) 프로토콜이 나타남
sender: “window” of up to N, consecutive transmitted but unACKed pkts
cumulative ACK
timer for oldest in-flight packet
receiver ****individually**** acknowledges all correctly received packets
sender times-out/retransmit individually for unACKed packets
Selective repeat : a dilemma
example :
seq #s : 0, 1, 2, 3
window size = 3
what relationship is neede between sequence # size and window size to avoid problem in scenario (b)?
→ 한정된 순서번호를 사용함. 즉, 한정된 순서번호의 허용치가 윈도우 사이즈 보다 크게 많지 않기 때문에 윈도우 사이즈보다 순서번호 허용치를 크게 늘리면 문제 해결됨
순서번호 허용치 값 ≥ 2 * 윈도우 크기
sequence number ≥ 2 * window size
정리 정말 잘하시네요 멋있습니다.