Skip to content

Split View: [컴퓨터 네트워크] 02. 네트워크 코어: 패킷 교환 vs 회선 교환

|

[컴퓨터 네트워크] 02. 네트워크 코어: 패킷 교환 vs 회선 교환

본 포스팅은 James Kurose, Keith Ross의 Computer Networking: A Top-Down Approach (6th Edition) 교재를 기반으로 정리한 내용입니다.


1. 네트워크 코어

네트워크 코어는 종단 시스템을 서로 연결하는 패킷 스위치링크의 그물망(mesh)이다. 데이터를 전달하는 방식에는 크게 두 가지가 있다:

  • 패킷 교환 (Packet Switching)
  • 회선 교환 (Circuit Switching)

2. 패킷 교환 (Packet Switching)

2.1 기본 개념

애플리케이션 계층의 메시지를 작은 데이터 덩어리인 패킷(packet) 으로 분할하여 전송한다. 각 패킷은 통신 링크와 패킷 스위치(라우터, 링크 계층 스위치)를 거쳐 목적지에 도달한다.

2.2 저장 후 전달 (Store-and-Forward Transmission)

대부분의 패킷 스위치는 저장 후 전달 방식을 사용한다.

스위치가 출력 링크로 패킷의 첫 번째 비트를 전송하기 전에, 패킷 전체를 수신해야 한다.

출발지(Source)         라우터           목적지(Destination)
   |                   |                   |
   |==== 패킷 1 =====>|                   |
   |                   |==== 패킷 1 =====>|
   |==== 패킷 2 =====>|                   |
   |                   |==== 패킷 2 =====>|

전송 지연 계산

패킷 크기가 L 비트이고, 전송률이 R bps일 때:

  • 하나의 링크를 통과하는 데 걸리는 시간: L/R
  • N개 링크를 통과하는 총 전송 지연: N * L/R 초 (저장 후 전달 때문)

예시: 패킷 크기 L = 10,000 bits, 전송률 R = 2 Mbps, 링크 2개

총 지연 = 2 * (10,000 / 2,000,000) = 0.01초 = 10ms

2.3 큐잉 지연과 패킷 손실

각 패킷 스위치는 여러 개의 링크에 연결되어 있으며, 각 링크에 대해 출력 버퍼(output buffer) 또는 출력 큐(output queue) 를 유지한다.

          ┌──────────────────────────┐
입력 ────>│   출력 큐 (버퍼)          │────> 출력 링크
링크      │  [pkt3][pkt2][pkt1] ──>  │     (R bps)
          └──────────────────────────┘
              ↑ 큐잉 지연 발생!

큐잉 지연 (Queuing Delay)

패킷이 출력 링크로 전송되기를 기다리는 시간이다. 네트워크 혼잡도에 따라 달라진다.

패킷 손실 (Packet Loss)

버퍼 공간이 유한하므로, 도착한 패킷이 가득 찬 큐를 만나면 패킷 드롭(drop) 이 발생한다. 이것이 바로 패킷 손실이다.

시나리오: 버퍼 크기 = 3 패킷

시점 1: [pkt1][pkt2][pkt3] → 버퍼 가득 참
시점 2: pkt4 도착 → 버퍼 초과 → pkt4 드롭!

2.4 포워딩 테이블과 라우팅

패킷이 목적지에 도달하려면 라우터가 적절한 출력 링크를 선택해야 한다.

  1. 각 종단 시스템은 IP 주소를 가진다
  2. 송신자는 패킷 헤더에 목적지 IP 주소를 포함시킨다
  3. 라우터는 포워딩 테이블(forwarding table) 을 참조하여 출력 링크를 결정한다
  4. 포워딩 테이블은 라우팅 프로토콜에 의해 자동으로 설정된다
패킷 헤더: 목적지 IP = 121.7.106.83

라우터 포워딩 테이블:
┌─────────────────┬────────────┐
│ 주소 범위        │ 출력 링크   │
├─────────────────┼────────────┤
│ 121.7.0.0/16    │ 링크 2     │
│ 200.23.0.0/16   │ 링크 3     │
│ 기타            │ 링크 0      │
└─────────────────┴────────────┘
→ 링크 2로 포워딩

3. 회선 교환 (Circuit Switching)

