SEARCH

— 葡萄酒 | 威士忌 | 白兰地 | 啤酒 —

5 Minutes to Understand How a Router Works and Its Main Components

BLOG 290

55d13c3c5faeb0e057dbdccf3ec0e62b


01. What Is a Router?

In simple terms, a router is a device that enables network interconnection with routing and forwarding functions. Additionally, it can adapt subnet speeds, isolate subnets, and define access rules.
Definition: A router is a device that enables network interconnection and operates at the third layer of the OSI model—the network layer. It provides two key mechanisms: routing and forwarding.

  • Routing: Determines the path a data packet takes from the source to the destination (the optimal transmission path between hosts). This process is called routing.
  • Forwarding: Transfers data packets from the router’s input port to the appropriate output port (this happens internally within the router).

02. Typical Router Structure

(Note: The diagram mentioned in the original text is not included here.)

03. How a Router Works

  1. Routing (Software, Control Layer):
    • The routing protocol selects and generates routing entries, which are added to the routing table.
    • The routing table is mapped into the forwarding engine in memory and stored in the cache area of the ASIC chip.
  1. Packet Forwarding (Hardware, Data Layer):
    • After the data link layer removes the frame header and trailer, the packet is sent to the network layer.
    • The network layer uses the IP header’s key fields to search the forwarding table and determine the output interface.

af96f4471a7fc3aee8588a22f2810203

04. Hardware Routing Forwarding Table

The hardware routing forwarding table can be searched within a single clock cycle, regardless of its size.
  • CAM Table:
    • Performs binary matching (1 or 0). It either fully matches or does not match at all.
    • Used for MAC address lookups.
  • TCAM Forwarding Table:
    • Performs ternary matching (0, 1, or “don’t care”).
    • Sorted from precise to imprecise matches.
    • Used for routing table policies, routing matches, firewalls, and routing rule matching.

05. NP (Network Processor) Chip

The NP chip is programmable and can accelerate hardware processing for multiple services simultaneously. Before its introduction, routers were specialized devices. With the NP chip, all-service routers became possible.
Advantages of NP over ASIC:

  • Higher Performance: Integrates dozens of CPUs, hardware co-processors, and accelerators. Even with complex QoS functions like congestion management and queue scheduling, it can still achieve line-speed forwarding (“hard forwarding”).
  • Greater Flexibility: Programmable user interfaces allow for flexible expansion.
  • Strong Service Support: Quickly supports new value-added services (e.g., MPLS, QoS, multicast).
  • Convenient Management and Development: Significantly shortens the secondary development cycle.
  • IPv6 Compatibility: Reserved IPv6 interfaces allow for smooth software upgrades.
  • High Reliability: Chips undergo rigorous fatigue testing before production, making them suitable for telecom-grade equipment development.

06. Multi-Stage Switching Structure Routers

A multi-stage switching structure consists of multiple interconnected switching units. Each switching unit has a complete set of input and output interfaces, similar to a standard switch, providing input-output connections.

07. Cluster Routers

Cluster routers are composed of multiple router nodes, including several routing entities and switching entities.

  • The switching structure aggregates multiple switching structures, offering a distributed architecture that meets performance, scalability, and size requirements.
  • It includes multiple control nodes with routing computation capabilities, enabling distributed implementation of routing and control protocols.
  • The cluster router architecture is considered the next-generation high-performance router architecture that aligns with the needs of internet development.

 

The prev:

Related recommendations

Expand more!

Mo