[IP Adventure] A Packet's Adventures on Routers - 05

EchoW
EchoW  Senior  (1)
6 years 6 hours ago  View: 4646  Reply: 5
1F

Journey of Protocol Packets

Most of the packets received by routers are service packets. These packets are processed by service boards and SFUs. Routers also receive a small number of special packets, such as routing protocol packets, user login and logout packets, and exception or error packets. These special packets are sent by service boards to the CPU of the master control board for processing. This chapter describes how protocol packets are forwarded.

Journey of Incoming Protocol Packets

Processing of the protocol packets that need to be sent to the CPU is similar to that of service packets. The following figure shows how protocol packets are processed.

The five differences are as follows:

  • Difference 1: The system does not search the forwarding table if packets are identified as protocol packets.
  • Difference 2: The packets with next-hop IP address 127.0.0.1 are sent to the CPU.
  • Difference 3: The committed access rate (CAR) of protocol packets is not limited.
  • Difference 4: Traffic classification is not performed on protocol packets.
  • Difference 5: Control plane (CP)-CAR is performed on protocol packets before they are sent to the CPU for processing.

Difference 1: The system does not search the forwarding table if packets are identified as protocol packets

The PFE (NP or ASIC chip) parses packets. If from the protocol field in the Layer 2 frame header, the PFE identifies a packet as a protocol packet that needs to be sent to the CPU for processing, such as an ARP, RARP, IS-IS, LLDP, LACP, or PPP control packet. If the destination IP address of the protocol packet is a reserved multicast IP address (ranging from 224.0.0.1 to 224.0.0.255), the uplink LPU does not search the forwarding table for packet forwarding.

As mentioned in the preceding chapter, the uplink LPU searches the forwarding table for the destination LPU and outbound interface information. The SFU switches the packets to a downlink LPU based on the destination LPU. Finally, the downlink LPU forwards the packets based on the outbound interface information. If an uplink LPU identifies a packet as a protocol packet that needs to be sent to the CPU for processing, the board does not search the forwarding table. Instead, it fills the destination LPU field with its slot and fills the outbound interface field with the CPU.

Difference 2: The packets with next-hop IP address 127.0.0.1 are sent to the CPU

Routes of the following types carry a fixed next-hop IP address (127.0.0.1), and the packets with such a next-hop address need to be sent to the CPU for processing.

·         Interface host routes and direct subnet routes with a broadcast address

If directly connected interfaces are configured with IP addresses and the link layer protocol and IP layer protocol are Up, three routes are generated. For example,

Routing Table:

Destination/Mask    Proto   Pre  Cost   Flags NextHop       Interface

       10.2.5.0/24  Direct  0    0        D   10.2.5.5      GigabitEthernet1/0/0
       10.2.5.5/32  Direct  0    0        D   127.0.0.1     GigabitEthernet1/0/0
     10.2.5.255/32  Direct  0    0        D   127.0.0.1     GigabitEthernet1/0/0

Forwarding Table:

Destination/Mask  Nexthop      Flag  TimeStamp   Interface            TunnelID

10.2.5.0/24       10.2.5.5     U     t[5847]     GigabitEthernet1/0/0     0x0
10.2.5.5/32       127.0.0.1    HU    t[5847]     InLoop0                  0x0
10.2.5.255/32     127.0.0.1    HU    t[5847]     InLoop0                  0x0

The first route is a network segment route, indicating that the GE1/0/0 of the router is directly connected to the network segment 10.2.5.0 and that the outbound interface to the network segment is GE1/0/0.

The second route is a host route, and the destination IP address 10.2.5.5 is the IP address of GE1/0/0. When a router receives a packet destined for the IP address of a local interface, it sends the packet to the application protocol stack. On Huawei routers, the outbound interface of host routes displayed in the forwarding table is InLoopBack0, indicating that the corresponding packets need to be sent to the CPU for processing.

The third route carries a broadcast address of 10.2.5.255/32 (one subnet of 10.2.5.0/24). According to IP standards, all Layer 3 interfaces on network segment 10.2.5.0/24 need to accept the packets with this address. The outbound interface of such routes is also InLoopBack0. Upon receipt of such packets, routers send them to the CPU for processing.

In addition, loopback and virtual template (VT) interfaces are logical, and IP addresses with a 32-bit mask are usually configured for such interfaces. Each interface of this type has a host route, for example,

Routing Table:

Destination/Mask    Proto   Pre  Cost   Flags NextHop         Interface

       10.0.0.5/32  Direct  0    0        D   127.0.0.1       LoopBack1
       10.2.3.9/32  Direct  0    0        D   127.0.0.1       Virtual-Template5

Forwarding Table:

Destination/Mask   Nexthop       Flag  TimeStamp     Interface     TunnelID

10.0.0.5/32        127.0.0.1     HU    t[142]        InLoop0        0x0
10.2.3.9/32        127.0.0.1     HU    t[28733]      InLoop0        0x0

The next-hop IP address of such host routes is 127.0.0.1, and the outbound interface in the forwarding table is InLoopBack0, indicating that the corresponding packets need to be sent to the CPU for processing.

·         Routes with a network-wide broadcast address

IP address 255.255.255.255/32 is a network-wide broadcast address and is used to configure host startup information. During startup, a host may not know its network mask or even its IP address. In this case, the host sends a DHCP Request message with IP address 255.255.255.255/32 to obtain an IP address from the DHCP or BOOTP server. Such messages exist only on the local network. Upon receipt of such messages, routers send them to the CPU for processing instead of forwarding them.