3.1 기본 개념

통신을 시작하기 전에 송신자와 수신자 사이에 전용 회선(dedicated circuit) 을 설정한다.

전통적인 전화 네트워크가 대표적인 회선 교환 네트워크다.

회선 교환 과정:
1. 연결 설정 (회선 예약)
2. 데이터 전송 (전용 자원 사용)
3. 연결 해제 (회선 반납)

핵심 특징

  • 연결 기간 동안 일정한 전송률을 보장한다
  • 자원이 예약되므로 큐잉 지연이 없다
  • 자원이 사용되지 않더라도 다른 연결이 사용할 수 없다 (자원 낭비 가능)

3.2 FDM (Frequency Division Multiplexing)

주파수 대역을 여러 개의 주파수 밴드로 나누어 각 연결에 할당한다.

주파수
  ^
  │  ┌────────┐
  │  │ 사용자4 │  밴드 4
  │  ├────────┤
  │  │ 사용자3 │  밴드 3
  │  ├────────┤
  │  │ 사용자2 │  밴드 2
  │  ├────────┤
  │  │ 사용자1 │  밴드 1
  │  └────────┘
  └──────────────────> 시간
  • 각 연결은 자신에게 할당된 주파수 밴드만 사용
  • FM 라디오 방송국이 FDM의 좋은 예시
  • 일반적으로 밴드 폭: 4 kHz (전화 네트워크)

3.3 TDM (Time Division Multiplexing)

시간을 일정한 길이의 프레임으로 나누고, 각 프레임을 고정된 수의 타임 슬롯으로 나누어 각 연결에 할당한다.

      프레임 1          프레임 2          프레임 3
  ┌──┬──┬──┬──┐   ┌──┬──┬──┬──┐   ┌──┬──┬──┬──┐
  │S1│S2│S3│S4│   │S1│S2│S3│S4│   │S1│S2│S3│S4│
  └──┴──┴──┴──┘   └──┴──┴──┴──┘   └──┴──┴──┴──┘
  ──────────────────────────────────────────> 시간

  S1: 사용자1의 슬롯, S2: 사용자2의 슬롯, ...
  • 각 연결은 각 프레임에서 자신의 타임 슬롯 동안만 데이터 전송
  • 전송률: 링크 전송률이 R이고 슬롯 수가 N이면, 각 연결의 전송률은 R/N

4. 패킷 교환 vs 회선 교환 비교

4.1 정량적 비교 예시

링크 용량: 1 Mbps

방식동시 사용자 수
회선 교환 (각 100 kbps)10명
패킷 교환 (평균 10% 활성)35명 이상 가능

왜 패킷 교환이 더 많은 사용자를 수용할 수 있는가

사용자가 100 kbps로 데이터를 생성하되, 전체 시간의 10%만 활성 상태라고 가정하자.

  • 회선 교환: 활성 여부에 관계없이 각 사용자에게 100 kbps 예약 → 최대 10명
  • 패킷 교환: 35명의 사용자 중 동시에 11명 이상이 활성일 확률은 0.0004 미만
패킷 교환의 통계적 다중화 (Statistical Multiplexing):

  35명 사용자, 각 10% 활성 확률
  동시 활성 사용자 수의 기대값 = 35 * 0.1 = 3.5명
  → 1 Mbps 링크로 충분히 감당 가능

4.2 장단점 비교

기준패킷 교환회선 교환
자원 효율성높음 (통계적 다중화)낮음 (자원 예약)
구현 복잡도낮음높음 (연결 설정 필요)
지연 보장보장 불가일정 지연 보장
혼잡 시패킷 손실, 지연 증가연결 거부
버스트 트래픽잘 처리비효율적

4.3 결론

오늘날의 인터넷은 패킷 교환 방식을 사용한다.

  • 버스트(bursty) 트래픽에 더 효율적
  • 더 간단하고 비용 효과적
  • 다만, 실시간 서비스(음성, 영상)를 위한 QoS 보장은 아직 해결 과제

5. 네트워크의 네트워크 (A Network of Networks)

5.1 ISP 계층 구조의 발전

종단 시스템은 접속 ISP를 통해 인터넷에 연결된다. 그렇다면 접속 ISP들은 어떻게 서로 연결될까?

