Network: Difference between revisions
(Fix: remove --- horizontal lines (12 removed)) |
(Phase 0.4: Expand Network) |
||
| Line 232: | Line 232: | ||
[[Category:Guide]] | [[Category:Guide]] | ||
== TCP/IP Tuning == | |||
Linux 네트워크 성능 튜닝은 HPC 워크로드에 중요. | |||
<syntaxhighlight lang="bash"> | |||
# /etc/sysctl.conf에 추가 | |||
net.core.somaxconn = 65535 | |||
net.core.netdev_max_backlog = 5000 | |||
net.core.rmem_max = 16777216 | |||
net.core.wmem_max = 16777216 | |||
net.core.rmem_default = 16777216 | |||
net.core.wmem_default = 16777216 | |||
net.ipv4.tcp_rmem = 4096 87380 16777216 | |||
net.ipv4.tcp_wmem = 4096 65536 16777216 | |||
net.ipv4.tcp_max_syn_backlog = 8192 | |||
net.ipv4.tcp_tw_reuse = 1 | |||
net.ipv4.ip_local_port_range = 1024 65535 | |||
# 적용 | |||
sudo sysctl -p | |||
</syntaxhighlight> | |||
== ethtool == | |||
ethtool은 네트워크 인터페이스 설정 도구. | |||
<syntaxhighlight lang="bash"> | |||
# 인터페이스 설정 확인 | |||
ethtool eth0 | |||
# 오프로딩 설정 | |||
ethtool -k eth0 | |||
# TSO/GSO 활성화 | |||
ethtool -K eth0 tso on gso on | |||
# 링크 속도 변경 | |||
ethtool -s eth0 speed 10000 duplex full autoneg on | |||
# 인터페이스 이름 변경 | |||
ethtool -N eth0 flow-type tcp src-port 80 action 1 | |||
</syntaxhighlight> | |||
== iproute2 == | |||
iproute2는 네트워크 설정 도구 모음 (ifconfig/route 대체). | |||
<syntaxhighlight lang="bash"> | |||
# IP 주소 확인 | |||
ip addr show | |||
# 라우팅 테이블 | |||
ip route show | |||
# neigh 테이블 | |||
ip neigh show | |||
# VLAN 설정 | |||
ip link add link eth0 name eth0.100 type vlan id 100 | |||
ip link set eth0.100 up | |||
# 네트워크 네임스페이스 | |||
ip netns add ns1 | |||
ip link set eth0 netns ns1 | |||
</syntaxhighlight> | |||
Latest revision as of 13:37, 17 July 2026
Network
Overview
네트워킹은 컴퓨터 시스템 간 데이터 통신을 가능하게 하는 핵심 기술입니다. 서버 환경에서는 네트워크 구성, 성능 최적화, 보안 설정이 시스템 안정성과 직결됩니다.
Summary
- 무엇인가? — 컴퓨터 간 데이터 통신을 위한 프로토콜, 하드웨어, 소프트웨어의 집합
- 왜 필요한가? — 서버 간 통신, 클라우드 연결, 외부 서비스 접근
- 언제 사용하는가? — 모든 서버 환경, 클라우드, 데이터센터, HPC 클러스터
Purpose
이 문서가 존재하는 이유
- Goal: 네트워크 기본 개념부터 실전 설정까지 한 곳에서 제공
- Scope: IP 클래스, 인터페이스 명명, 성능 용어/테스트, 프로토콜, 트래픽 분석, 팁/트릭
- Non-goals: 특정 클라우드 제공자(AWS, GCP)별 네트워크 설정은 별도 문서
Key Concepts
| Concept | Description | Related |
|---|---|---|
| IP Address | 네트워크상에서 장치를 식별하는 고유 주소 | Network Class |
| Interface Naming | 네트워크 인터페이스 명명 규칙 (eth0, enp3s0 등) | Network interface name |
| Throughput | 단위 시간당 전송 가능한 데이터량 | Network performance terminology |
| Latency | 데이터 전송 지연 시간 | Network performance terminology |
| TCP/UDP | 주요 전송 계층 프로토콜 | Network protocols |
| Bandwidth | 네트워크 회선의 최대 전송 용량 | Network performance test |
| Packet Loss | 전송 중 손실된 패킷 비율 | Network traffic |
Architecture
네트워킹은 OSI 7계층 모델로 구조화됩니다:
graph TD
A[Application Layer - HTTP, DNS] --> B[Transport Layer - TCP, UDP]
B --> C[Network Layer - IP, ICMP]
C --> D[Data Link Layer - Ethernet, VLAN]
D --> E[Physical Layer - Cable, NIC]
C --> F[Routing & Switching]
B --> G[Firewall - iptables]
Workflow
| Stage | Input | Output |
|---|---|---|
| Interface Config | Network config file | Active interface |
| IP Assignment | DHCP / Static config | Assigned IP address |
| Performance Test | IPerf3 / Speedtest | Bandwidth, Latency metrics |
| Traffic Monitor | tcpdump / conntrack | Real-time traffic data |
Detailed Explanation
IP Address Classification
IPv4 주소는 Class A, B, C, D, E로 분류됩니다. 서버 환경에서는 주로 Class C (192.168.x.x)와 Class B (172.16.x.x)가 사용됩니다.
Network Interface Naming
Linux 커널은 네트워크 인터페이스에 동적으로 이름을 부여합니다. 전통적인 eth0 방식과 systemd의 predictable naming 방식(enp3s0)이 있습니다.
Network Performance
네트워크 성능은 Throughput(처리량), Latency(지연시간), Packet Loss(손실률), Jitter(지연 변동) 등으로 측정됩니다.
Network Testing
IPerf3, Speedtest, ping, traceroute 등을 통해 네트워크 성능을 측정하고 문제를 진단합니다.
Network Protocols
TCP, UDP, HTTP, HTTPS, DNS, DHCP, SSH, FTP 등 주요 네트워크 프로토콜과 포트 정보를 제공합니다.
Network Traffic Analysis
tcpdump, conntrack, netstat 등을 통해 실시간 네트워크 트래픽을 모니터링하고 분석합니다.
Network Tips and Tricks
네트워킹 관련 실용적인 팁과 설정 방법을 제공합니다.
Configuration
# 네트워크 인터페이스 확인
ip addr show
ip link show
# 라우팅 테이블 확인
ip route show
# 네트워크 성능 테스트 (IPerf3)
iperf3 -c <server_ip> -t 30
# 트래픽 모니터링
tcpdump -i eth0 -n
conntrack -L
Examples
Example 1: 네트워크 인터페이스 설정
# /etc/netplan/01-netcfg.yaml
network:
version: 2
ethernets:
eth0:
dhcp4: true
dhcp6: true
Example 2: IPerf3 성능 테스트
# 서버 모드
iperf3 -s
# 클라이언트 모드
iperf3 -c <server_ip> -t 60 -P 4
Best Practices
- 인터페이스 명명 규칙 통일 (predictable naming 권장)
- 정기적인 네트워크 성능 벤치마킹
- 방화벽 규칙 최소화 원칙 적용
- 트래픽 모니터링 시스템 구축
- DNS 캐싱 활성화
Limitations
- 물리적 네트워크 장비 성능에 제한됨
- 대역폭 요금제 제한 존재
- 네트워크 지연은 하드웨어 한계 존재
References
Related Pages
- Network Class
- Network interface name
- Network performance terminology
- Network performance test
- Network protocols
- Network tips and tricks
- Network traffic
- Linux iptables
- DHCP
- DNS
Knowledge Graph
Related
→ Network performance test → RDMA → NIC Bonding → IPMI → SDN → NFS
TCP/IP Tuning
Linux 네트워크 성능 튜닝은 HPC 워크로드에 중요.
# /etc/sysctl.conf에 추가
net.core.somaxconn = 65535
net.core.netdev_max_backlog = 5000
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.core.rmem_default = 16777216
net.core.wmem_default = 16777216
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.tcp_tw_reuse = 1
net.ipv4.ip_local_port_range = 1024 65535
# 적용
sudo sysctl -p
ethtool
ethtool은 네트워크 인터페이스 설정 도구.
# 인터페이스 설정 확인
ethtool eth0
# 오프로딩 설정
ethtool -k eth0
# TSO/GSO 활성화
ethtool -K eth0 tso on gso on
# 링크 속도 변경
ethtool -s eth0 speed 10000 duplex full autoneg on
# 인터페이스 이름 변경
ethtool -N eth0 flow-type tcp src-port 80 action 1
iproute2
iproute2는 네트워크 설정 도구 모음 (ifconfig/route 대체).
# IP 주소 확인
ip addr show
# 라우팅 테이블
ip route show
# neigh 테이블
ip neigh show
# VLAN 설정
ip link add link eth0 name eth0.100 type vlan id 100
ip link set eth0.100 up
# 네트워크 네임스페이스
ip netns add ns1
ip link set eth0 netns ns1