WO2015172675A1 - Packet processing method and device - Google Patents

Packet processing method and device Download PDF

Info

Publication number
WO2015172675A1
WO2015172675A1 PCT/CN2015/078508 CN2015078508W WO2015172675A1 WO 2015172675 A1 WO2015172675 A1 WO 2015172675A1 CN 2015078508 W CN2015078508 W CN 2015078508W WO 2015172675 A1 WO2015172675 A1 WO 2015172675A1
Authority
WO
WIPO (PCT)
Prior art keywords
packet
parameter
message
path
node
Prior art date
Application number
PCT/CN2015/078508
Other languages
French (fr)
Chinese (zh)
Inventor
徐卫平
牛乐宏
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2015172675A1 publication Critical patent/WO2015172675A1/en

Links

Images

Definitions

  • the present invention relates to communication technologies, and in particular, to a message processing method and apparatus.
  • the usual network equipment can also provide value-added services (English name is Value-Added Service, abbreviated as VAS), for example, network address translation (English name is Network Address Translation, English) Abbreviated as NAT), firewall and other services.
  • value-added services English name is Value-Added Service, abbreviated as VAS
  • VAS Value-Added Service
  • NAT Network Address Translation
  • the service chain (English name is service chain) includes a service classifier (English name is service classifier) and N service forwarding entities (English full name is service forwarding entity, English abbreviation is SFE).
  • the SFEs included in the service chain are connected in sequence.
  • One or more service functions (English full service function, English abbreviated as SF) nodes can be connected to the SFE.
  • the SF node is configured to perform service processing on the received packet.
  • the SF node has functions such as a NAT function and a firewall.
  • the service classifier on the service chain adds a service header to the received packet according to the service type corresponding to the received packet.
  • the service header includes the path identifier of the service chain corresponding to the service type (English name is Identifier, English abbreviation is ID).
  • the service classifier sends a packet including the service header to the SFE connected to the service classifier.
  • the SFE sends a packet including the service header to the SF node connected to the SFE.
  • the SF node cannot identify the packet including the service header, and thus cannot perform service processing on the packet including the service header.
  • the embodiment of the present invention provides a packet processing method and device, which solves the problem that an SF node cannot process a packet including a service header.
  • a packet processing method including:
  • the packet processing apparatus receives the first packet from the SFE, where the first packet includes a second packet and a service header encapsulated in the second packet, where the service header is in the first packet Including the path ID of the service chain;
  • the message processing apparatus acquires the second packet and the path ID
  • the packet processing apparatus processes the second packet according to the path ID to obtain a third packet, where the processing of the second packet includes: adding a first parameter to the In the second packet, the first parameter is a parameter determined according to the path ID;
  • the message processing apparatus sends the third message to the SF node.
  • the method further includes:
  • the message processing apparatus receives a fourth packet from the SF node, where the fourth packet includes the first parameter
  • the packet processing device acquires the path ID according to the first parameter included in the fourth packet
  • the message processing apparatus acquires the fifth packet by processing the fourth packet according to the path ID obtained by the packet processing apparatus after receiving the fourth packet, where the The processing of the fourth packet includes: determining the service header according to the path ID, and encapsulating the fourth packet by using the service header;
  • the message processing apparatus sends the fifth message to the SFE.
  • a second possible implementation of the first aspect including:
  • the packet processing device determines, according to the identifier of the interface that receives the first packet, that the third packet is forwarded according to the forwarding entry, where the forwarding entry includes the interface that receives the first packet.
  • the packet processing apparatus sends the third packet to the SF node by using the first interface.
  • a third possible implementation manner of the first aspect is further provided, where the forwarding entry further includes the path ID;
  • the packet processing apparatus determines, according to the identifier of the interface that receives the first packet, that the third packet is forwarded according to the forwarding entry, and includes:
  • the packet processing apparatus determines, according to the path ID and the identifier of the interface that receives the first packet, that the third packet is forwarded according to the forwarding entry.
  • the forwarding entry further includes a second parameter, where the second parameter is used to identify the An SF node or a SF node of the SF node on the service chain;
  • the packet processing apparatus determines, according to the identifier of the interface that receives the first packet, that the third packet is forwarded according to the forwarding entry.
  • the packet processing apparatus determines to forward the third packet according to the forwarding entry according to the second parameter carried in the first packet and the identifier of the interface that receives the first packet. .
  • a fifth possible implementation of the first aspect including:
  • the message processing apparatus adds the second parameter to the traffic header.
  • the sixth possible implementation manner of the first aspect is further provided, where the service header in the first packet further includes a third parameter, where The third parameter is used to identify that the first packet is an operation, management, and maintenance (English full name operation, administration and maintenance, English abbreviation is OAM) message;
  • OAM English full name operation, administration and maintenance, English abbreviation is OAM
  • the method further includes:
  • the packet processing apparatus determines that the first packet includes the third parameter, and the forwarding policy is to send an OAM packet from the SFE to the SF node, send the Third message.
  • the first parameter is the path ID, or the first parameter is data obtained by processing the path ID according to an algorithm.
  • a message processing apparatus including:
  • a first receiving unit configured to receive a first packet from the SFE, where the first packet is a packet obtained after the service header is encapsulated in the second packet, where the service header is in the first packet Including the path ID of the service chain;
  • Decapsulating unit configured to acquire the second packet and the path ID
  • a first acquiring unit configured to process the second packet according to the path ID, to obtain a third packet, where the processing performed by the first acquiring unit on the second packet includes:
  • the first obtaining unit adds a first parameter to the second packet, where the first parameter is a parameter determined according to the path ID;
  • the first forwarding unit is configured to send the third packet to the SF node.
  • the method further includes:
  • a second receiving unit configured to receive a fourth packet from the SF node, where the fourth packet includes the first parameter
  • a second acquiring unit configured to acquire the path ID according to the first parameter included in the fourth packet
  • An encapsulating unit configured to process the fourth packet according to the path ID obtained by the packet processing device after receiving the fourth packet, to obtain a fifth packet, where the encapsulation
  • the processing of the fourth packet by the unit includes: the encapsulating unit determines the service header according to the path ID, and encapsulates the fourth packet by using the service header;
  • the second forwarding unit is configured to send the fifth packet to the SFE.
  • a second possible implementation manner of the second aspect is further provided, where the first forwarding unit is specifically configured to receive according to the first receiving unit And determining, by the identifier of the interface of the first packet, that the forwarding entry forwards the third packet, where the forwarding entry includes an identifier of the interface that receives the first packet and an identifier of the first interface;
  • the first forwarding unit is specifically configured to send, by using the first interface, the SF node Third message.
  • a third possible implementation of the second aspect is further provided, where the forwarding entry further includes the path ID;
  • the first forwarding unit is configured to determine, according to the path ID and the identifier of the interface that the first receiving unit receives the first packet, to forward the third packet according to the forwarding entry.
  • the forwarding entry further includes a second parameter, where the second parameter is used to identify the An SF node or a SF node of the SF node on the service chain;
  • the first forwarding unit is configured to receive, according to the second parameter carried in the first packet, the first receiving unit The identifier of the interface of the first packet is determined, and the third packet is forwarded according to the forwarding entry.
  • a fifth possible implementation manner of the second aspect is further provided, where the encapsulating unit is specifically configured to add the second parameter to the service header.
  • the third parameter is used to identify that the first packet is an OAM packet.
  • the message processing device further includes:
  • control unit configured to determine that the first packet includes the third parameter, and the forwarding policy is to control the first forwarding unit to send the OAM packet from the SFE to the SF node
  • the SF node sends the third packet.
  • the first parameter is the path ID, or the first parameter, in combination with the foregoing second aspect or any one of the foregoing possible implementation manners Data obtained by processing the path ID according to an algorithm.
  • the packet processing apparatus strips the service header of the first packet and obtains the second packet.
  • the message processing apparatus may obtain a path ID from a service header of the first packet.
  • the packet processing device adds a first parameter corresponding to the path ID to the second packet, Obtain the third message.
  • the message processing apparatus sends the third message to the SF node. In this way, the third packet received by the SF node does not include the service header, and the problem that the SF node cannot process the packet including the service header is solved.
  • FIG. 1 is a schematic diagram of a network scenario.
  • FIG. 2 is a schematic diagram of a network scenario according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of a message processing apparatus according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a message processing apparatus according to an embodiment of the present invention.
  • FIG. 5 is a flowchart of a packet processing method according to an embodiment of the present invention.
  • FIG. 1 is a schematic diagram of a network scenario.
  • the network shown in FIG. 1 includes a service classifier 101, an SFE 102, and an SF node 103.
  • the SF node may have at least one of service functions such as a NAT and a firewall.
  • a service chain in the network shown in FIG. 1 includes a service classifier 101, an SFE 102, and an SF node 103.
  • the service classifier 101 encapsulates the service header on the received packet 1001 and obtains the packet 1011.
  • the service header of the message 1011 includes a path ID and a preset ID of the service chain.
  • the preset ID is used to identify the SF node 103 on the service chain. The last hop of the SF node.
  • the SFE 102 receives message 1011 from service classifier 101.
  • the SFE 102 determines the forwarding entry according to the path ID and the preset ID included in the service header of the packet 1011.
  • the forwarding entry includes a path ID, a preset ID, and an egress port.
  • the egress port is connected to the SF node 103.
  • the SFE 102 transmits the message 1011 to the SF node 103 through the egress port.
  • the SF node 103 cannot perform the service processing on the packet 1001 included in the packet 1011 because the SF node 103 cannot identify the service header of the packet 1011.
  • the method is to add a message processing device between the SF node and the SFE.
  • the message processing apparatus processes the service header included in the received message 1011 so that the message 1002 received by the SF node 103 does not include the service header.
  • the method may include the message processing device stripping the service header of the message 1011 from the SFE 102 to obtain the message 1001.
  • the message processing device acquires the first parameter corresponding to the path ID according to the path ID included in the service header of the message 1011.
  • the message processing device adds the first parameter to the message 1001 to obtain the message 1002.
  • the message processing device transmits the message 1002 to the SF node. Since the message 1002 does not include a service header, the SF node 103 can perform service processing on the message 1002.
  • This solution can be implemented by the following embodiments.
  • FIG. 2 is a schematic diagram of a network scenario according to an embodiment of the present invention.
  • the network shown in FIG. 2 includes a service classifier 101, an SFE 102, an SF node 103, and a message processing device 104.
  • the service chain in the network shown in FIG. 2 includes a service classifier 101, an SFE 102, a message processing device 104, and an SF node 103.
  • the service classifier 101 communicates with the SFE 102;
  • the SFE 102 communicates with the message processing device 104;
  • the message processing device 104 communicates with the SF node 103.
  • the service chain may also include an SF node 105 in communication with the message processing device 104.
  • the SF node 105 is the last hop SF node of the SF node 103 on the service chain.
  • the SFE 102 can transmit the message 1010 to the SF node 105 via the message processing device 104, and receive the message 1011 sent by the SF node 105 through the message processing device 104.
  • the SFE 102 then transmits the message 1011 to the SF node 103 via the message processing device 104 such that the message 1010 is processed on the service chain in the order of the SF nodes.
  • the service described in the embodiment of the present invention Chain can also be a business function chain (English full service function chain).
  • FIG. 3 is a schematic diagram of a message processing apparatus according to an embodiment of the present invention.
  • the message processing apparatus shown in FIG. 3 can be the message processing apparatus 104 in the network shown in FIG. 2.
  • the message processing apparatus shown in FIG. 3 can be deployed between the SFE 102 and the SF node 103 on the service chain. Alternatively, the message processing apparatus shown in FIG. 3 can be deployed on the same device as the SFE 102. Alternatively, the message processing apparatus shown in FIG. 3 can be deployed on the same device as the SF node 103.
  • the message processing apparatus shown in FIG. 3 may include a processor 1040, a memory 1041, and a communication interface 1042.
  • the processor 1040, the memory 1041, and the communication interface 1042 are connected by a communication bus 1043.
  • the memory 1041 is used to store programs, and may also store mapping relationships.
  • the mapping relationship is a mapping relationship between the path ID and the first parameter.
  • the processor 1040 performs the following operations in accordance with executable instructions included in the program read from the memory 1041.
  • the processor 1040 receives the message 1011 from the SFE 102 via the communication interface 1042.
  • the packet 1011 is a packet obtained after the service header is encapsulated in the packet 1001.
  • the service header of the message 1011 includes the path ID of the service chain.
  • the processor 1040 strips the service header from the message 1011 and obtains the message 1001 and the path ID.
  • the processor 1040 obtains the message 1002 according to the path ID and the message 1001.
  • the message 1002 is a message 1002 obtained by adding the first parameter corresponding to the path ID stored in the memory 1041 to the message 1001.
  • the processor 1040 transmits the message 1002 to the SF node 103 via the communication interface 1042.
  • the first forwarding entry may also be saved in the memory 1041.
  • the first forwarding entry stored in the memory 104 includes an ID of an interface that receives the message 1011 and an ID of the first interface.
  • the first interface is connected to the SFE node 103.
  • the processor 1040 can determine, according to the ID of the interface that receives the message 1011, that the message 1002 is sent according to the first forwarding entry.
  • the processor 1040 can send the message 1002 to the SF node 103 through the communication interface 1042 according to the ID of the first interface.
  • the interface that receives the message 1011 is connected to the SFE 102.
  • the message 1003 includes a first parameter.
  • the processor 1040 receives through the communication interface 1042 Message 1003 from SF node 103.
  • the processor 1040 acquires a path ID corresponding to the first parameter from the memory 1041 according to the first parameter included in the message 1003.
  • the processor 1040 obtains the message 1013 according to the path ID and the message 1003 received through the communication interface 1042.
  • the packet 1013 is a packet obtained after the service header is encapsulated in the packet 1003.
  • the service header of the message 1013 includes the path ID.
  • the processor 1040 transmits a message 1013 to the SFE 102 via the communication interface 1042.
  • a second forwarding entry may also be saved in the memory 1041.
  • the second forwarding entry stored in the memory 104 includes an ID of an interface that receives the message 1003 and an ID of the second interface.
  • the second interface is connected to the SFE 102.
  • the processor 1040 can determine, according to the ID of the interface that receives the message 1003, that the message 1003 is sent according to the second forwarding entry.
  • the processor 1040 can transmit the message 1003 to the SFE 102 via the communication interface 1042 according to the ID of the second interface.
  • the interface that receives the message 1003 is connected to the SF node 103.
  • the processor 1040 cooperates with the communication interface 1042 according to the executable instructions and the mapping relationship in the memory 1041, so that the message processing apparatus shown in FIG. 3 executes the message processing apparatus in the embodiment shown in FIG. All the operations performed. It is also considered that the message processing apparatus shown in Fig. 3 is the message processing apparatus in the embodiment shown in Fig. 5.
  • FIG. 4 is a schematic diagram of a message processing apparatus according to an embodiment of the present invention.
  • the message processing apparatus shown in FIG. 4 includes a first receiving unit 1044, a decapsulation unit 1045, a first obtaining unit 1046, and a first forwarding unit 1047.
  • the packet processing apparatus provided in the embodiment corresponding to FIG. 4 further includes: a second receiving unit 1048, a second obtaining unit 1049, a packaging unit 1050, and a second forwarding unit 1051.
  • the packet processing apparatus provided in the embodiment corresponding to FIG. 4 further includes a storage unit 1052.
  • the storage unit 1052 can be used to save the mapping relationship held by the memory 1041 in FIG.
  • the packet processing apparatus provided in the embodiment corresponding to FIG. 4 further includes a control unit 1053.
  • the message processing apparatus shown in FIG. 3 and the message processing apparatus shown in FIG. 4 may be the same apparatus, for example, the message processing apparatus 104 in the network shown in FIG. 2. It can be considered that Fig. 3 shows the contents included in a message processing apparatus from a physical point of view, and Fig. 4 shows the contents included in a message processing apparatus from a logical point of view.
  • the first receiving unit 1044, the first forwarding unit 1047, the second receiving unit 1048, and the second forwarding unit 1051 in FIG. 4 may be implemented by the communication interface 1042 in FIG.
  • the communication interface 1042 may include at least one Physical interface; decapsulation list in Figure 4
  • the element 1045, the first obtaining unit 1046, and the encapsulating unit 1050 may be implemented by the processor 1040 of FIG. 3 according to executable instructions stored by the memory 1041 or according to executable instructions and mapping relationships stored by the memory 1041, and the processor 1040 may include at least A physical processor.
  • FIG. 5 is a flowchart of a packet processing method according to an embodiment of the present invention. The packet processing method provided by the embodiment of the present invention is described in detail below with reference to FIG. 2 to FIG.
  • the SFE 102 sends a message 1011 to the message processing device 104.
  • the SFE 102 can receive the message 1010 sent by the service classifier 101.
  • Message 1010 may be generated by service classifier 101.
  • service classifier 101 receives message 1001.
  • the service classifier 101 determines the path ID of the service chain corresponding to the service type according to the service type corresponding to the message 1001.
  • the service classifier 101 encapsulates the service header in the packet 1001 and obtains the packet 1010.
  • the traffic header of message 1010 includes the path ID of the service chain.
  • the message 1010 received by the SFE 102 is from the SFE 102 on the service chain.
  • the service header of the packet 1010 may further include at least one of a protocol type and metadata (English name is metadata).
  • the metadata may include the ID of the user who sent the message 1001 to the service classifier 101.
  • the SFE 102 can determine the forwarding entry according to the path ID in the service header of the packet 1010.
  • the forwarding entry includes a path ID and an ID of the interface.
  • the SFE 102 can send the message 1011 to the message processing device 104 according to the ID of the interface.
  • the interface may be an interface that the SFE 102 connects to the message processing device 104.
  • the interface may be an interface where the SFE 102 connects to the SF node 103. Since the message processing device 104 is interposed between the SFE 102 and the SF node, the SFE 102 can send the message 1011 to the message processing device 104 without updating or upgrading the forwarding entry in the SFE 102. .
  • the message 1010 received by the SFE 102 may be the same as the message 1011 sent by the SFE 102 to the message processing apparatus 104, or may be different from the message 1011 sent by the SFE 102 to the message processing apparatus 104.
  • the message processing device 104 obtains the path ID of the message 1001 and the service chain.
  • the first receiving unit 1044 receives the message 1011 from the SFE 102.
  • the decapsulation unit 1045 strips the service header of the message 1011, obtains the message 1001, and obtains the path ID of the service chain from the service header.
  • the packet sent by the SFE 102 to the SF node 103 may be a packet including the service header, and the decapsulation unit 1045 may directly obtain the packet 1001 and the service included in the service header from the packet 1011 received by the first receiving unit 1044.
  • the path ID of the chain may be a packet including the service header, and the decapsulation unit 1045 may directly obtain the packet 1001 and the service included in the service header from the packet 1011 received by the first receiving unit 1044.
  • the decapsulation unit 1045 may also write the protocol type included in the service header to the storage unit 1052.
  • the protocol type stored in the storage unit 1052 has a correspondence relationship with the path ID.
  • the decapsulation unit 1045 may also write the metadata included in the service header to the storage unit 1052.
  • the metadata stored in the storage unit 1052 has a correspondence relationship with the path ID.
  • the service header of the message 1011 may include any or all of the protocol type and the metadata.
  • the message processing device 104 processes the message 1001 by using the first parameter determined according to the path ID, and obtains the message 1002.
  • the processing includes adding the first parameter to the message 1001.
  • the first parameter may be the path ID itself, or the first parameter may be data obtained by processing the path ID according to an algorithm.
  • the algorithm can be a hash algorithm or a compression algorithm.
  • the compression algorithm is used to map data larger than N bits into N-bit data. N is the data bit contained in at least one byte.
  • the first obtaining unit 1046 may acquire the message 1002 by adding the first parameter determined according to the path ID to the message 1001. Adding the first parameter determined according to the path ID to the message 1001 means adding the first parameter to the inside of the message 1001, instead of adding an outer message header to the message 1001, and The first parameter is added to the newly added outer header.
  • the first obtaining unit 1046 may obtain the first parameter corresponding to the path ID from the mapping relationship between the path ID and the first parameter saved by the storage unit 1052.
  • the first obtaining unit 1046 may add the first parameter to a preset field in the message 1001.
  • the preset field is a word that the SF node 103 does not modify when performing service processing on the message 1002. At least one field in the segment.
  • the number of preset fields may be determined according to the number of bytes occupied by the first parameter. If the first parameter is a path ID and the path ID is 8 bits, the first obtaining unit 1046 may select a field from the message 1001 to save the path ID. If the first parameter is a path ID and the path ID is greater than 8 bits, the first obtaining unit 1046 may select a plurality of fields from the message 1001 to save the path ID.
  • the first obtaining unit 1046 may select one or more fields in the message 1001 to save the first according to the method of saving the path ID in the message 1001. parameter.
  • the selected one or more fields in the message 1001 are fields that the SF node 103 does not modify during the service processing of the message 1002.
  • the preset field may be a virtual local area network (English name is Virtual Local Area Network, abbreviated as VLAN) field.
  • the packet 1001 is an IPv4 packet
  • the default field may also be a service type of the IPv4 packet (English name is service, the English abbreviation is TOS) field and the survival time (English is called time to live, the English abbreviation is One or more fields in the TTL) field.
  • the packet 1001 is an IPv6 packet
  • the default field may be a stream type of the IPv6 packet (the English name is a traffic class) field, a hop limit (English name is a hop limit) field, and a stream tag (the English name is Flow). Label One or more fields in the field.
  • the first obtaining unit 1046 pre-stores the configuration information of the SF node 103.
  • the configuration information of the SF node 103 can modify the Time-To-Live field when the SF node 103 performs service processing.
  • the first obtaining unit 1046 adds the first parameter to the Type-of-Service field according to the configuration information of the SF node 103, so that the SF node 103 retains the first parameter corresponding to the path ID in the process of processing the message 1002.
  • the first obtaining unit 1046 can map the 24-bit path ID to the 8-bit first parameter and store it in a field of the message 1001.
  • the first obtaining unit 1046 may select an unused value as the first parameter from the value range of the 8-bit data.
  • the first obtaining unit 1046 may store the first parameter corresponding to the path ID to the storage unit 1052.
  • the first obtaining unit 1046 may also add the first parameter to the non-preset field in the message 1001 instead of adding the first parameter to the preset field, where
  • the preset field refers to a field that the SF node 103 will modify when performing service processing on the message 1002.
  • the SF node 103 may first read the first parameter in the process of performing service processing on the message 1002, and then The field is modified, and the first parameter is added back to the modified non-preset field or another non-preset field of the message 1001.
  • the message processing device 104 learns the rules of the first parameter added in the non-preset field, it can be ensured that the first parameter added by the SF node 103 in the non-preset field can still be recognized by the SFE 102.
  • the modified message 1002 is implemented in the present embodiment.
  • the example is still considered to be the message 1002 obtained after processing the message 1001 by the first parameter.
  • the message processing device 104 sends the message 1002 to the SF node 103.
  • the message 1002 to the SF node 103 can be transmitted by the first forwarding unit 1047.
  • the first forwarding unit 1047 can forward the message 1002 according to the first forwarding entry.
  • the first forwarding entry may include an ID of the interface that receives the message 1011 and an ID of the first interface, where the interface of the received message 1011 is connected to the SFE 102, and the first interface is connected to the SF node 103.
  • the first forwarding unit 1047 determines that the packet 1002 is sent according to the first forwarding entry according to the ID of the interface that receives the packet 1011.
  • the first forwarding entry may include a path ID in addition to the ID of the interface that receives the message 1011 and the ID of the first interface.
  • the first forwarding unit 1047 determines to send the message 1002 according to the first forwarding entry according to the ID of the interface that receives the message 1011 and the ID of the interface that receives the message 1011.
  • the first forwarding entry may include a first parameter in addition to the ID of the interface that receives the message 1011 and the ID of the first interface.
  • the first forwarding unit 1047 determines to send the message 1002 according to the first forwarding entry according to the first parameter and the ID of the interface of the received message 1011.
  • the first forwarding unit 1047 After determining that the message 1002 is sent according to the first forwarding entry, the first forwarding unit 1047 sends the message 1002 to the SF node 103 according to the first interface.
  • the method of 502 to 504 is a method in which the message processing device 104 processes the message 1011 transmitted to the SF node 103.
  • the message processing device 104 performs the above processing on the message 1011, and then strips the service header and acquires the message 1002.
  • the SF node 103 can identify and process the message 1002 that is not encapsulated with the service header.
  • the following 505 to 507 are methods in which the message processing apparatus 104 processes the message 1003 transmitted by the SF node 103 to the SFE 102.
  • the message 1003 is a message obtained after the SF node 103 performs service processing on the message 1002.
  • the field in which the message 1003 holds the path ID is the same as the field in which the message 1002 holds the path ID.
  • the following 505 to 507 are optional steps.
  • the SF node 103 sends a message 1003 to the message processing device 104.
  • the SF node 103 can transmit the message 1003 to the message processing device 104 by receiving the interface of the message 1002.
  • the forwarding entry is stored on the SF node 103.
  • the forwarding entry includes a first parameter and an ID of an interface to which the message processing device 104 is connected.
  • the SF node 103 acquires the ID of the interface of the connection message processing device 104 included in the forwarding entry according to the first parameter in the message 1002.
  • the SF node 103 transmits the message 1003 to the message processing device 104 based on the ID of the interface to which the message processing device 104 is connected.
  • the message processing device 104 obtains the message 1013 by processing the message 1003 according to the path ID.
  • the processing includes encapsulating the packet 1003 by using the service header corresponding to the path ID.
  • the second receiving unit 1048 receives the message 1003 from the SF node 103.
  • the message 1003 includes a first parameter.
  • the second obtaining unit 1049 acquires a path ID corresponding to the first parameter according to the first parameter included in the received message 1003.
  • the encapsulating unit 1050 encapsulates the service header on the packet 1003 to obtain the packet 1013.
  • the service header of the message 1013 includes a path ID.
  • the second obtaining unit 1049 may obtain the path ID corresponding to the first parameter from the storage unit 1052.
  • the service header of the packet 1013 obtained by the second obtaining unit 1049 is the same as the traffic header of the packet 1011. For example, if the service header of the packet 1011 in 502 carries the protocol type, the second obtaining unit 1049 may obtain the protocol type corresponding to the path ID from the storage unit 1052 according to the path ID, and add the protocol type to the packet 1013. Business head. If the service header of the packet 1011 in 502 carries the protocol type and the metadata, the second obtaining unit 1049 may obtain the information from the storage unit 1052 according to the path ID. The protocol type and metadata corresponding to the path ID, and the protocol type and metadata are added to the service header of the message 1013.
  • the modified message 1003 is implemented in the present embodiment.
  • the example is still considered to be the message 1003.
  • the message processing device 104 transmits the message 1013 to the SFE 102.
  • the second forwarding unit 1051 transmits a message 1013 to the SFE 102.
  • the second forwarding unit 1051 can forward the message 1013 according to the second forwarding entry.
  • the second forwarding entry includes an ID of an interface that receives the message 1003 and an ID of the second interface.
  • the second forwarding unit 1051 may determine to send the message 1013 to the SFE 102 according to the second forwarding entry according to the ID of the interface that receives the message 1003.
  • the second forwarding unit 1051 may send the message 1013 to the SFE 102 according to the second interface.
  • the second interface is connected to the SFE 102.
  • the second entry may be saved in the storage unit 1052.
  • the interface receiving the message 1003 is connected to the SF node 103.
  • the second forwarding unit 1049 can determine that the message 1003 is from the SF node 103 according to the ID of the interface that receives the message 1003.
  • the second forwarding unit 1049 can send the message 1013 to the SFE 102 by receiving the interface of the message 1011 to reduce the lookup of the forwarding entry.
  • the message processing device 104 can forward any message determined to be from the SF node 103 to the SFE 102.
  • the service classifier 101 may add a second parameter to the service header of the message 1011 in the process of generating the message 1011.
  • the second parameter is used to identify the SF node 103 on the service chain or the last hop SF node of the SF node 103 on the service chain.
  • the second parameter mentioned in the embodiment of the present invention may be information such as a character, a character string, a name, or an index (English name is index).
  • the first obtaining unit 1046 also stores the second parameter included in the service header of the message 1011 in the storage unit 1052.
  • the second parameter in the storage unit 1052 corresponds to the path ID.
  • the first forwarding entry further includes a second parameter.
  • the first forwarding unit 1047 of the 504 determines to send the message 1002 according to the first forwarding entry according to the second parameter and the ID of the interface of the received message 1011.
  • the second obtaining unit 1049 further acquires the second parameter corresponding to the path ID from the storage unit 1052 according to the acquired path ID.
  • Encapsulation unit 1050 also adds a second parameter to the traffic header of message 1013.
  • the message processing device 104 can determine the SF node 103 that receives the message 1002 according to the second parameter, which is helpful to improve. The accuracy of forwarding.
  • the packet processing device 104 can determine the forwarding entry according to the path ID.
  • the first obtaining unit 1046 saves the path ID and the second parameter included in the service header of the message 1011 in the storage unit 1052.
  • the first forwarding entry further includes a path ID and a second parameter.
  • the first forwarding unit 1047 in the 504 may determine to send the message 1002 according to the first forwarding entry according to the second parameter, the path ID, and the ID of the interface that receives the message 1011.
  • the first forwarding entry further includes a first parameter and a second parameter.
  • the first forwarding unit 1047 in the 504 may determine to send the message 1002 according to the first forwarding entry according to the second parameter, the first parameter, and the ID of the interface of the received message 1011.
  • the second obtaining unit 1049 further acquires the second parameter corresponding to the path ID from the storage unit 1052 according to the acquired path ID.
  • Encapsulation unit 1050 also adds a second parameter to the traffic header of message 1013.
  • the service header of the message 1011 mentioned in the foregoing embodiment of the present invention may further include a third parameter.
  • the third parameter is used to identify that the packet 1011 is an OAM packet.
  • the 504 further includes: when the message processing device 104 determines that the message 1011 includes the third parameter, and the forwarding policy is to send the OAM message from the SFE 102 to the SF node 103, the message 1002 is sent to the SF node 103.
  • the control unit 1053 included in the message processing apparatus 104 determines the industry that the decapsulation unit 1045 strips from the message 1011.
  • the service header includes a third parameter, and when the forwarding policy is to send the OAM message from the SFE 102 to the SF node 103, the first forwarding unit 1047 is controlled to send the message 1002 to the SF node 103.
  • the interface mentioned in the above embodiments of the present invention may be an interface of a physical interface, a logical interface or a tunnel. If the interface mentioned in the above embodiment of the present invention is an interface of a tunnel, the message processing apparatus 104 needs to establish a tunnel with the SFE 102 and the SF node 103, respectively.
  • the ID of the interface mentioned in the foregoing embodiment of the present invention belongs to the identifier of the interface, and the identifier of the interface in the embodiment of the present invention may also be identifier information represented by other forms.
  • the above general purpose processor may be a microprocessor or the processor or any conventional processor.
  • the steps of the method disclosed in the embodiment of the present invention may be directly implemented as a hardware processor, or may be performed by a combination of hardware and software modules in the processor.
  • the code implementing the above functions may be stored in a computer readable medium.
  • Computer readable media includes computer storage media.
  • a storage medium may be any available media that can be accessed by a computer.
  • the computer readable medium may be a random access memory (English full name is random access memory, abbreviated as RAM), read-only memory (English full name is read-only memory, English abbreviation for ROM), Electrical erasable programmable read-only memory (English full name electrically erasable programmable read-only memory, abbreviated as EEPROM), read-only optical disc (English full name compact disc read-only memory, English abbreviation for CD-ROM) or other disc
  • RAM random access memory
  • read-only memory English full name is read-only memory, English abbreviation for ROM
  • Electrical erasable programmable read-only memory English full name electrically erasable programmable read-only memory, abbreviated as EEPROM
  • read-only optical disc English full name compact disc read-only memory, English abbreviation for CD-ROM
  • the computer readable medium may be a compact disc (English full name compact disc, abbreviated as CD), a laser disc, a digital video disc (English full name digital video disc, abbreviated as DVD), a floppy disk or a Blu-ray disc.

