CN112671641B - Message forwarding method and device - Google Patents

Message forwarding method and device Download PDF

Info

Publication number
CN112671641B
CN112671641B CN202011368863.6A CN202011368863A CN112671641B CN 112671641 B CN112671641 B CN 112671641B CN 202011368863 A CN202011368863 A CN 202011368863A CN 112671641 B CN112671641 B CN 112671641B
Authority
CN
China
Prior art keywords
forwarding
message
parameter
preset
service
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202011368863.6A
Other languages
Chinese (zh)
Other versions
CN112671641A (en
Inventor
徐晓旸
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202011368863.6A priority Critical patent/CN112671641B/en
Publication of CN112671641A publication Critical patent/CN112671641A/en
Application granted granted Critical
Publication of CN112671641B publication Critical patent/CN112671641B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

Abstract

The present disclosure relates to a method and a device for forwarding a packet, wherein the method comprises: receiving a service message and determining the preset message characteristics of the service message; acquiring a forwarding parameter corresponding to the preset message characteristic; packaging the service message into a service chain message carrying the forwarding parameter; determining the equipment identifier of the service function forwarder of the next hop in the forwarding path according to the forwarding parameter; and sending the service chain message to a service function forwarder corresponding to the equipment identifier. The invention encapsulates the service message into the service chain message carrying the forwarding parameter, so that the service function forwarder of the next hop can transmit the service chain message continuously according to the forwarding parameter, and the forwarding parameter is encapsulated in the service chain message, the forwarding parameter can not be changed because of the equipment for modifying the message in the forwarding path, the consistency of the forward path and the return path during the transmission of the service chain message is ensured, and the consistency of the forwarding parameters of the forward path and the return path can be ensured.

Description

Message forwarding method and device
Cross Reference to Related Applications
The present disclosure is filed 24/8/2016, and has an application number of 201610716222.2, entitled "message forwarding method and apparatus", and the entire contents of the divisional cases of the chinese patent application are incorporated by reference in the present disclosure.
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a method and an apparatus for forwarding a packet.
Background
A Service Function Chain (SFC) defines and instantiates a group of ordered Service Functions (SF) for service flows to pass through, and is also referred to as a service chain (SFC) for short, which aims to provide an end-to-end service path for users. The SF may refer to a firewall (firewall), a Network Address Translator (NATs), or other functions of a specific application (application-specific), such as a load balancer. When a message is forwarded from one end of a Service chain to the other end, it needs to pass through a specific Service Path (RSP) formed by a plurality of SFs and their connected Service Function Forwarders (SFFs).
Generally, end-to-end traffic flows are transmitted by using a forward path and a return path, and due to the limited performance of a single SF device, when the traffic transmitted on the traffic path is too large, the SF is likely to become a performance bottleneck. Each hop requiring a specific service path may be set as a Service Function Group (SFG) composed of a plurality of SFs of the same type, and a local policy of the SFF is used to determine which SF in the SFG the service flow needs to pass through when transmitting.
When there is an SF in the traffic chain (e.g., a state firewall) that needs to maintain the state of the traffic flow, it is necessary to ensure that the incoming path of the forward traffic flow is consistent with the outgoing path of the return traffic flow. In the existing equal-cost multi-path (ECMP) routing technology, when a network device forwards an Internet Protocol (IP) packet, if there are multiple forwarding paths corresponding to a destination address of the IP packet in a forwarding table of the network device and their costs (cost) are the same, the network device extracts a five-tuple (a source IP address, a destination IP address, a source port, a destination port, and a Protocol number) from the IP packet, calculates a hash value according to the five-tuple, and selects one path from the multiple forwarding paths according to the hash value.
However, the quintuple of the return service flow is obtained by interchanging the source IP address and the destination IP address in the quintuple of the forward service flow and interchanging the source port and the destination port, and when the SFF receives the return service flow, the SFF cannot guide the return service flow to the SFG according to the hash algorithm to process the SF of the forward service flow, and thus cannot meet the requirement of consistency of the round-trip path.
Disclosure of Invention
The embodiment of the invention provides a message forwarding method and a message forwarding device, and aims to solve the problems that in the prior art, an SFF (Small form-factor pluggable) cannot guide a forward service flow and a return service flow to the same SF in an SFG (Small form-factor pluggable) according to a hash algorithm, and cannot meet the requirement on consistency of a round-trip path.
In order to solve the technical problem, the embodiment of the invention discloses the following technical scheme:
in a first aspect, an embodiment of the present invention provides a packet forwarding method, including:
a classifier receives a service message and determines the preset message characteristics of the service message;
the classifier acquires a forwarding parameter corresponding to the preset message characteristic;
the classifier encapsulates the service message into a service chain message, and the service chain message carries the forwarding parameter;
the classifier determines the equipment identification of the service function repeater of the next hop in the forwarding path according to the forwarding parameter;
and the classifier sends the service chain message to a service function forwarder corresponding to the equipment identifier.
With reference to the first aspect, in a first possible implementation manner of the first aspect, the obtaining, by the classifier, a forwarding parameter corresponding to the preset packet feature includes:
the classifier generates a parameter query request message, wherein the parameter query request message carries the preset message characteristics;
the classifier sends the parameter query request message to a parameter manager;
and the classifier receives the forwarding parameters returned by the parameter manager according to the parameter query request.
With reference to the first aspect, in a second possible implementation manner of the first aspect, the generating, by the classifier, the parameter query request message includes:
the classifier searches whether the forwarding parameter corresponding to the preset message characteristic exists in a classifier mapping table;
when the forwarding parameter corresponding to the preset message characteristic does not exist in the classifier mapping table, the classifier generates the parameter query request message;
the method further comprises the following steps:
and when the classifier receives the forwarding parameters returned by the parameter manager, adding the corresponding relation between the forwarding parameters and the preset message characteristics into the classifier mapping table.
With reference to the first aspect, in a third possible implementation manner of the first aspect, the obtaining, by the classifier, a forwarding parameter corresponding to the preset packet feature includes:
the classifier searches whether the forwarding parameter corresponding to the preset message characteristic exists in a classifier mapping table;
and when the forwarding parameters corresponding to the preset message characteristics exist in the classifier mapping table, the classifier acquires the forwarding parameters corresponding to the preset message characteristics from the classifier mapping table.
With reference to the first aspect, in a fourth possible implementation manner of the first aspect, the forwarding path includes at least one service function group, and each service function group is connected to at least two service function repeaters arranged according to a preset sequence;
the classifier determines the device identifier of the service function repeater of the next hop in the forwarding path according to the forwarding parameter, and the method comprises the following steps:
the classifier performs modular calculation on the forwarding parameters to obtain an operation result;
the classifier determines a target quantity value interval where the operation result is located;
and the classifier determines the equipment identifier corresponding to the target quantity value interval as the equipment identifier of the service function repeater of the next hop in the forwarding path according to the corresponding relation between the preset quantity value interval and the equipment identifier.
In a second aspect, an embodiment of the present invention provides a packet forwarding method, where the method includes:
a service function forwarder receives a service chain message forwarded by a previous hop device in a forwarding path, wherein the service chain message carries the forwarding parameter;
the service function repeater acquires the forwarding parameters in the service chain message;
the service function forwarder determines the next hop equipment identification in the forwarding path according to the forwarding parameter;
and the service function repeater sends the service chain message to the next hop equipment corresponding to the equipment identification.
With reference to the second aspect, in a first possible implementation manner of the second aspect, the determining, by the service function forwarder according to the forwarding parameter, an identifier of a next hop device in the forwarding path includes:
the service function forwarder determines the equipment type of the next hop equipment in the forwarding path according to a preset forwarding table;
and when the equipment type of the next hop equipment in the forwarding path determined by the service function repeater according to the preset forwarding table is the service function repeater, the service function repeater determines the equipment identifier of the service function repeater corresponding to the next hop equipment according to the forwarding parameters.
With reference to the second aspect, in a second possible implementation manner of the second aspect, the service function repeater is associated with a plurality of service function entities;
the service function forwarder determines the next hop equipment identifier in the forwarding path according to the forwarding parameter, and further includes:
and when the equipment type of the next hop equipment in the forwarding path determined by the service function repeater according to the preset forwarding table is a service function entity, the service function repeater determines the equipment identifier of the service function entity corresponding to the next hop equipment according to the forwarding parameter.
With reference to the second aspect, in a third possible implementation manner of the second aspect, the method further includes:
when the equipment identifier of the next hop equipment of the service chain message is the same as the preset equipment identifier, the service function repeater determines the preset message characteristic in the service chain message;
the service function repeater sends the mapping relation between the preset message characteristics and the forwarding parameters to a parameter manager;
the service function repeater unpacks the service chain message to obtain a service message;
and the service function repeater sends the service message to a receiving end of the forwarding path.
In a third aspect, an embodiment of the present invention provides a forwarding parameter management method, including:
a parameter manager receives a query request message sent by a classifier, wherein the query request message carries preset message characteristics;
the parameter manager acquires preset message characteristics in the query request message;
the parameter manager acquires a forwarding parameter which has a mapping relation with the preset message characteristic;
the parameter manager sends the forwarding parameters to the classifier.
With reference to the third aspect, in a first possible implementation manner of the third aspect, the obtaining, by the parameter manager, a forwarding parameter having a mapping relationship with the preset packet feature includes:
the parameter manager searches a forwarding parameter which has a mapping relation with the preset message characteristic in a manager mapping table;
when the forwarding parameter is found in a manager mapping table, the parameter manager sends the forwarding parameter to the classifier;
when the forwarding parameter is not found in a manager mapping table, the parameter manager searches a second path identifier corresponding to the first path identifier in a path identifier mapping table, replaces the first path identifier with the second path identifier, exchanges positions of elements of the same category to obtain an updated message characteristic, and finds the forwarding parameter having a mapping relation with the updated message characteristic in the manager mapping table;
and when the forwarding parameter having the mapping relation with the updated message characteristic is not found in a manager mapping table, the parameter manager calculates the forwarding parameter according to the preset message characteristic and sends the calculated forwarding parameter to the classifier.
With reference to the third aspect, in a second possible implementation manner of the third aspect, the method further includes:
when receiving a mapping relation sent by a service function repeater, the parameter manager judges whether the received mapping relation exists in the manager mapping table;
and when the received mapping relation does not exist in the manager mapping table, the parameter manager adds the received mapping relation into the manager mapping table.
In a fourth aspect, an embodiment of the present invention provides a packet forwarding apparatus, including:
the receiving module is used for receiving the service message and determining the preset message characteristics of the service message;
the acquisition module is used for acquiring the forwarding parameters corresponding to the preset message characteristics;
a packaging module, configured to package 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, an equipment identifier of a service function forwarder of a next hop in a forwarding path;
and the sending module is used for sending the service chain message to the service function forwarder corresponding to the equipment identifier.
The apparatus of the fourth aspect may further include other functional modules, configured to implement the methods in the first aspect and the various implementation manners of the first aspect.
In a fifth aspect, an embodiment of the present invention provides a packet forwarding apparatus, where the apparatus includes:
a receiving module, configured to receive a service link packet forwarded by a previous-hop device in a forwarding path, where the service link packet carries the forwarding parameter;
an obtaining module, configured to obtain a forwarding parameter in the service chain message;
a determining module, configured to determine, according to the forwarding parameter, a next hop device identifier in the forwarding path;
and the sending module is used for sending the service chain message to the next hop equipment corresponding to the equipment identifier.
The apparatus of the fifth aspect may further include other functional modules, configured to implement the methods in the second aspect and the various implementation manners of the second aspect.
In a sixth aspect, an embodiment of the present invention provides a forwarding parameter management apparatus, including:
the receiving module is used for receiving a query request message sent by the classifier, wherein the query request message carries preset message characteristics;
the acquisition module is used for acquiring the preset message characteristics in the query request message; acquiring a forwarding parameter which has a mapping relation with the preset message characteristic;
and the sending module is used for sending the forwarding parameters to the classifier.
The apparatus of the sixth aspect may further include other functional modules, configured to implement the methods in the third aspect and various implementation manners of the third aspect.
A seventh aspect of the present invention provides a packet forwarding apparatus, including: a memory for storing a set of codes and a processor for executing the set of codes to implement the method of the first, second or third aspect.
The classifier in the invention determines the preset message characteristics after receiving the service message, acquires the forwarding parameters corresponding to the preset message characteristics, and encapsulates the service message into the service chain message carrying the forwarding parameters, so that the next-hop service function repeater can continuously transmit the service chain message according to the forwarding parameters, and the forwarding parameters are encapsulated in the service chain message, even if the forwarding path has equipment for modifying the message, the forwarding parameters can not be changed, each SFF in the service forwarding path determines the SF of the next hop and the equipment identification of the SFF according to the forwarding parameters in the service chain message, and transmits the service chain message to the service function repeater corresponding to the equipment identification, and each hop equipment selects the next-hop equipment according to the forwarding parameters in the whole transmission process of the service chain message in the forwarding path, thereby ensuring that the forward path and the return path are consistent when the service chain message is transmitted.
When a service chain message is sent to a last hop service function repeater in a forwarding path, the last hop service function repeater determines preset message characteristics in the service chain message; and sending the mapping relation between the preset message characteristics and the forwarding parameters to a parameter manager, so that after the preset message characteristics are modified by a device (such as NAT) for modifying the message characteristics in the forwarding path, the modified preset message characteristics and the corresponding relation of the forwarding parameters are uploaded to the parameter manager, so as to be used when the service message is forwarded next time.
After receiving the query request, the parameter manager obtains the preset message characteristics in the query request message and searches the forwarding parameters which have a mapping relation with the preset message characteristics in the manager mapping table, when the forwarding parameters are not found in the manager mapping table, the parameter manager replaces or shifts the preset message characteristics to obtain updated message characteristics, each element in the updated message characteristics is the preset message characteristics of the symmetrical path of the current forwarding path, and then queries the forwarding parameters according to the updated message characteristics, so that the parameter manager can ensure the consistency of the forwarding parameters of the forward path and the return path.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a schematic structural diagram of a forward path and a backward path according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a message 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 invention;
FIG. 4 is a schematic diagram of the internal structure of any SFG in FIG. 3 and the structure of multiple SFFSs corresponding to the SFG;
FIG. 5 is a schematic flow chart of step S102 in FIG. 2;
FIG. 6 is a flowchart illustrating the step S205;
FIG. 7 is another schematic flow chart of step S102 in FIG. 2;
fig. 8 is a schematic structural diagram of a message forwarding apparatus according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of another packet forwarding device according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of another packet forwarding apparatus according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of another message forwarding apparatus according to an embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be described below with reference to the drawings in the embodiment of the present invention.
The service chain architecture in the broad sense comprises the following parts: control plane (english), SF, SFF, and classifier. The control plane is mainly responsible for life cycle management of a service chain, building (constraint) Service Function Paths (SFP), distributing (proxy) path information to nodes in the service chain, and the like, and is generally implemented by a controller; the SF is responsible for specific service policy execution and is mainly provided by a service provider; the SFF is responsible for forwarding the service message to a local SF and a next-hop SFF according to a service chain rule, and is mainly provided by a network operator; the classifier forwards the service link message obtained by encapsulating the service message to the first-hop SFF of the corresponding service link according to information such as quintuple in the service message, and the classifier can be independently arranged and can also be integrated into network equipment.
One RSP includes a plurality of SFs and SFFs connected to the SFs, and each RSP has a unique Service Path Identifier (SPI). Fig. 1 is a schematic structural diagram of a forward path and a return path provided in an embodiment of the present invention, where an SPI of the forward path is 10, an SPI of the return path is 11, and SPI values of the forward path and the return path are different.
As shown in FIG. 1, both the forward path and the return path pass through two SFGs. SFG1 comprises three SFs, namely: SF1, SF2 and SF3, wherein SF1 and SF2 are connected to SFF1, SF3 is connected to SFF2, and SFG2 comprises two SFs, namely: SF4 and SF5, and SF4 and SF5 are connected to SFF3. The solid line in fig. 1 represents a forward path through which forward traffic from the sending end src to the receiving end dst passes, and in the forward path, after the classifier 1 encapsulates the service packet, the encapsulated service link packet is forwarded to SF1 in SFG1 and SF4 in SFG 2; the dotted line in fig. 1 represents a return path through which a return flow from the receiving end dst to the sending end src passes, and in the return path, after encapsulating a service packet, the classifier 2 forwards the encapsulated service link packet to the SF4 in the SFG2 and the SF1 in the SFG1, in fig. 1, two classifiers are shown for convenience of understanding, and in practical applications, the classifier 1 and the classifier 2 may also refer to the same classifier.
In order to implement the consistency between the forward path and the backward path in fig. 1, as shown in fig. 2, an embodiment of the present invention provides a packet forwarding method, which includes the following steps.
In step S101, the classifier receives a service packet and determines a preset packet characteristic of the service packet.
In the embodiment of the present invention, the preset message characteristics may be { SPI, srcIP, dstIP }, where SPI is a path identifier of a forwarding path, srcIP is an IP address of a sending end, and dstIP is an IP address of a receiving end; the preset message characteristics may also be { SPI, srcIP, dstIP, srcPort, dstPort, proto }, where srcPort is a port number of the transmitting end, dstPort is a port number of the receiving end, and proto is a protocol number.
In the step, the classifier receives a service message sent by a sending end, acquires srcIP and dstIP in the received service message, and on the basis of acquiring the srcIP and the dstIP, can also acquire srcPort, dstPort and proto, and matches a preset service chain rule according to preset message characteristics to obtain the SPI.
The service chain rule comprises a matching action table, the matching action table comprises a corresponding relation between a binary group { srIP, dstIP } and the SPI, or a corresponding relation between a quintuple group { srIP, dstIP, srcPort, dstPort } and the SPI, when the service chain rule is matched, the matching action table can be searched according to one or more items in { srIP, dstIP } or one or more items in { srIP, dstIP, srcPort, dstPort, proto } in the preset message characteristics, and when the matching binary group or the quintuple exists in the matching action table, the SPI matched with the binary group or the quintuple is obtained.
In step S102, the classifier obtains a forwarding parameter corresponding to the preset packet feature.
In the embodiment of the invention, the forwarding parameter is an integer and is used for providing a routing basis for a classifier and an SFF when selecting the next hop, the corresponding relation between the forwarding parameter and the message characteristics is managed by a parameter manager, and the parameter manager can be independently arranged and can also be integrated in a controller as a functional module; 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 is not integrated in the classifier, the classifier may also store the correspondence between the forwarding parameter and the packet feature in the classifier after acquiring the correspondence between the forwarding parameter and the packet feature from the parameter manager each time.
Fig. 3 is a schematic diagram of a service chain architecture according to an embodiment of the present invention, where a classifier may obtain forwarding parameters corresponding to preset packet features from a parameter manager by sending a query request as shown in fig. 3, or may obtain the forwarding parameters corresponding to the preset packet features in a cache region inside the classifier.
When the corresponding relationship between the forwarding parameter and the packet feature cannot be cached in the classifier, or the forwarding parameter corresponding to the preset packet feature is not cached in the classifier, as shown in fig. 5, the step S102 may include the following steps.
In step S201, the classifier generates a parameter query request message.
In the embodiment of the present invention, the parameter query request message carries the preset packet characteristic.
The step S201 includes: the classifier can search whether the forwarding parameters corresponding to the preset message characteristics exist in a classifier mapping table; and when the forwarding parameters corresponding to the preset message characteristics do not exist in the classifier mapping table, the classifier generates the parameter query request message.
Step S201 further includes: and when the classifier receives the forwarding parameters returned by the parameter manager, adding the corresponding relation between the forwarding parameters and the preset message characteristics into the classifier mapping table.
In the embodiment of the present invention, since the first mapping relationship table in the classifier does not have a forwarding parameter corresponding to the preset message feature, the classifier can only obtain the forwarding parameter having a mapping relationship with the preset message feature by sending a query request to the parameter manager, and after the classifier obtains the forwarding parameter from the parameter manager, the mapping relationship between the preset message feature and the returned forwarding parameter can be stored in the classifier mapping table in order to facilitate the next forwarding of the service message including the preset message feature.
In step S202, the classifier sends the parameter query request message to the parameter manager.
In this step, when the parameter manager is located inside the classifier, the processor in the classifier may 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 may first obtain an address of the parameter manager and then send the query request message according to the address of the parameter manager.
In step S203, the parameter manager receives the query request message sent by the classifier.
In the embodiment of the present invention, in order to enable the parameter manager to determine the forwarding parameter according to the preset message characteristic, the query request message needs to carry the preset message characteristic.
In step S204, the parameter manager obtains a preset message feature in the query request message.
In step S205, the parameter manager obtains a forwarding parameter having a mapping relationship with the preset packet feature.
In this step, the parameter manager may search, according to the preset message feature, a forwarding parameter having a mapping relationship with the preset message feature in the parameter manager, and when the forwarding parameter having a mapping relationship with the preset message feature cannot be found locally, may calculate, according to the preset message feature, the forwarding parameter having a mapping relationship with the preset message feature.
In the embodiment of the present invention, the category may refer to an IP address category or a port category, for example, srcIP and dstIP may be determined to be elements belonging to the same IP address category, srcPort and dstPort may be determined to be elements belonging to the same port category, and the like, as shown in fig. 6, where the step S205 includes the following steps.
In step S2051, the parameter manager searches a manager mapping table for a forwarding parameter having a mapping relationship with the preset packet feature.
In the embodiment of the present invention, a second mapping relationship table for storing the message characteristics and the forwarding parameters may be set in the parameter manager.
In this step, the parameter manager may compare the message features in the second mapping relationship table with the preset message features one by one, and when there is a message feature that is the same as the preset message feature, may determine that the forwarding parameter having a mapping relationship with the preset message feature may be found in the manager mapping table, and the forwarding parameter having a mapping relationship with the preset message feature is the forwarding parameter to be found.
In step S2052, when the forwarding parameter is found in the manager mapping table, the parameter manager sends the forwarding parameter to the classifier.
In step S2053, when the forwarding parameter is not found in the manager mapping table, the parameter manager searches a second path identifier corresponding to the first path identifier in the path identifier mapping table, replaces the first path identifier with the second path identifier, exchanges positions of elements of the same category to obtain an updated packet feature, and finds the forwarding parameter having a mapping relationship with the updated packet feature in the manager mapping table.
In the embodiment of the present invention, a path identifier mapping table stores a corresponding relationship between a first path identifier and a second path identifier, where the second path identifier refers to a path identifier of a symmetric path of the forwarding path, for example, when the forwarding path is a forward path, the symmetric path of the forwarding path is a return path, and the second path identifier is a path identifier of the return path; when the forwarding path is a return path, the symmetric path of the forwarding path is a forward path, and the second path identifier is a path identifier of the forward path.
In this step, when the forwarding parameter is not found in the second mapping relationship table, the parameter manager may search, in the path identifier mapping table, a second path identifier corresponding to the first path identifier, replace the first path identifier with the second path identifier, and interchange positions of elements belonging to the same category in the preset message feature, for example, assuming that the preset message feature is { first SPI, srcIP, dstIP }, the updated message feature may be { second SPI, dstIP, srcIP }; assuming that the preset message characteristics are { first SPI, srcIP, dstIP, srcPort, dstPort, proto }, the updated message characteristics may be { second SPI, dstIP, srcPort, proto }, then the message characteristics identical to the updated message characteristics are searched in the second mapping relation table, if the message characteristics identical to the updated message characteristics are searched, it may be determined that a forwarding parameter having a mapping relation with the updated message characteristics may be searched in the manager mapping table, and the forwarding parameter having a mapping relation with the updated message characteristics is a forwarding parameter to be searched.
In the embodiment of the invention, after the forward service message is forwarded to the receiving end through the forward path, the return service message sent by the receiving end to the sending end needs to be forwarded on the return path symmetrical to the forward path, at this time, the classifier determines the preset message characteristics according to the return service message, and then sends the determined preset message characteristics to the parameter manager through the query request message. In order to acquire a forwarding parameter used when the forward service packet is forwarded on the forward path, the parameter manager processes an element in a preset packet feature in the return service packet in a manner of converting the preset packet feature into an update packet feature, where the update packet feature is the preset packet feature in the forward service packet. In this way, the parameter manager can ensure that the same forwarding parameters are used when the forward service packet is forwarded on the forward path and when the return service packet is forwarded on the return path.
In step S2054, when the forwarding parameter having a mapping relationship with the updated packet feature is not found in the manager mapping table, the parameter manager calculates the forwarding parameter according to the preset packet feature, and sends the calculated forwarding parameter to the classifier.
In the embodiment of the present invention, the calculation method of the forwarding parameter is determined by the rule of the parameter manager, and includes, but is not limited to, the following three methods: a hash algorithm, an accumulated global variable, or a random generation.
In step S206, the parameter manager sends the forwarding parameter to the classifier.
When the corresponding relationship between the cache forwarding parameter and the packet feature in the classifier is found, as shown in fig. 7, the step S102 further includes the following steps.
In step S301, the classifier searches in a classifier mapping table whether there is a forwarding parameter corresponding to the preset packet feature.
In the embodiment of the present invention, the classifier may be configured to store a correspondence between the packet characteristics and the forwarding parameters.
In this step, the classifier may compare the packet features in the first mapping relationship table with the preset packet features one by one, and when the packet features identical to the preset packet features exist, it may be determined that the forwarding parameters having a mapping relationship with the preset packet features can be found in the classifier mapping table, and the forwarding parameters having a mapping relationship with the preset packet features are the forwarding parameters to be found.
In step S302, when there is a forwarding parameter corresponding to the preset packet feature in the classifier mapping table, the classifier obtains the forwarding parameter corresponding to the preset packet feature from the classifier mapping table.
In step S103, the classifier encapsulates the service packet into a service link packet, where the service link packet carries the forwarding parameter.
In this step, the classifier encapsulates the service packet, and during encapsulation, the forwarding parameter may be encapsulated in the header of the service chain packet, or may be encapsulated in other positions of the service chain packet.
In step S104, the classifier determines the device identifier of the service function forwarder of the next hop in the forwarding path according to the forwarding parameter.
In this step, as shown in fig. 3, the classifier may select an apparatus identifier of one SFF from one SFF corresponding to the SFG1 according to the forwarding parameter and a preset routing method, where the apparatus identifier is used as an apparatus identifier of a service function forwarder of a next hop of the classifier, and the preset routing method may refer to a modulo method, or the like.
In the embodiment of the present invention, the device identifiers of the service function forwarders, such as SFF1, SFF2, 221, and 222, etc. The forwarding path is RSP, and the next hop refers to an SFF connected to the output end of the classifier in the forwarding path, such as SFF1 in fig. 1.
The forwarding path includes at least one service function group SFG, an architecture diagram of an internal structure of any SFG in fig. 3 and a plurality of SFFS connected to the SFG is shown in fig. 4, each service function group SFG includes a plurality of SFs, each SF is connected to one SFF, each SFF is connected to at least one SF, and at least two SFFS are arranged according to a preset sequence; assuming that the SFG contains n SFs, noted as SF 0, …, SF n-1; n SFs are connected with k SFFs which are respectively marked as SFF _0, … and SFF _ k-1; whereinThe number of local SFs (belonging to the SFG, the same applies below) connected to the SFF _ i is denoted num _ i, obviously n = ∑ Σ (i=0,...,k-1) num_i。
The step S104 includes the following steps.
And the classifier performs modular calculation on the forwarding parameters to obtain an operation result.
In the embodiment of the present invention, assuming that the operation result is s, s = selector% n, where n is the number of SFs in the SFG, and selector is a forwarding parameter.
And the classifier determines a target quantity value interval in which the operation result is positioned.
In this step, the classifier may compare the operation result s with two end points of each quantitative value section, and when the operation result s is located in any one quantitative value section, may determine the quantitative value section as a target quantitative value section.
And the classifier determines the equipment identifier corresponding to the target quantity value interval as the equipment identifier of the service function repeater of the next hop in the forwarding path according to the corresponding relation between the preset quantity value interval and the equipment identifier.
In the embodiment of the present invention, the classifier may preset a plurality of sets of correspondence between the quantity value intervals and the device identifiers, and the determination method of each set of correspondence is to determine one quantity value interval for the device identifier of each service function repeater.
When determining the quantity value interval corresponding to each device identifier, the number of SFs corresponding to each device identifier may be determined first, where the correspondence refers to the SF to which each device identifier is connected and the SFs to which all device identifiers in the forwarding path before the device identifier are connected, and the number of all SFs corresponding to the device identifiers is accumulated to obtain an accumulated quantity value, so that each device identifier may obtain an accumulated quantity value; then, the accumulated quantity value corresponding to two adjacent device identifiers in the forwarding path may be determined to be two end values of the quantity value interval.
The above procedure for determining the quantity value interval corresponding to each device identifier can be expressed by using a program language:
if s∈[∑ (i=0,...,m-1) num_i,∑ (i=0,...,m) num _ i) goto SFF _ m, wherein m takes a value of 0 to k-1.
N, num and SFF in the above formula represent element values in next jump SFG,% is modulus symbol, sigma (i=0,...,m-1) num _ i is an accumulated value of num _0 to num _ m-1, and when m =0, the accumulated value is 0.
That is, in this step, since in each SFG, the service function repeaters may be considered to be arranged in a preset order, for example, the order of the service function repeaters through which the solid line or the dotted line passes when transmitting the service packet in fig. 1, and the like, the device identifier corresponding to each service function repeater may also be considered to be arranged in a preset order, and therefore, when determining the quantity value interval, the sum of the number of the device identifier of each service function repeater and the corresponding service function entities of at least 0 device identifiers before the device identifier may be calculated first, for example, as shown in fig. 4, when m takes different values, a plurality of quantity value intervals may be determined, and when m =0, Σ may be determined (i=0,...,m-1) Sum of num _ i is 0 ∑ (i=0,...,m) The accumulated value of num _ i is 2 (here, the number of service function entities corresponding to SFF _0 is calculated during accumulation calculation, and is 2: SF _0 and SF _ 1), and when m =1, Σ (i=0,...,h-1) Sum of num _ i is 2 ∑ (i=0,...,h) The accumulated value of num _ i is 3 (here, the number of service function entities SF _0 and SF _1 corresponding to SFF _0 and the number of service function entities SF _2 corresponding to SFF _1 are calculated to be 3 in the accumulation calculation), … … may determine a plurality of number value intervals until m finishes taking the value of k-1, so that when s is located in [0,2), the next hop is determined to be SFF _0, and when s is located in [2,3), the next hop is determined to be SFF _1, … …. In this step, since each device identifier corresponds to one quantity value interval, after the target quantity value interval is determined, the device identifier corresponding to the target quantity value interval may be determined, and then the device identifier of the service function forwarder that determines the device identifier as the next hop in the forwarding path is determined, that is, the classifier determines the service function forwarder corresponding to the device identifier as the forwarding path in the SFG corresponding to the next hop thereofA next hop of service function forwarder.
In step S105, the classifier sends the service chain packet to the service function forwarder corresponding to the device identifier.
In this step, the classifier determines the address of the service function repeater according to the device identifier, and sends the service link packet to the service function repeater corresponding to the address.
In step S106, the service function forwarder receives the service link packet forwarded by the previous-hop device in the forwarding path.
In the embodiment of the present invention, the service chain packet carries the forwarding parameter, and the previous hop device of the service function forwarder in the forwarding path may refer to a classifier or a service function forwarder.
In step S107, the service function forwarder acquires a forwarding parameter in the service chain message.
In step S108, the service function forwarder determines the identifier of the next hop device in the forwarding path according to the forwarding parameter.
In this step, as shown in fig. 3, for example, when the current service function forwarder is one of a plurality of service function forwarders corresponding to SFG1, the current service function forwarder may determine a device identifier corresponding to a next hop device according to the forwarding parameter and a preset routing method, where the next hop device may refer to one of a plurality of SFs included in SFG1, a plurality of SFFs corresponding to SFG1, or a plurality of SFFs corresponding to SFG 2. The predetermined routing method may be referred to as a modulo method, etc.
In the embodiment of the present invention, the step S108 includes the following steps.
And the service function forwarder determines the equipment type of the next hop equipment in the forwarding path according to a preset forwarding table.
In the embodiment of the present invention, the service function forwarder may be provided with a device identifier and a device type preset forwarding table for storing each hop of device in a forwarding path, and since the service function forwarder is an SFF for forwarding a received service chain packet to any one of SFs or next hops corresponding thereto, the device type may refer to a service function entity type or a service function forwarder type, and the like.
In this step, the service function forwarder may obtain the device type of the next-hop device from a preset forwarding table.
And when the equipment type of the next hop equipment in the forwarding path determined according to the preset forwarding table is a service function repeater, the service function repeater determines the equipment identifier of the service function repeater corresponding to the next hop equipment according to the forwarding parameters.
In this step, the service function repeater may determine the device identifier of the service function repeater corresponding to the next hop device according to the forwarding parameter and the preset routing method.
In the embodiment of the present invention, as shown in fig. 4, a plurality of SFs are associated with the service function repeater; the step S108 further includes the following steps.
And when the equipment type of the next hop equipment in the forwarding path determined according to the preset forwarding table is a service function entity, the service function forwarder determines the equipment identifier of the service function entity corresponding to the next hop equipment according to the forwarding parameter.
In this step, the service function forwarder may obtain the device type of the next-hop device from a preset forwarding table, when the obtained device type of the next-hop device is the service function entity, the service function forwarder determines the device identifier of the service function entity corresponding to the next-hop device according to the forwarding parameter and a preset routing method, and when the device identifier of the service function entity corresponding to the next-hop device is determined, as shown in fig. 4, it is assumed that SFF _ i corresponds to n SFs, which are denoted as SF 0, …, and SF n-1, where the number of connected local SFs (belonging to the SFG, which are the same below) is denoted as num _ i, and obviously, n =Σis present (i=0,...,h-1) num _ i. Here, the preset routing method takes a modulus extracting method as an example, the modulus extracting method is as follows, and it is assumed that the serial number of the SFF is h:
note that s = selector% n,
if s∈[∑ (i=0,...,h-1) num_i,∑ (i=0,...,h) num_i):goto SF_s;
else drop packet。
wherein,% is modulus symbol, ∑ (i=0,...,h-1) num _ i is the accumulated value from num _0 to num _ h-1, and when h takes different values, a number of number value intervals can be determined, and when h =0, Σ (i=0,...,h-1) Sum of num _ i is 0 ∑ (i=0,...,h) num _ i has an accumulated value of 2, and when h =1, Σ (i=0,...,h-1) Sum of num _ i is 2 ∑ (i=0,...,h) The accumulated value of num _ i is 3, … …, such that when s is located at 0,2, the next hop is determined to be SF _0, and when s is located at 2,3, the next hop is determined to be SF _1, … ….
In step S109, the service function forwarder sends the service chain packet to the next hop device corresponding to the device identifier.
In 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 repeater determines the preset packet feature in the service chain packet.
In the embodiment of the present invention, the preset device identifier may refer to a device identifier of a receiving end device, and the device identifier of the next hop device is the same as the device identifier of the receiving end device, that is, the current service function repeater is the last hop service function repeater in the forwarding path.
In this step, since a device (such as NAT) for modifying the message characteristics may exist in the forwarding path, the preset message characteristics in the service chain message received by the last hop service function forwarder may have been modified, so that the preset message characteristics in the service chain message are determined again here.
In step S111, the service function forwarder sends the mapping relationship between the preset packet feature and the forwarding parameter to the parameter manager.
In this step, the service function forwarder sends the determined mapping relationship between the preset message characteristics and the forwarding parameters in the service chain message to the parameter manager.
In 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.
In this step, when receiving the mapping relationship sent by the service function forwarder, the parameter manager compares the received mapping relationship with each mapping relationship in the second mapping relationship table, determines whether the received mapping relationship is different from each mapping relationship in the second mapping relationship table, and determines that the received mapping relationship does not exist in the manager mapping table when the received mapping relationship is different from each mapping relationship in the second mapping relationship table.
In 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.
In step S114, the service function forwarder decapsulates the service chain packet to obtain a service packet.
In this step, the service function forwarder decapsulates the service chain packet using the reverse process when encapsulating the service packet, and obtains the service packet.
In step S115, the service function forwarder sends the service packet to the receiving end of the forwarding path.
In this step, the service function forwarder sends the service packet after decapsulation to the receiving end of the forwarding path.
As shown in fig. 8, in another embodiment of the present invention, a packet forwarding apparatus is provided, including: the device comprises a receiving module 11, an obtaining module 12, an encapsulating 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 characteristic of the service packet.
An obtaining module 12, configured to obtain a forwarding parameter corresponding to the preset packet characteristic.
And 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.
And a determining module 14, configured to determine, according to the forwarding parameter, an equipment identifier of a service function forwarder of a next hop in the forwarding path.
And a sending module 15, configured to send the service chain packet to a service function forwarder corresponding to the device identifier.
In another embodiment of the present invention, the obtaining module is configured to:
generating a parameter query request message, wherein the parameter query request message carries the preset message characteristics;
sending the parameter query request message to a parameter manager;
and receiving the forwarding parameters returned by the parameter manager according to the parameter query request.
In another embodiment of the present invention, the obtaining module is further configured to:
searching whether the forwarding parameter corresponding to the preset message characteristic exists in a classifier mapping table;
when the forwarding parameter corresponding to the preset message characteristic does not exist in the classifier mapping table, generating the parameter query request message;
and when the forwarding parameters returned by the parameter manager are received, adding the corresponding relation between the forwarding parameters and the preset message characteristics into the classifier mapping table.
In another embodiment of the present invention, the obtaining module is configured to:
searching whether the forwarding parameter corresponding to the preset message characteristic exists in a classifier mapping table;
and when the forwarding parameters corresponding to the preset message characteristics exist in the classifier mapping table, acquiring the forwarding parameters corresponding to the preset message characteristics from the classifier mapping table.
In another embodiment of the present invention, the forwarding path includes at least one service function group, and each service function group is connected to at least two service function repeaters arranged according to a preset sequence;
the determining module is configured to:
performing modular calculation on the forwarding parameters to obtain an operation result;
determining a target quantity value interval where the operation result is located;
and determining the equipment identifier corresponding to the target quantity value interval as the equipment identifier of the service function repeater of the next hop in the forwarding path according to the corresponding relation between the preset quantity value interval and the equipment identifier.
Another embodiment of the present invention as shown in fig. 9 provides another packet forwarding apparatus, where the apparatus includes: a receiving module 21, an obtaining module 22, a determining module 23 and a sending module 24.
A receiving module 21, configured to receive a service chain packet forwarded by a previous-hop device in a forwarding path, where the service chain packet carries the forwarding parameter.
An obtaining module 22, configured to obtain the forwarding parameter in the service chain message.
A determining module 23, configured to determine, according to the forwarding parameter, an identifier of a next hop device in the forwarding path.
And a sending module 24, configured to send the service chain packet to a next hop device corresponding to the device identifier.
In another embodiment of the present invention, the determining module 23 is configured to:
determining the equipment type of the next hop equipment in the forwarding path according to a preset forwarding table;
and when the equipment type of the next hop equipment in the forwarding path determined according to the preset forwarding table is a service function repeater, determining the equipment identifier of the service function repeater corresponding to the next hop equipment according to the forwarding parameters.
In a further embodiment of the invention, a plurality of service function entities are associated with the service function forwarder.
The determining module 23 is further configured to:
and when the equipment type of the next hop equipment in the forwarding path determined according to the preset forwarding table is a service function entity, determining the equipment identifier of the service function entity corresponding to the next hop equipment according to the forwarding parameter.
In yet another embodiment of the present invention, the apparatus further comprises: and releasing the packaging module.
The determining module 23 is further configured to determine a preset message feature in the service chain message when the device identifier of the next hop device of the service chain message is the same as the preset device identifier.
The sending module is further configured to send a mapping relationship between the preset packet feature and the forwarding parameter to a parameter manager;
and the decapsulation module is used for decapsulating the service chain message to obtain a service message.
The sending module is further configured to send the service packet to a receiving end of the forwarding path.
As shown in fig. 10, in another embodiment of the present invention, 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 packet characteristic.
The obtaining module 32 is configured to obtain a preset message feature in the query request message, and obtain a forwarding parameter having a mapping relationship with the preset message feature.
A sending module 33, configured to send the forwarding parameter to the classifier.
In another embodiment of the present invention, the preset packet feature includes a first path identifier of a forwarding path and at least one pair of elements in the same category, and the obtaining module is configured to:
searching a forwarding parameter which has a mapping relation with the preset message characteristic in a manager mapping table;
when the forwarding parameter is found in a manager mapping table, sending the forwarding parameter to the classifier;
when the forwarding parameter is not found in a manager mapping table, searching a second path identifier corresponding to the first path identifier in a path identifier mapping table, replacing the first path identifier with the second path identifier, exchanging positions of elements of the same category to obtain an updated message feature, and searching a forwarding parameter having a mapping relation with the updated message feature in the manager mapping table;
and when the forwarding parameter having the mapping relation with the updated message characteristic is not found in the mapping table of the manager, calculating the forwarding parameter according to the preset message characteristic, and sending the calculated forwarding parameter to the classifier.
In yet another embodiment of the present invention, the apparatus further comprises: the device comprises a judging module and an adding module.
And the judging module is used for judging whether the received mapping relation exists in the manager mapping table when the mapping relation sent by the service function forwarder is received.
And the adding module is used for adding the received mapping relation into the manager mapping table when the received mapping relation does not exist in the manager mapping table.
An embodiment of the present invention further provides a device 110 for forwarding a packet, as shown in fig. 11, including: a memory 1101, a processor 1102 and a transceiver 1103, the memory 1101 storing a set of codes, the processor 1102 performing any one of the methods as shown in fig. 2 and 5-7 according to the set of codes, and the transceiver 1103 communicating with other devices.
The memory 1101, the processor 1102 and the transceiver 1103 are coupled together by a bus system 1104, wherein the memory 1101 may comprise a random access memory or may further comprise a non-volatile memory, such as at least one disk memory. The bus system 1104 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus system 1104 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 11, but this is not intended to represent only one bus or type of bus.
The receiving module and the sending module in fig. 8-10 may be Integrated into the transceiver 1103, the remaining modules may be Integrated into the processor 1102, the remaining modules may be embedded in a hardware form or may be independent from a processor of the network device, or may be stored in a memory of the network device in a software form, so that the processor may call and execute operations corresponding to the above modules, and the processor may be a Central Processing Unit (CPU), A Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement the embodiments of the present invention.
Each device in the network device 110 provided in the embodiment of the present invention is configured to execute the method described above, and therefore, beneficial effects of the network device 110 may refer to beneficial effects described in the method section above, which are not described herein again.
In a specific implementation, the present invention further provides a computer storage medium, where the computer storage medium may store a program, and when the program is executed, the program may include some or all of the steps in each embodiment of the message forwarding method provided in the present invention. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a Random Access Memory (RAM).
Those skilled in the art will readily appreciate that the techniques of the embodiments of the present invention may be implemented as software plus a required general purpose hardware platform. Based on such understanding, the technical solutions in the embodiments of the present invention may be substantially or partially embodied in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, or the like, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the method according to the embodiments or some parts of the embodiments.
The same and similar parts among the various embodiments in this specification may be referred to each other. In particular, for the embodiment of the wireless communication device, since it is basically similar to the embodiment of the method, the description is simple, and for the relevant points, refer to the description in the embodiment of the method.
The above-described embodiments of the present invention should not be construed as limiting the scope of the present invention.

Claims (18)

1. A message forwarding method is characterized by comprising the following steps:
receiving a service message and determining the preset message characteristics of the service message;
acquiring a forwarding parameter corresponding to the preset message characteristic, wherein the forwarding parameter is obtained by calculation according to the message characteristic, when the service message is transmitted through a forward path, the message characteristic is the preset message characteristic, when the service message is transmitted through a return path, the message characteristic is an updated message characteristic of the preset message characteristic, and the updated message characteristic is obtained by exchanging positions of elements of the same category as the preset message characteristic;
packaging the service message according to the forwarding parameter to obtain a packaged service message;
determining the equipment identification of the next hop in the forwarding path according to the forwarding parameters;
and sending the encapsulated service message to the next hop corresponding to the equipment identifier.
2. The message forwarding method according to claim 1, wherein the obtaining of the forwarding parameter corresponding to the preset message feature comprises:
generating a parameter query request message, wherein the parameter query request message carries the preset message characteristics;
sending the parameter query request message to a parameter manager;
and receiving the forwarding parameters returned by the parameter manager according to the parameter query request.
3. The message forwarding method according to claim 2, wherein the generating the parameter query request message comprises:
searching whether the forwarding parameter corresponding to the preset message characteristic exists in a mapping table;
when the forwarding parameter corresponding to the preset message characteristic does not exist in the mapping table, generating the parameter query request message;
the method further comprises the following steps:
and when the forwarding parameters returned by the parameter manager are received, adding the corresponding relation between the forwarding parameters and the preset message characteristics into the mapping table.
4. The message forwarding method according to claim 1, wherein the obtaining of the forwarding parameter corresponding to the preset message feature comprises:
searching whether the forwarding parameter corresponding to the preset message characteristic exists in a mapping table;
and when the forwarding parameter corresponding to the preset message characteristic exists in the mapping table, acquiring the forwarding parameter corresponding to the preset message characteristic from the mapping table.
5. The packet forwarding method according to any one of claims 1 to 4, wherein the forwarding path includes at least one service function group, and each service function group is connected to at least two service function repeaters arranged according to a preset sequence;
determining a next hop in a forwarding path according to the forwarding parameter, including:
performing modular calculation on the forwarding parameters to obtain an operation result;
determining a target quantity value interval where the operation result is located;
and determining the equipment identifier corresponding to the target quantity value interval as the equipment identifier of the service function repeater of the next hop in the forwarding path according to the corresponding relation between the preset quantity value interval and the equipment identifier.
6. A message forwarding method is characterized in that the method comprises the following steps:
receiving a packaged service message forwarded by a previous hop device in a forwarding path, wherein the packaged service message carries forwarding parameters, the forwarding parameters are obtained by calculation according to message characteristics, when the service message is transmitted through a forward path, the message characteristics are preset message characteristics, when the service message is transmitted through a return path, the message characteristics are updating message characteristics of the preset message characteristics, and the updating message characteristics are obtained by exchanging positions of elements of the same category as the preset message characteristics;
acquiring a forwarding parameter in the encapsulated service message;
determining the next hop equipment identification in the forwarding path according to the forwarding parameters;
and sending the encapsulated service message to the next hop equipment corresponding to the equipment identification.
7. The method of claim 6, wherein the determining the next hop device identifier in the forwarding path according to the forwarding parameter comprises:
determining the equipment type of the next hop equipment in the forwarding path according to a preset forwarding table;
and when the equipment type of the next hop equipment in the forwarding path determined according to the preset forwarding table is a service function repeater, determining the equipment identifier of the service function repeater corresponding to the next hop equipment according to the forwarding parameters.
8. The method of claim 7, wherein a plurality of service function entities are associated with the service function forwarder;
the determining the next hop device identifier in the forwarding path according to the forwarding parameter further includes:
and when the equipment type of the next hop equipment in the forwarding path determined according to the preset forwarding table is a service function entity, determining the equipment identifier of the service function entity corresponding to the next hop equipment according to the forwarding parameter.
9. The method according to any one of claims 6 to 8, further comprising:
when the device identifier of the next hop device is the same as the preset device identifier, determining the preset message characteristics in the encapsulated service message;
sending the mapping relation between the preset message characteristics and the forwarding parameters to a parameter manager;
de-encapsulating the encapsulated service message to obtain a de-encapsulated service message;
and sending the decapsulated service message to a receiving end of the forwarding path.
10. A message forwarding apparatus, comprising:
the receiving module is used for receiving the service message and determining the preset message characteristics of the service message;
an obtaining module, configured to obtain a forwarding parameter corresponding to the preset message feature, where the forwarding parameter is obtained through calculation according to a message feature, and when the service message is transmitted through a forward path, the message feature is the preset message feature, and when the service message is transmitted through a return path, the message feature is an updated message feature of the preset message feature, and the updated message feature is obtained by exchanging positions of elements in the same category as the preset message feature;
the encapsulation module is used for encapsulating the service message according to the forwarding parameter so as to obtain an encapsulated service message;
a determining module, configured to determine, according to the forwarding parameter, an equipment identifier of a next hop in a forwarding path;
and the sending module is used for sending the encapsulated service message to the next hop corresponding to the equipment identifier.
11. The message forwarding device according to claim 10, wherein the obtaining module is configured to:
generating a parameter query request message, wherein the parameter query request message carries the preset message characteristics;
sending the parameter query request message to a parameter manager;
and receiving the forwarding parameters returned by the parameter manager according to the parameter query request.
12. The message forwarding device according to claim 11, wherein the obtaining module is further configured to:
searching whether the forwarding parameter corresponding to the preset message characteristic exists in a mapping table;
when the forwarding parameter corresponding to the preset message characteristic does not exist in a mapping table, generating the parameter query request message;
and when the forwarding parameters returned by the parameter manager are received, adding the corresponding relation between the forwarding parameters and the preset message characteristics into the mapping table.
13. The message forwarding apparatus according to claim 10, wherein the obtaining module is configured to:
searching whether the forwarding parameter corresponding to the preset message characteristic exists in a mapping table;
and when the forwarding parameter corresponding to the preset message characteristic exists in the mapping table, acquiring the forwarding parameter corresponding to the preset message characteristic from the mapping table.
14. The message forwarding device according to any one of claims 10 to 13, wherein the forwarding path includes at least one service function group, and each service function group connects at least two service function repeaters arranged according to a preset sequence;
the determining module is configured to:
performing modular calculation on the forwarding parameters to obtain an operation result;
determining a target quantity value interval where the operation result is located;
and determining the equipment identifier corresponding to the target quantity value interval as the equipment identifier of the service function repeater of the next hop in the forwarding path according to the corresponding relation between the preset quantity value interval and the equipment identifier.
15. A message forwarding apparatus, the apparatus comprising:
a receiving module, configured to receive a service packet encapsulated forwarded by a previous hop device in a forwarding path, where the service packet encapsulated carries a forwarding parameter, the forwarding parameter is obtained through calculation according to a packet feature, and when the service packet is transmitted through a forward path, the packet feature is a preset packet feature, and when the service packet is transmitted through a return path, the packet feature is an update packet feature of the preset packet feature, and the update packet feature is obtained by exchanging positions of elements of the same category as the preset packet feature;
an obtaining module, configured to obtain a forwarding parameter in the encapsulated service message;
a determining module, configured to determine, according to the forwarding parameter, a next hop device identifier in the forwarding path;
and the sending module is used for sending the encapsulated service message to the next hop equipment corresponding to the equipment identifier.
16. The apparatus of claim 15, wherein the determining module is configured to:
determining the equipment type of the next hop equipment in the forwarding path according to a preset forwarding table;
and when the equipment type of the next hop equipment in the forwarding path determined according to the preset forwarding table is a service function repeater, determining the equipment identifier of the service function repeater corresponding to the next hop equipment according to the forwarding parameter.
17. The apparatus of claim 16, wherein a plurality of service function entities are associated with the service function forwarder;
the determining module is further configured to:
and when the equipment type of the next hop equipment in the forwarding path determined according to the preset forwarding table is a service function entity, determining the equipment identifier of the service function entity corresponding to the next hop equipment according to the forwarding parameter.
18. The apparatus of any one of claims 15 to 17,
the determination module is further configured to: when the equipment identifier of the next hop equipment is the same as the preset equipment identifier, determining the preset message characteristics in the encapsulated service message;
the sending module is further configured to send a mapping relationship between the preset packet feature and the forwarding parameter to a parameter manager;
the device also comprises a decapsulation module for decapsulating the encapsulated service message to obtain a decapsulated service message;
the sending module is further configured to send the decapsulated service packet to a receiving end of the forwarding path.
CN202011368863.6A 2016-08-24 2016-08-24 Message forwarding method and device Active CN112671641B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011368863.6A CN112671641B (en) 2016-08-24 2016-08-24 Message forwarding method and device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011368863.6A CN112671641B (en) 2016-08-24 2016-08-24 Message forwarding method and device
CN201610716222.2A CN107786437B (en) 2016-08-24 2016-08-24 Message forwarding method and device

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN201610716222.2A Division CN107786437B (en) 2016-08-24 2016-08-24 Message forwarding method and device

Publications (2)

Publication Number Publication Date
CN112671641A CN112671641A (en) 2021-04-16
CN112671641B true CN112671641B (en) 2022-10-18

Family

ID=61246334

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202011368863.6A Active CN112671641B (en) 2016-08-24 2016-08-24 Message forwarding method and device
CN201610716222.2A Active CN107786437B (en) 2016-08-24 2016-08-24 Message forwarding method and device

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN201610716222.2A Active CN107786437B (en) 2016-08-24 2016-08-24 Message forwarding method and device

Country Status (2)

Country Link
CN (2) CN112671641B (en)
WO (1) WO2018036254A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110636003A (en) * 2018-06-21 2019-12-31 中国电信股份有限公司 Message forwarding method, device, system and computer readable storage medium
CN111200559B (en) * 2018-11-19 2022-05-10 中国电信股份有限公司 Routing method and routing device
CN111628921B (en) * 2019-02-27 2021-07-20 华为技术有限公司 Message processing method, message forwarding device and message processing device
CN111726293B (en) 2019-03-18 2021-11-30 华为技术有限公司 Message transmission method and device
CN111147598B (en) * 2019-12-30 2023-04-25 杭州迪普科技股份有限公司 HTTP message processing method and device
CN114125080A (en) * 2021-09-29 2022-03-01 北京信息科技大学 Message link terminal protocol stack construction method and analysis method, device and terminal
CN114448892A (en) * 2022-02-10 2022-05-06 珠海星云智联科技有限公司 Software and hardware routing method and device
CN117527693A (en) * 2022-08-03 2024-02-06 华为技术有限公司 Message forwarding method, device, system and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1553654A (en) * 2003-05-26 2004-12-08 华为技术有限公司 Method for realizing average flow bearing by bound ports of network processor system
CN102710507A (en) * 2012-05-17 2012-10-03 杭州华三通信技术有限公司 Method and network equipment for achieving consistency of message forwarding paths
CN103391219A (en) * 2013-08-09 2013-11-13 盛科网络(苏州)有限公司 Message analysis method and device based on conversation

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101286936B (en) * 2008-05-16 2010-10-27 成都市华为赛门铁克科技有限公司 Method and apparatus for data message processing
CN102368736B (en) * 2011-11-10 2014-12-10 华为技术有限公司 Message sending method and equipment
CN108632098B (en) * 2013-04-28 2021-08-13 华为技术有限公司 Flow classifier, service routing trigger, message processing method and system
WO2015010256A1 (en) * 2013-07-23 2015-01-29 华为技术有限公司 Packet forwarding method and device
CN103581018B (en) * 2013-07-26 2017-08-11 北京华为数字技术有限公司 File transmitting method, router and operation exchange device
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 (en) * 2013-11-19 2014-02-26 曙光信息产业(北京)有限公司 Message distribution method and message distribution device in system
CN105099919B (en) * 2014-05-15 2018-07-31 华为技术有限公司 Message processing method and device
JP2017518710A (en) * 2014-06-17 2017-07-06 華為技術有限公司Huawei Technologies Co.,Ltd. Service flow processing method, apparatus, and device
US10003530B2 (en) * 2014-07-22 2018-06-19 Futurewei Technologies, Inc. Service chain header and metadata transport
EP3157206B1 (en) * 2014-07-23 2018-09-19 Huawei Technologies Co., Ltd. Service message forwarding method and apparatus
CN104168201B (en) * 2014-08-06 2017-11-24 福建星网锐捷网络有限公司 A kind of method and device of multipath forwarding
CN104283806B (en) * 2014-10-31 2018-01-12 新华三技术有限公司 Business chain processing method and equipment
CN105681198B (en) * 2014-11-21 2018-11-20 华为技术有限公司 A kind of business chain processing method, equipment and system
CN105743822B (en) * 2014-12-11 2019-04-19 华为技术有限公司 A kind of method and device handling message

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1553654A (en) * 2003-05-26 2004-12-08 华为技术有限公司 Method for realizing average flow bearing by bound ports of network processor system
CN102710507A (en) * 2012-05-17 2012-10-03 杭州华三通信技术有限公司 Method and network equipment for achieving consistency of message forwarding paths
CN103391219A (en) * 2013-08-09 2013-11-13 盛科网络(苏州)有限公司 Message analysis method and device based on conversation

Also Published As

Publication number Publication date
CN112671641A (en) 2021-04-16
CN107786437B (en) 2020-12-15
WO2018036254A1 (en) 2018-03-01
CN107786437A (en) 2018-03-09

Similar Documents

Publication Publication Date Title
CN112671641B (en) Message forwarding method and device
KR102139712B1 (en) Packet processing method and device
CN113055289B (en) Message forwarding method, device and system based on service function chain SFC
CN107925613B (en) Method, device and system for forwarding message in Service Function Chain (SFC)
WO2017137004A1 (en) Method and apparatus for service function forwarding in a service domain
CN106059924B (en) Method, device and system for managing information
CN110535768B (en) Multicast data transmission method and related equipment
US11632322B2 (en) Preferred path route graphs in a network
US9455903B2 (en) Recording packet routes using bloom filters
US20120300781A1 (en) Packet Routing in a Network
CN109218111B (en) Method for processing message and repeater
KR102455886B1 (en) Service Feature Chaining Congestion Feedback
WO2015151184A1 (en) Communication system, communication method, relay device, and communication program
CN105530185A (en) Overlay routing network, routing method based on overlay routing network, and router
CN114128240A (en) Compressed data transmission in a network implementing an interior gateway protocol
CN113923161A (en) Message forwarding method and device
KR101304971B1 (en) Forwarding a packet in a sensor personal area network
KR100907136B1 (en) Communication device, routing method, and program recording medium
CN111526512A (en) Gateway bridging method, device, equipment and medium based on Wi-Fi data packet
CN108965122B (en) Routing method, device and computer readable storage medium
CN103986637A (en) Error message processing method and tunnel device
KR102001487B1 (en) Method for controlling software defined networking and computing device performing the same
CN114513450A (en) Method, device, equipment and storage medium for sending calculation route information
CN114125988A (en) Method and equipment for generating routing information, sending position information and forwarding message
Tariq et al. CBAM: A Controller based broadcast storm avoidance mechanism in SDN based NDN-IoTs

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant