C.W.K.
Stream
Lesson 09 of 12 · published

OSI 모델, 단순화

~15 min · osi, tcp-ip, layers, encapsulation

Level 0Pinger
0 XP0/101 lessons0/12 achievements
0/150 XP to next level150 XP to go0% complete

왜 "layer" 가 troubleshooting 을 가능하게 만드는가

전체 OSI 모델은 7 layer 인데, 실전 운영에선 4 개만 알면 돼. 그게 인터넷이 실제 쓰는 TCP/IP 모델에 깔끔하게 매핑돼. 문제가 어느 layer 에 사는지 알면 한 시간 추측이 5 분 fix 로 변해.

Layer역할프로토콜어디 사는지
Application앱이 진짜 원하는 것HTTP, SSH, DNS, SMTP네 소프트웨어
Transport프로세스 간 신뢰 / 빠른 전달TCP, UDPOS 커널
Network네트워크 간 패킷 라우팅IP, ICMP라우터, OS 커널
Physical/Link선/공중파 위 비트Ethernet, Wi-Fi, ARPNIC, 스위치, 케이블

Encapsulation — 모든 패킷이 진짜로 뭔지

웹페이지 로드할 때 요청은 머신 떠나기 전 헤더로 layer 별로 감겨:

  1. 브라우저가 HTTP 요청 만듦: GET / HTTP/1.1\nHost: github.com — Application.
  2. OS 가 TCP segment 로 감음, 출발/도착 포트 포함 — Transport.
  3. OS 가 IP 패킷으로 감음, 출발/도착 IP 포함 — Network.
  4. NIC 가 Ethernet frame 으로 감음, 출발/도착 MAC 포함, 선 위에 올림 — Link.

받는 쪽은 헤더를 역순으로 벗김 — de-encapsulation. 각 layer 는 자기 헤더만 신경 써.

Layered troubleshooting

  • Ping 안 돼? → Network layer (IP, routing, gateway).
  • Ping 되는데 포트 22 연결 안 돼? → Transport layer (방화벽 TCP 차단, 포트 닫힘).
  • 연결되는데 앱이 에러? → Application layer (config, auth).
  • 로컬 장치까지 안 돼? → Physical/Link (케이블 빠짐, Wi-Fi 다운).

Code

Layer 마다 점검·bash
# Physical/Link: is the interface even up?
ifconfig en0 | grep status

# Network: can we reach the gateway?
ping -c 3 $(route -n get default | awk '/gateway/ {print $2}')

# Network: can we reach the public internet?
ping -c 3 1.1.1.1

# Transport: is a specific port open?
nc -zv 192.168.1.100 22

# Application: does HTTP actually return something sane?
curl -I https://github.com

External links

Exercise

네트워크에서 도달 못 하는 거 하나 골라 (말 안 듣는 프린터, 또는 일부러 가짜 IP 192.168.99.99 같은 거). Layer 따라 걸어 — ifconfig (link), ping gateway (network), ping target (network), nc -zv target port (transport), application 레벨 테스트 (application). 어느 layer 가 먼저 깨지는지 메모 — 그게 네 버그.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.