구조 1: 모든 접속 ISP를 하나의 글로벌 ISP에 연결

접속 ISP ─┐
접속 ISP ─┼── 글로벌 ISP
접속 ISP ─┘

비현실적: 하나의 ISP가 전 세계를 커버해야 함

구조 2: 여러 글로벌 ISP가 경쟁

접속 ISP ── 글로벌 ISP A ── IXP ── 글로벌 ISP B ── 접속 ISP
  • IXP (Internet Exchange Point): ISP들이 서로 트래픽을 교환하는 지점

구조 3: 다계층 구조

접속 ISP ── 지역 ISP ── Tier-1 ISP ── 지역 ISP ── 접속 ISP

5.2 현대 인터넷의 구조

                    ┌─────────────────────┐
                    │     Tier-1 ISP      │
                    │  (AT&T, NTT, etc.)  │
                    └──────┬──────┬───────┘
                           │ IXP  │
              ┌────────────┤      ├────────────┐
              │            │      │            │
         ┌────┴────┐  ┌───┴───┐  ┌────┴────┐
         │지역 ISP │  │지역 ISP│  │지역 ISP │
         └────┬────┘  └───┬───┘  └────┬────┘
              │            │            │
         ┌────┴────┐  ┌───┴───┐  ┌────┴────┐
         │접속 ISP │  │접속 ISP│  │접속 ISP │
         └─────────┘  └───────┘  └─────────┘

주요 구성 요소

  • Tier-1 ISP: 전 세계를 커버하는 최상위 ISP (약 12개 정도)
  • IXP: ISP 간 직접 트래픽 교환 지점 (전 세계 600개 이상)
  • 피어링(Peering): 같은 계층의 ISP 간 무정산 트래픽 교환
  • 콘텐츠 제공자 네트워크(Content Provider Network): Google, Microsoft 등이 자체 네트워크 구축
Google의 네트워크 전략:
  ┌────────────────────────────────┐
  │  Google 데이터 센터 (전 세계)    │
  │  자체 사설 네트워크로 연결        │
  │  Tier-1, IXP에 직접 연결        │
  │  → 중간 ISP 비용 절감            │
  │  → 서비스 품질 직접 제어          │
  └────────────────────────────────┘

6. 정리

네트워크 코어 핵심 비교:

패킷 교환                    회선 교환
────────                    ────────
저장 후 전달                 전용 회선 설정
큐잉 지연 발생               큐잉 지연 없음
통계적 다중화                FDM / TDM
패킷 손실 가능               자원 낭비 가능
오늘날의 인터넷              전통 전화 네트워크

7. 확인 문제

Q1. 저장 후 전달(Store-and-Forward)이란?

패킷 스위치가 출력 링크로 첫 번째 비트를 전송하기 전에, 패킷의 모든 비트를 수신 완료해야 하는 전송 방식이다. 이로 인해 각 링크를 통과할 때마다 L/R초의 전송 지연이 추가된다.

Q2. 패킷 손실은 왜 발생하는가?

패킷 스위치의 출력 버퍼(큐) 공간이 유한하기 때문이다. 도착률이 출력 링크의 전송률을 초과하면 패킷이 큐에 쌓이고, 큐가 가득 차면 새로 도착하는 패킷이 드롭(drop) 된다.

Q3. 패킷 교환이 회선 교환보다 효율적인 이유는?

통계적 다중화(statistical multiplexing) 덕분이다. 모든 사용자가 동시에 데이터를 전송하지 않으므로, 패킷 교환은 자원을 미리 예약하지 않고 필요할 때만 링크를 사용한다. 이를 통해 같은 자원으로 더 많은 사용자를 수용할 수 있다.

[Computer Networking] 02. Network Core: Packet Switching vs Circuit Switching

This post is based on the textbook Computer Networking: A Top-Down Approach (6th Edition) by James Kurose and Keith Ross.


1. The Network Core

The network core is a mesh of packet switches and links that interconnect end systems. There are two fundamental approaches to data transfer:

  • Packet Switching
  • Circuit Switching

2. Packet Switching

2.1 Basic Concept

Application-layer messages are divided into smaller chunks of data called packets for transmission. Each packet travels through communication links and packet switches (routers, link-layer switches) to reach its destination.

