Back in the early 2000s, when I worked for an L3 switch (Ethernet switch + IP router) developer, I had once implemented packet forwarding by using IBM NP4GS3C, a network processor.
Not just because of that, but I also believe this might be a good time for us, especially network novices, to look into the logic of packet delivery by L3 switch, through the following series of posts:
Part 1. Router Architecture (this post)
Part 2. Packet Forwarding by IP Router
Part 3. L2 (Ethernet) Switching by L3 Switch
Part 4. IP Forwarding by L3 Switch
Router Architecture
Seen in the left figure above is the illustration of a Cisco 7600 router. This router consists of the following three functional modules:
■ Supervisor Engine
- Works as the brain of the entire router system that controls/operates the system. This is where all protocols (OSPF, BGP, SNMP, Telnet, etc.) are installed and run. Administrators can access these modules to manage the entire router system through CLI.
- Usually, general CPUs (like Intel CPU) with excellent processing power are placed here. And, protocol-embedding OSs are installed.
- In Juniper routers, this module is called a "routing engine".
■ Line Card
- In charge of receiving packets, looking up tables (FIB/ARP), applying QoS (QoS marking, policing, queueing), and delivering packets to destined output ports (all of these at wire-speed). Comes in different models to support different port types (1GE, 10GE, SONET, etc.) and port numbers.
- For wire-speed processing of packets, technically capable vendors like Cisco and Juniper use their own ASIC/NP while others usually use commercial ASIC (e.g. Broadcom, Marvell, etc.).
- In Juniper routers, this module is called a "packet forwarding engine (PFE)".
■ Switch Fabric Module
- Works as a bridge through which packets are delivered between line cards. For example, when a packet received at line card #1 needs to go out through line card #2, the packet is delivered through this module.
- In Juniper routers, this module is called a "switch fabric".
Seen in the right figure is the architecture of a general router to be explained through this and the later posts.
■ Control Module (Control Plane)
- This module, also known as "control plane", corresponds to Cisco's supervisor engine/Juniper routing engine.
- Although a control module has many protocols and tables, we have simplified the architecture to show only the ones to be explained through the posts.
- All routers have a control module that runs an OSPF process, and they learn routing information from their OSPF neighbors (OSPF routers) by using the OSPF protocol. Among the information learned, only the routing entries that correspond to the shortest paths to each destination are installed in the Routing Information Base (RIB).
- It has an ARP table if the port type of the line card is Ethernet, which is very likely these days. This ARP table stores "MAC addresses corresponding to IP addresses" of nodes (servers and routers) directly connected to the router (just like ARP tables on a Windows PC, which can be retrieved using a Windows command "arp -a").
■ Line Card (Data Plane)
- Also known as "data plane".
- Has a packet processor (e.g. Broadcom, Marvell chip, etc.), the most essential component in processing packets.
- Has an ingress packet buffer where received packets are kept momentarily.
- Has an egress packet buffer where packets are kept before being delivered to the output port. When congested (e.g. if packets of more than 1 Gbps are converging towards GE port), packets with higher priorities are processed first, and others are buffered here according to the specified scheduling algorithm (e.g. SPQ, WFQ/DWRR).
- Has a forwarding information base (FIB) and ARP table that are referred when determining which port to send a received packet to.
■ Switch Module
- Functions as a bridge through which packets are delivered between line cards. This module will not be further discussed as this post does not concern switching fabric technique.
RIB/ARP Table on Control Module (Control Plane) and FIB/ARP Table on Line Card (Data Plane)
It is known that routing entries in the RIB on the control module and the FIBs on the line cards vary depending on each vendor's implementation. For example, in case of Cisco:
- In OSPF LSDB, all routing paths (to be exact, all LSA information received from OSPF neighbors) are saved.
- In the RIB, only the routing entries that correspond to the shortest paths to each destination are installed.
- Then, the same entries in the RIB are copied to the FIB on each line card.
- That means, {RIB on Control Module} = {FIB on Line Card #1} = {FIB on Line Card #2} = {FIB on Line Card #3} = ...
However, things are different in ARP tables.
In the ARP table on each line card, only the ARP entries (IP & MAC) that each line card has learned itself are saved. These learned entries are not shared with other line cards (e.g. the ARP entries learned by the line card #1 are useless to other line cards). But, in the ARP table on the control module, all ARP entry information on all line cards is kept. How ARP entries are learned will be explained in the next post.
So, in Cisco routers, "show ip route" or "show ip arp" command retrieves these RIB and ARP tables on the control module.
What's Ingress and Egress?
Ingress means "incoming", and egress means "outgoing".
For example, if a packet is received via ge1/4 port of the line card #1, and is output via ge2/3 port of the line card #2,
- the ge1/4 port where the packet was received is called an "ingress port"
- the line card #1 where the packet was received is called an "ingress line card"
- the ge2/3 port where the packet was sent is called an "egress port"
- the line card #2 where the packet was sent is called an "egress line card"
So, line cards and ports on a router can be called and worked as ingress or egress line cards/ports depending on to which direction the packet was going.
In the next post, we will see how IP packets are forwarded (delivered) in the general router architecture discussed so far.
Hi Barry Greene Can you tell me about PTP port in ASR9K processor...what is the difference between line card PTP port configuration and dedicated IEEE 1588 port in ASR9K