Abstract

Disclosed are a packet processing method and device, which solve the problem that an SF node is unable to process a packet comprising a service header. The method comprises: receiving, by a packet processing device, a first packet from a service forwarding entity (SFE), wherein the first packet comprises a second packet and a service header encapsulated in the second packet, and the service header in the first packet comprises a path identifier (ID) of a service chain; acquiring, by the packet processing device, the second packet and the path ID; processing, by the packet processing device, the second packet according to the path ID to acquire a third packet, wherein processing the second packet comprises: adding a first parameter into the second packet, the first parameter being a parameter determined according to the path ID; and sending, by the packet processing device, the third packet to a service function (SF) node.

Description

报文处理方法及装置Message processing method and device
本申请要求于2014年5月15日提交中国专利局、申请号为CN 201410206623.4、发明名称为“报文处理方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application, filed on May 15, 2014, which is hereby incorporated by reference. .
技术领域Technical field
本发明涉及通信技术,尤其涉及报文处理方法及装置。The present invention relates to communication technologies, and in particular, to a message processing method and apparatus.
背景技术Background technique
通常的网络设备除了提供基本的交换、路由等转发功能外,还可提供增值业务(英文全称为Value-Added Service,英文缩写为VAS),例如:网络地址转换(英文全称为Network Address Translation,英文缩写为NAT)、防火墙等业务。In addition to providing basic switching, routing and other forwarding functions, the usual network equipment can also provide value-added services (English name is Value-Added Service, abbreviated as VAS), for example, network address translation (English name is Network Address Translation, English) Abbreviated as NAT), firewall and other services.
提供增值业务的网络中,业务链(英文名称为service chain)包括业务分类器(英文名称为service classifier)和N个业务转发实体(英文全称为service forwarding entity,英文缩写为SFE)。service chain包括的SFE依次连接。SFE上可连接一个或多个业务功能(英文全称为service function,英文缩写为SF)节点。SF节点用以对接收到的报文进行业务处理,例如:SF节点具有NAT功能、防火墙等功能。In the network providing value-added services, the service chain (English name is service chain) includes a service classifier (English name is service classifier) and N service forwarding entities (English full name is service forwarding entity, English abbreviation is SFE). The SFEs included in the service chain are connected in sequence. One or more service functions (English full service function, English abbreviated as SF) nodes can be connected to the SFE. The SF node is configured to perform service processing on the received packet. For example, the SF node has functions such as a NAT function and a firewall.
业务链上的service classifier根据接收到的报文对应的业务类型,为接收到的报文添加业务头。该业务头包括业务类型对应的业务链的路径标识(英文全称为Identifier,英文缩写为ID)。service classifier向连接service classifier的SFE发送包括该业务头的报文。SFE向连接SFE的SF节点发送包括该业务头的报文。SF节点无法识别包括业务头的报文,进而无法对包括业务头的报文进行业务处理。The service classifier on the service chain adds a service header to the received packet according to the service type corresponding to the received packet. The service header includes the path identifier of the service chain corresponding to the service type (English name is Identifier, English abbreviation is ID). The service classifier sends a packet including the service header to the SFE connected to the service classifier. The SFE sends a packet including the service header to the SF node connected to the SFE. The SF node cannot identify the packet including the service header, and thus cannot perform service processing on the packet including the service header.
发明内容Summary of the invention
有鉴于此,本发明实施例提供一种报文处理方法及装置,解决SF节点无法对包括业务头的报文进行处理的问题。In view of this, the embodiment of the present invention provides a packet processing method and device, which solves the problem that an SF node cannot process a packet including a service header.
本发明实施例提供的技术方案如下。The technical solutions provided by the embodiments of the present invention are as follows.
第一方面,提供了一种报文处理方法,包括:In a first aspect, a packet processing method is provided, including:
报文处理装置接收来自SFE的第一报文,所述第一报文包括第二报文和封装在所述第二报文上的业务头,所述第一报文中的所述业务头包括业务链的路径ID;The packet processing apparatus receives the first packet from the SFE, where the first packet includes a second packet and a service header encapsulated in the second packet, where the service header is in the first packet Including the path ID of the service chain;
所述报文处理装置获取所述第二报文和所述路径ID;The message processing apparatus acquires the second packet and the path ID;
所述报文处理装置通过根据所述路径ID对所述第二报文进行处理,获取第三报文,其中,对所述第二报文进行的处理包括:将第一参数添加至所述第二报文内,所述第一参数为根据所述路径ID确定的参数;The packet processing apparatus processes the second packet according to the path ID to obtain a third packet, where the processing of the second packet includes: adding a first parameter to the In the second packet, the first parameter is a parameter determined according to the path ID;
所述报文处理装置向SF节点发送所述第三报文。The message processing apparatus sends the third message to the SF node.
在上述第一方面的第一种可能的实现方式中,还包括:In the first possible implementation manner of the foregoing first aspect, the method further includes:
所述报文处理装置接收来自所述SF节点的第四报文,所述第四报文包括所述第一参数;The message processing apparatus receives a fourth packet from the SF node, where the fourth packet includes the first parameter;
所述报文处理装置根据所述第四报文中包括的所述第一参数,获取所述路径ID;The packet processing device acquires the path ID according to the first parameter included in the fourth packet;
所述报文处理装置通过根据所述报文处理装置在接收到所述第四报文后获取的所述路径ID对所述第四报文进行处理,获取第五报文,其中,所述对所述第四报文的处理包括:根据所述路径ID确定所述业务头,用所述业务头对所述第四报文进行封装;The message processing apparatus acquires the fifth packet by processing the fourth packet according to the path ID obtained by the packet processing apparatus after receiving the fourth packet, where the The processing of the fourth packet includes: determining the service header according to the path ID, and encapsulating the fourth packet by using the service header;
所述报文处理装置向所述SFE发送所述第五报文。The message processing apparatus sends the fifth message to the SFE.
结合上述第一方面的第一种可能的实现方式,还提供了第一方面的第二种可能的实现方式,包括:In conjunction with the first possible implementation of the foregoing first aspect, a second possible implementation of the first aspect is also provided, including:
所述报文处理装置根据接收所述第一报文的接口的标识,确定根据转发表项转发所述第三报文,所述转发表项包括所述接收所述第一报文的接口的标识和第一接口的标识; The packet processing device determines, according to the identifier of the interface that receives the first packet, that the third packet is forwarded according to the forwarding entry, where the forwarding entry includes the interface that receives the first packet. The identifier and the identifier of the first interface;
所述报文处理装置通过所述第一接口,向所述SF节点发送所述第三报文。The packet processing apparatus sends the third packet to the SF node by using the first interface.
结合上述第一方面的第二种可能的实现方式,还提供了第一方面的第三种可能的实现方式,所述转发表项还包括所述路径ID;In conjunction with the second possible implementation of the foregoing first aspect, a third possible implementation manner of the first aspect is further provided, where the forwarding entry further includes the path ID;
所述报文处理装置根据接收所述第一报文的接口的标识,确定根据转发表项转发所述第三报文,包括:The packet processing apparatus determines, according to the identifier of the interface that receives the first packet, that the third packet is forwarded according to the forwarding entry, and includes:
所述报文处理装置根据所述路径ID和所述接收所述第一报文的接口的标识,确定根据所述转发表项转发所述第三报文。The packet processing apparatus determines, according to the path ID and the identifier of the interface that receives the first packet, that the third packet is forwarded according to the forwarding entry.
结合上述第一方面的第二种可能的实现方式,还提供了第一方面的第四种可能的实现方式,所述转发表项还包括第二参数,所述第二参数用以标识所述SF节点或所述SF节点在所述业务链上的上一跳SF节点;In conjunction with the second possible implementation of the foregoing first aspect, the fourth possible implementation of the first aspect is further provided, the forwarding entry further includes a second parameter, where the second parameter is used to identify the An SF node or a SF node of the SF node on the service chain;
当所述第一报文中的业务头包括所述第二参数,所述报文处理装置根据接收所述第一报文的接口的标识,确定根据转发表项转发所述第三报文,包括:When the service header in the first packet includes the second parameter, the packet processing apparatus determines, according to the identifier of the interface that receives the first packet, that the third packet is forwarded according to the forwarding entry. include:
所述报文处理装置根据所述第一报文中携带的所述第二参数和所述接收所述第一报文的接口的标识,确定根据所述转发表项转发所述第三报文。The packet processing apparatus determines to forward the third packet according to the forwarding entry according to the second parameter carried in the first packet and the identifier of the interface that receives the first packet. .
结合上述第一方面的第四种可能的实现方式,还提供了第一方面的第五种可能的实现方式,包括:In conjunction with the fourth possible implementation of the foregoing first aspect, a fifth possible implementation of the first aspect is also provided, including:
所述报文处理装置将所述第二参数添加至所述业务头。The message processing apparatus adds the second parameter to the traffic header.
结合上述第一方面或第一方面的任意一种可能的实现方式,还提供了第一方面的第六种可能的实现方式,所述第一报文中的业务头还包括第三参数,所述第三参数用以标识所述第一报文为操作、管理和维护(英文全称为operation,administration and maintenance,英文缩写为OAM)报文;In conjunction with the foregoing first aspect or any one of the foregoing possible implementation manners, the sixth possible implementation manner of the first aspect is further provided, where the service header in the first packet further includes a third parameter, where The third parameter is used to identify that the first packet is an operation, management, and maintenance (English full name operation, administration and maintenance, English abbreviation is OAM) message;
所述报文处理装置向SF节点发送所述第三报文之前,还包括:Before the packet processing apparatus sends the third packet to the SF node, the method further includes:
当所述报文处理装置确定所述第一报文包括所述第三参数,且转发策略是将来自所述SFE的OAM报文发送至所述SF节点时,向所述SF节点发送所述第三报文。When the packet processing apparatus determines that the first packet includes the third parameter, and the forwarding policy is to send an OAM packet from the SFE to the SF node, send the Third message.
结合上述第一方面或第一方面的任意一种可能的实现方式,还提供了第 一方面的第七种可能的实现方式,所述第一参数为所述路径ID,或者所述第一参数为根据算法对所述路径ID进行处理后获得的数据。In combination with any of the above first aspect or any one of the possible implementations of the first aspect, In a seventh possible implementation manner, the first parameter is the path ID, or the first parameter is data obtained by processing the path ID according to an algorithm.
第二方面,提供了一种报文处理装置,包括:In a second aspect, a message processing apparatus is provided, including:
第一接收单元,用于接收来自SFE的第一报文,所述第一报文为在第二报文上封装业务头后获取的报文,所述第一报文中的所述业务头包括业务链的路径ID;a first receiving unit, configured to receive a first packet from the SFE, where the first packet is a packet obtained after the service header is encapsulated in the second packet, where the service header is in the first packet Including the path ID of the service chain;
解封装单元,用于获取所述第二报文和所述路径ID;Decapsulating unit, configured to acquire the second packet and the path ID;
第一获取单元,用于通过根据所述路径ID对所述第二报文进行处理,获取第三报文,其中,所述第一获取单元对所述第二报文进行的处理包括:所述第一获取单元将第一参数添加至所述第二报文内,所述第一参数为根据所述路径ID确定的参数;a first acquiring unit, configured to process the second packet according to the path ID, to obtain a third packet, where the processing performed by the first acquiring unit on the second packet includes: The first obtaining unit adds a first parameter to the second packet, where the first parameter is a parameter determined according to the path ID;
第一转发单元,用于向SF节点发送所述第三报文。The first forwarding unit is configured to send the third packet to the SF node.
在上述第二方面的第一种可能的实现方式中,还包括:In the first possible implementation manner of the foregoing second aspect, the method further includes:
第二接收单元,用于接收来自所述SF节点的第四报文,所述第四报文包括所述第一参数;a second receiving unit, configured to receive a fourth packet from the SF node, where the fourth packet includes the first parameter;
第二获取单元,用于根据所述第四报文包括的所述第一参数,获取所述路径ID;a second acquiring unit, configured to acquire the path ID according to the first parameter included in the fourth packet;
封装单元,用于通过根据所述报文处理装置在接收到所述第四报文后获取的所述路径ID对所述第四报文进行处理,获取第五报文,其中,所述封装单元对所述第四报文的处理包括:所述封装单元根据所述路径ID确定所述业务头,用所述业务头对所述第四报文进行封装;An encapsulating unit, configured to process the fourth packet according to the path ID obtained by the packet processing device after receiving the fourth packet, to obtain a fifth packet, where the encapsulation The processing of the fourth packet by the unit includes: the encapsulating unit determines the service header according to the path ID, and encapsulates the fourth packet by using the service header;
第二转发单元,用于向所述SFE发送所述第五报文。The second forwarding unit is configured to send the fifth packet to the SFE.
结合上述第二方面或第二方面的第一种可能的实现方式,还提供了第二方面的第二种可能的实现方式,所述第一转发单元具体用于根据所述第一接收单元接收所述第一报文的接口的标识,确定转发表项转发所述第三报文,所述转发表项包括所述接收所述第一报文的接口的标识和第一接口的标识;In conjunction with the foregoing second aspect or the first possible implementation of the second aspect, a second possible implementation manner of the second aspect is further provided, where the first forwarding unit is specifically configured to receive according to the first receiving unit And determining, by the identifier of the interface of the first packet, that the forwarding entry forwards the third packet, where the forwarding entry includes an identifier of the interface that receives the first packet and an identifier of the first interface;
所述第一转发单元具体用于通过所述第一接口,向所述SF节点发送所述 第三报文。The first forwarding unit is specifically configured to send, by using the first interface, the SF node Third message.
结合上述第二方面的第二种可能的实现方式,还提供了第二方面的第三种可能的实现方式,所述转发表项还包括所述路径ID;In conjunction with the second possible implementation of the foregoing second aspect, a third possible implementation of the second aspect is further provided, where the forwarding entry further includes the path ID;
所述第一转发单元具体用于根据所述路径ID和所述第一接收单元接收所述第一报文的接口的标识,确定根据所述转发表项转发所述第三报文。The first forwarding unit is configured to determine, according to the path ID and the identifier of the interface that the first receiving unit receives the first packet, to forward the third packet according to the forwarding entry.
结合上述第二方面的第二种可能的实现方式,还提供了第二方面的第四种可能的实现方式,所述转发表项还包括第二参数,所述第二参数用以标识所述SF节点或所述SF节点在所述业务链上的上一跳SF节点;In conjunction with the second possible implementation of the foregoing second aspect, the fourth possible implementation of the second aspect is further provided, the forwarding entry further includes a second parameter, where the second parameter is used to identify the An SF node or a SF node of the SF node on the service chain;
当所述第一报文的业务头包括所述第二参数,所述第一转发单元具体用于根据所述第一报文中携带的所述第二参数和所述第一接收单元接收所述第一报文的接口的标识,确定根据所述转发表项转发所述第三报文。When the service header of the first packet includes the second parameter, the first forwarding unit is configured to receive, according to the second parameter carried in the first packet, the first receiving unit The identifier of the interface of the first packet is determined, and the third packet is forwarded according to the forwarding entry.
结合上述第二方面的第四种可能的实现方式,还提供了第二方面的第五种可能的实现方式,所述封装单元具体用于将所述第二参数添加至所述业务头。In conjunction with the fourth possible implementation of the foregoing second aspect, a fifth possible implementation manner of the second aspect is further provided, where the encapsulating unit is specifically configured to add the second parameter to the service header.
结合上述第二方面或第二方面的任意一种可能的实现方式,还提供了第二方面的第六种可能的实现方式,所述第一报文中的业务头还包括第三参数,所述第三参数用以标识第一报文为OAM报文;A sixth possible implementation manner of the second aspect, where the service header in the first packet further includes a third parameter, in combination with the foregoing second aspect or any one of the foregoing possible implementation manners. The third parameter is used to identify that the first packet is an OAM packet.
所述报文处理装置还包括:The message processing device further includes:
控制单元,用于确定所述第一报文包括所述第三参数,且转发策略是将来自所述SFE的OAM报文发送至所述SF节点时,控制所述第一转发单元向所述SF节点发送所述第三报文。a control unit, configured to determine that the first packet includes the third parameter, and the forwarding policy is to control the first forwarding unit to send the OAM packet from the SFE to the SF node The SF node sends the third packet.
结合上述第二方面或第二方面的任意一种可能的实现方式,还提供了第二方面的第七种可能的实现方式,所述第一参数为所述路径ID,或者所述第一参数为根据算法对所述路径ID进行处理后获得的数据。A seventh possible implementation manner of the second aspect, the first parameter is the path ID, or the first parameter, in combination with the foregoing second aspect or any one of the foregoing possible implementation manners Data obtained by processing the path ID according to an algorithm.
通过上述方案,本发明实施例提供的报文处理装置剥除第一报文的业务头,获取第二报文。所述报文处理装置可从所述第一报文的业务头中获取路径ID。所述报文处理装置将与所述路径ID对应的第一参数添加至第二报文中, 获取第三报文。所述报文处理装置发送所述第三报文至SF节点。这样,SF节点接收的第三报文不包括业务头,解决了SF节点无法对包括业务头的报文进行处理的问题。Through the foregoing solution, the packet processing apparatus provided by the embodiment of the present invention strips the service header of the first packet and obtains the second packet. The message processing apparatus may obtain a path ID from a service header of the first packet. The packet processing device adds a first parameter corresponding to the path ID to the second packet, Obtain the third message. The message processing apparatus sends the third message to the SF node. In this way, the third packet received by the SF node does not include the service header, and the problem that the SF node cannot process the packet including the service header is solved.
附图说明DRAWINGS
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present invention. Other figures may also be obtained from those of ordinary skill in the art in view of these figures.
图1为一种网络场景示意图。FIG. 1 is a schematic diagram of a network scenario.
图2为本发明实施例提供的一种网络场景示意图。FIG. 2 is a schematic diagram of a network scenario according to an embodiment of the present invention.
图3为本发明实施例提供的报文处理装置的示意图。FIG. 3 is a schematic diagram of a message processing apparatus according to an embodiment of the present invention.
图4为本发明实施例提供的报文处理装置的示意图。FIG. 4 is a schematic diagram of a message processing apparatus according to an embodiment of the present invention.
图5为本发明实施例提供的报文处理方法的流程图。FIG. 5 is a flowchart of a packet processing method according to an embodiment of the present invention.
具体实施方式detailed description
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly described in conjunction with the drawings in the embodiments of the present invention. Some embodiments, rather than all of the embodiments, are invented. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention are within the scope of the present invention.
图1为一种网络场景示意图。图1所示的网络包括service classifier 101、SFE 102和SF节点103。SF节点可具有NAT、防火墙等业务功能中的至少一种功能。图1所示的网络中的一条service chain包括service classifier 101、SFE102和SF节点103。该条service chain上,service classifier 101在接收到的报文1001上封装业务头,获取报文1011。报文1011的所述业务头包括service chain的路径ID和预设ID。预设ID用以标识SF节点103在service chain上 的上一跳SF节点。SFE 102接收来自service classifier 101的报文1011。SFE 102根据报文1011的业务头包括的路径ID和预设ID,确定转发表项。该转发表项包括路径ID、预设ID和出端口。该出端口连接SF节点103。SFE 102通过该出端口,发送报文1011至SF节点103。由于SF节点103无法识别报文1011的业务头,SF节点103无法对报文1011包括的报文1001进行业务处理。FIG. 1 is a schematic diagram of a network scenario. The network shown in FIG. 1 includes a service classifier 101, an SFE 102, and an SF node 103. The SF node may have at least one of service functions such as a NAT and a firewall. A service chain in the network shown in FIG. 1 includes a service classifier 101, an SFE 102, and an SF node 103. On the service chain, the service classifier 101 encapsulates the service header on the received packet 1001 and obtains the packet 1011. The service header of the message 1011 includes a path ID and a preset ID of the service chain. The preset ID is used to identify the SF node 103 on the service chain. The last hop of the SF node. SFE 102 receives message 1011 from service classifier 101. The SFE 102 determines the forwarding entry according to the path ID and the preset ID included in the service header of the packet 1011. The forwarding entry includes a path ID, a preset ID, and an egress port. The egress port is connected to the SF node 103. The SFE 102 transmits the message 1011 to the SF node 103 through the egress port. The SF node 103 cannot perform the service processing on the packet 1001 included in the packet 1011 because the SF node 103 cannot identify the service header of the packet 1011.
针对上述问题,提出了SF节点无法对包括业务头的报文进行处理的解决方法。该方法是在SF节点和SFE之间增加报文处理装置。报文处理装置对接收的报文1011包括的业务头进行处理,使得SF节点103接收到的报文1002不包括业务头。该方法可包括:报文处理装置剥除来自SFE 102的报文1011的业务头,获取报文1001。报文处理装置根据报文1011的业务头包括的路径ID,获取与路径ID对应的第一参数。报文处理装置将第一参数添加至报文1001内,获取报文1002。报文处理装置将报文1002发送至SF节点。由于报文1002不包括业务头,SF节点103能够对报文1002进行业务处理。该解决方法可通过以下几种实施例实现。Aiming at the above problems, a solution to the problem that the SF node cannot process the packet including the service header is proposed. The method is to add a message processing device between the SF node and the SFE. The message processing apparatus processes the service header included in the received message 1011 so that the message 1002 received by the SF node 103 does not include the service header. The method may include the message processing device stripping the service header of the message 1011 from the SFE 102 to obtain the message 1001. The message processing device acquires the first parameter corresponding to the path ID according to the path ID included in the service header of the message 1011. The message processing device adds the first parameter to the message 1001 to obtain the message 1002. The message processing device transmits the message 1002 to the SF node. Since the message 1002 does not include a service header, the SF node 103 can perform service processing on the message 1002. This solution can be implemented by the following embodiments.
图2为本发明实施例提供的一种网络场景示意图。图2所示的网络包括service classifier 101、SFE 102、SF节点103和报文处理装置104。图2所示的网络中的service chain包括service classifier 101、SFE 102、报文处理装置104和SF节点103。所述service chain上,service classifier 101与SFE 102通信;SFE 102与报文处理装置104通信;报文处理装置104与SF节点103通信。若SF节点103是所述service chain上的第一个SF节点,则SF节点103在所述service chain上的上一跳SF节点不存在。若SF节点103并非所述service chain上的第一个SF节点,所述service chain还可包括与报文处理装置104通信的SF节点105。SF节点105是SF节点103在所述service chain上的上一跳SF节点。SFE 102可将报文1010通过报文处理装置104发送至SF节点105,接收SF节点105通过报文处理装置104发送的报文1011。SFE 102再将报文1011通过报文处理装置104发送至SF节点103,使得报文1010在所述service chain上依照SF节点的顺序进行处理。本发明实施例中所述service  chain也可以是业务功能链(英文全称为service function chain)。FIG. 2 is a schematic diagram of a network scenario according to an embodiment of the present invention. The network shown in FIG. 2 includes a service classifier 101, an SFE 102, an SF node 103, and a message processing device 104. The service chain in the network shown in FIG. 2 includes a service classifier 101, an SFE 102, a message processing device 104, and an SF node 103. On the service chain, the service classifier 101 communicates with the SFE 102; the SFE 102 communicates with the message processing device 104; and the message processing device 104 communicates with the SF node 103. If the SF node 103 is the first SF node on the service chain, the SF node 103 does not exist on the previous hop SF node on the service chain. If the SF node 103 is not the first SF node on the service chain, the service chain may also include an SF node 105 in communication with the message processing device 104. The SF node 105 is the last hop SF node of the SF node 103 on the service chain. The SFE 102 can transmit the message 1010 to the SF node 105 via the message processing device 104, and receive the message 1011 sent by the SF node 105 through the message processing device 104. The SFE 102 then transmits the message 1011 to the SF node 103 via the message processing device 104 such that the message 1010 is processed on the service chain in the order of the SF nodes. The service described in the embodiment of the present invention Chain can also be a business function chain (English full service function chain).
图3为本发明实施例提供的一种报文处理装置的示意图。图3所示的报文处理装置可为图2所示网络中的报文处理装置104。图3所示的报文处理装置可部署于service chain上SFE 102和SF节点103之间。或者,图3所示的报文处理装置可与SFE 102部署于同一设备上。又或者,图3所示的报文处理装置可与SF节点103部署于同一设备上。FIG. 3 is a schematic diagram of a message processing apparatus according to an embodiment of the present invention. The message processing apparatus shown in FIG. 3 can be the message processing apparatus 104 in the network shown in FIG. 2. The message processing apparatus shown in FIG. 3 can be deployed between the SFE 102 and the SF node 103 on the service chain. Alternatively, the message processing apparatus shown in FIG. 3 can be deployed on the same device as the SFE 102. Alternatively, the message processing apparatus shown in FIG. 3 can be deployed on the same device as the SF node 103.
图3所示的报文处理装置可以包括:处理器1040、存储器1041和通信接口1042。处理器1040、存储器1041和通信接口1042通过通信总线1043连接。存储器1041用于存储程序,还可以存储映射关系。映射关系为路径ID和第一参数的映射关系。The message processing apparatus shown in FIG. 3 may include a processor 1040, a memory 1041, and a communication interface 1042. The processor 1040, the memory 1041, and the communication interface 1042 are connected by a communication bus 1043. The memory 1041 is used to store programs, and may also store mapping relationships. The mapping relationship is a mapping relationship between the path ID and the first parameter.
处理器1040根据从存储器1041中读取的程序所包括的可执行指令,执行如下操作。The processor 1040 performs the following operations in accordance with executable instructions included in the program read from the memory 1041.
处理器1040通过通信接口1042,接收来自SFE 102的报文1011。报文1011是在报文1001上封装业务头后获取的报文。报文1011的业务头包括service chain的路径ID。The processor 1040 receives the message 1011 from the SFE 102 via the communication interface 1042. The packet 1011 is a packet obtained after the service header is encapsulated in the packet 1001. The service header of the message 1011 includes the path ID of the service chain.
处理器1040从报文1011剥除业务头,获取报文1001和路径ID。The processor 1040 strips the service header from the message 1011 and obtains the message 1001 and the path ID.
处理器1040根据路径ID和报文1001,获取报文1002。报文1002是将存储器1041中保存的与路径ID对应的第一参数添加至报文1001内而获取的报文1002。The processor 1040 obtains the message 1002 according to the path ID and the message 1001. The message 1002 is a message 1002 obtained by adding the first parameter corresponding to the path ID stored in the memory 1041 to the message 1001.
处理器1040通过通信接口1042,向SF节点103发送报文1002。The processor 1040 transmits the message 1002 to the SF node 103 via the communication interface 1042.
可选地,存储器1041中还可保存第一转发表项。存储器104中保存的第一转发表项包括接收报文1011的接口的ID和第一接口的ID。第一接口连接SFE节点103。处理器1040可根据接收报文1011的接口的ID,确定根据第一转发表项发送报文1002。处理器1040可根据第一接口的ID,通过通信接口1042发送报文1002至SF节点103。其中,接收报文1011的接口连接SFE102。Optionally, the first forwarding entry may also be saved in the memory 1041. The first forwarding entry stored in the memory 104 includes an ID of an interface that receives the message 1011 and an ID of the first interface. The first interface is connected to the SFE node 103. The processor 1040 can determine, according to the ID of the interface that receives the message 1011, that the message 1002 is sent according to the first forwarding entry. The processor 1040 can send the message 1002 to the SF node 103 through the communication interface 1042 according to the ID of the first interface. The interface that receives the message 1011 is connected to the SFE 102.
可选地,报文1003包括第一参数。处理器1040通过通信接口1042接收 来自SF节点103的报文1003。处理器1040根据报文1003中包括的第一参数,从存储器1041获取与第一参数对应的路径ID。处理器1040根据路径ID和通过通信接口1042接收到的报文1003,获取报文1013。其中,报文1013是在报文1003上封装业务头后获取的报文。报文1013的业务头包括路径ID。处理器1040通过通信接口1042,向SFE 102发送报文1013。Optionally, the message 1003 includes a first parameter. The processor 1040 receives through the communication interface 1042 Message 1003 from SF node 103. The processor 1040 acquires a path ID corresponding to the first parameter from the memory 1041 according to the first parameter included in the message 1003. The processor 1040 obtains the message 1013 according to the path ID and the message 1003 received through the communication interface 1042. The packet 1013 is a packet obtained after the service header is encapsulated in the packet 1003. The service header of the message 1013 includes the path ID. The processor 1040 transmits a message 1013 to the SFE 102 via the communication interface 1042.
可选地,存储器1041中还可保存第二转发表项。存储器104中保存的第二转发表项包括接收报文1003的接口的ID和第二接口的ID。第二接口连接SFE 102。处理器1040可根据接收报文1003的接口的ID,确定根据第二转发表项发送报文1003。处理器1040可根据第二接口的ID,通过通信接口1042发送报文1003至SFE 102。其中,接收报文1003的接口与SF节点103连接。Optionally, a second forwarding entry may also be saved in the memory 1041. The second forwarding entry stored in the memory 104 includes an ID of an interface that receives the message 1003 and an ID of the second interface. The second interface is connected to the SFE 102. The processor 1040 can determine, according to the ID of the interface that receives the message 1003, that the message 1003 is sent according to the second forwarding entry. The processor 1040 can transmit the message 1003 to the SFE 102 via the communication interface 1042 according to the ID of the second interface. The interface that receives the message 1003 is connected to the SF node 103.
进一步的,处理器1040根据存储器1041中的可执行指令和映射关系,与通信接口1042配合,使图3所示的报文处理装置执行了如图5所示的实施例中的报文处理装置所执行的全部操作。也可以认为,如图3所示的报文处理装置就是如图5所示的实施例中的报文处理装置。Further, the processor 1040 cooperates with the communication interface 1042 according to the executable instructions and the mapping relationship in the memory 1041, so that the message processing apparatus shown in FIG. 3 executes the message processing apparatus in the embodiment shown in FIG. All the operations performed. It is also considered that the message processing apparatus shown in Fig. 3 is the message processing apparatus in the embodiment shown in Fig. 5.
图4为本发明实施例提供的一种报文处理装置的示意图。图4所示的报文处理装置包括:第一接收单元1044、解封装单元1045、第一获取单元1046和第一转发单元1047。可选地,图4对应的实施例提供的报文处理装置还包括:第二接收单元1048、第二获取单元1049、封装单元1050和第二转发单元1051。可选地,图4对应的实施例提供的报文处理装置还包括存储单元1052。存储单元1052可用以保存图3中的存储器1041所保存的映射关系。可选地,图4对应的实施例提供的报文处理装置还包括控制单元1053。FIG. 4 is a schematic diagram of a message processing apparatus according to an embodiment of the present invention. The message processing apparatus shown in FIG. 4 includes a first receiving unit 1044, a decapsulation unit 1045, a first obtaining unit 1046, and a first forwarding unit 1047. Optionally, the packet processing apparatus provided in the embodiment corresponding to FIG. 4 further includes: a second receiving unit 1048, a second obtaining unit 1049, a packaging unit 1050, and a second forwarding unit 1051. Optionally, the packet processing apparatus provided in the embodiment corresponding to FIG. 4 further includes a storage unit 1052. The storage unit 1052 can be used to save the mapping relationship held by the memory 1041 in FIG. Optionally, the packet processing apparatus provided in the embodiment corresponding to FIG. 4 further includes a control unit 1053.
图3所示的报文处理装置和图4所示的报文处理装置可以是同一个装置,例如均为图2所示网络中的报文处理装置104。可以认为,图3从物理的角度显示了一个报文处理装置包括的内容,而图4则从逻辑的角度显示了一个报文处理装置包括的内容。可选地,图4中的第一接收单元1044、第一转发单元1047、第二接收单元1048和第二转发单元1051可以由图3中的通信接口1042来实现,通信接口1042可以包括至少一个物理接口;图4中的解封装单 元1045、第一获取单元1046和封装单元1050可以由图3中的处理器1040根据存储器1041存储的可执行指令或者根据存储器1041存储的可执行指令和映射关系来实现,处理器1040可以包括至少一个物理处理器。The message processing apparatus shown in FIG. 3 and the message processing apparatus shown in FIG. 4 may be the same apparatus, for example, the message processing apparatus 104 in the network shown in FIG. 2. It can be considered that Fig. 3 shows the contents included in a message processing apparatus from a physical point of view, and Fig. 4 shows the contents included in a message processing apparatus from a logical point of view. Optionally, the first receiving unit 1044, the first forwarding unit 1047, the second receiving unit 1048, and the second forwarding unit 1051 in FIG. 4 may be implemented by the communication interface 1042 in FIG. 3, and the communication interface 1042 may include at least one Physical interface; decapsulation list in Figure 4 The element 1045, the first obtaining unit 1046, and the encapsulating unit 1050 may be implemented by the processor 1040 of FIG. 3 according to executable instructions stored by the memory 1041 or according to executable instructions and mapping relationships stored by the memory 1041, and the processor 1040 may include at least A physical processor.
图5为本发明实施例提供的一种报文处理方法流程图。下面结合图2至图4,对本发明实施例提供的报文处理方法进行详细说明。FIG. 5 is a flowchart of a packet processing method according to an embodiment of the present invention. The packet processing method provided by the embodiment of the present invention is described in detail below with reference to FIG. 2 to FIG.
501,SFE 102发送报文1011至报文处理装置104。501. The SFE 102 sends a message 1011 to the message processing device 104.
图2所示的网络场景中,SFE 102可接收service classifier 101发送的报文1010。报文1010可由service classifier 101生成。例如:service classifier 101接收报文1001。service classifier 101根据报文1001所对应的业务类型,确定业务类型对应的service chain的路径ID。service classifier 101在报文1001上封装业务头,获取报文1010。报文1010的业务头包括所述service chain的路径ID。In the network scenario shown in FIG. 2, the SFE 102 can receive the message 1010 sent by the service classifier 101. Message 1010 may be generated by service classifier 101. For example, service classifier 101 receives message 1001. The service classifier 101 determines the path ID of the service chain corresponding to the service type according to the service type corresponding to the message 1001. The service classifier 101 encapsulates the service header in the packet 1001 and obtains the packet 1010. The traffic header of message 1010 includes the path ID of the service chain.
可选地,当service classifier 101和SFE102之间还存在SFE102在所述service chain上的上一跳SFE时,SFE 102接收的报文1010则来自于SFE 102在所述service chain上的所述上一跳SFE。Optionally, when there is a last hop SFE of the SFE 102 on the service chain between the service classifier 101 and the SFE 102, the message 1010 received by the SFE 102 is from the SFE 102 on the service chain. One hop SFE.
可选地,报文1010的业务头中还可包括协议类型、元数据(英文名称为metadata)中的至少一个。metadata可包括向service classifier 101发送报文1001的用户的ID。Optionally, the service header of the packet 1010 may further include at least one of a protocol type and metadata (English name is metadata). The metadata may include the ID of the user who sent the message 1001 to the service classifier 101.
SFE 102可根据报文1010的业务头中的路径ID,确定转发表项。该转发表项包括路径ID和接口的ID。SFE 102可根据接口的ID,发送报文1011至报文处理装置104。其中,该接口可以是SFE 102连接报文处理装置104的接口。或者,该接口可以是SFE 102连接SF节点103的接口。由于报文处理装置104介于SFE 102和SF节点之间,因此在无需对SFE 102中的转发表项进行更新或升级的情况下,就可以实现SFE 102发送报文1011至报文处理装置104。The SFE 102 can determine the forwarding entry according to the path ID in the service header of the packet 1010. The forwarding entry includes a path ID and an ID of the interface. The SFE 102 can send the message 1011 to the message processing device 104 according to the ID of the interface. The interface may be an interface that the SFE 102 connects to the message processing device 104. Alternatively, the interface may be an interface where the SFE 102 connects to the SF node 103. Since the message processing device 104 is interposed between the SFE 102 and the SF node, the SFE 102 can send the message 1011 to the message processing device 104 without updating or upgrading the forwarding entry in the SFE 102. .
SFE 102接收的报文1010与SFE 102发送至报文处理装置104的报文1011可以相同,也可与SFE 102发送至报文处理装置104的报文1011不同。 The message 1010 received by the SFE 102 may be the same as the message 1011 sent by the SFE 102 to the message processing apparatus 104, or may be different from the message 1011 sent by the SFE 102 to the message processing apparatus 104.
502,报文处理装置104获取报文1001和service chain的路径ID。502. The message processing device 104 obtains the path ID of the message 1001 and the service chain.
举例来说,第一接收单元1044接收来自SFE 102的报文1011。解封装单元1045剥除报文1011的业务头,获取报文1001,并从所述业务头中获取所述service chain的路径ID。For example, the first receiving unit 1044 receives the message 1011 from the SFE 102. The decapsulation unit 1045 strips the service header of the message 1011, obtains the message 1001, and obtains the path ID of the service chain from the service header.
SFE 102向SF节点103发送的报文可以为包括所述业务头的报文,解封装单元1045可直接从第一接收单元1044接收到的报文1011中获取报文1001和业务头包括的service chain的路径ID。The packet sent by the SFE 102 to the SF node 103 may be a packet including the service header, and the decapsulation unit 1045 may directly obtain the packet 1001 and the service included in the service header from the packet 1011 received by the first receiving unit 1044. The path ID of the chain.
若报文1011的业务头中还包括协议类型,解封装单元1045还可以将业务头中包含的协议类型写入存储单元1052。存储单元1052中保存的协议类型与路径ID存在对应关系。若报文1011的业务头中还包括metadata,解封装单元1045还可以将业务头中包含的metadata写入存储单元1052。存储单元1052中保存的metadata与路径ID存在对应关系。报文1011的业务头可以包括协议类型和metadata中的任意一个或者全部。If the protocol type is further included in the service header of the packet 1011, the decapsulation unit 1045 may also write the protocol type included in the service header to the storage unit 1052. The protocol type stored in the storage unit 1052 has a correspondence relationship with the path ID. If the header of the message 1011 further includes metadata, the decapsulation unit 1045 may also write the metadata included in the service header to the storage unit 1052. The metadata stored in the storage unit 1052 has a correspondence relationship with the path ID. The service header of the message 1011 may include any or all of the protocol type and the metadata.
503,报文处理装置104通过根据路径ID确定的第一参数对报文1001进行处理,获取报文1002。其中所述处理包括将所述第一参数添加至报文1001内。503. The message processing device 104 processes the message 1001 by using the first parameter determined according to the path ID, and obtains the message 1002. The processing includes adding the first parameter to the message 1001.
第一参数可以是路径ID本身,或者,第一参数可以是根据算法,对路径ID进行处理后获取的数据。所述算法可以是哈希算法或压缩算法。压缩算法用以将大于N位的数据映射成N位数据。N是至少一个字节包含的数据位。The first parameter may be the path ID itself, or the first parameter may be data obtained by processing the path ID according to an algorithm. The algorithm can be a hash algorithm or a compression algorithm. The compression algorithm is used to map data larger than N bits into N-bit data. N is the data bit contained in at least one byte.
第一获取单元1046可以通过将根据路径ID确定的第一参数添加至报文1001内来获取报文1002。将根据路径ID确定的第一参数添加至报文1001内是指将所述第一参数添加至报文1001的内部,而不是指为报文1001增加一个外层报文头,并将所述第一参数添加至新增的外层报文头中。可选地,第一获取单元1046可从存储单元1052保存的路径ID和第一参数的映射关系中,获取路径ID对应的第一参数。The first obtaining unit 1046 may acquire the message 1002 by adding the first parameter determined according to the path ID to the message 1001. Adding the first parameter determined according to the path ID to the message 1001 means adding the first parameter to the inside of the message 1001, instead of adding an outer message header to the message 1001, and The first parameter is added to the newly added outer header. Optionally, the first obtaining unit 1046 may obtain the first parameter corresponding to the path ID from the mapping relationship between the path ID and the first parameter saved by the storage unit 1052.
可选地,第一获取单元1046可将第一参数添加至报文1001中的预设字段。预设字段是SF节点103在对报文1002进行业务处理时不会被修改的字 段中的至少一个字段。其中,预设字段的个数可根据第一参数所占的字节数确定。若第一参数是路径ID,且路径ID是8位,第一获取单元1046可从报文1001中选择一个字段保存路径ID。若第一参数是路径ID,且路径ID大于8位,第一获取单元1046可从报文1001中选择多个字段来保存路径ID。若第一参数是根据算法对路径ID进行处理而获取的数据,第一获取单元1046可按照上述在报文1001中保存路径ID的方法,在报文1001中选择一个或多个字段保存第一参数。报文1001中被选择的一个或多个字段是SF节点103对报文1002进行业务处理过程中不会被修改的字段。Optionally, the first obtaining unit 1046 may add the first parameter to a preset field in the message 1001. The preset field is a word that the SF node 103 does not modify when performing service processing on the message 1002. At least one field in the segment. The number of preset fields may be determined according to the number of bytes occupied by the first parameter. If the first parameter is a path ID and the path ID is 8 bits, the first obtaining unit 1046 may select a field from the message 1001 to save the path ID. If the first parameter is a path ID and the path ID is greater than 8 bits, the first obtaining unit 1046 may select a plurality of fields from the message 1001 to save the path ID. If the first parameter is data obtained by processing the path ID according to the algorithm, the first obtaining unit 1046 may select one or more fields in the message 1001 to save the first according to the method of saving the path ID in the message 1001. parameter. The selected one or more fields in the message 1001 are fields that the SF node 103 does not modify during the service processing of the message 1002.
举例来说,预设字段可以是虚拟局域网(英文全称为Virtual Local Area Network,英文缩写为VLAN)字段。若报文1001为IPv4报文,则预设字段还可以是IPv4报文的服务类型(英文全称为type of service,英文缩写为TOS)字段和生存时间(英文全称为time to live,英文缩写为TTL)字段中的一个或多个字段。若报文1001为IPv6报文,则预设字段还可以是IPv6报文的流类型(英文名称为traffic class)字段、跳数限制(英文名称为hop limit)字段和流标记(英文名称为Flow Label)字段中的一个或多个字段。以SF节点103处理报文1002报文时会修改Time-To-Live字段为例,第一获取单元1046预存有SF节点103的配置信息。SF节点103的配置信息为SF节点103进行业务处理时可修改Time-To-Live字段。第一获取单元1046根据SF节点103的配置信息,将第一参数添加至Type-of-Service字段,使得SF节点103在处理报文1002的过程中保留路径ID对应的第一参数。For example, the preset field may be a virtual local area network (English name is Virtual Local Area Network, abbreviated as VLAN) field. If the packet 1001 is an IPv4 packet, the default field may also be a service type of the IPv4 packet (English name is service, the English abbreviation is TOS) field and the survival time (English is called time to live, the English abbreviation is One or more fields in the TTL) field. If the packet 1001 is an IPv6 packet, the default field may be a stream type of the IPv6 packet (the English name is a traffic class) field, a hop limit (English name is a hop limit) field, and a stream tag (the English name is Flow). Label One or more fields in the field. When the SF node 103 processes the packet 1002, the Time-To-Live field is modified. The first obtaining unit 1046 pre-stores the configuration information of the SF node 103. The configuration information of the SF node 103 can modify the Time-To-Live field when the SF node 103 performs service processing. The first obtaining unit 1046 adds the first parameter to the Type-of-Service field according to the configuration information of the SF node 103, so that the SF node 103 retains the first parameter corresponding to the path ID in the process of processing the message 1002.
以路径ID为24位数据为例,第一获取单元1046可将24位的路径ID映射成8位的第一参数保存于报文1001的一个字段中。可选地,若存储单元1052保存的映射关系中未包括路径ID对应的第一参数,第一获取单元1046可从8位数据的数值范围内,选择一个未被使用的数值作为第一参数。第一获取单元1046可将与路径ID对应的第一参数存储至存储单元1052。Taking the path ID as 24-bit data as an example, the first obtaining unit 1046 can map the 24-bit path ID to the 8-bit first parameter and store it in a field of the message 1001. Optionally, if the first parameter corresponding to the path ID is not included in the mapping relationship saved by the storage unit 1052, the first obtaining unit 1046 may select an unused value as the first parameter from the value range of the 8-bit data. The first obtaining unit 1046 may store the first parameter corresponding to the path ID to the storage unit 1052.
需要指出的是,第一获取单元1046也可以将第一参数添加至报文1001中的非预设字段中,而不是必须将第一参数添加至所述预设字段中,其中非 预设字段是指SF节点103在对报文1002进行业务处理时会被修改的字段。当第一参数被添加至报文1001中的所述非预设字段中时,SF节点103在对报文1002进行业务处理的过程中,可以先读出第一参数,再对所述非预设字段进行修改,并且将所述第一参数添加回修改后的所述非预设字段或者报文1001的另一个非预设字段。只要报文处理装置104获知添加在非预设字段中的第一参数的规则,就可以保证SF节点103添加在非预设字段中的第一参数仍然可以被SFE102识别。It should be noted that the first obtaining unit 1046 may also add the first parameter to the non-preset field in the message 1001 instead of adding the first parameter to the preset field, where The preset field refers to a field that the SF node 103 will modify when performing service processing on the message 1002. When the first parameter is added to the non-preset field in the message 1001, the SF node 103 may first read the first parameter in the process of performing service processing on the message 1002, and then The field is modified, and the first parameter is added back to the modified non-preset field or another non-preset field of the message 1001. As long as the message processing device 104 learns the rules of the first parameter added in the non-preset field, it can be ensured that the first parameter added by the SF node 103 in the non-preset field can still be recognized by the SFE 102.
若报文1002中的个别字段被修改或删除,或者为报文1002增加一个或几个字段,但并没有改变报文1002的主要功能和属性,那么这种被修改的报文1002在本实施例中仍被认为是通过第一参数对报文1001处理后获取的报文1002。If the individual fields in the message 1002 are modified or deleted, or one or more fields are added to the message 1002, but the main functions and attributes of the message 1002 are not changed, then the modified message 1002 is implemented in the present embodiment. The example is still considered to be the message 1002 obtained after processing the message 1001 by the first parameter.
504,报文处理装置104发送报文1002至SF节点103。504. The message processing device 104 sends the message 1002 to the SF node 103.
举例来说,可以由第一转发单元1047发送报文1002至SF节点103。For example, the message 1002 to the SF node 103 can be transmitted by the first forwarding unit 1047.
第一转发单元1047可以根据第一转发表项转发报文1002。第一转发表项可以包括接收报文1011的接口的ID和第一接口的ID,其中接收报文1011的接口连接SFE 102,第一接口连接SF节点103。第一转发单元1047具体根据接收报文1011的接口的ID,确定根据第一转发表项发送报文1002。The first forwarding unit 1047 can forward the message 1002 according to the first forwarding entry. The first forwarding entry may include an ID of the interface that receives the message 1011 and an ID of the first interface, where the interface of the received message 1011 is connected to the SFE 102, and the first interface is connected to the SF node 103. The first forwarding unit 1047 determines that the packet 1002 is sent according to the first forwarding entry according to the ID of the interface that receives the packet 1011.
可选地,第一转发表项除了包括接收报文1011的接口的ID和第一接口的ID之外,还可以包括路径ID。在这种情况下,第一转发单元1047具体根据接收报文1011的接口的ID和接收报文1011的接口的ID,确定根据第一转发表项发送报文1002。Optionally, the first forwarding entry may include a path ID in addition to the ID of the interface that receives the message 1011 and the ID of the first interface. In this case, the first forwarding unit 1047 determines to send the message 1002 according to the first forwarding entry according to the ID of the interface that receives the message 1011 and the ID of the interface that receives the message 1011.
可选地,第一转发表项除了包括接收报文1011的接口的ID和第一接口的ID之外,还可以包括第一参数。在这种情况下,第一转发单元1047具体根据第一参数和接收报文1011的接口的ID,确定根据第一转发表项发送报文1002。Optionally, the first forwarding entry may include a first parameter in addition to the ID of the interface that receives the message 1011 and the ID of the first interface. In this case, the first forwarding unit 1047 determines to send the message 1002 according to the first forwarding entry according to the first parameter and the ID of the interface of the received message 1011.
在确定根据第一转发表项发送报文1002后,第一转发单元1047根据第一接口,发送报文1002至SF节点103。 After determining that the message 1002 is sent according to the first forwarding entry, the first forwarding unit 1047 sends the message 1002 to the SF node 103 according to the first interface.
502至504的方法为报文处理装置104对发送至SF节点103的报文1011进行处理的方法。报文处理装置104将对报文1011进行上述处理后,剥掉了所述业务头,获取到报文1002。SF节点103可以对未封装有所述业务头的报文1002进行识别和处理。The method of 502 to 504 is a method in which the message processing device 104 processes the message 1011 transmitted to the SF node 103. The message processing device 104 performs the above processing on the message 1011, and then strips the service header and acquires the message 1002. The SF node 103 can identify and process the message 1002 that is not encapsulated with the service header.
下述505至507为报文处理装置104对SF节点103发送至SFE 102的报文1003进行处理的方法。报文1003为SF节点103对报文1002进行业务处理后获得的报文。报文1003保存路径ID的字段与报文1002保存路径ID的字段相同。下述505至507为可选地步骤。The following 505 to 507 are methods in which the message processing apparatus 104 processes the message 1003 transmitted by the SF node 103 to the SFE 102. The message 1003 is a message obtained after the SF node 103 performs service processing on the message 1002. The field in which the message 1003 holds the path ID is the same as the field in which the message 1002 holds the path ID. The following 505 to 507 are optional steps.
505,SF节点103发送报文1003至报文处理装置104。505. The SF node 103 sends a message 1003 to the message processing device 104.
SF节点103可通过接收报文1002的接口,发送报文1003至报文处理装置104。或者,SF节点103上保存有转发表项。该转发表项包括第一参数和连接报文处理装置104的接口的ID。SF节点103根据报文1002中的第一参数,获取转发表项包括的连接报文处理装置104的接口的ID。SF节点103根据连接报文处理装置104的接口的ID,发送报文1003至报文处理装置104。The SF node 103 can transmit the message 1003 to the message processing device 104 by receiving the interface of the message 1002. Alternatively, the forwarding entry is stored on the SF node 103. The forwarding entry includes a first parameter and an ID of an interface to which the message processing device 104 is connected. The SF node 103 acquires the ID of the interface of the connection message processing device 104 included in the forwarding entry according to the first parameter in the message 1002. The SF node 103 transmits the message 1003 to the message processing device 104 based on the ID of the interface to which the message processing device 104 is connected.
506,报文处理装置104通过根据路径ID对报文1003进行处理,获取报文1013。其中所述处理包括使用与路径ID对应的所述业务头对报文1003进行封装。506. The message processing device 104 obtains the message 1013 by processing the message 1003 according to the path ID. The processing includes encapsulating the packet 1003 by using the service header corresponding to the path ID.
举例来说,第二接收单元1048接收来自SF节点103的报文1003。报文1003包括第一参数。第二获取单元1049根据接收到的报文1003包括的第一参数,获取与第一参数对应的路径ID。封装单元1050在报文1003上封装所述业务头,获取报文1013。报文1013的所述业务头包括路径ID。可选地,第二获取单元1049可从存储单元1052中获取第一参数对应的路径ID。For example, the second receiving unit 1048 receives the message 1003 from the SF node 103. The message 1003 includes a first parameter. The second obtaining unit 1049 acquires a path ID corresponding to the first parameter according to the first parameter included in the received message 1003. The encapsulating unit 1050 encapsulates the service header on the packet 1003 to obtain the packet 1013. The service header of the message 1013 includes a path ID. Optionally, the second obtaining unit 1049 may obtain the path ID corresponding to the first parameter from the storage unit 1052.
第二获取单元1049获取的报文1013的业务头与报文1011的业务头相同。例如:若502中报文1011的业务头携带协议类型,则第二获取单元1049可根据路径ID,从存储单元1052中获取与路径ID对应的协议类型,并将协议类型添加至报文1013的业务头。若502中报文1011的业务头携带协议类型和metadata,则第二获取单元1049可根据路径ID,从存储单元1052中获取 与路径ID对应的协议类型和metadata,并将协议类型和metadata添加至报文1013的业务头。The service header of the packet 1013 obtained by the second obtaining unit 1049 is the same as the traffic header of the packet 1011. For example, if the service header of the packet 1011 in 502 carries the protocol type, the second obtaining unit 1049 may obtain the protocol type corresponding to the path ID from the storage unit 1052 according to the path ID, and add the protocol type to the packet 1013. Business head. If the service header of the packet 1011 in 502 carries the protocol type and the metadata, the second obtaining unit 1049 may obtain the information from the storage unit 1052 according to the path ID. The protocol type and metadata corresponding to the path ID, and the protocol type and metadata are added to the service header of the message 1013.
若报文1003中的个别字段被修改或删除,或者为报文1003增加一个或几个字段,但并没有改变报文1003的主要功能和属性,那么这种被修改的报文1003在本实施例中仍被认为是所述报文1003。If the individual fields in the message 1003 are modified or deleted, or one or more fields are added to the message 1003, but the main functions and attributes of the message 1003 are not changed, then the modified message 1003 is implemented in the present embodiment. The example is still considered to be the message 1003.
507,报文处理装置104发送报文1013至SFE 102。507. The message processing device 104 transmits the message 1013 to the SFE 102.
第二转发单元1051向SFE 102发送报文1013。The second forwarding unit 1051 transmits a message 1013 to the SFE 102.
举例来说,第二转发单元1051可以根据第二转发表项转发报文1013。第二转发表项包括接收报文1003的接口的ID和第二接口的ID。第二转发单元1051可根据接收报文1003的接口的ID,确定根据第二转发表项发送报文1013至SFE 102。第二转发单元1051可具体根据第二接口,向SFE 102发送报文1013。第二接口连接SFE 102。可选地,第二表项可保存于存储单元1052。For example, the second forwarding unit 1051 can forward the message 1013 according to the second forwarding entry. The second forwarding entry includes an ID of an interface that receives the message 1003 and an ID of the second interface. The second forwarding unit 1051 may determine to send the message 1013 to the SFE 102 according to the second forwarding entry according to the ID of the interface that receives the message 1003. The second forwarding unit 1051 may send the message 1013 to the SFE 102 according to the second interface. The second interface is connected to the SFE 102. Optionally, the second entry may be saved in the storage unit 1052.
可选地,接收报文1003的接口连接SF节点103。第二转发单元1049可根据接收报文1003的接口的ID,确定报文1003来自于SF节点103。第二转发单元1049可通过接收报文1011的接口,发送报文1013至SFE 102,以减少转发表项的查找。Optionally, the interface receiving the message 1003 is connected to the SF node 103. The second forwarding unit 1049 can determine that the message 1003 is from the SF node 103 according to the ID of the interface that receives the message 1003. The second forwarding unit 1049 can send the message 1013 to the SFE 102 by receiving the interface of the message 1011 to reduce the lookup of the forwarding entry.
由于报文1013来自于SF节点103,而SF节点103是附着于SFE 102的,因此报文处理装置104可以将任意确定为来自SF节点103的报文转发至SFE102。Since the message 1013 is from the SF node 103 and the SF node 103 is attached to the SFE 102, the message processing device 104 can forward any message determined to be from the SF node 103 to the SFE 102.
为了实现准确地转发报文,service classifier 101在生成报文1011的过程中,可在报文1011的业务头中添加第二参数。第二参数用以标识service chain上的SF节点103或service chain上SF节点103的上一跳SF节点。本发明实施例中提及的第二参数可以是字符、字符串、名称或索引(英文名称为index)等信息。In order to accurately forward the message, the service classifier 101 may add a second parameter to the service header of the message 1011 in the process of generating the message 1011. The second parameter is used to identify the SF node 103 on the service chain or the last hop SF node of the SF node 103 on the service chain. The second parameter mentioned in the embodiment of the present invention may be information such as a character, a character string, a name, or an index (English name is index).
502和503之间还可包括:第一获取单元1046还将报文1011的业务头包括的第二参数保存于存储单元1052。存储单元1052中的第二参数与路径ID对应。 Between 502 and 503, the first obtaining unit 1046 also stores the second parameter included in the service header of the message 1011 in the storage unit 1052. The second parameter in the storage unit 1052 corresponds to the path ID.
第一转发表项还包括第二参数。504中的第一转发单元1047具体根据第二参数和接收报文1011的接口的ID,确定根据第一转发表项发送报文1002。The first forwarding entry further includes a second parameter. The first forwarding unit 1047 of the 504 determines to send the message 1002 according to the first forwarding entry according to the second parameter and the ID of the interface of the received message 1011.
505和506之间还可包括:第二获取单元1049还根据获取的路径ID,从存储单元1052中获取路径ID对应的第二参数。封装单元1050还将第二参数添加至报文1013的业务头中。Between 505 and 506, the second obtaining unit 1049 further acquires the second parameter corresponding to the path ID from the storage unit 1052 according to the acquired path ID. Encapsulation unit 1050 also adds a second parameter to the traffic header of message 1013.
上述实施例中,若报文处理装置104连接有与SF节点103相似的一个或多个SF节点,报文处理装置104可根据第二参数确定接收报文1002的SF节点103,有助于提高转发的准确性。In the above embodiment, if the message processing device 104 is connected to one or more SF nodes similar to the SF node 103, the message processing device 104 can determine the SF node 103 that receives the message 1002 according to the second parameter, which is helpful to improve. The accuracy of forwarding.
当报文处理装置104连接有另一条service chain上的SF节点,所述另一条service chain上的SF节点在所述另一条service chain上的上一跳SF节点为SF节点105,且第二参数用以标识SF节点105时,报文处理装置104可根据路径ID来确定转发表项。When the message processing device 104 is connected to the SF node on another service chain, the SF node on the other service chain is the SF node 105 on the last hop node on the other service chain, and the second parameter When the SF node 105 is used to identify the forwarding entry, the packet processing device 104 can determine the forwarding entry according to the path ID.
502和503之间还可包括:第一获取单元1046将报文1011的业务头包括的路径ID和第二参数保存于存储单元1052。Between 502 and 503, the first obtaining unit 1046 saves the path ID and the second parameter included in the service header of the message 1011 in the storage unit 1052.
举例来说,若第一转发表项还包括路径ID和第二参数。504中的第一转发单元1047可根据第二参数、路径ID和接收报文1011的接口的ID,确定根据第一转发表项发送报文1002。若第一转发表项还包括第一参数和第二参数。504中的第一转发单元1047可根据第二参数、第一参数和接收报文1011的接口的ID,确定根据第一转发表项发送报文1002。For example, if the first forwarding entry further includes a path ID and a second parameter. The first forwarding unit 1047 in the 504 may determine to send the message 1002 according to the first forwarding entry according to the second parameter, the path ID, and the ID of the interface that receives the message 1011. The first forwarding entry further includes a first parameter and a second parameter. The first forwarding unit 1047 in the 504 may determine to send the message 1002 according to the first forwarding entry according to the second parameter, the first parameter, and the ID of the interface of the received message 1011.
505和506之间还可包括:第二获取单元1049还根据获取的路径ID,从存储单元1052中获取路径ID对应的第二参数。封装单元1050还将第二参数添加至报文1013的业务头中。Between 505 and 506, the second obtaining unit 1049 further acquires the second parameter corresponding to the path ID from the storage unit 1052 according to the acquired path ID. Encapsulation unit 1050 also adds a second parameter to the traffic header of message 1013.
可选地,本发明上述实施例提及的报文1011的业务头还可包括第三参数。第三参数用以标识报文1011为OAM报文。504之前还包括:当报文处理装置104确定报文1011包括第三参数,且转发策略是将来自SFE 102的OAM报文发送至SF节点103时,向SF节点103发送报文1002。具体地,报文处理装置104包括的控制单元1053确定解封装单元1045从报文1011剥除的业 务头包括第三参数,且转发策略是将来自SFE 102的OAM报文发送至SF节点103时,控制第一转发单元1047向SF节点103发送报文1002。Optionally, the service header of the message 1011 mentioned in the foregoing embodiment of the present invention may further include a third parameter. The third parameter is used to identify that the packet 1011 is an OAM packet. The 504 further includes: when the message processing device 104 determines that the message 1011 includes the third parameter, and the forwarding policy is to send the OAM message from the SFE 102 to the SF node 103, the message 1002 is sent to the SF node 103. Specifically, the control unit 1053 included in the message processing apparatus 104 determines the industry that the decapsulation unit 1045 strips from the message 1011. The service header includes a third parameter, and when the forwarding policy is to send the OAM message from the SFE 102 to the SF node 103, the first forwarding unit 1047 is controlled to send the message 1002 to the SF node 103.
本发明上述实施例中提及的接口可以是物理接口、逻辑接口或隧道的接口。若本发明的上述实施例中提及的接口为隧道的接口,报文处理装置104需分别与SFE 102和SF节点103建立隧道。本发明上述实施例中提及接口的ID属于接口的标识,本发明实施例中的接口的标识还可以是其他形式表示的标识信息。The interface mentioned in the above embodiments of the present invention may be an interface of a physical interface, a logical interface or a tunnel. If the interface mentioned in the above embodiment of the present invention is an interface of a tunnel, the message processing apparatus 104 needs to establish a tunnel with the SFE 102 and the SF node 103, respectively. The ID of the interface mentioned in the foregoing embodiment of the present invention belongs to the identifier of the interface, and the identifier of the interface in the embodiment of the present invention may also be identifier information represented by other forms.
上述通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器。结合本发明实施例所公开的方法的步骤,可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。当使用软件实现时,可以将实现上述功能的代码存储在计算机可读介质中。计算机可读介质包括计算机存储介质。存储介质可以是计算机能够存取的任何可用介质。以此为例但不限于:计算机可读介质可以是随机存取存储器(英文全称为random access memory,英文缩写为RAM)、只读存储器(英文全称为read-only memory,英文缩写为ROM)、电可擦可编程只读存储器(英文全称为electrically erasable programmable read-only memory,英文缩写为EEPROM)、只读光盘(英文全称为compact disc read-only memory,英文缩写为CD-ROM)或其他光盘存储、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的程序代码并能够由计算机存取的任何其他介质。计算机可读介质可以是压缩光碟(英文全称为compact disc,英文缩写为CD)、激光碟、数字视频光碟(英文全称为digital video disc,英文缩写为DVD)、软盘或者蓝光碟。The above general purpose processor may be a microprocessor or the processor or any conventional processor. The steps of the method disclosed in the embodiment of the present invention may be directly implemented as a hardware processor, or may be performed by a combination of hardware and software modules in the processor. When implemented in software, the code implementing the above functions may be stored in a computer readable medium. Computer readable media includes computer storage media. A storage medium may be any available media that can be accessed by a computer. For example, but not limited to: the computer readable medium may be a random access memory (English full name is random access memory, abbreviated as RAM), read-only memory (English full name is read-only memory, English abbreviation for ROM), Electrical erasable programmable read-only memory (English full name electrically erasable programmable read-only memory, abbreviated as EEPROM), read-only optical disc (English full name compact disc read-only memory, English abbreviation for CD-ROM) or other disc A storage, magnetic storage medium or other magnetic storage device, or any other medium that can be used to carry or store program code in the form of an instruction or data structure and that can be accessed by a computer. The computer readable medium may be a compact disc (English full name compact disc, abbreviated as CD), a laser disc, a digital video disc (English full name digital video disc, abbreviated as DVD), a floppy disk or a Blu-ray disc.
最后应说明的是:以上实施例仅用以示例性说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明及本发明带来的有益效果进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明权利要求的范围。 Finally, it should be noted that the above embodiments are only used to exemplify the technical solutions of the present invention, and are not limited thereto; although the beneficial effects brought by the present invention and the present invention are described in detail with reference to the foregoing embodiments, the field It should be understood by those skilled in the art that the technical solutions described in the foregoing embodiments may be modified or equivalently replaced with some of the technical features; and such modifications or substitutions do not deviate from the essence of the corresponding technical solutions. The scope of the claims.

