WO2015101003A1 - Network device and packet forwarding method - Google Patents

Network device and packet forwarding method Download PDF

Info

Publication number
WO2015101003A1
WO2015101003A1 PCT/CN2014/081811 CN2014081811W WO2015101003A1 WO 2015101003 A1 WO2015101003 A1 WO 2015101003A1 CN 2014081811 W CN2014081811 W CN 2014081811W WO 2015101003 A1 WO2015101003 A1 WO 2015101003A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
mapper
physical interface
identifier
forwarding engine
Prior art date
Application number
PCT/CN2014/081811
Other languages
French (fr)
Chinese (zh)
Inventor
李教峰
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2015101003A1 publication Critical patent/WO2015101003A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/25Routing or path finding in a switch fabric
    • H04L49/253Routing or path finding in a switch fabric using establishment or release of connections between ports
    • H04L49/254Centralised controller, i.e. arbitration or scheduling

Definitions

  • the present invention relates to the field of network communications, and in particular, to a network device and a method for forwarding a message. Background technique
  • the most basic function of the router is to determine the physical interface and the next hop address of the packet based on the network layer address in the received packet and the routing table maintained by the router, and modify the link layer header of the packet to forward the packet. Message.
  • a router forwards a packet, it can perform network address translation, deep packet inspection, and quality of service (QoS).
  • QoS quality of service
  • Routers usually use a distributed forwarding architecture, including line cards (English: l ine card) and switching networks (English: switching fabric) chips.
  • the line card provides a physical interface, and also includes a forwarding engine; the forwarding engines are connected to each other through a switching network chip.
  • the data traffic forwarded between the two physical interfaces of the same line card can be forwarded by the forwarding engine of the line card, and does not need to be sent to the switching network chip.
  • the total bandwidth of the outgoing interface of the line card may be 64 kilobits per second (English: ki lobits per second, symbol: Kbps), 128Kbps or 256Kbps, or 100 megabits per second (English: megabits per second, symbol: Mbps) 200Mbps or 1 gigabit per second (English: gigabits per second, symbol: Gbps), etc., which makes it difficult to match the processing power of the line card's forwarding engine and the interface rate. It is possible that the forwarding engine has insufficient capacity to meet the corresponding interface rate. It is also possible that the forwarding engine has excess capacity and exceeds the interface rate, resulting in wasted forwarding engine capability.
  • the embodiments of the present invention provide a network device and a method for forwarding a message.
  • the peer map is provided with a correspondence between a forwarding engine and a physical interface by separating the forwarding engine from the line card, and the physical interface and the forwarding engine are provided. Decoupling, increasing the flexibility of physical interface and forwarding engine configuration, thereby improving network equipment Forwarding performance and reliability.
  • a network device including a plurality of forwarding engines, a mapper and a line card;
  • the line card includes a physical interface;
  • the mapper includes an uplink port and a downlink port; and the uplink port is the mapper connection a port of the forwarding engine;
  • a downlink port is a port to which the mapper connects the line card;
  • the line card is configured to send a packet received from the physical interface to the mapper, and is further configured to send the packet received from the mapper from the corresponding physical interface;
  • the mapper is configured to: send the packet from the physical interface to the corresponding forwarding engine according to the correspondence between the forwarding engine and the physical interface; and send the packet from the forwarding engine to the corresponding physical interface;
  • Forwarding engine used to forward packets.
  • the identity of the forwarding engine is an identity of an uplink port of the mapper.
  • the mapper is further configured to dynamically acquire a correspondence between the forwarding engine and a physical interface. .
  • the network device further includes a main control board, configured to acquire an identifier of the uplink port of the mapper and a downlink port Identifying a mapping relationship between the forwarding engine and the physical interface according to a predefined policy, and providing the mapping to the mapper.
  • the predefined policy includes: a service configuration, a bandwidth of a physical interface, a state of a forwarding engine, and a load of a forwarding engine.
  • a service configuration a bandwidth of a physical interface
  • a state of a forwarding engine a state of a forwarding engine
  • a load of a forwarding engine One or more strategies in the situation.
  • the line card comprises an interface processing chip
  • All physical interfaces of the line card are connected to a downlink port of the mapper through the interface processing chip;
  • Corresponding relationship between the forwarding engine and the physical interface is a correspondence between the identifier of the forwarding engine and the combination of the identifier of the downlink port and the identifier of the physical interface;
  • the interface processing chip is configured to process a message from a physical interface of the line card, and is further configured to process a message sent by the mapper to a physical interface of the line card;
  • the interface processing chip is configured to receive the first packet from the first physical interface of the line card, and set the identifier of the first physical interface to the first packet to obtain a second packet;
  • the mapper sends the second packet;
  • the interface processing chip is further configured to receive a third packet from the mapper, where the third packet includes an identifier of a second physical interface of the line card, and the third packet is included in the third packet. And removing the identifier of the second physical interface, to obtain a fourth packet, and sending the fourth packet to the second physical interface according to the identifier of the second physical interface.
  • the mapper is configured to receive the second packet from the downlink port, where The second packet is marked with the identifier of the downlink port, and is sent to the forwarding engine corresponding to the first physical port according to the correspondence between the forwarding engine and the physical interface.
  • the interface processing chip is further configured to: apply the identifier of the downlink port to the first packet;
  • the second packet further includes an identifier of the first downlink port;
  • the third packet further includes an identifier of the downlink port.
  • the interface processing chip is further configured to remove the identifier of the downlink port from the third packet, to obtain the fourth packet.
  • the interface processing chip is further configured to save an identifier of the downlink port
  • the main control board is further configured to provide an identifier of the downlink port to the interface processing chip.
  • all physical interfaces of the line card are respectively connected to the A downstream port of the mapper.
  • the correspondence between the forwarding engine and the physical interface is an identifier and an identifier of an uplink port of the mapper The correspondence between the identifiers of the uplink ports of the mapper.
  • the network device further includes a switching network chip;
  • the plurality of forwarding engines are connected to each other through the switching network chip;
  • the switching network chip is configured to exchange packets between the multiple forwarding engines.
  • a second aspect provides a method for forwarding a packet, where the network device includes a plurality of forwarding engines, a mapper, and a line card. The method for forwarding a packet includes:
  • the first physical interface of the line card receives the first packet
  • the line card is configured to mark the first packet with the first physical interface, and obtain a second packet, where the second packet includes an identifier of the first physical interface; And sending, by the mapper, the second packet to the first forwarding engine according to the correspondence between the forwarding engine and the physical interface;
  • the first downlink port is a port that the mapper connects to the line card;
  • the first forwarding engine sends the second packet to a second forwarding engine, or sends the second packet to the mapper.
  • the correspondence between the forwarding engine and the physical interface is a correspondence between an identifier of an uplink port of the mapper and an identifier of the physical interface
  • the mapper sends the second packet to the first forwarding engine according to the correspondence between the forwarding engine and the physical interface, including:
  • the mapper obtains an identifier of the first uplink port of the mapper according to the identifier of the first physical interface in the second packet, and the corresponding relationship between the forwarding engine and the physical interface;
  • the first uplink port is a port that the mapper connects to the first forwarding engine;
  • the mapper sends the second packet from the first uplink port to the first forwarding engine.
  • the method further Includes:
  • the second forwarding engine receives the second packet, and processes the second packet to obtain a third packet.
  • the third packet is sent to the mapper, where the third packet includes The identifier of the second physical interface, the mapper receives the third packet, and obtains the identifier of the second downlink port of the mapper according to the identifier of the second physical interface, the correspondence between the downlink port and the physical interface And sending the third packet from the second downlink port to a line card where the second physical interface is located;
  • the line card where the second physical interface is located, the identifier of the second physical interface is removed from the third packet, the fourth packet is obtained, and the fourth packet is sent to the second packet. Physical interface.
  • the method further include: The mapper receives the second packet from the first uplink port, where the second packet includes an identifier of the second physical interface;
  • the line card where the second physical interface is located, the identifier of the second physical interface is removed from the second packet, the third packet is obtained, and the third packet is sent from the second physical The interface is sent out.
  • the correspondence between the forwarding engine and the physical interface is an identifier of an uplink port of the mapper, and a combination of an identifier of a downlink port of the mapper and an identifier of the physical interface.
  • the mapper sends the second packet to the first forwarding engine according to the correspondence between the forwarding engine and the physical interface, including:
  • the mapper obtains the mapper according to the identifier of the first physical interface, the identifier of the first downlink port, and the correspondence between the forwarding engine and the physical interface in the second packet.
  • the identifier of the first uplink port; the first uplink port is a port that the mapper connects to the first forwarding engine;
  • the mapper sends the identifier of the first downlink port to the second packet, and sends a second packet marked with the identifier of the first downlink port from the first uplink port to the The first forwarding engine.
  • the method further Includes:
  • the second forwarding engine receives the second packet, and processes the second packet to obtain a third packet.
  • the third packet is sent to the mapper, where the third packet includes An identifier of the second physical interface, further including an identifier of the second downlink port of the mapper;
  • the mapper removes the identifier of the second downlink port from the third packet, obtains a fourth packet, and sends the fourth packet from the second downlink port to the second physical port.
  • the line card where the second physical interface is located, the identifier of the second physical interface is removed from the fourth packet, the fifth packet is obtained, and the fifth packet is sent to the second packet. Physical interface.
  • the method further includes: the mapper receiving the second packet from the first uplink port, the second The packet includes an identifier of the second physical interface, and an identifier of the second downlink port of the mapper.
  • the mapper removes the identifier of the second downlink port from the second packet, obtains a third packet, and sends the third packet from the second downlink port to the second physics
  • the line card where the interface is located
  • the line card where the second physical interface is located, the identifier of the second physical interface is removed from the third packet, the fourth packet is obtained, and the fourth packet is sent from the second physical The interface is sent out.
  • the correspondence between the forwarding engine and the physical interface is an identifier of an uplink port of the mapper, and a combination of an identifier of a downlink port of the mapper and an identifier of the physical interface.
  • the method further includes: the line card is configured to mark the first downlink port of the first packet; and the second packet further includes an identifier of the first downlink port;
  • the mapper sends the second packet to the first forwarding engine according to the correspondence between the forwarding engine and the physical interface, including:
  • the mapper obtains an identifier of the first uplink port of the mapper according to the second packet, and the corresponding relationship between the forwarding engine and the physical interface, where the first uplink port is the mapper Connecting to the port of the first forwarding engine;
  • the mapper sends the second packet from the first uplink port to the first forwarding engine.
  • the method further Includes:
  • the second forwarding engine receives the second packet, and processes the second packet to obtain a third packet.
  • the third packet is sent to the mapper, where the third packet includes An identifier of the second physical interface, further including an identifier of the second downlink port of the mapper;
  • the mapper sends the third packet from the second downlink port to the line card where the second physical interface is located, according to the identifier of the second downlink port in the third packet;
  • the method further The device includes: receiving, by the mapper, the second packet from the first uplink port, where the second packet includes an identifier of the second physical interface, and further includes an identifier of the second downlink port of the mapper;
  • the mapper sends the second packet from the second downlink port to the line card where the second physical interface is located, according to the identifier of the second downlink port in the second packet;
  • the line card where the second physical interface is located, the identifier of the second downlink port and the identifier of the second physical interface are removed from the second packet, and a third packet is obtained, and the The three messages are sent out from the second physical interface.
  • the network device provided by the embodiment of the present invention can separate the forwarding engine from the line card, and can increase the flexibility of the configuration of the interface and the forwarding engine; and through centralized management and scheduling of the forwarding engine, the capability of the forwarding engine can be avoided from being insufficient or excessive. Improve the forwarding performance and system reliability of network devices.
  • FIG. 1 is a schematic structural diagram of a network device according to an embodiment of the present invention.
  • FIG. 2 is a schematic structural diagram of another network device according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of another network device according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of another network device according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of another network device according to an embodiment of the present invention.
  • FIG. 6 is a flowchart of a method for forwarding a message according to an embodiment of the present invention.
  • FIG. 7 is a flowchart of another method for forwarding a message according to an embodiment of the present invention. detailed description
  • the embodiment of the present invention provides a network device.
  • the network device 100 includes multiple forwarding engines 102.
  • the network device 100 further includes a mapper 103 and a line card 104.
  • the line card 104 includes a physical interface, such as a Gigabit Ethernet (GE) interface, an E_carrier first level (English: first level of E-carrier, referred to as El) interface, and an asynchronous transmission mode (English: Asynchronous Transfer Mode, referred to as ATM) interface.
  • GE Gigabit Ethernet
  • El E_carrier first level
  • El asynchronous transmission mode
  • ATM Asynchronous Transfer Mode
  • the network device 100 shown in FIG. 1 includes two forwarding engines as an example, and the network device 100 may also include more than two forwarding engines.
  • the network device 100 shown in FIG. 1 is exemplified by two line cards.
  • the network device 100 may also include a line card.
  • the network device 100 may also include more than two line cards.
  • the line card 104 is for transmitting a message received from the physical interface to the mapper 103; and transmitting the message received from the mapper 103 from the corresponding physical interface.
  • All physical interfaces on one line card 104 each have a different identification.
  • the identifier of the physical interface can be the interface number. If there are multiple line cards 104 within a network device 100, the physical interfaces on the different line cards 104 may have the same identity.
  • the mapper 103 can distinguish between physical interfaces having the same identification on different line cards 104 by the connection between the mapper 103 and the line card 104.
  • all physical interfaces of a network device 100 can be uniquely identified. For example, all physical interfaces may be identified by a globally unique interface number within network device 100.
  • the mapper 103 is configured to send the packet from the line card to the corresponding forwarding engine 102 according to the correspondence between the forwarding engine and the physical interface, and is further configured to send the packet from the forwarding engine 102 to the corresponding line card.
  • the mapper 103 includes an uplink port and a downlink port; the uplink port is a port to which the mapper 103 is connected to the forwarding engine 102, such as port 2A and port 2B shown in FIG. 1, and the downlink port is a link line card of the mapper 103.
  • Port 104 such as port 4a, port 4b, etc. shown in FIG.
  • a plurality of line cards 104 on a network device 100 can be distinguished by an identification of a downstream port of the mapper 103, such as a port number.
  • the identifier of the downlink port of the mapper 103 is used as the identifier of the line card 104.
  • the forwarding engine 102 is configured to forward the message; specifically, the forwarding engine 102 sends the message to other forwarding engines for processing, or sends the message to the mapper 103.
  • a forwarding table is stored in the forwarding engine 102.
  • the forwarding engine 102 sends the message to other forwarding engines for processing according to the stored forwarding table, or sends the message to the mapper 103 for transmission to the corresponding line card 104.
  • the forwarding engine 102 can also perform service processing such as network address translation, deep packet inspection, and QoS on the packet.
  • the network device 100 may further include a switching fabric chip 101.
  • the plurality of forwarding engines 102 are connected to each other through the switching network chip 101.
  • the forwarding engine 102 sends the packet to other forwarding engines for processing, specifically through the switching network chip 101.
  • the switching network chip 101 is configured to exchange packets between the forwarding engines, specifically, the packets received from one forwarding engine to another forwarding engine.
  • the correspondence between the forwarding engine and the physical interface is an identifier and a physical of the forwarding engine.
  • the forwarding engine may be identified by the identifier of the uplink port of the mapper 103, that is, the identifier of the forwarding engine may be an identifier of the uplink port of the mapper 103.
  • the correspondence between the forwarding engine and the physical interface can be statically configured in the mapper 103.
  • the mapper 103 can also dynamically obtain a correspondence between the forwarding engine and the physical interface.
  • the network device 100 further includes a main control board 105, configured to obtain an identifier of an uplink port of the mapper 103 and an identifier of a downlink port.
  • the main control board 105 is further configured to obtain identifiers of all physical interfaces of the line card 104.
  • the main control board 105 can also be used to obtain parameters of the physical interface of the line card 104.
  • the parameters of the physical interface include the type of the physical interface, the bandwidth of the physical interface, or a combination thereof.
  • the main control board 105 is further configured to generate a correspondence between the forwarding engine and the physical interface according to a predefined policy.
  • the predefined policy may be based on a service configuration, a bandwidth of a physical interface, and a forwarding engine.
  • the main control board 105 is specifically configured to dynamically generate the forwarding engine according to a predefined policy, an identifier of an uplink port of the mapper 103, an identifier of a downlink port, and an identifier of all physical interfaces of the line card 104. Correspondence between physical interfaces.
  • the main control board 105 is further configured to provide a correspondence between the forwarding engine and the physical interface to the mapper 103.
  • main control board 105 and the mapper 103 Between the main control board 105 and the mapper 103, between the main control board 105 and the forwarding engine 102, between the main control board 105 and the line card 104, it can be connected by bus or other means.
  • all physical interfaces of the same line card 104 can be respectively connected to one downstream port of the mapper 103.
  • the mapper 103 can distinguish the physical interfaces by the identity of the downstream port.
  • the identifier of the physical interface may be an identifier of a downlink port of the mapper 103.
  • the correspondence between the forwarding engine and the physical interface obtained by the network device shown in FIG. 4 is based on the interface bandwidth.
  • the forwarding engine is identified by the identifier of the uplink port of the mapper 103, and the physical interface passes through the mapper 103.
  • the identity of the downstream port is identified.
  • all physical interfaces on the same line card 104 can also be connected to one downstream port of the mapper 103.
  • the mapper 103 can distinguish the physical interfaces of the different line cards 104 having the same identifier, such as the interface number, by the identifier of the downlink port.
  • the line card 104 further includes an interface processing chip 1041 for maintaining information of the physical interface of the line card 104, for example, an identifier of the physical interface, a type of the physical interface, a bandwidth of the physical interface, and the like. All of the physical interfaces of the line card 104 are connected to a downstream port of the mapper 103 via the interface processing chip 1041 of the line card 104.
  • the interface processing chip 1041 is configured to process messages from the physical interfaces of the line card 104; and is also used to process messages sent by the mapper 103 to the physical interfaces of the line card 104.
  • the interface processing chip 1041 further saves an identifier of a downlink port of the mapper 103 to which the mapper 103 is connected; correspondingly, the main control board 105 is further configured to provide the identifier of the downlink port to the The interface processing chip 1041.
  • the interface processing chip 1041 is specifically configured to process the packet received from the physical interface. Specifically, the interface processing chip 1041 of the line card 104 marks the physical interface of the packet received from the physical interface of the line card 104 by receiving the message. The interface processing chip 1041 further adds the identifier of the downlink port of the mapper 103 saved to the packet. Alternatively, the mapper 103 receives the packet from the packet received from the downlink port. The identity of the downstream port.
  • the interface processing chip 1041 is further configured to process the packet from the mapper 103, where the packet includes an identifier of the physical interface.
  • the packet further includes an identifier of the downlink port.
  • the interface processing chip 1041 of the line card 104 removes the identifier of the physical interface from the packet from the mapper 103, and optionally removes the identifier of the downlink port, and sends the packet according to the identifier of the physical interface. Sent from the physical interface.
  • interface processing chip 1041 of the line card 104 can also be used for performing rate matching, multiplexing/demultiplexing, protocol conversion, and the like on the message.
  • Table 2 is the correspondence between the forwarding engine and the physical interface obtained by the network device shown in FIG. 5 based on the interface bandwidth.
  • the forwarding engine is identified by the identifier of the uplink port of the mapper 103, and the physical interface passes through the downlink port of the mapper 103.
  • the combination of the identity and the identity of the physical interface is identified.
  • GE3 + 4c 2B Figure 5 and Table 2 show the same physical interfaces on the different line cards 104 of the network device 100.
  • the same applies to all physical interfaces on the network device 100 that can be uniquely identified.
  • the physical interface may also be identified only by the identifier of the physical interface.
  • the physical interfaces on the different line cards 104 can be connected to the mapper 103 in different ways. For example, all of the physical interfaces of one line card are each connected to one downstream port of the mapper 103, and all physical interfaces of the other line card are connected to a downstream port of the mapper through the interface processing chip of the line card.
  • the network device decouples the forwarding engine from the line card, and decouples the physical interface and the forwarding engine to implement centralized management and scheduling of multiple forwarding engines.
  • the dynamic mapping between the physical interface and the forwarding engine is implemented by the mapper, which increases the flexibility of the configuration of the physical interface and the forwarding engine, and improves the forwarding performance of the network device.
  • the network device 100 includes a router, a switch, and the like.
  • the correspondence between the forwarding engine and the physical interface generated based on the interface bandwidth may cause different forwarding engines to have different burdens.
  • the processing complexity of packets from different types of physical interfaces is usually different. For example, the packets of the GE interface may only need to be forwarded by the route, and the packets of the E1 interface may need to be used for deep packet inspection. Complex traffic processing such as firewalls and QoS.
  • the correspondence between the forwarding engine and the physical interface can be dynamically adjusted based on the load of the forwarding engine.
  • a forwarding engine load table is used to record the load status of each forwarding engine; the forwarding engine load table can be maintained by the main control board 105, and each forwarding engine can periodically report the load status, or can be actively initiated by the main control board 105. Query the load status of each forwarding engine. Further, the load of the forwarding engine may be tracked, for example, the load of the forwarding engine is periodically recorded to form a historical log. If all the forwarding engines are in a high load for a long time, indicating that the forwarding resources are insufficient, the forwarding engine may be added; or if the forwarding engine is long-term At low load, it means that there is excess forwarding resources, which can reduce the forwarding engine.
  • the network device provided by the present invention can centrally manage and schedule multiple forwarding engines.
  • the correspondence between the forwarding engine and the physical interface is obtained based on the service demand, such as the rate limit of the interface aggregation.
  • the relationship table between the physical interface and the bundle group may be recorded by using an interface binding relationship table.
  • the interface binding relationship table may be maintained by the main control board 105, and may be provided to the main control board 105 according to service requirements.
  • a binding group can be associated with a forwarding engine according to the interface binding relationship table.
  • Table 3 is an interface binding relationship table of the network device 100 shown in FIG. 5 according to an embodiment of the present invention.
  • a forwarding engine status table may be used to record the status of each forwarding engine.
  • the status of the forwarding engine includes normal (or called work), failure, shutdown (or called power-off), etc.; forwarding engine status table It can be maintained by the main control board 105.
  • Each forwarding engine can report the status periodically, or report the status when the status changes.
  • the main control board 105 can actively query the status of each forwarding engine.
  • All interfaces responsible for the failed forwarding engine can be switched to any one or more forwarding engines in a normal state; further, the forwarding engine of the forwarding engine can be switched to the forwarding engine with a normal state and a light load. on.
  • an alert can be issued if the status of all forwarding engines is not normal.
  • the primary forwarding engine and the standby forwarding engine may be configured in advance to improve system reliability by means of active/standby protection. Specifically, a dedicated backup forwarding engine may be set. When the primary forwarding engine works normally, the standby forwarding engine does not. Work, for example, in a powered-off state; when the primary forwarding engine fails, the standby forwarding engine enters a working state.
  • multiple forwarding engines can be used as the primary and backup devices, and an active/standby relationship table is used to record the primary and backup relationships between the forwarding engines to improve the utilization of the forwarding engine.
  • the responsible interface can be switched to another forwarding engine or an alternate forwarding engine, and the corresponding relationship between the forwarding engine and the physical interface is updated by the main control board 105 and provided to the mapper 103. You can avoid the forwarding engine failure and the physical interface will not work.
  • the responsible physical interface can be switched back to the forwarding engine from the other forwarding engine or the standby forwarding engine, and the corresponding relationship between the forwarding engine and the physical interface is updated by the main control board 105 and provided to the mapper. 103.
  • the mapper 103 can be implemented in hardware, such as an application specific integrated circuit (English:
  • ASIC Appl ication-specific integrated circuit
  • NP network processor
  • FPGA field programmable gate array
  • ASIC Appl ication-specific integrated circuit
  • NP network processor
  • FPGA field programmable gate array
  • the mapper 103 can also be implemented by software in combination with hardware.
  • the mapper 103 includes a processor 1031, a memory 1032, and a communication port 1033, and the processor 1031, the memory 1032, and the communication port 1033 can be connected via a bus or the like. Ways to connect to each other.
  • the memory 1032 is used to store programs.
  • the program can include program code, the program code including computer operating instructions.
  • the memory 1032 may include random-access memory (RAM) and may also include non-volati le memory.
  • the processor 1031 may be a central processing unit (CPU).
  • the communication port 1033 includes an uplink port for communicating with a forwarding engine, such as a 10GE interface, and the communication port 1033 further includes a downlink port for communicating with a line card, such as a GE interface.
  • the correspondence between the forwarding engine and the physical interface may be stored in the memory 1032.
  • the correspondence between the forwarding engine and the physical interface may also be saved in the cache of the processor.
  • the network device can separate the forwarding engine from the line card, and can increase the flexibility of physical interface and forwarding engine configuration; and can implement centralized management and scheduling of multiple forwarding engines to avoid insufficient forwarding engine capability. Or excess, improve the forwarding performance of network devices;
  • the forwarding engines can also be backups of each other, one forwarding engine is faulty, and other forwarding engines can take over their work, and the interface will not work, causing network failure, thereby improving System reliability.
  • mappers may be configured to implement functions such as active/standby protection and load balancing to ensure the network device 100. Reliability and forwarding performance.
  • the forwarding engine and the line card of the network device 100 may be in a one-to-one relationship, or may be a one-to-one relationship, or may be a one-to-many relationship, which may be specifically according to the network device 100.
  • the configuration is not limited by the present invention.
  • an embodiment of the present invention provides a method for forwarding a message, which can be used in a network device as shown in FIG. 5 of the present invention.
  • the method includes: 601.
  • the first line card receives the first packet from the first physical interface of the first line card, and marks the first packet with the identifier of the first physical interface, and obtains the second report. Sending the second packet to the mapper;
  • the interface processing chip of the first line card adds an identifier of the first physical interface, such as an interface number, to the first packet, to obtain the second packet, and the second packet. Sent to the mapper.
  • the second packet includes an identifier of the first physical interface.
  • the interface processing module of the first line card further performs multiplexing, protocol conversion, and the like on the pair of packets.
  • the mapper sends the second packet to the first forwarding engine according to the correspondence between the forwarding engine and the physical interface.
  • the mapper receives the second packet from the first downlink port, and sends the second packet to the first forwarding engine according to the correspondence between the forwarding engine and the physical interface.
  • all the physical interfaces of the network device may be uniquely identified, that is, the identifier of the physical interface is globally unique on the network device.
  • the correspondence between the forwarding engine and the physical interface is the correspondence between the identifier of the uplink port of the mapper and the identifier of the physical interface.
  • the mapper may obtain the identifier of the first uplink port of the mapper according to the identifier of the first physical interface in the second packet, and the correspondence between the forwarding engine and the physical interface.
  • the first uplink port is a port that the mapper connects to the first forwarding engine.
  • the mapper sends the second packet from the first uplink port to the first forwarding engine.
  • the correspondence between the forwarding engine and the physical interface is a correspondence between the identifier of the uplink port of the mapper and the combination of the identifier of the downlink port of the mapper and the identifier of the physical interface.
  • the mapper receives the identifier of the first downlink port of the second packet, and the forwarding engine and the physical interface according to the identifier of the first physical interface in the second packet. Corresponding relationship between the first uplink port of the mapper is obtained, and the first uplink port is a port that the mapper is connected to the first forwarding engine.
  • the mapper sends the identifier of the first downlink port to the second packet, and sends a second packet marked with the identifier of the first downlink port from the first uplink port to the The first forward bow I engine.
  • the correspondence between the forwarding engine and the physical interface is a correspondence between a combination of the identifier of the downlink port of the mapper and the identifier of the physical interface and the identifier of the uplink port of the mapper.
  • the interface processing chip of the first line card further performs the mapping on the first packet.
  • An identifier of a first downlink port of the mapper; a first downlink port of the mapper is a port connecting the mapper to the first line card; an interface processing chip of the first line card stores the The identifier of the first downlink port.
  • the second packet further includes an identifier of the first downlink port.
  • the mapper Determining, by the mapper, the identifier of the first uplink port of the mapper according to the correspondence between the second packet and the forwarding engine and the physical interface, where the first uplink port is the mapper A port that connects to the first forwarding engine.
  • the mapper sends the second packet from the first uplink port to the first forwarding engine.
  • the first forwarding engine forwards the second packet.
  • the first forwarding engine forwards the second packet according to the forwarding table. If the second packet needs to be processed by another forwarding engine, continue to execute 604-605; if the second packet does not need to be processed by another forwarding engine, continue to execute 606, and may directly send it to the corresponding device through the mapper. Physical interface.
  • the first forwarding engine performs service processing such as network address translation, deep packet detection, and QoS on the second packet before forwarding the second packet.
  • service processing such as network address translation, deep packet detection, and QoS
  • Each forwarding engine of the network device stores a forwarding table; the forwarding table is generated by the main control board and provided to each forwarding engine.
  • the second forwarding engine receives the second packet, and processes the second packet to obtain a third packet.
  • the third packet is sent to the mapper, where the third packet is sent. Including the identifier of the second physical interface;
  • the second forwarding engine performs forwarding processing on the second packet according to the forwarding table, and may perform service processing such as network address translation, deep packet detection, and QoS to obtain a third packet;
  • the third message is sent to the mapper.
  • the mapper receives the third packet, and sends the third packet according to the identifier of the second physical interface.
  • the mapper further includes a correspondence between the downlink port and the physical interface, and is specifically a correspondence between the identifier of the downlink port of the mapper and the identifier of the physical interface.
  • the mapper may obtain the identifier of the second downlink port of the mapper according to the identifier of the second physical interface, the correspondence between the downlink port and the physical interface, and obtain the third packet from the The second downlink port is sent to the second physical interface.
  • the mapper sends the third packet to an interface processing chip of the second line card, where the second physical interface is located on the second line card.
  • the interface processing chip of the second line card removes the identifier of the second physical interface from the third packet, and obtains a fourth Transmitting the fourth packet to the second physical interface.
  • the third packet further includes an identifier of the second downlink port of the mapper, where the mapper removes the second downlink from the third packet
  • the identifier of the port is obtained, and the fourth packet is sent, and the fourth packet is sent from the second downlink port to the second physical interface.
  • the fourth packet is sent from the second downlink port to an interface processing chip of the second line card, where the second physical interface is located on the second line card.
  • the interface processing chip of the second line card removes the identifier of the second physical interface from the fourth packet, obtains a fifth packet, and sends the fifth packet to the second physical interface.
  • the third packet further includes an identifier of the second downlink port of the mapper, where the mapper is configured according to the second downlink port in the third packet
  • the identifier is sent from the second downlink port to the second physical interface.
  • the mapper sends the third packet to an interface processing chip of the second line card, where the second physical interface is located on the second line card.
  • the interface processing chip of the second line card removes the identifier of the second downlink port and the identifier of the second physical interface from the third packet, to obtain a fourth packet, and the fourth packet
  • the text is sent to the second physical interface.
  • the mapper receives the second packet from the first uplink port, where the second packet includes an identifier of the second physical interface, and sends the second packet according to the identifier of the second physical interface. .
  • the mapper further includes a correspondence between the downlink port and the physical interface, which is specifically a correspondence between the identifier of the downlink port of the mapper and the identifier of the physical interface.
  • the mapper may obtain an identifier of the second downlink port of the mapper according to the identifier of the second physical interface, the correspondence between the downlink port and the physical interface, and obtain the second packet from the The second downlink port is sent to the second physical interface.
  • the mapper sends the second packet to an interface processing chip of the second line card, where the second physical interface is located on the second line card.
  • the interface processing chip of the second line card removes the identifier of the second physical interface from the second packet, obtains a third packet, and sends the third packet from the second physical interface. .
  • the second packet further includes an identifier of the second downlink port of the mapper, where the mapper removes the second downlink from the second packet The identifier of the port is obtained, and the third packet is sent, and the third packet is sent from the second downlink port to the second physical interface.
  • the third packet is sent from the second downlink port to an interface processing chip of the second line card, where the second physical interface is located on the second line card.
  • the interface card of the second line card is processed from the chip
  • the third packet is removed from the identifier of the second physical interface, and the fourth packet is obtained, and the fourth packet is sent out from the second physical interface.
  • the second packet further includes an identifier of the second downlink port of the mapper, where the mapper is configured according to the second downlink port in the second packet
  • the identifier is sent from the second downlink port to the second physical interface.
  • the mapper sends the second packet to an interface processing chip of the second line card, where the second physical interface is located on the second line card.
  • the interface processing chip of the second line card removes the identifier of the second downlink port and the identifier of the second physical interface from the second packet, to obtain a third packet, and the third packet
  • the text is sent out from the second physical interface.
  • first line card and the second line card may be the same line card.
  • the first downlink port may be the same port as the second downlink port.
  • the stripping of the forwarding engine from the line card can increase the flexibility of the physical interface and the forwarding engine configuration; and can implement centralized management and scheduling of multiple forwarding engines to avoid the forwarding engine. Insufficient or excessive capacity, improve the forwarding performance of network devices;
  • the forwarding engines can also backup each other, a forwarding engine failure, can be replaced by other forwarding engines, will not make the interface unable to work and cause network failure , thereby improving system reliability.
  • FIG. 7 is another method for forwarding a message according to an embodiment of the present invention, which can be used in a network device as shown in FIG. 4 of the present invention. The method includes:
  • the first physical interface of the first line card receives the first packet, and sends the first packet to the mapper.
  • the first physical interface sends the first packet from the first downlink port of the mapper to the mapper; the first downlink port is the first physical interface connection The end of the mapper.
  • the mapper processes the first packet according to the correspondence between the forwarding engine and the physical interface, and obtains the second packet, and sends the second packet to the first forwarding engine.
  • the mapper receives the first packet from the first downlink port, and obtains the first uplink according to the identifier of the first downlink port and the correspondence between the forwarding engine and the physical interface.
  • the identifier of the port where the first uplink port is a port that the mapper connects to the first forwarding engine.
  • the mapper marks the first packet with the identifier of the first uplink port, and obtains a second packet, and Sending the second packet from the first uplink port to the first forwarding engine.
  • the correspondence between the forwarding engine and the physical interface is the correspondence between the identifier of the uplink port of the mapper and the identifier of the downlink port of the mapper, where the identifier of the uplink port of the mapper is used to identify The forwarding engine, whose identifier of the downlink port of the mapper is used to identify the physical interface.
  • the first forwarding engine forwards the second packet.
  • the first forwarding engine forwards the second packet according to the forwarding table. If the second packet needs to be processed by another forwarding engine, continue to perform 704-705; if the second packet does not need to be processed by another forwarding engine, continue to execute 706, and may directly send it to the corresponding device through the mapper. Physical interface.
  • the first forwarding engine performs service processing such as network address translation, deep packet detection, and QoS on the second packet before forwarding the second packet.
  • service processing such as network address translation, deep packet detection, and QoS
  • Each forwarding engine of the network device stores a forwarding table; the forwarding table is generated by the main control board and provided to each forwarding engine.
  • the second forwarding engine receives the second packet, and processes the second packet to obtain a third packet.
  • the third packet is sent to the mapper, where the third packet is sent. Including the identifier of the second physical interface;
  • the identifier of the second physical interface is an identifier of a second downlink port of the mapper; and the second downlink port is a port of the second physical interface that is connected to the mapper.
  • the second forwarding engine performs forwarding processing on the second packet according to the forwarding table, and may perform service processing such as network address translation, deep packet detection, and QoS to obtain a third packet;
  • the third message is sent to the mapper.
  • the mapper receives the third packet, and sends the third packet to the second physical interface according to the identifier of the second physical interface.
  • the mapper removes the identifier of the second physical interface from the third packet to obtain a fourth packet, and according to the identifier of the second physical interface, the fourth packet is removed from the fourth packet.
  • the second downlink port is sent to the second physical interface.
  • the mapper receives the second packet from the first uplink port, where the second packet includes an identifier of the second physical interface, and sends the second packet according to the identifier of the second physical interface. ;
  • the identifier of the second physical interface is an identifier of a second downlink port of the mapper; and the second downlink port is a port of the second physical interface that is connected to the mapper.
  • the mapper removes the identifier of the second physical interface from the second packet to obtain a third packet, and according to the identifier of the second physical interface, the third packet is The second downlink port is sent to the second physical interface.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

Disclosed is a network device, with forwarding engines being removed from line cards, increasing configuration flexibility of physical interfaces and forwarding engines, and realizing centralized management and scheduling of multiple forwarding engines to avoid inadequate or excess capability of the forwarding engines to improve forwarding performance and reliability of the network device. The network device comprises a plurality of forwarding engines, mappers and line cards, the line cards comprising physical interfaces; according to the relationship between the forwarding engines and physical interfaces, the mapper transmits packets from the line cards to the corresponding forwarding engines, and packets from the forwarding engines to the corresponding physical interfaces. Also provided is a network device packet forwarding method.

Description

网络设备及转发报文的方法 本申请要求于 2013年 12月 31日提交中国专利局、 申请号为 201310753145. 4、 发明名称为 "网络设备及转发报文的方法" 的中国专利申请的优先权,其全部内 容通过引用结合在本申请中。 技术领域  Network device and method for forwarding a message The present application claims to be filed on December 31, 2013, the Chinese Patent Office, the application number is 201310753145. 4. The priority of the Chinese patent application entitled "Network Device and Method of Forwarding Message" The entire content of which is incorporated herein by reference. Technical field
本发明涉及网络通信领域, 尤其涉及网络设备及转发报文的方法。 背景技术  The present invention relates to the field of network communications, and in particular, to a network device and a method for forwarding a message. Background technique
路由器最基本的功能是根据收到报文中的网络层地址以及路由器内部维护 的路由表决定转发该报文的物理接口以及下一跳地址,并且修改该报文的链路层 头后转发该报文。路由器在转发报文时, 还可以进行网络地址转换、深度报文检 测、 服务质量 (英文: qual ity of service, 简称 QoS) 等业务处理。  The most basic function of the router is to determine the physical interface and the next hop address of the packet based on the network layer address in the received packet and the routing table maintained by the router, and modify the link layer header of the packet to forward the packet. Message. When a router forwards a packet, it can perform network address translation, deep packet inspection, and quality of service (QoS).
路由器通常采用分布式转发架构, 包括线卡 (英文: l ine card) 和交换网 (英文: switching fabric ) 芯片。 线卡提供物理接口, 还包括转发引擎; 转发 引擎之间通过交换网芯片相互连接。在同一个线卡的两个物理接口间转发的数据 流量, 由该线卡的转发引擎就可以完成转发处理, 不需要送到交换网芯片。路由 器的线卡种类很多, 有提供低速链路接口的线卡, 也有提供高速接口的线卡, 不 同类型接口的速率相差非常大。 线卡的出接口总带宽可能是 64千位每秒 (英文: ki lobits per second, 符号: Kbps ) , 128Kbps或 256Kbps, 也可能是 100兆位每 秒 (英文: megabits per second, 符号: Mbps ) 、 200Mbps或 1吉位每秒 (英文: gigabits per second, 符号: Gbps ) 等等, 导致线卡的转发引擎的处理能力和 接口速率很难匹配。有可能转发引擎能力不足, 无法满足对应的接口速率, 也有 可能转发引擎能力过剩, 超过了接口速率, 导致浪费转发引擎能力。 此外, 在线 卡的转发引擎发生故障的情况下, 该线卡的所有接口都将不能正常工作。 发明内容 本发明实施例提供了一种网络设备和转发报文的方法, 通过将转发引擎从 线卡上剥离出来, 映射器提供转发引擎和物理接口之间的对应关系, 将物理接口 和转发引擎解耦合, 增加物理接口和转发引擎配置的灵活性, 从而提高网络设备 的转发性能和可靠性。 Routers usually use a distributed forwarding architecture, including line cards (English: l ine card) and switching networks (English: switching fabric) chips. The line card provides a physical interface, and also includes a forwarding engine; the forwarding engines are connected to each other through a switching network chip. The data traffic forwarded between the two physical interfaces of the same line card can be forwarded by the forwarding engine of the line card, and does not need to be sent to the switching network chip. There are many types of line cards for routers. There are line cards that provide low-speed link interfaces, and line cards that provide high-speed interfaces. The speeds of different types of interfaces are very different. The total bandwidth of the outgoing interface of the line card may be 64 kilobits per second (English: ki lobits per second, symbol: Kbps), 128Kbps or 256Kbps, or 100 megabits per second (English: megabits per second, symbol: Mbps) 200Mbps or 1 gigabit per second (English: gigabits per second, symbol: Gbps), etc., which makes it difficult to match the processing power of the line card's forwarding engine and the interface rate. It is possible that the forwarding engine has insufficient capacity to meet the corresponding interface rate. It is also possible that the forwarding engine has excess capacity and exceeds the interface rate, resulting in wasted forwarding engine capability. In addition, in the event of a failure of the online card's forwarding engine, all interfaces of the line card will not work properly. SUMMARY OF THE INVENTION The embodiments of the present invention provide a network device and a method for forwarding a message. The peer map is provided with a correspondence between a forwarding engine and a physical interface by separating the forwarding engine from the line card, and the physical interface and the forwarding engine are provided. Decoupling, increasing the flexibility of physical interface and forwarding engine configuration, thereby improving network equipment Forwarding performance and reliability.
第一方面, 提供了一种网络设备, 包括多个转发引擎, 映射器和线卡; 所述 线卡包括物理接口; 所述映射器包括上行端口和下行端口; 上行端口为所述映射 器连接转发引擎的端口; 下行端口为所述映射器连接所述线卡的端口;  In a first aspect, a network device is provided, including a plurality of forwarding engines, a mapper and a line card; the line card includes a physical interface; the mapper includes an uplink port and a downlink port; and the uplink port is the mapper connection a port of the forwarding engine; a downlink port is a port to which the mapper connects the line card;
所述线卡, 用于将从物理接口接收到的报文发送到所述映射器; 还用于将从 所述映射器接收到的报文从对应的物理接口发送出去;  The line card is configured to send a packet received from the physical interface to the mapper, and is further configured to send the packet received from the mapper from the corresponding physical interface;
所述映射器, 用于根据转发引擎和物理接口之间的对应关系, 把来自物理接 口的报文发送到对应的转发引擎;还用于把来自转发引擎的报文发送到对应的物 理接口;  The mapper is configured to: send the packet from the physical interface to the corresponding forwarding engine according to the correspondence between the forwarding engine and the physical interface; and send the packet from the forwarding engine to the corresponding physical interface;
转发引擎, 用于转发报文。  Forwarding engine, used to forward packets.
在第一方面的第一种可能实现中,所述转发引擎的标识为所述映射器的上行 端口的标识。  In a first possible implementation of the first aspect, the identity of the forwarding engine is an identity of an uplink port of the mapper.
根据第一方面或第一方面的第一种可能实现,在第一方面的第二种可能实现 中, 所述映射器还用于动态获取所述转发弓 I擎和物理接口之间的对应关系。  According to the first aspect or the first possible implementation of the first aspect, in a second possible implementation of the first aspect, the mapper is further configured to dynamically acquire a correspondence between the forwarding engine and a physical interface. .
根据第一方面的第二种可能实现中, 在第一方面的第三种可能实现中, 所述 网络设备还包括主控板,用于获取所述映射器的上行端口的标识和下行端口的标 识; 根据预定义的策略, 生成所述转发引擎和物理接口之间的映射关系, 并提供 给所述映射器。  According to a second possible implementation of the first aspect, in a third possible implementation of the first aspect, the network device further includes a main control board, configured to acquire an identifier of the uplink port of the mapper and a downlink port Identifying a mapping relationship between the forwarding engine and the physical interface according to a predefined policy, and providing the mapping to the mapper.
根据第一方面的第三种可能的实现方式, 在第一方面的第四种可能实现中, 所述预定义的策略包括基于业务配置, 物理接口的带宽, 转发引擎的状态和转发 引擎的负载情况中一个或多个的策略。  According to a third possible implementation manner of the first aspect, in a fourth possible implementation of the first aspect, the predefined policy includes: a service configuration, a bandwidth of a physical interface, a state of a forwarding engine, and a load of a forwarding engine. One or more strategies in the situation.
根据第一方面和第一方面的第一种至第四种可能的实现方式中的任一种,在 第一方面的第五种可能实现中, 所述线卡包括接口处理芯片;  According to the first aspect and any one of the first to fourth possible implementation manners of the first aspect, in a fifth possible implementation of the first aspect, the line card comprises an interface processing chip;
所述线卡的所有物理接口通过所述接口处理芯片连接到所述映射器的一个 下行端口;  All physical interfaces of the line card are connected to a downlink port of the mapper through the interface processing chip;
所述转发引擎和物理接口之间的对应关系为所述转发引擎的标识, 与, 下行 端口的标识和物理接口的标识的组合的对应关系;  Corresponding relationship between the forwarding engine and the physical interface is a correspondence between the identifier of the forwarding engine and the combination of the identifier of the downlink port and the identifier of the physical interface;
所述接口处理芯片, 用于处理来自所述线卡的物理接口的报文; 还用于处理 所述映射器发送到所述线卡的物理接口的报文;  The interface processing chip is configured to process a message from a physical interface of the line card, and is further configured to process a message sent by the mapper to a physical interface of the line card;
根据第一方面的第五种可能的实现方式, 在第一方面的第六种可能实现中, 所述接口处理芯片, 具体用于从所述线卡的第一物理接口接收第一报文, 为所述 第一报文打上所述第一物理接口的标识, 得到第二报文; 并向所述映射器发送所 述第二报文; According to a fifth possible implementation of the first aspect, in a sixth possible implementation of the first aspect, The interface processing chip is configured to receive the first packet from the first physical interface of the line card, and set the identifier of the first physical interface to the first packet to obtain a second packet; The mapper sends the second packet;
所述接口处理芯片, 具体还用于接收来自所述映射器的第三报文, 所述第三 报文中包括所述线卡的第二物理接口的标识,从所述第三报文中去除所述第二物 理接口的标识, 得到第四报文; 并根据所述第二物理接口的标识, 向所述第二物 理接口发送所述第四报文。  The interface processing chip is further configured to receive a third packet from the mapper, where the third packet includes an identifier of a second physical interface of the line card, and the third packet is included in the third packet. And removing the identifier of the second physical interface, to obtain a fourth packet, and sending the fourth packet to the second physical interface according to the identifier of the second physical interface.
根据第一方面的第六种可能的实现方式, 在第一方面的第七种可能实现中, 所述映射器, 具体用于从所述下行端口接收所述第二报文, 为所述第二报文打上 所述下行端口的标识,并根据所述转发引擎和物理接口之间的对应关系发送给所 述第一物理端口对应的转发引擎。  According to the sixth possible implementation of the first aspect, in a seventh possible implementation of the first aspect, the mapper is configured to receive the second packet from the downlink port, where The second packet is marked with the identifier of the downlink port, and is sent to the forwarding engine corresponding to the first physical port according to the correspondence between the forwarding engine and the physical interface.
根据第一方面的第六种可能的实现方式, 在第一方面的第八种可能实现中, 所述接口处理芯片, 具体还用于为所述第一报文打上所述下行端口的标识; 所述 第二报文中还包括所述第一下行端口的标识;  According to the sixth possible implementation of the first aspect, in the eighth possible implementation of the first aspect, the interface processing chip is further configured to: apply the identifier of the downlink port to the first packet; The second packet further includes an identifier of the first downlink port;
所述第三报文中还包括所述下行端口的标识; 所述接口处理芯片, 具体还用 于从所述第三报文中去除所述下行端口的标识, 得到所述第四报文。  The third packet further includes an identifier of the downlink port. The interface processing chip is further configured to remove the identifier of the downlink port from the third packet, to obtain the fourth packet.
根据第一方面的第八种可能的实现方式, 在第一方面的第九种可能实现中, 所述接口处理芯片还用于保存所述下行端口的标识;  According to the eighth possible implementation of the first aspect, in a ninth possible implementation of the first aspect, the interface processing chip is further configured to save an identifier of the downlink port;
所述主控板, 还可用于将所述下行端口的标识提供给所述接口处理芯片。 根据第一方面和第一方面的第一种至第四种可能的实现方式中的任一种,在 第一方面的第十种可能实现中,所述线卡的所有物理接口分别连接所述映射器的 一个下行端口。  The main control board is further configured to provide an identifier of the downlink port to the interface processing chip. In accordance with the first aspect and any one of the first to fourth possible implementations of the first aspect, in a tenth possible implementation of the first aspect, all physical interfaces of the line card are respectively connected to the A downstream port of the mapper.
根据第一方面的第十种可能的实现方式, 在第一方面的第十一种可能实现 中,所述转发引擎和物理接口之间的对应关系为所述映射器的上行端口的标识与 所述映射器的上行端口的标识的对应关系。  According to the tenth possible implementation manner of the first aspect, in the eleventh possible implementation of the first aspect, the correspondence between the forwarding engine and the physical interface is an identifier and an identifier of an uplink port of the mapper The correspondence between the identifiers of the uplink ports of the mapper.
根据第一方面和第一方面的第一种至第十一种可能的实现方式中的任一种, 在第一方面的第十二种可能实现中, 所述网络设备还包括交换网芯片; 所述多个 转发引擎通过所述交换网芯片相互连接;  According to the first aspect and any one of the first to the eleventh possible implementation manners of the first aspect, in a twelfth possible implementation of the first aspect, the network device further includes a switching network chip; The plurality of forwarding engines are connected to each other through the switching network chip;
所述交换网芯片, 用于对所述多个转发引擎之间的报文进行交换。 第二方面, 提供了一种转发报文的方法, 应用于网络设备中, 所述网络设备 包括多个转发引擎, 映射器和线卡; 所述转发报文的方法包括: The switching network chip is configured to exchange packets between the multiple forwarding engines. A second aspect provides a method for forwarding a packet, where the network device includes a plurality of forwarding engines, a mapper, and a line card. The method for forwarding a packet includes:
线卡的第一物理接口接收第一报文;  The first physical interface of the line card receives the first packet;
所述线卡为所述第一报文打上所述第一物理接口的标识, 得到第二报文, 所 述第二报文中包括所述第一物理接口的标识; 将所述第二报文发送给映射器; 所述映射器从第一下行端口接收所述第二报文,根据转发引擎和物理接口之 间的对应关系, 将所述第二报文发送给第一转发引擎; 所述第一下行端口为所述 映射器连接所述线卡的端口;  The line card is configured to mark the first packet with the first physical interface, and obtain a second packet, where the second packet includes an identifier of the first physical interface; And sending, by the mapper, the second packet to the first forwarding engine according to the correspondence between the forwarding engine and the physical interface; The first downlink port is a port that the mapper connects to the line card;
所述第一转发引擎向第二转发引擎发送所述第二报文,或者向所述映射器发 送所述第二报文。  The first forwarding engine sends the second packet to a second forwarding engine, or sends the second packet to the mapper.
在第二方面的第一种可能实现方式中,所述转发引擎和物理接口之间的对应 关系为映射器的上行端口的标识和物理接口的标识的对应关系;  In a first possible implementation manner of the second aspect, the correspondence between the forwarding engine and the physical interface is a correspondence between an identifier of an uplink port of the mapper and an identifier of the physical interface;
所述映射器根据转发引擎和物理接口之间的对应关系,将所述第二报文发送 给第一转发引擎, 包括:  The mapper sends the second packet to the first forwarding engine according to the correspondence between the forwarding engine and the physical interface, including:
所述映射器根据所述第二报文中所述第一物理接口的标识,以及所述转发引 擎和物理接口之间的对应关系, 得到所述映射器的第一上行端口的标识; 所述第 一上行端口为所述映射器连接所述第一转发引擎的端口;  The mapper obtains an identifier of the first uplink port of the mapper according to the identifier of the first physical interface in the second packet, and the corresponding relationship between the forwarding engine and the physical interface; The first uplink port is a port that the mapper connects to the first forwarding engine;
所述映射器将所述第二报文从所述第一上行端口发送给所述第一转发引擎。 根据第二方面的第一种可能实现方式, 在第二方面的第二种可能实现方式 中, 在所述第一转发引擎向第二转发引擎发送所述第二报文之后, 所述方法还包 括:  The mapper sends the second packet from the first uplink port to the first forwarding engine. According to the first possible implementation manner of the second aspect, in a second possible implementation manner of the second aspect, after the first forwarding engine sends the second packet to the second forwarding engine, the method further Includes:
第二转发引擎接收所述第二报文,对所述第二报文进行处理,得到第三报文; 将所述第三报文发送给所述映射器, 所述第三报文中包括第二物理接口的标识; 所述映射器接收所述第三报文, 根据所述第二物理接口的标识, 下行端口和 物理接口的对应关系, 得到所述映射器的第二下行端口的标识, 并将所述第三报 文从所述第二下行端口发送到所述第二物理接口所位于的线卡;  The second forwarding engine receives the second packet, and processes the second packet to obtain a third packet. The third packet is sent to the mapper, where the third packet includes The identifier of the second physical interface, the mapper receives the third packet, and obtains the identifier of the second downlink port of the mapper according to the identifier of the second physical interface, the correspondence between the downlink port and the physical interface And sending the third packet from the second downlink port to a line card where the second physical interface is located;
所述第二物理接口所位于的线卡,从所述第三报文中去除所述第二物理接口 的标识, 得到第四报文, 并将所述第四报文发送到所述第二物理接口。  The line card where the second physical interface is located, the identifier of the second physical interface is removed from the third packet, the fourth packet is obtained, and the fourth packet is sent to the second packet. Physical interface.
根据第二方面的第一种可能实现方式, 在第二方面的第三种可能实现方式 中,在所述第一转发引擎向所述映射器发送所述第二报文之后,所述方法还包括: 所述映射器从第一上行端口接收所述第二报文,所述第二报文中包括第二物 理接口的标识; According to a first possible implementation manner of the second aspect, in a third possible implementation manner of the second aspect, after the first forwarding engine sends the second packet to the mapper, the method further include: The mapper receives the second packet from the first uplink port, where the second packet includes an identifier of the second physical interface;
所述映射器根据所述第二物理接口的标识,所述下行端口和物理接口的对应 关系, 得到所述映射器的第二下行端口的标识, 并将所述第二报文从所述第二下 行端口发送到所述第二物理接口所位于的线卡;  Determining, by the mapper, the identifier of the second downlink port of the mapper according to the identifier of the second physical interface, the correspondence between the downlink port and the physical interface, and the second packet from the first Sending, by the second downlink port, a line card where the second physical interface is located;
所述第二物理接口所位于的线卡,从所述第二报文中去除所述第二物理接口 的标识, 得到第三报文, 并将所述第三报文从所述第二物理接口发送出去。  The line card where the second physical interface is located, the identifier of the second physical interface is removed from the second packet, the third packet is obtained, and the third packet is sent from the second physical The interface is sent out.
在第二方面的第四种可能实现方式中,所述转发引擎和物理接口之间的对应 关系为映射器的上行端口的标识, 与, 映射器的下行端口的标识和物理接口的标 识的组合的对应关系;  In a fourth possible implementation manner of the second aspect, the correspondence between the forwarding engine and the physical interface is an identifier of an uplink port of the mapper, and a combination of an identifier of a downlink port of the mapper and an identifier of the physical interface. Correspondence relationship;
所述映射器根据转发引擎和物理接口之间的对应关系,将所述第二报文发送 给第一转发引擎, 包括:  The mapper sends the second packet to the first forwarding engine according to the correspondence between the forwarding engine and the physical interface, including:
所述映射器根据所述第二报文中所述第一物理接口的标识,所述第一下行端 口的标识, 以及所述转发引擎和物理接口之间的对应关系, 得到所述映射器的第 一上行端口的标识;所述第一上行端口为所述映射器连接所述第一转发引擎的端 Π ;  The mapper obtains the mapper according to the identifier of the first physical interface, the identifier of the first downlink port, and the correspondence between the forwarding engine and the physical interface in the second packet. The identifier of the first uplink port; the first uplink port is a port that the mapper connects to the first forwarding engine;
所述映射器为所述第二报文打上所述第一下行端口的标识,并将打上所述第 一下行端口的标识的第二报文从所述第一上行端口发送给所述第一转发引擎。  The mapper sends the identifier of the first downlink port to the second packet, and sends a second packet marked with the identifier of the first downlink port from the first uplink port to the The first forwarding engine.
根据第二方面的第四种可能实现方式, 在第二方面的第五种可能实现方式 中, 在所述第一转发引擎向第二转发引擎发送所述第二报文之后, 所述方法还包 括:  According to the fourth possible implementation manner of the second aspect, in a fifth possible implementation manner of the second aspect, after the first forwarding engine sends the second packet to the second forwarding engine, the method further Includes:
第二转发引擎接收所述第二报文,对所述第二报文进行处理,得到第三报文; 将所述第三报文发送给所述映射器, 所述第三报文中包括第二物理接口的标识, 还包括所述映射器的第二下行端口的标识;  The second forwarding engine receives the second packet, and processes the second packet to obtain a third packet. The third packet is sent to the mapper, where the third packet includes An identifier of the second physical interface, further including an identifier of the second downlink port of the mapper;
所述映射器从所述第三报文中去除所述第二下行端口的标识, 得到第四报 文,并将所述第四报文从所述第二下行端口发送到所述第二物理接口所位于的线 卡;  The mapper removes the identifier of the second downlink port from the third packet, obtains a fourth packet, and sends the fourth packet from the second downlink port to the second physical port. The line card where the interface is located;
所述第二物理接口所位于的线卡,从所述第四报文中去除所述第二物理接口 的标识, 得到第五报文, 并将所述第五报文发送到所述第二物理接口。  The line card where the second physical interface is located, the identifier of the second physical interface is removed from the fourth packet, the fifth packet is obtained, and the fifth packet is sent to the second packet. Physical interface.
根据第二方面的第四种可能实现方式, 在第二方面的第六种可能实现方式 中,在所述第一转发引擎向所述映射器发送所述第二报文之后,所述方法还包括: 所述映射器从第一上行端口接收所述第二报文,所述第二报文中包括第二物 理接口的标识, 还包括所述映射器的第二下行端口的标识; According to a fourth possible implementation of the second aspect, a sixth possible implementation in the second aspect After the first forwarding engine sends the second packet to the mapper, the method further includes: the mapper receiving the second packet from the first uplink port, the second The packet includes an identifier of the second physical interface, and an identifier of the second downlink port of the mapper.
所述映射器从所述第二报文中去除所述第二下行端口的标识, 得到第三报 文,并将所述第三报文从所述第二下行端口发送到所述第二物理接口所位于的线 卡;  The mapper removes the identifier of the second downlink port from the second packet, obtains a third packet, and sends the third packet from the second downlink port to the second physics The line card where the interface is located;
所述第二物理接口所位于的线卡,从所述第三报文中去除所述第二物理接口 的标识, 得到第四报文, 并将所述第四报文从所述第二物理接口发送出去。  The line card where the second physical interface is located, the identifier of the second physical interface is removed from the third packet, the fourth packet is obtained, and the fourth packet is sent from the second physical The interface is sent out.
在第二方面的第七种可能实现方式中,所述转发引擎和物理接口之间的对应 关系为映射器的上行端口的标识, 与, 映射器的下行端口的标识和物理接口的标 识的组合的对应关系;  In a seventh possible implementation manner of the second aspect, the correspondence between the forwarding engine and the physical interface is an identifier of an uplink port of the mapper, and a combination of an identifier of a downlink port of the mapper and an identifier of the physical interface. Correspondence relationship;
所述方法还包括: 所述线卡为所述第一报文打上所述第一下行端口的标识; 所述第二报文中还包括所述第一下行端口的标识;  The method further includes: the line card is configured to mark the first downlink port of the first packet; and the second packet further includes an identifier of the first downlink port;
相应地, 所述映射器根据转发引擎和物理接口之间的对应关系, 将所述第二 报文发送给第一转发引擎, 包括:  Correspondingly, the mapper sends the second packet to the first forwarding engine according to the correspondence between the forwarding engine and the physical interface, including:
所述映射器根据所述第二报文,以及所述转发引擎和物理接口之间的对应关 系, 得到所述映射器的第一上行端口的标识, 所述第一上行端口为所述映射器连 接所述第一转发引擎的端口;  The mapper obtains an identifier of the first uplink port of the mapper according to the second packet, and the corresponding relationship between the forwarding engine and the physical interface, where the first uplink port is the mapper Connecting to the port of the first forwarding engine;
所述映射器将所述第二报文从所述第一上行端口发送给所述第一转发引擎。 根据第二方面的第七种可能实现方式, 在第二方面的第八种可能实现方式 中, 在所述第一转发引擎向第二转发引擎发送所述第二报文之后, 所述方法还包 括:  The mapper sends the second packet from the first uplink port to the first forwarding engine. According to the seventh possible implementation of the second aspect, in an eighth possible implementation manner of the second aspect, after the first forwarding engine sends the second packet to the second forwarding engine, the method further Includes:
第二转发引擎接收所述第二报文,对所述第二报文进行处理,得到第三报文; 将所述第三报文发送给所述映射器, 所述第三报文中包括第二物理接口的标识, 还包括所述映射器的第二下行端口的标识;  The second forwarding engine receives the second packet, and processes the second packet to obtain a third packet. The third packet is sent to the mapper, where the third packet includes An identifier of the second physical interface, further including an identifier of the second downlink port of the mapper;
所述映射器根据所述第三报文中所述第二下行端口的标识,将所述第三报文 从所述第二下行端口发送给所述第二物理接口所位于的线卡;  The mapper sends the third packet from the second downlink port to the line card where the second physical interface is located, according to the identifier of the second downlink port in the third packet;
所述第二物理接口所位于的线卡,从所述第三报文中去除所述第二下行端口 的标识和所述第二物理接口的标识, 得到第四报文, 并将所述第四报文发送到所 述第二物理接口。 根据第二方面的第七种可能实现方式, 在第二方面的第九种可能实现方式 中,在所述第一转发引擎向所述映射器发送所述第二报文之后,所述方法还包括: 所述映射器从第一上行端口接收所述第二报文,所述第二报文中包括第二物 理接口的标识, 还包括所述映射器的第二下行端口的标识; The line card where the second physical interface is located, the identifier of the second downlink port and the identifier of the second physical interface are removed from the third packet, and a fourth packet is obtained, and the Four messages are sent to the second physical interface. According to a seventh possible implementation manner of the second aspect, in a ninth possible implementation manner of the second aspect, after the first forwarding engine sends the second packet to the mapper, the method further The device includes: receiving, by the mapper, the second packet from the first uplink port, where the second packet includes an identifier of the second physical interface, and further includes an identifier of the second downlink port of the mapper;
所述映射器根据所述第二报文中所述第二下行端口的标识,将所述第二报文 从所述第二下行端口发送给所述第二物理接口所位于的线卡;  The mapper sends the second packet from the second downlink port to the line card where the second physical interface is located, according to the identifier of the second downlink port in the second packet;
所述第二物理接口所位于的线卡,从所述第二报文中去除所述第二下行端口 的标识和所述第二物理接口的标识, 得到第三报文, 并将所述第三报文从所述第 二物理接口发送出去。  The line card where the second physical interface is located, the identifier of the second downlink port and the identifier of the second physical interface are removed from the second packet, and a third packet is obtained, and the The three messages are sent out from the second physical interface.
本发明实施例提供的网络设备, 把转发引擎从线卡上剥离出来, 可以增加接 口和转发引擎配置的灵活性; 且通过对转发引擎的集中管理和调度, 可以避免转 发引擎的能力不足或过剩, 提高网络设备的转发性能和系统可靠性。 附图说明  The network device provided by the embodiment of the present invention can separate the forwarding engine from the line card, and can increase the flexibility of the configuration of the interface and the forwarding engine; and through centralized management and scheduling of the forwarding engine, the capability of the forwarding engine can be avoided from being insufficient or excessive. Improve the forwarding performance and system reliability of network devices. DRAWINGS
图 1是本发明实施例提供的一 网络设备结构示意图;  1 is a schematic structural diagram of a network device according to an embodiment of the present invention;
图 2是本发明实施例提供的另 种网络设备结构示意图;  2 is a schematic structural diagram of another network device according to an embodiment of the present invention;
图 3是本发明实施例提供的又 种网络设备结构示意图;  3 is a schematic structural diagram of another network device according to an embodiment of the present invention;
图 4是本发明实施例提供的又 种网络设备结构示意图;  4 is a schematic structural diagram of another network device according to an embodiment of the present invention;
图 5是本发明实施例提供的又 种网络设备结构示意图;  FIG. 5 is a schematic structural diagram of another network device according to an embodiment of the present invention;
图 6是本发明实施例提供的一. 转发报文的方法流程图;  FIG. 6 is a flowchart of a method for forwarding a message according to an embodiment of the present invention;
图 7是本发明实施例提供的另 种转发报文的方法流程图。 具体实施方式  FIG. 7 is a flowchart of another method for forwarding a message according to an embodiment of the present invention. detailed description
为使本发明实施例的上述目的、 特征和优点能够更加明显易懂, 下面结 合附图和具体实施方式对本发明实施例作进一步详细的说明。  The above described objects, features, and advantages of the embodiments of the present invention will become more apparent and understood.
本发明实施例提供了一种网络设备, 如图 1所示, 所述网络设备 100包括多 个转发引擎 102, 所述网络设备 100还包括映射器 103和线卡 104。 线卡 104包 括物理接口, 例如千兆以太网 (英文: Gigabit Ethernet, 简称 GE) 接口、 E_ 载波第一级 (英文: first level of E-carrier, 简称 El ) 接口、 异步传输模 式 (英文: Asynchronous Transfer Mode, 简称 ATM) 接口等。 图 1所示网络设备 100, 以包括两个转发引擎作为示例, 所述网络设备 100 也可以包括两个以上的转发引擎。 图 1所示网络设备 100, 以包括两个线卡作为 示例, 所述网络设备 100也可以包括一个线卡, 所述网络设备 100也可以包括多 于两个线卡。 The embodiment of the present invention provides a network device. As shown in FIG. 1 , the network device 100 includes multiple forwarding engines 102. The network device 100 further includes a mapper 103 and a line card 104. The line card 104 includes a physical interface, such as a Gigabit Ethernet (GE) interface, an E_carrier first level (English: first level of E-carrier, referred to as El) interface, and an asynchronous transmission mode (English: Asynchronous Transfer Mode, referred to as ATM) interface. The network device 100 shown in FIG. 1 includes two forwarding engines as an example, and the network device 100 may also include more than two forwarding engines. The network device 100 shown in FIG. 1 is exemplified by two line cards. The network device 100 may also include a line card. The network device 100 may also include more than two line cards.
线卡 104用于把从物理接口接收到的报文发送到映射器 103; 以及把从映射 器 103接收到的报文, 从对应的物理接口发送出去。在一个线卡 104上的所有物 理接口各自有不同的标识。 物理接口的标识可以为接口号。 如果一个网络设备 100内有多个线卡 104, 则在不同线卡 104上的物理接口可以有相同的标识。 映 射器 103可以通过映射器 103和线卡 104间的连接区分不同线卡 104上有相同的 标识的物理接口。 可选的, 一个网络设备 100的所有物理接口可以被唯一标识。 例如所有物理接口可以被网络设备 100内全局唯一的接口号标识。  The line card 104 is for transmitting a message received from the physical interface to the mapper 103; and transmitting the message received from the mapper 103 from the corresponding physical interface. All physical interfaces on one line card 104 each have a different identification. The identifier of the physical interface can be the interface number. If there are multiple line cards 104 within a network device 100, the physical interfaces on the different line cards 104 may have the same identity. The mapper 103 can distinguish between physical interfaces having the same identification on different line cards 104 by the connection between the mapper 103 and the line card 104. Alternatively, all physical interfaces of a network device 100 can be uniquely identified. For example, all physical interfaces may be identified by a globally unique interface number within network device 100.
映射器 103, 用于根据转发引擎和物理接口之间的对应关系, 把来自线卡的 报文发送到对应的转发引擎 102; 还用于把来自转发引擎 102的报文发送到对应 的线卡 104。 所述映射器 103包括上行端口和下行端口; 上行端口为所述映射器 103连接转发引擎 102的端口, 例如图 1中所示端口 2A, 端口 2B; 下行端口为 所述映射器 103连接线卡 104的端口, 例如图 1中所示端口 4a, 端口 4b等。 可 以用所述映射器 103的下行端口的标识, 例如端口号, 来区分一个网络设备 100 上的多个线卡 104。 可选地, 将所述映射器 103的下行端口的标识作为线卡 104 的标识。  The mapper 103 is configured to send the packet from the line card to the corresponding forwarding engine 102 according to the correspondence between the forwarding engine and the physical interface, and is further configured to send the packet from the forwarding engine 102 to the corresponding line card. 104. The mapper 103 includes an uplink port and a downlink port; the uplink port is a port to which the mapper 103 is connected to the forwarding engine 102, such as port 2A and port 2B shown in FIG. 1, and the downlink port is a link line card of the mapper 103. Port 104, such as port 4a, port 4b, etc. shown in FIG. A plurality of line cards 104 on a network device 100 can be distinguished by an identification of a downstream port of the mapper 103, such as a port number. Optionally, the identifier of the downlink port of the mapper 103 is used as the identifier of the line card 104.
转发引擎 102用于转发报文; 具体地, 转发引擎 102将报文发送给其他转发 引擎处理, 或者将报文发送给所述映射器 103。 所述转发引擎 102中存储了转发 表。转发引擎 102根据存储的转发表, 将报文发送给其他转发引擎处理, 或者将 报文发送给所述映射器 103, 以发送到对应的线卡 104。 转发引擎 102还可以对 报文进行网络地址转换、 深度报文检测、 QoS等业务处理。  The forwarding engine 102 is configured to forward the message; specifically, the forwarding engine 102 sends the message to other forwarding engines for processing, or sends the message to the mapper 103. A forwarding table is stored in the forwarding engine 102. The forwarding engine 102 sends the message to other forwarding engines for processing according to the stored forwarding table, or sends the message to the mapper 103 for transmission to the corresponding line card 104. The forwarding engine 102 can also perform service processing such as network address translation, deep packet inspection, and QoS on the packet.
如图 2所示,所述网络设备 100还可以包括交换网(英文: switching fabric ) 芯片 101 ; 所述多个转发引擎 102之间通过所述交换网芯片 101相互连接。 转发 引擎 102具体通过交换网芯片 101, 将报文发送给其他转发引擎处理。 交换网芯 片 101, 用于对转发引擎之间的报文进行交换, 具体地, 把从一个转发引擎收到 的报文交换到另外一个转发引擎。  As shown in FIG. 2, the network device 100 may further include a switching fabric chip 101. The plurality of forwarding engines 102 are connected to each other through the switching network chip 101. The forwarding engine 102 sends the packet to other forwarding engines for processing, specifically through the switching network chip 101. The switching network chip 101 is configured to exchange packets between the forwarding engines, specifically, the packets received from one forwarding engine to another forwarding engine.
可选地,所述转发引擎和物理接口之间的对应关系为转发引擎的标识与物理 接口的标识之间的对应关系;所述转发引擎可以通过所述映射器 103的上行端口 的标识来标识, 即所述转发引擎的标识可以为所述映射器 103的上行端口的标 识。 Optionally, the correspondence between the forwarding engine and the physical interface is an identifier and a physical of the forwarding engine. Corresponding relationship between the identifiers of the interfaces; the forwarding engine may be identified by the identifier of the uplink port of the mapper 103, that is, the identifier of the forwarding engine may be an identifier of the uplink port of the mapper 103.
在一个可选的实现中,转发引擎和物理接口之间的对应关系可以静态配置在 所述映射器 103中。  In an alternative implementation, the correspondence between the forwarding engine and the physical interface can be statically configured in the mapper 103.
在另一个可选的实现中,所述映射器 103也可以动态获取转发引擎和物理接 口之间的对应关系。 如图 3所示, 所述网络设备 100还包括主控板 105, 用于获 取所述映射器 103的上行端口的标识和下行端口的标识。可选的, 主控板 105还 用于获取线卡 104的所有物理接口的标识。 主控板 105还可以用于获取线卡 104 的物理接口的参数。物理接口的参数包括物理接口的类型, 物理接口的带宽, 或 其组合。进一步地, 所述主控板 105还用于根据预定义的策略, 生成转发引擎和 物理接口之间的对应关系, 例如, 预定义的策略可以为基于业务配置, 物理接口 的带宽, 转发引擎的状态和转发引擎的负载情况中的一个或多个的策略。所述主 控板 105, 具体可用于根据预定义的策略, 所述映射器 103的上行端口的标识和 下行端口的标识, 以及线卡 104的所有物理接口的标识, 动态生成所述转发引擎 和物理接口之间的对应关系。 主控板 105, 还用于提供所述转发引擎和物理接口 之间的对应关系给映射器 103。  In another optional implementation, the mapper 103 can also dynamically obtain a correspondence between the forwarding engine and the physical interface. As shown in FIG. 3, the network device 100 further includes a main control board 105, configured to obtain an identifier of an uplink port of the mapper 103 and an identifier of a downlink port. Optionally, the main control board 105 is further configured to obtain identifiers of all physical interfaces of the line card 104. The main control board 105 can also be used to obtain parameters of the physical interface of the line card 104. The parameters of the physical interface include the type of the physical interface, the bandwidth of the physical interface, or a combination thereof. Further, the main control board 105 is further configured to generate a correspondence between the forwarding engine and the physical interface according to a predefined policy. For example, the predefined policy may be based on a service configuration, a bandwidth of a physical interface, and a forwarding engine. A policy of one or more of the status and forwarding engine load conditions. The main control board 105 is specifically configured to dynamically generate the forwarding engine according to a predefined policy, an identifier of an uplink port of the mapper 103, an identifier of a downlink port, and an identifier of all physical interfaces of the line card 104. Correspondence between physical interfaces. The main control board 105 is further configured to provide a correspondence between the forwarding engine and the physical interface to the mapper 103.
主控板 105与映射器 103之间, 主控板 105与转发引擎 102之间, 主控板 105与线卡 104之间, 可以通过总线或其他方式相连。  Between the main control board 105 and the mapper 103, between the main control board 105 and the forwarding engine 102, between the main control board 105 and the line card 104, it can be connected by bus or other means.
如图 4所示, 同一个线卡 104的所有物理接口可以分别连接所述映射器 103 的一个下行端口。映射器 103可以通过下行端口的标识区分各个物理接口。所述 物理接口的标识可以为所述映射器 103的下行端口的标识。例如, 表 1为图 4所 示的网络设备基于接口带宽得到的转发引擎和物理接口之间的对应关系, 其中, 转发引擎通过映射器 103的上行端口的标识来标识,物理接口通过映射器 103的 下行端口的标识来标识。  As shown in FIG. 4, all physical interfaces of the same line card 104 can be respectively connected to one downstream port of the mapper 103. The mapper 103 can distinguish the physical interfaces by the identity of the downstream port. The identifier of the physical interface may be an identifier of a downlink port of the mapper 103. For example, the correspondence between the forwarding engine and the physical interface obtained by the network device shown in FIG. 4 is based on the interface bandwidth. The forwarding engine is identified by the identifier of the uplink port of the mapper 103, and the physical interface passes through the mapper 103. The identity of the downstream port is identified.
表 1  Table 1
Figure imgf000010_0001
如图 5所示, 同一个线卡 104上的所有物理接口也可以连接到所述映射器 103的一个下行端口。 映射器 103可以通过下行端口的标识区分不同线卡 104上 有相同的标识, 例如接口号, 的物理接口。 线卡 104还包括接口处理芯片 1041, 用于维护该线卡 104的物理接口的信息, 例如, 物理接口的标识、物理接口的类 型、物理接口的带宽等。线卡 104的所有物理接口通过所述线卡 104的接口处理 芯片 1041连接所述映射器 103的一个下行端口。接口处理芯片 1041用于处理来 自所述线卡 104的各个物理接口的报文;还用于处理所述映射器 103发送到所述 线卡 104的各个物理接口的报文。 可选地, 所述接口处理芯片 1041还保存其所 连接的所述映射器 103的下行端口的标识; 相应地, 所述主控板 105, 还可用于 将所述下行端口的标识提供给所述接口处理芯片 1041。
Figure imgf000010_0001
As shown in FIG. 5, all physical interfaces on the same line card 104 can also be connected to one downstream port of the mapper 103. The mapper 103 can distinguish the physical interfaces of the different line cards 104 having the same identifier, such as the interface number, by the identifier of the downlink port. The line card 104 further includes an interface processing chip 1041 for maintaining information of the physical interface of the line card 104, for example, an identifier of the physical interface, a type of the physical interface, a bandwidth of the physical interface, and the like. All of the physical interfaces of the line card 104 are connected to a downstream port of the mapper 103 via the interface processing chip 1041 of the line card 104. The interface processing chip 1041 is configured to process messages from the physical interfaces of the line card 104; and is also used to process messages sent by the mapper 103 to the physical interfaces of the line card 104. Optionally, the interface processing chip 1041 further saves an identifier of a downlink port of the mapper 103 to which the mapper 103 is connected; correspondingly, the main control board 105 is further configured to provide the identifier of the downlink port to the The interface processing chip 1041.
接口处理芯片 1041, 具体用于对从物理接口收到的报文进行处理。 具体地, 线卡 104的接口处理芯片 1041为从所述线卡 104的物理接口收到的报文打上 (英 文: mark) 收到该报文的物理接口的标识。 所述接口处理芯片 1041还为所述报 文打上保存的所述映射器 103的下行端口的标识; 可替换的, 所述映射器 103为 从下行端口收到的报文打上收到该报文的下行端口的标识。  The interface processing chip 1041 is specifically configured to process the packet received from the physical interface. Specifically, the interface processing chip 1041 of the line card 104 marks the physical interface of the packet received from the physical interface of the line card 104 by receiving the message. The interface processing chip 1041 further adds the identifier of the downlink port of the mapper 103 saved to the packet. Alternatively, the mapper 103 receives the packet from the packet received from the downlink port. The identity of the downstream port.
接口处理芯片 1041, 具体还用于对来自映射器 103的报文进行处理, 所述 报文中包括物理接口的标识。可选地, 所述报文中还包括下行端口的标识。 具体 地, 线卡 104的接口处理芯片 1041从来自映射器 103的报文中去除物理接口的 标识, 可选地, 还去除下行端口的标识; 并根据所述物理接口的标识将所述报文 从所述物理接口发送出去。  The interface processing chip 1041 is further configured to process the packet from the mapper 103, where the packet includes an identifier of the physical interface. Optionally, the packet further includes an identifier of the downlink port. Specifically, the interface processing chip 1041 of the line card 104 removes the identifier of the physical interface from the packet from the mapper 103, and optionally removes the identifier of the downlink port, and sends the packet according to the identifier of the physical interface. Sent from the physical interface.
进一步地, 线卡 104的接口处理芯片 1041还可用于对报文进行速率匹配、 复用 /解复用、 协议转换等处理。  Further, the interface processing chip 1041 of the line card 104 can also be used for performing rate matching, multiplexing/demultiplexing, protocol conversion, and the like on the message.
例如,表 2为图 5所示网络设备基于接口带宽得到的转发引擎和物理接口之 间的对应关系, 转发引擎通过映射器 103的上行端口的标识来标识, 物理接口通 过映射器 103的下行端口的标识和物理接口的标识的组合来标识。  For example, Table 2 is the correspondence between the forwarding engine and the physical interface obtained by the network device shown in FIG. 5 based on the interface bandwidth. The forwarding engine is identified by the identifier of the uplink port of the mapper 103, and the physical interface passes through the downlink port of the mapper 103. The combination of the identity and the identity of the physical interface is identified.
表 2 Table 2
Figure imgf000011_0001
Elc + 4b 2B
Figure imgf000011_0001
Elc + 4b 2B
Eld + 4b 2B  Eld + 4b 2B
GE1 + 4c 2A  GE1 + 4c 2A
GE2 + 4c 2B  GE2 + 4c 2B
GE3 + 4c 2B 图 5和表 2以网络设备 100的不同线卡 104上物理接口有相同的标识为示意, 当然, 对于网络设备 100上的所有物理接口可以唯一标识的情况也同样适用。可 选地, 对于网络设备 100的所有物理接口可以唯一标识的情况, 所述转发引擎和 物理接口之间的对应关系中, 所述物理接口也可以仅通过物理接口的标识来标 识。  GE3 + 4c 2B Figure 5 and Table 2 show the same physical interfaces on the different line cards 104 of the network device 100. Of course, the same applies to all physical interfaces on the network device 100 that can be uniquely identified. Optionally, in a case where all the physical interfaces of the network device 100 can be uniquely identified, in the correspondence between the forwarding engine and the physical interface, the physical interface may also be identified only by the identifier of the physical interface.
如果一个网络设备 100内有多个线卡 104, 不同线卡 104上的物理接口可以 通过不同的方式连接所述映射器 103。 例如, 一个线卡的所有物理接口各自连接 所述映射器 103的一个下行端口,另一个线卡的所有物理接口通过该线卡的接口 处理芯片连接到所述映射器的一个下行端口。  If there are multiple line cards 104 within a network device 100, the physical interfaces on the different line cards 104 can be connected to the mapper 103 in different ways. For example, all of the physical interfaces of one line card are each connected to one downstream port of the mapper 103, and all physical interfaces of the other line card are connected to a downstream port of the mapper through the interface processing chip of the line card.
本发明实施例提供的网络设备, 把转发引擎从线卡上剥离出来, 可以将物理 接口和转发引擎解耦合, 实现多个转发引擎的集中管理和调度。通过映射器实现 物理接口和转发引擎之间的动态映射,可以增加物理接口和转发引擎配置的灵活 性, 提高网络设备的转发性能。  The network device provided by the embodiment of the present invention decouples the forwarding engine from the line card, and decouples the physical interface and the forwarding engine to implement centralized management and scheduling of multiple forwarding engines. The dynamic mapping between the physical interface and the forwarding engine is implemented by the mapper, which increases the flexibility of the configuration of the physical interface and the forwarding engine, and improves the forwarding performance of the network device.
所述网络设备 100包括路由器, 交换机等。  The network device 100 includes a router, a switch, and the like.
进一步地, 基于接口带宽生成的转发引擎和物理接口之间的对应关系, 可能 会导致多个转发引擎负担不一样。对来自不同类型的物理接口的报文, 所做处理 的复杂度通常是不一样的, 例如, GE接口的报文可能只需要路由转发处理, 而 E1接口的报文可能需要做深度报文检测、 防火墙、 QoS等复杂业务处理。还可以 基于转发引擎的负载情况, 动态调整转发引擎和物理接口之间的对应关系。具体 地, 用一张转发引擎负载表, 记录各个转发引擎的负载情况; 转发引擎负载表可 以由所述主控板 105维护, 各个转发引擎可以定期上报负载情况, 也可以由主控 板 105主动查询各个转发引擎的负载情况。进一步地, 还可以跟踪转发引擎的负 载情况, 例如定期记录转发引擎的负载, 形成历史日志; 如果所有转发引擎长期 都处于高负载, 表示转发资源不足, 可以增加转发引擎; 或者如果转发引擎长期 都处于低负载, 表示转发资源过剩, 可以减少转发引擎。  Further, the correspondence between the forwarding engine and the physical interface generated based on the interface bandwidth may cause different forwarding engines to have different burdens. The processing complexity of packets from different types of physical interfaces is usually different. For example, the packets of the GE interface may only need to be forwarded by the route, and the packets of the E1 interface may need to be used for deep packet inspection. Complex traffic processing such as firewalls and QoS. The correspondence between the forwarding engine and the physical interface can be dynamically adjusted based on the load of the forwarding engine. Specifically, a forwarding engine load table is used to record the load status of each forwarding engine; the forwarding engine load table can be maintained by the main control board 105, and each forwarding engine can periodically report the load status, or can be actively initiated by the main control board 105. Query the load status of each forwarding engine. Further, the load of the forwarding engine may be tracked, for example, the load of the forwarding engine is periodically recorded to form a historical log. If all the forwarding engines are in a high load for a long time, indicating that the forwarding resources are insufficient, the forwarding engine may be added; or if the forwarding engine is long-term At low load, it means that there is excess forwarding resources, which can reduce the forwarding engine.
进一步地, 本发明提供的网络设备, 通过集中管理和调度多个转发引擎, 可 以基于业务需求, 例如接口捆绑 (英文: Link aggregation) 的限速, 得到转发 引擎和物理接口之间的对应关系。 具体地, 可以用一张接口捆绑关系表, 记录物 理接口和捆绑组的对应关系。接口捆绑关系表可以由所述主控板 105维护, 具体 可以根据业务需求提供给主控板 105。 这样在生成转发引擎和物理接口之间的对 应关系时,可以根据接口捆绑关系表,将一个捆绑组与一个转发引擎对应。例如, 表 3为本发明实施例图 5所示的网络设备 100的接口捆绑关系表。 Further, the network device provided by the present invention can centrally manage and schedule multiple forwarding engines. The correspondence between the forwarding engine and the physical interface is obtained based on the service demand, such as the rate limit of the interface aggregation. Specifically, the relationship table between the physical interface and the bundle group may be recorded by using an interface binding relationship table. The interface binding relationship table may be maintained by the main control board 105, and may be provided to the main control board 105 according to service requirements. When a mapping between the forwarding engine and the physical interface is generated, a binding group can be associated with a forwarding engine according to the interface binding relationship table. For example, Table 3 is an interface binding relationship table of the network device 100 shown in FIG. 5 according to an embodiment of the present invention.
表 3 table 3
Figure imgf000013_0001
进一步地, 本发明实施例所述的网络设备, 当一个转发引擎发生故障时, 可 以将该转发引擎负责的所有物理接口, 切换到其他转发引擎上。 具体地, 可以用 一张转发引擎状态表, 记录各个转发引擎的状态, 例如, 转发引擎的状态包括正 常 (或称为工作), 故障, 停机 (或称为下电) 等; 转发引擎状态表可以由所述 主控板 105维护,各个转发引擎可以定期上报状态,或者在状态发生变化时上报, 或者也可以由主控板 105主动查询各个转发引擎的状态。可以将发生故障的转发 引擎负责的所有接口切换到任意一个或多个处于正常状态的转发引擎上;进一步 地, 还可以结合转发引擎的负载状态, 切换到处于正常状态且负载较轻的转发引 擎上。可选地,如果所有转发引擎的状态均不是正常,可以发出告警。进一步地, 也可以预先设置主用转发引擎和备用转发引擎,通过主备保护的方式提高系统可 靠性; 具体地, 可以设置专门的备用转发引擎, 在主转发引擎正常工作时, 备用 转发引擎不工作, 例如处于下电状态; 在主转发引擎发生故障时, 备用转发引擎 才进入工作状态。当然,也可以多个转发引擎之间互为主备,用一张主备关系表, 记录转发引擎之间的主备关系, 以提高转发引擎的利用率。
Figure imgf000013_0001
Further, in the network device of the embodiment of the present invention, when a forwarding engine fails, all the physical interfaces that the forwarding engine is responsible for may be switched to other forwarding engines. Specifically, a forwarding engine status table may be used to record the status of each forwarding engine. For example, the status of the forwarding engine includes normal (or called work), failure, shutdown (or called power-off), etc.; forwarding engine status table It can be maintained by the main control board 105. Each forwarding engine can report the status periodically, or report the status when the status changes. Alternatively, the main control board 105 can actively query the status of each forwarding engine. All interfaces responsible for the failed forwarding engine can be switched to any one or more forwarding engines in a normal state; further, the forwarding engine of the forwarding engine can be switched to the forwarding engine with a normal state and a light load. on. Optionally, an alert can be issued if the status of all forwarding engines is not normal. Further, the primary forwarding engine and the standby forwarding engine may be configured in advance to improve system reliability by means of active/standby protection. Specifically, a dedicated backup forwarding engine may be set. When the primary forwarding engine works normally, the standby forwarding engine does not. Work, for example, in a powered-off state; when the primary forwarding engine fails, the standby forwarding engine enters a working state. Of course, multiple forwarding engines can be used as the primary and backup devices, and an active/standby relationship table is used to record the primary and backup relationships between the forwarding engines to improve the utilization of the forwarding engine.
如果一个转发引擎发生故障,可以将负责的接口切换到其他转发引擎或备用 转发引擎, 并由主控板 105更新所述转发引擎和物理接口之间的对应关系, 并提 供给映射器 103, 从而可以避免转发引擎故障导致物理接口无法工作。 当该转发 引擎故障恢复后,可以再将负责的物理接口从其他转发引擎或备用转发引擎切回 该转发引擎, 由主控板 105更新所述转发引擎和物理接口之间的对应关系, 并提 供给映射器 103。 If a forwarding engine fails, the responsible interface can be switched to another forwarding engine or an alternate forwarding engine, and the corresponding relationship between the forwarding engine and the physical interface is updated by the main control board 105 and provided to the mapper 103. You can avoid the forwarding engine failure and the physical interface will not work. When the forwarding After the engine is faulty, the responsible physical interface can be switched back to the forwarding engine from the other forwarding engine or the standby forwarding engine, and the corresponding relationship between the forwarding engine and the physical interface is updated by the main control board 105 and provided to the mapper. 103.
所述映射器 103可以用硬件实现, 例如专用集成电路 (英文:  The mapper 103 can be implemented in hardware, such as an application specific integrated circuit (English:
appl ication-specific integrated circuit, 简称 ASIC), 网络处理器 (network processor, 简称 NP) , 现场可编程门阵列 (FPGA), 或者其他可编程逻辑器件。 Appl ication-specific integrated circuit (ASIC), network processor (NP), field programmable gate array (FPGA), or other programmable logic device.
所述映射器 103也可以通过软件结合硬件的形式实现, 例如所述映射器 103 包括处理器 1031、存储器 1032和通信端口 1033,所述处理器 1031、存储器 1032 和通信端口 1033可以通过总线或其他方式相互连接。所述存储器 1032用于存放 程序。 具体地, 程序可以包括程序代码, 所述程序代码包括计算机操作指令。 存 储器 1032可能包含随机存取存储器 (random-access memory, 简称 RAM) , 也 可能还包括非易失性存储器 (non-volati le memory) 。 所述处理器 1031可以是 中央处理器 ( central processing unit, 简称 CPU) 。  The mapper 103 can also be implemented by software in combination with hardware. For example, the mapper 103 includes a processor 1031, a memory 1032, and a communication port 1033, and the processor 1031, the memory 1032, and the communication port 1033 can be connected via a bus or the like. Ways to connect to each other. The memory 1032 is used to store programs. In particular, the program can include program code, the program code including computer operating instructions. The memory 1032 may include random-access memory (RAM) and may also include non-volati le memory. The processor 1031 may be a central processing unit (CPU).
所述通信端口 1033包括上行端口用于与转发引擎通信,例如可以是 10GE接 口;所述通信端口 1033还包括下行端口,用于与线卡通信,例如可以是 GE接口。  The communication port 1033 includes an uplink port for communicating with a forwarding engine, such as a 10GE interface, and the communication port 1033 further includes a downlink port for communicating with a line card, such as a GE interface.
所述转发引擎和物理接口之间的对应关系可以保存在所述存储器 1032中。 所述转发引擎和物理接口之间的对应关系也可以保存在所述处理器的缓存中。  The correspondence between the forwarding engine and the physical interface may be stored in the memory 1032. The correspondence between the forwarding engine and the physical interface may also be saved in the cache of the processor.
本发明实施例提供的网络设备, 把转发引擎从线卡上剥离出来, 可以增加物 理接口和转发引擎配置的灵活性; 且可以实现多个转发引擎的集中管理和调度, 避免转发引擎的能力不足或过剩, 提高了网络设备的转发性能; 此外, 转发引擎 之间还可以互为备份, 一个转发引擎故障, 可以由其他转发引擎接替其工作, 不 会使接口无法工作而引发网络故障, 从而提高系统可靠性。  The network device provided by the embodiment of the present invention can separate the forwarding engine from the line card, and can increase the flexibility of physical interface and forwarding engine configuration; and can implement centralized management and scheduling of multiple forwarding engines to avoid insufficient forwarding engine capability. Or excess, improve the forwarding performance of network devices; In addition, the forwarding engines can also be backups of each other, one forwarding engine is faulty, and other forwarding engines can take over their work, and the interface will not work, causing network failure, thereby improving System reliability.
本发明图 1至图 5任一所示的网络设备 100中, 仅示出了一个映射器, 当然 也可以设置两个映射器实现主备保护, 负载均衡等功能, 以保证所述网络设备 100的可靠性和转发性能。  In the network device 100 shown in any of FIG. 1 to FIG. 5, only one mapper is shown. Of course, two mappers may be configured to implement functions such as active/standby protection and load balancing to ensure the network device 100. Reliability and forwarding performance.
本发明实施例中, 网络设备 100的转发引擎与线卡可以是一对一的关系, 也 可以是多对一的关系, 也可以是一对多的关系, 具体可以根据所述网络设备 100 的应用场景、 用户需求等进行配置, 本发明对此不作限定。  In the embodiment of the present invention, the forwarding engine and the line card of the network device 100 may be in a one-to-one relationship, or may be a one-to-one relationship, or may be a one-to-many relationship, which may be specifically according to the network device 100. The configuration is not limited by the present invention.
参见图 6, 本发明实施例提供了一种转发报文的方法, 可用于如本发明图 5 所示的网络设备中。 所述方法包括: 601、 第一线卡从所述第一线卡的第一物理接口接收第一报文, 为所述第一 报文打上(英文: mark)所述第一物理接口的标识, 得到第二报文; 将所述第二 报文发送给映射器; Referring to FIG. 6, an embodiment of the present invention provides a method for forwarding a message, which can be used in a network device as shown in FIG. 5 of the present invention. The method includes: 601. The first line card receives the first packet from the first physical interface of the first line card, and marks the first packet with the identifier of the first physical interface, and obtains the second report. Sending the second packet to the mapper;
具体地,所述第一线卡的接口处理芯片为所述第一报文打上所述第一物理接 口的标识, 例如接口号, 得到所述第二报文; 并将所述第二报文发送给映射器。  Specifically, the interface processing chip of the first line card adds an identifier of the first physical interface, such as an interface number, to the first packet, to obtain the second packet, and the second packet. Sent to the mapper.
所述第二报文中包括所述第一物理接口的标识。  The second packet includes an identifier of the first physical interface.
可选地, 在对所述第一报文打上所述第一物理接口的标识之前, 所述第一线 卡的接口处理模块还对所述对报文进行复用, 协议转换等处理。  Optionally, before the marking of the first physical interface is performed on the first packet, the interface processing module of the first line card further performs multiplexing, protocol conversion, and the like on the pair of packets.
602、 所述映射器根据转发引擎和物理接口之间的对应关系, 将所述第二报 文发送给第一转发引擎;  602. The mapper sends the second packet to the first forwarding engine according to the correspondence between the forwarding engine and the physical interface.
具体地, 所述映射器从第一下行端口接收所述第二报文, 根据所述转发引擎 和物理接口之间的对应关系, 将所述第二报文发送到第一转发引擎。  Specifically, the mapper receives the second packet from the first downlink port, and sends the second packet to the first forwarding engine according to the correspondence between the forwarding engine and the physical interface.
第一种可能的实现方式中, 所述网络设备的所有物理接口可以唯一标识, 即 所述物理接口的标识在所述网络设备上全局唯一。所述转发引擎和物理接口之间 的对应关系为映射器的上行端口的标识和物理接口的标识的对应关系。所述映射 器可以根据所述第二报文中所述第一物理接口的标识,以及所述转发引擎和物理 接口之间的对应关系, 得到所述映射器的第一上行端口的标识, 所述第一上行端 口为所述映射器连接所述第一转发引擎的端口。所述映射器将所述第二报文从所 述第一上行端口发送给所述第一转发引擎。  In a first possible implementation manner, all the physical interfaces of the network device may be uniquely identified, that is, the identifier of the physical interface is globally unique on the network device. The correspondence between the forwarding engine and the physical interface is the correspondence between the identifier of the uplink port of the mapper and the identifier of the physical interface. The mapper may obtain the identifier of the first uplink port of the mapper according to the identifier of the first physical interface in the second packet, and the correspondence between the forwarding engine and the physical interface. The first uplink port is a port that the mapper connects to the first forwarding engine. The mapper sends the second packet from the first uplink port to the first forwarding engine.
第二种可能的实现方式中,所述转发引擎和物理接口之间的对应关系为映射 器的上行端口的标识, 与, 映射器的下行端口的标识和物理接口的标识的组合的 对应关系。所述映射器根据所述第二报文中所述第一物理接口的标识, 所述映射 器接收所述第二报文的第一下行端口的标识,以及所述转发引擎和物理接口之间 的对应关系, 得到所述映射器的第一上行端口的标识, 所述第一上行端口为所述 映射器连接所述第一转发引擎的端口。所述映射器为所述第二报文打上所述第一 下行端口的标识,并将打上所述第一下行端口的标识的第二报文从所述第一上行 端口发送给所述第一转发弓 I擎。  In a second possible implementation manner, the correspondence between the forwarding engine and the physical interface is a correspondence between the identifier of the uplink port of the mapper and the combination of the identifier of the downlink port of the mapper and the identifier of the physical interface. The mapper receives the identifier of the first downlink port of the second packet, and the forwarding engine and the physical interface according to the identifier of the first physical interface in the second packet. Corresponding relationship between the first uplink port of the mapper is obtained, and the first uplink port is a port that the mapper is connected to the first forwarding engine. The mapper sends the identifier of the first downlink port to the second packet, and sends a second packet marked with the identifier of the first downlink port from the first uplink port to the The first forward bow I engine.
第三种可能的实现方式中,所述转发引擎和物理接口之间的对应关系为映射 器的下行端口的标识与物理接口的标识的组合和映射器的上行端口的标识的对 应关系。在 601中, 所述第一线卡的接口处理芯片还为所述第一报文打上所述映 射器的第一下行端口的标识;所述映射器的第一下行端口为所述映射器连接所述 第一线卡的端口; 所述第一线卡的接口处理芯片存储了所述第一下行端口的标 识。所述第二报文中还包括所述第一下行端口的标识。所述映射器根据所述第二 报文, 和所述转发引擎和物理接口之间的对应关系, 得到所述映射器的第一上行 端口的标识, 所述第一上行端口为所述映射器连接所述第一转发引擎的端口。所 述映射器将所述第二报文从所述第一上行端口发送给所述第一转发引擎。 In a third possible implementation, the correspondence between the forwarding engine and the physical interface is a correspondence between a combination of the identifier of the downlink port of the mapper and the identifier of the physical interface and the identifier of the uplink port of the mapper. In 601, the interface processing chip of the first line card further performs the mapping on the first packet. An identifier of a first downlink port of the mapper; a first downlink port of the mapper is a port connecting the mapper to the first line card; an interface processing chip of the first line card stores the The identifier of the first downlink port. The second packet further includes an identifier of the first downlink port. Determining, by the mapper, the identifier of the first uplink port of the mapper according to the correspondence between the second packet and the forwarding engine and the physical interface, where the first uplink port is the mapper A port that connects to the first forwarding engine. The mapper sends the second packet from the first uplink port to the first forwarding engine.
603、 所述第一转发引擎转发所述第二报文;  603. The first forwarding engine forwards the second packet.
具体地, 所述第一转发引擎根据转发表, 转发所述第二报文。 如果所述第二 报文需要经过其他转发引擎处理, 则继续执行 604-605 ; 如果所述第二报文无需 再经过其他转发引擎处理, 则继续执行 606, 可以直接通过映射器发送到相应的 物理接口。  Specifically, the first forwarding engine forwards the second packet according to the forwarding table. If the second packet needs to be processed by another forwarding engine, continue to execute 604-605; if the second packet does not need to be processed by another forwarding engine, continue to execute 606, and may directly send it to the corresponding device through the mapper. Physical interface.
可选地, 所述第一转发引擎在转发所述第二报文之前, 对所述第二报文进行 网络地址转换、 深度报文检测、 QoS等业务处理。  Optionally, the first forwarding engine performs service processing such as network address translation, deep packet detection, and QoS on the second packet before forwarding the second packet.
所述网络设备的各个转发引擎都保存有转发表; 转发表由主控板生成, 并提 供给各个转发引擎。  Each forwarding engine of the network device stores a forwarding table; the forwarding table is generated by the main control board and provided to each forwarding engine.
604、 第二转发引擎接收所述第二报文, 对所述第二报文进行处理, 得到第 三报文; 将所述第三报文发送给所述映射器, 所述第三报文中包括第二物理接口 的标识;  604. The second forwarding engine receives the second packet, and processes the second packet to obtain a third packet. The third packet is sent to the mapper, where the third packet is sent. Including the identifier of the second physical interface;
具体地, 所述第二转发引擎根据转发表, 对所述第二报文进行转发处理, 还 可以进行网络地址转换、 深度报文检测、 QoS等业务处理, 得到第三报文; 并将 所述第三报文发送给所述映射器。  Specifically, the second forwarding engine performs forwarding processing on the second packet according to the forwarding table, and may perform service processing such as network address translation, deep packet detection, and QoS to obtain a third packet; The third message is sent to the mapper.
605、 所述映射器接收所述第三报文, 根据所述第二物理接口的标识发送所 述第三报文;  605. The mapper receives the third packet, and sends the third packet according to the identifier of the second physical interface.
对应 602中第一种可能的实现方式,所述映射器还包括下行端口和物理接口 的对应关系, 具体为所述映射器的下行端口的标识和物理接口的标识的对应关 系。所述映射器可以根据所述第二物理接口的标识, 所述下行端口和物理接口的 对应关系, 得到所述映射器的第二下行端口的标识, 并将所述第三报文从所述第 二下行端口发送到所述第二物理接口。具体地, 所述映射器将所述第三报文发送 给第二线卡的接口处理芯片, 所述第二物理接口位于所述第二线卡上。所述第二 线卡的接口处理芯片从所述第三报文中去除所述第二物理接口的标识,得到第四 报文, 并将所述第四报文发送到所述第二物理接口。 Corresponding to the first possible implementation manner of the 602, the mapper further includes a correspondence between the downlink port and the physical interface, and is specifically a correspondence between the identifier of the downlink port of the mapper and the identifier of the physical interface. The mapper may obtain the identifier of the second downlink port of the mapper according to the identifier of the second physical interface, the correspondence between the downlink port and the physical interface, and obtain the third packet from the The second downlink port is sent to the second physical interface. Specifically, the mapper sends the third packet to an interface processing chip of the second line card, where the second physical interface is located on the second line card. The interface processing chip of the second line card removes the identifier of the second physical interface from the third packet, and obtains a fourth Transmitting the fourth packet to the second physical interface.
对应 602中第二种可能的实现方式,所述第三报文中还包括所述映射器的第 二下行端口的标识, 所述映射器从所述第三报文中去除所述第二下行端口的标 识, 得到第四报文, 并将所述第四报文从所述第二下行端口发送到所述第二物理 接口。具体地, 将所述第四报文从所述第二下行端口发送给第二线卡的接口处理 芯片, 所述第二物理接口位于所述第二线卡上。所述第二线卡的接口处理芯片从 所述第四报文中去除所述第二物理接口的标识, 得到第五报文, 并将所述第五报 文发送到所述第二物理接口。  Corresponding to the second possible implementation of the 602, the third packet further includes an identifier of the second downlink port of the mapper, where the mapper removes the second downlink from the third packet The identifier of the port is obtained, and the fourth packet is sent, and the fourth packet is sent from the second downlink port to the second physical interface. Specifically, the fourth packet is sent from the second downlink port to an interface processing chip of the second line card, where the second physical interface is located on the second line card. The interface processing chip of the second line card removes the identifier of the second physical interface from the fourth packet, obtains a fifth packet, and sends the fifth packet to the second physical interface.
对应 602中第三种可能的实现方式,所述第三报文中还包括所述映射器的第 二下行端口的标识, 所述映射器根据所述第三报文中所述第二下行端口的标识, 将所述第三报文从所述第二下行端口发送给所述第二物理接口。具体地, 所述映 射器将所述第三报文发送给第二线卡的接口处理芯片,所述第二物理接口位于所 述第二线卡上。所述第二线卡的接口处理芯片, 从所述第三报文中去除所述第二 下行端口的标识和所述第二物理接口的标识, 得到第四报文, 并将所述第四报文 发送到所述第二物理接口。  Corresponding to the third possible implementation manner of the 602, the third packet further includes an identifier of the second downlink port of the mapper, where the mapper is configured according to the second downlink port in the third packet The identifier is sent from the second downlink port to the second physical interface. Specifically, the mapper sends the third packet to an interface processing chip of the second line card, where the second physical interface is located on the second line card. The interface processing chip of the second line card removes the identifier of the second downlink port and the identifier of the second physical interface from the third packet, to obtain a fourth packet, and the fourth packet The text is sent to the second physical interface.
606、 所述映射器从第一上行端口接收所述第二报文, 所述第二报文中包括 第二物理接口的标识; 根据所述第二物理接口的标识发送所述第二报文。  606. The mapper receives the second packet from the first uplink port, where the second packet includes an identifier of the second physical interface, and sends the second packet according to the identifier of the second physical interface. .
对应 602中第一种可能的实现方式,所述映射器还包括下行端口和物理接口 的对应关系, 具体为所述映射器的下行端口的标识和物理接口的标识的对应关 系。所述映射器可以根据所述第二物理接口的标识, 所述下行端口和物理接口的 对应关系, 得到所述映射器的第二下行端口的标识, 并将所述第二报文从所述第 二下行端口发送到所述第二物理接口。具体地, 所述映射器将所述第二报文发送 给第二线卡的接口处理芯片, 所述第二物理接口位于所述第二线卡上。所述第二 线卡的接口处理芯片从所述第二报文中去除所述第二物理接口的标识,得到第三 报文, 并将所述第三报文从所述第二物理接口发送出去。  Corresponding to the first possible implementation manner of the 602, the mapper further includes a correspondence between the downlink port and the physical interface, which is specifically a correspondence between the identifier of the downlink port of the mapper and the identifier of the physical interface. The mapper may obtain an identifier of the second downlink port of the mapper according to the identifier of the second physical interface, the correspondence between the downlink port and the physical interface, and obtain the second packet from the The second downlink port is sent to the second physical interface. Specifically, the mapper sends the second packet to an interface processing chip of the second line card, where the second physical interface is located on the second line card. The interface processing chip of the second line card removes the identifier of the second physical interface from the second packet, obtains a third packet, and sends the third packet from the second physical interface. .
对应 602中第二种可能的实现方式,所述第二报文中还包括所述映射器的第 二下行端口的标识, 所述映射器从所述第二报文中去除所述第二下行端口的标 识, 得到第三报文, 并将所述第三报文从所述第二下行端口发送到所述第二物理 接口。具体地, 将所述第三报文从所述第二下行端口发送给第二线卡的接口处理 芯片, 所述第二物理接口位于所述第二线卡上。所述第二线卡的接口处理芯片从 所述第三报文中去除所述第二物理接口的标识, 得到第四报文, 并将所述第四报 文从所述第二物理接口发送出去。 Corresponding to the second possible implementation of the 602, the second packet further includes an identifier of the second downlink port of the mapper, where the mapper removes the second downlink from the second packet The identifier of the port is obtained, and the third packet is sent, and the third packet is sent from the second downlink port to the second physical interface. Specifically, the third packet is sent from the second downlink port to an interface processing chip of the second line card, where the second physical interface is located on the second line card. The interface card of the second line card is processed from the chip The third packet is removed from the identifier of the second physical interface, and the fourth packet is obtained, and the fourth packet is sent out from the second physical interface.
对应 602中第三种可能的实现方式,所述第二报文中还包括所述映射器的第 二下行端口的标识, 所述映射器根据所述第二报文中所述第二下行端口的标识, 将所述第二报文从所述第二下行端口发送给所述第二物理接口。具体地, 所述映 射器将所述第二报文发送给第二线卡的接口处理芯片,所述第二物理接口位于所 述第二线卡上。所述第二线卡的接口处理芯片, 从所述第二报文中去除所述第二 下行端口的标识和所述第二物理接口的标识, 得到第三报文, 并将所述第三报文 从所述第二物理接口发送出去。  Corresponding to the third possible implementation manner of the 602, the second packet further includes an identifier of the second downlink port of the mapper, where the mapper is configured according to the second downlink port in the second packet The identifier is sent from the second downlink port to the second physical interface. Specifically, the mapper sends the second packet to an interface processing chip of the second line card, where the second physical interface is located on the second line card. The interface processing chip of the second line card removes the identifier of the second downlink port and the identifier of the second physical interface from the second packet, to obtain a third packet, and the third packet The text is sent out from the second physical interface.
本实施例中, 所述第一线卡和所述第二线卡可以为同一线卡。所述第一下行 端口可以与所述第二下行端口为同一端口。  In this embodiment, the first line card and the second line card may be the same line card. The first downlink port may be the same port as the second downlink port.
本发明实施例提供的转发报文的方法, 把转发引擎从线卡上剥离出来, 可以 增加物理接口和转发引擎配置的灵活性;且可以实现多个转发引擎的集中管理和 调度, 避免转发引擎的能力不足或过剩, 提高了网络设备的转发性能; 此外, 转 发引擎之间还可以互为备份, 一个转发引擎故障, 可以由其他转发引擎接替其工 作, 不会使接口无法工作而引发网络故障, 从而提高系统可靠性。 参见图 7, 为本发明实施例提供的另一种转发报文的方法, 可用于如本发明 图 4所示的网络设备中。 所述方法包括:  The method for forwarding a packet according to the embodiment of the present invention, the stripping of the forwarding engine from the line card can increase the flexibility of the physical interface and the forwarding engine configuration; and can implement centralized management and scheduling of multiple forwarding engines to avoid the forwarding engine. Insufficient or excessive capacity, improve the forwarding performance of network devices; In addition, the forwarding engines can also backup each other, a forwarding engine failure, can be replaced by other forwarding engines, will not make the interface unable to work and cause network failure , thereby improving system reliability. FIG. 7 is another method for forwarding a message according to an embodiment of the present invention, which can be used in a network device as shown in FIG. 4 of the present invention. The method includes:
701、 第一线卡的第一物理接口接收第一报文, 将所述第一报文发送给映射 器;  701. The first physical interface of the first line card receives the first packet, and sends the first packet to the mapper.
具体地,所述第一物理接口将所述第一报文从所述映射器的第一下行端口发 送给所述映射器; 所述第一下行端口为所述第一物理接口连接所述映射器的端 曰。  Specifically, the first physical interface sends the first packet from the first downlink port of the mapper to the mapper; the first downlink port is the first physical interface connection The end of the mapper.
702、 所述映射器根据转发引擎和物理接口之间的对应关系, 处理所述第一 报文, 得到第二报文, 并将所述第二报文发送给第一转发引擎;  702. The mapper processes the first packet according to the correspondence between the forwarding engine and the physical interface, and obtains the second packet, and sends the second packet to the first forwarding engine.
具体地, 所述映射器从第一下行端口接收所述第一报文, 根据所述第一下行 端口的标识, 以及所述转发引擎和物理接口之间的对应关系, 得到第一上行端口 的标识, 所述第一上行端口为所述映射器连接所述第一转发引擎的端口。所述映 射器为所述第一报文打上(mark)所述第一上行端口的标识, 得到第二报文, 并 将所述第二报文从所述第一上行端口发送给所述第一转发引擎。 Specifically, the mapper receives the first packet from the first downlink port, and obtains the first uplink according to the identifier of the first downlink port and the correspondence between the forwarding engine and the physical interface. The identifier of the port, where the first uplink port is a port that the mapper connects to the first forwarding engine. The mapper marks the first packet with the identifier of the first uplink port, and obtains a second packet, and Sending the second packet from the first uplink port to the first forwarding engine.
所述转发引擎和物理接口之间的对应关系为所述映射器的上行端口的标识 和所述映射器的下行端口的标识的对应关系, 其中, 所述映射器的上行端口的标 识用于标识转发引擎, 所述映射器的下行端口的标识用于标识物理接口。  The correspondence between the forwarding engine and the physical interface is the correspondence between the identifier of the uplink port of the mapper and the identifier of the downlink port of the mapper, where the identifier of the uplink port of the mapper is used to identify The forwarding engine, whose identifier of the downlink port of the mapper is used to identify the physical interface.
703、 所述第一转发引擎转发所述第二报文;  703. The first forwarding engine forwards the second packet.
具体地, 所述第一转发引擎根据转发表, 转发所述第二报文。 如果所述第二 报文需要经过其他转发引擎处理, 则继续执行 704-705 ; 如果所述第二报文无需 再经过其他转发引擎处理, 则继续执行 706, 可以直接通过映射器发送到相应的 物理接口。  Specifically, the first forwarding engine forwards the second packet according to the forwarding table. If the second packet needs to be processed by another forwarding engine, continue to perform 704-705; if the second packet does not need to be processed by another forwarding engine, continue to execute 706, and may directly send it to the corresponding device through the mapper. Physical interface.
可选地, 所述第一转发引擎在转发所述第二报文之前, 对所述第二报文进行 网络地址转换、 深度报文检测、 QoS等业务处理。  Optionally, the first forwarding engine performs service processing such as network address translation, deep packet detection, and QoS on the second packet before forwarding the second packet.
所述网络设备的各个转发引擎都保存有转发表; 转发表由主控板生成, 并提 供给各个转发引擎。  Each forwarding engine of the network device stores a forwarding table; the forwarding table is generated by the main control board and provided to each forwarding engine.
704、 第二转发引擎接收所述第二报文, 对所述第二报文进行处理, 得到第 三报文; 将所述第三报文发送给所述映射器, 所述第三报文中包括第二物理接口 的标识;  704. The second forwarding engine receives the second packet, and processes the second packet to obtain a third packet. The third packet is sent to the mapper, where the third packet is sent. Including the identifier of the second physical interface;
所述第二物理接口的标识为所述映射器的第二下行端口的标识;所述第二下 行端口为所述第二物理接口连接所述映射器的端口。  The identifier of the second physical interface is an identifier of a second downlink port of the mapper; and the second downlink port is a port of the second physical interface that is connected to the mapper.
具体地, 所述第二转发引擎根据转发表, 对所述第二报文进行转发处理, 还 可以进行网络地址转换、 深度报文检测、 QoS等业务处理, 得到第三报文; 并将 所述第三报文发送给所述映射器。  Specifically, the second forwarding engine performs forwarding processing on the second packet according to the forwarding table, and may perform service processing such as network address translation, deep packet detection, and QoS to obtain a third packet; The third message is sent to the mapper.
705、 所述映射器接收所述第三报文, 根据所述第二物理接口的标识将所述 第三报文发送到所述第二物理接口;  705. The mapper receives the third packet, and sends the third packet to the second physical interface according to the identifier of the second physical interface.
具体地, 所述映射器将所述第二物理接口的标识从所述第三报文中去除, 得 到第四报文; 根据所述第二物理接口的标识, 将所述第四报文从所述第二下行端 口发送给所述第二物理接口。  Specifically, the mapper removes the identifier of the second physical interface from the third packet to obtain a fourth packet, and according to the identifier of the second physical interface, the fourth packet is removed from the fourth packet. The second downlink port is sent to the second physical interface.
706、 所述映射器从第一上行端口接收所述第二报文, 所述第二报文中包括 第二物理接口的标识; 根据所述第二物理接口的标识发送所述第二报文;  706. The mapper receives the second packet from the first uplink port, where the second packet includes an identifier of the second physical interface, and sends the second packet according to the identifier of the second physical interface. ;
所述第二物理接口的标识为所述映射器的第二下行端口的标识;所述第二下 行端口为所述第二物理接口连接所述映射器的端口。 具体地, 所述映射器将所述第二物理接口的标识从所述第二报文中去除, 得 到第三报文; 根据所述第二物理接口的标识, 将所述第三报文从所述第二下行端 口发送给所述第二物理接口。 The identifier of the second physical interface is an identifier of a second downlink port of the mapper; and the second downlink port is a port of the second physical interface that is connected to the mapper. Specifically, the mapper removes the identifier of the second physical interface from the second packet to obtain a third packet, and according to the identifier of the second physical interface, the third packet is The second downlink port is sent to the second physical interface.
以上所述, 仅为本发明较佳的具体实施方式, 但本发明的保护范围并不局限 于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易想到 的变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明的保护范围应 该以权利要求的保护范围为准。  The above is only a preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or within the technical scope disclosed by the present invention. Alternatives are intended to be covered by the scope of the present invention. Therefore, the scope of the invention should be determined by the scope of the claims.

Claims

权 利 要 求 Rights request
1、 一种网络设备, 其特征在于, 包括多个转发引擎, 映射器和线卡; 所述线卡包括物理接口; 1. A network device, characterized in that it includes multiple forwarding engines, mappers and line cards; the line cards include physical interfaces;
所述映射器包括上行端口和下行端口;上行端口为所述映射器连接转发引擎 的端口; 下行端口为所述映射器连接所述线卡的端口; The mapper includes an uplink port and a downlink port; the uplink port is the port through which the mapper connects to the forwarding engine; the downlink port is the port through which the mapper connects to the line card;
所述线卡, 用于将从物理接口接收到的报文发送到所述映射器; 还用于将从 所述映射器接收到的报文从对应的物理接口发送出去; The line card is used to send messages received from the physical interface to the mapper; and is also used to send messages received from the mapper out of the corresponding physical interface;
所述映射器, 用于根据转发引擎和物理接口之间的对应关系, 把来自物理接 口的报文发送到对应的转发引擎;还用于把来自转发引擎的报文发送到对应的物 理接口; The mapper is used to send messages from the physical interface to the corresponding forwarding engine according to the corresponding relationship between the forwarding engine and the physical interface; and is also used to send messages from the forwarding engine to the corresponding physical interface;
转发引擎, 用于转发报文。 Forwarding engine, used to forward messages.
2、 根据权利要求 1所述的网络设备, 其特征在于, 所述转发引擎的标识为 所述映射器的上行端口的标识。 2. The network device according to claim 1, wherein the identifier of the forwarding engine is the identifier of the uplink port of the mapper.
3、 根据权利要求 1或 2所述的网络设备, 其特征在于, 所述映射器还用于 动态获取所述转发引擎和物理接口之间的对应关系。 3. The network device according to claim 1 or 2, characterized in that the mapper is also used to dynamically obtain the correspondence between the forwarding engine and the physical interface.
4、 根据权利要求 3所述的网络设备, 其特征在于, 还包括主控板, 用于获 取所述映射器的上行端口的标识和下行端口的标识; 根据预定义的策略, 生成所 述转发引擎和物理接口之间的映射关系, 并提供给所述映射器。 4. The network device according to claim 3, further comprising a main control board for obtaining the identifier of the uplink port and the identifier of the downlink port of the mapper; generating the forwarding according to a predefined policy The mapping relationship between the engine and the physical interface is provided to the mapper.
5、 根据权利要求 4所述的网络设备, 其特征在于, 所述预定义的策略包括 基于业务配置, 物理接口的带宽, 转发引擎的状态和转发引擎的负载情况中一个 或多个的策略。 5. The network device according to claim 4, characterized in that the predefined policy includes one or more policies based on service configuration, bandwidth of the physical interface, status of the forwarding engine and load condition of the forwarding engine.
6、 根据权利要求 1至 5任一项所述的网络设备, 其特征在于, 所述线卡包 括接口处理芯片; 6. The network device according to any one of claims 1 to 5, characterized in that the line card includes an interface processing chip;
所述线卡的所有物理接口通过所述接口处理芯片连接到所述映射器的一个 下行端口; All physical interfaces of the line card are connected to a downlink port of the mapper through the interface processing chip;
所述转发引擎和物理接口之间的对应关系为所述转发引擎的标识, 与, 下行 端口的标识和物理接口的标识的组合的对应关系; The corresponding relationship between the forwarding engine and the physical interface is the corresponding relationship between the identifier of the forwarding engine and the combination of the identifier of the downlink port and the identifier of the physical interface;
所述接口处理芯片, 用于处理来自所述线卡的物理接口的报文; 还用于处理 所述映射器发送到所述线卡的物理接口的报文; The interface processing chip is used to process messages from the physical interface of the line card; and is also used to process messages sent by the mapper to the physical interface of the line card;
7、 根据权利要求 6所述的网络设备, 其特征在于, 7. The network device according to claim 6, characterized in that,
所述接口处理芯片, 具体用于从所述线卡的第一物理接口接收第一报文, 为 所述第一报文打上所述第一物理接口的标识, 得到第二报文; 并向所述映射器发 送所述第二报文; The interface processing chip is specifically configured to receive a first message from the first physical interface of the line card, mark the first message with the identification of the first physical interface, and obtain a second message; and The mapper sends the second message;
所述接口处理芯片, 具体还用于接收来自所述映射器的第三报文, 所述第三 报文中包括所述线卡的第二物理接口的标识,从所述第三报文中去除所述第二物 理接口的标识, 得到第四报文; 并根据所述第二物理接口的标识, 向所述第二物 理接口发送所述第四报文。 The interface processing chip is specifically configured to receive a third message from the mapper. The third message includes an identifier of the second physical interface of the line card. From the third message Remove the identifier of the second physical interface to obtain a fourth message; and send the fourth message to the second physical interface according to the identifier of the second physical interface.
8、 根据权利要求 7所述的网络设备, 其特征在于, 8. The network device according to claim 7, characterized in that,
所述映射器, 具体用于从所述下行端口接收所述第二报文, 为所述第二报文 打上所述下行端口的标识,并根据所述转发引擎和物理接口之间的对应关系发送 给所述第一物理端口对应的转发引擎。 The mapper is specifically configured to receive the second message from the downlink port, mark the second message with the identifier of the downlink port, and according to the corresponding relationship between the forwarding engine and the physical interface Sent to the forwarding engine corresponding to the first physical port.
9、 根据权利要求 7所述的网络设备, 其特征在于, 9. The network device according to claim 7, characterized in that,
所述接口处理芯片, 具体还用于为所述第一报文打上所述下行端口的标识; 所述第二报文中还包括所述第一下行端口的标识; The interface processing chip is specifically also used to mark the first message with the identifier of the downlink port; the second message also includes the identifier of the first downlink port;
所述第三报文中还包括所述下行端口的标识; 所述接口处理芯片, 具体还用 于从所述第三报文中去除所述下行端口的标识, 得到所述第四报文。 The third message also includes the identifier of the downlink port; the interface processing chip is specifically configured to remove the identifier of the downlink port from the third message to obtain the fourth message.
10、 根据权利要求 9所述的网络设备, 其特征在于, 10. The network device according to claim 9, characterized in that,
所述接口处理芯片还用于保存所述下行端口的标识; The interface processing chip is also used to save the identification of the downlink port;
所述主控板, 还可用于将所述下行端口的标识提供给所述接口处理芯片。 The main control board may also be used to provide the identification of the downlink port to the interface processing chip.
11、根据权利要求 1至 5任一项所述的网络设备, 其特征在于, 所述线卡的 所有物理接口分别连接所述映射器的一个下行端口。 11. The network device according to any one of claims 1 to 5, characterized in that all physical interfaces of the line card are respectively connected to one downlink port of the mapper.
12、 根据权利要求 11所述的网络设备, 其特征在于, 所述转发引擎和物理 接口之间的对应关系为所述映射器的上行端口的标识与所述映射器的上行端口 的标识的对应关系。 12. The network device according to claim 11, wherein the correspondence between the forwarding engine and the physical interface is the correspondence between the identifier of the upstream port of the mapper and the identifier of the upstream port of the mapper. relation.
13、 根据权利要求 1至 12任一项所述的网络设备, 其特征在于, 还包括交 换网芯片; 13. The network device according to any one of claims 1 to 12, further comprising a switching network chip;
所述多个转发引擎通过所述交换网芯片相互连接; The multiple forwarding engines are connected to each other through the switching network chip;
所述交换网芯片, 用于对所述多个转发引擎之间的报文进行交换。 The switching network chip is used to exchange messages between the multiple forwarding engines.
14、 一种转发报文的方法, 其特征在于, 应用于网络设备中, 所述网络设备 包括多个转发引擎, 映射器和线卡; 14. A method of forwarding messages, characterized in that it is applied to network equipment, and the network equipment includes multiple forwarding engines, mappers and line cards;
所述转发报文的方法包括: The method of forwarding messages includes:
线卡的第一物理接口接收第一报文; The first physical interface of the line card receives the first message;
所述线卡为所述第一报文打上所述第一物理接口的标识, 得到第二报文, 所 述第二报文中包括所述第一物理接口的标识; 将所述第二报文发送给映射器; 所述映射器从第一下行端口接收所述第二报文,根据转发引擎和物理接口之 间的对应关系, 将所述第二报文发送给第一转发引擎; 所述第一下行端口为所述 映射器连接所述线卡的端口; The line card tags the first message with the identifier of the first physical interface to obtain a second message, and the second message includes the identifier of the first physical interface; The mapper receives the second message from the first downlink port and sends the second message to the first forwarding engine according to the corresponding relationship between the forwarding engine and the physical interface; The first downlink port is a port through which the mapper is connected to the line card;
所述第一转发引擎向第二转发引擎发送所述第二报文,或者向所述映射器发 送所述第二报文。 The first forwarding engine sends the second message to the second forwarding engine, or sends the second message to the mapper.
15、 根据权利要求 14所述的方法, 其特征在于, 所述转发引擎和物理接口 之间的对应关系为映射器的上行端口的标识和物理接口的标识的对应关系; 所述映射器根据转发引擎和物理接口之间的对应关系,将所述第二报文发送 给第一转发引擎, 包括: 15. The method according to claim 14, wherein the correspondence between the forwarding engine and the physical interface is the correspondence between the identifier of the uplink port of the mapper and the identifier of the physical interface; the mapper forwards Correspondence between the engine and the physical interface, sending the second message to the first forwarding engine, including:
所述映射器根据所述第二报文中所述第一物理接口的标识,以及所述转发引 擎和物理接口之间的对应关系, 得到所述映射器的第一上行端口的标识; 所述第 一上行端口为所述映射器连接所述第一转发引擎的端口; The mapper obtains the identity of the first uplink port of the mapper based on the identity of the first physical interface in the second message and the correspondence between the forwarding engine and the physical interface; The first uplink port is the port through which the mapper is connected to the first forwarding engine;
所述映射器将所述第二报文从所述第一上行端口发送给所述第一转发引擎。 The mapper sends the second packet from the first uplink port to the first forwarding engine.
16、 根据权利要求 15所示的方法, 其特征在于, 在所述第一转发引擎向第 二转发引擎发送所述第二报文之后, 所述方法还包括: 16. The method according to claim 15, characterized in that, after the first forwarding engine sends the second message to the second forwarding engine, the method further includes:
第二转发引擎接收所述第二报文,对所述第二报文进行处理,得到第三报文; 将所述第三报文发送给所述映射器, 所述第三报文中包括第二物理接口的标识; 所述映射器接收所述第三报文, 根据所述第二物理接口的标识, 下行端口和 物理接口的对应关系, 得到所述映射器的第二下行端口的标识, 并将所述第三报 文从所述第二下行端口发送到所述第二物理接口所位于的线卡; The second forwarding engine receives the second message, processes the second message, and obtains a third message; and sends the third message to the mapper, where the third message includes The identifier of the second physical interface; the mapper receives the third message, and obtains the identifier of the second downlink port of the mapper according to the identifier of the second physical interface, the corresponding relationship between the downlink port and the physical interface. , and send the third message from the second downlink port to the line card where the second physical interface is located;
所述第二物理接口所位于的线卡,从所述第三报文中去除所述第二物理接口 的标识, 得到第四报文, 并将所述第四报文发送到所述第二物理接口。 The line card where the second physical interface is located removes the identifier of the second physical interface from the third message, obtains a fourth message, and sends the fourth message to the second message. physical interface.
17、 根据权利要求 15所述的方法, 其特征在于, 在所述第一转发引擎向所 述映射器发送所述第二报文之后, 所述方法还包括: 所述映射器从第一上行端口接收所述第二报文,所述第二报文中包括第二物 理接口的标识; 17. The method according to claim 15, characterized in that, after the first forwarding engine sends the second message to the mapper, the method further includes: The mapper receives the second message from the first uplink port, and the second message includes the identifier of the second physical interface;
所述映射器根据所述第二物理接口的标识,所述下行端口和物理接口的对应 关系, 得到所述映射器的第二下行端口的标识, 并将所述第二报文从所述第二下 行端口发送到所述第二物理接口所位于的线卡; The mapper obtains the identity of the second downlink port of the mapper based on the identity of the second physical interface and the corresponding relationship between the downlink port and the physical interface, and transfers the second message from the first The second downlink port sends the data to the line card where the second physical interface is located;
所述第二物理接口所位于的线卡,从所述第二报文中去除所述第二物理接口 的标识, 得到第三报文, 并将所述第三报文从所述第二物理接口发送出去。 The line card where the second physical interface is located removes the identifier of the second physical interface from the second message, obtains a third message, and removes the third message from the second physical interface. The interface is sent out.
18、 根据权利要求 14所示的方法, 其特征在于, 所述转发引擎和物理接口 之间的对应关系为映射器的上行端口的标识, 与, 映射器的下行端口的标识和物 理接口的标识的组合的对应关系; 18. The method according to claim 14, characterized in that: the correspondence between the forwarding engine and the physical interface is the identifier of the uplink port of the mapper, and, the identifier of the downlink port of the mapper and the identifier of the physical interface The corresponding relationship of the combination;
所述映射器根据转发引擎和物理接口之间的对应关系,将所述第二报文发送 给第一转发引擎, 包括: The mapper sends the second message to the first forwarding engine according to the corresponding relationship between the forwarding engine and the physical interface, including:
所述映射器根据所述第二报文中所述第一物理接口的标识,所述第一下行端 口的标识, 以及所述转发引擎和物理接口之间的对应关系, 得到所述映射器的第 一上行端口的标识;所述第一上行端口为所述映射器连接所述第一转发引擎的端 Π ; The mapper obtains the mapper according to the identifier of the first physical interface in the second message, the identifier of the first downlink port, and the corresponding relationship between the forwarding engine and the physical interface. The identification of the first uplink port; the first uplink port is the end of the mapper connected to the first forwarding engine;
所述映射器为所述第二报文打上所述第一下行端口的标识,并将打上所述第 一下行端口的标识的第二报文从所述第一上行端口发送给所述第一转发引擎。 The mapper marks the second message with the identifier of the first downlink port, and sends the second message marked with the identifier of the first downlink port from the first uplink port to the The first forwarding engine.
19、 根据权利要求 18所示的方法, 其特征在于, 在所述第一转发引擎向第 二转发引擎发送所述第二报文之后, 所述方法还包括: 19. The method according to claim 18, characterized in that, after the first forwarding engine sends the second message to the second forwarding engine, the method further includes:
第二转发引擎接收所述第二报文,对所述第二报文进行处理,得到第三报文; 将所述第三报文发送给所述映射器, 所述第三报文中包括第二物理接口的标识, 还包括所述映射器的第二下行端口的标识; The second forwarding engine receives the second message, processes the second message, and obtains a third message; and sends the third message to the mapper, where the third message includes The identifier of the second physical interface also includes the identifier of the second downlink port of the mapper;
所述映射器从所述第三报文中去除所述第二下行端口的标识, 得到第四报 文,并将所述第四报文从所述第二下行端口发送到所述第二物理接口所位于的线 卡; The mapper removes the identifier of the second downlink port from the third message, obtains a fourth message, and sends the fourth message from the second downlink port to the second physical The line card on which the interface is located;
所述第二物理接口所位于的线卡,从所述第四报文中去除所述第二物理接口 的标识, 得到第五报文, 并将所述第五报文发送到所述第二物理接口。 The line card where the second physical interface is located removes the identifier of the second physical interface from the fourth message, obtains a fifth message, and sends the fifth message to the second message. physical interface.
20、 根据权利要求 18所述的方法, 其特征在于, 在所述第一转发引擎向所 述映射器发送所述第二报文之后, 所述方法还包括: 所述映射器从第一上行端口接收所述第二报文,所述第二报文中包括第二物 理接口的标识, 还包括所述映射器的第二下行端口的标识; 20. The method according to claim 18, characterized in that, after the first forwarding engine sends the second message to the mapper, the method further includes: The mapper receives the second message from the first uplink port, where the second message includes an identifier of the second physical interface and an identifier of the second downlink port of the mapper;
所述映射器从所述第二报文中去除所述第二下行端口的标识, 得到第三报 文,并将所述第三报文从所述第二下行端口发送到所述第二物理接口所位于的线 卡; The mapper removes the identifier of the second downlink port from the second message, obtains a third message, and sends the third message from the second downlink port to the second physical port. The line card on which the interface is located;
所述第二物理接口所位于的线卡,从所述第三报文中去除所述第二物理接口 的标识, 得到第四报文, 并将所述第四报文从所述第二物理接口发送出去。 The line card where the second physical interface is located removes the identifier of the second physical interface from the third message, obtains a fourth message, and removes the fourth message from the second physical interface. The interface is sent out.
21、 根据权利要求 14所示的方法, 其特征在于, 所述转发引擎和物理接口 之间的对应关系为映射器的上行端口的标识, 与, 映射器的下行端口的标识和物 理接口的标识的组合的对应关系; 21. The method according to claim 14, characterized in that: the correspondence between the forwarding engine and the physical interface is the identifier of the uplink port of the mapper, and, the identifier of the downlink port of the mapper and the identifier of the physical interface The corresponding relationship of the combination;
所述方法还包括: 所述线卡为所述第一报文打上所述第一下行端口的标识; 所述第二报文中还包括所述第一下行端口的标识; The method further includes: the line card marking the first packet with the identification of the first downlink port; the second packet further including the identification of the first downlink port;
相应地, 所述映射器根据转发引擎和物理接口之间的对应关系, 将所述第二 报文发送给第一转发引擎, 包括: Correspondingly, the mapper sends the second message to the first forwarding engine according to the corresponding relationship between the forwarding engine and the physical interface, including:
所述映射器根据所述第二报文,以及所述转发引擎和物理接口之间的对应关 系, 得到所述映射器的第一上行端口的标识, 所述第一上行端口为所述映射器连 接所述第一转发引擎的端口; The mapper obtains the identity of the first uplink port of the mapper based on the second message and the corresponding relationship between the forwarding engine and the physical interface, and the first uplink port is the mapper A port connected to the first forwarding engine;
所述映射器将所述第二报文从所述第一上行端口发送给所述第一转发引擎。 The mapper sends the second packet from the first uplink port to the first forwarding engine.
22、 根据权利要求 21所示的方法, 其特征在于, 在所述第一转发引擎向第 二转发引擎发送所述第二报文之后, 所述方法还包括: 22. The method according to claim 21, characterized in that, after the first forwarding engine sends the second message to the second forwarding engine, the method further includes:
第二转发引擎接收所述第二报文,对所述第二报文进行处理,得到第三报文; 将所述第三报文发送给所述映射器, 所述第三报文中包括第二物理接口的标识, 还包括所述映射器的第二下行端口的标识; The second forwarding engine receives the second message, processes the second message, and obtains a third message; and sends the third message to the mapper, where the third message includes The identifier of the second physical interface also includes the identifier of the second downlink port of the mapper;
所述映射器根据所述第三报文中所述第二下行端口的标识,将所述第三报文 从所述第二下行端口发送给所述第二物理接口所位于的线卡; The mapper sends the third message from the second downlink port to the line card where the second physical interface is located according to the identification of the second downlink port in the third message;
所述第二物理接口所位于的线卡,从所述第三报文中去除所述第二下行端口 的标识和所述第二物理接口的标识, 得到第四报文, 并将所述第四报文发送到所 述第二物理接口。 The line card where the second physical interface is located removes the identifier of the second downlink port and the identifier of the second physical interface from the third message, obtains a fourth message, and sends the third message Four messages are sent to the second physical interface.
23、 根据权利要求 21所述的方法, 其特征在于, 在所述第一转发引擎向所 述映射器发送所述第二报文之后, 所述方法还包括: 所述映射器从第一上行端口接收所述第二报文,所述第二报文中包括第二物 理接口的标识, 还包括所述映射器的第二下行端口的标识; 23. The method according to claim 21, characterized in that, after the first forwarding engine sends the second message to the mapper, the method further includes: The mapper receives the second message from the first uplink port, where the second message includes an identifier of the second physical interface and an identifier of the second downlink port of the mapper;
所述映射器根据所述第二报文中所述第二下行端口的标识,将所述第二报文 从所述第二下行端口发送给所述第二物理接口所位于的线卡; The mapper sends the second message from the second downlink port to the line card where the second physical interface is located according to the identifier of the second downlink port in the second message;
所述第二物理接口所位于的线卡,从所述第二报文中去除所述第二下行端口 的标识和所述第二物理接口的标识, 得到第三报文, 并将所述第三报文从所述第 二物理接口发送出去。 The line card where the second physical interface is located removes the identifier of the second downlink port and the identifier of the second physical interface from the second message, obtains a third message, and sends the third message Three messages are sent out from the second physical interface.
PCT/CN2014/081811 2013-12-31 2014-07-08 Network device and packet forwarding method WO2015101003A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310753145.4A CN104753792B (en) 2013-12-31 2013-12-31 The network equipment and the method to E-Packet
CN201310753145.4 2013-12-31

Publications (1)

Publication Number Publication Date
WO2015101003A1 true WO2015101003A1 (en) 2015-07-09

Family

ID=53493124

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/081811 WO2015101003A1 (en) 2013-12-31 2014-07-08 Network device and packet forwarding method

Country Status (2)

Country Link
CN (1) CN104753792B (en)
WO (1) WO2015101003A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105656777B (en) * 2016-01-22 2019-06-07 中国人民解放军国防科学技术大学 A kind of more logical forwarding engines isolation dispatching method and isolation scheduling system
CN107241174B (en) * 2017-06-28 2020-04-03 迈普通信技术股份有限公司 Network switching method and network equipment
CN109639599B (en) * 2018-12-26 2023-04-07 天翼电子商务有限公司 Network resource scheduling method and system, storage medium and scheduling device
CN110691045B (en) * 2019-10-25 2022-02-11 新华三信息安全技术有限公司 Protocol message forwarding method, line card board, network equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1620068A (en) * 2003-11-20 2005-05-25 韩国电子通信研究院 Link integrating apparatus and method
CN101252535A (en) * 2008-03-28 2008-08-27 杭州华三通信技术有限公司 Centralize type forwarding network appliance and method
US20090129380A1 (en) * 2007-11-20 2009-05-21 Arindam Paul Determining packet forwarding information for packets sent from a protocol offload engine in a packet switching device
CN102281526A (en) * 2010-06-10 2011-12-14 中兴通讯股份有限公司 Mobile communication control method and system, mapping forwarding server and access router

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1620068A (en) * 2003-11-20 2005-05-25 韩国电子通信研究院 Link integrating apparatus and method
US20090129380A1 (en) * 2007-11-20 2009-05-21 Arindam Paul Determining packet forwarding information for packets sent from a protocol offload engine in a packet switching device
CN101252535A (en) * 2008-03-28 2008-08-27 杭州华三通信技术有限公司 Centralize type forwarding network appliance and method
CN102281526A (en) * 2010-06-10 2011-12-14 中兴通讯股份有限公司 Mobile communication control method and system, mapping forwarding server and access router

Also Published As

Publication number Publication date
CN104753792B (en) 2018-10-30
CN104753792A (en) 2015-07-01

Similar Documents

Publication Publication Date Title
JP6841918B2 (en) Methods and devices for transmitting service flows based on flexible Ethernet, as well as communication systems
CN102025541B (en) Method and system for realizing multicast protection
US9634929B2 (en) Using context labels to scale MAC tables on computer network edge devices
US8179900B2 (en) Edge node redundant system in label switching network
JP2015065684A (en) Methods for configuring network switches
US10965594B2 (en) Pseudo wire load sharing method and device
CN104104570A (en) Aggregation processing method in IRF (Intelligent Resilient Framework) system and device
WO2020168854A1 (en) Evpn multicast method, apparatus and system
EP2999171B1 (en) Method, apparatus and system for establishing optical bypass
WO2015101003A1 (en) Network device and packet forwarding method
US10225091B2 (en) Method for implementing point-to-multipoint multicast, network node, and system
EP2538602B1 (en) Method and system for realizing hot standby in centralized network nodes
US20230208751A1 (en) Packet forwarding method, device, and system
EP2648382A1 (en) Method, device and system for establishing lsp
JP5164744B2 (en) Communication network system and bandwidth control method for inter-base communication
CN102255759B (en) Method and device for transmitting data message based on PW (Packet Writing) redundant backup
JP2023527932A (en) BIER Multicast Traffic Statistics Collection Method, Apparatus, and System
US20100303069A1 (en) Server, transmission system and gre tunnel encapsulation transferring method thereof
WO2018209915A1 (en) Large-scale oam detection system and method in distributed devices
CN102045259B (en) Packet switching equipment and method for managing customer service
CN111885630A (en) Data transmission method and communication device
WO2023169285A1 (en) Communication method and apparatus, and network device and system
WO2023065750A1 (en) State synchronization method and apparatus, and device
CN117097581A (en) Multicast communication method and related device
CN104283759A (en) System and method for implementing IGMP Snooping under VPLS

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14876026

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14876026

Country of ref document: EP

Kind code of ref document: A1