2.2 Store-and-Forward Transmission

Most packet switches use store-and-forward transmission.

The switch must receive the entire packet before it can begin transmitting the first bit of the packet on the outbound link.

Source                Router              Destination
   |                   |                   |
   |==== Packet 1 ====>|                   |
   |                   |==== Packet 1 ====>|
   |==== Packet 2 ====>|                   |
   |                   |==== Packet 2 ====>|

Transmission Delay Calculation

When the packet size is L bits and the transmission rate is R bps:

  • Time to traverse one link: L/R seconds
  • Total transmission delay across N links: N * L/R seconds (due to store-and-forward)

Example: Packet size L = 10,000 bits, transmission rate R = 2 Mbps, 2 links

Total delay = 2 * (10,000 / 2,000,000) = 0.01 seconds = 10ms

2.3 Queuing Delay and Packet Loss

Each packet switch has multiple links connected to it, and maintains an output buffer (or output queue) for each link.

          +----------------------------+
Input --->|   Output Queue (Buffer)     |----> Output Link
Link      |  [pkt3][pkt2][pkt1] --->   |     (R bps)
          +----------------------------+
              ^ Queuing delay occurs!

Queuing Delay

The time a packet waits in the queue before being transmitted on the output link. It varies depending on network congestion.

Packet Loss

Since buffer space is finite, a packet arriving at a full queue will be dropped. This is packet loss.

Scenario: Buffer size = 3 packets

Time 1: [pkt1][pkt2][pkt3] -> Buffer full
Time 2: pkt4 arrives -> Buffer overflow -> pkt4 dropped!

2.4 Forwarding Tables and Routing

For a packet to reach its destination, routers must select the appropriate output link.

  1. Each end system has an IP address
  2. The sender includes the destination IP address in the packet header
  3. The router consults its forwarding table to determine the output link
  4. Forwarding tables are automatically configured by routing protocols
Packet header: Destination IP = 121.7.106.83

Router forwarding table:
+------------------+-------------+
| Address Range    | Output Link |
+------------------+-------------+
| 121.7.0.0/16     | Link 2      |
| 200.23.0.0/16    | Link 3      |
| Default          | Link 0      |
+------------------+-------------+
-> Forward to Link 2

3. Circuit Switching

3.1 Basic Concept

Before communication begins, a dedicated circuit is established between the sender and receiver.

The traditional telephone network is a classic example of a circuit-switched network.

Circuit switching process:
1. Connection setup (circuit reservation)
2. Data transfer (using dedicated resources)
3. Connection teardown (circuit release)

Key Characteristics

  • Guarantees a constant transmission rate for the duration of the connection
  • Resources are reserved, so there is no queuing delay
  • Resources cannot be used by other connections even when idle (possible resource waste)

3.2 FDM (Frequency Division Multiplexing)

The frequency band is divided into multiple frequency bands, each assigned to a connection.

Frequency
  ^
  |  +--------+
  |  | User 4 |  Band 4
  |  +--------+
  |  | User 3 |  Band 3
  |  +--------+
  |  | User 2 |  Band 2
  |  +--------+
  |  | User 1 |  Band 1
  |  +--------+
  +--------------------> Time
  • Each connection uses only its assigned frequency band
  • FM radio stations are a good example of FDM
  • Typical bandwidth: 4 kHz (telephone networks)

3.3 TDM (Time Division Multiplexing)

Time is divided into frames of fixed length, and each frame is divided into a fixed number of time slots, each assigned to a connection.

      Frame 1          Frame 2          Frame 3
  +--+--+--+--+   +--+--+--+--+   +--+--+--+--+
  |S1|S2|S3|S4|   |S1|S2|S3|S4|   |S1|S2|S3|S4|
  +--+--+--+--+   +--+--+--+--+   +--+--+--+--+
  ---------------------------------------------> Time

  S1: User 1's slot, S2: User 2's slot, ...
  • Each connection transmits data only during its time slot in each frame
  • Transmission rate: If the link rate is R and the number of slots is N, each connection gets R/N

4. Packet Switching vs Circuit Switching Comparison

4.1 Quantitative Comparison Example

Link capacity: 1 Mbps