Claims (16)

  1. 一种报文处理方法,其特征在于,所述方法包括:A packet processing method, characterized in that the method comprises:
    报文处理装置接收来自业务转发实体SFE的第一报文,所述第一报文包括第二报文和封装在所述第二报文上的业务头,所述第一报文中的所述业务头包括业务链的路径标识ID;The packet processing apparatus receives the first packet from the service forwarding entity SFE, where the first packet includes a second packet and a service header encapsulated in the second packet, where the first packet is included The service header includes a path identifier ID of the service chain;
    所述报文处理装置获取所述第二报文和所述路径ID;The message processing apparatus acquires the second packet and the path ID;
    所述报文处理装置通过根据所述路径ID对所述第二报文进行处理,获取第三报文,其中,对所述第二报文进行的处理包括:将第一参数添加至所述第二报文内,所述第一参数为根据所述路径ID确定的参数;The packet processing apparatus processes the second packet according to the path ID to obtain a third packet, where the processing of the second packet includes: adding a first parameter to the In the second packet, the first parameter is a parameter determined according to the path ID;
    所述报文处理装置向业务功能SF节点发送所述第三报文。The message processing apparatus sends the third message to a service function SF node.
  2. 如权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1 wherein the method further comprises:
    所述报文处理装置接收来自所述SF节点的第四报文,所述第四报文包括所述第一参数;The message processing apparatus receives a fourth packet from the SF node, where the fourth packet includes the first parameter;
    所述报文处理装置根据所述第四报文中包括的所述第一参数,获取所述路径ID;The packet processing device acquires the path ID according to the first parameter included in the fourth packet;
    所述报文处理装置通过根据所述报文处理装置在接收到所述第四报文后获取的所述路径ID对所述第四报文进行处理,获取第五报文,其中,所述对所述第四报文的处理包括:根据所述路径ID确定所述业务头,用所述业务头对所述第四报文进行封装;The message processing apparatus acquires the fifth packet by processing the fourth packet according to the path ID obtained by the packet processing apparatus after receiving the fourth packet, where the The processing of the fourth packet includes: determining the service header according to the path ID, and encapsulating the fourth packet by using the service header;
    所述报文处理装置向所述SFE发送所述第五报文。The message processing apparatus sends the fifth message to the SFE.
  3. 如权利要求2所述的方法,其特征在于,所述报文处理装置向业务功能SF节点发送所述第三报文包括:The method of claim 2, wherein the sending, by the message processing device, the third message to the service function SF node comprises:
    所述报文处理装置根据接收所述第一报文的接口的标识,确定根据转发表项转发所述第三报文,所述转发表项包括所述接收所述第一报文的接口的标识和第一接口的标识;The packet processing device determines, according to the identifier of the interface that receives the first packet, that the third packet is forwarded according to the forwarding entry, where the forwarding entry includes the interface that receives the first packet. The identifier and the identifier of the first interface;
    所述报文处理装置通过所述第一接口,向所述SF节点发送所述第三报文。 The packet processing apparatus sends the third packet to the SF node by using the first interface.
  4. 如权利要求3所述的方法,其特征在于,所述转发表项还包括所述路径ID;The method of claim 3, wherein the forwarding entry further comprises the path ID;
    所述报文处理装置根据接收所述第一报文的接口的标识,确定根据转发表项转发所述第三报文,包括:The packet processing apparatus determines, according to the identifier of the interface that receives the first packet, that the third packet is forwarded according to the forwarding entry, and includes:
    所述报文处理装置根据所述路径ID和所述接收所述第一报文的接口的标识,确定根据所述转发表项转发所述第三报文。The packet processing apparatus determines, according to the path ID and the identifier of the interface that receives the first packet, that the third packet is forwarded according to the forwarding entry.
  5. 如权利要求3所述的方法,其特征在于,所述转发表项还包括第二参数,所述第二参数用以标识所述SF节点或所述SF节点在所述业务链上的上一跳SF节点;The method of claim 3, wherein the forwarding entry further comprises a second parameter, the second parameter is used to identify a previous one of the SF node or the SF node on the service chain. Jump SF node;
    当所述第一报文中的业务头包括所述第二参数,所述报文处理装置根据接收所述第一报文的接口的标识,确定根据转发表项转发所述第三报文,包括:When the service header in the first packet includes the second parameter, the packet processing apparatus determines, according to the identifier of the interface that receives the first packet, that the third packet is forwarded according to the forwarding entry. include:
    所述报文处理装置根据所述第一报文中携带的所述第二参数和所述接收所述第一报文的接口的标识,确定根据所述转发表项转发所述第三报文。The packet processing apparatus determines to forward the third packet according to the forwarding entry according to the second parameter carried in the first packet and the identifier of the interface that receives the first packet. .
  6. 如权利要求5所述的方法,其特征在于,所述用所述业务头对所述第四报文进行封装包括:The method according to claim 5, wherein the encapsulating the fourth packet by using the service header comprises:
    所述报文处理装置将所述第二参数添加至所述业务头。The message processing apparatus adds the second parameter to the traffic header.
  7. 如权利要求1至6任一所述的方法,其特征在于,所述第一报文中的业务头还包括第三参数,所述第三参数用以标识所述第一报文为操作、管理和维护OAM报文;The method according to any one of claims 1 to 6, wherein the service header in the first packet further includes a third parameter, and the third parameter is used to identify that the first packet is an operation, Manage and maintain OAM packets;
    所述报文处理装置向业务功能SF节点发送所述第三报文之前,所述方法还包括:Before the packet processing apparatus sends the third packet to the service function SF node, the method further includes:
    当所述报文处理装置确定所述第一报文包括所述第三参数,且转发策略是将来自所述SFE的OAM报文发送至所述SF节点时,向所述SF节点发送所述第三报文。When the packet processing apparatus determines that the first packet includes the third parameter, and the forwarding policy is to send an OAM packet from the SFE to the SF node, send the Third message.
  8. 如权利要求1至7任一所述的方法,其特征在于,所述第一参数为所述路径ID,或者所述第一参数为根据算法对所述路径ID进行处理后获得的数 据。The method according to any one of claims 1 to 7, wherein the first parameter is the path ID, or the first parameter is a number obtained by processing the path ID according to an algorithm. according to.
  9. 一种报文处理装置,其特征在于,所述报文处理装置包括:A message processing apparatus, characterized in that the message processing apparatus comprises:
    第一接收单元,用于接收来自业务转发实体SFE的第一报文,所述第一报文为在第二报文上封装业务头后获取的报文,所述第一报文中的所述业务头包括业务链的路径标识ID;a first receiving unit, configured to receive a first packet from the service forwarding entity SFE, where the first packet is a packet obtained after the service header is encapsulated in the second packet, where the first packet is The service header includes a path identifier ID of the service chain;
    解封装单元,用于获取所述第二报文和所述路径ID;Decapsulating unit, configured to acquire the second packet and the path ID;
    第一获取单元,用于通过根据所述路径ID对所述第二报文进行处理,获取第三报文,其中,所述第一获取单元对所述第二报文进行的处理包括:所述第一获取单元将第一参数添加至所述第二报文内,所述第一参数为根据所述路径ID确定的参数;a first acquiring unit, configured to process the second packet according to the path ID, to obtain a third packet, where the processing performed by the first acquiring unit on the second packet includes: The first obtaining unit adds a first parameter to the second packet, where the first parameter is a parameter determined according to the path ID;
    第一转发单元,用于向业务功能SF节点发送所述第三报文。The first forwarding unit is configured to send the third packet to the service function SF node.
  10. 如权利要求9所述的装置,其特征在于,所述装置还包括:The device of claim 9 wherein said device further comprises:
    第二接收单元,用于接收来自所述SF节点的第四报文,所述第四报文包括所述第一参数;a second receiving unit, configured to receive a fourth packet from the SF node, where the fourth packet includes the first parameter;
    第二获取单元,用于根据所述第四报文包括的所述第一参数,获取所述路径ID;a second acquiring unit, configured to acquire the path ID according to the first parameter included in the fourth packet;
    封装单元,用于通过根据所述报文处理装置在接收到所述第四报文后获取的所述路径ID对所述第四报文进行处理,获取第五报文,其中,所述封装单元对所述第四报文的处理包括:所述封装单元根据所述路径ID确定所述业务头,用所述业务头对所述第四报文进行封装;An encapsulating unit, configured to process the fourth packet according to the path ID obtained by the packet processing device after receiving the fourth packet, to obtain a fifth packet, where the encapsulation The processing of the fourth packet by the unit includes: the encapsulating unit determines the service header according to the path ID, and encapsulates the fourth packet by using the service header;
    第二转发单元,用于向所述SFE发送所述第五报文。The second forwarding unit is configured to send the fifth packet to the SFE.
  11. 如权利要求10所述的装置,其特征在于,The device of claim 10 wherein:
    所述第一转发单元具体用于根据所述第一接收单元接收所述第一报文的接口的标识,确定转发表项转发所述第三报文,所述转发表项包括所述接收所述第一报文的接口的标识和第一接口的标识;The first forwarding unit is configured to: according to the identifier of the interface that the first receiving unit receives the first packet, determine that the forwarding entry forwards the third packet, where the forwarding entry includes the receiving station The identifier of the interface of the first packet and the identifier of the first interface;
    所述第一转发单元具体用于通过所述第一接口,向所述SF节点发送所述第三报文。 The first forwarding unit is specifically configured to send the third packet to the SF node by using the first interface.
  12. 如权利要求11所述的装置,其特征在于,所述转发表项还包括所述路径ID;The apparatus according to claim 11, wherein the forwarding entry further includes the path ID;
    所述第一转发单元具体用于根据所述路径ID和所述第一接收单元接收所述第一报文的接口的标识,确定根据所述转发表项转发所述第三报文。The first forwarding unit is configured to determine, according to the path ID and the identifier of the interface that the first receiving unit receives the first packet, to forward the third packet according to the forwarding entry.
  13. 如权利要求11所述的装置,其特征在于,所述转发表项还包括第二参数,所述第二参数用以标识所述SF节点或所述SF节点在所述业务链上的上一跳SF节点;The apparatus according to claim 11, wherein the forwarding entry further comprises a second parameter, the second parameter is used to identify a previous one of the SF node or the SF node on the service chain. Jump SF node;
    当所述第一报文的业务头包括所述第二参数,所述第一转发单元具体用于根据所述第一报文中携带的所述第二参数和所述第一接收单元接收所述第一报文的接口的标识,确定根据所述转发表项转发所述第三报文。When the service header of the first packet includes the second parameter, the first forwarding unit is configured to receive, according to the second parameter carried in the first packet, the first receiving unit The identifier of the interface of the first packet is determined, and the third packet is forwarded according to the forwarding entry.
  14. 如权利要求13所述的装置,其特征在于,The device of claim 13 wherein:
    所述封装单元具体用于将所述第二参数添加至所述业务头。The encapsulating unit is specifically configured to add the second parameter to the service header.
  15. 如权利要求9至14任一所述的装置,其特征在于,所述第一报文中的业务头还包括第三参数,所述第三参数用以标识第一报文为操作、管理和维护OAM报文;The device according to any one of claims 9 to 14, wherein the service header in the first packet further includes a third parameter, and the third parameter is used to identify the first packet as operation, management, and Maintain OAM packets;
    所述报文处理装置还包括:The message processing device further includes:
    控制单元,用于确定所述第一报文包括所述第三参数,且转发策略是将来自所述SFE的OAM报文发送至所述SF节点时,控制所述第一转发单元向所述SF节点发送所述第三报文。a control unit, configured to determine that the first packet includes the third parameter, and the forwarding policy is to control the first forwarding unit to send the OAM packet from the SFE to the SF node The SF node sends the third packet.
  16. 如权利要求9至15任一所述的装置,其特征在于,所述第一参数为所述路径ID,或者所述第一参数为根据算法对所述路径ID进行处理后获得的数据。 The apparatus according to any one of claims 9 to 15, wherein the first parameter is the path ID, or the first parameter is data obtained by processing the path ID according to an algorithm.
