WO2020043200A1 - 建立快速转发表 - Google Patents

建立快速转发表 Download PDF

Info

Publication number
WO2020043200A1
WO2020043200A1 PCT/CN2019/103795 CN2019103795W WO2020043200A1 WO 2020043200 A1 WO2020043200 A1 WO 2020043200A1 CN 2019103795 W CN2019103795 W CN 2019103795W WO 2020043200 A1 WO2020043200 A1 WO 2020043200A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
forwarding table
resource utilization
communication message
service
Prior art date
Application number
PCT/CN2019/103795
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 新华三信息安全技术有限公司
Priority to JP2021510359A priority Critical patent/JP7101308B2/ja
Priority to US17/271,454 priority patent/US11646976B2/en
Priority to EP19854078.3A priority patent/EP3832960B1/en
Publication of WO2020043200A1 publication Critical patent/WO2020043200A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/50Network service management, e.g. ensuring proper service fulfilment according to agreements
    • H04L41/5003Managing SLA; Interaction between SLA and QoS
    • H04L41/5006Creating or negotiating SLA contracts, guarantees or penalties
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/30Routing of multiclass traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/50Network service management, e.g. ensuring proper service fulfilment according to agreements
    • H04L41/5003Managing SLA; Interaction between SLA and QoS
    • H04L41/5019Ensuring fulfilment of SLA
    • H04L41/5022Ensuring fulfilment of SLA by giving priorities, e.g. assigning classes of service
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/02Capturing of monitoring data
    • H04L43/026Capturing of monitoring data using flow identification
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • H04L43/0882Utilisation of link capacity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/742Route cache; Operation thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • H04L47/2408Traffic characterised by specific attributes, e.g. priority or QoS for supporting different services, e.g. a differentiated services [DiffServ] type of service
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • H04L47/80Actions related to the user profile or the type of traffic
    • H04L47/805QOS or priority aware