MethodSimultaneous Users
Circuit switching (100 kbps each)10
Packet switching (avg. 10% active)35 or more

Why Packet Switching Can Accommodate More Users

Assume each user generates data at 100 kbps but is active only 10% of the time.

  • Circuit switching: Reserves 100 kbps per user regardless of activity -> max 10 users
  • Packet switching: The probability that more than 10 of 35 users are simultaneously active is less than 0.0004
Statistical Multiplexing in Packet Switching:

  35 users, each active with 10% probability
  Expected number of simultaneously active users = 35 * 0.1 = 3.5
  -> 1 Mbps link can easily handle this

4.2 Advantages and Disadvantages

CriterionPacket SwitchingCircuit Switching
Resource efficiencyHigh (statistical multiplexing)Low (resource reservation)
ImplementationSimpleComplex (connection setup needed)
Delay guaranteeNo guaranteeConstant delay guaranteed
Under congestionPacket loss, increased delayConnection rejection
Bursty trafficHandles wellInefficient

4.3 Conclusion

Today's Internet uses packet switching.

  • More efficient for bursty traffic
  • Simpler and more cost-effective
  • However, QoS guarantees for real-time services (voice, video) remain a challenge

5. A Network of Networks

5.1 Evolution of the ISP Hierarchy

End systems connect to the Internet through access ISPs. But how do access ISPs connect to each other?

Structure 1: Connect All Access ISPs to a Single Global ISP

Access ISP --+
Access ISP --+-- Global ISP
Access ISP --+

Unrealistic: One ISP would need to cover the entire world

Structure 2: Multiple Global ISPs Competing

Access ISP -- Global ISP A -- IXP -- Global ISP B -- Access ISP
  • IXP (Internet Exchange Point): A point where ISPs exchange traffic with each other

Structure 3: Multi-Tier Hierarchy

Access ISP -- Regional ISP -- Tier-1 ISP -- Regional ISP -- Access ISP

5.2 Modern Internet Structure

                    +---------------------+
                    |     Tier-1 ISP      |
                    |  (AT&T, NTT, etc.)  |
                    +------+------+-------+
                           | IXP  |
              +------------+      +------------+
              |            |      |            |
         +----+----+  +---+---+  +----+----+
         |Regional |  |Regional|  |Regional |
         |  ISP    |  |  ISP   |  |  ISP    |
         +----+----+  +---+---+  +----+----+
              |            |            |
         +----+----+  +---+---+  +----+----+
         |Access   |  |Access  |  |Access   |
         |  ISP    |  |  ISP   |  |  ISP    |
         +---------+  +-------+  +---------+

Key Components

  • Tier-1 ISP: Top-level ISPs with worldwide coverage (approximately 12)
  • IXP: Direct traffic exchange points between ISPs (over 600 worldwide)
  • Peering: Settlement-free traffic exchange between ISPs at the same tier
  • Content Provider Network: Companies like Google and Microsoft build their own networks
Google's network strategy:
  +--------------------------------+
  |  Google data centers (global)  |
  |  Connected via private network |
  |  Direct connections to Tier-1  |
  |  and IXPs                      |
  |  -> Reduces intermediate ISP   |
  |     costs                      |
  |  -> Direct control over        |
  |     service quality            |
  +--------------------------------+

6. Summary

Network Core Key Comparison:

Packet Switching              Circuit Switching
----------------              -----------------
Store-and-forward             Dedicated circuit setup
Queuing delay occurs          No queuing delay
Statistical multiplexing      FDM / TDM
Packet loss possible          Resource waste possible
Today's Internet              Traditional telephone network

7. Review Questions

Q1. What is Store-and-Forward?

A transmission method where the packet switch must receive all bits of a packet before transmitting the first bit on the outbound link. This adds a transmission delay of L/R seconds at each link traversal.

Q2. Why does packet loss occur?

Because the output buffer (queue) of a packet switch has finite space. When the arrival rate exceeds the transmission rate of the output link, packets queue up, and when the queue is full, newly arriving packets are dropped.

Q3. Why is packet switching more efficient than circuit switching?

Thanks to statistical multiplexing. Since not all users transmit data simultaneously, packet switching does not reserve resources in advance but uses links only when needed. This allows the same resources to accommodate more users.