PCT/CN2015/078508 2014-05-15 2015-05-08 Packet processing method and device WO2015172675A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410206623.4A CN105099919B (en) 2014-05-15 2014-05-15 Message processing method and device
CN201410206623.4 2014-05-15

Publications (1)

Publication Number Publication Date
WO2015172675A1 true WO2015172675A1 (en) 2015-11-19

Family

ID=54479323

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/078508 WO2015172675A1 (en) 2014-05-15 2015-05-08 Packet processing method and device

Country Status (2)

Country Link
CN (1) CN105099919B (en)
WO (1) WO2015172675A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112671641A (en) * 2016-08-24 2021-04-16 华为技术有限公司 Message forwarding method and device

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108353352B (en) * 2015-12-16 2020-06-16 华为技术有限公司 Network element selection method and network element selector
EP4231605A3 (en) 2016-07-01 2023-09-27 Huawei Technologies Co., Ltd. Service function chaining sfc-based packet forwarding method, apparatus, and system
CN107579838A (en) * 2016-07-05 2018-01-12 中兴通讯股份有限公司 Data processing method and device
CN108574638B (en) * 2017-03-14 2020-10-16 华为技术有限公司 Method and equipment for forwarding data message
CN107786462B (en) * 2017-10-30 2020-05-12 新华三技术有限公司 Message forwarding method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100080226A1 (en) * 2008-10-01 2010-04-01 Mohamed Khalid Service path selection in a service network
CN101772918A (en) * 2007-08-03 2010-07-07 思科技术公司 The Operations, Administration and Maintenance of service chaining (OAM)
US20130170424A1 (en) * 2011-12-29 2013-07-04 Qualcomm Incorporated Selectively multiplexing communication streams
CN104283891A (en) * 2014-10-27 2015-01-14 杭州华三通信技术有限公司 Method and device for access of service function node to service link network

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103152270B (en) * 2013-03-11 2016-06-08 华为技术有限公司 The method E-Packeted and router
CN103269280B (en) * 2013-04-23 2017-12-15 华为技术有限公司 The method, apparatus and system commenced business in network
CN103259728B (en) * 2013-05-24 2016-03-30 华为技术有限公司 A kind of OFS in-band communications method and OFS

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101772918A (en) * 2007-08-03 2010-07-07 思科技术公司 The Operations, Administration and Maintenance of service chaining (OAM)
US20100080226A1 (en) * 2008-10-01 2010-04-01 Mohamed Khalid Service path selection in a service network
US20130170424A1 (en) * 2011-12-29 2013-07-04 Qualcomm Incorporated Selectively multiplexing communication streams
CN104283891A (en) * 2014-10-27 2015-01-14 杭州华三通信技术有限公司 Method and device for access of service function node to service link network

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112671641A (en) * 2016-08-24 2021-04-16 华为技术有限公司 Message forwarding method and device