Routing Table:

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

Forwarding Table:

Destination/Mask   Nexthop       Flag  TimeStamp     Interface        TunnelID       
255.255.255.255/32 127.0.0.1       HU    t[128]        InLoop0        0x0

·         UNR Routes

When a user dials up to a broadband remote access server (BRAS) or broadband network gateway (BNG) using PPPoE, the BRAS or BNG requests an IP address from the RADIUS server and allocates the address to the user. If the IP address allocated to the user is 10.111.111.1/32, the BRAS or BNG generates the route 10.111.111.1/32. After receiving a network-to-user packet, the BRAS or BNG sends it to the CPU for processing so that accounting can be implemented. The next-hop IP address of this route is also 127.0.0.1.

Destination/Mask    Proto   Pre  Cost   Flags NextHop         Interface

   10.111.111.1/32  Unr     61   0        D   127.0.0.1       InLoopBack0 

This route is not learned through any routing protocol, nor is it a direct or static route. It is a UNR.

The BRAS or BNG needs to advertise this route so that the user can receive packets from the network. However, if the BRAS or BNG has a large number of access users, it needs to advertise the same number of UNRs. To prevent this problem, the BRAS or BNG generates a UNR based on the address pool, with 127.0.0.1 as the next-hop IP address, and Null0 as the outbound interface.

Destination/Mask    Proto   Pre  Cost   Flags NextHop         Interface

 10.111.111.0/24    Unr     61   0         D  127.0.0.1       NULL0

Difference 3: The committed access rate (CAR) of protocol packets is not limited

The CAR of protocol packets that are sent to the CPU is not limited, preventing packet loss in the case of traffic bursts.

Difference 4: Traffic classification is not performed on protocol packets

Protocol packets are sent to the CPU on the downlink LPU. Therefore, traffic policy-related functions, such as traffic classification and marking, are meaningless for the packets.

Difference 5: Control plane (CP)-CAR is performed on protocol packets before they are sent to the CPU for processing

If a large number of packets are sent to the CPU for processing, the CPU will be overloaded. To prevent this problem, CP-CAR is performed on the packets before they are sent to the CPU. The mechanism of CP-CAR is similar to that of flow-based CAR. For details, see Chapter 4. Packets are separated in different channels based on the protocol type, VLAN, or user. Each channel uses a token bucket to limit the packet rate. If the bandwidth of the packets that are sent to the CPU exceeds a specified rate, the packets will be randomly discarded.

Journey of Outgoing Protocol Packets

The protocol packets sent by the CPU are directly delivered to the PFE, without being processed by the PIC. Because most of the protocol packets sent by the CPU carry destination LPU and outbound interface information, the forwarding plane does not need to search the forwarding table. The packets directly enter a queue. As for a small number of special packets, such as ping packets with a specified source interface (triggered by the ping destination-ip -si interface-name command), the forwarding plane needs to search the forwarding table because the IP address of the source interface is unknown. Then, the special packets are sent to the TM, without going through CAR limitation.

The subsequent processing of protocol packets is similar to that of service packets except that CAR limitation and traffic classification are not performed on the protocol packets on the downlink LPU.

Fast Reply Packets Are Not Sent to the CPU

Ping (ICMP request) packets are usually used to check the connectivity of the link to a gateway or network-side IP address. Before ICMP request packets are sent to the CPU for parsing, CP-CAR is implemented.

Upon receipt of the packets, the CPU constructs ICMP reply packets and sends them to the source end. If a large number of ICMP request packets are sent to the CPU, the CPU will be overloaded, increasing the ping delay. To solve this problem, Huawei high-end routers support the ICMP fast reply function. With this function, the received ICMP request packets are not sent to the CPU for processing. Instead, the PFE of the LPU responds to the source end with ICMP reply packets, greatly shortening the ping delay.

The forwarding process using ICMP fast reply is as follows:

As shown in the preceding figure, ping packets are not sent to the CPU on the downlink LPU. Instead, the PFE swaps the source and destination IP addresses of the packets and loops the packets back to the uplink LPU.

However, if the size of fast reply packets is greater than the MTU, the packets are fragmented, and the fragmented packets are regarded as common ping packets for further CPU processing.

By default, ICMP fast reply is enabled in most versions. If ping packets are simulated as service packets during troubleshooting, ICMP fast reply needs to be disabled. To disable it, run the undo icmp-reply fast command in the slot view or system view.

Similar to ICMP fast reply, there is ARP fast reply messages and Web fast reply messages. They are not sent to CPU, and they are generated by line boards.

 

Related subjects:

[IP Adventure] A Packet's Adventures on Routers - 04

[IP Adventure] A Packet's Adventures on Routers - 03

[IP Adventure] A Packet's Adventures on Routers - 02

[IP Adventure] A Packet's Adventures on Routers - 01

[IP Adventure] A Packet's Adventures on Routers - Introduction

本帖最后由 EchoW 于 2016-04-21 14:51 编辑
Comment
nklsureshkumar nklsureshkumar  5 years 5 months ago

Protocol Packets DOC is useful for me. 

faz
faz  Platinum 
5 years 11 months ago
2F
Good tutorial
Saravanan.S
Saravanan.S  Gold 
5 years 5 months ago
3F
Good document related with Protocol Packets
Saravanan.S
Saravanan.S  Gold 
5 years 5 months ago
4F
Excellent information about journey of protocol packets
nklsureshkumar
nklsureshkumar  Platinum 
5 years 5 months ago
5F
Good quality data doc