router
Q&A 정리: router
라우터란 무엇인가?
서로 다른 네트워크 사이에서 데이터 패킷의 이동 경로를 결정하고 전달하는 장치다. 우체국처럼 패킷의 목적지 주소를 읽고, 다음에 어느 네트워크로 보내야 하는지 판단하여 최종 목적지까지 릴레이 방식으로 전달한다.
A router is a computer and networking device that forwards data packets between computer networks, including internetworks such as the global Internet.
Routers perform the traffic directing functions on the Internet. A router is connected to two or more data lines from different IP networks. When a data packet comes in on a line, the router reads the network address information in the packet header to determine the ultimate destination. Then, using information in its routing table or routing policy, it directs the packet to the next network on its journey. A data packet is forwarded from one router to another through an internetwork until it reaches its destination node.
라우팅 테이블은 어떻게 만들어지는가?
라우팅 테이블은 "이 목적지로 가려면 어느 경로를 써라"라는 안내표다. 관리자가 직접 설정하는 고정 경로(static route)와, 라우팅 프로토콜을 통해 주변 라우터와 정보를 교환하며 자동으로 배우는 동적 경로(dynamic route) 두 가지 방식으로 만들어진다.
A router maintains a routing table that lists which route should be used to forward a data packet, and through which physical interface connection. It does this using internal pre-configured directives, called static routes, or by learning routes dynamically using a routing protocol. Static and dynamic routes are stored in the routing table.
라우터가 Layer 3 장치인 이유는?
네트워크 모델에서 Layer 3은 IP 주소를 기반으로 경로를 결정하는 계층이다. 라우터는 패킷의 목적지 IP 주소를 보고 전달 경로를 판단하므로 Layer 3 장치로 분류된다.
A router is considered a layer-3 device because its primary forwarding decision is based on the information in the layer-3 IP packet, specifically the destination IP address.
라우터는 패킷을 받으면 어떻게 전달하는가?
라우터는 패킷의 목적지 IP 주소를 라우팅 테이블과 대조하여 가장 적합한 경로를 찾고, 해당 경로의 출구 인터페이스에 맞는 형태로 패킷을 포장(캡슐화)하여 다음 구간으로 내보낸다.
When a router receives a packet, it searches its routing table to find the best match between the destination IP address of the packet and one of the addresses in the routing table. Once a match is found, the packet is encapsulated in the layer-2 data link frame for the outgoing interface indicated in the table entry.
라우터는 전달한 패킷의 정보를 기억하는가?
기억하지 않는다. 라우터는 패킷의 내용물을 열어보지도 않고, 목적지 주소만 확인한 뒤 전달하면 해당 패킷에 대한 정보를 버린다. 택배 기사가 상자 안의 내용물은 모른 채 주소만 보고 배달하는 것과 같다.
A router typically does not look into the packet payload, but only at the layer-3 addresses to make a forwarding decision, plus optionally other information in the header for hints on, for example, quality of service (QoS). For pure IP forwarding, a router is designed to minimize the state information associated with individual packets. Once a packet is forwarded, the router does not retain any historical information about the packet.
라우팅과 포워딩의 차이는?
라우팅은 "어떤 길로 갈지 경로를 정하는 것"이고, 포워딩은 "정해진 경로를 따라 실제로 패킷을 다음 구간으로 넘기는 것"이다. 내비게이션이 경로를 계산하는 게 라우팅이라면, 그 경로대로 실제 운전하는 게 포워딩이다.
Routing is the process of selecting a path for traffic in a network. Forwarding is the relaying of packets from one network segment to another by nodes in a computer network.
라우터는 '다른 네트워크'의 경계를 어떻게 정의하는가?
IP 주소는 "네트워크 부분"과 "호스트 부분"으로 나뉘며, 서브넷 마스크(또는 CIDR 표기)가 그 경계를 정한다. 같은 네트워크 부분을 공유하면 같은 네트워크, 다르면 다른 네트워크로 판단한다.
An IP address is recognized as consisting of two parts: the network prefix in the high-order bits and the remaining bits called the rest field, host identifier, or interface identifier (IPv6), used for host numbering within a network. The subnet mask or CIDR notation determines how the IP address is divided into network and host parts.