WO2014029278A1 - 一种转发表写入、报文转发方法及装置 - Google Patents

一种转发表写入、报文转发方法及装置 Download PDF

Info

Publication number
WO2014029278A1
WO2014029278A1 PCT/CN2013/081231 CN2013081231W WO2014029278A1 WO 2014029278 A1 WO2014029278 A1 WO 2014029278A1 CN 2013081231 W CN2013081231 W CN 2013081231W WO 2014029278 A1 WO2014029278 A1 WO 2014029278A1
Authority
WO
WIPO (PCT)
Prior art keywords
information
forwarding
forwarding table
address
routing
Prior art date
Application number
PCT/CN2013/081231
Other languages
English (en)
French (fr)
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 WO2014029278A1 publication Critical patent/WO2014029278A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/54Organization of routing tables

Definitions

  • the present invention relates to the field of communications, and in particular, to a forwarding table write, a message forwarding method, and a device. Background technique
  • Packet forwarding efficiency is a key indicator for measuring the performance of packet forwarding devices, such as routing devices and switching devices.
  • routing devices and switching devices generally use forwarding tables to complete packet forwarding.
  • the packet forwarding device is a distributed device, the packet forwarding device includes a plurality of line card boards in addition to the main control board. After the route is generated on the main control board, the route forwarding information is synchronized to the line card board. Forward the packet through the forwarding table on the line card.
  • the packet forwarding device is a centralized device, the packet forwarding device includes an integrated board that integrates the functions of the main control board and the line card board. The packet forwarding is implemented through the forwarding table on the integrated board.
  • the routing device and the switching device write the routing forwarding information (including the routing prefix information, the egress encapsulation information, and the egress port information) generated by the dynamic routing protocol or the static configuration to the forwarding table.
  • Each forwarding table entry in the forwarding table corresponds to one routing forwarding.
  • Information, route forwarding information, egress encapsulation information, and egress port information are stored in each forwarding table entry.
  • the routing device and the switching device can first query the corresponding forwarding table entry in the forwarding table according to the destination address of the packet to be forwarded (that is, according to the routing prefix information in the packet header of the packet to be forwarded, The forwarding table entry with the same routing prefix information is saved in the publication, and the forwarding table entry is queried, and then the header content of the packet to be forwarded is modified according to the queried encapsulation information, and finally the queried out port information is reported.
  • the packet to be forwarded is forwarded, that is, the packet forwarding process includes three steps: table lookup, encapsulation, and forwarding.
  • the switching device After Layer 3 packet forwarding is used as an example, after the packet to be forwarded enters the switching device (or routing device), The switching device (or routing device) performs packet parsing and can be based on the virtual private network identity (VPNID) and destination address (Dest) of the packet to be forwarded.
  • VPNID virtual private network identity
  • Dest destination address
  • the IP forwarding query table matches the best path, and modifies the header content of the packet to be forwarded according to the egress encapsulation information included in the determined forwarding table entry, such as modifying the label in the packet header and the next hop internet protocol (IP, Internet Protocol, address, physical address (MAC address), etc., and then forward the packet to be forwarded with the modified packet header content based on the queried outbound port information.
  • IP Internet Protocol
  • MAC address physical address
  • the embodiment of the invention provides a forwarding table write, a packet forwarding method and a device, which can improve the packet forwarding capacity of the packet forwarding device.
  • a forwarding table writing method comprising:
  • the packet forwarding device obtains the specified information from the egress encapsulation information included in the routing forwarding information, where the specified information is used to modify the header of the packet in the packet forwarding process;
  • the packet forwarding device determines whether the specified information is stored in the forwarding table, and the forwarding table is configured to save routing and forwarding information:
  • the packet forwarding device writes the address or address index of the specified information in the forwarding table, the route prefix information included in the route forwarding information, and the outbound port information to a forwarding table entry in the forwarding table;
  • the packet forwarding device writes the specified information into the forwarding table, and the address or address index in the forwarding table and the route included in the routing forwarding information
  • the suffix information and the outbound port information are written to a forwarding table entry of the forwarding table.
  • a packet forwarding method where the method includes:
  • the packet forwarding device receives the packet to be forwarded.
  • the packet forwarding device parses the to-be-forwarded packet to obtain the route prefix information carried in the to-be-forwarded packet;
  • the packet forwarding device uses the routing prefix information as a key value, queries the forwarding table, determines the outbound port information stored in the forwarding table entry where the routing prefix information is located, and the address or address index of the specified information in the forwarding table, The specified information is used to modify the header of the packet during the packet forwarding process.
  • the packet forwarding device uses the address or address index to determine the specified information stored in the forwarding table, and encapsulates the to-be-forwarded packet by using the specified specified information.
  • the packet forwarding device forwards the encapsulated packet to be forwarded according to the outbound port information.
  • a forwarding table writing device the device comprising:
  • the information extracting unit is configured to: forward the information to the routing information, and obtain the specified information from the egress encapsulation information included in the routing forwarding information, where the specified information is used to modify the information of the packet header during the packet forwarding process;
  • a determining unit configured to determine whether the specified information is stored in the forwarding table, where the forwarding is used to save routing and forwarding information
  • a write unit configured to: when the determining unit determines that the specified information is stored in the forwarding table, the address or address index of the specified information in the forwarding table, and the route prefix information included in the routing forwarding information And outputting the port information to a forwarding table entry of the forwarding table; when the determining unit determines that the specified information is not stored in the forwarding table, writing the specified information to the forwarding table, and specifying the The address or address index in the forwarding table, the route prefix information included in the route forwarding information, and the outbound port information are written into a forwarding table entry of the forwarding table.
  • a message forwarding device the device comprising:
  • a receiving unit configured to receive a packet to be forwarded
  • the parsing unit is configured to parse the to-be-forwarded packet to obtain the route prefix information carried in the to-be-forwarded packet;
  • the query unit is configured to use the route prefix information as a key value, query a forwarding table, determine an outbound port information stored in a forwarding table entry where the route prefix information is located, and an address or address index of the specified information in the forwarding table, where The specified information is used to modify the header of the packet during the packet forwarding process;
  • the encapsulating unit is configured to determine the specified information stored in the forwarding table by using the address or the address index, and encapsulate the to-be-forwarded packet by using the specified specified information;
  • the forwarding unit is configured to forward the encapsulated packet to be forwarded according to the outbound port information.
  • the routing information to be written into the forwarding table may be obtained, and the specified information is obtained from the egress encapsulation information to determine whether the specified information is stored in the forwarding table, and if it is stored,
  • the address or address index of the specified information in the forwarding table may be written into the forwarding table entry corresponding to the routing forwarding information instead of the egress encapsulation information.
  • the specified information may be written into the forwarding table, and The address or address index of the specified information in the forwarding table is written into the forwarding table entry corresponding to the routing forwarding information instead of the egress encapsulation information.
  • the same specified information can be shared by one forwarding table address, and different forwarding table entries can be shared by the same specified information, thereby reducing the capacity of the forwarding table, without increasing the capacity of the forwarding table.
  • the packet forwarding capacity of the packet forwarding device is increased, thereby improving the performance of the packet forwarding device while saving hardware costs.
  • it is not necessary to repeatedly write the same specified information reduce the amount of data written to the forwarding table, and speed up the writing of forwarding information to the forwarding table.
  • FIG. 1 is a schematic diagram of packet forwarding provided by the prior art
  • 2 is a flow chart of steps of a method for writing a forwarding table according to Embodiment 1 of the present invention
  • FIG. 3 is a flowchart of steps for writing a forwarding table according to Embodiment 2 of the present invention
  • FIG. 5 is a flowchart of steps of a packet forwarding method according to Embodiment 4 of the present invention.
  • FIG. 6 is a flowchart of steps of a packet forwarding method according to Embodiment 5 of the present invention.
  • FIG. 7 is a schematic structural diagram of a forwarding table writing apparatus according to Embodiment 6 of the present invention
  • FIG. 8 is a schematic structural diagram of a packet forwarding apparatus according to Embodiment 7 of the present invention. detailed description
  • the route prefix information, the egress encapsulation information, and the egress port information are saved in each forwarding table entry of the packet forwarding device forwarding table.
  • the inventor of the present invention finds that the multiple routing forwarding information corresponds to the egress.
  • the information used to modify the packet header is the same in many cases. For example, as shown in FIG. 1, two routes 2.2.2.2 are advertised from the service provider edge device PE2 to the service provider edge device PE1. 3.3.3.3, their destination addresses are different.
  • the egress encapsulation information is used to modify the inner label of the packet header (the configuration specifies the same label as the VPN).
  • the layer outgoing label, the next hop IP address, and the MAC address are identical. Therefore, the information of the packet header can be modified by the abstraction of the egress packet information, and the information used to modify the packet header can be shared, the occupation of the forwarding table space can be reduced, and the packet forwarding of the packet forwarding device can be improved. capacity. At the same time, the sharing of the information used to modify the packet header can also reduce the number of forwarding table write tables and improve the forwarding table writing table speed.
  • a first embodiment of the present invention provides a method for writing a forwarding table, which is used to write a routing forwarding information into a forwarding table, and writes a routing forwarding information into a forwarding table as an example.
  • a forwarding table which is used to write a routing forwarding information into a forwarding table, and writes a routing forwarding information into a forwarding table as an example.
  • Step 101 Extract specified information from route forwarding information.
  • the executor of each step in this embodiment is a packet forwarding device, which can be understood as a routing device or a switching device.
  • the packet forwarding device uses the egress encapsulation information included in the routing forwarding information.
  • the specified information is obtained by modifying the header of the packet during the packet forwarding process.
  • the route forwarding information may be generated by the packet forwarding device through a dynamic routing protocol or a static configuration.
  • the packet forwarding device can obtain the specified information from the egress encapsulation information included in the routing forwarding information according to the protocol type that the packet forwarding follows.
  • the specified information may include, but is not limited to, at least one of a private network label, a private network physical MAC address, a public network physical MAC address, and a public network Internet Protocol IP address.
  • Step 102 Determine whether the specified information has been stored.
  • the packet forwarding device may determine whether the specified information has been stored in the forwarding table for storing the routing forwarding information. If it is determined that it has been stored, then step 104 can be skipped, otherwise, step 103 can be continued.
  • Step 103 Write the specified information into a forwarding table.
  • the routing forwarding information If it is determined that the specified information is not stored in the forwarding table, that is, in the routing forwarding information previously written in the forwarding table, if the routing forwarding information has the same specified information as the routing forwarding information to be written this time, in this step The specified information in the route forwarding information that needs to be written this time can be written into the forwarding table.
  • Step 104 Write route forwarding information to the forwarding table.
  • the specified information may be written in the address or address index in the forwarding table, the route prefix information included in the routing forwarding information, and the outbound port information.
  • a forwarding table entry of the forwarding table is entered, and the forwarding table is saved by the forwarding table.
  • the forwarding table entry is shared by the same specified information, so that the same specified information is only required to be written in one forwarding table.
  • the method may further include step 104, (step 104, may be performed before step 104, or may be performed after step 104):
  • Step 104 Store a correspondence between the specified information and an address or an address index.
  • This step is a preferred step.
  • the packet forwarding device may add a correspondence table entry in the pre-established correspondence table, and the forwarding table is written.
  • the specified information, the correspondence between the address or the address index of the specified information in the forwarding table is written into the correspondence table entry.
  • step 104 If the specified information of the forwarding table is written for each strip, the method provided by step 104 is used, and in step 101, it is determined whether the specified information has been stored in the following manner:
  • the packet forwarding device uses the specified information as a key value, queries the corresponding relationship table, and determines whether the corresponding relationship table entry has the specified information in the corresponding relationship table; If it is determined that the corresponding relationship table entry in the correspondence relationship table holds the specified information, it is determined that the specified information is already stored in the forwarding table, otherwise, it is determined that the specified information is not stored in the forwarding table.
  • step 104 may further include step 103, (step 103, and step 104, the execution is in no particular order): Step 103, determine the routing prefix Whether the information has been stored.
  • This step is a preferred step.
  • the packet forwarding device may determine whether the routing prefix information included in the routing forwarding information that needs to be written this time is stored in the forwarding. If the route prefix information included in the route forwarding information to be written is included, proceed to step 104, and the address or address index of the specified information in the forwarding table, the route prefix information included in the route forwarding information, and the outbound The port information is written into a forwarding table entry of the forwarding table. Otherwise, the flow can be ended, thereby preventing duplicate storage of routing information.
  • a reference count value may be set for each specified information of the write forwarding table, and the initial value of the reference count value may be 0.
  • the The reference count value set by the specified information is incremented by 1, so that the reference count value can be used for the table quantity. Therefore, after the route forwarding information is revoked, the space occupied by the corresponding relationship table entry may be recovered when all the forwarding table entries including the address or the address index in the forwarding table are deleted by the change of the reference count value. , reduce the occupation of system resources.
  • the method provided in Embodiment 1 can be applied to a packet forwarding device, such as a routing device or a switching device.
  • the packet forwarding device can be a distributed device or a centralized device.
  • the following describes the solution of the first embodiment of the present invention by taking the packet forwarding device as a distributed device as an example.
  • Embodiment 2 A second embodiment of the present invention provides a method for writing a forwarding table.
  • the process of the method may be as shown in FIG. 3, including:
  • Step 201 The main control board generates route forwarding information.
  • the main control board In this step, the main control board generates new route forwarding information through dynamic routing protocol or static configuration, and synchronizes route forwarding information (including route prefix information, egress encapsulation information, and egress port information) to each line card.
  • the route forwarding information may also be synchronized to the line card board where the egress port indicated by the egress port information in the route forwarding information is located.
  • Step 202 Extract specified information.
  • the line card can obtain the specified information from the egress encapsulation information included in the route forwarding information according to the protocol type that the packet forwarding follows.
  • Step 203 Determine whether the specified information is stored.
  • the line card may use the specified information as a key to query the correspondence table (which may be a software table), determine whether the corresponding relationship table entry holds the specified information, and if not, continue to perform step 204. Otherwise, the jump proceeds to step 205.
  • the correspondence table which may be a software table
  • Step 204 Write the specified information into the forwarding table.
  • the line card writes the specified information to the forwarding table when it is determined that the specified information has not been written to the forwarding table.
  • the reference count value can be set for the specified information, and the initial value of the reference count value is 0.
  • the line card may further add a correspondence table entry in the correspondence table, and the correspondence between the specified information and the address or address index of the specified information in the forwarding table. Write the correspondence table entry.
  • adding a correspondence table entry in the correspondence table, and writing the correspondence between the specified information and the address or the address index of the specified information in the forwarding table into the correspondence table entry may also be forwarding the route The information is executed after the forwarding table is written.
  • Step 205 Determine whether the route prefix information is stored.
  • the line card board may use the routing prefix information included in the routing and forwarding information as a key to query the forwarding table, and determine whether the forwarding table entry has the routing prefix information. If not, proceed to step 206. Otherwise, you can end this process. Therefore, when the route forwarding information has been written by the other line card to the forwarding table, the routing forwarding information is no longer written to the forwarding table, and the repeated writing of the routing forwarding information is avoided.
  • Step 206 Write route forwarding information to the forwarding table.
  • the line card board may write the address or address index of the specified information in the forwarding table, the route prefix information included in the routing forwarding information, and the outbound port information into a forwarding of the forwarding table. Publish the entry and implement the forwarding table to save the routing information.
  • the reference count value set for the specified information may also be incremented by 1, so that the reference counting value may be used to indicate that the specified information is included, if The reference information is set to the reference count value.
  • the reference count value may be decremented by 1 when the route forwarding information is revoked, and deleted when the reference count value is 0.
  • a correspondence table entry having the specified information Therefore, it is possible to determine whether all forwarding table entries including the address or address index of the specified information in the forwarding table are deleted by referring to the change of the reference value, and the address or address index in the forwarding table is included in the forwarding table. When all the forwarding table entries are deleted, the space occupied by the corresponding relation table entries in the corresponding relation table is recovered, and the occupation of system resources is reduced.
  • the method may further include step 207:
  • Step 207 Update the reference count value.
  • the packet forwarding device may decrement the reference count value set for the specified information by 1 when the route forwarding information is revoked, and delete the correspondence table when the reference count value is 0. A correspondence table entry in which the specified information is saved.
  • the executive body of each step in the second embodiment can be understood as an integrated board.
  • Step 301 Generate route forwarding information.
  • the packet forwarding device can generate new routing forwarding information through dynamic routing protocol or static configuration.
  • the routing forwarding information can include routing prefix information, egress encapsulation information, and egress port information.
  • ECMP Equal-cost Multi-path
  • FRR Fast Reroute
  • Step 302 Determine a protocol type that the packet forwarding follows.
  • the packet forwarding device packet forwarding follows the Layer 3 routing protocol. Therefore, it can be determined that the following specified information needs to be obtained from the egress encapsulation information: private network label, private network physical (MAC) address, public network physics MAC address and public network Internet Protocol (IP) address.
  • MAC private network physical
  • IP Internet Protocol
  • the specified information obtained from the egress package information may also be determined in combination with the actual forwarding needs. For example, it may be determined that the following specified information needs to be obtained from the egress package information: a private network physical (MAC) address and a public network Internet Protocol (IP) address. You do not need to obtain private network VPN labels and public network labels.
  • MAC physical
  • IP Internet Protocol
  • Step 303 Obtain specified information.
  • the specified information may be obtained from the egress encapsulation information according to the level, such as from the inner layer to the outer layer of the packet encapsulation, and/or from the third layer to the second layer of the packet encapsulation. Order, get the specified information.
  • the same specified information may be obtained, and the same specified information may be shared, for example, by using an Address Resolution Protocol (ARP).
  • ARP Address Resolution Protocol
  • the egress packet information obtained by IP ECMP and IP FRR can be abstracted to obtain the same next hop IP address and MAC address.
  • L3VPN outer LDP, L3VPN outer LDP ECMP/FRR/TE/TE FRR, L3VPN FRR outer LDP/LDP FRR/LDP ECMP/TE/TE FRR in the export encapsulation information may be obtained after abstract integration.
  • step 303 may be performed by the main control board or by the line card.
  • the fourth embodiment of the present invention provides a packet forwarding method.
  • a fourth embodiment of the present invention provides a packet forwarding method.
  • the process of the method may be as shown in FIG. 5, including:
  • Step 401 Receive a packet to be forwarded.
  • Step 402 Parse the packet to be forwarded.
  • the packet forwarding device can parse the packet and extract the route prefix information in the packet.
  • Step 403 Determine the port information, and specify the address or address index of the information in the forwarding table.
  • the packet forwarding device can use the route prefix information as a key to query the forwarding table, and determine the outbound port information and the specified in the forwarding table entry where the route prefix information is located.
  • the address or address index of the information in the forwarding table can be used.
  • Step 404 Encapsulate a packet to be forwarded.
  • the packet forwarding device may use the address or address index to determine the specified information stored in the forwarding table, and encapsulate the to-be-forwarded packet by using the determined egress encapsulation information.
  • Step 405 Forward the packet.
  • the packet forwarding device may forward the encapsulated packet to be forwarded according to the outbound port information.
  • the following describes the solution of the fourth embodiment of the present invention by taking the packet forwarding device as a distributed device and implementing Layer 3 packet forwarding as an example.
  • a fifth embodiment of the present invention provides a packet forwarding method.
  • the process of the method may be as shown in FIG. 6, including:
  • Step 501 Receive a packet to be forwarded.
  • This step includes: the first line card receives the Layer 3 message.
  • Step 502 Parse the to-be-forwarded packet.
  • This step includes the first line card parsing the packet and extracting the routing prefix information in the Layer 3 packet.
  • Step 503 Determine the port information, and specify the address or address index of the information in the forwarding table.
  • the first line card can query the forwarding table according to the routing prefix information, obtain the port information, and the address or address index corresponding to the specified information in the forwarding table.
  • Step 504 Send a packet to be forwarded.
  • the first line card can determine the egress port according to the outbound port information, and send the to-be-forwarded packet and the address or address index corresponding to the specified information in the forwarding table to the second line card board where the egress port is located. Specifically, the first line card can send the to-be-forwarded packet and the address or address index corresponding to the specified information in the forwarding table to the main control board, and then the main control board associates the to-be-forwarded packet with the specified information. The address or address index in the forwarding table is sent to the second line card where the egress port is located.
  • Step 505 Encapsulate a packet to be forwarded.
  • the specified information encapsulates the to-be-forwarded packet, that is, the second-line card board modifies the information such as the IP address, the MAC address, the public network label, and the private network label in the packet header according to the specified information.
  • the encapsulated packet to be forwarded may also be implemented on the first line card.
  • the encapsulated packet to be forwarded is sent to the second line card. That is, after the step 503, the first line card may perform the step 505, and the packet to be forwarded is encapsulated, and then the step 504 is performed, the encapsulated to-be-forwarded packet is forwarded to the second line card, and the second may continue to perform step 506. .
  • Step 506 Forward the packet.
  • the second line card may forward the encapsulated packet to be forwarded according to the outbound port information.
  • Embodiment 6 is provided based on the same inventive concept as the first to fifth embodiments of the present invention.
  • the sixth embodiment of the present invention provides a forwarding table writing device, which can be integrated into a routing device or a switching device.
  • the structure of the device can be as shown in FIG. 7, and includes:
  • the information extracting unit 11 is configured to: forward the information to the routing information, and obtain the specified information from the egress encapsulation information included in the routing forwarding information, where the specified information is used to modify the header of the packet in the packet forwarding process; 12 is configured to determine whether the specified information is stored in the forwarding table, where the forwarding table is configured to save routing forwarding information; and the writing unit 13 is configured to: when the determining unit determines that the specified information is stored in the forwarding table, An address or address index of the specified information in the forwarding table, routing prefix information included in the routing forwarding information, and The outbound port information is written into a forwarding table entry of the forwarding table; when the determining unit determines that the specified information is not stored in the forwarding table, the specified information is written into the forwarding table, and the specified information is The address or address index in the forwarding table, the route prefix information included in the route forwarding information, and the outbound port information are written into a forwarding table entry of the forwarding table.
  • the information extracting unit 11 is configured to obtain the specified information from the egress encapsulation information included in the routing forwarding information according to the protocol type that the packet forwarding follows.
  • the apparatus further includes a correspondence establishing unit 14:
  • the correspondence relationship establishing unit 14 is configured to: after the writing unit writes the specified information into the forwarding table, add a correspondence table entry in the pre-established correspondence table, and the specified information and the specified information are in the forwarding The correspondence of the address or address index in the publication is written into the correspondence table entry.
  • the determining unit 12 is configured to use the specified information as a key value, query a correspondence relationship table, and determine whether the corresponding relationship table entry has the specified information in the correspondence relationship table; The corresponding relationship table entry stores the specified information, and determines that the specified information is already stored in the forwarding table. Otherwise, it is determined that the specified information is not stored in the forwarding table.
  • the apparatus also includes a counting unit 15:
  • the counting unit 15 is configured to write, by the writing unit, an address or address index of the specified information in the forwarding table, routing prefix information included in the routing forwarding information, and outgoing port information into a forwarding table entry of the forwarding table. Thereafter, the reference count value set for the specified information is incremented by 1, the reference count value being used to indicate the number of forwarding table entries including the address or address index of the specified information in the forwarding table, and the reference count value The initial value is 0.
  • the counting unit 15 is further configured to: when the routing forwarding information is revoked, decrement the reference count value set for the specified information by 1, and when the reference counting value is 0, the deletion correspondence table is saved Corresponding relationship table entry of the specified information.
  • the writing unit 13 is configured to write an address or address index of the specified information in the forwarding table, routing prefix information included in the routing forwarding information, and outgoing port information into a forwarding table of the forwarding table.
  • the forwarding table Before the entry, querying the forwarding table by using the routing prefix information as a key value, determining whether there is a forwarding table entry in the forwarding table, and storing the routing prefix information; specifying an address or an address of the information in the forwarding table
  • the index, the route prefix information included in the route forwarding information, and the outbound port information are written into a forwarding table entry of the forwarding table.
  • the seventh embodiment of the present invention provides a packet forwarding device, which may be integrated into a routing device or a switching device.
  • the structure of the device may be as shown in FIG.
  • the receiving unit 21 is configured to receive the to-be-forwarded packet; the parsing unit 22 is configured to parse the to-be-forwarded packet to obtain the routing prefix information carried in the to-be-forwarded packet; the querying unit 23 is configured to use the routing prefix information.
  • the forwarding table is queried, and the outbound port information stored in the forwarding table entry of the routing prefix information and the address or address index of the specified information in the forwarding table are determined, and the specified information is in the packet forwarding process. The information is used to modify the information of the packet header.
  • the encapsulating unit 24 is configured to determine the specified information stored in the forwarding table by using the address or the address index, and encapsulate the to-be-forwarded packet by using the specified specified information.
  • the outbound port information forwards the encapsulated packet to be forwarded.
  • embodiments of the present application can be provided as a method, system, or computer program product.
  • the application can take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware.
  • the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • the present application refers to a method, device (system), and computer program according to an embodiment of the present application.
  • the flow chart and/or block diagram of the product is described. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG.
  • These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

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

Abstract

本发明实施例提供一种转发表写入、报文转发方法及装置,包括:在一个转发表中保存从各条出口封装信息中获取的不同的指定信息,并在每条转发表条目中写入路由前缀信息、出端口信息以及对应的指定信息在转发表中的地址或地址索引。从而在一个转发表中,实现多条转发表条目对相同的指定信息的共享,减少转发表容量的占用,在不增加转发表容量的情况下,提高报文转发设备的报文转发容量,在提高报文转发设备性能的同时节省硬件成本。且无需重复写入相同的指定信息,减少向转发表写入的数据数量,加快路由转发信息写入转发表的速度。

Description

一种转发表写入、 报文转发方法及装置 技术领域
本发明涉及通信领域, 尤其涉及一种转发表写入、 报文转发方法及装 置。 背景技术
报文转发效率是衡量报文转发设备, 如路由设备和交换设备性能的一 项关键指标。 为了提高报文转发效率, 路由设备和交换设备一般采用转发 表来完成报文转发。 若报文转发设备为分布式设备, 则报文转发设备除包 括主控板之外, 还包括多块线卡板, 在主控板上完成路由生成之后将路由 转发信息同步到线卡板, 通过线卡板上的转发表完成报文转发。 若报文转 发设备为集中式设备, 则报文转发设备包括集成有主控板和线卡板功能的 集成板, 通过集成板上的转发表完成报文转发。
路由设备和交换设备将通过动态路由协议或静态配置生成的路由转发 信息 (包括路由前缀信息、 出口封装信息和出端口信息) 写入转发表, 转 发表中的每条转发表条目对应一条路由转发信息, 每条转发表条目中均保 存有路由前缀信息、 出口封装信息和出端口信息。 路由设备和交换设备在 进行报文转发时, 首先可以根据待转发报文的目的地址查询转发表中对应 的转发表条目 (即根据待转发报文的报文头中的路由前缀信息, 匹配转发 表中保存有相同路由前缀信息的转发表条目, 并查询该转发表条目), 然后 根据查询到的出口封装信息修改待转发报文的报文头内容, 最后根据查询 到的出端口信息将报文头内容已修改的待转发报文转发出去, 即报文转发 过程包括查表、 封装和转发三个步骤。
以三层报文转发为例, 待转发报文进入交换设备(或路由设备)后, 交换设备(或路由设备)进行报文解析, 并可以根据待转发报文的虚拟专 用网络标识号( VPNID, Virtual Private Network Identity )和目的地址( Dest
IP )查询转发表匹配最佳路径,并根据确定出的转发表条目中包含的出口封 装信息修改待转发报文的报文头内容, 如修改报文头中的标签、 下一跳因 特网协议(IP, Internet Protocol )地址、 物理地址( MAC地址)等, 然后 可以根据查询到的出端口信息将报文头内容已修改的待转发报文转发出 去。
在现有技术中, 由于转发表空间有限, 而在每条转发表条目中均保存 有一条路由转发信息对应的路由前缀信息、 出口封装信息和出端口信息, 每条转发表条目占用空间较大, 因此限制了转发表能够保存的路由转发信 息的数量, 导致报文转发设备的报文转发容量受到限制。 发明内容
本发明实施例提供一种转发表写入、 报文转发方法及装置, 能够提高 报文转发设备的报文转发容量。
一种转发表写入方法, 所述方法包括:
针对一条路由转发信息, 报文转发设备从该路由转发信息包括的出口 封装信息中获取指定信息, 所述指定信息为在报文转发过程中, 用于修改 报文头的信息;
报文转发设备确定转发表中是否已存储有所述指定信息, 所述转发表 用于保存路由转发信息:
若是, 则报文转发设备将所述指定信息在所述转发表中的地址或地址 索引、 该路由转发信息中包括的路由前缀信息以及出端口信息写入所述转 发表的一条转发表条目;
否则, 报文转发设备将所述指定信息写入所述转发表, 并将所述指定 信息在所述转发表中的地址或地址索引、 该路由转发信息中包括的路由前 缀信息以及出端口信息写入所述转发表的一条转发表条目。
一种报文转发方法, 所述方法包括:
报文转发设备接收待转发报文;
报文转发设备对所述待转发报文进行解析, 获得该待转发报文中携带 的路由前缀信息;
报文转发设备利用所述路由前缀信息作为键值, 查询转发表, 确定该 路由前缀信息所在转发表条目中存储的出端口信息以及指定信息在所述转 发表中的地址或地址索引, 所述指定信息为在报文转发过程中, 用于修改 报文头的信息;
报文转发设备利用所述地址或地址索引确定转发表中保存的指定信 息, 利用确定出的指定信息封装所述待转发报文;
报文转发设备根据所述出端口信息转发封装后的所述待转发报文。 一种转发表写入装置, 所述装置包括:
信息提取单元, 配置为针对一条路由转发信息, 从该路由转发信息包 括的出口封装信息中获取指定信息, 所述指定信息为在报文转发过程中, 用于修改报文头的信息;
确定单元, 配置为确定转发表中是否已存储有所述指定信息, 所述转 发表用于保存路由转发信息;
写入单元, 配置为在确定单元确定出转发表中已存储有所述指定信息 时, 将所述指定信息在所述转发表中的地址或地址索引、 该路由转发信息 中包括的路由前缀信息以及出端口信息写入所述转发表的一条转发表条 目; 在确定单元确定出转发表中没有存储有所述指定信息时, 将所述指定 信息写入所述转发表, 并将所述指定信息在所述转发表中的地址或地址索 引、 该路由转发信息中包括的路由前缀信息以及出端口信息写入所述转发 表的一条转发表条目。 一种报文转发装置, 所述装置包括:
接收单元, 配置为接收待转发报文;
解析单元, 配置为对所述待转发报文进行解析, 获得该待转发报文中 携带的路由前缀信息;
查询单元, 配置为利用所述路由前缀信息作为键值, 查询转发表, 确 定该路由前缀信息所在转发表条目中存储的出端口信息以及指定信息在所 述转发表中的地址或地址索引, 所述指定信息为在报文转发过程中, 用于 修改报文头的信息;
封装单元, 配置为利用所述地址或地址索引确定转发表中保存的指定 信息, 利用确定出的指定信息封装所述待转发报文;
转发单元, 配置为根据所述出端口信息转发封装后的所述待转发报文。 根据本发明实施例提供的方案, 可以针对一条待写入转发表的路由转 发信息, 从出口封装信息中获取指定信息, 确定转发表中是否已存储有该 指定信息, 如果已存储, 则相对于现有技术, 可以将该指定信息在转发表 中的地址或地址索引替代出口封装信息写入该路由转发信息对应的转发表 条目, 如果没有存储, 则可以将该指定信息写入转发表, 并将该指定信息 在转发表中的地址或地址索引替代出口封装信息写入该路由转发信息对应 的转发表条目。 通过本发明实施例方案, 可以使得相同的指定信息共用一 个转发表地址, 实现不同的转发表条目对相同的指定信息的共享, 减少转 发表容量的占用, 在不增加转发表容量的情况下, 提高报文转发设备的报 文转发容量, 从而在提高报文转发设备性能的同时节省硬件成本。 并且, 无需重复写入相同的指定信息, 减少向转发表写入的数据数量, 加快路由 转发信息写入转发表的速度。 附图说明
图 1为现有技术提供的报文转发示意图; 图 2为本发明实施例一提供的转发表写入方法的步骤流程图; 图 3为本发明实施例二提供的转发表写入方法的步骤流程图; 图 4为本发明实施例三提供的从出口封装信息获取指定信息的步骤流 程图;
图 5为本发明实施例四提供的报文转发方法的步骤流程图;
图 6为本发明实施例五提供的报文转发方法的步骤流程图;
图 7为本发明实施例六提供的转发表写入装置的结构示意图; 图 8为本发明实施例七提供的报文转发装置的结构示意图。 具体实施方式
在现有技术中, 报文转发设备转发表的每条转发表条目中均需保存有 路由前缀信息、 出口封装信息和出端口信息, 本案发明人通过分析发现, 多条路由转发信息对应的出口封装信息中, 用于修改报文头的信息在很多 情况下是相同的, 例如, 如图 1所示, 从服务商边缘设备 PE2通告到服务 商边缘设备 PE1上的两条路由 2.2.2.2和 3.3.3.3, 它们的目的地址不同, 转 发目的设备相同时, 在两条路由转发信息中, 出口封装信息中用于修改报 文头的内层出标签(配置指定同 VPN为同一标签)、 外层出标签、 下一跳 IP地址、 MAC地址完全相同。 因此, 可以对出口封装信息进行抽象整合获 得用于修改报文头的信息, 实现对用于修改报文头的信息的共享, 减少对 转发表空间的占用, 提高报文转发设备的报文转发容量。 同时, 通过用于 修改报文头的信息的共享还可以减少转发表写表次数, 提高转发表写表速 度。
下面结合说明书附图和各实施例对本发明方案进行说明。
实施例一、
本发明实施例一提供一种转发表写入方法, 用于实现将路由转发信息 写入转发表, 以将一条路由转发信息写入转发表为例, 该方法的步骤流程 可以如图 2所示, 包括:
步骤 101、 从路由转发信息中提取指定信息。
本实施例中各步骤的执行主体为报文转发设备, 可以理解为路由设备 或交换设备。
在本步骤中, 针对需要写入转发表的一条路由转发信息 (路由转发信 息中包括路由前缀信息、 出口封装信息和出端口信息), 报文转发设备从该 路由转发信息包括的出口封装信息中获取指定信息, 所述指定信息为在报 文转发过程中, 用于修改报文头的信息。
在本实施例中, 路由转发信息可以是由报文转发设备通过动态路由协 议或静态配置生成的。
具体的, 报文转发设备可以按照报文转发遵循的协议类型, 从路由转 发信息包括的出口封装信息中获取指定信息。
所述指定信息可以但不限于包括私网标签、私网物理 MAC地址、公网 物理 MAC地址和公网因特网协议 IP地址中的至少一个。
步骤 102、 确定所述指定信息是否已存储。
报文转发设备可以确定用于保存路由转发信息的转发表中, 是否已存 储有所述指定信息。 若确定已存储, 则可以跳转执行步骤 104, 否则, 可以 继续执行步骤 103。
步骤 103、 将所述指定信息写入转发表。
若确定所述指定信息未存储在转发表中, 即在之前写入转发表的路由 转发信息中, 没有路由转发信息与本次需要写入的路由转发信息具有相同 的指定信息时, 在本步骤中, 可以将本次需要写入的路由转发信息中的指 定信息写入转发表。
在本实施例中, 通过将指定信息单独写入转发表, 相同的指定信息可 以共用一个转发表地址, 使得后续可以实现对相同的指定信息的共享。 步骤 104、 将路由转发信息写入转发表。
若确定所述指定信息已存储在转发表中, 在本步骤中, 可以将所述指 定信息在所述转发表中的地址或地址索引、 路由转发信息中包括的路由前 缀信息以及出端口信息写入所述转发表的一条转发表条目, 实现转发表对 该路由转发信息的保存。
在本实施例中, 通过将指定信息在转发表中的地址或地址索引写入转 发表条目, 实现转发表条目对相同的指定信息的共享, 使得相同的指定信 息在一个转发表中只需写入一次, 无需重复写入, 减少向转发表写入的数 据数量, 提高路由转发信息向转发表写入的速度, 同时, 相同的指定信息 在一个转发表中无需重复存储, 减少了转发表空间的占用, 使得相同的转 发表容量可以存储更多的路由转发信息, 可以提高报文转发设备的报文转 发容量。
较优的, 在步骤 103之后, 所述方法还可以包括步骤 104, (步骤 104, 可以在步骤 104之前执行, 也可以在步骤 104之后执行 ):
步骤 104,、 存储指定信息与地址或地址索引的对应关系。
本步骤是一个优选步骤。 为了使得后续可以方便地查找指定信息是否 已在所述转发表中存储, 在步骤 103之后, 报文转发设备可以在预先建立 的对应关系表中增加对应关系表条目, 将写入所述转发表的指定信息、 该 指定信息在所述转发表中的地址或地址索引的对应关系写入该对应关系表 条目。
如果针对每条写入所述转发表的指定信息, 利用步骤 104,提供的方式 系, 则在步骤 101中可以通过以下方式确定指定信息是否已存储:
报文转发设备利用指定信息为键值, 查询所述对应关系表, 确定该对 应关系表中是否有对应关系表条目保存有该指定信息; 若确定所述对应关系表中有对应关系表条目保存有该指定信息, 确定 所述转发表中已存储有该指定信息, 否则, 确定所述转发表中没有存储该 指定信息。
为了避免路由转发信息重复写入转发表, 优选的, 在步骤 103之后, 步骤 104之前还可以包括步骤 103,(步骤 103,和步骤 104,的执行不分先后 ): 步骤 103,、 确定路由前缀信息是否已存储。
本步骤是一个优选步骤。 在本步骤中, 报文转发设备可以确定所述转 发表中, 是否已存储有本次需要写入的路由转发信息中包括的路由前缀信 息。 需要写入的路由转发信息中包括的路由前缀信息) 时, 继续执行步骤 104, 将所述指定信息在所述转发表中的地址或地址索引、 该路由转发信息中包 括的路由前缀信息以及出端口信息写入所述转发表的一条转发表条目, 否 则, 可以结束本流程, 从而防止路由转发信息的重复存储。
需要说明的是, 本实施例中, 还可以针对每条写入转发表的指定信息, 设定一个引用计数值, 该引用计数值的初始值可以为 0, 在步骤 104之后, 可以将为该指定信息设定的引用计数值加 1,使得该引用计数值可以用于表 量。 从而可以在路由转发信息撤消后, 可以通过引用计数值的变化, 在包 括该指定信息在所述转发表中的地址或地址索引的全部转发表条目均删除 时, 回收对应关系表条目占用的空间, 减少系统资源的占用。
实施例一提供的方法可以适用于报文转发设备, 如路由设备或交换设 备。 报文转发设备可以为分布式设备, 也可以为集中式设备。 下面以报文 转发设备为分布式设备为例, 对本发明实施例一的方案进行具体说明。
实施例二、 本发明实施例二提供一种转发表写入方法, 该方法的步骤流程可以如 图 3所示, 包括:
步骤 201、 主控板生成路由转发信息。
在本步骤中, 主控板通过动态路由协议或者静态配置生成新的路由转 发信息, 并将路由转发信息 (包括路由前缀信息、 出口封装信息和出端口 信息) 同步到各个线卡板, 当然, 也可以将路由转发信息同步到该路由转 发信息中的出端口信息表示的出端口所在的线卡板。
针对每个接收到路由转发信息的线卡板, 均可以执行以下操作将路由 转发信息写入转发表。 下面以一个线卡板为例, 对该线卡板将路由转发信 息写入转发表的过程进行说明。
步骤 202、 提取指定信息。
在本步骤中, 线卡板可以按照报文转发遵循的协议类型, 从路由转发 信息包括的出口封装信息中获取指定信息。
步骤 203、 确定指定信息是否已存储。
在本步骤中, 线卡板可以以所述指定信息为关键字, 查询对应关系表 (可以是软件表), 判断是否存在对应关系表条目保存有该指定信息, 如果 不存在则继续执行步骤 204, 否则, 跳转执行步骤 205。
步骤 204、 将指定信息写入转发表。
线卡板在确定所述指定信息尚未写入转发表时, 将所述指定信息写入 转发表。
在线卡板将所述指定信息写入转发表之后, 可以为该指定信息设定引 用计数值, 该引用计数值的初始值为 0。
将所述指定信息写入转发表之后, 线卡板还可以在对应关系表中增加 对应关系表条目, 将所述指定信息与该指定信息在所述转发表中的地址或 地址索引的对应关系写入该对应关系表条目。 当然, 在对应关系表中增加对应关系表条目, 将所述指定信息与该指 定信息在所述转发表中的地址或地址索引的对应关系写入该对应关系表条 目也可以是在将路由转发信息写入转发表之后执行的。
步骤 205、 确定路由前缀信息是否已存储。
在本步骤中, 线卡板可以以路由转发信息包括的路由前缀信息为关键 字, 查询转发表, 判断是否存在转发表条目保存有所述路由前缀信息, 如 果不存在, 则继续执行步骤 206, 否则, 可以结束本流程。 从而在路由转发 信息已经被其他线卡板写入转发表时, 不再向转发表写入该路由转发信息, 避免路由转发信息的重复写入。
步骤 206、 将路由转发信息写入转发表。
在本步骤中, 线卡板可以将所述指定信息在所述转发表中的地址或地 址索引、 所述路由转发信息中包括的路由前缀信息以及出端口信息写入所 述转发表的一条转发表条目, 实现转发表对该路由转发信息的保存。
较优的, 将路由转发信息写入转发表之后, 还可以将为所述指定信息 设定的引用计数值加 1,使得该引用计数值可以用于表示包括该指定信息在 优选的, 如果为所述指定信息设定了引用计数值, 则在本实施例中, 还可以在所述路由转发信息撤销时, 将所述引用计数值减 1, 在所述引用计 数值为 0 时, 删除保存有所述指定信息的对应关系表条目。 从而可以通过 引用计数值的变化, 确定包含该指定信息在所述转发表中的地址或地址索 引的全部转发表条目是否删除, 在包含该指定信息在所述转发表中的地址 或地址索引的全部转发表条目均删除时, 回收对应关系表中对应关系表条 目占用的空间, 减少对系统资源的占用。
优选地, 所述方法还可以包括步骤 207:
步骤 207、 更新引用计数值。 在本步骤中, 报文转发设备可以在所述路由转发信息撤销时, 将为所 述指定信息设定的引用计数值减 1, 并在所述引用计数值为 0时, 删除对应 关系表中保存有所述指定信息的对应关系表条目。
如果实施例二中报文转发设备为集中式设备, 则实施例二中各步骤的 执行主体可以理解为集成板。
下面对本发明实施例一中涉及的从出口封装信息获取指定信息的方法 进行说明。
实施例三、
本发明实施例三提供的方法的步骤流程可以如图 4所示, 包括: 步骤 301、 生成路由转发信息。
在本步骤中, 报文转发设备可以通过动态路由协议或者静态配置生成 新的路由转发信息, 路由转发信息可以包括路由前缀信息、 出口封装信息 和出端口信息。
具体的, 如果通过等价多路径 ( ECMP, Equal-cost Multi-path )或快速 重路由 (FRR, Fast ReRoute )获得多条路径, 需要针对每条路径生成一条 路由转发信息。
步骤 302、 确定报文转发遵循的协议类型。
假设在本实施例中, 报文转发设备报文转发遵循三层路由协议, 因此, 可以确定需要从出口封装信息中获取以下指定信息: 私网标签、 私网物理 ( MAC )地址、 公网物理 MAC地址和公网因特网协议( IP )地址。
当然, 还可以结合实际转发需要确定从出口封装信息中获取的指定信 息, 如, 可以确定需要从出口封装信息中获取以下指定信息: 私网物理 ( MAC )地址和公网因特网协议( IP )地址, 不需要获取私网 VPN标签和 公网标签。
步骤 303、 获取指定信息。 在本步骤中, 针对一条路由转发信息, 可以按层次从出口封装信息中 获取指定信息, 如按照从报文封装的内层到外层, 和 /或从报文封装的三层 到二层的顺序, 获得指定信息。
通过将出口封装信息抽象整合为指定信息, 即使针对不同的出口封装 信息, 也可能得到相同的指定信息, 并可以实现相同指定信息的共享, 比 如针对通过地址解析协议(ARP, Address Resolution Protocol ), IP ECMP、 IP FRR获得的出口封装信息,经过抽象整合后可以得到相同的下一跳 IP地 址和 MAC地址。 同理, 针对出口封装信息中的 L3VPN外层 LDP、 L3VPN 外层 LDP ECMP/FRR/TE/TE FRR、 L3VPN FRR外层 LDP/LDP FRR/LDP ECMP/TE/TE FRR, 经过抽象整合后可能得到相同的私网 VPN标签、 私网 MAC地址、 公网标签、 下一跳 IP地址和公网 MAC地址。
需要说明的是, 若报文转发设备为分布式设备, 则步骤 303 可以由主 控板执行, 也可以由线卡板执行。
在本发明实施例一〜实施例三提供的方案的基础上, 本发明实施例四提 供一种报文转发方法。
实施例四、
本发明实施例四提供一种报文转发方法,该方法的步骤流程可以如图 5 所示, 包括:
步骤 401、 接收待转发报文。
步骤 402、 解析待转发报文。
报文转发设备可以进行报文解析, 提取报文中的路由前缀信息。
步骤 403、确定出端口信息, 以及指定信息在转发表中的地址或地址索 引。
在本步骤中, 报文转发设备可以将路由前缀信息作为关键字, 查询转 发表, 确定该路由前缀信息所在转发表条目中存储的出端口信息以及指定 信息在所述转发表中的地址或地址索引。
步骤 404、 封装待转发报文。
在本步骤中, 报文转发设备可以利用所述地址或地址索引确定转发表 中保存的指定信息, 并利用确定出的出口封装信息封装所述待转发报文。
步骤 405、 转发报文。
在本步骤中, 报文转发设备可以根据所述出端口信息转发封装后的所 述待转发报文。
下面以报文转发设备为分布式设备, 实现三层报文转发为例, 对本发 明实施例四的方案进行具体说明。
实施例五、
本发明实施例五提供一种报文转发方法,该方法的步骤流程可以如图 6 所示, 包括:
步骤 501、 接收待转发报文。
本步骤包括, 第一线卡板接收三层报文。
步骤 502、 解析待转发报文。
本步骤包括, 第一线卡板进行报文解析, 提取三层报文中的路由前缀 信息。
步骤 503、确定出端口信息, 以及指定信息在转发表中的地址或地址索 引。
在本步骤中, 第一线卡板可以根据路由前缀信息查询转发表, 获取出 端口信息、 以及指定信息对应在转发表中的地址或地址索引。
步骤 504、 发送待转发报文。
在本步骤中, 第一线卡板可以根据出端口信息确定出端口, 将待转发 报文, 以及指定信息对应在转发表中的地址或地址索引发送到出端口所在 的第二线卡板。 具体的, 第一线卡板可以将待转发报文, 以及指定信息对应在转发表 中的地址或地址索引发送到主控板, 然后由主控板将待转发报文, 以及指 定信息对应在转发表中的地址或地址索引发送到出端口所在的第二线卡 板。
步骤 505、 封装待转发报文。 指定信息封装所述待转发报文, 即可以理解为第二线卡板根据指定信息修 改报文头中的 IP地址、 MAC地址、 公网标签、 私网标签等信息。
当然, 封装待转发报文可以也可以是在第一线卡板上实现的。 并可以 在封装完成后, 将封装后的待转发报文发送至第二线卡板。 即在步骤 503 之后, 第一线卡板可以执行步骤 505,封装待转发报文, 然后执行步骤 504, 将封装后的待转发报文转发到第二线卡板, 且第二可以继续执行步骤 506。
步骤 506、 转发报文。
在本步骤中, 第二线卡板可以根据所述出端口信息转发封装后的所述 待转发报文。
与本发明实施例一〜实施例五基于同一发明构思, 提供以下的装置。 实施例六、
本发明实施例六提供一种转发表写入装置, 该装置可以集成于路由设 备或交换设备, 该装置的结构可以如图 7所示, 包括:
信息提取单元 11配置为针对一条路由转发信息, 从该路由转发信息包 括的出口封装信息中获取指定信息, 所述指定信息为在报文转发过程中, 用于修改报文头的信息; 确定单元 12配置为确定转发表中是否已存储有所 述指定信息, 所述转发表用于保存路由转发信息; 写入单元 13配置为在确 定单元确定出转发表中已存储有所述指定信息时, 将所述指定信息在所述 转发表中的地址或地址索引、 该路由转发信息中包括的路由前缀信息以及 出端口信息写入所述转发表的一条转发表条目; 在确定单元确定出转发表 中没有存储有所述指定信息时, 将所述指定信息写入所述转发表, 并将所 述指定信息在所述转发表中的地址或地址索引、 该路由转发信息中包括的 路由前缀信息以及出端口信息写入所述转发表的一条转发表条目。
所述信息提取单元 11具体配置为按照报文转发遵循的协议类型, 从该 路由转发信息包括的出口封装信息中获取指定信息。
所述装置还包括对应关系建立单元 14:
对应关系建立单元 14配置为写入单元将所述指定信息写入所述转发表 之后, 在预先建立的对应关系表中增加对应关系表条目, 将所述指定信息 与该指定信息在所述转发表中的地址或地址索引的对应关系写入该对应关 系表条目。
所述确定单元 12具体配置为利用所述指定信息为键值, 查询对应关系 表, 确定所述对应关系表中是否有对应关系表条目保存有所述指定信息; 若确定所述对应关系表中有对应关系表条目保存有所述指定信息, 确定转 发表中已存储有所述指定信息, 否则, 确定转发表中没有存储所述指定信 息。
所述装置还包括计数单元 15:
计数单元 15配置为写入单元将所述指定信息在所述转发表中的地址或 地址索引、 该路由转发信息中包括的路由前缀信息以及出端口信息写入所 述转发表的一条转发表条目之后, 将为该指定信息设定的引用计数值加 1, 该引用计数值用于表示包括该指定信息在所述转发表中的地址或地址索引 的转发表条目的数量, 且该引用计数值的初始值为 0。
所述计数单元 15还配置为在所述路由转发信息撤销时, 将为所述指定 信息设定的引用计数值减 1, 并在所述引用计数值为 0时, 删除对应关系表 中保存有所述指定信息的对应关系表条目。 所述写入单元 13具体配置为将所述指定信息在所述转发表中的地址或 地址索引、 该路由转发信息中包括的路由前缀信息以及出端口信息写入所 述转发表的一条转发表条目之前, 利用所述路由前缀信息为键值, 查询所 述转发表, 确定所述转发表中是否有转发表条目保存有所述路由前缀信息; 指定信息在所述转发表中的地址或地址索引、 该路由转发信息中包括的所 路由前缀信息以及出端口信息写入所述转发表的一条转发表条目。
实施例七、
本发明实施例七提供一种报文转发装置, 该装置可以集成于路由设备 或交换设备, 该装置的结构可以如图 8所示, 包括:
接收单元 21配置为接收待转发报文; 解析单元 22配置为对所述待转 发报文进行解析, 获得该待转发报文中携带的路由前缀信息; 查询单元 23 配置为利用所述路由前缀信息作为键值, 查询转发表, 确定该路由前缀信 息所在转发表条目中存储的出端口信息以及指定信息在所述转发表中的地 址或地址索引, 所述指定信息为在报文转发过程中, 用于修改报文头的信 息; 封装单元 24配置为利用所述地址或地址索引确定转发表中保存的指定 信息, 利用确定出的指定信息封装所述待转发报文; 转发单元 25配置为根 据所述出端口信息转发封装后的所述待转发报文。
本领域内的技术人员应明白, 本申请的实施例可提供为方法、 系统、 或计算机程序产品。 因此, 本申请可采用完全硬件实施例、 完全软件实施 例、 或结合软件和硬件方面的实施例的形式。 而且, 本申请可采用在一个 或多个其中包含有计算机可用程序代码的计算机可用存储介质 (包括但不 限于磁盘存储器、 CD-ROM、 光学存储器等)上实施的计算机程序产品的 形式。
本申请是参照根据本申请实施例的方法、 设备(系统)、 和计算机程序 产品的流程图和 /或方框图来描述的。 应理解可由计算机程序指令实现流 程图和 /或方框图中的每一流程和 /或方框、 以及流程图和 /或方框图中 的流程和 /或方框的结合。 可提供这些计算机程序指令到通用计算机、 专 用计算机、 嵌入式处理机或其他可编程数据处理设备的处理器以产生一个 机器, 使得通过计算机或其他可编程数据处理设备的处理器执行的指令产 生用于实现在流程图一个流程或多个流程和 /或方框图一个方框或多个方 框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理 设备以特定方式工作的计算机可读存储器中, 使得存储在该计算机可读存 储器中的指令产生包括指令装置的制造品, 该指令装置实现在流程图一个 流程或多个流程和 /或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备 上, 使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机 实现的处理, 从而在计算机或其他可编程设备上执行的指令提供用于实现 在流程图一个流程或多个流程和 /或方框图一个方框或多个方框中指定的 功能的步骤。
尽管已描述了本申请的优选实施例, 但本领域内的技术人员一旦得知 了基本创造性概念, 则可对这些实施例做出另外的变更和修改。 所以, 所 附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和 修改。
显然, 本领域的技术人员可以对本申请进行各种改动和变型而不脱离 本申请的精神和范围。 这样, 倘若本申请的这些修改和变型属于本申请权 利要求及其等同技术的范围之内, 则本申请也意图包含这些改动和变型在 内。

Claims

权利要求书
1、 一种转发表写入方法, 所述方法包括:
针对一条路由转发信息, 报文转发设备从该路由转发信息包括的出口 封装信息中获取指定信息, 所述指定信息为在报文转发过程中, 用于修改 报文头的信息;
报文转发设备确定转发表中是否已存储有所述指定信息, 所述转发表 用于保存路由转发信息:
若是, 则报文转发设备将所述指定信息在所述转发表中的地址或地址 索引、 该路由转发信息中包括的路由前缀信息以及出端口信息写入所述转 发表的一条转发表条目;
否则, 报文转发设备将所述指定信息写入所述转发表, 并将所述指定 信息在所述转发表中的地址或地址索引、 该路由转发信息中包括的路由前 缀信息以及出端口信息写入所述转发表的一条转发表条目。
2、 如权利要求 1所述的方法, 其中, 报文转发设备从该路由转发信息 包括的出口封装信息中获取指定信息, 包括:
报文转发设备按照报文转发遵循的协议类型, 从该路由转发信息包括 的出口封装信息中获取指定信息。
3、 如权利要求 1所述的方法, 其中, 所述指定信息包括私网标签、 私 网物理 MAC地址、 公网物理 MAC地址和公网因特网协议 IP地址中的至 少一个。
4、 如权利要求 1~3任一所述的方法, 其中, 报文转发设备将所述指定 信息写入所述转发表之后, 所述方法还包括:
报文转发设备在预先建立的对应关系表中增加对应关系表条目, 将所 述指定信息与该指定信息在所述转发表中的地址或地址索引的对应关系写 入该对应关系表条目。
5、 如权利要求 1~3任一所述的方法, 其中, 报文转发设备确定转发表 中是否已存储有所述指定信息, 包括:
报文转发设备利用所述指定信息为键值, 查询对应关系表, 确定所述 对应关系表中是否有对应关系表条目保存有所述指定信息;
若确定所述对应关系表中有对应关系表条目保存有所述指定信息, 确 定转发表中已存储有所述指定信息, 否则, 确定转发表中没有存储所述指 定信息。
6、 如权利要求 1~3任一所述的方法, 其中, 报文转发设备将所述指定 信息在所述转发表中的地址或地址索引、 该路由转发信息中包括的路由前 缀信息以及出端口信息写入所述转发表的一条转发表条目之后, 所述方法 还包括:
报文转发设备将为该指定信息设定的引用计数值加 1,该引用计数值用 数量, 且该引用计数值的初始值为 0。
7、 如权利要求 6所述的方法, 其中, 所述方法还包括:
报文转发设备在所述路由转发信息撤销时, 将为所述指定信息设定的 引用计数值减 1, 并在所述引用计数值为 0时, 删除对应关系表中保存有所 述指定信息的对应关系表条目。
8、 如权利要求 1~3任一所述的方法, 其中, 报文转发设备将所述指定 信息在所述转发表中的地址或地址索引、 该路由转发信息中包括的路由前 缀信息以及出端口信息写入所述转发表的一条转发表条目之前, 所述方法 还包括:
报文转发设备利用所述路由前缀信息为键值, 查询所述转发表, 确定 所述转发表中是否有转发表条目保存有所述路由前缀信息;
则, 报文转发设备将所述指定信息在所述转发表中的地址或地址索引、 该路由转发信息中包括的路由前缀信息以及出端口信息写入所述转发表的 一条转发表条目, 包括: 缀信息时, 将所述指定信息在所述转发表中的地址或地址索引、 该路由转 发信息中包括的路由前缀信息以及出端口信息写入所述转发表的一条转发 表条目。
9、 一种报文转发方法, 所述方法包括:
报文转发设备接收待转发报文;
报文转发设备对所述待转发报文进行解析, 获得该待转发报文中携带 的路由前缀信息;
报文转发设备利用所述路由前缀信息作为键值, 查询转发表, 确定该 路由前缀信息所在转发表条目中存储的出端口信息以及指定信息在所述转 发表中的地址或地址索引, 所述指定信息为在报文转发过程中, 用于修改 报文头的信息;
报文转发设备利用所述地址或地址索引确定转发表中保存的指定信 息, 利用确定出的指定信息封装所述待转发报文;
报文转发设备根据所述出端口信息转发封装后的所述待转发报文。
10、 一种转发表写入装置, 所述装置包括:
信息提取单元, 配置为针对一条路由转发信息, 从该路由转发信息包 括的出口封装信息中获取指定信息, 所述指定信息为在报文转发过程中, 用于修改报文头的信息;
确定单元, 配置为确定转发表中是否已存储有所述指定信息, 所述转 发表用于保存路由转发信息;
写入单元, 配置为在确定单元确定出转发表中已存储有所述指定信息 时, 将所述指定信息在所述转发表中的地址或地址索引、 该路由转发信息 中包括的路由前缀信息以及出端口信息写入所述转发表的一条转发表条 目; 在确定单元确定出转发表中没有存储有所述指定信息时, 将所述指定 信息写入所述转发表, 并将所述指定信息在所述转发表中的地址或地址索 引、 该路由转发信息中包括的路由前缀信息以及出端口信息写入所述转发 表的一条转发表条目。
11、 如权利要求 10所述的装置, 其中, 所述信息提取单元, 配置为按 照报文转发遵循的协议类型, 从该路由转发信息包括的出口封装信息中获 取指定信息。
12、 如权利要求 10或 11所述的装置, 其中, 所述装置还包括: 对应关系建立单元, 配置为写入单元将所述指定信息写入所述转发表 之后, 在预先建立的对应关系表中增加对应关系表条目, 将所述指定信息 与该指定信息在所述转发表中的地址或地址索引的对应关系写入该对应关 系表条目。
13、 如权利要求 10或 11所述的装置, 其中, 所述确定单元, 配置为 利用所述指定信息为键值, 查询对应关系表, 确定所述对应关系表中是否 有对应关系表条目保存有所述指定信息; 若确定所述对应关系表中有对应 关系表条目保存有所述指定信息, 确定转发表中已存储有所述指定信息, 否则, 确定转发表中没有存储所述指定信息。
14、 如权利要求 10或 11所述的装置, 其中, 所述装置还包括: 计数单元, 配置为写入单元将所述指定信息在所述转发表中的地址或 地址索引、 该路由转发信息中包括的路由前缀信息以及出端口信息写入所 述转发表的一条转发表条目之后, 将为该指定信息设定的引用计数值加 1, 该引用计数值用于表示包括该指定信息在所述转发表中的地址或地址索引 的转发表条目的数量, 且该引用计数值的初始值为 0。
15、 如权利要求 14所述的装置, 其中, 所述计数单元, 还配置为在所 述路由转发信息撤销时, 将为所述指定信息设定的引用计数值减 1, 并在所 述引用计数值为 0 时, 删除对应关系表中保存有所述指定信息的对应关系 表条目。
16、 如权利要求 10或 11所述的装置, 其中, 所述写入单元, 配置为 将所述指定信息在所述转发表中的地址或地址索引、 该路由转发信息中包 括的路由前缀信息以及出端口信息写入所述转发表的一条转发表条目之 前, 利用所述路由前缀信息为键值, 查询所述转发表, 确定所述转发表中 是否有转发表条目保存有所述路由前缀信息; 并在确定所述转发表中没有 转发表条目保存有所述路由前缀信息时, 将所述指定信息在所述转发表中 的地址或地址索引、 该路由转发信息中包括的路由前缀信息以及出端口信 息写入所述转发表的一条转发表条目。
17、 一种报文转发装置, 所述装置包括:
接收单元, 配置为接收待转发报文;
解析单元, 配置为对所述待转发报文进行解析, 获得该待转发报文中 携带的路由前缀信息;
查询单元, 配置为利用所述路由前缀信息作为键值, 查询转发表, 确 定该路由前缀信息所在转发表条目中存储的出端口信息以及指定信息在所 述转发表中的地址或地址索引, 所述指定信息为在报文转发过程中, 用于 修改报文头的信息;
封装单元, 配置为利用所述地址或地址索引确定转发表中保存的指定 信息, 利用确定出的指定信息封装所述待转发报文;
转发单元, 配置为根据所述出端口信息转发封装后的所述待转发报文。
PCT/CN2013/081231 2012-08-20 2013-08-09 一种转发表写入、报文转发方法及装置 WO2014029278A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210296875.1A CN102857414B (zh) 2012-08-20 2012-08-20 一种转发表写入、报文转发方法及装置
CN201210296875.1 2012-08-20

Publications (1)

Publication Number Publication Date
WO2014029278A1 true WO2014029278A1 (zh) 2014-02-27

Family

ID=47403618

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/081231 WO2014029278A1 (zh) 2012-08-20 2013-08-09 一种转发表写入、报文转发方法及装置

Country Status (2)

Country Link
CN (1) CN102857414B (zh)
WO (1) WO2014029278A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113162857A (zh) * 2016-01-18 2021-07-23 华为技术有限公司 按需获取路由的方法及网关
CN114090313A (zh) * 2021-10-31 2022-02-25 新华三技术有限公司合肥分公司 一种转发表生成方法及装置
CN114338528A (zh) * 2021-12-23 2022-04-12 锐捷网络股份有限公司 一种表项的查询方法及装置
CN115065632A (zh) * 2022-03-31 2022-09-16 重庆金美通信有限责任公司 一种轻量化的树形网络数据转发方法

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102857414B (zh) * 2012-08-20 2018-05-04 中兴通讯股份有限公司 一种转发表写入、报文转发方法及装置
CN104301225B (zh) * 2013-07-17 2017-12-29 华为技术有限公司 一种流转发方法和通信设备
CN105791107A (zh) * 2014-12-22 2016-07-20 中兴通讯股份有限公司 一种acl规则的配置方法、匹配方法及相关装置
CN107547409B (zh) * 2016-06-24 2020-12-25 华为技术有限公司 一种路由查找方法、装置和路由设备
CN106357446B (zh) * 2016-09-20 2019-07-09 杭州迪普科技股份有限公司 一种流量转发路径的获取方法及装置
CN108259346B (zh) * 2017-01-25 2020-08-04 新华三技术有限公司 一种等价路由表项建立方法和装置
CN107086960B (zh) * 2017-02-28 2020-06-09 新华三技术有限公司 一种报文传输方法和装置
CN111026324B (zh) * 2018-10-09 2021-11-19 华为技术有限公司 转发表项的更新方法及装置
CN110233801B (zh) * 2019-05-31 2021-08-17 北京星网锐捷网络技术有限公司 路由更新方法及装置
CN110661713B (zh) * 2019-10-22 2021-09-21 新华三信息安全技术有限公司 一种报文转发方法及装置
CN115604186A (zh) * 2021-07-09 2023-01-13 华为技术有限公司(Cn) 路由方法及相关设备
CN115334035B (zh) * 2022-07-15 2023-10-10 天翼云科技有限公司 一种报文转发方法、装置、电子设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1921453A (zh) * 2006-09-25 2007-02-28 杭州华为三康技术有限公司 Mpls有序方式下lsp中间节点标签分配方法及装置
CN101577676A (zh) * 2009-06-10 2009-11-11 杭州华三通信技术有限公司 一种实现粘性访问的方法和装置
US7822033B1 (en) * 2005-12-30 2010-10-26 Extreme Networks, Inc. MAC address detection device for virtual routers
CN102857414A (zh) * 2012-08-20 2013-01-02 中兴通讯股份有限公司 一种转发表写入、报文转发方法及装置

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101197787B (zh) * 2008-01-03 2010-08-25 杭州华三通信技术有限公司 一种报文信息学习方法和装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7822033B1 (en) * 2005-12-30 2010-10-26 Extreme Networks, Inc. MAC address detection device for virtual routers
CN1921453A (zh) * 2006-09-25 2007-02-28 杭州华为三康技术有限公司 Mpls有序方式下lsp中间节点标签分配方法及装置
CN101577676A (zh) * 2009-06-10 2009-11-11 杭州华三通信技术有限公司 一种实现粘性访问的方法和装置
CN102857414A (zh) * 2012-08-20 2013-01-02 中兴通讯股份有限公司 一种转发表写入、报文转发方法及装置

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113162857A (zh) * 2016-01-18 2021-07-23 华为技术有限公司 按需获取路由的方法及网关
CN114090313A (zh) * 2021-10-31 2022-02-25 新华三技术有限公司合肥分公司 一种转发表生成方法及装置
CN114090313B (zh) * 2021-10-31 2024-04-12 新华三技术有限公司合肥分公司 一种转发表生成方法及装置
CN114338528A (zh) * 2021-12-23 2022-04-12 锐捷网络股份有限公司 一种表项的查询方法及装置
CN114338528B (zh) * 2021-12-23 2023-06-16 锐捷网络股份有限公司 一种表项的查询方法及装置
CN115065632A (zh) * 2022-03-31 2022-09-16 重庆金美通信有限责任公司 一种轻量化的树形网络数据转发方法
CN115065632B (zh) * 2022-03-31 2023-11-17 重庆金美通信有限责任公司 一种轻量化的树形网络数据转发方法

Also Published As

Publication number Publication date
CN102857414B (zh) 2018-05-04
CN102857414A (zh) 2013-01-02

Similar Documents

Publication Publication Date Title
WO2014029278A1 (zh) 一种转发表写入、报文转发方法及装置
US9485141B1 (en) Constrained route distribution for multiple virtual private network services
US9584398B2 (en) Methods and apparatus to utilize route parameter sets for exchanging routes in a communication network
WO2021258754A1 (zh) 报文指示方法、装置、设备和存储介质
US9143429B2 (en) Identifying an egress point to a network location
WO2017000878A1 (zh) 报文处理
US9369293B2 (en) Compressing singly linked lists sharing common nodes for multi-destination group expansion
US10313154B2 (en) Packet forwarding
US9838243B2 (en) Transformative requests
US10791051B2 (en) System and method to bypass the forwarding information base (FIB) for interest packet forwarding in an information-centric networking (ICN) environment
CN109714274B (zh) 一种获取对应关系的方法和路由设备
WO2015043327A1 (zh) 路由方法、设备和系统
CN105991433B (zh) 三层虚拟专用网接入二层虚拟专用网的方法和装置
US10511547B2 (en) Multicast data packet forwarding
US10313275B2 (en) Packet forwarding
US9391896B2 (en) System and method for packet forwarding using a conjunctive normal form strategy in a content-centric network
WO2013139270A1 (zh) 实现三层虚拟专用网络的方法、设备及系统
CN102474451B (zh) 连接内层和外层mpls标签
EP3166263B1 (en) Routing calculation method and device for trill isis
CN106453091B (zh) 路由器转发平面的等价路由管理方法和装置
US10313274B2 (en) Packet forwarding
CN112437008B (zh) 网络路由收敛处理和报文处理方法、装置及设备
WO2013023509A1 (zh) 一种报文收发方法、装置和系统
US20130177019A1 (en) Scaling ipv4 at large datacenters with device level aggregation
WO2014067055A1 (zh) 流表刷新的方法及装置

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: 13831689

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: 13831689

Country of ref document: EP

Kind code of ref document: A1