WO2018036254A1 - 报文转发方法及装置 - Google Patents

报文转发方法及装置 Download PDF

Info

Publication number
WO2018036254A1
WO2018036254A1 PCT/CN2017/089465 CN2017089465W WO2018036254A1 WO 2018036254 A1 WO2018036254 A1 WO 2018036254A1 CN 2017089465 W CN2017089465 W CN 2017089465W WO 2018036254 A1 WO2018036254 A1 WO 2018036254A1
Authority
WO
WIPO (PCT)
Prior art keywords
forwarding
parameter
packet
preset
classifier
Prior art date
Application number
PCT/CN2017/089465
Other languages
English (en)
French (fr)
Inventor
徐晓旸
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2018036254A1 publication Critical patent/WO2018036254A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/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/24Multipath
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/302Route determination based on requested QoS

Definitions

  • the present disclosure relates to the field of communications technologies, and in particular, to a packet forwarding method and apparatus.
  • the service function chain (English: service function chain, SFC for short) defines and instantiates a set of ordered business functions for service flow (English: service function, SF for short), and the business function chain is also referred to as the service chain. (English: service chain), its purpose is to provide users with an end-to-end business path.
  • SF can refer to firewall (English: firewalls), network address translator (English: Network Address Translators, referred to as: NATs) or other specific applications (English: application-specific) functions, for example, load balancer (English: load Balancer) and so on.
  • the network device forwards the Internet Protocol (English: Internet Protocol, IP for short) message, if the network
  • the network device extracts the quintuple from the IP packet (source IP address, The destination IP address, the source port, the destination port, and the protocol number are calculated, and a hash value is calculated according to the quintuple, and then a path is selected from the multiple forwarding paths according to the hash value.
  • the quintuple of the return service flow is to exchange the source IP address and the destination IP address in the quintuple of the forward service flow, and the source port and the destination port are exchanged, and the SFF receives the return service flow.
  • the return service flow cannot be directed to the SF of the forward traffic flow in the SFG, and the round-trip path consistency requirement cannot be met.
  • a packet forwarding method and apparatus are provided to solve the problem that the SFF cannot lead the forward service flow and the return service flow to the same SF in the SFG according to the hash algorithm in the prior art, and cannot meet the round-trip path.
  • an embodiment of the present invention provides a packet forwarding method, including:
  • the classifier receives the service packet and determines the preset packet feature of the service packet
  • the classifier obtains a forwarding parameter corresponding to the preset message feature
  • the classifier encapsulates the service packet into a service chain packet, where the service chain packet carries the forwarding parameter
  • the classifier sends the service chain message to a service function forwarder corresponding to the device identifier.
  • the classifier obtains a forwarding parameter corresponding to the preset packet feature, including:
  • the classifier generates a parameter query request message, where the parameter query request message carries the preset message feature
  • the classifier sends the parameter query request message to a parameter manager
  • the classifier receives the forwarding parameter returned by the parameter manager according to the parameter query request.
  • the generating, by the classifier, the parameter query request message includes:
  • the classifier searches, in the classifier mapping table, whether the forwarding parameter corresponding to the preset message feature exists;
  • the classifier When the forwarding parameter corresponding to the preset message feature does not exist in the classifier mapping table, the classifier generates the parameter query request message;
  • the method further includes:
  • the classifier When the classifier receives the forwarding parameter returned by the parameter manager, the corresponding relationship between the forwarding parameter and the preset message feature is added to the classifier mapping table.
  • the classifier obtains a forwarding parameter corresponding to the preset packet feature, including:
  • the classifier searches, in the classifier mapping table, whether the forwarding parameter corresponding to the preset message feature exists;
  • the classifier acquires the corresponding to the preset message feature from the classifier mapping table. Forward parameters.
  • the forwarding path includes at least one service function group, and each of the service function groups is connected to at least two service function forwardings arranged in a preset order.
  • the classifier determines, according to the forwarding parameter, a device identifier of a service function forwarder of a next hop in the forwarding path, including:
  • the classifier performs modulo calculation on the forwarding parameter to obtain an operation result
  • the classifier determines a target quantity value interval in which the operation result is located
  • the classifier determines, according to the correspondence between the preset quantity value interval and the device identifier, the device identifier corresponding to the target quantity value interval as the device identifier of the service function forwarder of the next hop in the forwarding path.
  • an embodiment of the present invention provides a packet forwarding method, where the method includes:
  • the service function forwarder receives the service chain packet forwarded by the last hop device in the forwarding path, where the service chain packet carries the forwarding parameter;
  • the service function forwarder obtains a forwarding parameter in the service chain packet
  • the service function forwarder sends the service chain message to the next hop device corresponding to the device identifier.
  • the service function forwarder determines, according to the forwarding parameter, a next hop device identifier in the forwarding path, including:
  • the service function forwarder determines, according to the preset forwarding table, that the device type of the next hop device in the forwarding path is a service function forwarder, the service function forwarder determines a next hop according to the forwarding parameter. Device ID of the service function forwarder corresponding to the device.
  • the service function forwarder is associated with multiple service function entities
  • the service function forwarder determines the next hop device identifier in the forwarding path according to the forwarding parameter, and further includes:
  • the service function forwarder determines, according to the preset forwarding table, that the device type of the next hop device in the forwarding path is a service function entity, the service function forwarder determines the next hop device according to the forwarding parameter.
  • the method further includes:
  • the service function forwarder determines the preset packet feature in the service chain packet.
  • the service function forwarder decapsulates the service chain packet to obtain a service packet
  • the service function forwarder sends the service packet to the receiving end of the forwarding path.
  • an embodiment of the present invention provides a forwarding parameter management method, including:
  • the parameter manager receives a query request message sent by the classifier, where the query request message carries a preset message feature;
  • the parameter manager obtains a preset message feature in the query request message
  • the parameter manager obtains a forwarding parameter that has a mapping relationship with the preset packet feature
  • the parameter manager sends the forwarding parameter to the classifier.
  • the preset message feature includes a first path identifier of a forwarding path and at least one pair of elements of the same category, where the parameter manager obtains
  • the forwarding parameter of the preset packet feature has a mapping relationship, including:
  • the parameter manager searches, in the manager mapping table, a forwarding parameter that has a mapping relationship with the preset packet feature
  • the parameter manager When the forwarding parameter is found in the manager mapping table, the parameter manager sends the forwarding parameter to the classifier;
  • the parameter manager searches the path identifier mapping table for the second path identifier corresponding to the first path identifier, and replaces the first path identifier. Identifying the second path, and swapping the elements of the same category to obtain the updated message feature, and searching, in the manager mapping table, the forwarding parameter that has a mapping relationship with the updated message feature;
  • the parameter manager calculates a forwarding parameter according to the preset message feature, and sends the forwarding parameter to the classifier.
  • the calculated forwarding parameters are the forwarding parameters that has a mapping relationship with the update message feature.
  • the method further includes:
  • the parameter manager determines whether the received mapping relationship exists in the manager mapping table
  • the parameter manager adds the received mapping relationship to the manager mapping table.
  • a fourth aspect of the present invention provides a packet forwarding apparatus, including:
  • a receiving module configured to receive a service packet, and determine a preset packet feature of the service packet
  • An obtaining module configured to acquire a forwarding parameter corresponding to the preset message feature
  • the encapsulating module is configured to encapsulate the service packet into a service chain packet, where the service chain packet carries the forwarding parameter;
  • a determining module configured to determine, according to the forwarding parameter, a device identifier of a service function forwarder of a next hop in the forwarding path;
  • the sending module is configured to send the service chain packet to the corresponding service function forwarder of the device identifier.
  • the apparatus of the above fourth aspect may further include other functional modules for implementing the methods in the foregoing first aspect and various implementations of the first aspect.
  • an embodiment of the present invention provides a packet forwarding device, where the device includes:
  • a receiving module configured to receive a service chain packet forwarded by a device in a forwarding path, where the service chain packet carries the forwarding parameter
  • An obtaining module configured to obtain a forwarding parameter in the service chain packet
  • a determining module configured to determine, according to the forwarding parameter, a next hop device identifier in the forwarding path
  • the sending module is configured to send the service chain packet to the next hop device corresponding to the device identifier.
  • the apparatus of the above fifth aspect may further include other functional modules for implementing the methods in the various implementation manners of the second aspect and the second aspect.
  • an embodiment of the present invention provides a forwarding parameter management apparatus, including:
  • a receiving module configured to receive a query request message sent by the classifier, where the query request message carries a preset message feature
  • An acquiring module configured to acquire a preset packet feature in the query request message, and obtain a forwarding parameter that has a mapping relationship with the preset packet feature
  • a sending module configured to send the forwarding parameter to the classifier.
  • the apparatus of the above sixth aspect may further include other functional modules for implementing the methods in the various implementation manners of the third aspect and the third aspect.
  • a seventh aspect of the present invention provides a message forwarding device, the message forwarding device comprising: a memory and a processor, wherein the memory is configured to store a set of codes, and the processor is configured to execute the set of codes to implement the first aspect, the first The method of the second aspect or the third aspect.
  • the classifier of the present invention determines the preset packet feature after receiving the service packet, and obtains the forwarding parameter corresponding to the preset packet feature, and encapsulates the service packet into a service chain packet carrying the forwarding parameter, so that the classifier encapsulates the service packet
  • the service function forwarder of the next hop can continue to transmit the service chain packet according to the forwarding parameter, and the forwarding parameter is encapsulated in the service chain packet. Even if there is a device that modifies the packet in the forwarding path, the forwarding parameter does not occur.
  • the SFF in the service forwarding path determines the device identifier of the SF and the SFF of the next hop according to the forwarding parameter in the service chain packet, and sends the service chain packet to the service function forwarder corresponding to the device identifier.
  • the entire transmission process of the service chain packet in the forwarding path is determined by each hop device.
  • the forwarding parameter selects the next hop device to ensure that the forward path and the return path are consistent when the service chain is transmitted.
  • the last hop service function forwarder determines the preset message feature in the service chain message; and sends the message to the parameter manager.
  • the mapping relationship between the preset packet feature and the forwarding parameter so that the device that modifies the packet feature in the forwarding path (such as NAT) modifies the preset packet feature, and then modifies the modified preset packet feature.
  • the corresponding relationship between the forwarding parameters and the forwarding parameters is uploaded to the parameter manager for use in forwarding the service packets next time.
  • the parameter manager After receiving the query request, the parameter manager obtains the preset message feature in the query request message and searches for a forwarding parameter in the manager mapping table that has a mapping relationship with the preset message feature. When the forwarding parameter is not found in the device mapping table, the parameter manager replaces or shifts the preset message feature to obtain the updated message feature, and each element in the updated message feature is a symmetric path of the current forwarding path. The preset message characteristics are then queried according to the updated message characteristics, so that the parameter manager can ensure that the forwarding parameters of the forward path and the return path are consistent.
  • FIG. 1 is a schematic structural diagram of a forward path and a return path according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a packet forwarding method according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of a service chain architecture according to an embodiment of the present disclosure.
  • FIG. 4 is a schematic structural diagram of an internal structure of any SFG in FIG. 3 and a plurality of SFFSs corresponding to the SFG;
  • FIG. 5 is a schematic flow chart of step S102 in FIG. 2;
  • FIG. 6 is a schematic flowchart of step S205
  • FIG. 7 is another schematic flowchart of step S102 in FIG. 2;
  • FIG. 8 is a schematic structural diagram of a packet forwarding apparatus according to an embodiment of the present disclosure.
  • FIG. 9 is a schematic structural diagram of another packet forwarding apparatus according to an embodiment of the present disclosure.
  • FIG. 10 is a schematic structural diagram of another packet forwarding apparatus according to an embodiment of the present disclosure.
  • FIG. 11 is a schematic structural diagram of still another packet forwarding apparatus according to an embodiment of the present invention.
  • the business chain architecture in a broad sense includes the following parts: control plane (English: control plane), SF, SFF, and classifier.
  • the control plane is mainly responsible for lifecycle management of the business chain, constructing a service function path (English: service function path, SFP for short), and distributing path information to nodes in the service chain, usually by a controller;
  • the SF is responsible for the implementation of the specific service policy, and is mainly provided by the service provider.
  • the SFF is responsible for forwarding the service packet to the local SF and the next hop SFF according to the service chain rule, which is mainly provided by the network operator; the classifier is based on the service packet.
  • the information such as the quintuple forwards the service chain packet obtained by the encapsulated service packet to the first hop SFF of the corresponding service chain, and the classifier can be independently set or integrated into the network device.
  • FIG. 1 is a schematic structural diagram of a forward path and a return path according to an embodiment of the present invention.
  • the SPI of the forward path is 10
  • the SPI of the return path is 11
  • the SPI values of the forward path and the return path are different.
  • SFG1 includes three SFs, namely: SF1, SF2 and SF3, wherein SF1 and SF2 are connected to SFF1, SF3 is connected to SFF2, and SFG2 includes two SFs, namely: SF4 and SF5, and SF4 and SF5 are both connected to SFF3.
  • the solid line in Figure 1 indicates the forward path through which the forward traffic from the sender src to the receiver dst passes.
  • the classifier 1 encapsulates the service packet and forwards the encapsulated service chain packet to the packet.
  • SF1 in SFG1 and SF4 in SFG2 the dotted line in Fig.
  • classifier 1 indicates the return path through which the return traffic from the receiving end dst to the transmitting end src passes.
  • the classifier 2 encapsulates the service packet, it will be encapsulated.
  • the service chain message is forwarded to SF4 in SFG2 and SF1 in SFG1.
  • two classifiers are shown for ease of understanding. In practical applications, classifier 1 and classifier 2 may also refer to the same classifier.
  • an embodiment of the present invention provides a packet forwarding method, including the following steps.
  • step S101 the classifier receives the service message and determines the preset message feature of the service message.
  • the preset packet feature may be ⁇ SPI, srcIP, dstIP ⁇ , where SPI is the path identifier of the forwarding path, srcIP is the IP address of the sending end, dstIP is the IP address of the receiving end, and preset packet characteristics It can also be ⁇ SPI, srcIP, dstIP, srcPort, dstPort, proto ⁇ , where srcPort is the port number of the sender, dstPort is the port number of the receiver, and proto is the protocol number.
  • the classifier receives the service packet sent by the sender, obtains srcIP and dstIP in the received service packet, and obtains srcPort, dstPort, and proto based on the srcIP and dstIP, and according to the preset.
  • the message characteristics match the preset service chain rules to get the SPI.
  • the service chain rule includes a matching action table, and the matching action table includes a correspondence between the binary group ⁇ srcIP, dstIP ⁇ and the SPI, or a correspondence between the quintuple ⁇ srcIP, dstIP, srcPort, dstPort, proto ⁇ and the SPI, and the matching
  • the service chain rule one or more of ⁇ srcIP, dstIP ⁇ in the preset message feature, or one or more of ⁇ srcIP, dstIP, srcPort, dstPort, proto ⁇ may be used to find a matching action table.
  • the SPI matching the binary group or the quintuple is obtained.
  • step S102 the classifier acquires a forwarding parameter corresponding to the preset message feature.
  • the forwarding parameter is an integer, which is used to provide a path selection basis for the classifier and the SFF when selecting the next hop, and the correspondence between the forwarding parameter and the packet feature is managed by the parameter manager, and the parameter manager Can be set independently or integrated as a function module inside the controller; when the sender of the forward path and the sender of the return path share the same classifier, the parameter manager can also be integrated inside the classifier; when the parameter manager When it is not integrated in the classifier, after the classifier obtains the correspondence between the forwarding parameter and the message feature from the parameter manager, the correspondence between the forwarding parameter and the message feature may also be stored in the classifier. in.
  • FIG. 3 is a schematic diagram of a service chain architecture according to an embodiment of the present invention.
  • the classifier may obtain a forwarding parameter corresponding to a preset message feature from a parameter manager by sending a query request, as shown in FIG.
  • the internal buffer area of the device obtains a forwarding parameter corresponding to the preset message feature.
  • the step S102 may include the following steps.
  • step S201 the classifier generates a parameter query request message.
  • the parameter query request message carries the preset message feature.
  • the step S201 includes: the classifier may search, in the classifier mapping table, whether the forwarding parameter corresponding to the preset message feature exists; when the classifier mapping table does not exist and the preset The classifier generates the parameter query request message when the forwarding parameter corresponding to the message feature.
  • the step S201 further includes: when the classifier receives the forwarding parameter returned by the parameter manager, adding a correspondence between the forwarding parameter and the preset message feature to the classifier mapping table.
  • the classifier can only obtain and query the report by sending a query request to the parameter manager. If the classifier obtains the forwarding parameter from the parameter manager, the classifier can forward the preset packet feature and the return packet in order to facilitate the next forwarding of the service packet containing the preset packet feature.
  • the mapping relationship between the parameters is stored in the classifier mapping table.
  • step S202 the classifier sends the parameter query request message to the parameter manager.
  • the processor in the classifier can directly send the query request message to the parameter manager, and when the parameter manager is located outside the classifier, the processor in the classifier can First obtain the address of the parameter manager, and then send a query request message according to the address of the parameter manager.
  • step S203 the parameter manager receives the query request message sent by the classifier.
  • the query request message in order to enable the parameter manager to determine the forwarding parameter according to the preset message feature, the query request message needs to carry the preset message feature.
  • step S204 the parameter manager acquires a preset message feature in the query request message.
  • step S205 the parameter manager obtains a forwarding parameter that has a mapping relationship with the preset message feature.
  • the parameter manager can search for a forwarding parameter that is in a mapping relationship with the preset packet feature in the parameter manager according to the preset packet feature.
  • the forwarding parameter that has a mapping relationship with the preset packet feature can be calculated according to the preset packet feature.
  • the preset message feature includes a first path identifier of the forwarding path and at least one pair of elements of the same category.
  • the category may refer to an IP address category or a port category, etc., for example, srcIP and dstIP may be used. It is determined that it is an element belonging to the same IP address category, and srcPort and dstPort may be determined to be elements belonging to the same port category, etc.
  • the step S205 includes the following steps.
  • step S2051 the parameter manager searches the manager mapping table for a forwarding parameter that has a mapping relationship with the preset message feature.
  • a second mapping relationship table for storing message features and forwarding parameters may be set in the parameter manager.
  • the parameter manager can compare the packet features in the second mapping relationship table with the preset packet features one by one. When there is a packet feature with the same preset packet characteristics, the manager mapping can be determined. The forwarding parameter that has a mapping relationship with the preset packet feature can be found in the table, and the forwarding parameter that has a mapping relationship with the preset packet feature is the forwarding parameter to be searched.
  • step S2052 when the forwarding parameter is found in the manager mapping table, the parameter manager sends the forwarding parameter to the classifier.
  • step S2053 when the forwarding parameter is not found in the manager mapping table, the parameter manager searches the path identifier mapping table for the second path identifier corresponding to the first path identifier, and the first Replace path identifier with second path Identifying, and exchanging the elements of the same category to obtain an updated message feature, and searching, in the manager mapping table, a forwarding parameter that has a mapping relationship with the updated message feature.
  • the path identifier mapping table stores the correspondence between the first path identifier and the second path identifier
  • the second path identifier refers to the path identifier of the symmetric path of the forwarding path, for example, when the forwarding path
  • the symmetric path of the forwarding path is the return path
  • the second path is identified as the path identifier of the return path.
  • the forwarding path is the return path
  • the symmetric path of the forwarding path is the forward path
  • the second path identifier The path identifier for the forward path.
  • the parameter manager may search for the second path identifier corresponding to the first path identifier in the path identifier mapping table, and then the first path The identifier is replaced with the second path identifier, and the elements belonging to the same category in the preset message feature are interchanged. For example, if the preset message feature is ⁇ first SPI, srcIP, dstIP ⁇ , the message feature may be updated.
  • the update message characteristics can be ⁇ second SPI, dstIP, srcIP, dstPort, srcPort, proto ⁇ , and then in the second mapping relationship table to find the same message characteristics as the update message feature, if the same message feature as the update message feature is found, the manager mapping table can be determined.
  • the forwarding parameter that has a mapping relationship with the update packet feature can be found, and the forwarding parameter that has a mapping relationship with the update packet feature is the forwarding parameter to be searched.
  • the returning service packet sent by the receiving end to the transmitting end needs to be on the return path symmetric with the forward path.
  • the classifier determines the preset message feature according to the return service message, and then sends the determined preset message feature to the parameter manager through the query request message.
  • the parameter manager processes the elements in the preset packet features in the return service packet.
  • the preset message feature is converted into the update message feature, and the update message feature here is the preset message feature in the forward service message. In this way, the parameter manager can ensure that the forward traffic packets are forwarded on the forward path and the return traffic packets are forwarded on the return path.
  • step S2054 when the forwarding parameter that has a mapping relationship with the update message feature is not found in the manager mapping table, the parameter manager calculates a forwarding parameter according to the preset message feature, and the classification parameter is Transmitting the calculated forwarding parameters.
  • the calculation method of the forwarding parameter is determined by the rules of the parameter manager, including but not limited to the following three types: a hash algorithm, an accumulated global variable, or a randomly generated manner.
  • step S206 the parameter manager sends the forwarding parameter to the classifier.
  • the step S102 further includes the following steps.
  • step S301 the classifier searches in the classifier mapping table whether there is a forwarding parameter corresponding to the preset message feature.
  • a correspondence between the packet feature and the forwarding parameter may be set inside the classifier.
  • the classifier can compare the packet features in the first mapping relationship table with the preset packet features one by one. When there is a packet feature with the same preset message characteristics, the classifier mapping table can be determined. The forwarding parameter that has a mapping relationship with the preset packet feature can be found, and the forwarding parameter that has a mapping relationship with the preset packet feature is the forwarding parameter to be searched.
  • step S302 when the forwarding parameter corresponding to the preset message feature exists in the classifier mapping table, the classifier obtains the forwarding corresponding to the preset message feature from the classifier mapping table. parameter.
  • the classifier encapsulates the service packet into a service chain packet, where the service chain packet carries the forwarding parameter.
  • the classifier encapsulates the service packet.
  • the forwarding parameter may be encapsulated in the service chain header or encapsulated in other locations of the service chain packet.
  • step S104 the classifier determines, according to the forwarding parameter, a device identifier of a service function forwarder of a next hop in the forwarding path.
  • the classifier may select a device identifier of the SFF in an SFF corresponding to the SFG1 according to the forwarding parameter and the preset routing method, as the service function repeater of the next hop of the classifier.
  • the device identification, the preset routing method can refer to the modulo method, and the like.
  • the device identifier of the service function forwarder for example, SFF1, SFF2, 221, and 222, and the like.
  • the forwarding path is RSP, and the next hop refers to the SFF in the forwarding path that is connected to the output of the classifier, such as SFF1 in FIG.
  • the forwarding path includes at least one service function group SFG.
  • the step S104 includes the following steps.
  • the classifier performs modulo calculation on the forwarding parameter to obtain an operation result.
  • s selector%n, where n is the number of SFs in the SFG, and the selector is a forwarding parameter.
  • the classifier determines a target quantity value interval in which the operation result is located.
  • the classifier can compare the operation result s with two end points of each quantity value interval, and when the operation result s is located in any one of the quantity value intervals, the quantity value interval can be determined as the target quantity value interval.
  • the classifier determines, according to the correspondence between the preset quantity value interval and the device identifier, the device identifier corresponding to the target quantity value interval as the device identifier of the service function forwarder of the next hop in the forwarding path.
  • the classifier may pre-set a correspondence between multiple sets of quantity value intervals and device identifiers, and the method for determining each group of correspondences is to determine a quantity value interval for the device identifier of each service function forwarder.
  • the number of SFs corresponding to each device identifier may be first determined, where the correspondence refers to each device identifying its own connected SF, and before the device identifier in the forwarding path. All devices identify the connected SF, accumulate the number of all SFs corresponding to the device identifier, and obtain the cumulative quantity value, so that each device identifier can obtain a cumulative quantity value; then, it can determine the corresponding two device identifiers in the forwarding path.
  • the cumulative quantity value is the value of both ends of the quantity value interval.
  • the service function repeaters can be considered to be arranged in a preset order, for example, the service that the solid line or the broken line in FIG. 1 passes when transmitting the service message.
  • the order of the function repeaters, etc. therefore, the device identifiers corresponding to the forwarders of each service function can also be considered to be arranged in a preset order. Therefore, when determining the quantity value interval, the device of each service function forwarder can be calculated first. A sum of the number of corresponding service function entities identifying themselves and at least 0 device identifiers thereof, for example, as shown in FIG.
  • the device identifier corresponding to the target quantity value interval may be determined, thereby determining that the device identifier is determined as the forwarding path.
  • the device identifier of the next-hop service function forwarder that is, the classifier determines, in the SFG corresponding to the next hop, the service function forwarder corresponding to the device identifier as the next-hop service function forwarder in the forwarding path.
  • step S105 the classifier sends the service chain message to the service function forwarder corresponding to the device identifier.
  • the classifier determines the address of the service function forwarder according to the device identifier, and sends the service chain message to the service function forwarder corresponding to the address.
  • step S106 the service function forwarder receives the service chain message forwarded by the last hop device in the forwarding path.
  • the service chain packet carries the forwarding parameter
  • the previous hop device in the forwarding path of the service function forwarder may refer to a classifier, and may also be a service function forwarder.
  • step S107 the service function forwarder obtains the forwarding parameter in the service chain message.
  • step S108 the service function forwarder determines the next hop device identifier in the forwarding path according to the forwarding parameter.
  • the current service function forwarder when the current service function forwarder is one of multiple service function forwarders corresponding to SFG1, the current service function forwarder can be based on forwarding parameters and presets.
  • the routing method determines the device identifier corresponding to the next hop device, where the next hop device may refer to one of the plurality of SFs included in the SFG1, the plurality of SFFs corresponding to the SFG1, or the plurality of SFFs corresponding to the SFG2.
  • the preset routing method can refer to the modulo method and the like.
  • the step S108 includes the following steps.
  • the service function forwarder determines the device type of the next hop device in the forwarding path according to the preset forwarding table.
  • the service function forwarder may be configured with a device identifier and a device type preset forwarding table for storing each hop device in the forwarding path, because the service function forwarder is used to receive the received service chain report.
  • the file is forwarded to any corresponding SF or SFF of the next hop, so the device type may refer to a service function entity type or a service function forwarder type.
  • the service function forwarder can obtain the device type of the next hop device from the preset forwarding table.
  • the service function forwarder determines, according to the forwarding parameter, a service function forwarder corresponding to the next hop device.
  • Equipment Identity the device type of the next hop device in the forwarding path determined by the preset forwarding table.
  • the service function forwarder can determine the device identifier of the service function forwarder corresponding to the next hop device according to the forwarding parameter and the preset routing method. For the determination method, refer to the process of step S1041 to step S1044, the only difference is that The process is performed by the business function forwarder.
  • the service function forwarder is associated with multiple SFs; the step S108 It also includes the following steps.
  • the service function forwarder determines, according to the forwarding parameter, a device identifier of the service function entity corresponding to the next hop device. .
  • the service function forwarder can obtain the device type of the next hop device from the preset forwarding table.
  • the service function forwarder according to the forwarding parameter
  • the preset routing method determines the device identifier of the service function entity corresponding to the next hop device.
  • the preset routing method here takes the modulo method as an example. The modulo method is as follows, assuming that the SFF number is h:
  • num_i is the accumulated value of num_0 to num_h-1.
  • h takes different values, multiple quantity value intervals can be determined.
  • the cumulative value of num_i is 3,..., so that when s is located at [ 0, 2), it is determined that the next hop is SF_0, and when s is located at [2, 3), it is determined that the next hop is SF_1, ....
  • step S109 the service function forwarder sends the service chain message to the next hop device corresponding to the device identifier.
  • step S110 when the device identifier of the next hop device of the service chain packet is the same as the preset device identifier, the service function forwarder determines the preset packet feature in the service chain packet.
  • the preset device identifier may be the device identifier of the receiving device, and the device identifier of the next hop device is the same as the device identifier of the receiving device, that is, the current service function forwarder is the last one in the forwarding path. Jump service function forwarder.
  • the preset packet feature in the service chain packet received by the last hop service function forwarder may have been modified.
  • the preset packet characteristics in the service chain message are determined.
  • step S111 the service function forwarder sends a mapping relationship between the preset message feature and the forwarding parameter to the parameter manager.
  • the service function forwarder sends a mapping relationship between the determined preset message feature and the forwarding parameter in the service chain message to the parameter manager.
  • step S112 when the parameter manager receives the mapping relationship sent by the service function forwarder, the parameter manager determines whether the received mapping relationship exists in the manager mapping table.
  • the parameter manager when the parameter manager receives the mapping relationship sent by the service function forwarder, compares the received mapping relationship with each mapping relationship in the second mapping relationship table, and determines whether the received mapping relationship is related to the second mapping relationship.
  • the mapping relationship in the mapping relationship table is different.
  • step S113 when the received mapping relationship does not exist in the manager mapping table, the parameter manager adds the received mapping relationship to the manager mapping table.
  • step S114 the service function forwarder decapsulates the service chain packet to obtain a service packet.
  • the service function forwarder decapsulates the service chain packet by using the reverse process of encapsulating the service packet, and Get a business message.
  • step S115 the service function forwarder sends the service packet to the receiving end of the forwarding path.
  • the service function forwarder sends the decapsulated service packet to the receiving end of the forwarding path.
  • a message forwarding apparatus including: a receiving module 11, an obtaining module 12, a packaging module 13, a determining module 14, and a sending module 15.
  • the receiving module 11 is configured to receive a service packet, and determine a preset packet feature of the service packet.
  • the obtaining module 12 is configured to obtain a forwarding parameter corresponding to the preset message feature.
  • the encapsulating module 13 is configured to encapsulate the service packet into a service chain packet, where the service chain packet carries the forwarding parameter.
  • the determining module 14 is configured to determine, according to the forwarding parameter, a device identifier of a service function forwarder of a next hop in the forwarding path.
  • the sending module 15 is configured to send the service chain message to the corresponding service function forwarder of the device identifier.
  • the acquiring module is configured to:
  • the acquiring module is further configured to:
  • the correspondence between the forwarding parameter and the preset message feature is added to the classifier mapping table.
  • the acquiring module is configured to:
  • the forwarding parameter corresponding to the preset message feature exists in the classifier mapping table
  • the forwarding parameter corresponding to the preset message feature is obtained from the classifier mapping table.
  • the forwarding path includes at least one service function group, and each of the service function groups is connected to at least two service function forwarders arranged in a preset order;
  • the determining module is configured to:
  • the device identifier corresponding to the target quantity value interval is determined as the device identifier of the next function service forwarder in the forwarding path according to the correspondence between the preset quantity value interval and the device identifier.
  • the device includes a receiving module 21, an obtaining module 22, a determining module 23, and a sending module 24.
  • the receiving module 21 is configured to receive a service chain packet forwarded by the last hop device in the forwarding path, where the service chain packet carries the forwarding parameter.
  • the obtaining module 22 is configured to obtain forwarding parameters in the service chain packet.
  • the determining module 23 is configured to determine, according to the forwarding parameter, a next hop device identifier in the forwarding path.
  • the sending module 24 is configured to send the service chain message to the next hop device corresponding to the device identifier.
  • the determining module 23 is configured to:
  • the device identifier of the service function forwarder corresponding to the next hop device is determined according to the forwarding parameter.
  • the service function forwarder is associated with a plurality of service function entities.
  • the determining module 23 is further configured to:
  • the device identifier of the service function entity corresponding to the next hop device is determined according to the forwarding parameter.
  • the apparatus further includes: releasing the package module.
  • the determining module 23 is further configured to determine a preset packet feature in the service chain packet when the device identifier of the next hop device of the service chain packet is the same as the preset device identifier.
  • the sending module is further configured to send, to the parameter manager, a mapping relationship between the preset message feature and the forwarding parameter;
  • the decapsulation module is configured to decapsulate the service chain packet to obtain a service packet.
  • the sending module is further configured to send the service packet to the receiving end of the forwarding path.
  • a forwarding parameter management apparatus includes: a receiving module 31, an obtaining module 32, and a sending module 33.
  • the receiving module 31 is configured to receive a query request message sent by the classifier, where the query request message carries a preset message feature.
  • the obtaining module 32 is configured to acquire a preset message feature in the query request message, and obtain a forwarding parameter that has a mapping relationship with the preset message feature.
  • the sending module 33 is configured to send the forwarding parameter to the classifier.
  • the preset message feature includes a first path identifier of the forwarding path and at least one pair of elements of the same category, and the acquiring module is configured to:
  • the second path identifier corresponding to the first path identifier is searched in the path identifier mapping table, and the first path identifier is replaced with the second path identifier. And exchanging the elements of the same category to obtain an update message feature, and searching, in the manager mapping table, a forwarding parameter that has a mapping relationship with the update message feature;
  • the forwarding parameter When the forwarding parameter that has a mapping relationship with the update packet feature is not found in the manager mapping table, the forwarding parameter is calculated according to the preset packet feature, and the calculated forwarding is sent to the classifier. parameter.
  • the apparatus further includes: a determining module and a joining module.
  • the determining module is configured to determine, when the mapping relationship sent by the service function forwarder is received, whether the received mapping relationship exists in the manager mapping table.
  • the embodiment of the present invention further provides a message forwarding device 110.
  • the device includes: a memory 1101, a processor 1102, and a transceiver 1103.
  • the memory 1101 is configured to store a set of codes
  • the processor 1102 is configured to The set of codes performs any of the methods shown in Figures 2 and 5-7, and the transceiver 1103 is used to communicate with other devices.
  • the memory 1101, the processor 1102 and the transceiver 1103 are coupled together by a bus system 1104.
  • the memory 1101 may include a random access memory, and may also include a non-volatile memory, such as at least one disk storage.
  • the bus system 1104 can be an industry standard architecture (English: Industry Standard Architecture, ISA for short) bus, an external device interconnection (English: Peripheral Component, PCI) bus or an extended industry standard architecture (English: Extended Industry Standard Architecture, short for EISA) bus and so on.
  • the bus system 1104 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 11, but it does not mean that there is only one bus or one type of bus.
  • the receiving module and the sending module in FIG. 8 to FIG. 10 may be integrated into the transceiver 1103, and the remaining modules may be integrated into the processor 1102.
  • the remaining modules may be embedded in the hardware or in a processor independent of the network device. , can also be stored in the memory of the network device in the form of software, so that the processor can call the corresponding operations of the above modules, the processor can be a central processing unit (English: Central Processing Unit, CPU for short), a specific integrated circuit ( English: Application Specific Integrated Circuit (ASIC) or one or more integrated circuits configured to implement embodiments of the present invention.
  • CPU Central Processing Unit
  • ASIC Application Specific Integrated Circuit
  • Each device in the network device 110 provided by the embodiment of the present invention is used to perform the foregoing method. Therefore, the beneficial effects of the network device 110 can be referred to the beneficial effects described in the foregoing method, and details are not described herein again.
  • the present invention further provides a computer storage medium, wherein the computer storage medium may store a program, and the program may include some or all of the steps in the embodiments of the message forwarding method provided by the present invention.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (English: read-only memory, abbreviated as: ROM) or a random access memory (English: random access memory, abbreviation: RAM).
  • the techniques in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such understanding, the technical solution in the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product, which may be stored in a storage medium such as a ROM/RAM. , a disk, an optical disk, etc., including instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present invention or portions of the embodiments.
  • a computer device which may be a personal computer, server, or network device, etc.

Landscapes

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

Abstract

本公开是关于一种报文转发方法及装置,所述方法包括:接收业务报文,并确定所述业务报文的预设报文特征;获取与所述预设报文特征对应的转发参数;将所述业务报文封装为携带有所述转发参数的业务链报文;根据所述转发参数确定转发路径中的下一跳的业务功能转发器的设备标识;向所述设备标识对应的业务功能转发器发送所述业务链报文。本发明将业务报文封装为携带有转发参数的业务链报文,可以便于下一跳的业务功能转发器继续根据转发参数传输业务链报文,且转发参数被封装在业务链报文中,转发参数不会因转发路径中存在修改报文的设备发生改变,保证业务链报文传输时的正向路径和返程路径一致,可以实现保证正向路径及返程路径的转发参数一致。

Description

报文转发方法及装置
本申请要求于2016年8月24日提交中国专利局、申请号为201610716222.2、发明名称为“报文转发方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本公开涉及通信技术领域,尤其涉及一种报文转发方法及装置。
背景技术
业务功能链(英文:service function chain,简称:SFC)定义并实例化一组有序的供业务流通过的业务功能(英文:service function,简称:SF),业务功能链也被简称为业务链(英文:service chain),其目的是为用户提供端到端的业务路径。其中,SF可以指防火墙(英文:firewalls)、网络地址转换器(英文:Network Address Translators,简称:NATs)或者其他特定应用(英文:application-specific)的功能,例如,负载均衡器(英文:load balancer)等。当报文从业务链的一端被转发到另一端时,需要经过一条由多个SFs以及它们连结的业务功能转发器(英文:Service Function Forwarder,简称:SFFs)构成的具体业务路径(英文:Rendered Service Path,简称:RSP)。
通常端到端的业务流使用正向路径和返程路径传输,由于单个SF设备的性能有限,当业务路径上传输的流量过大时,SF容易成为性能瓶颈。所以需要具体业务路径的每一跳可以被设置为由多个相同类型的SFs构成的业务功能组(英文:service function group,简称:SFG),并且使用SFF的本地策略决定业务流在传输时需要经过SFG内的哪个SF。
当业务链中存在需要维持业务流的状态的SF(例如状态防火墙)时,需要保证正向业务流与返程业务流的来去路径一致。在现有的网络等价多路径(英文:equal-cost multi-path,简称:ECMP)路由技术中,当网络设备转发因特网协议(英文:Internet Protocol,简称:IP)报文时,如果该网络设备的转发表中该IP报文的目的地址对应的转发路径有多条且它们的开销(英文:cost)相同时,网络设备会从该IP报文中抽取出五元组(源IP地址、目的IP地址、源端口、目的端口及协议号),并根据该五元组计算出一个哈希(英文:hash)值,然后根据该hash值从该多条转发路径中选择一条路径。
但是,返程业务流的五元组是将正向业务流的五元组中的源IP地址和目的IP地址互换,将源端口和目的端口互换得到的,SFF在收到返程业务流时,无法根据hash算法将返程业务流引向SFG中处理正向业务流的SF,进而无法满足往返路径的一致性要求。
发明内容
本发明实施例中提供了一种报文转发方法及装置,以解决现有技术中SFF无法根据hash算法将正向业务流和返程业务流引向SFG中的同一个SF,无法满足往返路径的一致性要求的问题。
为了解决上述技术问题,本发明实施例公开了如下技术方案:
第一方面,本发明实施例提供一种报文转发方法,包括:
分类器接收业务报文,并确定所述业务报文的预设报文特征;
所述分类器获取与所述预设报文特征对应的转发参数;
所述分类器将所述业务报文封装为业务链报文,所述业务链报文中携带有所述转发参数;
所述分类器根据所述转发参数确定转发路径中的下一跳的业务功能转发器的设备标识;
所述分类器向所述设备标识对应的业务功能转发器发送所述业务链报文。
结合第一方面,在第一方面第一种可能的实现方式中,所述分类器获取与所述预设报文特征对应的转发参数,包括:
所述分类器生成参数查询请求消息,所述参数查询请求消息中携带有所述预设报文特征;
所述分类器向参数管理器发送所述参数查询请求消息;
所述分类器接收所述参数管理器根据所述参数查询请求返回的所述转发参数。
结合第一方面,在第一方面第二种可能的实现方式中,所述分类器生成所述参数查询请求消息包括:
所述分类器在分类器映射表中查找是否存在与所述预设报文特征对应的所述转发参数;
当所述分类器映射表中不存在与所述预设报文特征对应的所述转发参数时,所述分类器生成所述参数查询请求消息;
所述方法还包括:
当所述分类器接收到所述参数管理器返回的所述转发参数时,将所述转发参数以及所述预设报文特征的对应关系加入所述分类器映射表。
结合第一方面,在第一方面第三种可能的实现方式中,所述分类器获取与所述预设报文特征对应的转发参数,包括:
所述分类器在分类器映射表中查找是否存在与所述预设报文特征对应的所述转发参数;
当所述分类器映射表中存在与所述预设报文特征对应的所述转发参数时,所述分类器从所述分类器映射表中获取与所述预设报文特征对应的所述转发参数。
结合第一方面,在第一方面第四种可能的实现方式中,所述转发路径中包含至少一个业务功能组,每个所述业务功能组连接至少两个按照预设顺序排列的业务功能转发器;
所述分类器根据所述转发参数确定转发路径中的下一跳的业务功能转发器的设备标识,包括:
所述分类器对所述转发参数进行取模计算,得到运算结果;
所述分类器确定所述运算结果所在的目标数量值区间;
所述分类器根据预设的数量值区间与设备标识的对应关系将所述目标数量值区间对应的设备标识确定为转发路径中的下一跳的业务功能转发器的设备标识。
第二方面,本发明实施例提供一种报文转发方法,所述方法包括:
业务功能转发器接收转发路径中上一跳设备转发的业务链报文,所述业务链报文中携带有所述转发参数;
所述业务功能转发器获取所述业务链报文中的转发参数;
所述业务功能转发器根据所述转发参数确定所述转发路径中下一跳设备标识;
所述业务功能转发器向所述设备标识对应的下一跳设备发送所述业务链报文。
结合第二方面,在第二方面第一种可能的实现方式中,所述业务功能转发器根据所述转发参数确定所述转发路径中下一跳设备标识,包括:
所述业务功能转发器根据预设转发表确定所述转发路径中下一跳设备的设备类型;
当所述业务功能转发器根据所述预设转发表确定的所述转发路径中下一跳设备的设备类型为业务功能转发器时,所述业务功能转发器根据所述转发参数确定下一跳设备对应的业务功能转发器的设备标识。
结合第二方面,在第二方面第二种可能的实现方式中,所述业务功能转发器关联有多个业务功能实体;
所述业务功能转发器根据所述转发参数确定所述转发路径中下一跳设备标识,还包括:
当所述业务功能转发器根据所述预设转发表确定的所述转发路径中下一跳设备的设备类型为业务功能实体时,所述业务功能转发器根据所述转发参数确定下一跳设备对应的业务功能实体的设备标识。
结合第二方面,在第二方面第三种可能的实现方式中,所述方法还包括:
当所述业务链报文的下一跳设备的设备标识与预设设备标识相同时,业务功能转发器确定所述业务链报文中的预设报文特征;
所述业务功能转发器向参数管理器发送所述预设报文特征与所述转发参数之间的映射关系;
所述业务功能转发器将所述业务链报文解除封装,得到业务报文;
所述业务功能转发器向所述转发路径的接收端发送所述业务报文。
第三方面,本发明实施例提供一种转发参数管理方法,包括:
参数管理器接收分类器发送的查询请求消息,所述查询请求消息携带有预设报文特征;
所述参数管理器获取所述查询请求消息中的预设报文特征;
所述参数管理器获取与所述预设报文特征存在映射关系的转发参数;
所述参数管理器向所述分类器发送所述转发参数。
结合第三方面,在第三方面第一种可能的实现方式中,所述预设报文特征中包含转发路径的第一路径标识和至少一对相同类别的元素,所述参数管理器获取与所述预设报文特征存在映射关系的转发参数,包括:
所述参数管理器在管理器映射表中查找与所述预设报文特征存在映射关系的转发参数;
当在管理器映射表中查找到所述转发参数时,所述参数管理器向所述分类器发送所述转发参数;
当在管理器映射表中未查找到所述转发参数时,所述参数管理器在路径标识映射表中查找与所述第一路径标识对应的第二路径标识,将所述第一路径标识替换为第二路径标识,并且将相同类别的元素互换位置,得到更新报文特征,在管理器映射表中查找与所述更新报文特征存在映射关系的转发参数;
当在管理器映射表中未查找到与所述更新报文特征存在映射关系的转发参数时,所述参数管理器根据所述预设报文特征计算转发参数,并且向所述分类器发送所述计算得到的转发参数。
结合第三方面,在第三方面第二种可能的实现方式中,所述方法还包括:
当接收到业务功能转发器发送的映射关系时,所述参数管理器判断所述管理器映射表中是否存在接收的所述映射关系;
当所述管理器映射表中不存在接收的所述映射关系时,所述参数管理器将接收的所述映射关系加入所述管理器映射表中。
第四方面,本发明实施例提供一种报文转发装置,包括:
接收模块,用于接收业务报文,并确定所述业务报文的预设报文特征;
获取模块,用于获取与所述预设报文特征对应的转发参数;
封装模块,用于将所述业务报文封装为业务链报文,所述业务链报文中携带有所述转发参数;
确定模块,用于根据所述转发参数确定转发路径中的下一跳的业务功能转发器的设备标识;
发送模块,用于向所述设备标识对应的业务功能转发器发送所述业务链报文。
上述第四方面的装置还可以包括其他的功能模块,用于实现上述第一方面及第一方面的各种实现方式中的方法。
第五方面,本发明实施例提供一种报文转发装置,所述装置包括:
接收模块,用于接收转发路径中上一跳设备转发的业务链报文,所述业务链报文中携带有所述转发参数;
获取模块,用于获取所述业务链报文中的转发参数;
确定模块,用于根据所述转发参数确定所述转发路径中下一跳设备标识;
发送模块,用于向所述设备标识对应的下一跳设备发送所述业务链报文。
上述第五方面的装置还可以包括其他的功能模块,用于实现上述第二方面及第二方面的各种实现方式中的方法。
第六方面,本发明实施例提供一种转发参数管理装置,包括:
接收模块,用于接收分类器发送的查询请求消息,所述查询请求消息携带有预设报文特征;
获取模块,用于获取所述查询请求消息中的预设报文特征;以及获取与所述预设报文特征存在映射关系的转发参数;
发送模块,用于向所述分类器发送所述转发参数。
上述第六方面的装置还可以包括其他的功能模块,用于实现上述第三方面及第三方面的各种实现方式中的方法。
本发明第七方面提供了一种报文转发装置,所述报文转发装置包括:存储器和处理器,存储器用于存储一组代码,处理器用于执行该组代码以实现上述第一方面、第二方面或第三方面所述的方法。
本发明中的分类器在接收的业务报文后确定预设报文特征,并获取与预设报文特征对应的转发参数,将业务报文封装为携带有转发参数的业务链报文,这样可以便于下一跳的业务功能转发器继续根据转发参数传输业务链报文,且转发参数被封装在业务链报文中,即使转发路径中存在修改报文的设备时,转发参数也不会发生改变,业务转发路径中的各个SFF根据业务链报文中的转发参数确定下一跳的SF及SFF的设备标识,并向所述设备标识对应的业务功能转发器发送所述业务链报文,业务链报文在转发路径中的整个传输过程,均是由每一跳设备根据 转发参数选择下一跳设备,可以保证业务链报文传输时的正向路径和返程路径一致。
当将业务链报文发送至转发路径中的最后一跳业务功能转发器时,最后一跳业务功能转发器确定所述业务链报文中的预设报文特征;并向参数管理器发送所述预设报文特征与所述转发参数之间的映射关系,这样可以在转发路径中修改报文特征的设备(如NAT)修改预设报文特征后,将修改后的预设报文特征及转发参数的对应关系上传至参数管理器,以便于下次转发业务报文时使用。
参数管理器在接收到查询请求后,会获取所述查询请求消息中的预设报文特征并在管理器映射表中查找与所述预设报文特征存在映射关系的转发参数,当在管理器映射表中未查找到所述转发参数时,参数管理器将预设报文特征进行替换或者移位,得到更新报文特征,更新报文特征中的各个元素即为当前转发路径的对称路径的预设报文特征,然后再根据更新报文特征查询转发参数,这样,参数管理器即可以实现保证正向路径及返程路径的转发参数一致。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍。
图1为本发明实施例提供的正向路径和返程路径的结构示意图;
图2为本发明实施例提供的一种报文转发方法的流程示意图;
图3为本发明实施例提供的一种业务链架构示意图;
图4为图3中任一SFG的内部结构及与该SFG对应的多个SFFS的架构示意图;
图5为图2中步骤S102的一种流程示意图;
图6为步骤S205的一种流程示意图;
图7为图2中步骤S102的另一种流程示意图;
图8为本发明实施例提供的一种报文转发装置的结构示意图;
图9为本发明实施例提供的另一种报文转发装置的结构示意图;
图10为本发明实施例提供的另一种报文转发装置的结构示意图;
图11为本发明实施例提供的再一种报文转发装置的结构示意图。
具体实施方式
为了使本技术领域的人员更好地理解本发明中的技术方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行描述。
广义上的业务链架构包括以下几个部分:控制面(英文:control plane)、SF、SFF及分类器(classifier)。控制面主要负责业务链的生命周期管理、构建(construct)业务功能路径(英文:service function path,简称:SFP)、向业务链中的节点分发(propagate)路径信息等,通常由控制器实现;SF负责具体的业务策略执行,主要由业务提供商提供;SFF负责将业务报文根据业务链规则转发给本地SF和下一跳SFF,主要由网络运营商提供;分类器根据业务报文中的五元组等信息,将封装业务报文得到的业务链报文转发给对应业务链的第一跳SFF,分类器可以独立设置,也可以集成到网络设备中。
一条RSP中包含多个SFs以及它们连结的SFFs,每条RSP有一个唯一的业务路径标识(英文:service path identifier,简称:SPI)。图1为本发明实施例提供的正向路径和返程路径的结构示意图,其中,正向路径的SPI为10,返程路径的SPI为11,正向路径与返程路径的SPI值不同。
如图1所示,正向路径与返程路径均经过两个SFG。SFG1包含三个SFs,即:SF1、SF2与SF3,其中,SF1与SF2连接SFF1,SF3连接SFF2,SFG2包含两个SFs,即:SF4与SF5,SF4与SF5均连接到SFF3。图1中的实线表示从发送端src到接收端dst的正向流量经过的正向路径,在正向路径中,分类器1封装业务报文后,将封装后的业务链报文转发给SFG1中的SF1与SFG2中的SF4;图1中的虚线表示从接收端dst到发送端src的返程流量经过的返程路径,在返程路径中,分类器2封装业务报文后,将封装后的业务链报文转发给SFG2中的SF4与SFG1中的SF1,图1中为了便于理解示出两个分类器,在实际应用中,分类器1和分类器2也可以指同一个分类器。
为了实现图1中的正向路径和返程路径的一致性,如图2所示,本发明的一个实施例提供一种报文转发方法,包括以下步骤。
在步骤S101中,分类器接收业务报文,并确定所述业务报文的预设报文特征。
在本发明实施例中,预设报文特征可以为{SPI,srcIP,dstIP},其中SPI为转发路径的路径标识,srcIP为发送端的IP地址,dstIP为接收端的IP地址;预设报文特征也可以为{SPI,srcIP,dstIP,srcPort,dstPort,proto},其中,srcPort为发送端的端口号,dstPort为接收端的端口号,proto为协议号。
在该步骤中,分类器接收发送端发送的业务报文,在接收到的业务报文中获取srcIP和dstIP,在获取srcIP和dstIP基础上,还可以获取srcPort、dstPort和proto,并根据预设报文特征匹配预设的业务链规则,以得到SPI。
业务链规则中包括匹配动作表,匹配动作表中包含二元组{srcIP,dstIP}与SPI的对应关系,或者五元组{srcIP,dstIP,srcPort,dstPort,proto}与SPI的对应关系,匹配业务链规则时,可以根据预设报文特征中的{srcIP,dstIP}中的一项或多项,或者{srcIP,dstIP,srcPort,dstPort,proto}中的一项或多项查找匹配动作表,当匹配动作表中存在匹配的二元组或者五元组,获取与该二元组或者五元组匹配的SPI。
在步骤S102中,所述分类器获取与所述预设报文特征对应的转发参数。
在本发明实施例中,转发参数为整数,用于给分类器和SFF在选择下一跳时提供选路依据,转发参数与报文特征之间的对应关系由参数管理器管理,参数管理器可以独立设置,也可以作为一个功能模块集成在控制器内部;当正向路径的发送方与返程路径的发送方共用同一分类器时,参数管理器也可以集成在分类器内部;当参数管理器没有集成在分类器中时,在分类器每次从参数管理器获取到转发参数与报文特征之间的对应关系后,也可以将转发参数与报文特征之间的对应关系存储在分类器中。
图3是本发明实施例提供的一种业务链架构示意图,分类器可以如图3所示通过发送查询请求的方式从参数管理器获取与预设报文特征对应的转发参数,也可以在分类器内部缓存区域获取与预设报文特征对应的转发参数。
当分类器中无法缓存转发参数与报文特征之间对应关系、或者分类器中没有缓存预设报文特征对应的转发参数时,如图5所示,所述步骤S102可以包括以下步骤。
在步骤S201中,分类器生成参数查询请求消息。
在本发明实施例中,所述参数查询请求消息中携带有所述预设报文特征。
所述步骤S201包括:所述分类器可以在分类器映射表中查找是否存在与所述预设报文特征对应的所述转发参数;当所述分类器映射表中不存在与所述预设报文特征对应的所述转发参数时,所述分类器生成所述参数查询请求消息。
步骤S201还包括:当所述分类器接收到所述参数管理器返回的所述转发参数时,将所述转发参数以及所述预设报文特征的对应关系加入所述分类器映射表。
在本发明实施例中,由于分类器内部的第一映射关系表中不存在与预设报文特征对应的转发参数,分类器只能通过向参数管理器发送查询请求的方式获取与预设报文特征存在映射关系的转发参数,当分类器从参数管理器获取到转发参数后,为了方便下一次转发包含该预设报文特征的业务报文,可以将预设报文特征与返回的转发参数之间的映射关系存入分类器映射表。
在步骤S202中,分类器向参数管理器发送所述参数查询请求消息。
在该步骤中,在参数管理器位于分类器内部时,分类器中的处理器可以直接将查询请求消息发送给参数管理器,在参数管理器位于分类器外部时,分类器中的处理器可以首先获取参数管理器的地址,然后根据参数管理器的地址发送查询请求消息。
在步骤S203中,参数管理器接收分类器发送的查询请求消息。
在本发明实施例中,为了使参数管理器能够根据预设报文特征确定转发参数,所以所述查询请求消息中需要携带有预设报文特征。
在步骤S204中,参数管理器获取所述查询请求消息中的预设报文特征。
在步骤S205中,参数管理器获取与所述预设报文特征存在映射关系的转发参数。
在该步骤中,参数管理器可以根据预设报文特征在参数管理器内部查找与预设报文特征存在映射关系的转发参数,当在本地无法查找到与预设报文特征存在映射关系的转发参数时,可以根据预设报文特征计算与预设报文特征存在映射关系的转发参数。
所述预设报文特征中包含转发路径的第一路径标识和至少一对相同类别的元素,在本发明实施例中,类别可以指IP地址类别或者端口类别等等,例如,srcIP和dstIP可以被确定为是同属于IP地址类别的元素,srcPort和dstPort可以被确定为是同属于端口类别的元素等,如图6所示,所述步骤S205包括以下步骤。
在步骤S2051中,参数管理器在管理器映射表中查找与所述预设报文特征存在映射关系的转发参数。
在本发明实施例中,可以在参数管理器中设置用于存储报文特征与转发参数的第二映射关系表。
在该步骤中,参数管理器可以逐一将第二映射关系表中的报文特征与预设报文特征比较,当存在与预设报文特征相同的报文特征时,可以确定在管理器映射表中可以查找到与预设报文特征存在映射关系的转发参数,并且与该预设报文特征存在映射关系的转发参数为待查找的转发参数。
在步骤S2052中,当在管理器映射表中查找到所述转发参数时,所述参数管理器向所述分类器发送所述转发参数。
在步骤S2053中,当在管理器映射表中未查找到所述转发参数时,参数管理器在路径标识映射表中查找与所述第一路径标识对应的第二路径标识,将所述第一路径标识替换为第二路径 标识,并且将相同类别的元素互换位置,得到更新报文特征,在管理器映射表中查找与所述更新报文特征存在映射关系的转发参数。
在本发明实施例中,路径标识映射表中存储有第一路径标识与第二路径标识之间的对应关系,第二路径标识指所述转发路径的对称路径的路径标识,例如,当转发路径为正向路径时,转发路径的对称路径为返程路径,则第二路径标识为返程路径的路径标识;当转发路径为返程路径时,转发路径的对称路径为正向路径,则第二路径标识为正向路径的路径标识。
在该步骤中,当在第二映射关系表中未查找到转发参数时,参数管理器可以在路径标识映射表中查找与所述第一路径标识对应的第二路径标识,然后将第一路径标识替换为第二路径标识,并且将预设报文特征中属于相同类别的元素互换位置,例如,假设预设报文特征为{第一SPI,srcIP,dstIP},则更新报文特征可以为{第二SPI,dstIP,srcIP};假设预设报文特征为{第一SPI,srcIP,dstIP,srcPort,dstPort,proto},则更新报文特征可以为{第二SPI,dstIP,srcIP,dstPort,srcPort,proto},然后再在第二映射关系表中查找与更新报文特征相同的报文特征,若查找到与更新报文特征相同的报文特征,则可以确定在管理器映射表中可以查找到与更新报文特征存在映射关系的转发参数,并且与该更新报文特征存在映射关系的转发参数为待查找的转发参数。
在本发明实施例中,由于正向的业务报文在通过正向路径被转发到接收端后,接收端向发送端发送的返程的业务报文需要在与正向路径对称的返程路径上被转发,这时,分类器会根据返程的业务报文确定预设报文特征,然后将该确定的预设报文特征通过查询请求消息发送给参数管理器。参数管理器为了获取到与正向的业务报文在正向路径被转发时使用的转发参数,会将返程的业务报文中的预设报文特征中的元素进行处理,处理的方式就是将预设报文特征转化为更新报文特征,这里的更新报文特征即为正向的业务报文中的预设报文特征。通过这种方式,参数管理器可以保证正向的业务报文在正向路径上被转发时和返程的业务报文在返程路径上被转发时使用相同的转发参数。
在步骤S2054中,当在管理器映射表中未查找到与所述更新报文特征存在映射关系的转发参数时,参数管理器根据所述预设报文特征计算转发参数,并且向所述分类器发送所述计算得到的转发参数。
在本发明实施例中,转发参数的计算方法由参数管理器的规则决定,包括但不限于以下三种:hash算法、累加全局变量或者随机生成的方式。
在步骤S206中,参数管理器向所述分类器发送所述转发参数。
当分类器中缓存转发参数与报文特征之间对应关系时,如图7所示,所述步骤S102还包括以下步骤。
在步骤S301中,分类器在分类器映射表中查找是否存在与所述预设报文特征对应的转发参数。
在本发明实施例中,可以在分类器内部设置用于存储报文特征与转发参数之间的对应关系。
在该步骤中,分类器可以逐一将第一映射关系表中的报文特征与预设报文特征比较,当存在与预设报文特征相同的报文特征时,可以确定在分类器映射表中可以查找到与预设报文特征存在映射关系的转发参数,并且与该预设报文特征存在映射关系的转发参数为待查找的转发参数。
在步骤S302中,当所述分类器映射表中存在与所述预设报文特征对应的转发参数时,分类器从所述分类器映射表中获取与所述预设报文特征对应的转发参数。
在步骤S103中,所述分类器将所述业务报文封装为业务链报文,所述业务链报文中携带有所述转发参数。
在该步骤中,分类器将业务报文进行封装,封装时,可以将转发参数封装在业务链报文头中,也可以封装在业务链报文的其他位置。
在步骤S104中,所述分类器根据所述转发参数确定转发路径中的下一跳的业务功能转发器的设备标识。
在该步骤中,如图3所示,分类器可以根据转发参数和预设的选路方法在SFG1对应的一个SFF中选择一个SFF的设备标识,作为分类器的下一跳的业务功能转发器的设备标识,预设的选路方法可以指取模方法等。
在本发明实施例中,业务功能转发器的设备标识,例如SFF1、SFF2、221和222等。转发路径即为RSP,下一跳指转发路径中与分类器的输出端连接的SFF,如图1中的SFF1。
所述转发路径中包含至少一个业务功能组SFG,图3中任一SFG的内部结构及与该SFG连接的多个SFFS的架构示意图如图4所示,每个所述业务功能组SFG中包括多个SF,每个SF均连接一个SFF,每个SFF连接至少一个SF,至少两个SFF按照预设顺序排列;假定SFG包含n个SFs,记为SF 0,…,SF n-1;n个SFs共连接k个SFFs,分别记为SFF_0,…,SFF_k-1;其中,SFF_i连接的本地SF(隶属该SFG,下同)的数量记为num_i,显然有n=∑(i=0,...,k-1)num_i。
所述步骤S104包括以下步骤。
分类器对所述转发参数进行取模计算,得到运算结果。
在本发明实施例中,假设运算结果为s,则s=selector%n,其中,n为SFG内SFs的数量,selector为转发参数。
分类器确定所述运算结果所在的目标数量值区间。
在该步骤中,分类器可以将运算结果s与每个数量值区间的两个端点对比,当运算结果s位于任意一个数量值区间中时,可以将该数量值区间确定为目标数量值区间。
分类器根据预设的数量值区间与设备标识的对应关系将所述目标数量值区间对应的设备标识确定为转发路径中的下一跳的业务功能转发器的设备标识。
在本发明实施例中,分类器可以预先设置多组数量值区间与设备标识的对应关系,每组对应关系的确定方法为针对每个业务功能转发器的设备标识,确定一个数量值区间。
在确定每个设备标识对应的数量值区间时,可以首先确定每个设备标识对应的SF的数量,这里的对应指每个设备标识其自身连接的SF,以及,在转发路径中该设备标识之前的所有设备标识连接的SF,累加设备标识对应的所有SF的数量,得到累计数量值,这样,每个设备标识可以得到一个累计数量值;然后可以确定转发路径中相邻两个设备标识对应的累计数量值为所述数量值区间的两端值。
以上确定每个设备标识对应的数量值区间的过程可以利用程序语言表达:
if s∈[∑(i=0,...,m-1)num_i,∑(i=0,...,m)num_i):goto SFF_m,其中,m取值0至k-1。
上式中的n、num、SFF均代表下一跳SFG内的元素值,%为取模符号,∑(i=0,...,m-1)num_i为num_0到num_m-1的累加值,当m=0时,累加值为0。
也就是说,在该步骤中,由于在每个SFG中,业务功能转发器均可以被认为是按照预设顺 序排列的,例如,图1中实线或者虚线在传递业务报文时经过的业务功能转发器的顺序等,所以,每个业务功能转发器对应的设备标识也可以认为是按照预设顺序排列的,因此,在确定数量值区间时,可以首先计算每个业务功能转发器的设备标识其自身及其之前的至少0个设备标识的对应的业务功能实体的数量总和,例如,如图4所示,当m取不同值时,可以确定多个数量值区间,当m=0时,∑(i=0,...,m-1)num_i的累加值为0,∑(i=0,...,m)num_i的累加值为2(此处是由于累加计算时计算SFF_0对应的业务功能实体的数量,共2个:SF_0和SF_1),当m=1时,∑(i=0,...,h-1)num_i的累加值为2,∑(i=0,...,h)num_i的累加值为3(此处是由于累加计算时计算SFF_0对应的业务功能实体SF_0和SF_1,和,SFF_1对应的业务功能实体SF_2的数量,共3个),……直至m取完k-1的值,可以确定多个数量值区间,这样,当s位于[0,2),则确定下一跳为SFF_0,当s位于[2,3),则确定下一跳为SFF_1,……。在该步骤中,由于每个设备标识均对应一个数量值区间,所以在确定目标数量值区间后可以确定与该目标数量值区间对应的设备标识,进而确定将该设备标识确定为转发路径中的下一跳的业务功能转发器的设备标识,也就是说,分类器在与其下一跳对应的SFG中确定与该设备标识对应的业务功能转发器为转发路径中下一跳的业务功能转发器。
在步骤S105中,所述分类器向所述设备标识对应的业务功能转发器发送所述业务链报文。
在该步骤中,分类器根据设备标识确定业务功能转发器的地址,并将业务链报文向与所述地址对应的业务功能转发器发送。
在步骤S106中,业务功能转发器接收转发路径中上一跳设备转发的业务链报文。
在本发明实施例中,所述业务链报文中携带有所述转发参数,业务功能转发器在转发路径中的上一跳设备可以指分类器,也可以指业务功能转发器等。
在步骤S107中,业务功能转发器获取所述业务链报文中的转发参数。
在步骤S108中,业务功能转发器根据所述转发参数确定所述转发路径中下一跳设备标识。
在该步骤中,如图3所示,例如,当当前的业务功能转发器为与SFG1对应的多个业务功能转发器中的一个时,该当前的业务功能转发器可以根据转发参数和预设的选路方法确定下一跳设备对应的设备标识,这里的下一跳设备可以指在SFG1包括的多个SF、与SFG1对应的多个SFF或者SFG2对应的多个SFF中的一个设备。预设的选路方法可以指取模方法等。
在本发明实施例中,所述步骤S108包括以下步骤。
业务功能转发器根据预设转发表确定所述转发路径中下一跳设备的设备类型。
在本发明实施例中,业务功能转发器中可以设置有用于存储转发路径中每一跳设备的设备标识及设备类型预设转发表,由于业务功能转发器是用于将接收到的业务链报文转发给其对应的任意一个SF或者下一跳的SFF,所以设备类型可以指业务功能实体类型或者业务功能转发器类型等。
在该步骤中,业务功能转发器可以从预设转发表中获取下一跳设备的设备类型。
当根据所述预设转发表确定的所述转发路径中下一跳设备的设备类型为业务功能转发器时,业务功能转发器根据所述转发参数确定下一跳设备对应的业务功能转发器的设备标识。
在该步骤中,业务功能转发器可以根据转发参数及预设的选路方法确定下一跳设备对应的业务功能转发器的设备标识,确定方法可以参见步骤S1041至步骤S1044的过程,区别仅在于,该过程由业务功能转发器执行。
在本发明实施例中,如图4所示,所述业务功能转发器会关联有多个SFs;所述步骤S108 还包括以下步骤。
当根据所述预设转发表确定的所述转发路径中下一跳设备的设备类型为业务功能实体时,业务功能转发器根据所述转发参数确定下一跳设备对应的业务功能实体的设备标识。
在该步骤中,业务功能转发器可以从预设转发表中获取下一跳设备的设备类型,当获取的下一跳设备的设备类型为业务功能实体时,业务功能转发器根据所述转发参数及预设的选路方法,确定下一跳设备对应的业务功能实体的设备标识,在确定下一跳设备对应的业务功能实体的设备标识时,如图4所示,假定SFF_i对应n个SFs,记为SF 0,…,SF n-1,其中,连接的本地SF(隶属该SFG,下同)数量记为num_i,显然有n=∑(i=0,...,h-1)num_i。这里预设的选路方法以取模方法为例,取模方法如下,假定该SFF的编号为h:
记s=selector%n,
if s∈[∑(i=0,...,h-1)num_i,∑(i=0,...,h)num_i):goto SF_s;
else drop packet。
其中,%为取模符号,∑(i=0,...,h-1)num_i为num_0到num_h-1的累加值,当h取不同的值时,可以确定多个数量值区间,当h=0时,∑(i=0,...,h-1)num_i的累加值为0,∑(i=0,...,h)num_i的累加值为2,当h=1时,∑(i=0,...,h-1)num_i的累加值为2,∑(i=0,...,h)num_i的累加值为3,……,这样,当s位于[0,2),则确定下一跳为SF_0,当s位于[2,3),则确定下一跳为SF_1,……。
在步骤S109中,业务功能转发器向所述设备标识对应的下一跳设备发送所述业务链报文。
在步骤S110中,当所述业务链报文的下一跳设备的设备标识与预设设备标识相同时,业务功能转发器确定所述业务链报文中的预设报文特征。
在本发明实施例中,预设设备标识可以指接收端设备的设备标识,下一跳设备的设备标识与接收端设备的设备标识相同,即当前的业务功能转发器为转发路径中的最后一跳业务功能转发器。
在该步骤中,由于转发路径中会存在修改报文特征的设备(如NAT),所以最后一跳业务功能转发器接收到的业务链报文中的预设报文特征可能已经被修改,所以此处再次确定业务链报文中的预设报文特征。
在步骤S111中,业务功能转发器向参数管理器发送所述预设报文特征与所述转发参数之间的映射关系。
在该步骤中,业务功能转发器向参数管理器发送确定的预设报文特征与业务链报文中的转发参数之间的映射关系。
在步骤S112中,当参数管理器接收到业务功能转发器发送的映射关系时,参数管理器判断所述管理器映射表中是否存在接收的所述映射关系。
在该步骤中,参数管理器在接收到业务功能转发器发送的映射关系时,将接收到的映射关系与第二映射关系表中的各个映射关系进行对比,判断接收的映射关系是否与第二映射关系表中的各个映射关系均不相同,当接收的映射关系与第二映射关系表中的各个映射关系均不相同时,可以确定所述管理器映射表中不存在接收的所述映射关系。
在步骤S113中,当所述管理器映射表中不存在接收的所述映射关系时,参数管理器将接收的所述映射关系加入所述管理器映射表中。
在步骤S114中,业务功能转发器将所述业务链报文解除封装,得到业务报文。
在该步骤中,业务功能转发器利用封装业务报文时的逆过程对业务链报文进行解封装,并 得到业务报文。
在步骤S115中,业务功能转发器向所述转发路径的接收端发送所述业务报文。
在该步骤中,业务功能转发器向转发路径的接收端发送解除封装后的业务报文。
如图8所示,在本发明的又一实施例中,提供一种报文转发装置,包括:接收模块11、获取模块12、封装模块13、确定模块14和发送模块15。
接收模块11,用于接收业务报文,并确定所述业务报文的预设报文特征。
获取模块12,用于获取与所述预设报文特征对应的转发参数。
封装模块13,用于将所述业务报文封装为业务链报文,所述业务链报文中携带有所述转发参数。
确定模块14,用于根据所述转发参数确定转发路径中的下一跳的业务功能转发器的设备标识。
发送模块15,用于向所述设备标识对应的业务功能转发器发送所述业务链报文。
在本发明的又一实施例中,所述获取模块,用于:
生成参数查询请求消息,所述参数查询请求消息中携带有所述预设报文特征;
向参数管理器发送所述参数查询请求消息;
接收所述参数管理器根据所述参数查询请求返回的所述转发参数。
在本发明的又一实施例中,所述获取模块,还用于:
在分类器映射表中查找是否存在与所述预设报文特征对应的所述转发参数;
当所述分类器映射表中不存在与所述预设报文特征对应的所述转发参数时,生成所述参数查询请求消息;
当接收到所述参数管理器返回的所述转发参数时,将所述转发参数以及所述预设报文特征的对应关系加入所述分类器映射表。
在本发明的又一实施例中,所述获取模块,用于:
在分类器映射表中查找是否存在与所述预设报文特征对应的所述转发参数;
当所述分类器映射表中存在与所述预设报文特征对应的所述转发参数时,从所述分类器映射表中获取与所述预设报文特征对应的所述转发参数。
在本发明的又一实施例中,所述转发路径中包含至少一个业务功能组,每个所述业务功能组连接至少两个按照预设顺序排列的业务功能转发器;
所述确定模块,用于:
对所述转发参数进行取模计算,得到运算结果;
确定所述运算结果所在的目标数量值区间;
根据预设的数量值区间与设备标识的对应关系将所述目标数量值区间对应的设备标识确定为转发路径中的下一跳的业务功能转发器的设备标识。
如图9所本发明的又一实施例提供另一种报文转发装置,所述装置包括:接收模块21、获取模块22、确定模块23和发送模块24。
接收模块21,用于接收转发路径中上一跳设备转发的业务链报文,所述业务链报文中携带有所述转发参数。
获取模块22,用于获取所述业务链报文中的转发参数。
确定模块23,用于根据所述转发参数确定所述转发路径中下一跳设备标识。
发送模块24,用于向所述设备标识对应的下一跳设备发送所述业务链报文。
在本发明的又一实施例中,所述确定模块23,用于:
根据预设转发表确定所述转发路径中下一跳设备的设备类型;
当根据所述预设转发表确定的所述转发路径中下一跳设备的设备类型为业务功能转发器时,根据所述转发参数确定下一跳设备对应的业务功能转发器的设备标识。
在本发明的又一实施例中,所述业务功能转发器关联有多个业务功能实体。
所述确定模块23,还用于:
当根据所述预设转发表确定的所述转发路径中下一跳设备的设备类型为业务功能实体时,根据所述转发参数确定下一跳设备对应的业务功能实体的设备标识。
在本发明的又一实施例中,所述装置还包括:解除封装模块。
所述确定模块23还用于当所述业务链报文的下一跳设备的设备标识与预设设备标识相同时,确定所述业务链报文中的预设报文特征。
所述发送模块还用于向参数管理器发送所述预设报文特征与所述转发参数之间的映射关系;
所述解除封装模块,用于将所述业务链报文解除封装,得到业务报文。
所述发送模块还用于向所述转发路径的接收端发送所述业务报文。
如图10所示,在本发明的又一实施例中,一种转发参数管理装置,包括:接收模块31、获取模块32和发送模块33。
接收模块31,用于接收分类器发送的查询请求消息,所述查询请求消息携带有预设报文特征。
获取模块32,用于获取所述查询请求消息中的预设报文特征,以及获取与所述预设报文特征存在映射关系的转发参数。
发送模块33,用于向所述分类器发送所述转发参数。
在本发明的又一实施例中,所述预设报文特征中包含转发路径的第一路径标识和至少一对相同类别的元素,所述获取模块用于:
在管理器映射表中查找与所述预设报文特征存在映射关系的转发参数;
当在管理器映射表中查找到所述转发参数时,向所述分类器发送所述转发参数;
当在管理器映射表中未查找到所述转发参数时,在路径标识映射表中查找与所述第一路径标识对应的第二路径标识,将所述第一路径标识替换为第二路径标识,并且将相同类别的元素互换位置,得到更新报文特征,在管理器映射表中查找与所述更新报文特征存在映射关系的转发参数;
当在管理器映射表中未查找到与所述更新报文特征存在映射关系的转发参数时,根据所述预设报文特征计算转发参数,并且向所述分类器发送所述计算得到的转发参数。
在本发明的又一实施例中,所述装置还包括:判断模块和加入模块。
判断模块,用于当接收到业务功能转发器发送的映射关系时,判断所述管理器映射表中是否存在接收的所述映射关系。
加入模块,用于当所述管理器映射表中不存在接收的所述映射关系时,将接收的所述映射关系加入所述管理器映射表中。
本发明实施例还提供了一种报文转发的装置110,如图11所示,包括:存储器1101、处理器1102和收发器1103,存储器1101用于存储一组代码,处理器1102用于根据该组代码执行如图2和图5-图7中所示的任意一种方法,收发器1103用于和其他设备通信。
其中,存储器1101、处理器1102和收发器1103之间是通过总线***1104耦合在一起的,其中存储器1101可能包含随机存取存储器,也可能还包括非易失性存储器,例如至少一个磁盘存储器。总线***1104可以是工业标准体系结构(英文:Industry Standard Architecture,简称ISA)总线、外部设备互连(英文:Peripheral Component,简称PCI)总线或扩展工业标准体系结构(英文:Extended Industry Standard Architecture,简称EISA)总线等。该总线***1104可以分为地址总线、数据总线、控制总线等。为便于表示,图11中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
其中,图8-图10中的接收模块和发送模块可以集成到收发器1103中,其余模块可以集成到处理器1102中,其余模块可以以硬件形式内嵌于或独立于网络设备的处理器中,也可以以软件形式存储于网络设备的存储器中,以便于处理器调用执行以上各个模块对应的操作,该处理器可以为中央处理器(英文:Central Processing Unit,简称CPU)、特定集成电路(英文:Application Specific Integrated Circuit,简称ASIC)或者是被配置成实施本发明实施例的一个或多个集成电路。
本发明实施例提供的网络设备110中的各个器件用于执行上述方法,因此,网络设备110的有益效果可以参见上述方法部分所述的有益效果,在此不再赘述。
具体实现中,本发明还提供一种计算机存储介质,其中,该计算机存储介质可存储有程序,该程序执行时可包括本发明提供的报文转发方法的各实施例中的部分或全部步骤。所述的存储介质可为磁碟、光盘、只读存储记忆体(英文:read-only memory,简称:ROM)或随机存储记忆体(英文:random access memory,简称:RAM)等。
本领域的技术人员可以清楚地了解到本发明实施例中的技术可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本发明实施例中的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例或者实施例的某些部分所述的方法。
本说明书中各个实施例之间相同相似的部分互相参见即可。尤其,对于无线通信设备实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例中的说明即可。
以上所述的本发明实施方式并不构成对本发明保护范围的限定。

Claims (24)

  1. 一种报文转发方法,其特征在于,包括:
    分类器接收业务报文,并确定所述业务报文的预设报文特征;
    所述分类器获取与所述预设报文特征对应的转发参数;
    所述分类器将所述业务报文封装为业务链报文,所述业务链报文中携带有所述转发参数;
    所述分类器根据所述转发参数确定转发路径中的下一跳的业务功能转发器的设备标识;
    所述分类器向所述设备标识对应的业务功能转发器发送所述业务链报文。
  2. 根据权利要求1所述的报文转发方法,其特征在于,所述分类器获取与所述预设报文特征对应的转发参数,包括:
    所述分类器生成参数查询请求消息,所述参数查询请求消息中携带有所述预设报文特征;
    所述分类器向参数管理器发送所述参数查询请求消息;
    所述分类器接收所述参数管理器根据所述参数查询请求返回的所述转发参数。
  3. 根据权利要求2所述的报文转发方法,其特征在于,所述分类器生成所述参数查询请求消息包括:
    所述分类器在分类器映射表中查找是否存在与所述预设报文特征对应的所述转发参数;
    当所述分类器映射表中不存在与所述预设报文特征对应的所述转发参数时,所述分类器生成所述参数查询请求消息;
    所述方法还包括:
    当所述分类器接收到所述参数管理器返回的所述转发参数时,将所述转发参数以及所述预设报文特征的对应关系加入所述分类器映射表。
  4. 根据权利要求1所述的报文转发方法,其特征在于,所述分类器获取与所述预设报文特征对应的转发参数,包括:
    所述分类器在分类器映射表中查找是否存在与所述预设报文特征对应的所述转发参数;
    当所述分类器映射表中存在与所述预设报文特征对应的所述转发参数时,所述分类器从所述分类器映射表中获取与所述预设报文特征对应的所述转发参数。
  5. 根据权利要求1-4中任意一项所述的报文转发方法,其特征在于,所述转发路径中包含至少一个业务功能组,每个所述业务功能组连接至少两个按照预设顺序排列的业务功能转发器;
    所述分类器根据所述转发参数确定转发路径中的下一跳的业务功能转发器的设备标识,包括:
    所述分类器对所述转发参数进行取模计算,得到运算结果;
    所述分类器确定所述运算结果所在的目标数量值区间;
    所述分类器根据预设的数量值区间与设备标识的对应关系将所述目标数量值区间对应的设备标识确定为转发路径中的下一跳的业务功能转发器的设备标识。
  6. 一种报文转发方法,其特征在于,所述方法包括:
    业务功能转发器接收转发路径中上一跳设备转发的业务链报文,所述业务链报文中携带有所述转发参数;
    所述业务功能转发器获取所述业务链报文中的转发参数;
    所述业务功能转发器根据所述转发参数确定所述转发路径中下一跳设备标识;
    所述业务功能转发器向所述设备标识对应的下一跳设备发送所述业务链报文。
  7. 根据权利要求6所述的方法,其特征在于,所述业务功能转发器根据所述转发参数确定所述转发路径中下一跳设备标识,包括:
    所述业务功能转发器根据预设转发表确定所述转发路径中下一跳设备的设备类型;
    当所述业务功能转发器根据所述预设转发表确定的所述转发路径中下一跳设备的设备类型为业务功能转发器时,所述业务功能转发器根据所述转发参数确定下一跳设备对应的业务功能转发器的设备标识。
  8. 根据权利要求7所述的方法,其特征在于,所述业务功能转发器关联有多个业务功能实体;
    所述业务功能转发器根据所述转发参数确定所述转发路径中下一跳设备标识,还包括:
    当所述业务功能转发器根据所述预设转发表确定的所述转发路径中下一跳设备的设备类型为业务功能实体时,所述业务功能转发器根据所述转发参数确定下一跳设备对应的业务功能实体的设备标识。
  9. 根据权利要求6至8任一项所述的方法,其特征在于,所述方法还包括:
    当所述业务链报文的下一跳设备的设备标识与预设设备标识相同时,业务功能转发器确定所述业务链报文中的预设报文特征;
    所述业务功能转发器向参数管理器发送所述预设报文特征与所述转发参数之间的映射关系;
    所述业务功能转发器将所述业务链报文解除封装,得到业务报文;
    所述业务功能转发器向所述转发路径的接收端发送所述业务报文。
  10. 一种转发参数管理方法,其特征在于,包括:
    参数管理器接收分类器发送的查询请求消息,所述查询请求消息携带有预设报文特征;
    所述参数管理器获取所述查询请求消息中的预设报文特征;
    所述参数管理器获取与所述预设报文特征存在映射关系的转发参数;
    所述参数管理器向所述分类器发送所述转发参数。
  11. 根据权利要求10所述的方法,其特征在于,所述预设报文特征中包含转发路径的第一路径标识和至少一对相同类别的元素,所述参数管理器获取与所述预设报文特征存在映射关系的转发参数,包括:
    所述参数管理器在管理器映射表中查找与所述预设报文特征存在映射关系的转发参数;
    当在管理器映射表中查找到所述转发参数时,所述参数管理器向所述分类器发送所述转发参数;
    当在管理器映射表中未查找到所述转发参数时,所述参数管理器在路径标识映射表中查找与所述第一路径标识对应的第二路径标识,将所述第一路径标识替换为第二路径标识,并且将相同类别的元素互换位置,得到更新报文特征,在管理器映射表中查找与所述更新报文特征存在映射关系的转发参数;
    当在管理器映射表中未查找到与所述更新报文特征存在映射关系的转发参数时,所述参数 管理器根据所述预设报文特征计算转发参数,并且向所述分类器发送所述计算得到的转发参数。
  12. 根据权利要求10至11任一项所述的方法,其特征在于,所述方法还包括:
    当接收到业务功能转发器发送的映射关系时,所述参数管理器判断所述管理器映射表中是否存在接收的所述映射关系;
    当所述管理器映射表中不存在接收的所述映射关系时,所述参数管理器将接收的所述映射关系加入所述管理器映射表中。
  13. 一种报文转发装置,其特征在于,包括:
    接收模块,用于接收业务报文,并确定所述业务报文的预设报文特征;
    获取模块,用于获取与所述预设报文特征对应的转发参数;
    封装模块,用于将所述业务报文封装为业务链报文,所述业务链报文中携带有所述转发参数;
    确定模块,用于根据所述转发参数确定转发路径中的下一跳的业务功能转发器的设备标识;
    发送模块,用于向所述设备标识对应的业务功能转发器发送所述业务链报文。
  14. 根据权利要求13所述的报文转发装置,其特征在于,所述获取模块,用于:
    生成参数查询请求消息,所述参数查询请求消息中携带有所述预设报文特征;
    向参数管理器发送所述参数查询请求消息;
    接收所述参数管理器根据所述参数查询请求返回的所述转发参数。
  15. 根据权利要求14所述的报文转发装置,其特征在于,所述获取模块,还用于:
    在分类器映射表中查找是否存在与所述预设报文特征对应的所述转发参数;
    当所述分类器映射表中不存在与所述预设报文特征对应的所述转发参数时,生成所述参数查询请求消息;
    当接收到所述参数管理器返回的所述转发参数时,将所述转发参数以及所述预设报文特征的对应关系加入所述分类器映射表。
  16. 根据权利要求13所述的报文转发装置,其特征在于,所述获取模块,用于:
    在分类器映射表中查找是否存在与所述预设报文特征对应的所述转发参数;
    当所述分类器映射表中存在与所述预设报文特征对应的所述转发参数时,从所述分类器映射表中获取与所述预设报文特征对应的所述转发参数。
  17. 根据权利要求13-16中任意一项所述的报文转发装置,其特征在于,所述转发路径中包含至少一个业务功能组,每个所述业务功能组连接至少两个按照预设顺序排列的业务功能转发器;
    所述确定模块,用于:
    对所述转发参数进行取模计算,得到运算结果;
    确定所述运算结果所在的目标数量值区间;
    根据预设的数量值区间与设备标识的对应关系将所述目标数量值区间对应的设备标识确定为转发路径中的下一跳的业务功能转发器的设备标识。
  18. 一种报文转发装置,其特征在于,所述装置包括:
    接收模块,用于接收转发路径中上一跳设备转发的业务链报文,所述业务链报文中携带有所述转发参数;
    获取模块,用于获取所述业务链报文中的转发参数;
    确定模块,用于根据所述转发参数确定所述转发路径中下一跳设备标识;
    发送模块,用于向所述设备标识对应的下一跳设备发送所述业务链报文。
  19. 根据权利要求18所述的装置,其特征在于,所述确定模块,用于:
    根据预设转发表确定所述转发路径中下一跳设备的设备类型;
    当根据所述预设转发表确定的所述转发路径中下一跳设备的设备类型为业务功能转发器时,根据所述转发参数确定下一跳设备对应的业务功能转发器的设备标识。
  20. 根据权利要求19所述的装置,其特征在于,所述业务功能转发器关联有多个业务功能实体;
    所述确定模块,还用于:
    当根据所述预设转发表确定的所述转发路径中下一跳设备的设备类型为业务功能实体时,根据所述转发参数确定下一跳设备对应的业务功能实体的设备标识。
  21. 根据权利要求18至20任一项所述的装置,其特征在于,
    所述确定模块还用于:当所述业务链报文的下一跳设备的设备标识与预设设备标识相同时,确定所述业务链报文中的预设报文特征;
    所述发送模块还用于向参数管理器发送所述预设报文特征与所述转发参数之间的映射关系;
    所述装置还包括解除封装模块,用于将所述业务链报文解除封装,得到业务报文;
    所述发送模块还用于向所述转发路径的接收端发送所述业务报文。
  22. 一种转发参数管理装置,其特征在于,包括:
    接收模块,用于接收分类器发送的查询请求消息,所述查询请求消息携带有预设报文特征;
    获取模块,用于获取所述查询请求消息中的预设报文特征,以及获取与所述预设报文特征存在映射关系的转发参数;
    发送模块,用于向所述分类器发送所述转发参数。
  23. 根据权利要求22所述的装置,其特征在于,所述预设报文特征中包含转发路径的第一路径标识和至少一对相同类别的元素,所述获取模块用于:
    在管理器映射表中查找与所述预设报文特征存在映射关系的转发参数;
    当在管理器映射表中查找到所述转发参数时,向所述分类器发送所述转发参数;
    当在管理器映射表中未查找到所述转发参数时,在路径标识映射表中查找与所述第一路径标识对应的第二路径标识,将所述第一路径标识替换为第二路径标识,并且将相同类别的元素互换位置,得到更新报文特征,在管理器映射表中查找与所述更新报文特征存在映射关系的转发参数;
    当在管理器映射表中未查找到与所述更新报文特征存在映射关系的转发参数时,根据所述预设报文特征计算转发参数,并且向所述分类器发送所述计算得到的转发参数。
  24. 根据权利要求22至23任一项所述的装置,其特征在于,所述装置还包括:
    判断模块,用于当接收到业务功能转发器发送的映射关系时,判断所述管理器映射表中是否存在接收的所述映射关系;
    加入模块,用于当所述管理器映射表中不存在接收的所述映射关系时,将接收的所述映射关系加入所述管理器映射表中。
PCT/CN2017/089465 2016-08-24 2017-06-22 报文转发方法及装置 WO2018036254A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610716222.2 2016-08-24
CN201610716222.2A CN107786437B (zh) 2016-08-24 2016-08-24 报文转发方法及装置

Publications (1)

Publication Number Publication Date
WO2018036254A1 true WO2018036254A1 (zh) 2018-03-01

Family

ID=61246334

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/089465 WO2018036254A1 (zh) 2016-08-24 2017-06-22 报文转发方法及装置

Country Status (2)

Country Link
CN (2) CN107786437B (zh)
WO (1) WO2018036254A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114125080A (zh) * 2021-09-29 2022-03-01 北京信息科技大学 一种报文链终端协议栈构建方法和解析方法、装置及终端
CN114448892A (zh) * 2022-02-10 2022-05-06 珠海星云智联科技有限公司 一种软硬件选路方法及装置

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110636003A (zh) * 2018-06-21 2019-12-31 中国电信股份有限公司 报文转发方法、装置、***和计算机可读存储介质
CN111200559B (zh) * 2018-11-19 2022-05-10 中国电信股份有限公司 路由方法和路由装置
CN111628921B (zh) * 2019-02-27 2021-07-20 华为技术有限公司 一种报文的处理方法、报文转发装置以及报文处理装置
CN111726293B (zh) * 2019-03-18 2021-11-30 华为技术有限公司 一种报文传输方法及装置
CN111147598B (zh) * 2019-12-30 2023-04-25 杭州迪普科技股份有限公司 Http报文处理方法及装置
CN117527693A (zh) * 2022-08-03 2024-02-06 华为技术有限公司 报文转发方法、设备、***及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014176740A1 (zh) * 2013-04-28 2014-11-06 华为技术有限公司 流分类器、业务路由触发器、报文处理的方法和***
WO2016011616A1 (zh) * 2014-07-23 2016-01-28 华为技术有限公司 业务报文转发方法及装置
CN105681198A (zh) * 2014-11-21 2016-06-15 华为技术有限公司 一种业务链处理方法、设备及***
CN105743822A (zh) * 2014-12-11 2016-07-06 华为技术有限公司 一种处理报文的方法及装置

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1302645C (zh) * 2003-05-26 2007-02-28 华为技术有限公司 网络处理器***端口捆绑中实现流量均担的方法
CN101286936B (zh) * 2008-05-16 2010-10-27 成都市华为赛门铁克科技有限公司 数据报文的处理方法及装置
CN102368736B (zh) * 2011-11-10 2014-12-10 华为技术有限公司 一种报文发送方法和设备
CN102710507B (zh) * 2012-05-17 2015-05-13 杭州华三通信技术有限公司 一种实现报文转发路径一致的方法和网络设备
EP3016322B1 (en) * 2013-07-23 2019-01-16 Huawei Technologies Co., Ltd. Packet forwarding method and device
CN103581018B (zh) * 2013-07-26 2017-08-11 北京华为数字技术有限公司 报文发送方法、路由器以及业务交换器
CN103391219A (zh) * 2013-08-09 2013-11-13 盛科网络(苏州)有限公司 基于会话的报文分析方法及装置
US20150124622A1 (en) * 2013-11-01 2015-05-07 Movik Networks, Inc. Multi-Interface, Multi-Layer State-full Load Balancer For RAN-Analytics Deployments In Multi-Chassis, Cloud And Virtual Server Environments
CN103607357A (zh) * 2013-11-19 2014-02-26 曙光信息产业(北京)有限公司 ***中报文的分配方法和装置
CN105099919B (zh) * 2014-05-15 2018-07-31 华为技术有限公司 报文处理方法及装置
CN105379218B (zh) * 2014-06-17 2018-09-07 华为技术有限公司 业务流的处理方法、装置及设备
US10003530B2 (en) * 2014-07-22 2018-06-19 Futurewei Technologies, Inc. Service chain header and metadata transport
CN104168201B (zh) * 2014-08-06 2017-11-24 福建星网锐捷网络有限公司 一种多路径转发的方法及装置
CN104283806B (zh) * 2014-10-31 2018-01-12 新华三技术有限公司 业务链处理方法和设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014176740A1 (zh) * 2013-04-28 2014-11-06 华为技术有限公司 流分类器、业务路由触发器、报文处理的方法和***
WO2016011616A1 (zh) * 2014-07-23 2016-01-28 华为技术有限公司 业务报文转发方法及装置
CN105681198A (zh) * 2014-11-21 2016-06-15 华为技术有限公司 一种业务链处理方法、设备及***
CN105743822A (zh) * 2014-12-11 2016-07-06 华为技术有限公司 一种处理报文的方法及装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114125080A (zh) * 2021-09-29 2022-03-01 北京信息科技大学 一种报文链终端协议栈构建方法和解析方法、装置及终端
CN114448892A (zh) * 2022-02-10 2022-05-06 珠海星云智联科技有限公司 一种软硬件选路方法及装置

Also Published As

Publication number Publication date
CN112671641B (zh) 2022-10-18
CN107786437A (zh) 2018-03-09
CN107786437B (zh) 2020-12-15
CN112671641A (zh) 2021-04-16

Similar Documents

Publication Publication Date Title
WO2018036254A1 (zh) 报文转发方法及装置
US10148573B2 (en) Packet processing method, node, and system
WO2017137004A1 (en) Method and apparatus for service function forwarding in a service domain
WO2018000443A1 (zh) 基于业务功能链sfc的报文转发方法、装置和***
US20160080253A1 (en) Service routing system, device, and method
CN107078963B (zh) 虚拟可扩展局域网中的路由追踪
US10461958B2 (en) Packet transmission method and apparatus
CN107046506B (zh) 一种报文处理方法、流分类器和业务功能实例
CN110535768B (zh) 组播数据传输方法及相关设备
CN104660508A (zh) 一种报文转发方法及装置
CN112491701B (zh) 转发报文方法和装置
US11632322B2 (en) Preferred path route graphs in a network
CN109714274B (zh) 一种获取对应关系的方法和路由设备
WO2017198131A1 (zh) 用于重定向数据流的方法和***、网络设备和控制设备
US9455903B2 (en) Recording packet routes using bloom filters
WO2015151184A1 (ja) 通信システム、通信方法、中継装置、および、通信プログラム
WO2016197689A1 (zh) 处理报文的方法、装置和***
WO2016029345A1 (zh) 网络流的信息统计方法和装置
JP5725236B2 (ja) 通信システム、ノード、パケット転送方法およびプログラム
KR102455886B1 (ko) 서비스 기능 체이닝 혼잡 피드백
JP2016508682A (ja) ドメインにまたがるvpnトラフィックのqosによる区別のための方法および配置構成
CN113923161A (zh) 一种报文转发方法及装置
CN105812257A (zh) 业务链路由管理***及其使用方法
CN105530185A (zh) 覆盖路由网络、基于覆盖路由网络的路由方法及路由器
CN110022263B (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: 17842679

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17842679

Country of ref document: EP

Kind code of ref document: A1