Also Published As

Publication number Publication date
CN105099919B (en) 2018-07-31
CN105099919A (en) 2015-11-25

Similar Documents

Publication Publication Date Title
US11831526B2 (en) Service chain fault detection method and apparatus
WO2015172675A1 (en) Packet processing method and device
CN109756425B (en) Multicast forwarding method, device and BFR
US9992106B2 (en) Generating a host route
US9894003B2 (en) Method, apparatus and system for processing data packet
US10205656B2 (en) Method and apparatus for updating manner of processing packet of service flow
CN105024985B (en) A kind of message processing method and device
EP3958521A1 (en) Method and apparatus for providing service for service flow
US20150003463A1 (en) Multiprotocol Label Switching Transport for Supporting a Very Large Number of Virtual Private Networks
US10505895B2 (en) Method and device for storing and sending MAC address entry, and system
US20230078123A1 (en) Method for Forwarding Packet in SRV6 Service Function Chain and SF Device
US10505759B2 (en) Access layer-2 virtual private network from layer-3 virtual private network
EP2903218A1 (en) Method and device for modifying and forwarding message in data communication network
US10003503B2 (en) Tunnel type selection method and apparatus
WO2021088629A1 (en) Detnet data packet processing method and apparatus
US20240048479A1 (en) Packet Forwarding Method and Apparatus, Network Device, and Storage Medium
US11855888B2 (en) Packet verification method, device, and system
WO2021078171A1 (en) Message transmission method and device, and digital processing chip
US20200007665A1 (en) Method for using metadata in internet protocol packets
CN116346938B (en) Calculation power access method and device, electronic equipment and storage medium
CN116668375B (en) Message distribution method, device, network equipment and storage medium
WO2023088145A1 (en) Packet processing method, apparatus and device
US8971289B2 (en) Maintaining point of presence for clients roaming within a layer 2 domain
CN116614432A (en) Message processing method, network element equipment, control equipment and storage medium

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

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

Country of ref document: EP

Kind code of ref document: A1