Definitions

  • the network equipment set in the network usually includes an access switch, an aggregation switch, and a core switch.
  • the user terminal can access the access switch
  • the access switch is connected to the aggregation switch
  • the aggregation switch is connected to the core switch
  • the core switch is connected to the egress router
  • the egress router is connected to the external network to realize data transmission between the user terminal and the external network.
  • a network device (such as a core switch) is usually provided with a fast forwarding function.
  • the processing process of the network device for processing packets is shown below.
  • the network device After the network device receives a communication message, if the fast forwarding table corresponding to the communication message is not currently established, the network device will forward the communication message by looking up the routing table, and then generate the communication message in the local cache.
  • the fast forwarding table may include information such as the quintuple information, the inbound interface, and the outbound interface of the communication packet.
  • the network device identifies the messages belonging to the same data stream according to the information in the messages (such as the quintuple information).
  • the network device If the network device subsequently receives a communication message having the same quintuple information (that is, a communication message belonging to the same data stream), the network device forwards the message according to the fast forwarding table, and the network device does not need to search the routing table. In this way, the message forwarding time can be reduced and the message forwarding efficiency can be improved.
  • FIG. 1 is a schematic diagram of a network system according to an embodiment of the present application.
  • FIG. 2 is a flowchart of a method for establishing a fast forwarding table according to an embodiment of the present application
  • FIG. 3 is a flowchart of a method for establishing a fast forwarding table according to an embodiment of the present application
  • FIG. 4 is a schematic structural diagram of an apparatus for establishing a fast forwarding table according to an embodiment of the present application
  • FIG. 5 is a schematic structural diagram of an apparatus for establishing a fast forwarding table according to an embodiment of the present application
  • FIG. 6 is a schematic structural diagram of an apparatus for establishing a fast forwarding table according to an embodiment of the present application
  • FIG. 7 is a schematic structural diagram of an apparatus for establishing a fast forwarding table according to an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a device for establishing a fast forwarding table according to an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of an apparatus for establishing a fast forwarding table according to an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of a network device according to an embodiment of the present application.
  • the embodiment of the present application provides a method for establishing a fast forwarding table.
  • the method is applied to a network device.
  • the network device may be an access switch, an aggregation switch, a core switch, etc.
  • the network device may also be a router, a firewall, or an AC (Access Controller, access controller) and other physical devices, and the network device may also be a logical device with the above functions.
  • AC Access Controller, access controller
  • the network device may implement the embodiments of the present application, and the specific form of the embodiments of the present application is not particularly limited.
  • the method for establishing a fast forwarding table provided in the embodiments of the present application can be applied to an application scenario of a campus network.
  • the campus network can include multiple user terminals.
  • a school includes a research and development building and an administrative building.
  • Each building can have multiple user terminals.
  • FIG. 1 it is a schematic diagram of a network architecture of a campus network according to an embodiment of the present application.
  • the network architecture includes network equipment, user terminals in a research and development building, and user terminals in an administrative building. Each user terminal is Connect to and communicate with network devices.
  • the campus network can be divided into three parts: network egress, data center, and user access.
  • the egress router, core switch, and access device can be set in the campus network.
  • the access device can be the user access part
  • the egress router can be the network egress part
  • the core switch is connected to the egress router, data center, and access device respectively.
  • the access device may include an access switch and an aggregation switch.
  • the user terminal is connected to the access switch to connect the user terminal to the campus network
  • the access switch is connected to the aggregation switch
  • the aggregation switch is connected to the core switch
  • the core switch is used to forward communication packets at high speed to complete the data center and the user terminal.
  • the core switch can also forward communication packets to the egress router and the egress router to the external network to implement data communication between the internal network and the external network.
  • the network device After the network device receives the communication message, it will determine the target service that matches the communication message according to the preset message processing policy and the service matching rules set by the message processing policy. The specific processing process will follow Will explain in detail. After the network device determines the target service that matches the communication message, it can obtain the target priority of the target service and determine the target resource utilization corresponding to the target priority based on the correspondence between the preset priority and the resource utilization threshold. Threshold. Then, the network device judges whether the current resource utilization exceeds the target resource utilization threshold, and if the current resource utilization does not exceed the target resource utilization threshold, it establishes a fast forwarding table corresponding to the communication message.
  • a fast forwarding table corresponding to the communication message is generated in a local cache, and the fast forwarding table may include information such as quintuple information of the communication message, an inbound interface, and an outbound interface.
  • the network device identifies the messages belonging to the same data stream according to the information in the messages (such as the quintuple information).
  • the network device If the network device subsequently receives a communication message with the same quintuple information (that is, a communication message belonging to the same data stream), the network device does not need to look up the routing table. Instead, it can find the quintuple information by matching the communication message to find the The fast forwarding table corresponding to the communication message, thereby forwarding the message. In this way, the message forwarding time can be reduced and the message forwarding efficiency can be improved.
  • a large number of user terminals are usually gathered in the network. When these user terminals communicate with each other, a large number of fast forwarding tables are established in the network devices, resulting in insufficient memory of the network devices, affecting the performance of the network devices, and even causing the devices to hang Dead or restart.
  • a fast forwarding table may be selectively established for communication packets of some data streams, and a fast forwarding table may not be established for communication packets of each data stream, which reduces the memory pressure of the network device and prevents the network device from hanging. Or restart.
  • the embodiment of the present application is to establish a fast forwarding table for all messages or close the fast forwarding table, and modify it to determine the service packets for which fast forwarding tables can be established according to the priorities of different services. No fast forwarding table is established for any service packets.
  • the priority of the service can also be flexibly configured, and the network device can determine whether to establish or not to establish a fast forwarding table according to the configured priority, so as to flexibly establish the fast forwarding table.
  • the embodiment of the present application first describes the process of configuring the priorities of each service, as follows.
  • a rule for establishing a fast forwarding table may be configured in a network device in advance. Specifically, a set of command lines may be added to enable the network device running the set of command lines to establish or not establish a fast forwarding table according to the priority of the service. After you configure and run this set of command lines on a network device, the network device can determine which service packets can establish a fast forwarding table according to the priority of each service, and which service packets can not be established a fast forwarding table.
  • a command line in the set of command lines is as follows.
  • each service can also be configured, and each priority corresponds to a different establishment rule of the fast forwarding table.
  • level 3 is the highest priority.
  • level 2 is medium priority.
  • Level When receiving a communication packet that matches a service with priority level 2 and if the resource utilization is less than the resource utilization threshold, a fast forwarding table corresponding to the communication message is established.
  • the fast forwarding table corresponding to the communication message is not established or the fast forwarding table is cleared; level 1 is a low priority, and no fast communication is established when a communication message matching a service with priority level 1 is received. Forwarding table.
  • the priority of the NAT service can be configured as the highest priority.
  • a command line in the command line of the group can be:
  • NAT level 3 // indicates that the NAT (Network Address Translation) service is set to the highest priority, and a fast forwarding table can be established.
  • the priority of the AFT service can be configured as the highest priority.
  • a command line in the set of command lines can be:
  • [H3C-ipf-xx] module AFT level 3 // Indicates that AFT (Address Family Translation) service is set to the highest priority, and a fast forwarding table can be established.
  • the priority of the ASPF service can be configured to be a medium priority.
  • a command line in the set of command lines can be:
  • ASPF level 2 // Indicates that ASPF (Advanced Stateful Packet Filter) service is set to medium priority.
  • ASPF Advanced Stateful Packet Filter
  • a network device After a network device receives a command to configure the priority of a service, it stores the priority of the service in the configuration information of the service for subsequent processing.
  • the configuration information of the service may also include information such as matching rules of the service.
  • the matching rule may include preset matching items, such as quintuple information.
  • different services can be configured with the same priority, and different services can be configured with different priorities.
  • the number of priorities may not be limited to three.
  • each priority may correspond to a different resource utilization threshold, and the specific processing process will be described in detail later.
  • the priority configuration methods of the foregoing services are only examples, and the priority corresponding to each service can be configured by a technician according to the service requirements, which is not limited in the embodiment of the present application.
  • a network device establishes a fast forwarding table for all communication packets.
  • the network device can determine the priority of the target service that matches the communication message, or the priority of the target service that matches the communication message, and the resource utilization threshold corresponding to the priority. To determine whether a fast forwarding table needs to be established. In this way, a fast forwarding table can be selectively established for communication packets of some data streams, which reduces the memory pressure of the network device and prevents the network device from hanging or restarting.
  • the processing procedure of the method for establishing a fast forwarding table may include the following steps.
  • Step 201 When a network device receives a communication message, it determines a target service that matches the communication message according to the service matching rule set by the message processing policy.
  • the target service that matches the communication message may be one or multiple.
  • the network device may have processing functions of multiple services, such as a NAT service, an AFT service, and an ASPF service.
  • the network device may be preset with a message processing policy, and the network device may determine a target service that matches the communication message according to a service matching rule set by the message processing policy.
  • the message processing strategy may include a message matching process (that is, a matching order of each service), and a matching rule for each service.
  • the network device may determine the target service that matches the communication packet according to the matching order of each service and the matching rules of each service.
  • the network device when a network device receives a communication message, the network device will sequentially match and process the communication message according to the matching order of each service and the matching rule of each service, so as to determine the connection with the message.
  • the target service of the communication message matches.
  • the matching order of the service is: NAT service ⁇ AFT service ⁇ ASPF service
  • the network device can match the communication message with the matching rule of the NAT service, and then match the communication message with the matching rule of the AFT service. Match, and then match the communication packet with the matching rule of the ASPF service.
  • the matching rule of the NAT service may include preset matching items (such as quintuple information). When the quintuple information of the communication packet does not match the matching item, the communication packet is processed. The matching of the next service, that is, the matching of the AFT service.
  • the matching rule is considered to be matched, and then the corresponding NAT service processing of the communication message can be performed; after the NAT service processing of the communication message, This communication message is matched with the next service, that is, the AFT service.
  • the matching process of the AFT service and the ASPF service is similar to the matching process of the NAT service, the difference is that the specific content of the set matching items (such as quintuple information) may be different.
  • Step 202 If the fast forwarding table corresponding to the communication message is not stored locally, the network device obtains the target priority of the target service, and determines the target corresponding to the target priority according to the preset correspondence between the priority and the resource utilization threshold. Resource utilization threshold.
  • the fast forwarding table may include quintuple information, information about an incoming interface of the message, and information about an outgoing interface of the message.
  • the network device can parse the service packet, obtain the quintuple information in the service packet, and then match the quintuple information with the quintuple information of each fast forwarding table currently established to determine whether There is a fast forwarding table containing the five-tuple information. If there is a fast forwarding table containing the quintuple information (that is, a fast forwarding table corresponding to the communication message), the communication message may be forwarded according to the fast forwarding table. If there is no fast forwarding table containing the 5-tuple information, the network device can obtain the priority of the target service (that is, the target priority) from the configuration information of the target service (that is, the service that matches the communication message). ). The network device may store a resource utilization threshold corresponding to each priority in advance, that is, a correspondence between the priority and the resource utilization threshold, and the correspondence may be set by a technician based on experience. The resource utilization may include memory utilization and / or CPU utilization.
  • the priority of a service may include level1, level2, level3, and level4, where the resource utilization threshold corresponding to level1 is 0%, and for a service with priority level1, no fast forwarding table is established when processing communication packets;
  • the resource utilization threshold corresponding to level 2 is 40%.
  • the resource utilization threshold corresponding to level 3 is 80%, for services with priority level 3, when processing communication packets, the fast forwarding table is established when the current resource utilization is less than 80%; the resource utilization threshold corresponding to level 4 is 100%, for priority
  • a fast forwarding table is established when processing communication packets.
  • the network device may determine the target resource utilization threshold corresponding to the target priority according to the preset correspondence between the priority and the resource utilization threshold. For example, after receiving a communication message, the network device determines that the service matching the communication message is an ASPF service, the priority corresponding to the ASPF service is level 2, and the target resource utilization threshold corresponding to level 2 is 40%.
  • Step 203 The network device determines whether the current resource utilization exceeds a target resource utilization threshold.
  • the network device may obtain the current resource utilization rate, and then determine whether the current resource utilization rate is greater than or equal to the target resource utilization threshold.
  • Step 204 If the current resource utilization does not exceed the target resource utilization threshold, the network device establishes a fast forwarding table corresponding to the communication message.
  • the network device determines that the current resource utilization is less than or equal to the target resource utilization threshold, it means that the current resource utilization is low and the network equipment can allocate more resources to process the current service. Therefore, the communication can be established The fast forwarding table corresponding to the message.
  • the specific processing procedure is as follows: the network device determines the inbound interface of the communication message, and then determines the interface type and interface number of the inbound interface.
  • the network device can also route locally according to the destination IP address and destination port number of the communication message. Query the corresponding outbound interface in the table, and then determine the interface type and interface number of the outbound interface, and then according to the quintuple information of the communication message, the interface type and interface number of the incoming interface receiving the communication message, and forward the The interface type and interface number of the outbound interface of the communication packet generate a fast forwarding table.
  • the fast forwarding table can be shown in Table 1.
  • GE indicates that the interface type is GigabitEthernet (gigabit Ethernet), that is, an interface with a rate of 1 Gbps. "1/1" in GE1 / 1 is the interface number, which indicates the first on the first board (card slot). Interfaces.
  • the quintuple information of the communication message is: source IP address 1.1.1.1, source port number 10, destination IP address 2.2.2.2, destination port number 20, and protocol TCP (Transmission Control Protocol (Transmission Control Protocol).
  • TCP Transmission Control Protocol
  • a fast forwarding table as shown in Table 1 may be established.
  • the fast forwarding table may also include fields such as the total number of currently established fast forwarding tables, and internal tags (not shown in Table 1).
  • the internal flag is used to mark whether the communication message has been fragmented. For example, when the internal flag is 1, it indicates that the communication message is a fragmented message. When the internal flag is 0, it indicates that the communication message has been fragmented. Communication messages are messages that have not been fragmented.
  • the network device can forward the communication message by looking up the fast forwarding table. No need to look up the routing table, which can reduce the message forwarding time and improve the message forwarding rate.
  • the network device when a communication message is received, the network device establishes a temporary forwarding table corresponding to the communication message, and the fast forwarding table may be converted from the temporary forwarding table.
  • the process for the network device to establish the fast forwarding table is: clearing the temporary tags in the temporary forwarding table, and establishing the association between the session corresponding to the communication message and the temporary forwarding table, and obtaining the fast forwarding table corresponding to the communication message.
  • the network device when the network device receives the first communication message, the network device generates a temporary forwarding table corresponding to the communication message. Specifically, the network device parses the communication message to obtain quintuple information of the communication message. The network device may also determine the incoming interface of the communication packet, and then determine the interface type and interface number of the incoming interface.
  • the network device may also query the corresponding outgoing interface in the local routing table according to the destination IP address and destination port number of the communication message, and then determine the interface type and interface number of the outgoing interface, and then according to the five yuan of the communication message
  • the group information, the interface type and interface number of the inbound interface corresponding to the communication packet, and the interface type and interface number of the outbound interface corresponding to the communication packet are used to generate a temporary forwarding table.
  • the temporary forwarding table may be as shown in Table 2.
  • the difference between the temporary forwarding table and the fast forwarding table is that in addition to the fields in the fast forwarding table, the temporary forwarding table also includes the temporarily marked fields.
  • the temporary tag is used to mark the table as a temporary entry.
  • the temporary flag may be 1 to indicate that the table is a temporary entry.
  • the network device establishes a session (can be referred to as a target session) corresponding to the communication message according to the temporary forwarding table.
  • the session usually includes the information of the session initiator, the information of the session responder, and the session establishment time.
  • a session established based on the temporary forwarding table shown in Table 2 may include the following information.
  • the information of the session initiator is: source IP address / source port number is 1.1.1.1/10, destination IP address / destination port number is 2.2.2.2/20, protocol: TCP, packet input interface type and interface number: GE1 / 1 , Source security domain: Management, where the source security domain can be determined according to the type and interface number of the incoming interface of the message.
  • the information of the session responder is: source IP address / source port number is 2.2.2.2/20, destination IP address / destination port number is 1.1.1.1/10, protocol: TCP, packet outgoing interface type and interface number: GE1 / 2
  • Source security domain Local, where the source security domain can be determined according to the type and number of the outbound interface of the packet.
  • Session status TCP session has been established.
  • Session start time 2018-07-10 14:06:53; session survival time: 1199s.
  • the number of packets sent by the session initiator to the session responder 459 packets, and the number of bytes: 18555 bytes.
  • the number of packets sent by the session responder to the session initiator 958 packets, and the number of bytes: 42151 bytes.
  • the network device can record the data transmission between the two communication parties, and forward the received communication message according to the session.
  • the network device for a communication message, only establishes one session and one fast forwarding table.
  • the network device If the network device determines that the current resource utilization does not exceed the target resource utilization threshold, the network device formalizes the temporary forwarding table, that is, converts the temporary forwarding table into a formal fast forwarding table.
  • the specific process is: establishing the association between the target session and the temporary forwarding table, and clearing the temporary mark in the temporary forwarding table.
  • the network device when the network device receives the first communication message sent by the user equipment, the network device establishes a temporary forwarding table corresponding to the communication message, and then establishes a session according to the temporary forwarding table. For example, the network device determines that the target service matching the communication message is an ASPF service. Since ASPF service processing requires a session to be established, the network device will establish a session corresponding to the communication message according to the temporary forwarding table of the communication message. The network device may set a pointer to the session in the structure of the temporary forwarding table, and at the same time, set a pointer to the temporary forwarding table in the structure of the session, thereby establishing the association between the target session and the temporary forwarding table. In addition, the network device may also delete or leave the temporarily marked field in the temporary forwarding table empty, so as to obtain a fast forwarding table corresponding to the communication message.
  • the temporary forwarding table corresponding to the communication message is deleted.
  • the temporary forwarding table corresponding to the communication message is deleted.
  • the network device determines that the current resource utilization exceeds the target resource utilization threshold, it means that the current network equipment is under great processing pressure, and the network equipment is likely to be unable to allocate more resources to process the current service. Therefore, the network device can delete the temporary forwarding table corresponding to the communication message, and does not establish a fast forwarding table corresponding to the communication message, but can still perform forwarding processing on the communication message. In this way, although certain packet forwarding efficiency will be sacrificed, it can ensure that the network device has sufficient memory to process services, and avoid hanging or restarting the network device.
  • the network device determines a service that matches the communication message according to the message processing policy
  • the temporary forwarding table corresponding to the communication message is deleted, and the fast forwarding table corresponding to the communication message is not established.
  • the routing table forwards the communication message.
  • the specific processing procedure is: the network device queries the next hop address corresponding to the destination IP address in the routing table according to the destination IP address of the communication packet. Then, the network device forwards the communication packet according to the queried next hop address. If the network device does not query the next-hop address corresponding to the destination IP address in the routing table, the communication packet can be processed according to a preset processing policy, which can be configured by a technician according to needs. For example, the network device may discard the communication message, or the network device may forward the communication message according to a preset forwarding path.
  • the target priority of the target service obtained by the network device may be the highest priority, the lowest priority, or a priority other than the highest priority and the lowest priority.
  • the methods provided in the embodiments of the present application may be as follows.
  • the network device may execute the step of establishing a fast forwarding table corresponding to the communication message.
  • the network device may perform the step of deleting the temporary forwarding table corresponding to the communication message.
  • the network device may determine the target resource utilization corresponding to the target priority according to the preset correspondence between the priority and the resource utilization threshold. Rate threshold. Then, steps 203 to 204 are performed to determine whether to establish a fast forwarding table corresponding to the communication message.
  • the network device may determine whether to establish a fast forwarding table corresponding to the communication message in the following two ways.
  • Method 1 The network device determines the target priority of each target service, and determines the target resource utilization threshold corresponding to each target priority according to the preset correspondence between the priority and the resource utilization threshold. If the current resource utilization is not If the determined maximum value of the target resource utilization threshold is exceeded, a fast forwarding table corresponding to the communication message is established.
  • the network device determines the priority of each target service (that is, the target priority) and the priority of each target.
  • the level corresponds to the target resource utilization threshold, thereby obtaining multiple target resource utilization thresholds.
  • the network device can determine the maximum value of multiple target resource utilization thresholds, and then determine whether the current resource utilization exceeds the maximum value. If the current resource utilization does not exceed the determined maximum value, a fast transition corresponding to the communication message is established. Post.
  • the services that match communication messages include NAT services and ASPF services, where the resource utilization threshold corresponding to the ASPF service is 80%, the resource utilization threshold corresponding to the NAT service is 100%, and the current resource utilization is 85% ,
  • the network device determines that 85% ⁇ 100%, and establishes a fast forwarding table for the communication message.
  • Method 2 In the process of determining the target service matching the communication message according to the message processing strategy, the network device executes the communication message on the communication message whenever a target service matching the communication message is determined.
  • Target business and obtain the target priority of the target business, determine the target resource utilization threshold corresponding to the target priority according to the preset correspondence between the priority and the resource utilization threshold, and then determine whether the current resource utilization exceeds the target Target resource utilization threshold.
  • the target service is the last service in the matching order.
  • the communication message may be subsequently matched with a higher priority service (that is, a fast forwarding table may be established subsequently), so the temporary forwarding table is not processed at this time. , Can prevent the temporary forwarding table from being deleted by mistake, and avoid the inability to build a fast forwarding table based on the temporary forwarding table in the future.
  • the network device can match the communication message with the matching rules of the unmatched services in each service according to the matching order of each service to determine the next target service that matches the communication message.
  • the temporary forwarding table corresponding to the communication message is deleted.
  • the process of establishing a fast forwarding table may be: clearing the temporary tags in the temporary forwarding table, and establishing the association between the session corresponding to the communication message and the temporary forwarding table, and obtaining the fast forwarding table corresponding to the communication message. Subsequently, when the network device determines a service that matches the communication message, it can perform service processing, and it is not necessary to determine whether to establish a fast forwarding table.
  • the resource utilization threshold corresponding to the ASPF service is 40%
  • the resource utilization threshold corresponding to the NAT service is 100%
  • the current resource utilization is 80%.
  • the network device can also delete some of the established fast forwarding tables to reduce the memory pressure of the network device and prevent the network device from hanging or restarting.
  • the specific process is: if the current resource utilization exceeds the target resource utilization threshold, then according to a preset association relationship between the fast forwarding table and the service, determine one or more first services corresponding to each currently established fast forwarding table. And determine the highest priority among the priorities of one or more first services corresponding to each fast forwarding table; determine the first priority lower than or equal to the target priority from the highest priority, and In the forwarding table, the target fast forwarding table with the highest priority among the priorities of the associated one or more services is determined, and the target fast forwarding table is deleted.
  • a session usually includes a field of a service associated with the session (may be referred to as a first field).
  • the service associated with the session can be recorded in the first field.
  • logo For example, if the network device is establishing the session during ASPF service processing, the ID of the ASPF service may be recorded in the first field of the session.
  • the network device may need to call the session when performing other target services. (That is, the target service is executed based on the information recorded by the session). At this time, the network device may also record the identifier of the target service that invokes the session in the first field.
  • the network device can establish the association relationship between the session and the service, and then, based on the association relationship between the session and the temporary forwarding table established above, the network device can obtain the association relationship between the temporary forwarding table and the service.
  • the network device converts the temporary forwarding table into a fast forwarding table, a preset association relationship between the fast forwarding table and the service can be obtained.
  • a network device may establish a temporary forwarding table S for communication packets, and establish a session M according to the temporary forwarding table S when performing ASPF service processing, and then the network device records the identifier of the ASPF service in the first field of the session M To establish the association between the session M and the ASPF service.
  • the network equipment formalizes the temporary forwarding table S, that is, in the structure of the temporary forwarding table S, a pointer to the session M is set, and , In the structure of the session M, setting a pointer to the temporary forwarding table S, so as to establish an association between the session M and the temporary forwarding table S, and deleting or leaving empty the temporarily marked fields in the temporary forwarding table, Thus, a fast forwarding table S 'corresponding to the communication message is obtained.
  • the structure of the fast forwarding table S ' is provided with a pointer to the session M, and the identifier of the ASPF service is recorded in the first field of the session M. In this way, the association relationship between the fast forwarding table S' and the ASPF service can be established. .
  • the network device can also record the number of fast forwarding tables corresponding to each service. For each service, the network device can count the number of fast forwarding tables associated with the service according to a preset association relationship between the fast forwarding table and the service to obtain a priority table of the fast forwarding table.
  • the priority table of the fast forwarding table may also include the names of the services supported by the network equipment, and the priority of each service.
  • the priority table of the fast forwarding table can be shown in Table 3.
  • URPF stands for Unicast, Reverse, and Forwarding, that is, unicast reverse path forwarding.
  • a priority table of a fast forwarding table is added to hierarchically authorize service modules.
  • Network devices can selectively establish data flows for different services according to different priorities of different services.
  • the fast forwarding table that is, the fast forwarding table is established only for the required packets, thereby saving the memory of the network device, making full use of the functions and performance of the network device, and improving the use efficiency of the network device.
  • the number of fast forwarding tables corresponding to each target service is increased by one.
  • the target services that match the communication message are NAT service, ASPF service, and URPF service.
  • the network device After the network device establishes a fast forwarding table for the communication message, it will quickly convert the corresponding NAT service, ASPF service, and URPF service.
  • the number of posts is increased by one, that is, the above table 3 is modified to the entry shown in table 4.
  • the network device can determine the association with the fast forwarding table according to the preset association relationship between the fast forwarding table and the service. One or more services, and then determine the priorities corresponding to these services. Then, the network device determines the highest priority among these priorities, and compares the highest priority with the target priority corresponding to the target resource utilization threshold. If the highest priority of the service associated with the fast forwarding table is the first priority that is lower than or equal to the target priority, then the fast forwarding table is associated with a less important service, and the network device can delete the fast forwarding table.
  • Post that is, the target fast forwarding table
  • the highest priority of the service associated with the fast forwarding table is higher than the target priority, it means that the fast forwarding table is associated with a more important service, and the fast forwarding table is not deleted.
  • the resource utilization is high, some fast forwarding tables associated with less important services can be deleted, thereby reducing the memory pressure of network equipment, preventing network equipment from hanging or restarting, and ensuring that important traffic can be quickly forwarded. Communication messages for higher-level services.
  • priorities include level1, level2, level3, and level4, where the resource utilization threshold corresponding to level1 is 0%, the resource utilization threshold corresponding to level2 is 40%, the resource utilization threshold corresponding to level3 is 80%, and the level4 corresponds to The resource utilization threshold is 100%.
  • the service corresponding to level 1 is a URPF service
  • the service corresponding to level 2 is an ASPF service
  • the service corresponding to level 3 is an AFT service
  • the service corresponding to level 4 is a NAT service.
  • fast forwarding table 1 fast forwarding table 2
  • fast forwarding table 3 is an AFT service
  • fast forwarding table 4 is a NAT service.
  • the services associated with forwarding table 3 are NAT and URPF services, and the services associated with fast forwarding table 4 are ASPF and AFT services.
  • the network device may determine that the highest priority among the priorities of the services associated with fast forwarding table 1 is level 4 and the highest priority of the services associated with fast forwarding table 2 Is level2, the highest priority among the priorities of the services associated with the fast forwarding table 3 is level4, and the highest priority among the priorities of the services associated with the fast forwarding table 4 is level3, thereby determining the priority of the services associated with the fast forwarding table 1
  • the highest priority in the class is higher than level 3, and the highest priority of the services associated with the fast forwarding table 3 is higher than the level 3, and the highest priority of the services associated with the fast forwarding table 2 is lower than the level 3, the fast forwarding table 4 is associated with.
  • the highest priority of the service is equal to level 3, and then the fast forwarding table 2 and the fast forwarding table 4 are deleted.
  • the embodiment of the present application newly adds monitoring of the memory threshold.
  • the fast forwarding table corresponding to the service module with lower priority is cleared. Ensure that network devices have sufficient memory to process services, and avoid hanging or restarting network devices.
  • the number of fast forwarding tables corresponding to each service in the above table 3 may be updated according to the preset association relationship between the current fast forwarding table and the service. For example, the network device determines to delete the fast forwarding table 1.
  • the services associated with the fast forwarding table 1 are the ASPF service and the URPF service.
  • the network device may reduce the number of the fast forwarding tables corresponding to the ASPF service and the URPF service in Table 3 by one.
  • the network device may establish a fast forwarding table corresponding to the communication packet; if the network device determines that the target priority is the lowest priority, it may The fast forwarding table corresponding to the communication message is not established; if the network device determines that the target priority is a priority other than the highest priority and the lowest priority, it may execute step 202 according to the preset priority And a corresponding relationship with a resource utilization threshold, determining a target resource utilization threshold corresponding to the target priority. In this way, the processing amount of the network device can be reduced, and the processing resources of the network device can be saved.
  • the embodiment of the present application also provides an example of a method for establishing a fast forwarding table.
  • four priorities are divided, that is, levels 1 to 4. among them:
  • Level 4 is the highest priority, and the corresponding resource utilization threshold is 100%.
  • a fast forwarding table is established when processing communication packets.
  • Level 3 is a medium priority, and the corresponding resource utilization threshold is 80%.
  • a fast forwarding table is established when the current resource utilization is less than or equal to 80%. If the current resource utilization is greater than 80%, the fast forwarding table is not established or the fast forwarding table is deleted.
  • Level 2 is a medium priority, and the corresponding resource utilization threshold is 60%.
  • a fast forwarding table is established when the current resource utilization is less than or equal to 60%. If the current resource utilization is greater than 60%, the fast forwarding table is not established or the fast forwarding table is deleted.
  • level1 is a low priority, and the corresponding resource utilization threshold is 0.
  • priority level1 For services with priority level1, no fast forwarding table is established when processing communication packets.
  • the campus network includes network equipment, user terminals in the R & D building, and user terminals in the administrative building. Each user terminal is connected to the network equipment and communicates through the network equipment.
  • the campus network can be divided into three parts: network egress, data center, and user access.
  • the egress router, core switch, and access device can be set in the campus network.
  • the access device corresponds to the user access part
  • the egress router corresponds to the network egress part
  • the core switch is connected to the egress router, data center, and access device. connection.
  • the access device may include an access switch and an aggregation switch.
  • the access switch is used to connect the user terminal to the campus network, the access switch is connected to the aggregation switch, and the aggregation switch is connected to the core switch; the core switch is used to forward communication packets at high speed to complete the connection between the data center and the user terminal, and
  • the data communication between user terminals in the campus network can also forward communication packets to the egress router and the egress router to the external network to achieve data communication between the internal network and the external network.
  • An example of a method for establishing a fast forwarding table provided in the embodiment of the present application may be executed by a core switch in a campus network. Take the user terminal in the R & D building to send a communication message to the user terminal in the administrative building as an example. The user terminal in the R & D building sends a communication message to the access switch, and the access switch sends the communication message to the convergence switch. Send the communication message to the core switch, and the core switch executes the method for establishing a fast forwarding table provided in this application, and forwards the communication message to the user terminal in the administrative building.
  • the specific process of this example can be as follows.
  • Step 301 The core switch receives a communication message.
  • step 201 For the processing of this step, reference may be made to the related description of step 201 above, and details are not described herein again.
  • Step 302 The core switch establishes a temporary forwarding table corresponding to the communication message.
  • step 204 For the processing of this step, reference may be made to the related description of step 204, and details are not described herein again.
  • Step 303 The core switch determines a target service that matches the communication message according to the service matching rule set by the message processing policy.
  • step 201 For the processing of this step, refer to the related description of step 201 above.
  • the number of target services is used as an example for description. The case where there are multiple target services is similar, and details are not described again.
  • Step 304 The core switch determines whether the fast forwarding table corresponding to the communication message is stored locally.
  • step 305 is performed, and if the fast forwarding table corresponding to the communication message is locally stored, step 310 is performed.
  • step 204 For the processing of this step, reference may be made to the related description of step 204, and details are not described herein again.
  • Step 305 The core switch obtains a target priority of a preset target service.
  • step 309 is performed; if the target priority is level3 or level2, steps 306 to 307 are performed; if the target priority is level1, step 308 is performed.
  • step 202 For the processing of this step, reference may be made to the related description of step 202 above, and details are not described herein again.
  • Step 306 The core switch determines a target resource utilization threshold corresponding to the target priority according to a preset correspondence between the priority and the resource utilization threshold.
  • step 202 For the processing of this step, reference may be made to the related description of step 202 above, and details are not described herein again.
  • Step 307 The core switch determines whether the current resource utilization exceeds a target resource utilization threshold.
  • step 308 is performed; if the resource utilization is less than or equal to the target resource utilization threshold, step 309 is executed.
  • step 203 For the processing of this step, reference may be made to the related description of step 203, and details are not described herein again.
  • Step 308 The core switch deletes the temporary forwarding table.
  • step 204 For the processing of this step, reference may be made to the related description of step 204, and details are not described herein again.
  • Step 309 The core switch formalizes the temporary forwarding table.
  • step 204 For the processing of this step, reference may be made to the related description of step 204, and details are not described herein again.
  • Step 310 The core switch forwards the communication message according to the fast forwarding table corresponding to the communication message.
  • step 204 For the processing of this step, reference may be made to the related description of step 204, and details are not described herein again.
  • Step 311 The core switch forwards the communication message according to the routing table corresponding to the communication message.
  • step 204 For the processing of this step, reference may be made to the related description of step 204, and details are not described herein again.
  • the network device determines a target service matching the communication message according to a service matching rule set by the message processing policy. If the fast forwarding table corresponding to the communication message is not stored locally, the preset target priority of the target service is obtained, and the target resource utilization corresponding to the target priority is determined according to the correspondence between the preset priority and the resource utilization threshold. Rate threshold. Then, the network device judges whether the current resource utilization exceeds the target resource utilization threshold, and if the current resource utilization does not exceed the target resource utilization threshold, it establishes a fast forwarding table corresponding to the communication message.
  • a fast forwarding table corresponding to the communication message can be established.
  • the embodiment of the present application can selectively establish a fast forwarding table for communication packets of some data streams, and does not need to establish a fast forwarding table for communication packets of each data stream, which reduces the memory pressure of network devices and prevents the network devices from hanging or Restart.
  • an embodiment of the present application further provides an apparatus for establishing a fast forwarding table.
  • the apparatus includes:
  • a first determining module 410 configured to determine a target service matching a communication message according to a service matching rule set by a message processing policy when a communication message is received;
  • the second determining module 420 is configured to obtain a preset target priority of the target service if the fast forwarding table corresponding to the communication message is not stored locally, and determine according to the correspondence between the preset priority and the resource utilization threshold.
  • a first determining module 430 configured to determine whether the current resource utilization exceeds a target resource utilization threshold
  • a first establishing module 440 is configured to establish a fast forwarding table corresponding to a communication packet if the current resource utilization does not exceed the target resource utilization threshold.
  • the device further includes:
  • a second establishing module 450 configured to establish a temporary forwarding table corresponding to the communication message when the communication message is received;
  • the first establishment module 440 is specifically configured to:
  • the device further includes:
  • a first deleting module 460 configured to delete a temporary forwarding table corresponding to a communication packet if the current resource utilization exceeds a target resource utilization threshold
  • the temporary forwarding table corresponding to the communication message is deleted.
  • the first establishment module 440 is specifically configured to:
  • the device further includes:
  • the third determining module 470 is configured to determine, if the current resource utilization exceeds the target resource utilization threshold, a preset or corresponding to each currently established fast forwarding table according to a preset association relationship between the fast forwarding table and the service. More first services, and determining the highest priority among the priorities of one or more first services corresponding to each fast forwarding table;
  • a second deletion module 480 configured to determine a first priority lower than or equal to the target priority from the highest priority, and determine one or more associated services from the fast forwarding tables The highest priority among the priorities is the target fast forwarding table of the first priority, and the target fast forwarding table is deleted.
  • the device further includes:
  • a third establishing module 490 is configured to establish a fast forwarding table corresponding to the communication packet if the target priority is the highest priority; if the target priority is the lowest priority, the communication packet is not established The corresponding fast forwarding table;
  • the third establishing module 490 is further configured to trigger the second determining module to execute the according to the preset priority if the target priority is a priority other than the highest priority and the lowest priority. A correspondence between a priority and a resource utilization threshold, and determining a target resource utilization threshold corresponding to the target priority.
  • the message processing strategy includes a matching order of each service and a matching rule of each service
  • the device further includes:
  • a third deleting module 4100 configured to determine whether the target service is the last service in the matching sequence if the current resource utilization exceeds the target resource utilization threshold; if the target service is not the The last service in the matching order is to match the communication message with the matching rule of the unmatched service in each service according to the matching order of each service, and determine that the next match matches the communication message. If the target service is the last service in the matching order, deleting the temporary forwarding table corresponding to the communication message;
  • a second judgment module 4110 is configured to determine whether a fast forwarding table corresponding to a communication message is currently established if the current resource utilization does not exceed the target resource utilization threshold, and if a fast forwarding table corresponding to a communication message is not currently established, then The first establishment module is triggered to execute the step of establishing a fast forwarding table corresponding to the communication message.
  • the network device when a network device receives a communication message, the network device determines a target service matching the communication message according to a service matching rule set by the message processing policy.
  • the fast forwarding table obtains a preset target priority of the target service, and determines a target resource utilization threshold corresponding to the target priority according to the preset relationship between the preset priority and the resource utilization threshold. Then, the network device judges whether the current resource utilization exceeds the target resource utilization threshold, and if the current resource utilization does not exceed the target resource utilization threshold, it establishes a fast forwarding table corresponding to the communication message. In this way, when the current resource utilization does not exceed the target resource utilization threshold, a fast forwarding table corresponding to the communication message can be established.
  • the embodiment of the present application can selectively establish a fast forwarding table for communication packets of some data streams, and does not need to establish a fast forwarding table for communication packets of each data stream, which reduces the memory pressure of the network device and prevents the network device from hanging or Restart.
  • FIG. 10 shows a structural block diagram of a network device according to an embodiment of the present application.
  • the network device includes: a processor 1001 and a machine-readable storage medium 1002.
  • the machine-readable storage medium 1002 stores machine-executable instructions that can be executed by the processor 1001, and the processor 1001 is prompted by the machine-executable instructions: perform the following steps:
  • a preset target priority of the target service is obtained, and the target priority is determined according to a correspondence between the preset priority and a resource utilization threshold.
  • the processor 1001 is prompted by a machine executable instruction, and may further perform the following steps:
  • the processor 1001 is prompted by a machine executable instruction, and may further perform the following steps:
  • the temporary forwarding table corresponding to the communication message is deleted.
  • the processor 1001 is caused by the machine-executable instructions to specifically perform the following steps:
  • the processor 1001 is prompted by a machine executable instruction, and may further perform the following steps:
  • a first priority lower than or equal to the target priority is determined from the highest priority, and from each of the fast forwarding tables, the highest priority among the priorities of the associated one or more services is determined as Delete the target fast forwarding table of the first priority fast forwarding table.
  • the processor 1001 is prompted by a machine executable instruction, and may further perform the following steps:
  • the target priority is the highest priority, establishing a fast forwarding table corresponding to the communication message; if the target priority is the lowest priority, not establishing a fast forwarding table corresponding to the communication message;
  • the target priority is the highest priority and a priority other than the lowest priority, executing the corresponding relationship according to a preset priority and a resource utilization threshold to determine the target priority correspondence
  • the target resource utilization threshold step If the target priority is the highest priority and a priority other than the lowest priority, executing the corresponding relationship according to a preset priority and a resource utilization threshold to determine the target priority correspondence The target resource utilization threshold step.
  • the message processing strategy includes a matching order of each service and a matching rule of each service; the processor 1001 is prompted by a machine executable instruction, and may further perform the following steps:
  • the target resource utilization threshold determines whether the target service is the last service in the matching sequence; if the target service is not the last service in the matching sequence, Then, according to the matching order of each service, matching the communication message with the matching rule of the unmatched service in each service to determine the next target service that matches the communication message; if the target If the service is the last service in the matching sequence, the temporary forwarding table corresponding to the communication message is deleted;
  • the network device may further include a communication bus 1003, the processor 1001, and the machine-readable storage medium 1002 communicate with each other through the communication bus 1003, which may be a Peripheral Component Interconnect Standard (PCI) Bus or Extended Industry Standard Architecture (Extended Industry Standard Architecture, EISA) bus, etc.
  • the communication bus 1003 can be divided into an address bus, a data bus, a control bus, and the like.
  • the communication bus 1003 may be connected to devices such as a transceiver 1004.
  • the machine-readable storage medium 1002 may include random access memory (Random Access Memory, RAM), and may also include non-volatile memory (Non-Volatile Memory, NVM), such as at least one disk memory.
  • NVM non-Volatile Memory
  • the machine-readable storage medium 1002 may also be at least one storage device located far from the foregoing processor.
  • the processor 1001 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc .; it may also be a digital signal processor (Digital Signal Processing, DSP), and an application-specific integrated circuit. (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • CPU central processing unit
  • NP network processor
  • DSP Digital Signal Processing
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • the network device when a network device receives a communication message, the network device determines a target service matching the communication message according to a service matching rule set by the message processing policy.
  • the fast forwarding table obtains a preset target priority of the target service, and determines a target resource utilization threshold corresponding to the target priority according to the preset relationship between the preset priority and the resource utilization threshold. Then, the network device judges whether the current resource utilization exceeds the target resource utilization threshold, and if the current resource utilization does not exceed the target resource utilization threshold, it establishes a fast forwarding table corresponding to the communication message. In this way, when the current resource utilization does not exceed the target resource utilization threshold, a fast forwarding table corresponding to the communication message can be established.
  • the embodiment of the present application can selectively establish a fast forwarding table for communication packets of some data streams, and does not need to establish a fast forwarding table for communication packets of each data stream, which reduces the memory pressure of the network device and prevents the network device from hanging or Restart.
  • an embodiment of the present application further provides a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions, and when called and executed by a processor, Machine-executable instructions cause the processor to perform the following steps:
  • a preset target priority of the target service is obtained, and the target priority is determined according to a correspondence between the preset priority and a resource utilization threshold.
  • the machine-executable instructions cause the processor to execute other possible implementation manners of the method for establishing a fast forwarding table, and details are not described herein again.
  • the network device when a network device receives a communication message, the network device determines a target service matching the communication message according to a service matching rule set by the message processing policy.
  • the fast forwarding table obtains a preset target priority of the target service, and determines a target resource utilization threshold corresponding to the target priority according to the preset relationship between the preset priority and the resource utilization threshold. Then, the network device judges whether the current resource utilization exceeds the target resource utilization threshold, and if the current resource utilization does not exceed the target resource utilization threshold, it establishes a fast forwarding table corresponding to the communication message. In this way, when the current resource utilization does not exceed the target resource utilization threshold, a fast forwarding table corresponding to the communication message can be established.
  • the embodiment of the present application can selectively establish a fast forwarding table for communication packets of some data streams, and does not need to establish a fast forwarding table for communication packets of each data stream, which reduces the memory pressure of network devices and prevents the network devices from hanging or Restart.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be from a website site, computer, server, or data center Transmission by wire (for example, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (for example, infrared, wireless, microwave, etc.) to another website site, computer, server, or data center.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, and the like that includes one or more available medium integration.
  • the available medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (Solid State Disk (SSD)), and the like.
  • a magnetic medium for example, a floppy disk, a hard disk, a magnetic tape
  • an optical medium for example, a DVD
  • a semiconductor medium for example, a solid state disk (Solid State Disk (SSD)

Landscapes

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

Abstract

一种建立快速转发表的方法及装置,所述方法包括:当接收到通信报文时,根据报文处理策略设定的业务的匹配规则,确定与所述通信报文相匹配的目标业务,如果本地未存储所述通信报文对应的快速转发表,则获取预设的所述目标业务的目标优先级,并根据预设的优先级和资源利用率阈值的对应关系,确定所述目标优先级对应的目标资源利用率阈值,判断当前资源利用率是否超过所述目标资源利用率阈值,如果所述当前资源利用率未超过所述目标资源利用率阈值,则建立所述通信报文对应的快速转发表。采用本申请,可以降低网络设备的内存压力,避免网络设备挂死或重启。

Description

建立快速转发表
相关申请的交叉引用
本申请要求于2018年8月31日提交中国专利局、申请号为201811012726.1、发明名称为“一种建立快速转发表的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
背景技术
目前,网络中设置的网络设备通常包括接入交换机、汇聚交换机和核心交换机。其中,用户终端可以接入接入交换机,接入交换机连接汇聚交换机,汇聚交换机与核心交换机连接,核心交换机连接出口路由器,出口路由器连接外网,实现用户终端与外网的数据传输。
网络设备(比如核心交换机)通常设置有快速转发功能,该网络设备处理报文的处理过程如下所示。
当网络设备接收到一个通信报文后,如果当前未建立该通信报文对应的快速转发表,网络设备会通过查找路由表,转发该通信报文,然后,在本地的缓存中生成该通信报文对应的快速转发表,快速转发表中可以包括该通信报文的五元组信息、入接口和出接口等信息。网络设备根据报文中的信息(比如五元组信息)来标识属于同一条数据流的报文。后续若网络设备接收到具有相同五元组信息的通信报文(即属于同一数据流的通信报文),网络设备则根据该快速转发表转发报文,网络设备无需查找路由表。这样,能够减少报文的转发时间,提高报文的转发效率。
附图简要说明
图1为本申请实施例提供的一种网络系统的示意图图;
图2为本申请实施例提供的一种建立快速转发表的方法流程图;
图3为本申请实施例提供的一种建立快速转发表的方法流程图;
图4为本申请实施例提供的一种建立快速转发表的装置的结构示意图;
图5为本申请实施例提供的一种建立快速转发表的装置的结构示意图;
图6为本申请实施例提供的一种建立快速转发表的装置的结构示意图;
图7为本申请实施例提供的一种建立快速转发表的装置的结构示意图;
图8为本申请实施例提供的一种建立快速转发表的装置的结构示意图;
图9为本申请实施例提供的一种建立快速转发表的装置的结构示意图;
图10为本申请实施例提供的一种网络设备的结构示意图。
具体实施方式
为使本申请的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本申请作 进一步详细的说明。
本申请实施例提供了一种建立快速转发表的方法,该方法应用于网络设备,该网络设备可以为接入交换机、汇聚交换机和核心交换机等,网络设备还可以是路由器、防火墙、AC(Access Controller,接入控制器)等实体设备,网络设备还可以是上述功能的逻辑设备。应当理解的是,网络设备可以实现本申请实施例即可,具体形式本申请实施例并不作特别限定。
本申请实施例提供的建立快速转发表的方法,可以应用于园区网的应用场景下。园区网中可以包括多个用户终端,例如,某学校包括有研发楼和行政楼,每个楼中可以设置有多个用户终端。如图1所示,为本申请实施例提供的一种园区网的组网架构示意图,该组网架构包括网络设备、研发楼中的用户终端和行政楼中的用户终端,每个用户终端均与网络设备连接,并通过网络设备进行通信。基于网络各部分的功能和特点,园区网可以被划分为网络出口、数据中心及用户接入三大部分。相应的,园区网中可以设置有出口路由器、核心交换机和接入设备,其中,接入设备可以是用户接入部分,出口路由器可以是网络出口部分,核心交换机分别与出口路由器、数据中心和接入设备连接。接入设备可以包括接入交换机和汇聚交换机。用户终端连接接入交换机,以将用户终端接入到园区网中,接入交换机连接汇聚交换机,汇聚交换机与核心交换机连接;核心交换机用于高速转发通信报文,以完成数据中心和用户终端之间、以及园区网中的用户终端之间的数据通信,核心交换机还可以将通信报文转发至出口路由器,并由出口路由器转发至外网,以实现内网和外网之间的数据通信。
当网络设备接收到通信报文后,会根据预设的报文处理策略,按照报文处理策略设定的业务的匹配规则,确定与该通信报文相匹配的目标业务,具体的处理过程后续会进行详细说明。网络设备确定与该通信报文相匹配的目标业务后,可以获取目标业务的目标优先级,并根据预设的优先级和资源利用率阈值的对应关系,确定目标优先级对应的目标资源利用率阈值。然后,网络设备判断当前资源利用率是否超过目标资源利用率阈值,如果当前资源利用率未超过目标资源利用率阈值,则建立通信报文对应的快速转发表。
这样,在当前资源利用率未超过目标资源利用率阈值时,可以建立该通信报文对应的快速转发表。
发明人发现现有技术中至少存在如下问题:相关技术中,当网络设备接收到一个通信报文后,如果当前未建立该通信报文对应的快速转发表,网络设备会通过查找路由表,转发该通信报文,然后,在本地的缓存中生成该通信报文对应的快速转发表,快速转发表中可以包括该通信报文的五元组信息、入接口和出接口等信息。网络设备根据报文中的信息(比如五元组信息)来标识属于同一条数据流的报文。后续若网络设备接收到具有相同五元组信息的通信报文(即属于同一数据流的通信报文),网络设备无需查找路由表,可以通过匹配通信报文的五元组信息,查找到该通信报文对应的快速转发表,从而转发报文。这样,能够减少报文的转发时间,提高报文的转发效率。然而,网络中通常会聚集大量的用户终端,这些用户终端之间相互通信时,网络设备中会建立大量的快速转发表,导致网络设备的内存不足,影响网络设备的性能,甚至会导致设备挂死或重启。
本申请实施例可以有选择地针对一些数据流的通信报文建立快速转发表,可以不对每条数据流的通信报文都建立快速转发表,降低了网络设备的内存压力,避免网络设备挂死或重启。
本申请实施例相比与现有技术,由针对所有报文都建立快速转发表或都关闭快速转发表,修改成根据不同业务的优先级,确定可以为哪些业务报文建立快速转发表,可以不为哪些业务报文建立快速转发表。在本申请实施例中,还可以灵活配置业务的优先级,网络设备能够根据配置后的优先级,确定建立或不建立快速转发表,实现灵活建立快速转发表。
本申请实施例首先对各业务的优先级的配置过程进行说明,具体如下。
在实施上述建立快速转发表的方法的过程中,可以预先在网络设备中配置快速转发表的建立规则。具体的,可以新增一组命令行,用于使运行该组命令行的网络设备按照业务的优先级建立、或者不建立快速转发表。在网络设备上配置并运行该组命令行后,网络设备可以按照各业务的优先级,确定可以为哪些业务报文建立快速转发表,可以不为哪些业务报文建立快速转发表。示例性的,该组命令行中某条命令行如下。
[H3C]ip fast-forwarding xx enable//表示启动名为“xx”的快速转发表的建立规则,其中,“xx”为快速转发表的建立规则的标识。
另外,还可以配置各业务对应的优先级,各优先级对应不同的快速转发表的建立规则。以划分三个优先级(即level 1~3)为例:level3为最高优先级,在接收到与优先级为level3的业务相匹配的通信报文时,均建立快速转发表;level2为中等优先级,在接收到与优先级为level2的业务相匹配的通信报文时,如果资源利用率小于资源利用率阈值时,则建立该通信报文对应的快速转发表,如果资源利用率不小于资源利用率阈值,则不建立该通信报文对应的快速转发表或者清除快速转发表;level1为低优先级,在接收到与优先级为level1的业务相匹配的通信报文时,均不建立快速转发表。
示例性的,可以配置NAT业务的优先级为最高优先级,该组命令行中某条命令行可以为:
[H3C-ipf-xx]module NAT level 3//表示设置NAT(Network Address Translation,网络地址转换)业务为最高优先级,可以建立快速转发表。
示例性的,可以配置AFT业务的优先级为最高优先级,该组命令行中某条命令行可以为:
[H3C-ipf-xx]module AFT level 3//表示设置AFT(Address Family Translation,地址族转换)业务为最高优先级,可以建立快速转发表。
示例性的,可以配置ASPF业务的优先级为中等优先级,该组命令行中某条命令行可以为:
[H3C-ipf-xx]module ASPF level 2//表示设置ASPF(Advanced Stateful Packet Filter,高级状态包过滤)业务为中等优先级,在接收到与ASPF业务相匹配的通信报文时,如果网络设备的当前资源利用率小于预设资源利用率阈值时,建立该通信报文对应的快速转发表。
在缺省情况下,所有业务都属于level1,因此无需配置属于level1的业务。
网络设备接收到配置某业务的优先级的命令后,会在该业务的配置信息中存储该业务的优先级,以便进行后续处理。该业务的配置信息中还可以包括该业务的匹配规则等信息。其中,匹配规则可以包括预设的匹配项,比如五元组信息。
需要说明的是,根据实际需求,可以为不同的业务配置相同的优先级,也可以为不同的业务配置不同的优先级。另外,优先级的数目可以不限于三个,对于优先级的数目为多个的情况,每个优先级可以分别对应不同的资源利用率阈值,具体的处理过程后续会进行详细说明。
上述各业务的优先级配置方式仅为举例说明,每个业务对应的优先级可以由技术人员根据业务需要进行配置,本申请实施例不做限定。
现有技术在默认情况下,网络设备会对所有通信报文都建立快速转发表。通过本申请实施例提供的方法,网络设备可以根据与通信报文相匹配的目标业务的优先级,或根据与通信报文相匹配的目标业务的优先级、该优先级对应的资源利用率阈值,判断是否需要建立快速转发表,这样,可以有选择地针对一些数据流的通信报文建立快速转发表,降低了网络设备的内存压力,避免网络设备挂死或重启。
如图2所示,以执行主体为园区网中的网络设备(比如核心交换机)为例,本申请实施例提供的建立快速转发表的方法的处理过程可以包括以下步骤。
步骤201,当网络设备接收到通信报文时,根据报文处理策略设定的业务的匹配规则,确定与通信报文相匹配的目标业务。
其中,与通信报文相匹配的目标业务可以是一个,也可以是多个。
在本申请实施例中,网络设备可以具备多种业务的处理功能,比如NAT业务,AFT业务和ASPF业务等。网络设备中可以预先设置有报文处理策略,网络设备可以根据报文处理策略设定的业务的匹配规则,确定与通信报文相匹配的目标业务。
可选的,报文处理策略可以包括报文匹配流程(即各业务的匹配顺序)、以及每个业务的匹配规则。网络设备可以根据各业务的匹配顺序和各业务的匹配规则,确定与通信报文相匹配的目标业务。
在本申请实施例中,当网络设备接收到通信报文后,网络设备会按照各业务的匹配顺序,以及每个业务的匹配规则,依次对通信报文进行匹配及业务处理,从而确定与该通信报文相匹配的目标业务。
例如,业务的匹配顺序为:NAT业务→AFT业务→ASPF业务,则网络设备可以先将该通信报文与NAT业务的匹配规则进行匹配,然后再将该通信报文与AFT业务的匹配规则进行匹配,接下来再将该通信报文与ASPF业务的匹配规则进行匹配。以NAT业务为例,NAT业务的匹配规则可以包括预设的匹配项(比如五元组信息),当该通信报文的五元组信息与匹配项不匹配时,则对该通信报文进行下一业务的匹配,即AFT业务的匹配。当该通信报文的五元组信息与匹配项匹配时,则认为匹配该匹配规则,然后对该通信报文可以进行相应的NAT业务处理;待对该通信报文进行NAT业务处理后,则对该通信报文进行下一业务的匹配,即AFT业务的匹配。AFT业务和ASPF业务的匹配过程与NAT业务的匹配过程类似,区别在于设置的匹配项(比如五元组信息)的具体内容可以是不同的。
步骤202,如果本地未存储通信报文对应的快速转发表,则网络设备获取目标业务的目标优先级,并根据预设的优先级和资源利用率阈值的对应关系,确定目标优先级对应的目标资源利用率阈值。
其中,快速转发表可以包括五元组信息、报文的入接口信息和报文的出接口信息等。
在实施中,网络设备可以对业务报文进行解析,获取业务报文中的五元组信息,然后将该五元组信息与当前建立的各快速转发表的五元组信息进行匹配,判断是否存在包含该五元组信息的快速转发表。如果存在包含该五元组信息的快速转发表(即该通信报文对应的快速转发表),则可以根据该快速转发表,对该通信报文进行转发处理。如果不存在包含该五元组信息的快速转发表,则网络设备可以从目标业务(即与该通信报文相匹配的业务)的配置信息中,获取该目标业务的优先级(即目标优先级)。网络设备中可以预先存储有每个优先级对应的资源利用率阈值,即优先级和资源利用率阈值的对应关系,该对应关系可以由技术人员根据经验进行设置。其中,资源利用率可以包括内存利用率和/或CPU利用率。
例如,业务的优先级可以包括level1、level2、level3、level4,其中,level1对应的资源利用率阈值为0%,则针对优先级为level1的业务,处理通信报文时,不建立快速转发表;level2对应的资源利用率阈值为40%,则针对优先级为level2的业务,处理通信报文时,在当前资源利用率小于40%的情况下建立快速转发表;level3对应的资源利用率阈值为80%,则针对优先级为level3的业务,在处理通信报文时,在当前资源利用率小于80%的情况下建立快速转发表;level4对应的资源利用率阈值为100%,则针对优先级为level4的业务,在处理通信报文时,建立快速转发表。
网络设备可以根据预设的优先级和资源利用率阈值的对应关系,确定目标优先级对应的目标资源利用率阈值。例如,网络设备接收到通信报文后,确定与该通信报文相匹配的业务为ASPF业务,ASPF业务对应的优先级为level2,level2对应的目标资源利用率阈值为40%。
步骤203,网络设备判断当前资源利用率是否超过目标资源利用率阈值。
在本申请实施例中,网络设备可以获取当前资源利用率,然后判断当前资源利用率是否大于或等于目标资源利用率阈值。
步骤204,如果当前资源利用率未超过目标资源利用率阈值,则网络设备建立通信报文对应的快速转发表。
在本申请实施例中,如果网络设备判定当前资源利用率小于或等于目标资源利用率阈值,则说明当前资源利用率较低,网络设备能够分配较多资源处理当前业务,因此,可以建立该通信报文对应的快速转发表。
具体的处理过程为:网络设备确定该通信报文的入接口,进而确定该入接口的接口类型和接口号,网络设备还可以根据该通信报文的目的IP地址和目的端口号,在本地路由表中查询对应的出接口,然后确定该出接口的接口类型和接口号,进而根据该通信报文的五元组信息、接收该通信报文的入接口的接口类型和接口号、以及转发该通信报文的出接口的接口类型和接口号,生成快速转发表。快速转发表可以如表一所示。
表一
Figure PCTCN2019103795-appb-000001
Figure PCTCN2019103795-appb-000002
其中,GE表示接口类型为GigabitEthernet(千兆以太网),即速率为1G bps的接口,GE1/1中“1/1”为接口号,表示第1个板卡(卡槽)上的第1个接口。
例如,网络设备接收到通信报文,该通信报文的五元组信息为:源IP地址1.1.1.1、源端口号10、目的IP地址2.2.2.2、目的端口号20、协议TCP(Transmission Control Protocol,传输控制协议),如果网络设备当前未建立该通信报文对应的快速转发表表,且当前资源利用率小于目标资源利用率阈值,则可以建立如表一所示的快速转发表。
另外,快速转发表中还可以包括当前已建立的快速转发表的总数目、以及内部标记等字段(表一中未示出)。其中,内部标记用于标记该通信报文是否进行过分片处理,例如,当内部标记为1时,表示该通信报文为进行分片处理后的报文,当内部标记为0时,表示该通信报文为未进行分片处理的报文。
这样,后续当网络设备接收到具有相同五元组信息的通信报文(即与该通信报文属于同一数据流的通信报文)后,网络设备可以通过查找该快速转发表转发该通信报文,无需查找路由表,能够减少报文的转发时间,提高报文的转发速率。
可选的,当接收到通信报文时,网络设备会建立该通信报文对应的临时转发表,快速转发表可以是由临时转发表转化而来。网络设备建立快速转发表的过程为:清除临时转发表中的临时标记,并建立通信报文对应的会话与临时转发表的关联关系,得到通信报文对应的快速转发表。
在本申请实施例中,当网络设备接收到首个通信报文时,网络设备会生成该通信报文对应的临时转发表。具体的,网络设备对该通信报文进行解析,获取该通信报文的五元组信息。网络设备还可以确定该通信报文的入接口,进而确定该入接口的接口类型和接口号。网络设备还可以根据该通信报文的目的IP地址和目的端口号,在本地路由表中查询对应的出接口,然后确定该出接口的接口类型和接口号,进而根据该通信报文的五元组信息、该通信报文对应的入接口的接口类型和接口号、以及该通信报文对应的出接口的接口类型和接口号,生成临时转发表,临时转发表可以如表二所示。
表二
Figure PCTCN2019103795-appb-000003
临时转发表与快速转发表的区别在于,临时转发表除了包含快速转发表中的字段以外,还包括临时标记的字段。该临时标记用于标记该表为临时表项。示例性的,临时标记可以为1,以表示该表为临时表项。网络设备根据临时转发表建立该通信报文对应的会话(可称为目标会话)。其中,会话通常包括会话发起者的信息、会话响应者的信息和会话建立时间等。示例性的,基于表二所示的临时转发表建立的会话可以包括以下信息。
会话发起者的信息为:源IP地址/源端口号为1.1.1.1/10,目的IP地址/目的端口号2.2.2.2/20,协议:TCP,报文入接口类型和接口号:GE1/1,源安全域:Management,其中,源安全域可以根据报文入接口类型和接口号确定。
会话响应者的信息为:源IP地址/源端口号为2.2.2.2/20,目的IP地址/目的端口号1.1.1.1/10,协议:TCP,报文出接口类型和接口号:GE1/2,源安全域:Local,其中,源安全域可以根据报文出接口类型和接口号确定。
会话状态:TCP会话已建立。
会话开始时间:2018-07-10 14:06:53;会话生存时间:1199s。
会话发起者向会话应答者发送的数据包数目:459packets,字节数:18555bytes。
会话应答者向会话发起者发送的数据包数目:958packets,字节数:42151bytes。
网络设备通过建立会话,可以记录通信双方的数据传输情况,并根据该会话对接收到的通信报文进行转发处理。本申请实施例中,针对一个通信报文,网络设备仅建立一个会话和一个快速转发表。
如果网络设备判定当前资源利用率未超过目标资源利用率阈值,网络设备则会将该临时转发表进行正式化处理,即将该临时转发表转化为正式的快速转发表。具体的处理过程为:建立目标会话与该临时转发表的关联关系,并且,清除临时转发表中的临时标记。
在本申请实施例中,如上所述,网络设备接收到用户设备发送的首个通信报文时,网络设备会建立该通信报文对应的临时转发表,然后根据该临时转发表建立会话。例如,网络设备确定与通信报文相匹配的目标业务为ASPF业务,由于进行ASPF业务处理需要建立会话,因此,网络设备会根据该通信报文的临时转发表建立该通信报文对应的会话。网络设备可以在临时转发表的结构体中,设置指向该会话的指针,同时,在会话的结构体中,设置指向该临时转发表的指针,从而建立目标会话与该临时转发表的关联关系。并且,网络设备还可以将该临时转发表中的临时标记的字段删除或置为空,从而得到该通信报文对应的快速转发表。
可选的,如果当前资源利用率超过目标资源利用率阈值,则删除通信报文对应的临时转发表。在另一个示例中,如果根据报文处理策略,未确定出与通信报文相匹配的业务,则删除通信报文对应的临时转发表。
在本申请实施例中,如果网络设备判定当前资源利用率超过目标资源利用率阈值,则说明当前网络设备的处理压力较大,网络设备很可能无法分配较多资源处理当前业务。因此,网络设备可以删除通信报文对应的临时转发表,不建立该通信报文对应的快速转发表,但仍然可以对该通信报文做转发处理。这样,虽然会牺牲一定的报文转发效率,但是能够保证网络设备有足够的内存来处理业务,避免网络设备挂死或重启。
或者,如果网络设备根据报文处理策略,未确定出与通信报文相匹配的业务,则删除通信报文对应的临时转发表,不建立该通信报文对应的快速转发表,此时可以根据路由表对该通信报文做转发处理。具体的处理过程为:网络设备根据该通信报文的目的IP地址,在路由表中查询该目的IP地址对应的下 一跳地址。然后,网络设备根据查询到的下一跳地址,对该通信报文进行转发处理。如果网络设备在路由表中未查询到该目的IP地址对应的下一跳地址,则可以根据预设的处理策略,对该通信报文进行处理,该处理策略可以由技术人员根据需要进行配置,例如,网络设备可以丢弃该通信报文,或者,网络设备可以根据预设的转发路径,对该通信报文进行转发处理。
在另一种可能的实现方式中,网络设备获取到的目标业务的目标优先级可能是最高优先级,也可能是最低优先级,还可能是最高优先级、最低优先级以外的优先级。针对这三种情况,本申请实施例提供的方法可以如下。
情况一、如果该目标优先级为最高优先级,则网络设备可以执行建立该通信报文对应的快速转发表的步骤。
情况二、如果该目标优先级为最低优先级,则网络设备可以执行删除该通信报文对应的临时转发表的步骤。
情况三、如果该目标优先级为最高优先级和最低优先级以外的其他优先级,则网络设备可以根据预设的优先级和资源利用率阈值的对应关系,确定目标优先级对应的目标资源利用率阈值。然后执行步骤203~204,判断是否建立该通信报文对应的快速转发表。
可选的,当与通信报文相匹配的目标业务的数目为多个时,网络设备可以采用以下两种方式确定是否建立通信报文对应的快速转发表。
方式一、网络设备确定各目标业务的目标优先级,并根据预设的优先级和资源利用率阈值的对应关系,分别确定各目标优先级对应的目标资源利用率阈值,如果当前资源利用率未超过确定出的目标资源利用率阈值中的最大值,则建立通信报文对应的快速转发表。
在本申请实施例中,如果网络设备确定出与多个与通信报文相匹配的目标业务,则网络设备会分别确定每个目标业务的优先级(即目标优先级),以及每个目标优先级对应目标资源利用率阈值,从而得到多个目标资源利用率阈值。网络设备可以确定多个目标资源利用率阈值中的最大值,进而判断当前资源利用率是否超过该最大值,如果当前资源利用率未超过确定出的最大值,则建立通信报文对应的快速转发表。例如,与通信报文相匹配的业务包括NAT业务和ASPF业务,其中,ASPF业务对应的资源利用率阈值为80%,NAT业务对应的资源利用率阈值为100%,当前资源利用率为85%,则网络设备判定85%<100%,建立该通信报文的快速转发表。
方式二、网络设备在按照报文处理策略,确定与通信报文相匹配的目标业务的过程中,每当确定出与通信报文相匹配的目标业务时,网络设备对该通信报文执行该目标业务,并获取该目标业务的目标优先级,根据预设的优先级和资源利用率阈值的对应关系,确定该目标优先级对应的目标资源利用率阈值,然后判断当前资源利用率是否超过该目标资源利用率阈值。
如果当前资源利用率超过目标资源利用率阈值,则进一步判断目标业务是否为匹配顺序中的最后一个业务。
如果目标业务不是匹配顺序中的最后一个业务,则该通信报文后续可能与更高优先级的业务相匹配 (即后续可能会建立快速转发表),所以,在此时不对临时转发表进行处理,可以防止误删临时转发表,避免后续无法根据临时转发表建立快速转发表。网络设备可以按照各业务的匹配顺序,将通信报文与各业务中未匹配业务的匹配规则进行匹配,确定下一个与通信报文相匹配的目标业务。
如果该业务是报文匹配流程中的最后一个业务,则删除通信报文对应的临时转发表。
如果当前资源利用率未超过目标资源利用率阈值,则进一步判断当前是否已建立该通信报文对应的快速转发表,如果当前未建立该通信报文对应的快速转发表,则建立该通信报文对应的快速转发表。建立快速转发表的过程可以是:清除临时转发表中的临时标记,并建立通信报文对应的会话与临时转发表的关联关系,得到通信报文对应的快速转发表。后续,网络设备确定出与该通信报文相匹配的业务时,可以执行业务处理,并可以不用确定是否建立快速转发表。
例如,报文匹配流程中,需要依次匹配ASPF业务、NAT业务和AFT业务,其中,ASPF业务对应的资源利用率阈值为40%,NAT业务对应的资源利用率阈值为100%,AFT业务对应的资源利用率阈值为80%,当前资源利用率为80%。当网络设备确定通信报文与ASPF业务匹配时,判定当前资源利用率超过目标资源利用率阈值40%,此时,由于ASPF业务不是报文匹配流程中的最后一个业务,因此,可以对该通信报文进行ASPF业务处理,不对临时转发表进行处理,以避免误删临时转发表。网络设备继续匹配下一个业务,当判定通信报文与NAT业务匹配时,建立快速转发表。
按照此方式,当所有业务均被匹配完时,若当前资源利用率未超过确定出的目标资源利用率阈值中的最大值,则建立通信报文对应的快速转发表;若当前资源利用率超过确定出的目标资源利用率阈值中的最大值,则删除通信报文对应的临时转发表。
可选的,网络设备还可以在当前资源利用率过高时,删除已建立的部分快速转发表,以降低网络设备的内存压力,避免网络设备挂死或重启。具体的处理过程为:如果当前资源利用率超过目标资源利用率阈值,则根据快速转发表与业务的预设关联关系,确定当前建立的每个快速转发表对应的一个或更多个第一业务,并确定每个快速转发表对应的一个或更多个第一业务的优先级中的最高优先级;从最高优先级中确定低于或等于目标优先级的第一优先级,并从各快速转发表中,确定关联的一个或更多个业务的优先级中最高优先级为第一优先级的目标快速转发表,并删除目标快速转发表。
在本申请实施例中,会话中通常包含与该会话相关联的业务的字段(可称为第一字段),网络设备建立会话后,可以在该第一字段中记录与该会话相关联的业务的标识。例如,网络设备是在进行ASPF业务处理时,建立的该会话,则可以在该会话的第一字段中,记录ASPF业务的标识,后续,网络设备在进行其他目标业务时,可能需要调用该会话(即基于会话记录的信息执行该目标业务),此时,网络设备还可以在第一字段中记录调用该会话的目标业务的标识。这样,网络设备能够建立会话与业务的关联关系,然后,基于上述建立的会话与临时转发表的关联关系,网络设备可以得到临时转发表与业务的关联关系。相应的,网络设备将临时转发表转化为快速转发表后,即可得到快速转发表与业务的预设关联关系。
例如,网络设备可以建立通信报文的临时转发表S,并在进行ASPF业务处理时,根据临时转发表S建立会话M,则网络设备在该会话M的第一字段中,记录ASPF业务的标识,以建立会话M和ASPF 业务的关联关系。如果网络设备判定当前资源利用率未超过目标资源利用率阈值,则网络设备对临时转发表S进行正式化处理,也即,在临时转发表S的结构体中,设置指向会话M的指针,同时,在会话M的结构体中,设置指向临时转发表S的指针,从而建立会话M与临时转发表S的关联关系,并且,将该临时转发表中的临时标记的字段删除或置为空,从而得到该通信报文对应的快速转发表S’。快速转发表S’的结构体中,设置有指向会话M的指针,而会话M的第一字段中,记录有ASPF业务的标识,这样,可以建立起快速转发表S’与ASPF业务的关联关系。
网络设备还可以分别记录每个业务对应快速转发表的数目。针对每个业务,网络设备可以根据快速转发表与业务的预设关联关系,统计与该业务相关联的快速转发表的数目,得到快速转发表的优先级表。快速转发表的优先级表还可以包括网络设备支持的业务的名称,以及每种业务的优先级。快速转发表的优先级表可以如表三所示。
表三
业务 优先级 快速转发表的数量
NAT业务 level 4 10
AFT业务 level 3 3
ASPF业务 level 2 0
URPF业务 level 1 0
…… …… ……
其中,URPF表示unicast Reverse Path Forwarding,即单播反向路径转发。
本申请实施例中,新增了一种快速转发表的优先级表,以此对业务模块分级授权,网络设备按照不同业务的不同优先级,针对不同业务的数据流,能够实现有选择地建立快速转发表,也即,仅对有需求的报文建立快速转发表,从而节约网络设备的内存,充分利用了网络设备的功能和性能,提升网络设备的使用效率。
需要说明的是,对于目标业务为多个的情况,网络设备建立快速转发表后,会将每个目标业务对应的快速转发表的数量加一。例如,与通信报文相匹配的目标业务有NAT业务、ASPF业务和URPF业务,网络设备建立该通信报文的快速转发表后,则会分别将NAT业务、ASPF业务和URPF业务对应的快速转发表的数量加一,也即,上述表三修改为表四所示的表项。
表四
业务 优先级 快速转发表的数量
NAT业务 level 4 11
AFT业务 level 3 3
ASPF业务 level 2 1
URPF业务 level 1 1
…… …… ……
当网络设备判定当前资源利用率超过目标资源利用率阈值时,针对当前已建立的每个快速转发表,网络设备可以根据快速转发表与业务的预设关联关系,确定与该快速转发表相关联的一个或更多个业务,进而确定这些业务对应的优先级。然后,网络设备确定这些优先级中的最高优先级,将该最高优先级与目标资源利用率阈值对应的目标优先级进行比较。如果该快速转发表关联的业务的最高优先级,是低于或等于目标优先级的第一优先级,则说明该快速转发表与重要程度较低的业务相关联,网络设备可以删除该快速转发表(即目标快速转发表);如果该快速转发表关联的业务的最高优先级高于目标优先级,则说明该快速转发表与重要程度较高的业务相关联,不删除该快速转发表。这样,可以在资源利用率较高时,删除一些与重要程度较低的业务相关联的快速转发表,从而降低网络设备的内存压力,避免网络设备挂死或重启,同时,保证能够快速转发重要程度较高的业务的通信报文。
例如,优先级包括level1、level2、level3、level4,其中,level1对应的资源利用率阈值为0%,level2对应的资源利用率阈值为40%,level3对应的资源利用率阈值为80%,level4对应的资源利用率阈值为100%。level1对应的业务为URPF业务,level2对应的业务为ASPF业务,level3对应的业务为AFT业务,level4对应的业务为NAT业务。当前存在快速转发表1、快速转发表2、快速转发表3和快速转发表4,其中,快速转发表1关联的业务为NAT业务和ASPF业务,快速转发表2关联的业务为ASPF业务,快速转发表3关联的业务为NAT业务和URPF业务,快速转发表4关联的业务为ASPF业务和AFT业务。当目标资源利用率阈值为80%、目标优先级为level3时,网络设备可以确定快速转发表1关联的业务的优先级中的最高优先级为level4,快速转发表2关联的业务的最高优先级为level2,快速转发表3关联的业务的优先级中的最高优先级为level4,快速转发表4关联的业务的优先级中的最高优先级为level3,进而确定快速转发表1关联的业务的优先级中的最高优先级高于level3、快速转发表3关联的业务的优先级中的最高优先级高于level3、快速转发表2关联的业务的最高优先级低于level3、快速转发表4关联的业务的优先级中的最高优先级等于level3,然后将快速转发表2和快速转发表4删除。
本申请实施例中新增了对内存门限的监控,在网络设备达到内存门限时,清除优先级较低的业务模块对应的快速转发表,这样,虽然会牺牲一定的报文转发效率,但是能够保证网络设备有足够的内存来处理业务,避免网络设备挂死或重启。
可选的,网络设备删除快速转发表后,可以根据当前快速转发表与业务的预设关联关系,更新上述表三中各业务对应的快速转发表的数量。例如,网络设备确定删除快速转发表1,快速转发表1关联的业务为ASPF业务和URPF业务,网络设备可以将表三中ASPF业务和URPF业务对应的快速转发表的数量分别减1。
在另一种可能的实现方式中,如果网络设备判定目标优先级为最高优先级,则可以建立所述通信报文对应的快速转发表;如果网络设备判定目标优先级为最低优先级,则可以不建立所述通信报文对应的 快速转发表;如果网络设备判定目标优先级为所述最高优先级和所述最低优先级以外的其他优先级,则可以执行步骤202中根据预设的优先级和资源利用率阈值的对应关系,确定所述目标优先级对应的目标资源利用率阈值步骤。这样,可以降低网络设备的处理量,节约网络设备的处理资源。
本申请实施例还提供了一种建立快速转发表的方法示例,该示例中共划分四个优先级,即level 1~4。其中:
level4为最高优先级,对应的资源利用率阈值为100%,则针对优先级为level4的业务,在处理通信报文时,建立快速转发表。
level3为中等优先级,对应的资源利用率阈值为80%,则针对优先级为level3的业务,在处理通信报文时,在当前资源利用率小于或等于80%的情况下建立快速转发表,如果当前资源利用率大于80%,则不建立快速转发表,或删除快速转发表。
Level2为中等优先级,对应的资源利用率阈值为60%,则针对优先级为level2的业务,处理通信报文时,在当前资源利用率小于或等于60%的情况下建立快速转发表,如果当前资源利用率大于60%,则不建立快速转发表,或删除快速转发表。
level1为低优先级,对应的资源利用率阈值为0,则针对优先级为level1的业务,处理通信报文时,不建立快速转发表。
基于图1所示的园区网,园区网包括网络设备、研发楼中的用户终端和行政楼中的用户终端,每个用户终端均与网络设备连接,并通过网络设备进行通信。基于网络各部分的功能和特点,园区网可以被划分为网络出口、数据中心及用户接入三大部分。相应的,园区网中可以设置有出口路由器、核心交换机和接入设备,其中,接入设备对应用户接入部分,出口路由器对应网络出口部分,核心交换机分别与出口路由器、数据中心和接入设备连接。接入设备可以包括接入交换机和汇聚交换机。接入交换机用于将用户终端接入到园区网中,接入交换机连接汇聚交换机,汇聚交换机与核心交换机连接;核心交换机用于高速转发通信报文,以完成数据中心和用户终端之间、以及园区网中的用户终端之间的数据通信,还可以将通信报文转发至出口路由器,并由出口路由器转发至外网,以实现内网和外网之间的数据通信。
本申请实施例提供的建立快速转发表的方法示例,可以由园区网中的核心交换机执行。以研发楼中的用户终端向行政楼中的用户终端发送通信报文为例,研发楼中的用户终端向接入交换机发送通信报文,接入交换机向汇聚交换机发送该通信报文,汇聚交换机向核心交换机发送该通信报文,核心交换机执行本申请提供的建立快速转发表的方法示例,将该通信报文转发至行政楼中的用户终端。
如图3所示,该示例的具体过程可以如下。
步骤301,核心交换机接收通信报文。
本步骤的处理过程可以参照上述步骤201的相关说明,此处不再赘述。
步骤302,核心交换机建立该通信报文对应的临时转发表。
本步骤的处理过程可以参照上述步骤204的相关说明,此处不再赘述。
步骤303,核心交换机根据报文处理策略设定的业务的匹配规则,确定与通信报文相匹配的目标业务。
本步骤的处理过程可以参照上述步骤201的相关说明。本示例以目标业务的数量为一个为例进行说明,目标业务为多个的情况与之类似,不再赘述。
步骤304,核心交换机判断本地是否存储该通信报文对应的快速转发表。
如果本地未存储该通信报文对应的快速转发表,则执行步骤305,如果本地存储该通信报文对应的快速转发表,则执行步骤310。
本步骤的处理过程可以参照上述步骤204的相关说明,此处不再赘述。
步骤305,核心交换机获取预设的目标业务的目标优先级。
其中,如果目标优先级为level4,则执行步骤309;如果目标优先级为level3或level2,则执行步骤306~307,如果目标优先级为level1,则执行步骤308。
本步骤的处理过程可以参照上述步骤202的相关说明,此处不再赘述。
步骤306,核心交换机根据预设的优先级和资源利用率阈值的对应关系,确定目标优先级对应的目标资源利用率阈值。
本步骤的处理过程可以参照上述步骤202的相关说明,此处不再赘述。
步骤307,核心交换机判断当前资源利用率是否超过目标资源利用率阈值。
如果资源利用率大于目标资源利用率阈值,则执行步骤308;如果资源利用率小于或等于目标资源利用率阈值,则执行步骤309。
本步骤的处理过程可以参照上述步骤203的相关说明,此处不再赘述。
步骤308,核心交换机删除临时转发表。
本步骤的处理过程可以参照上述步骤204的相关说明,此处不再赘述。
步骤309,核心交换机对临时转发表进行正式化处理。
本步骤的处理过程可以参照上述步骤204的相关说明,此处不再赘述。
步骤310,核心交换机根据该通信报文对应的快速转发表,对该通信报文进行转发处理。
本步骤的处理过程可以参照上述步骤204的相关说明,此处不再赘述。
步骤311,核心交换机根据该通信报文对应的路由表,对该通信报文进行转发处理。
本步骤的处理过程可以参照上述步骤204的相关说明,此处不再赘述。
本申请实施例提供的建立快速转发表的方法中,当网络设备接收到通信报文时,网络设备根据报文 处理策略设定的业务的匹配规则,确定与通信报文相匹配的目标业务,如果本地未存储通信报文对应的快速转发表,则获取预设的目标业务的目标优先级,并根据预设的优先级和资源利用率阈值的对应关系,确定目标优先级对应的目标资源利用率阈值。然后,网络设备判断当前资源利用率是否超过目标资源利用率阈值,如果当前资源利用率未超过目标资源利用率阈值,则建立通信报文对应的快速转发表。这样,在当前资源利用率未超过目标资源利用率阈值时,可以建立该通信报文对应的快速转发表。本申请实施例可以有选择地针对一些数据流的通信报文建立快速转发表,无需针对每条数据流的通信报文建立快速转发表,降低了网络设备的内存压力,避免网络设备挂死或重启。
基于相同的技术构思,如图4所示,本申请实施例还提供了一种建立快速转发表的装置,该装置包括:
第一确定模块410,用于当接收到通信报文时,根据报文处理策略设定的业务的匹配规则,确定与通信报文相匹配的目标业务;
第二确定模块420,用于如果本地未存储通信报文对应的快速转发表,则获取预设的目标业务的目标优先级,并根据预设的优先级和资源利用率阈值的对应关系,确定目标优先级对应的目标资源利用率阈值;
第一判断模块430,用于判断当前资源利用率是否超过目标资源利用率阈值;
第一建立模块440,用于如果当前资源利用率未超过目标资源利用率阈值,则建立通信报文对应的快速转发表。
可选的,如图5所示,该装置还包括:
第二建立模块450,用于当接收到通信报文时,建立通信报文对应的临时转发表;
第一建立模块440,具体用于:
清除临时转发表中的临时标记,并建立通信报文对应的会话与临时转发表的关联关系,得到通信报文对应的快速转发表。
可选的,如图6所示,该装置还包括:
第一删除模块460,用于如果当前资源利用率超过目标资源利用率阈值,则删除通信报文对应的临时转发表;
或者,如果根据报文处理策略,未确定出与通信报文相匹配的业务,则删除通信报文对应的临时转发表。
可选的,当与通信报文相匹配的目标业务的数目为多个时,第一建立模块440,具体用于:
如果当前资源利用率未超过确定出的目标资源利用率阈值中的最大值,则建立通信报文对应的快速转发表。
可选的,如图7所示,该装置还包括:
第三确定模块470,用于如果所述当前资源利用率超过所述目标资源利用率阈值,则根据快速转发表与业务的预设关联关系,确定当前建立的每个快速转发表对应的一个或更多个第一业务,并确定每个快速转发表对应的一个或更多个第一业务的优先级中的最高优先级;
第二删除模块480,用于从所述最高优先级中确定低于或等于所述目标优先级的第一优先级,并从所述各快速转发表中,确定关联的一个或更多个业务的优先级中的最高优先级为所述第一优先级的目标快速转发表,并删除所述目标快速转发表。
可选的,如图8所示,所述装置还包括:
第三建立模块490,用于如果所述目标优先级为最高优先级,则建立所述通信报文对应的快速转发表;如果所述目标优先级为最低优先级,则不建立所述通信报文对应的快速转发表;
所述第三建立模块490,还用于如果所述目标优先级为所述最高优先级和所述最低优先级以外的其他优先级,则触发所述第二确定模块执行所述根据预设的优先级和资源利用率阈值的对应关系,确定所述目标优先级对应的目标资源利用率阈值步骤。
可选的,报文处理策略包括各业务的匹配顺序和各业务的匹配规则;
如图9所示,该装置还包括:
第三删除模块4100,用于如果所述当前资源利用率超过所述目标资源利用率阈值,则判断所述目标业务是否为所述匹配顺序中的最后一个业务;如果所述目标业务不是所述匹配顺序中的最后一个业务,则按照所述各业务的匹配顺序,将所述通信报文与所述各业务中未匹配业务的匹配规则进行匹配,确定下一个与所述通信报文相匹配的目标业务;如果所述目标业务是所述匹配顺序中的最后一个业务,则删除所述通信报文对应的临时转发表;
第二判断模块4110,用于如果当前资源利用率未超过目标资源利用率阈值,则判断当前是否已建立通信报文对应的快速转发表,如果当前未建立通信报文对应的快速转发表,则触发第一建立模块执行建立通信报文对应的快速转发表步骤。
本申请实施例中,当网络设备接收到通信报文时,网络设备根据报文处理策略设定的业务的匹配规则,确定与通信报文相匹配的目标业务,如果本地未存储通信报文对应的快速转发表,则获取预设的目标业务的目标优先级,并根据预设的优先级和资源利用率阈值的对应关系,确定目标优先级对应的目标资源利用率阈值。然后,网络设备判断当前资源利用率是否超过目标资源利用率阈值,如果当前资源利用率未超过目标资源利用率阈值,则建立通信报文对应的快速转发表。这样,在当前资源利用率未超过目标资源利用率阈值时,可以建立该通信报文对应的快速转发表。本申请实施例可以有选择地针对一些数据流的通信报文建立快速转发表,无需针对每条数据流的通信报文建立快速转发表,降低了网络设备的内存压力,避免网络设备挂死或重启。
与上述建立快速转发表的方法实施例对应,本申请实施例还提供了一种网络设备。参照图10,图10示出了本申请实施例提供的一种网络设备的结构框图。该网络设备包括:处理器1001和机器可读存储介质1002,机器可读存储介质1002存储有能够被处理器1001执行的机器可执行指令,处理器1001 被机器可执行指令促使:执行以下步骤:
当接收到通信报文时,根据报文处理策略设定的业务的匹配规则,确定与所述通信报文相匹配的目标业务;
如果本地未存储所述通信报文对应的快速转发表,则获取预设的所述目标业务的目标优先级,并根据预设的优先级和资源利用率阈值的对应关系,确定所述目标优先级对应的目标资源利用率阈值;
判断当前资源利用率是否超过所述目标资源利用率阈值;
如果所述当前资源利用率未超过所述目标资源利用率阈值,则建立所述通信报文对应的快速转发表。
在本申请的一个可选实施例中,处理器1001被机器可执行指令促使,还可以执行以下步骤:
当接收到通信报文时,建立所述通信报文对应的临时转发表;
清除所述临时转发表中的临时标记,并建立所述通信报文对应的会话与所述临时转发表的关联关系,得到所述通信报文对应的快速转发表。
在本申请的一个可选实施例中,处理器1001被机器可执行指令促使,还可以执行以下步骤:
如果所述当前资源利用率超过所述目标资源利用率阈值,则删除所述通信报文对应的临时转发表;
或者,如果根据所述报文处理策略,未确定出与所述通信报文相匹配的业务,则删除所述通信报文对应的临时转发表。
在本申请的一个可选实施例中,当与所述通信报文相匹配的目标业务的数目为多个时,所述如果所述当前资源利用率未超过所述目标资源利用率阈值,则处理器1001被机器可执行指令促使具体执行以下步骤:
如果所述当前资源利用率未超过确定出的目标资源利用率阈值中的最大值,则建立所述通信报文对应的快速转发表。
在本申请的一个可选实施例中,处理器1001被机器可执行指令促使,还可以执行以下步骤:
如果所述当前资源利用率超过所述目标资源利用率阈值,则根据快速转发表与业务的预设关联关系,确定当前建立的每个快速转发表对应的一个或多个业务,并确定每个快速转发表对应的一个或多个业务的优先级中的最高优先级;
从所述最高优先级中确定低于或等于所述目标优先级的第一优先级,并从所述各快速转发表中,确定关联的一个或多个业务的优先级中的最高优先级为所述第一优先级的目标快速转发表,并删除所述目标快速转发表。
在本申请的一个可选实施例中,所述获取预设的所述目标业务的目标优先级之后,处理器1001被机器可执行指令促使,还可以执行以下步骤:
如果所述目标优先级为最高优先级,则建立所述通信报文对应的快速转发表;如果所述目标优先级 为最低优先级,则不建立所述通信报文对应的快速转发表;
如果所述目标优先级为所述最高优先级和所述最低优先级以外的其他优先级,则执行所述根据预设的优先级和资源利用率阈值的对应关系,确定所述目标优先级对应的目标资源利用率阈值步骤。
在本申请的一个可选实施例中,所述报文处理策略包括各业务的匹配顺序和所述各业务的匹配规则;处理器1001被机器可执行指令促使,还可以执行以下步骤:
如果所述当前资源利用率超过所述目标资源利用率阈值,则判断所述目标业务是否为所述匹配顺序中的最后一个业务;如果所述目标业务不是所述匹配顺序中的最后一个业务,则按照所述各业务的匹配顺序,将所述通信报文与所述各业务中未匹配业务的匹配规则进行匹配,确定下一个与所述通信报文相匹配的目标业务;如果所述目标业务是所述匹配顺序中的最后一个业务,则删除所述通信报文对应的临时转发表;
如果所述当前资源利用率未超过所述目标资源利用率阈值,则判断当前是否已建立所述通信报文对应的快速转发表,如果当前未建立所述通信报文对应的快速转发表,则执行所述建立所述通信报文对应的快速转发表步骤。
如图10所示,网络设备还可以包括通信总线1003,处理器1001、机器可读存储介质1002通过通信总线1003完成相互间的通信,可以是外设部件互连标准(Peripheral Component Interconnect,PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,EISA)总线等。该通信总线1003可以分为地址总线、数据总线、控制总线等。
上述通信总线1003除了可以连接有上述处理器1001、机器可读存储介质1002外,还可以连接有收发器1004等器件。
机器可读存储介质1002可以包括随机存取存储器(Random Access Memory,RAM),也可以包括非易失性存储器(Non-Volatile Memory,NVM),例如至少一个磁盘存储器。另外,机器可读存储介质1002还可以是至少一个位于远离前述处理器的存储装置。
处理器1001可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(Digital Signal Processing,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。
本申请实施例中,当网络设备接收到通信报文时,网络设备根据报文处理策略设定的业务的匹配规则,确定与通信报文相匹配的目标业务,如果本地未存储通信报文对应的快速转发表,则获取预设的目标业务的目标优先级,并根据预设的优先级和资源利用率阈值的对应关系,确定目标优先级对应的目标资源利用率阈值。然后,网络设备判断当前资源利用率是否超过目标资源利用率阈值,如果当前资源利用率未超过目标资源利用率阈值,则建立通信报文对应的快速转发表。这样,在当前资源利用率未超过目标资源利用率阈值时,可以建立该通信报文对应的快速转发表。本申请实施例可以有选择地针对一些数据流的通信报文建立快速转发表,无需针对每条数据流的通信报文建立快速转发表,降低了网络设备的内存压力,避免网络设备挂死或重启。
与上述建立快速转发表的方法实施例对应,本申请实施例还提供了一种机器可读存储介质,所述机器可读存储介质存储有机器可执行指令,在被处理器调用和执行时,机器可执行指令促使处理器:执行以下步骤:
当接收到通信报文时,根据报文处理策略设定的业务的匹配规则,确定与所述通信报文相匹配的目标业务;
如果本地未存储所述通信报文对应的快速转发表,则获取预设的所述目标业务的目标优先级,并根据预设的优先级和资源利用率阈值的对应关系,确定所述目标优先级对应的目标资源利用率阈值;
判断当前资源利用率是否超过所述目标资源利用率阈值;
如果所述当前资源利用率未超过所述目标资源利用率阈值,则建立所述通信报文对应的快速转发表。
所述机器可执行指令促使处理器执行建立快速转发表的方法的其他可能的实现方式,此处不再赘述。
本申请实施例中,当网络设备接收到通信报文时,网络设备根据报文处理策略设定的业务的匹配规则,确定与通信报文相匹配的目标业务,如果本地未存储通信报文对应的快速转发表,则获取预设的目标业务的目标优先级,并根据预设的优先级和资源利用率阈值的对应关系,确定目标优先级对应的目标资源利用率阈值。然后,网络设备判断当前资源利用率是否超过目标资源利用率阈值,如果当前资源利用率未超过目标资源利用率阈值,则建立通信报文对应的快速转发表。这样,在当前资源利用率未超过目标资源利用率阈值时,可以建立该通信报文对应的快速转发表。本申请实施例可以有选择地针对一些数据流的通信报文建立快速转发表,无需针对每条数据流的通信报文建立快速转发表,降低了网络设备的内存压力,避免网络设备挂死或重启。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
以上所述仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。凡在本申请的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本申请的保护范围内。

Claims (22)

  1. 一种建立快速转发表的方法,其特征在于,所述方法包括:
    当接收到通信报文时,根据报文处理策略设定的业务的匹配规则,确定与所述通信报文相匹配的目标业务;
    如果本地未存储所述通信报文对应的快速转发表,则获取预设的所述目标业务的目标优先级,并根据预设的优先级和资源利用率阈值的对应关系,确定所述目标优先级对应的目标资源利用率阈值;
    判断当前资源利用率是否超过所述目标资源利用率阈值;
    如果所述当前资源利用率未超过所述目标资源利用率阈值,则建立所述通信报文对应的快速转发表。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    当接收到通信报文时,建立所述通信报文对应的临时转发表;
    所述建立所述通信报文对应的快速转发表,包括:
    清除所述临时转发表中的临时标记,并建立所述通信报文对应的会话与所述临时转发表的关联关系,得到所述通信报文对应的快速转发表。
  3. 根据权利要求2所述的方法,其特征在于,所述方法还包括:
    如果所述当前资源利用率超过所述目标资源利用率阈值,则删除所述通信报文对应的临时转发表;
    或者,如果根据所述报文处理策略,未确定出与所述通信报文相匹配的业务,则删除所述通信报文对应的临时转发表。
  4. 根据权利要求1所述的方法,其特征在于,当与所述通信报文相匹配的目标业务的数目为多个时,所述如果所述当前资源利用率未超过所述目标资源利用率阈值,则建立所述通信报文对应的快速转发表,包括:
    如果所述当前资源利用率未超过确定出的目标资源利用率阈值中的最大值,则建立所述通信报文对应的快速转发表。
  5. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    如果所述当前资源利用率超过所述目标资源利用率阈值,则根据快速转发表与业务的预设关联关系,确定当前建立的每个快速转发表对应的一个或更多个第一业务,并确定每个快速转发表对应的一个或更多个第一业务的优先级中的最高优先级;
    从所述最高优先级中确定低于或等于所述目标优先级的第一优先级,并从所述各快速转发表中,确定关联的一个或更多个业务的优先级中的最高优先级为所述第一优先级的目标快速转发表,并删除所述目标快速转发表。
  6. 根据权利要求1所述的方法,其特征在于,所述获取预设的所述目标业务的目标优先级之后, 所述方法还包括:
    如果所述目标优先级为最高优先级,则建立所述通信报文对应的快速转发表;
    如果所述目标优先级为最低优先级,则不建立所述通信报文对应的快速转发表;
    如果所述目标优先级为所述最高优先级和所述最低优先级以外的其他优先级,则执行所述根据预设的优先级和资源利用率阈值的对应关系,确定所述目标优先级对应的目标资源利用率阈值步骤。
  7. 根据权利要求2所述的方法,其特征在于,所述报文处理策略包括各业务的匹配顺序和所述各业务的匹配规则;
    所述方法还包括:
    如果所述当前资源利用率超过所述目标资源利用率阈值,则判断所述目标业务是否为所述匹配顺序中的最后一个业务;如果所述目标业务不是所述匹配顺序中的最后一个业务,则按照所述各业务的匹配顺序,将所述通信报文与所述各业务中未匹配业务的匹配规则进行匹配,确定下一个与所述通信报文相匹配的目标业务;如果所述目标业务是所述匹配顺序中的最后一个业务,则删除所述通信报文对应的临时转发表;
    如果所述当前资源利用率未超过所述目标资源利用率阈值,则判断当前是否已建立所述通信报文对应的快速转发表,如果当前未建立所述通信报文对应的快速转发表,则执行所述建立所述通信报文对应的快速转发表步骤。
  8. 一种建立快速转发表的装置,其特征在于,所述装置包括:
    第一确定模块,用于当接收到通信报文时,根据报文处理策略设定的业务的匹配规则,确定与所述通信报文相匹配的目标业务;
    第二确定模块,用于如果本地未存储所述通信报文对应的快速转发表,则获取预设的所述目标业务的目标优先级,并根据预设的优先级和资源利用率阈值的对应关系,确定所述目标优先级对应的目标资源利用率阈值;
    第一判断模块,用于判断当前资源利用率是否超过所述目标资源利用率阈值;
    第一建立模块,用于如果所述当前资源利用率未超过所述目标资源利用率阈值,则建立所述通信报文对应的快速转发表。
  9. 根据权利要求8所述的装置,其特征在于,所述装置还包括:
    第二建立模块,用于当接收到通信报文时,建立所述通信报文对应的临时转发表;
    所述第一建立模块,具体用于:
    清除所述临时转发表中的临时标记,并建立所述通信报文对应的会话与所述临时转发表的关联关系,得到所述通信报文对应的快速转发表。
  10. 根据权利要求9所述的装置,其特征在于,所述装置还包括:
    第一删除模块,用于如果所述当前资源利用率超过所述目标资源利用率阈值,则删除所述通信报文对应的临时转发表;
    或者,如果根据所述报文处理策略,未确定出与所述通信报文相匹配的业务,则删除所述通信报文对应的临时转发表。
  11. 根据权利要求8所述的装置,其特征在于,当与所述通信报文相匹配的目标业务的数目为多个时,所述第一建立模块,具体用于:
    如果所述当前资源利用率未超过确定出的目标资源利用率阈值中的最大值,则建立所述通信报文对应的快速转发表。
  12. 根据权利要求8所述的装置,其特征在于,所述装置还包括:
    第三确定模块,用于如果所述当前资源利用率超过所述目标资源利用率阈值,则根据快速转发表与业务的预设关联关系,确定当前建立的每个快速转发表对应的一个或更多个第一业务,并确定每个快速转发表对应的一个或更多个第一业务的优先级中的最高优先级;
    第二删除模块,用于从所述最高优先级中确定低于或等于所述目标优先级的第一优先级,并从所述各快速转发表中,确定关联的一个或更多个业务的优先级中的最高优先级为所述第一优先级的目标快速转发表,并删除所述目标快速转发表。
  13. 根据权利要求8所述的装置,其特征在于,所述装置还包括:
    第三建立模块,用于如果所述目标优先级为最高优先级,则建立所述通信报文对应的快速转发表;如果所述目标优先级为最低优先级,则不建立所述通信报文对应的快速转发表;
    所述第三建立模块,还用于如果所述目标优先级为所述最高优先级和所述最低优先级以外的其他优先级,则触发所述第二确定模块执行所述根据预设的优先级和资源利用率阈值的对应关系,确定所述目标优先级对应的目标资源利用率阈值步骤。
  14. 根据权利要求9所述的装置,其特征在于,所述报文处理策略包括各业务的匹配顺序和所述各业务的匹配规则;
    所述装置还包括:
    第三删除模块,用于如果所述当前资源利用率超过所述目标资源利用率阈值,则判断所述目标业务是否为所述匹配顺序中的最后一个业务;如果所述目标业务不是所述匹配顺序中的最后一个业务,则按照所述各业务的匹配顺序,将所述通信报文与所述各业务中未匹配业务的匹配规则进行匹配,确定下一个与所述通信报文相匹配的目标业务;如果所述目标业务是所述匹配顺序中的最后一个业务,则删除所述通信报文对应的临时转发表;
    第二判断模块,用于如果所述当前资源利用率未超过所述目标资源利用率阈值,则判断当前是否已 建立所述通信报文对应的快速转发表,如果当前未建立所述通信报文对应的快速转发表,则触发所述第一建立模块执行所述建立所述通信报文对应的快速转发表步骤。
  15. 一种网络设备,其特征在于,包括处理器和机器可读存储介质,所述机器可读存储介质存储有能够被所述处理器执行的机器可执行指令,所述处理器被所述机器可执行指令促使执行以下步骤:
    当接收到通信报文时,根据报文处理策略设定的业务的匹配规则,确定与所述通信报文相匹配的目标业务;
    如果本地未存储所述通信报文对应的快速转发表,则获取预设的所述目标业务的目标优先级,并根据预设的优先级和资源利用率阈值的对应关系,确定所述目标优先级对应的目标资源利用率阈值;
    判断当前资源利用率是否超过所述目标资源利用率阈值;
    如果所述当前资源利用率未超过所述目标资源利用率阈值,则建立所述通信报文对应的快速转发表。
  16. 根据权利要求15所述的网络设备,其特征在于,所述处理器被所述机器可执行指令促使执行以下步骤:
    当接收到通信报文时,建立所述通信报文对应的临时转发表;
    清除所述临时转发表中的临时标记,并建立所述通信报文对应的会话与所述临时转发表的关联关系,得到所述通信报文对应的快速转发表。
  17. 根据权利要求16所述的网络设备,其特征在于,所述处理器被所述机器可执行指令促使还执行以下步骤:
    如果所述当前资源利用率超过所述目标资源利用率阈值,则删除所述通信报文对应的临时转发表;或者,如果根据所述报文处理策略,未确定出与所述通信报文相匹配的业务,则删除所述通信报文对应的临时转发表。
  18. 根据权利要求15所述的网络设备,其特征在于,当与所述通信报文相匹配的目标业务的数目为多个时,所述如果所述当前资源利用率未超过所述目标资源利用率阈值,则所述处理器被所述机器可执行指令促使具体执行以下步骤:
    如果所述当前资源利用率未超过确定出的目标资源利用率阈值中的最大值,则建立所述通信报文对应的快速转发表。
  19. 根据权利要求15所述的网络设备,其特征在于,所述处理器被所述机器可执行指令促使还执行以下步骤:
    如果所述当前资源利用率超过所述目标资源利用率阈值,则根据快速转发表与业务的预设关联关系,确定当前建立的每个快速转发表对应的一个或更多个第一业务,并确定每个快速转发表对应的一个或更多个第一业务的优先级中的最高优先级;
    从所述最高优先级中确定低于或等于所述目标优先级的第一优先级,并从所述各快速转发表中,确 定关联的一个或更多个业务的优先级中的最高优先级为所述第一优先级的目标快速转发表,并删除所述目标快速转发表。
  20. 根据权利要求15所述的网络设备,其特征在于,所述获取预设的所述目标业务的目标优先级之后,所述处理器被所述机器可执行指令促使还执行以下步骤:
    如果所述目标优先级为最高优先级,则建立所述通信报文对应的快速转发表;
    如果所述目标优先级为最低优先级,则不建立所述通信报文对应的快速转发表;
    如果所述目标优先级为所述最高优先级和所述最低优先级以外的其他优先级,则执行所述根据预设的优先级和资源利用率阈值的对应关系,确定所述目标优先级对应的目标资源利用率阈值步骤。
  21. 根据权利要求16所述的网络设备,其特征在于,所述报文处理策略包括各业务的匹配顺序和所述各业务的匹配规则;
    所述处理器被所述机器可执行指令促使还执行以下步骤:
    如果所述当前资源利用率超过所述目标资源利用率阈值,则判断所述目标业务是否为所述匹配顺序中的最后一个业务;如果所述目标业务不是所述匹配顺序中的最后一个业务,则按照所述各业务的匹配顺序,将所述通信报文与所述各业务中未匹配业务的匹配规则进行匹配,确定下一个与所述通信报文相匹配的目标业务;如果所述目标业务是所述匹配顺序中的最后一个业务,则删除所述通信报文对应的临时转发表;
    如果所述当前资源利用率未超过所述目标资源利用率阈值,则判断当前是否已建立所述通信报文对应的快速转发表,如果当前未建立所述通信报文对应的快速转发表,则执行所述建立所述通信报文对应的快速转发表步骤。
  22. 一种机器可读存储介质,其特征在于,所述机器可读存储介质存储有机器可执行指令,在被处理器调用和执行时,所述机器可执行指令促使所述处理器执行以下步骤:
    当接收到通信报文时,根据报文处理策略设定的业务的匹配规则,确定与所述通信报文相匹配的目标业务;
    如果本地未存储所述通信报文对应的快速转发表,则获取预设的所述目标业务的目标优先级,并根据预设的优先级和资源利用率阈值的对应关系,确定所述目标优先级对应的目标资源利用率阈值;
    判断当前资源利用率是否超过所述目标资源利用率阈值;
    如果所述当前资源利用率未超过所述目标资源利用率阈值,则建立所述通信报文对应的快速转发表。
PCT/CN2019/103795 2018-08-31 2019-08-30 建立快速转发表 WO2020043200A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2021510359A JP7101308B2 (ja) 2018-08-31 2019-08-30 高速転送テーブル作成
US17/271,454 US11646976B2 (en) 2018-08-31 2019-08-30 Establishment of fast forwarding table
EP19854078.3A EP3832960B1 (en) 2018-08-31 2019-08-30 Establishment of fast forwarding table

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811012726.1 2018-08-31
CN201811012726.1A CN110278152B (zh) 2018-08-31 2018-08-31 一种建立快速转发表的方法及装置

Publications (1)

Publication Number Publication Date
WO2020043200A1 true WO2020043200A1 (zh) 2020-03-05

Family

ID=67958045

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/103795 WO2020043200A1 (zh) 2018-08-31 2019-08-30 建立快速转发表

Country Status (5)

Country Link
US (1) US11646976B2 (zh)
EP (1) EP3832960B1 (zh)
JP (1) JP7101308B2 (zh)
CN (1) CN110278152B (zh)
WO (1) WO2020043200A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113055306B (zh) * 2019-12-26 2022-10-28 北京华为数字技术有限公司 报文转发方法以及相关设备
CN111817960B (zh) * 2020-07-23 2022-02-01 杭州迪普信息技术有限公司 流控设备的报文转发方法及装置
CN114567581B (zh) * 2022-01-14 2023-12-26 新华三技术有限公司合肥分公司 一种配置表项的方法及设备
CN115002016B (zh) * 2022-05-17 2023-08-22 阿里云计算有限公司 报文处理系统、方法、设备和存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030072318A1 (en) * 2001-09-14 2003-04-17 Nokia Inc. System and method for packet forwarding
US20140112130A1 (en) * 2012-10-23 2014-04-24 Electronics And Telecommunications Research Institute Method for setting packet forwarding rule and control apparatus using the method
CN104579961A (zh) * 2013-10-11 2015-04-29 中国移动通信集团公司 数据报文的调度方法及装置
CN105208585A (zh) * 2014-06-23 2015-12-30 中兴通讯股份有限公司 调度信息的配置、配置参数的处理方法及装置

Family Cites Families (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6157644A (en) * 1997-10-07 2000-12-05 Northern Telecom Limited Method and apparatus for accelerating OSI layer 3 routers
US6577628B1 (en) * 1999-06-30 2003-06-10 Sun Microsystems, Inc. Providing quality of service (QoS) in a network environment in which client connections are maintained for limited periods of time
CN100442766C (zh) * 2005-07-08 2008-12-10 华为技术有限公司 数据通信设备转发业务的实现方法
JP4627461B2 (ja) 2005-07-14 2011-02-09 日本電信電話株式会社 通信サービス制御システムと方法およびプログラム
US8893009B2 (en) * 2009-01-28 2014-11-18 Headwater Partners I Llc End user device that secures an association of application to service policy with an application certificate check
US9351193B2 (en) * 2009-01-28 2016-05-24 Headwater Partners I Llc Intermediate networking devices
US10248996B2 (en) * 2009-01-28 2019-04-02 Headwater Research Llc Method for operating a wireless end-user device mobile payment agent
US10348571B2 (en) * 2009-06-11 2019-07-09 Talari Networks, Inc. Methods and apparatus for accessing dynamic routing information from networks coupled to a wide area network (WAN) to determine optimized end-to-end routing paths
CN103024874B (zh) * 2011-09-21 2015-07-29 中国移动通信集团山东有限公司 一种选择网络接入的方法及装置
US8897154B2 (en) * 2011-10-24 2014-11-25 A10 Networks, Inc. Combining stateless and stateful server load balancing
CN102833169B (zh) * 2012-09-04 2015-03-04 桂林电子科技大学 一种常数复杂度的对等网络目的资源定位方法
CN102984069B (zh) * 2012-11-30 2016-01-27 福建星网锐捷网络有限公司 表项调整方法、装置和交换设备
CN103763194B (zh) * 2013-12-31 2017-08-22 新华三技术有限公司 一种报文转发方法及装置
US9451095B2 (en) 2014-06-17 2016-09-20 Alcatel Lucent Charging in a software defined network
CN106713182B (zh) * 2015-08-10 2020-10-09 华为技术有限公司 一种处理流表的方法及装置
CN106559336B (zh) * 2015-09-24 2020-04-03 新华三技术有限公司 应用于sdn中的路径倒换方法、转发表项下发方法和装置
CN107070693B (zh) * 2017-01-12 2019-10-11 烽火通信科技股份有限公司 基于OpenFlow流表的快速配置POTN业务的方法及装置
CN107786450B (zh) * 2017-10-17 2020-09-08 新华三技术有限公司 一种数据报文传输方法、装置及机器可读存储介质
US10880124B2 (en) * 2018-12-28 2020-12-29 Alibaba Group Holding Limited Offload controller control of programmable switch
CA3143425A1 (en) * 2020-12-19 2022-06-19 Meteorcomm Llc End of train to head of train communication over a train control network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030072318A1 (en) * 2001-09-14 2003-04-17 Nokia Inc. System and method for packet forwarding
US20140112130A1 (en) * 2012-10-23 2014-04-24 Electronics And Telecommunications Research Institute Method for setting packet forwarding rule and control apparatus using the method
CN104579961A (zh) * 2013-10-11 2015-04-29 中国移动通信集团公司 数据报文的调度方法及装置
CN105208585A (zh) * 2014-06-23 2015-12-30 中兴通讯股份有限公司 调度信息的配置、配置参数的处理方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3832960A4 *

Also Published As

Publication number Publication date
CN110278152A (zh) 2019-09-24
US11646976B2 (en) 2023-05-09
JP2021535665A (ja) 2021-12-16
US20210306282A1 (en) 2021-09-30
JP7101308B2 (ja) 2022-07-14
CN110278152B (zh) 2020-05-29
EP3832960A1 (en) 2021-06-09
EP3832960B1 (en) 2022-08-17
EP3832960A4 (en) 2021-10-27

Similar Documents

Publication Publication Date Title
WO2020043200A1 (zh) 建立快速转发表
US9071529B2 (en) Method and apparatus for accelerating forwarding in software-defined networks
US9654395B2 (en) SDN-based service chaining system
JP5958570B2 (ja) ネットワークシステム、コントローラ、スイッチ、及びトラフィック監視方法
EP2853069B1 (en) Integrated heterogeneous software-defined network
CN108141416B (zh) 一种报文处理方法、计算设备以及报文处理装置
US8867361B2 (en) Implementing EPC in a cloud computer with OpenFlow data plane
US9602428B2 (en) Method and apparatus for locality sensitive hash-based load balancing
US10567345B2 (en) Verifying firewall filter entries using rules associated with an access control list (ACL) template
US10361954B2 (en) Method and apparatus for processing modified packet
US9998364B2 (en) Method for processing packet and forwarder
WO2021017930A1 (zh) 报文转发
JP2000349851A (ja) パケット転送装置
CN108259378B (zh) 一种报文处理方法及装置
US11863459B2 (en) Packet processing method and apparatus
US10291518B2 (en) Managing flow table entries for express packet processing based on packet priority or quality of service
US20220286409A1 (en) Method and apparatus for configuring quality of service policy for service, and computing device
WO2012159525A1 (zh) 一种用于自治网络的业务控制方法及系统
US8675669B2 (en) Policy homomorphic network extension
WO2017000097A1 (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: 19854078

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021510359

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2019854078

Country of ref document: EP

Effective date: 20210303