[go: up one dir, main page]

CN112671641B - Message forwarding method and device - Google Patents

Message forwarding method and device Download PDF

Info

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

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/24Multipath
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/302Route determination based on requested QoS

Landscapes

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

Abstract

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

Figure 202011368863

The present disclosure relates to a message forwarding method and device. The method includes: receiving a service message, and determining a preset message feature of the service message; acquiring forwarding parameters corresponding to the preset message feature ; Encapsulate the service message into a service chain message that carries the forwarding parameter; determine the device identifier of the service function repeater of the next hop in the forwarding path according to the forwarding parameter; The service function forwarder sends the service chain message. The present invention encapsulates the service message into a service chain message carrying forwarding parameters, so that the next-hop service function forwarder can continue to transmit the service chain message according to the forwarding parameters, and the forwarding parameters are encapsulated in the service chain message, The forwarding parameters will not be changed due to the device that modifies the packet in the forwarding path. This ensures that the forward path and the return path are the same when the service chain packet is transmitted, and the forwarding parameters of the forward path and the return path can be guaranteed to be the same.

Figure 202011368863

Description

报文转发方法及装置Message forwarding method and device

相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS

本公开为2016年8月24日提交,申请号为201610716222.2,发明名称为“报文转发方法及装置”的中国专利申请的分案,其全部内容通过引用结合在本公开中。This disclosure is a division of a Chinese patent application filed on August 24, 2016, with the application number of 201610716222.2, and the title of the invention is “Message Forwarding Method and Device”, the entire contents of which are incorporated into this disclosure by reference.

技术领域technical field

本公开涉及通信技术领域,尤其涉及一种报文转发方法及装置。The present disclosure relates to the field of communication technologies, and in particular, to a message forwarding method and device.

背景技术Background technique

业务功能链(英文:service function chain,简称:SFC)定义并实例化一组有序的供业务流通过的业务功能(英文:service function,简称:SF),业务功能链也被简称为业务链(英文:service chain),其目的是为用户提供端到端的业务路径。其中,SF可以指防火墙(英文:firewalls)、网络地址转换器(英文:Network Address Translators,简称:NATs)或者其他特定应用(英文:application-specific)的功能,例如,负载均衡器(英文:load balancer)等。当报文从业务链的一端被转发到另一端时,需要经过一条由多个SFs以及它们连结的业务功能转发器(英文:Service Function Forwarder,简称:SFFs)构成的具体业务路径(英文:Rendered Service Path,简称:RSP)。A service function chain (English: service function chain, abbreviated as: SFC) defines and instantiates a set of ordered business functions (English: service function, abbreviated as: SF) for business flow to pass through, and a business function chain is also referred to as a business chain for short (English: service chain), its purpose is to provide users with an end-to-end business path. Among them, SF may refer to firewalls (English: firewalls), network address translators (English: Network Address Translators, referred to as: NATs) or other specific application (English: application-specific) functions, for example, load balancers (English: load balancer), etc. When a message is forwarded from one end of the service chain to the other end, it needs to pass through a specific service path (English: Rendered Service Path, referred to as: RSP).

通常端到端的业务流使用正向路径和返程路径传输,由于单个SF设备的性能有限,当业务路径上传输的流量过大时,SF容易成为性能瓶颈。所以需要具体业务路径的每一跳可以被设置为由多个相同类型的SFs构成的业务功能组(英文:service functiongroup,简称:SFG),并且使用SFF的本地策略决定业务流在传输时需要经过SFG内的哪个SF。Usually, the end-to-end service flow is transmitted using the forward path and the return path. Due to the limited performance of a single SF device, when the traffic transmitted on the service path is too large, the SF easily becomes a performance bottleneck. Therefore, each hop that needs a specific service path can be set as a service function group (English: service function group, SFG for short) composed of multiple SFs of the same type, and the local policy of SFF is used to determine the service flow that needs to pass through during transmission. Which SF within the SFG.

当业务链中存在需要维持业务流的状态的SF(例如状态防火墙)时,需要保证正向业务流与返程业务流的来去路径一致。在现有的网络等价多路径(英文:equal-costmulti-path,简称:ECMP)路由技术中,当网络设备转发因特网协议(英文:InternetProtocol,简称:IP)报文时,如果该网络设备的转发表中该IP报文的目的地址对应的转发路径有多条且它们的开销(英文:cost)相同时,网络设备会从该IP报文中抽取出五元组(源IP地址、目的IP地址、源端口、目的端口及协议号),并根据该五元组计算出一个哈希(英文:hash)值,然后根据该hash值从该多条转发路径中选择一条路径。When there is an SF (such as a stateful firewall) that needs to maintain the state of the service flow in the service chain, it is necessary to ensure that the forward service flow and the return service flow have the same incoming and outgoing paths. In the existing network equal-cost multi-path (English: equal-costmulti-path, abbreviated: ECMP) routing technology, when a network device forwards an Internet Protocol (English: Internet Protocol, abbreviated: IP) packet, if the network device's When there are multiple forwarding paths corresponding to the destination address of the IP packet in the forwarding table and their costs (English: cost) are the same, the network device will extract a quintuple (source IP address, destination IP address) from the IP packet. address, source port, destination port, and protocol number), and calculates a hash (English: hash) value according to the five-tuple, and then selects a path from the multiple forwarding paths according to the hash value.

但是,返程业务流的五元组是将正向业务流的五元组中的源IP地址和目的IP地址互换,将源端口和目的端口互换得到的,SFF在收到返程业务流时,无法根据hash算法将返程业务流引向SFG中处理正向业务流的SF,进而无法满足往返路径的一致性要求。However, the quintuple of the return service flow is obtained by exchanging the source IP address and the destination IP address in the quintuple of the forward service flow, and exchanging the source port and the destination port. When the SFF receives the return service flow , the return service flow cannot be directed to the SF in the SFG that processes the forward service flow according to the hash algorithm, and thus the consistency requirements of the round-trip path cannot be met.

发明内容SUMMARY OF THE INVENTION

本发明实施例中提供了一种报文转发方法及装置,以解决现有技术中SFF无法根据hash算法将正向业务流和返程业务流引向SFG中的同一个SF,无法满足往返路径的一致性要求的问题。The embodiments of the present invention provide a message forwarding method and device, so as to solve the problem that in the prior art, the SFF cannot direct the forward service flow and the return service flow to the same SF in the SFG according to the hash algorithm, and cannot meet the requirements of the round-trip path. The question of consistency requirements.

为了解决上述技术问题,本发明实施例公开了如下技术方案:In order to solve the above technical problems, the embodiments of the present invention disclose the following technical solutions:

第一方面,本发明实施例提供一种报文转发方法,包括:In a first aspect, an embodiment of the present invention provides a packet forwarding method, including:

分类器接收业务报文,并确定所述业务报文的预设报文特征;The classifier receives the service message, and determines the preset message characteristics of the service message;

所述分类器获取与所述预设报文特征对应的转发参数;obtaining, by the classifier, forwarding parameters corresponding to the preset packet characteristics;

所述分类器将所述业务报文封装为业务链报文,所述业务链报文中携带有所述转发参数;The classifier encapsulates the service message into a service chain message, and the service chain message carries the forwarding parameter;

所述分类器根据所述转发参数确定转发路径中的下一跳的业务功能转发器的设备标识;The classifier determines, according to the forwarding parameter, the device identifier of the service function forwarder of the next hop in the forwarding path;

所述分类器向所述设备标识对应的业务功能转发器发送所述业务链报文。The classifier sends the service chain message to the service function forwarder corresponding to the device identifier.

结合第一方面,在第一方面第一种可能的实现方式中,所述分类器获取与所述预设报文特征对应的转发参数,包括:With reference to the first aspect, in a first possible implementation manner of the first aspect, the classifier obtains forwarding parameters corresponding to the preset packet characteristics, including:

所述分类器生成参数查询请求消息,所述参数查询请求消息中携带有所述预设报文特征;The classifier generates a parameter query request message, where the parameter query request message carries the preset message feature;

所述分类器向参数管理器发送所述参数查询请求消息;The classifier sends the parameter query request message to the parameter manager;

所述分类器接收所述参数管理器根据所述参数查询请求返回的所述转发参数。The classifier receives the forwarding parameter returned by the parameter manager according to the parameter query request.

结合第一方面,在第一方面第二种可能的实现方式中,所述分类器生成所述参数查询请求消息包括:With reference to the first aspect, in a second possible implementation manner of the first aspect, generating the parameter query request message by the classifier includes:

所述分类器在分类器映射表中查找是否存在与所述预设报文特征对应的所述转发参数;The classifier looks up in the classifier mapping table whether there is the forwarding parameter corresponding to the preset packet feature;

当所述分类器映射表中不存在与所述预设报文特征对应的所述转发参数时,所述分类器生成所述参数查询请求消息;When the forwarding parameter corresponding to the preset message feature does not exist in the classifier mapping table, the classifier generates the parameter query request message;

所述方法还包括:The method also includes:

当所述分类器接收到所述参数管理器返回的所述转发参数时,将所述转发参数以及所述预设报文特征的对应关系加入所述分类器映射表。When the classifier receives the forwarding parameter returned by the parameter manager, the corresponding relationship between the forwarding parameter and the preset packet feature is added to the classifier mapping table.

结合第一方面,在第一方面第三种可能的实现方式中,所述分类器获取与所述预设报文特征对应的转发参数,包括:With reference to the first aspect, in a third possible implementation manner of the first aspect, the classifier obtains forwarding parameters corresponding to the preset packet characteristics, including:

所述分类器在分类器映射表中查找是否存在与所述预设报文特征对应的所述转发参数;The classifier looks up in the classifier mapping table whether there is the forwarding parameter corresponding to the preset packet feature;

当所述分类器映射表中存在与所述预设报文特征对应的所述转发参数时,所述分类器从所述分类器映射表中获取与所述预设报文特征对应的所述转发参数。When the forwarding parameters corresponding to the preset packet characteristics exist in the classifier mapping table, the classifier obtains the forwarding parameters corresponding to the preset packet characteristics from the classifier mapping table forwarding parameters.

结合第一方面,在第一方面第四种可能的实现方式中,所述转发路径中包含至少一个业务功能组,每个所述业务功能组连接至少两个按照预设顺序排列的业务功能转发器;With reference to the first aspect, in a fourth possible implementation manner of the first aspect, the forwarding path includes at least one service function group, and each service function group is connected to at least two service function forwarding arranged in a preset order device;

所述分类器根据所述转发参数确定转发路径中的下一跳的业务功能转发器的设备标识,包括:The classifier determines, according to the forwarding parameter, the device identifier of the service function forwarder of the next hop in the forwarding path, including:

所述分类器对所述转发参数进行取模计算,得到运算结果;The classifier performs modulo calculation on the forwarding parameter to obtain an operation result;

所述分类器确定所述运算结果所在的目标数量值区间;The classifier determines the target quantity value interval in which the operation result is located;

所述分类器根据预设的数量值区间与设备标识的对应关系将所述目标数量值区间对应的设备标识确定为转发路径中的下一跳的业务功能转发器的设备标识。The classifier determines the device identifier corresponding to the target quantity value interval as the device identifier of the service function repeater of the next hop in the forwarding path according to the preset corresponding relationship between the quantity value interval and the device identifier.

第二方面,本发明实施例提供一种报文转发方法,所述方法包括:In a second aspect, an embodiment of the present invention provides a packet forwarding method, the method includes:

业务功能转发器接收转发路径中上一跳设备转发的业务链报文,所述业务链报文中携带有所述转发参数;The service function forwarder receives the service chain message forwarded by the previous hop device in the forwarding path, and the service chain message carries the forwarding parameter;

所述业务功能转发器获取所述业务链报文中的转发参数;obtaining, by the service function forwarder, forwarding parameters in the service chain message;

所述业务功能转发器根据所述转发参数确定所述转发路径中下一跳设备标识;The service function forwarder determines, according to the forwarding parameter, the identifier of the next-hop device in the forwarding path;

所述业务功能转发器向所述设备标识对应的下一跳设备发送所述业务链报文。The service function forwarder sends the service chain message to the next-hop device corresponding to the device identifier.

结合第二方面,在第二方面第一种可能的实现方式中,所述业务功能转发器根据所述转发参数确定所述转发路径中下一跳设备标识,包括:With reference to the second aspect, in a first possible implementation manner of the second aspect, the service function forwarder determines the identifier of the next-hop device in the forwarding path according to the forwarding parameter, including:

所述业务功能转发器根据预设转发表确定所述转发路径中下一跳设备的设备类型;The service function forwarder determines the device type of the next-hop device in the forwarding path according to a preset forwarding table;

当所述业务功能转发器根据所述预设转发表确定的所述转发路径中下一跳设备的设备类型为业务功能转发器时,所述业务功能转发器根据所述转发参数确定下一跳设备对应的业务功能转发器的设备标识。When the device type of the next hop device in the forwarding path determined by the service function forwarder according to the preset forwarding table is a service function forwarder, the service function forwarder determines the next hop according to the forwarding parameter The device identifier of the service function forwarder corresponding to the device.

结合第二方面,在第二方面第二种可能的实现方式中,所述业务功能转发器关联有多个业务功能实体;With reference to the second aspect, in a second possible implementation manner of the second aspect, the service function forwarder is associated with multiple service function entities;

所述业务功能转发器根据所述转发参数确定所述转发路径中下一跳设备标识,还包括:The service function forwarder determines, according to the forwarding parameter, the identifier of the next-hop device in the forwarding path, further comprising:

当所述业务功能转发器根据所述预设转发表确定的所述转发路径中下一跳设备的设备类型为业务功能实体时,所述业务功能转发器根据所述转发参数确定下一跳设备对应的业务功能实体的设备标识。When the device type of the next hop device in the forwarding path determined by the service function forwarder according to the preset forwarding table is a service function entity, the service function forwarder determines the next hop device according to the forwarding parameter The device identifier of the corresponding business function entity.

结合第二方面,在第二方面第三种可能的实现方式中,所述方法还包括:With reference to the second aspect, in a third possible implementation manner of the second aspect, the method further includes:

当所述业务链报文的下一跳设备的设备标识与预设设备标识相同时,业务功能转发器确定所述业务链报文中的预设报文特征;When the device identifier of the next-hop device of the service chain message is the same as the preset device identifier, the service function forwarder determines the preset message feature in the service chain message;

所述业务功能转发器向参数管理器发送所述预设报文特征与所述转发参数之间的映射关系;sending, by the service function forwarder, a mapping relationship between the preset message feature and the forwarding parameter to the parameter manager;

所述业务功能转发器将所述业务链报文解除封装,得到业务报文;The service function forwarder decapsulates the service chain message to obtain a service message;

所述业务功能转发器向所述转发路径的接收端发送所述业务报文。The service function forwarder sends the service message to the receiving end of the forwarding path.

第三方面,本发明实施例提供一种转发参数管理方法,包括:In a third aspect, an embodiment of the present invention provides a forwarding parameter management method, including:

参数管理器接收分类器发送的查询请求消息,所述查询请求消息携带有预设报文特征;The parameter manager receives a query request message sent by the classifier, where the query request message carries preset message characteristics;

所述参数管理器获取所述查询请求消息中的预设报文特征;obtaining, by the parameter manager, preset message characteristics in the query request message;

所述参数管理器获取与所述预设报文特征存在映射关系的转发参数;obtaining, by the parameter manager, a forwarding parameter that has a mapping relationship with the preset message feature;

所述参数管理器向所述分类器发送所述转发参数。The parameter manager sends the forwarding parameters to the classifier.

结合第三方面,在第三方面第一种可能的实现方式中,所述预设报文特征中包含转发路径的第一路径标识和至少一对相同类别的元素,所述参数管理器获取与所述预设报文特征存在映射关系的转发参数,包括:With reference to the third aspect, in a first possible implementation manner of the third aspect, the preset packet feature includes a first path identifier of the forwarding path and at least a pair of elements of the same type, and the parameter manager obtains the The forwarding parameters for which the preset message characteristics have a mapping relationship include:

所述参数管理器在管理器映射表中查找与所述预设报文特征存在映射关系的转发参数;The parameter manager searches the manager mapping table for a forwarding parameter that has a mapping relationship with the preset message feature;

当在管理器映射表中查找到所述转发参数时,所述参数管理器向所述分类器发送所述转发参数;When the forwarding parameter is found in the manager mapping table, the parameter manager sends the forwarding parameter to the classifier;

当在管理器映射表中未查找到所述转发参数时,所述参数管理器在路径标识映射表中查找与所述第一路径标识对应的第二路径标识,将所述第一路径标识替换为第二路径标识,并且将相同类别的元素互换位置,得到更新报文特征,在管理器映射表中查找与所述更新报文特征存在映射关系的转发参数;When the forwarding parameter is not found in the manager mapping table, the parameter manager searches the path identifier mapping table for a second path identifier corresponding to the first path identifier, and replaces the first path identifier is the second path identifier, and the elements of the same category are exchanged to obtain the update message feature, and the forwarding parameter that has a mapping relationship with the update message feature is searched in the manager mapping table;

当在管理器映射表中未查找到与所述更新报文特征存在映射关系的转发参数时,所述参数管理器根据所述预设报文特征计算转发参数,并且向所述分类器发送所述计算得到的转发参数。When a forwarding parameter that has a mapping relationship with the update message feature is not found in the manager mapping table, the parameter manager calculates the forwarding parameter according to the preset message feature, and sends the forwarding parameter to the classifier. forwarding parameters calculated above.

结合第三方面,在第三方面第二种可能的实现方式中,所述方法还包括:With reference to the third aspect, in a second possible implementation manner of the third aspect, the method further includes:

当接收到业务功能转发器发送的映射关系时,所述参数管理器判断所述管理器映射表中是否存在接收的所述映射关系;When receiving the mapping relationship sent by the service function forwarder, the parameter manager determines whether the received mapping relationship exists in the manager mapping table;

当所述管理器映射表中不存在接收的所述映射关系时,所述参数管理器将接收的所述映射关系加入所述管理器映射表中。When the received mapping relationship does not exist in the manager mapping table, the parameter manager adds the received mapping relationship into the manager mapping table.

第四方面,本发明实施例提供一种报文转发装置,包括:In a fourth aspect, an embodiment of the present invention provides a packet forwarding device, including:

接收模块,用于接收业务报文,并确定所述业务报文的预设报文特征;a receiving module, configured to receive a service message and determine preset message characteristics of the service message;

获取模块,用于获取与所述预设报文特征对应的转发参数;an acquisition module, configured to acquire forwarding parameters corresponding to the preset message characteristics;

封装模块,用于将所述业务报文封装为业务链报文,所述业务链报文中携带有所述转发参数;an encapsulation module, configured to encapsulate the service message into a service chain message, where the service chain message carries the forwarding parameter;

确定模块,用于根据所述转发参数确定转发路径中的下一跳的业务功能转发器的设备标识;a determining module, configured to determine the device identifier of the service function repeater of the next hop in the forwarding path according to the forwarding parameter;

发送模块,用于向所述设备标识对应的业务功能转发器发送所述业务链报文。A sending module, configured to send the service chain message to the service function forwarder corresponding to the device identifier.

上述第四方面的装置还可以包括其他的功能模块,用于实现上述第一方面及第一方面的各种实现方式中的方法。The apparatus of the fourth aspect may further include other functional modules for implementing the methods in the first aspect and various implementation manners of the first aspect.

第五方面,本发明实施例提供一种报文转发装置,所述装置包括:In a fifth aspect, an embodiment of the present invention provides a message forwarding device, the device comprising:

接收模块,用于接收转发路径中上一跳设备转发的业务链报文,所述业务链报文中携带有所述转发参数;a receiving module, configured to receive a service chain message forwarded by a previous hop device in the forwarding path, where the service chain message carries the forwarding parameter;

获取模块,用于获取所述业务链报文中的转发参数;an acquisition module, configured to acquire the forwarding parameters in the service chain message;

确定模块,用于根据所述转发参数确定所述转发路径中下一跳设备标识;a determining module, configured to determine the identifier of the next-hop device in the forwarding path according to the forwarding parameter;

发送模块,用于向所述设备标识对应的下一跳设备发送所述业务链报文。A sending module, configured to send the service chain message to the next-hop device corresponding to the device identifier.

上述第五方面的装置还可以包括其他的功能模块,用于实现上述第二方面及第二方面的各种实现方式中的方法。The apparatus of the fifth aspect may further include other functional modules for implementing the methods in the second aspect and various implementation manners of the second aspect.

第六方面,本发明实施例提供一种转发参数管理装置,包括:In a sixth aspect, an embodiment of the present invention provides a forwarding parameter management device, including:

接收模块,用于接收分类器发送的查询请求消息,所述查询请求消息携带有预设报文特征;a receiving module, configured to receive a query request message sent by the classifier, where the query request message carries preset message characteristics;

获取模块,用于获取所述查询请求消息中的预设报文特征;以及获取与所述预设报文特征存在映射关系的转发参数;an acquisition module, configured to acquire preset message features in the query request message; and acquire forwarding parameters that have a mapping relationship with the preset message features;

发送模块,用于向所述分类器发送所述转发参数。A sending module, configured to send the forwarding parameter to the classifier.

上述第六方面的装置还可以包括其他的功能模块,用于实现上述第三方面及第三方面的各种实现方式中的方法。The apparatus of the sixth aspect may further include other functional modules for implementing the third aspect and the methods in various implementation manners of the third aspect.

本发明第七方面提供了一种报文转发装置,所述报文转发装置包括:存储器和处理器,存储器用于存储一组代码,处理器用于执行该组代码以实现上述第一方面、第二方面或第三方面所述的方法。A seventh aspect of the present invention provides a message forwarding device, the message forwarding device includes: a memory and a processor, where the memory is used to store a set of codes, and the processor is used to execute the set of codes to implement the first aspect and the first The method described in the second aspect or the third aspect.

本发明中的分类器在接收的业务报文后确定预设报文特征,并获取与预设报文特征对应的转发参数,将业务报文封装为携带有转发参数的业务链报文,这样可以便于下一跳的业务功能转发器继续根据转发参数传输业务链报文,且转发参数被封装在业务链报文中,即使转发路径中存在修改报文的设备时,转发参数也不会发生改变,业务转发路径中的各个SFF根据业务链报文中的转发参数确定下一跳的SF及SFF的设备标识,并向所述设备标识对应的业务功能转发器发送所述业务链报文,业务链报文在转发路径中的整个传输过程,均是由每一跳设备根据转发参数选择下一跳设备,可以保证业务链报文传输时的正向路径和返程路径一致。The classifier in the present invention determines the preset message features after receiving the service message, obtains forwarding parameters corresponding to the preset message features, and encapsulates the service message into a service chain message carrying the forwarding parameters, so that It is convenient for the service function forwarder of the next hop to continue to transmit the service chain message according to the forwarding parameters, and the forwarding parameters are encapsulated in the service chain message. Even if there is a device that modifies the message in the forwarding path, the forwarding parameter will not occur. change, each SFF in the service forwarding path determines the device identity of the SF and SFF of the next hop according to the forwarding parameters in the service chain message, and sends the service chain message to the service function forwarder corresponding to the device identity, During the entire transmission process of service chain packets in the forwarding path, each hop device selects the next hop device according to the forwarding parameters, which ensures that the forward path and return path of service chain packets are the same.

当将业务链报文发送至转发路径中的最后一跳业务功能转发器时,最后一跳业务功能转发器确定所述业务链报文中的预设报文特征;并向参数管理器发送所述预设报文特征与所述转发参数之间的映射关系,这样可以在转发路径中修改报文特征的设备(如NAT)修改预设报文特征后,将修改后的预设报文特征及转发参数的对应关系上传至参数管理器,以便于下次转发业务报文时使用。When sending the service chain message to the last hop service function forwarder in the forwarding path, the last hop service function forwarder determines the preset message characteristics in the service chain message; The mapping relationship between the preset packet characteristics and the forwarding parameters, so that the device that modifies the packet characteristics in the forwarding path (such as NAT) modifies the preset packet characteristics, and the modified preset packet characteristics and the corresponding relationship of forwarding parameters are uploaded to the parameter manager for use when forwarding service packets next time.

参数管理器在接收到查询请求后,会获取所述查询请求消息中的预设报文特征并在管理器映射表中查找与所述预设报文特征存在映射关系的转发参数,当在管理器映射表中未查找到所述转发参数时,参数管理器将预设报文特征进行替换或者移位,得到更新报文特征,更新报文特征中的各个元素即为当前转发路径的对称路径的预设报文特征,然后再根据更新报文特征查询转发参数,这样,参数管理器即可以实现保证正向路径及返程路径的转发参数一致。After receiving the query request, the parameter manager will obtain the preset message features in the query request message and look up the forwarding parameters that have a mapping relationship with the preset message features in the manager mapping table. When the forwarding parameter is not found in the server mapping table, the parameter manager replaces or shifts the preset message feature to obtain the updated message feature, and each element in the updated message feature is the symmetric path of the current forwarding path Then, the forwarding parameters are queried according to the updated message characteristics. In this way, the parameter manager can ensure that the forwarding path and the return path have the same forwarding parameters.

应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍。In order to illustrate the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that are required in the description of the embodiments or the prior art.

图1为本发明实施例提供的正向路径和返程路径的结构示意图;1 is a schematic structural diagram of a forward path and a return path provided by an embodiment of the present invention;

图2为本发明实施例提供的一种报文转发方法的流程示意图;FIG. 2 is a schematic flowchart of a message forwarding method according to an embodiment of the present invention;

图3为本发明实施例提供的一种业务链架构示意图;FIG. 3 is a schematic diagram of a service chain architecture provided by an embodiment of the present invention;

图4为图3中任一SFG的内部结构及与该SFG对应的多个SFFS的架构示意图;FIG. 4 is a schematic diagram of the internal structure of any SFG in FIG. 3 and a plurality of SFFSs corresponding to the SFG;

图5为图2中步骤S102的一种流程示意图;FIG. 5 is a schematic flowchart of step S102 in FIG. 2;

图6为步骤S205的一种流程示意图;6 is a schematic flowchart of step S205;

图7为图2中步骤S102的另一种流程示意图;Fig. 7 is another schematic flow chart of step S102 in Fig. 2;

图8为本发明实施例提供的一种报文转发装置的结构示意图;FIG. 8 is a schematic structural diagram of a message forwarding apparatus according to an embodiment of the present invention;

图9为本发明实施例提供的另一种报文转发装置的结构示意图;FIG. 9 is a schematic structural diagram of another message forwarding apparatus provided by an embodiment of the present invention;

图10为本发明实施例提供的另一种报文转发装置的结构示意图;FIG. 10 is a schematic structural diagram of another message forwarding apparatus provided by an embodiment of the present invention;

图11为本发明实施例提供的再一种报文转发装置的结构示意图。FIG. 11 is a schematic structural diagram of still another packet forwarding apparatus according to an embodiment of the present invention.

具体实施方式Detailed ways

为了使本技术领域的人员更好地理解本发明中的技术方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行描述。In order to make those skilled in the art better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be described below with reference to the accompanying drawings in the embodiments of the present invention.

广义上的业务链架构包括以下几个部分:控制面(英文:control plane)、SF、SFF及分类器(classifier)。控制面主要负责业务链的生命周期管理、构建(construct)业务功能路径(英文:service function path,简称:SFP)、向业务链中的节点分发(propagate)路径信息等,通常由控制器实现;SF负责具体的业务策略执行,主要由业务提供商提供;SFF负责将业务报文根据业务链规则转发给本地SF和下一跳SFF,主要由网络运营商提供;分类器根据业务报文中的五元组等信息,将封装业务报文得到的业务链报文转发给对应业务链的第一跳SFF,分类器可以独立设置,也可以集成到网络设备中。The business chain architecture in a broad sense includes the following parts: control plane (English: control plane), SF, SFF and classifier. The control plane is mainly responsible for the life cycle management of the business chain, constructing the business function path (English: service function path, referred to as: SFP), and distributing the path information to the nodes in the business chain, etc. It is usually implemented by the controller; The SF is responsible for specific service policy execution, which is mainly provided by the service provider; the SFF is responsible for forwarding service packets to the local SF and the next-hop SFF according to the service chain rules, which are mainly provided by the network operator; Five-tuple and other information, the service chain message obtained by encapsulating the service message is forwarded to the first hop SFF of the corresponding service chain. The classifier can be set independently or integrated into the network device.

一条RSP中包含多个SFs以及它们连结的SFFs,每条RSP有一个唯一的业务路径标识(英文:service path identifier,简称:SPI)。图1为本发明实施例提供的正向路径和返程路径的结构示意图,其中,正向路径的SPI为10,返程路径的SPI为11,正向路径与返程路径的SPI值不同。An RSP contains multiple SFs and their connected SFFs, and each RSP has a unique service path identifier (English: service path identifier, SPI for short). 1 is a schematic structural diagram of a forward path and a return path provided by an embodiment of the present invention, wherein the SPI of the forward path is 10, the SPI of the return path is 11, and the SPI values of the forward path and the return path are different.

如图1所示,正向路径与返程路径均经过两个SFG。SFG1包含三个SFs,即:SF1、SF2与SF3,其中,SF1与SF2连接SFF1,SF3连接SFF2,SFG2包含两个SFs,即:SF4与SF5,SF4与SF5均连接到SFF3。图1中的实线表示从发送端src到接收端dst的正向流量经过的正向路径,在正向路径中,分类器1封装业务报文后,将封装后的业务链报文转发给SFG1中的SF1与SFG2中的SF4;图1中的虚线表示从接收端dst到发送端src的返程流量经过的返程路径,在返程路径中,分类器2封装业务报文后,将封装后的业务链报文转发给SFG2中的SF4与SFG1中的SF1,图1中为了便于理解示出两个分类器,在实际应用中,分类器1和分类器2也可以指同一个分类器。As shown in Figure 1, both the forward path and the return path pass through two SFGs. SFG1 contains three SFs, namely: SF1, SF2 and SF3, wherein SF1 and SF2 are connected to SFF1, SF3 is connected to SFF2, and SFG2 contains two SFs, namely: SF4 and SF5, both SF4 and SF5 are connected to SFF3. The solid line in Figure 1 represents the forward path passed by the forward traffic from the sender src to the receiver dst. In the forward path, after the classifier 1 encapsulates the service packet, it forwards the encapsulated service chain packet to SF1 in SFG1 and SF4 in SFG2; the dotted line in Figure 1 represents the return path that the return traffic from the receiving end dst to the sending end src passes through. The service chain message is forwarded to SF4 in SFG2 and SF1 in SFG1. Figure 1 shows two classifiers for ease of understanding. In practical applications, classifier 1 and classifier 2 may also refer to the same classifier.

为了实现图1中的正向路径和返程路径的一致性,如图2所示,本发明的一个实施例提供一种报文转发方法,包括以下步骤。In order to achieve the consistency of the forward path and the return path in FIG. 1 , as shown in FIG. 2 , an embodiment of the present invention provides a packet forwarding method, including the following steps.

在步骤S101中,分类器接收业务报文,并确定所述业务报文的预设报文特征。In step S101, the classifier receives a service message, and determines preset message characteristics of the service message.

在本发明实施例中,预设报文特征可以为{SPI,srcIP,dstIP},其中SPI为转发路径的路径标识,srcIP为发送端的IP地址,dstIP为接收端的IP地址;预设报文特征也可以为{SPI,srcIP,dstIP,srcPort,dstPort,proto},其中,srcPort为发送端的端口号,dstPort为接收端的端口号,proto为协议号。In the embodiment of the present invention, the preset message feature may be {SPI, srcIP, dstIP}, where SPI is the path identifier of the forwarding path, srcIP is the IP address of the sender, and dstIP is the IP address of the receiver; the preset message feature It can also be {SPI, srcIP, dstIP, srcPort, dstPort, proto}, where srcPort is the port number of the sender, dstPort is the port number of the receiver, and proto is the protocol number.

在该步骤中,分类器接收发送端发送的业务报文,在接收到的业务报文中获取srcIP和dstIP,在获取srcIP和dstIP基础上,还可以获取srcPort、dstPort和proto,并根据预设报文特征匹配预设的业务链规则,以得到SPI。In this step, the classifier receives the service packet sent by the sender, obtains srcIP and dstIP in the received service packet, and obtains srcPort, dstPort and proto on the basis of obtaining srcIP and dstIP, and according to preset The packet characteristics match the preset business chain rules to obtain SPI.

业务链规则中包括匹配动作表,匹配动作表中包含二元组{srcIP,dstIP}与SPI的对应关系,或者五元组{srcIP,dstIP,srcPort,dstPort,proto}与SPI的对应关系,匹配业务链规则时,可以根据预设报文特征中的{srcIP,dstIP}中的一项或多项,或者{srcIP,dstIP,srcPort,dstPort,proto}中的一项或多项查找匹配动作表,当匹配动作表中存在匹配的二元组或者五元组,获取与该二元组或者五元组匹配的SPI。The business chain rule includes a matching action table. The matching action table includes the corresponding relationship between the two-tuple {srcIP, dstIP} and SPI, or the corresponding relationship between the five-tuple {srcIP, dstIP, srcPort, dstPort, proto} and SPI, matching. In the case of business chain rules, you can search for the matching action table according to one or more of {srcIP, dstIP}, or one or more of {srcIP, dstIP, srcPort, dstPort, proto} in the preset packet characteristics , when there is a matching two-tuple or five-tuple in the matching action table, obtain the SPI that matches the two-tuple or five-tuple.

在步骤S102中,所述分类器获取与所述预设报文特征对应的转发参数。In step S102, the classifier obtains forwarding parameters corresponding to the preset packet characteristics.

在本发明实施例中,转发参数为整数,用于给分类器和SFF在选择下一跳时提供选路依据,转发参数与报文特征之间的对应关系由参数管理器管理,参数管理器可以独立设置,也可以作为一个功能模块集成在控制器内部;当正向路径的发送方与返程路径的发送方共用同一分类器时,参数管理器也可以集成在分类器内部;当参数管理器没有集成在分类器中时,在分类器每次从参数管理器获取到转发参数与报文特征之间的对应关系后,也可以将转发参数与报文特征之间的对应关系存储在分类器中。In the embodiment of the present invention, the forwarding parameter is an integer, which is used to provide a routing basis for the classifier and the SFF when selecting the next hop, and the corresponding relationship between the forwarding parameter and the packet characteristics is managed by the parameter manager, and the parameter manager It can be set independently or integrated in the controller as a functional module; when the sender of the forward path and the sender of the return path share the same classifier, the parameter manager can also be integrated inside the classifier; when the parameter manager When it is not integrated in the classifier, after each time the classifier obtains the correspondence between the forwarding parameters and the packet features from the parameter manager, the corresponding relationship between the forwarding parameters and the packet characteristics can also be stored in the classifier. middle.

图3是本发明实施例提供的一种业务链架构示意图,分类器可以如图3所示通过发送查询请求的方式从参数管理器获取与预设报文特征对应的转发参数,也可以在分类器内部缓存区域获取与预设报文特征对应的转发参数。FIG. 3 is a schematic diagram of a service chain architecture provided by an embodiment of the present invention. The classifier may obtain forwarding parameters corresponding to preset packet characteristics from the parameter manager by sending a query request as shown in FIG. The forwarding parameters corresponding to the preset packet characteristics are obtained from the internal buffer area of the server.

当分类器中无法缓存转发参数与报文特征之间对应关系、或者分类器中没有缓存预设报文特征对应的转发参数时,如图5所示,所述步骤S102可以包括以下步骤。When the classifier cannot cache the correspondence between the forwarding parameters and the packet features, or the classifier does not cache the forwarding parameters corresponding to the preset packet features, as shown in FIG. 5 , the step S102 may include the following steps.

在步骤S201中,分类器生成参数查询请求消息。In step S201, the classifier generates a parameter query request message.

在本发明实施例中,所述参数查询请求消息中携带有所述预设报文特征。In this embodiment of the present invention, the parameter query request message carries the preset message feature.

所述步骤S201包括:所述分类器可以在分类器映射表中查找是否存在与所述预设报文特征对应的所述转发参数;当所述分类器映射表中不存在与所述预设报文特征对应的所述转发参数时,所述分类器生成所述参数查询请求消息。The step S201 includes: the classifier may look up whether the forwarding parameter corresponding to the preset packet feature exists in the classifier mapping table; When the forwarding parameter corresponding to the packet feature is detected, the classifier generates the parameter query request message.

步骤S201还包括:当所述分类器接收到所述参数管理器返回的所述转发参数时,将所述转发参数以及所述预设报文特征的对应关系加入所述分类器映射表。Step S201 further includes: when the classifier receives the forwarding parameter returned by the parameter manager, adding the corresponding relationship between the forwarding parameter and the preset packet feature to the classifier mapping table.

在本发明实施例中,由于分类器内部的第一映射关系表中不存在与预设报文特征对应的转发参数,分类器只能通过向参数管理器发送查询请求的方式获取与预设报文特征存在映射关系的转发参数,当分类器从参数管理器获取到转发参数后,为了方便下一次转发包含该预设报文特征的业务报文,可以将预设报文特征与返回的转发参数之间的映射关系存入分类器映射表。In the embodiment of the present invention, since there is no forwarding parameter corresponding to the preset packet feature in the first mapping relationship table inside the classifier, the classifier can only obtain the information with the preset packet by sending a query request to the parameter manager. A forwarding parameter whose message feature has a mapping relationship. After the classifier obtains the forwarding parameter from the parameter manager, in order to facilitate the next forwarding of a service message containing the preset message feature, the preset message feature can be combined with the returned forwarding. The mapping relationship between the parameters is stored in the classifier mapping table.

在步骤S202中,分类器向参数管理器发送所述参数查询请求消息。In step S202, the classifier sends the parameter query request message to the parameter manager.

在该步骤中,在参数管理器位于分类器内部时,分类器中的处理器可以直接将查询请求消息发送给参数管理器,在参数管理器位于分类器外部时,分类器中的处理器可以首先获取参数管理器的地址,然后根据参数管理器的地址发送查询请求消息。In this step, when the parameter manager is located inside the classifier, the processor in the classifier can directly send the query request message to the parameter manager, and when the parameter manager is located outside the classifier, the processor in the classifier can First obtain the address of the parameter manager, and then send a query request message according to the address of the parameter manager.

在步骤S203中,参数管理器接收分类器发送的查询请求消息。In step S203, the parameter manager receives the query request message sent by the classifier.

在本发明实施例中,为了使参数管理器能够根据预设报文特征确定转发参数,所以所述查询请求消息中需要携带有预设报文特征。In this embodiment of the present invention, in order to enable the parameter manager to determine the forwarding parameters according to the preset packet characteristics, the query request message needs to carry the preset packet characteristics.

在步骤S204中,参数管理器获取所述查询请求消息中的预设报文特征。In step S204, the parameter manager obtains the preset message feature in the query request message.

在步骤S205中,参数管理器获取与所述预设报文特征存在映射关系的转发参数。In step S205, the parameter manager obtains forwarding parameters that have a mapping relationship with the preset packet characteristics.

在该步骤中,参数管理器可以根据预设报文特征在参数管理器内部查找与预设报文特征存在映射关系的转发参数,当在本地无法查找到与预设报文特征存在映射关系的转发参数时,可以根据预设报文特征计算与预设报文特征存在映射关系的转发参数。In this step, the parameter manager may search for the forwarding parameters that have a mapping relationship with the preset message characteristics in the parameter manager according to the preset packet characteristics. When forwarding parameters, forwarding parameters that have a mapping relationship with the preset packet characteristics may be calculated according to the preset packet characteristics.

所述预设报文特征中包含转发路径的第一路径标识和至少一对相同类别的元素,在本发明实施例中,类别可以指IP地址类别或者端口类别等等,例如,srcIP和dstIP可以被确定为是同属于IP地址类别的元素,srcPort和dstPort可以被确定为是同属于端口类别的元素等,如图6所示,所述步骤S205包括以下步骤。The preset packet feature includes the first path identifier of the forwarding path and at least a pair of elements of the same category. In this embodiment of the present invention, the category may refer to an IP address category or a port category, for example, srcIP and dstIP may It is determined to be elements belonging to the same IP address category, srcPort and dstPort can be determined to be elements belonging to the same port category, etc. As shown in FIG. 6 , the step S205 includes the following steps.

在步骤S2051中,参数管理器在管理器映射表中查找与所述预设报文特征存在映射关系的转发参数。In step S2051, the parameter manager searches the manager mapping table for forwarding parameters that have a mapping relationship with the preset packet characteristics.

在本发明实施例中,可以在参数管理器中设置用于存储报文特征与转发参数的第二映射关系表。In this embodiment of the present invention, a second mapping relationship table for storing packet characteristics and forwarding parameters may be set in the parameter manager.

在该步骤中,参数管理器可以逐一将第二映射关系表中的报文特征与预设报文特征比较,当存在与预设报文特征相同的报文特征时,可以确定在管理器映射表中可以查找到与预设报文特征存在映射关系的转发参数,并且与该预设报文特征存在映射关系的转发参数为待查找的转发参数。In this step, the parameter manager may compare the message features in the second mapping relationship table with the preset message features one by one, and when there is a message feature that is the same as the preset message feature, it may be determined to map A forwarding parameter that has a mapping relationship with the preset message feature can be found in the table, and the forwarding parameter that has a mapping relationship with the preset message feature is the forwarding parameter to be searched.

在步骤S2052中,当在管理器映射表中查找到所述转发参数时,所述参数管理器向所述分类器发送所述转发参数。In step S2052, when the forwarding parameter is found in the manager mapping table, the parameter manager sends the forwarding parameter to the classifier.

在步骤S2053中,当在管理器映射表中未查找到所述转发参数时,参数管理器在路径标识映射表中查找与所述第一路径标识对应的第二路径标识,将所述第一路径标识替换为第二路径标识,并且将相同类别的元素互换位置,得到更新报文特征,在管理器映射表中查找与所述更新报文特征存在映射关系的转发参数。In step S2053, when the forwarding parameter is not found in the manager mapping table, the parameter manager searches the path identifier mapping table for a second path identifier corresponding to the first path identifier, and converts the first path identifier to the first path identifier. The path identifier is replaced with the second path identifier, and elements of the same category are exchanged to obtain the update message feature, and the forwarding parameter that has a mapping relationship with the update message feature is searched in the manager mapping table.

在本发明实施例中,路径标识映射表中存储有第一路径标识与第二路径标识之间的对应关系,第二路径标识指所述转发路径的对称路径的路径标识,例如,当转发路径为正向路径时,转发路径的对称路径为返程路径,则第二路径标识为返程路径的路径标识;当转发路径为返程路径时,转发路径的对称路径为正向路径,则第二路径标识为正向路径的路径标识。In this embodiment of the present invention, the path identifier mapping table stores the correspondence between the first path identifier and the second path identifier, and the second path identifier refers to the path identifier of the symmetric path of the forwarding path. For example, when the forwarding path When it is a forward path, the symmetrical path of the forwarding path is the return path, and the second path identifier is the path identifier of the return path; when the forwarding path is the return path, the symmetrical path of the forwarding path is the forward path, then the second path identifier Path identifier for the forward path.

在该步骤中,当在第二映射关系表中未查找到转发参数时,参数管理器可以在路径标识映射表中查找与所述第一路径标识对应的第二路径标识,然后将第一路径标识替换为第二路径标识,并且将预设报文特征中属于相同类别的元素互换位置,例如,假设预设报文特征为{第一SPI,srcIP,dstIP},则更新报文特征可以为{第二SPI,dstIP,srcIP};假设预设报文特征为{第一SPI,srcIP,dstIP,srcPort,dstPort,proto},则更新报文特征可以为{第二SPI,dstIP,srcIP,dstPort,srcPort,proto},然后再在第二映射关系表中查找与更新报文特征相同的报文特征,若查找到与更新报文特征相同的报文特征,则可以确定在管理器映射表中可以查找到与更新报文特征存在映射关系的转发参数,并且与该更新报文特征存在映射关系的转发参数为待查找的转发参数。In this step, when the forwarding parameter is not found in the second mapping relationship table, the parameter manager may look up the second path identifier corresponding to the first path identifier in the path identifier mapping table, and then assign the first path identifier to the first path identifier. The identifier is replaced with the second path identifier, and the positions of elements belonging to the same category in the preset message feature are exchanged. For example, if the preset message feature is {first SPI, srcIP, dstIP}, the update message feature can be is {second SPI, dstIP, srcIP}; assuming that the preset message feature is {first SPI, srcIP, dstIP, srcPort, dstPort, proto}, the update message feature can be {second SPI, dstIP, srcIP, dstPort, srcPort, proto}, and then look for the message feature that is the same as the update message feature in the second mapping table. If the message feature that is the same as the update message feature is found, it can be determined The forwarding parameter that has a mapping relationship with the update message feature can be found in the , and the forwarding parameter that has a mapping relationship with the update message feature is the forwarding parameter to be searched.

在本发明实施例中,由于正向的业务报文在通过正向路径被转发到接收端后,接收端向发送端发送的返程的业务报文需要在与正向路径对称的返程路径上被转发,这时,分类器会根据返程的业务报文确定预设报文特征,然后将该确定的预设报文特征通过查询请求消息发送给参数管理器。参数管理器为了获取到与正向的业务报文在正向路径被转发时使用的转发参数,会将返程的业务报文中的预设报文特征中的元素进行处理,处理的方式就是将预设报文特征转化为更新报文特征,这里的更新报文特征即为正向的业务报文中的预设报文特征。通过这种方式,参数管理器可以保证正向的业务报文在正向路径上被转发时和返程的业务报文在返程路径上被转发时使用相同的转发参数。In this embodiment of the present invention, after the forward service packet is forwarded to the receiving end through the forward path, the return service packet sent by the receiving end to the sending end needs to be sent on the return path symmetrical with the forward path. Forwarding, at this time, the classifier will determine the preset message feature according to the return service message, and then send the determined preset message feature to the parameter manager through a query request message. In order to obtain the forwarding parameters used when the forward service packet is forwarded on the forward path, the parameter manager will process the elements in the preset packet characteristics in the return service packet. The preset message feature is converted into an update message feature, and the update message feature here is the preset message feature in the forward service message. In this way, the parameter manager can ensure that the forward service packets are forwarded on the forward path and the return service packets are forwarded on the return path using the same forwarding parameters.

在步骤S2054中,当在管理器映射表中未查找到与所述更新报文特征存在映射关系的转发参数时,参数管理器根据所述预设报文特征计算转发参数,并且向所述分类器发送所述计算得到的转发参数。In step S2054, when the forwarding parameter that has a mapping relationship with the update message feature is not found in the manager mapping table, the parameter manager calculates the forwarding parameter according to the preset message feature, and assigns a forwarding parameter to the classification The controller sends the calculated forwarding parameters.

在本发明实施例中,转发参数的计算方法由参数管理器的规则决定,包括但不限于以下三种:hash算法、累加全局变量或者随机生成的方式。In this embodiment of the present invention, the calculation method of the forwarding parameter is determined by the rules of the parameter manager, including but not limited to the following three methods: hash algorithm, accumulation of global variables, or random generation.

在步骤S206中,参数管理器向所述分类器发送所述转发参数。In step S206, the parameter manager sends the forwarding parameter to the classifier.

当分类器中缓存转发参数与报文特征之间对应关系时,如图7所示,所述步骤S102还包括以下步骤。When the correspondence between the forwarding parameters and the packet features is cached in the classifier, as shown in FIG. 7 , the step S102 further includes the following steps.

在步骤S301中,分类器在分类器映射表中查找是否存在与所述预设报文特征对应的转发参数。In step S301, the classifier searches the classifier mapping table whether there is a forwarding parameter corresponding to the preset packet feature.

在本发明实施例中,可以在分类器内部设置用于存储报文特征与转发参数之间的对应关系。In this embodiment of the present invention, a corresponding relationship between packet characteristics and forwarding parameters may be set in the classifier.

在该步骤中,分类器可以逐一将第一映射关系表中的报文特征与预设报文特征比较,当存在与预设报文特征相同的报文特征时,可以确定在分类器映射表中可以查找到与预设报文特征存在映射关系的转发参数,并且与该预设报文特征存在映射关系的转发参数为待查找的转发参数。In this step, the classifier may compare the message features in the first mapping relationship table with the preset message features one by one. A forwarding parameter that has a mapping relationship with the preset message feature can be found in the , and the forwarding parameter that has a mapping relationship with the preset message feature is the forwarding parameter to be searched.

在步骤S302中,当所述分类器映射表中存在与所述预设报文特征对应的转发参数时,分类器从所述分类器映射表中获取与所述预设报文特征对应的转发参数。In step S302, when there are forwarding parameters corresponding to the preset packet characteristics in the classifier mapping table, the classifier obtains the forwarding parameters corresponding to the preset packet characteristics from the classifier mapping table parameter.

在步骤S103中,所述分类器将所述业务报文封装为业务链报文,所述业务链报文中携带有所述转发参数。In step S103, the classifier encapsulates the service packet into a service chain packet, and the service chain packet carries the forwarding parameter.

在该步骤中,分类器将业务报文进行封装,封装时,可以将转发参数封装在业务链报文头中,也可以封装在业务链报文的其他位置。In this step, the classifier encapsulates the service packet. When encapsulating, the forwarding parameter may be encapsulated in the service chain packet header, or may be encapsulated in other positions of the service chain packet.

在步骤S104中,所述分类器根据所述转发参数确定转发路径中的下一跳的业务功能转发器的设备标识。In step S104, the classifier determines the device identifier of the service function forwarder of the next hop in the forwarding path according to the forwarding parameter.

在该步骤中,如图3所示,分类器可以根据转发参数和预设的选路方法在SFG1对应的一个SFF中选择一个SFF的设备标识,作为分类器的下一跳的业务功能转发器的设备标识,预设的选路方法可以指取模方法等。In this step, as shown in FIG. 3 , the classifier can select a device identifier of an SFF in a SFF corresponding to SFG1 according to the forwarding parameters and the preset routing method, as the service function repeater of the next hop of the classifier The device identification, the preset routing method can refer to the modulo method, etc.

在本发明实施例中,业务功能转发器的设备标识,例如SFF1、SFF2、221和222等。转发路径即为RSP,下一跳指转发路径中与分类器的输出端连接的SFF,如图1中的SFF1。In this embodiment of the present invention, the device identifiers of the service function forwarders are, for example, SFF1, SFF2, 221, and 222. The forwarding path is the RSP, and the next hop refers to the SFF connected to the output end of the classifier in the forwarding path, such as SFF1 in Figure 1 .

所述转发路径中包含至少一个业务功能组SFG,图3中任一SFG的内部结构及与该SFG连接的多个SFFS的架构示意图如图4所示,每个所述业务功能组SFG中包括多个SF,每个SF均连接一个SFF,每个SFF连接至少一个SF,至少两个SFF按照预设顺序排列;假定SFG包含n个SFs,记为SF 0,…,SF n-1;n个SFs共连接k个SFFs,分别记为SFF_0,…,SFF_k-1;其中,SFF_i连接的本地SF(隶属该SFG,下同)的数量记为num_i,显然有n=∑(i=0,...,k-1)num_i。The forwarding path includes at least one service function group SFG. The internal structure of any SFG in FIG. 3 and the schematic diagram of the architecture of multiple SFFSs connected to the SFG are shown in FIG. 4 . Each of the service function groups SFG includes: Multiple SFs, each SF is connected to one SFF, each SFF is connected to at least one SF, and at least two SFFs are arranged in a preset order; assuming that the SFG contains n SFs, denoted as SF 0, ..., SF n-1; n A total of k SFFs are connected to SFs, which are denoted as SFF_0,..., SFF_k-1 respectively; among them, the number of local SFs connected by SFF_i (belonging to this SFG, the same below) is denoted as num_i, obviously n=∑ (i=0, ...,k-1) num_i.

所述步骤S104包括以下步骤。The step S104 includes the following steps.

分类器对所述转发参数进行取模计算,得到运算结果。The classifier performs a modulo calculation on the forwarding parameter to obtain an operation result.

在本发明实施例中,假设运算结果为s,则s=selector%n,其中,n为SFG内SFs的数量,selector为转发参数。In the embodiment of the present invention, assuming that the operation result is s, then s=selector%n, where n is the number of SFs in the SFG, and the selector is a forwarding parameter.

分类器确定所述运算结果所在的目标数量值区间。The classifier determines the target quantity value interval in which the operation result is located.

在该步骤中,分类器可以将运算结果s与每个数量值区间的两个端点对比,当运算结果s位于任意一个数量值区间中时,可以将该数量值区间确定为目标数量值区间。In this step, the classifier can compare the operation result s with the two endpoints of each quantitative value interval, and when the operation result s is located in any quantitative value interval, the quantitative value interval can be determined as the target quantitative value interval.

分类器根据预设的数量值区间与设备标识的对应关系将所述目标数量值区间对应的设备标识确定为转发路径中的下一跳的业务功能转发器的设备标识。The classifier determines the device identifier corresponding to the target quantity value interval as the device identifier of the service function repeater of the next hop in the forwarding path according to the corresponding relationship between the preset quantity value interval and the device identifier.

在本发明实施例中,分类器可以预先设置多组数量值区间与设备标识的对应关系,每组对应关系的确定方法为针对每个业务功能转发器的设备标识,确定一个数量值区间。In this embodiment of the present invention, the classifier may preset multiple sets of corresponding relationships between quantitative value intervals and device identifiers, and a method for determining each group of corresponding relationships is to determine a quantitative value interval for the device identifier of each service function repeater.

在确定每个设备标识对应的数量值区间时,可以首先确定每个设备标识对应的SF的数量,这里的对应指每个设备标识其自身连接的SF,以及,在转发路径中该设备标识之前的所有设备标识连接的SF,累加设备标识对应的所有SF的数量,得到累计数量值,这样,每个设备标识可以得到一个累计数量值;然后可以确定转发路径中相邻两个设备标识对应的累计数量值为所述数量值区间的两端值。When determining the quantity value interval corresponding to each device identifier, the number of SFs corresponding to each device identifier can be determined first, where the correspondence refers to the SF connected to each device identifier itself, and before the device identifier in the forwarding path The SFs connected to all the device IDs of the device ID are accumulated, and the number of all the SFs corresponding to the device IDs is accumulated to obtain the cumulative quantity value. In this way, each device ID can obtain a cumulative quantity value; then the corresponding two adjacent device IDs in the forwarding path can be determined. The accumulated quantity value is the two end values of the quantity value interval.

以上确定每个设备标识对应的数量值区间的过程可以利用程序语言表达:The above process of determining the quantity value interval corresponding to each device identifier can be expressed in programming language:

if s∈[∑(i=0,...,m-1)num_i,∑(i=0,...,m)num_i):goto SFF_m,其中,m取值0至k-1。if s∈[∑ (i=0,...,m-1) num_i,∑ (i=0,...,m) num_i): goto SFF_m, where m takes values from 0 to k-1.

上式中的n、num、SFF均代表下一跳SFG内的元素值,%为取模符号,∑(i=0,...,m-1)num_i为num_0到num_m-1的累加值,当m=0时,累加值为0。In the above formula, n, num and SFF all represent the element value in the next hop SFG, % is the modulo symbol, ∑ (i=0,...,m-1) num_i is the accumulated value of num_0 to num_m-1 , when m=0, the accumulated value is 0.

也就是说,在该步骤中,由于在每个SFG中,业务功能转发器均可以被认为是按照预设顺序排列的,例如,图1中实线或者虚线在传递业务报文时经过的业务功能转发器的顺序等,所以,每个业务功能转发器对应的设备标识也可以认为是按照预设顺序排列的,因此,在确定数量值区间时,可以首先计算每个业务功能转发器的设备标识其自身及其之前的至少0个设备标识的对应的业务功能实体的数量总和,例如,如图4所示,当m取不同值时,可以确定多个数量值区间,当m=0时,∑(i=0,...,m-1)num_i的累加值为0,∑(i=0,...,m)num_i的累加值为2(此处是由于累加计算时计算SFF_0对应的业务功能实体的数量,共2个:SF_0和SF_1),当m=1时,∑(i=0,...,h-1)num_i的累加值为2,∑(i=0,...,h)num_i的累加值为3(此处是由于累加计算时计算SFF_0对应的业务功能实体SF_0和SF_1,和,SFF_1对应的业务功能实体SF_2的数量,共3个),……直至m取完k-1的值,可以确定多个数量值区间,这样,当s位于[0,2),则确定下一跳为SFF_0,当s位于[2,3),则确定下一跳为SFF_1,……。在该步骤中,由于每个设备标识均对应一个数量值区间,所以在确定目标数量值区间后可以确定与该目标数量值区间对应的设备标识,进而确定将该设备标识确定为转发路径中的下一跳的业务功能转发器的设备标识,也就是说,分类器在与其下一跳对应的SFG中确定与该设备标识对应的业务功能转发器为转发路径中下一跳的业务功能转发器。That is to say, in this step, because in each SFG, the service function repeaters can be considered to be arranged in a preset order, for example, the solid line or the dotted line in FIG. The order of the function repeaters, etc., therefore, the device identifiers corresponding to each service function repeater can also be considered to be arranged in a preset order. Therefore, when determining the quantity value interval, the equipment of each service function repeater can be calculated first. The sum of the number of corresponding business function entities that identify itself and at least 0 device identifiers before it. For example, as shown in Figure 4, when m takes different values, multiple value intervals can be determined. When m=0 , the accumulated value of ∑ (i=0,...,m-1) num_i is 0, and the accumulated value of ∑ (i=0,...,m) num_i is 2 (here because SFF_0 is calculated during accumulation calculation The number of corresponding business function entities, a total of 2: SF_0 and SF_1), when m=1, the accumulated value of ∑ (i=0,...,h-1) num_i is 2, ∑ (i=0, ...,h) The accumulated value of num_i is 3 (here is due to calculating the number of business function entities SF_0 and SF_1 corresponding to SFF_0, and the number of business function entities SF_2 corresponding to SFF_1, a total of 3), ... Until the value of k-1 is taken by m, multiple quantity value intervals can be determined. In this way, when s is located in [0, 2), the next hop is determined to be SFF_0, and when s is located in [2, 3), the next hop is determined. Jump to SFF_1,  …. In this step, since each device identifier corresponds to a quantity value interval, after the target quantity value interval is determined, the device identifier corresponding to the target quantity value interval can be determined, and then the device identifier in the forwarding path can be determined. The device identifier of the service function forwarder of the next hop, that is, the classifier determines in the SFG corresponding to its next hop that the service function forwarder corresponding to the device identifier is the service function forwarder of the next hop in the forwarding path .

在步骤S105中,所述分类器向所述设备标识对应的业务功能转发器发送所述业务链报文。In step S105, the classifier sends the service chain message to the service function forwarder corresponding to the device identifier.

在该步骤中,分类器根据设备标识确定业务功能转发器的地址,并将业务链报文向与所述地址对应的业务功能转发器发送。In this step, the classifier determines the address of the service function forwarder according to the device identification, and sends the service chain message to the service function forwarder corresponding to the address.

在步骤S106中,业务功能转发器接收转发路径中上一跳设备转发的业务链报文。In step S106, the service function forwarder receives the service chain message forwarded by the previous hop device in the forwarding path.

在本发明实施例中,所述业务链报文中携带有所述转发参数,业务功能转发器在转发路径中的上一跳设备可以指分类器,也可以指业务功能转发器等。In this embodiment of the present invention, the service chain message carries the forwarding parameter, and the last hop device of the service function forwarder in the forwarding path may refer to a classifier, or a service function forwarder or the like.

在步骤S107中,业务功能转发器获取所述业务链报文中的转发参数。In step S107, the service function forwarder obtains the forwarding parameters in the service chain message.

在步骤S108中,业务功能转发器根据所述转发参数确定所述转发路径中下一跳设备标识。In step S108, the service function forwarder determines the identifier of the next-hop device in the forwarding path according to the forwarding parameter.

在该步骤中,如图3所示,例如,当当前的业务功能转发器为与SFG1对应的多个业务功能转发器中的一个时,该当前的业务功能转发器可以根据转发参数和预设的选路方法确定下一跳设备对应的设备标识,这里的下一跳设备可以指在SFG1包括的多个SF、与SFG1对应的多个SFF或者SFG2对应的多个SFF中的一个设备。预设的选路方法可以指取模方法等。In this step, as shown in FIG. 3 , for example, when the current service function repeater is one of multiple service function repeaters corresponding to SFG1, the current service function repeater may The routing method determines the device identifier corresponding to the next-hop device, where the next-hop device may refer to a device among multiple SFs included in SFG1, multiple SFFs corresponding to SFG1, or multiple SFFs corresponding to SFG2. The preset routing method may refer to a modulo method or the like.

在本发明实施例中,所述步骤S108包括以下步骤。In this embodiment of the present invention, the step S108 includes the following steps.

业务功能转发器根据预设转发表确定所述转发路径中下一跳设备的设备类型。The service function forwarder determines the device type of the next-hop device in the forwarding path according to the preset forwarding table.

在本发明实施例中,业务功能转发器中可以设置有用于存储转发路径中每一跳设备的设备标识及设备类型预设转发表,由于业务功能转发器是用于将接收到的业务链报文转发给其对应的任意一个SF或者下一跳的SFF,所以设备类型可以指业务功能实体类型或者业务功能转发器类型等。In this embodiment of the present invention, the service function repeater may be provided with a preset forwarding table for storing the device identifier and device type of each hop device in the forwarding path. Since the service function repeater is used to report the received service chain The message is forwarded to any corresponding SF or the SFF of the next hop, so the device type may refer to the service function entity type or the service function forwarder type.

在该步骤中,业务功能转发器可以从预设转发表中获取下一跳设备的设备类型。In this step, the service function forwarder may obtain the device type of the next-hop device from the preset forwarding table.

当根据所述预设转发表确定的所述转发路径中下一跳设备的设备类型为业务功能转发器时,业务功能转发器根据所述转发参数确定下一跳设备对应的业务功能转发器的设备标识。When the device type of the next-hop device in the forwarding path determined according to the preset forwarding table is a service function forwarder, the service function forwarder determines the service function forwarder corresponding to the next-hop device according to the forwarding parameter. Equipment Identity.

在该步骤中,业务功能转发器可以根据转发参数及预设的选路方法确定下一跳设备对应的业务功能转发器的设备标识。In this step, the service function repeater may determine the device identifier of the service function repeater corresponding to the next-hop device according to the forwarding parameter and the preset routing method.

在本发明实施例中,如图4所示,所述业务功能转发器会关联有多个SFs;所述步骤S108还包括以下步骤。In this embodiment of the present invention, as shown in FIG. 4 , the service function forwarder is associated with multiple SFs; the step S108 further includes the following steps.

当根据所述预设转发表确定的所述转发路径中下一跳设备的设备类型为业务功能实体时,业务功能转发器根据所述转发参数确定下一跳设备对应的业务功能实体的设备标识。When the device type of the next-hop device in the forwarding path determined according to the preset forwarding table is a service function entity, the service function forwarder determines the device identifier of the service function entity corresponding to the next-hop device according to the forwarding parameter .

在该步骤中,业务功能转发器可以从预设转发表中获取下一跳设备的设备类型,当获取的下一跳设备的设备类型为业务功能实体时,业务功能转发器根据所述转发参数及预设的选路方法,确定下一跳设备对应的业务功能实体的设备标识,在确定下一跳设备对应的业务功能实体的设备标识时,如图4所示,假定SFF_i对应n个SFs,记为SF 0,…,SF n-1,其中,连接的本地SF(隶属该SFG,下同)数量记为num_i,显然有n=∑(i=0,...,h-1)num_i。这里预设的选路方法以取模方法为例,取模方法如下,假定该SFF的编号为h:In this step, the service function forwarder may obtain the device type of the next-hop device from the preset forwarding table, and when the obtained device type of the next-hop device is the service function entity, the service function forwarder can obtain the device type of the next-hop device according to the forwarding parameter and the preset routing method, determine the device identity of the service function entity corresponding to the next hop device, when determining the device identity of the service function entity corresponding to the next hop device, as shown in Figure 4, it is assumed that SFF_i corresponds to n SFs , denoted as SF 0, . num_i. The preset routing method here takes the modulo method as an example. The modulo method is as follows, assuming that the number of the SFF is h:

记s=selector%n,Remember s=selector%n,

if s∈[∑(i=0,...,h-1)num_i,∑(i=0,...,h)num_i):goto SF_s;if s∈[∑ (i=0,...,h-1) num_i,∑ (i=0,...,h) num_i):goto SF_s;

else drop packet。else drop packet.

其中,%为取模符号,∑(i=0,...,h-1)num_i为num_0到num_h-1的累加值,当h取不同的值时,可以确定多个数量值区间,当h=0时,∑(i=0,...,h-1)num_i的累加值为0,∑(i=0,...,h)num_i的累加值为2,当h=1时,∑(i=0,...,h-1)num_i的累加值为2,∑(i=0,...,h)num_i的累加值为3,……,这样,当s位于[0,2),则确定下一跳为SF_0,当s位于[2,3),则确定下一跳为SF_1,……。Among them, % is the modulo symbol, ∑ (i=0,...,h-1) num_i is the accumulated value of num_0 to num_h-1. When h takes different values, multiple value intervals can be determined. When When h=0, the accumulated value of ∑ (i=0,...,h-1) num_i is 0, and the accumulated value of ∑ (i=0,...,h) num_i is 2, when h=1 , the accumulated value of ∑ (i=0,...,h-1) num_i is 2, and the accumulated value of ∑ (i=0,...,h) num_i is 3,..., so that when s is located in [ 0, 2), the next hop is determined to be SF_0, and when s is in [2, 3), the next hop is determined to be SF_1, . . .

在步骤S109中,业务功能转发器向所述设备标识对应的下一跳设备发送所述业务链报文。In step S109, the service function forwarder sends the service chain message to the next-hop device corresponding to the device identifier.

在步骤S110中,当所述业务链报文的下一跳设备的设备标识与预设设备标识相同时,业务功能转发器确定所述业务链报文中的预设报文特征。In step S110, when the device identifier of the next-hop device of the service chain message is the same as the preset device identifier, the service function forwarder determines the preset message feature in the service chain message.

在本发明实施例中,预设设备标识可以指接收端设备的设备标识,下一跳设备的设备标识与接收端设备的设备标识相同,即当前的业务功能转发器为转发路径中的最后一跳业务功能转发器。In this embodiment of the present invention, the preset device identification may refer to the device identification of the receiving end device, and the device identification of the next hop device is the same as the device identification of the receiving end device, that is, the current service function forwarder is the last one in the forwarding path. Hop service function repeater.

在该步骤中,由于转发路径中会存在修改报文特征的设备(如NAT),所以最后一跳业务功能转发器接收到的业务链报文中的预设报文特征可能已经被修改,所以此处再次确定业务链报文中的预设报文特征。In this step, since there will be a device (such as NAT) that modifies the packet characteristics in the forwarding path, the preset packet characteristics in the service chain packet received by the last-hop service function forwarder may have been modified. Here, the preset message characteristics in the service chain message are determined again.

在步骤S111中,业务功能转发器向参数管理器发送所述预设报文特征与所述转发参数之间的映射关系。In step S111, the service function forwarder sends the mapping relationship between the preset packet feature and the forwarding parameter to the parameter manager.

在该步骤中,业务功能转发器向参数管理器发送确定的预设报文特征与业务链报文中的转发参数之间的映射关系。In this step, the service function forwarder sends the determined mapping relationship between the preset message feature and the forwarding parameter in the service chain message to the parameter manager.

在步骤S112中,当参数管理器接收到业务功能转发器发送的映射关系时,参数管理器判断所述管理器映射表中是否存在接收的所述映射关系。In step S112, when the parameter manager receives the mapping relationship sent by the service function forwarder, the parameter manager determines whether the received mapping relationship exists in the manager mapping table.

在该步骤中,参数管理器在接收到业务功能转发器发送的映射关系时,将接收到的映射关系与第二映射关系表中的各个映射关系进行对比,判断接收的映射关系是否与第二映射关系表中的各个映射关系均不相同,当接收的映射关系与第二映射关系表中的各个映射关系均不相同时,可以确定所述管理器映射表中不存在接收的所述映射关系。In this step, when receiving the mapping relationship sent by the service function repeater, the parameter manager compares the received mapping relationship with each mapping relationship in the second mapping relationship table, and determines whether the received mapping relationship is the same as the second mapping relationship. Each mapping relationship in the mapping relationship table is different, and when the received mapping relationship is different from each mapping relationship in the second mapping relationship table, it can be determined that the received mapping relationship does not exist in the manager mapping table .

在步骤S113中,当所述管理器映射表中不存在接收的所述映射关系时,参数管理器将接收的所述映射关系加入所述管理器映射表中。In step S113, when the received mapping relationship does not exist in the manager mapping table, the parameter manager adds the received mapping relationship into the manager mapping table.

在步骤S114中,业务功能转发器将所述业务链报文解除封装,得到业务报文。In step S114, the service function forwarder decapsulates the service chain message to obtain a service message.

在该步骤中,业务功能转发器利用封装业务报文时的逆过程对业务链报文进行解封装,并得到业务报文。In this step, the service function forwarder decapsulates the service chain packet by using the reverse process of encapsulating the service packet, and obtains the service packet.

在步骤S115中,业务功能转发器向所述转发路径的接收端发送所述业务报文。In step S115, the service function forwarder sends the service message to the receiving end of the forwarding path.

在该步骤中,业务功能转发器向转发路径的接收端发送解除封装后的业务报文。In this step, the service function forwarder sends the decapsulated service message to the receiving end of the forwarding path.

如图8所示,在本发明的又一实施例中,提供一种报文转发装置,包括:接收模块11、获取模块12、封装模块13、确定模块14和发送模块15。As shown in FIG. 8 , in another embodiment of the present invention, a message forwarding apparatus is provided, including: a receiving module 11 , an obtaining module 12 , an encapsulating module 13 , a determining module 14 and a sending module 15 .

接收模块11,用于接收业务报文,并确定所述业务报文的预设报文特征。The receiving module 11 is configured to receive a service message and determine preset message characteristics of the service message.

获取模块12,用于获取与所述预设报文特征对应的转发参数。The obtaining module 12 is configured to obtain forwarding parameters corresponding to the preset packet characteristics.

封装模块13,用于将所述业务报文封装为业务链报文,所述业务链报文中携带有所述转发参数。The encapsulation module 13 is configured to encapsulate the service message into a service chain message, and the service chain message carries the forwarding parameter.

确定模块14,用于根据所述转发参数确定转发路径中的下一跳的业务功能转发器的设备标识。The determining module 14 is configured to determine, according to the forwarding parameter, the device identifier of the service function forwarder of the next hop in the forwarding path.

发送模块15,用于向所述设备标识对应的业务功能转发器发送所述业务链报文。The sending module 15 is configured to send the service chain message to the service function forwarder corresponding to the device identifier.

在本发明的又一实施例中,所述获取模块,用于:In yet another embodiment of the present invention, the obtaining module is used for:

生成参数查询请求消息,所述参数查询请求消息中携带有所述预设报文特征;generating a parameter query request message, where the parameter query request message carries the preset message feature;

向参数管理器发送所述参数查询请求消息;sending the parameter query request message to the parameter manager;

接收所述参数管理器根据所述参数查询请求返回的所述转发参数。The forwarding parameter returned by the parameter manager according to the parameter query request is received.

在本发明的又一实施例中,所述获取模块,还用于:In yet another embodiment of the present invention, the obtaining module is further configured to:

在分类器映射表中查找是否存在与所述预设报文特征对应的所述转发参数;Find out whether there is the forwarding parameter corresponding to the preset packet feature in the classifier mapping table;

当所述分类器映射表中不存在与所述预设报文特征对应的所述转发参数时,生成所述参数查询请求消息;When the forwarding parameter corresponding to the preset packet feature does not exist in the classifier mapping table, generating the parameter query request message;

当接收到所述参数管理器返回的所述转发参数时,将所述转发参数以及所述预设报文特征的对应关系加入所述分类器映射表。When the forwarding parameter returned by the parameter manager is received, the corresponding relationship between the forwarding parameter and the preset packet feature is added to the classifier mapping table.

在本发明的又一实施例中,所述获取模块,用于:In yet another embodiment of the present invention, the obtaining module is used for:

在分类器映射表中查找是否存在与所述预设报文特征对应的所述转发参数;Find out whether there is the forwarding parameter corresponding to the preset packet feature in the classifier mapping table;

当所述分类器映射表中存在与所述预设报文特征对应的所述转发参数时,从所述分类器映射表中获取与所述预设报文特征对应的所述转发参数。When the forwarding parameters corresponding to the preset packet characteristics exist in the classifier mapping table, the forwarding parameters corresponding to the preset packet characteristics are acquired from the classifier mapping table.

在本发明的又一实施例中,所述转发路径中包含至少一个业务功能组,每个所述业务功能组连接至少两个按照预设顺序排列的业务功能转发器;In another embodiment of the present invention, the forwarding path includes at least one service function group, and each of the service function groups is connected to at least two service function repeaters arranged in a preset order;

所述确定模块,用于:The determining module is used for:

对所述转发参数进行取模计算,得到运算结果;performing modulo calculation on the forwarding parameter to obtain an operation result;

确定所述运算结果所在的目标数量值区间;Determine the target quantity value range in which the operation result is located;

根据预设的数量值区间与设备标识的对应关系将所述目标数量值区间对应的设备标识确定为转发路径中的下一跳的业务功能转发器的设备标识。The device identifier corresponding to the target quantity value interval is determined as the device identifier of the service function repeater of the next hop in the forwarding path according to the corresponding relationship between the preset quantity value interval and the device identifier.

如图9所本发明的又一实施例提供另一种报文转发装置,所述装置包括:接收模块21、获取模块22、确定模块23和发送模块24。As shown in FIG. 9 , another embodiment of the present invention provides another apparatus for forwarding a message. The apparatus includes: a receiving module 21 , an obtaining module 22 , a determining module 23 and a sending module 24 .

接收模块21,用于接收转发路径中上一跳设备转发的业务链报文,所述业务链报文中携带有所述转发参数。The receiving module 21 is configured to receive a service chain message forwarded by a previous hop device in the forwarding path, where the service chain message carries the forwarding parameter.

获取模块22,用于获取所述业务链报文中的转发参数。The obtaining module 22 is configured to obtain the forwarding parameters in the service chain message.

确定模块23,用于根据所述转发参数确定所述转发路径中下一跳设备标识。The determining module 23 is configured to determine the identifier of the next-hop device in the forwarding path according to the forwarding parameter.

发送模块24,用于向所述设备标识对应的下一跳设备发送所述业务链报文。The sending module 24 is configured to send the service chain message to the next-hop device corresponding to the device identifier.

在本发明的又一实施例中,所述确定模块23,用于:In yet another embodiment of the present invention, the determining module 23 is configured to:

根据预设转发表确定所述转发路径中下一跳设备的设备类型;Determine the device type of the next-hop device in the forwarding path according to the preset forwarding table;

当根据所述预设转发表确定的所述转发路径中下一跳设备的设备类型为业务功能转发器时,根据所述转发参数确定下一跳设备对应的业务功能转发器的设备标识。When the device type of the next-hop device in the forwarding path determined according to the preset forwarding table is a service function forwarder, the device identifier of the service function forwarder corresponding to the next-hop device is determined according to the forwarding parameter.

在本发明的又一实施例中,所述业务功能转发器关联有多个业务功能实体。In yet another embodiment of the present invention, the service function forwarder is associated with a plurality of service function entities.

所述确定模块23,还用于:The determining module 23 is also used for:

当根据所述预设转发表确定的所述转发路径中下一跳设备的设备类型为业务功能实体时,根据所述转发参数确定下一跳设备对应的业务功能实体的设备标识。When the device type of the next-hop device in the forwarding path determined according to the preset forwarding table is a service function entity, the device identifier of the service function entity corresponding to the next-hop device is determined according to the forwarding parameter.

在本发明的又一实施例中,所述装置还包括:解除封装模块。In yet another embodiment of the present invention, the apparatus further includes: a decapsulation module.

所述确定模块23还用于当所述业务链报文的下一跳设备的设备标识与预设设备标识相同时,确定所述业务链报文中的预设报文特征。The determining module 23 is further configured to determine the preset message feature in the service chain message when the device identifier of the next hop device of the service chain message is the same as the preset device identifier.

所述发送模块还用于向参数管理器发送所述预设报文特征与所述转发参数之间的映射关系;The sending module is further configured to send the mapping relationship between the preset message feature and the forwarding parameter to the parameter manager;

所述解除封装模块,用于将所述业务链报文解除封装,得到业务报文。The decapsulation module is configured to decapsulate the service chain message to obtain a service message.

所述发送模块还用于向所述转发路径的接收端发送所述业务报文。The sending module is further configured to send the service message to the receiving end of the forwarding path.

如图10所示,在本发明的又一实施例中,一种转发参数管理装置,包括:接收模块31、获取模块32和发送模块33。As shown in FIG. 10 , in another embodiment of the present invention, a forwarding parameter management apparatus includes: a receiving module 31 , an obtaining module 32 and a sending module 33 .

接收模块31,用于接收分类器发送的查询请求消息,所述查询请求消息携带有预设报文特征。The receiving module 31 is configured to receive a query request message sent by the classifier, where the query request message carries preset message characteristics.

获取模块32,用于获取所述查询请求消息中的预设报文特征,以及获取与所述预设报文特征存在映射关系的转发参数。The obtaining module 32 is configured to obtain the preset message feature in the query request message, and obtain forwarding parameters that have a mapping relationship with the preset message feature.

发送模块33,用于向所述分类器发送所述转发参数。A sending module 33, configured to send the forwarding parameter to the classifier.

在本发明的又一实施例中,所述预设报文特征中包含转发路径的第一路径标识和至少一对相同类别的元素,所述获取模块用于:In another embodiment of the present invention, the preset packet feature includes a first path identifier of a forwarding path and at least a pair of elements of the same category, and the obtaining module is configured to:

在管理器映射表中查找与所述预设报文特征存在映射关系的转发参数;Searching for forwarding parameters that have a mapping relationship with the preset message characteristics in the manager mapping table;

当在管理器映射表中查找到所述转发参数时,向所述分类器发送所述转发参数;When the forwarding parameter is found in the manager mapping table, sending the forwarding parameter to the classifier;

当在管理器映射表中未查找到所述转发参数时,在路径标识映射表中查找与所述第一路径标识对应的第二路径标识,将所述第一路径标识替换为第二路径标识,并且将相同类别的元素互换位置,得到更新报文特征,在管理器映射表中查找与所述更新报文特征存在映射关系的转发参数;When the forwarding parameter is not found in the manager mapping table, a second path identifier corresponding to the first path identifier is searched in the path identifier mapping table, and the first path identifier is replaced with a second path identifier , and the elements of the same category are exchanged to obtain the update message feature, and the forwarding parameter that has a mapping relationship with the update message feature is searched in the manager mapping table;

当在管理器映射表中未查找到与所述更新报文特征存在映射关系的转发参数时,根据所述预设报文特征计算转发参数,并且向所述分类器发送所述计算得到的转发参数。When a forwarding parameter that has a mapping relationship with the update message feature is not found in the manager mapping table, the forwarding parameter is calculated according to the preset message feature, and the calculated forwarding is sent to the classifier parameter.

在本发明的又一实施例中,所述装置还包括:判断模块和加入模块。In yet another embodiment of the present invention, the apparatus further includes: a judgment module and a join module.

判断模块,用于当接收到业务功能转发器发送的映射关系时,判断所述管理器映射表中是否存在接收的所述映射关系。A judging module, configured to judge whether the received mapping relationship exists in the manager mapping table when receiving the mapping relationship sent by the service function forwarder.

加入模块,用于当所述管理器映射表中不存在接收的所述映射关系时,将接收的所述映射关系加入所述管理器映射表中。An adding module is configured to add the received mapping relationship to the manager mapping table when the received mapping relationship does not exist in the manager mapping table.

本发明实施例还提供了一种报文转发的装置110,如图11所示,包括:存储器1101、处理器1102和收发器1103,存储器1101用于存储一组代码,处理器1102用于根据该组代码执行如图2和图5-图7中所示的任意一种方法,收发器1103用于和其他设备通信。An embodiment of the present invention further provides an apparatus 110 for forwarding messages, as shown in FIG. 11 , including: a memory 1101, a processor 1102, and a transceiver 1103, where the memory 1101 is used to store a set of codes, and the processor 1102 is used to store a set of codes according to The set of codes performs any one of the methods shown in Figure 2 and Figures 5-7, and the transceiver 1103 is used to communicate with other devices.

其中,存储器1101、处理器1102和收发器1103之间是通过总线系统1104耦合在一起的,其中存储器1101可能包含随机存取存储器,也可能还包括非易失性存储器,例如至少一个磁盘存储器。总线系统1104可以是工业标准体系结构(英文:Industry StandardArchitecture,简称ISA)总线、外部设备互连(英文:Peripheral Component,简称PCI)总线或扩展工业标准体系结构(英文:Extended Industry Standard Architecture,简称EISA)总线等。该总线系统1104可以分为地址总线、数据总线、控制总线等。为便于表示,图11中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The memory 1101, the processor 1102 and the transceiver 1103 are coupled together through a bus system 1104, wherein the memory 1101 may include random access memory, and may also include non-volatile memory, such as at least one disk memory. The bus system 1104 may be an Industry Standard Architecture (English: Industry Standard Architecture, ISA for short) bus, a Peripheral Component (English: Peripheral Component, PCI for short) bus, or an Extended Industry Standard Architecture (English: Extended Industry Standard Architecture, EISA for short) bus ) bus, etc. The bus system 1104 can be divided into an address bus, a data bus, a control bus, and the like. For ease of presentation, only one thick line is used in FIG. 11, but it does not mean that there is only one bus or one type of bus.

其中,图8-图10中的接收模块和发送模块可以集成到收发器1103中,其余模块可以集成到处理器1102中,其余模块可以以硬件形式内嵌于或独立于网络设备的处理器中,也可以以软件形式存储于网络设备的存储器中,以便于处理器调用执行以上各个模块对应的操作,该处理器可以为中央处理器(英文:Central Processing Unit,简称CPU)、特定集成电路(英文:Application Specific Integrated Circuit,简称ASIC)或者是被配置成实施本发明实施例的一个或多个集成电路。Among them, the receiving module and the sending module in FIG. 8-FIG. 10 can be integrated into the transceiver 1103, the remaining modules can be integrated into the processor 1102, and the remaining modules can be embedded in hardware or independent of the processor of the network device , can also be stored in the memory of the network device in the form of software, so that the processor can call and execute the operations corresponding to the above modules. The processor can be a central processing unit (English: Central Processing Unit, referred to as CPU), a specific integrated circuit ( English: Application Specific Integrated Circuit, ASIC for short) or one or more integrated circuits configured to implement embodiments of the present invention.

本发明实施例提供的网络设备110中的各个器件用于执行上述方法,因此,网络设备110的有益效果可以参见上述方法部分所述的有益效果,在此不再赘述。Each device in the network device 110 provided in the embodiment of the present invention is used to execute the above method. Therefore, for the beneficial effects of the network device 110, reference may be made to the beneficial effects described in the above method section, which will not be repeated here.

具体实现中,本发明还提供一种计算机存储介质,其中,该计算机存储介质可存储有程序,该程序执行时可包括本发明提供的报文转发方法的各实施例中的部分或全部步骤。所述的存储介质可为磁碟、光盘、只读存储记忆体(英文:read-only memory,简称:ROM)或随机存储记忆体(英文:random access memory,简称:RAM)等。In a specific implementation, the present invention also provides a computer storage medium, wherein the computer storage medium can store a program, and when the program is executed, it can include some or all of the steps in the various embodiments of the message forwarding method provided by the present invention. The storage medium may be a magnetic disk, an optical disk, a read-only memory (English: read-only memory, ROM for short) or a random access memory (English: random access memory, RAM for short).

本领域的技术人员可以清楚地了解到本发明实施例中的技术可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本发明实施例中的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例或者实施例的某些部分所述的方法。Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such understanding, the technical solutions in the embodiments of the present invention may be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products may be stored in a storage medium, such as ROM/RAM , magnetic disk, optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of the present invention.

本说明书中各个实施例之间相同相似的部分互相参见即可。尤其,对于无线通信设备实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例中的说明即可。It is sufficient to refer to each other for the same and similar parts among the various embodiments in this specification. In particular, for the wireless communication device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for the relevant parts, refer to the descriptions in the method embodiments.

以上所述的本发明实施方式并不构成对本发明保护范围的限定。The embodiments of the present invention described above do not limit the protection scope of the present invention.

Claims (18)

1.一种报文转发方法,其特征在于,包括:1. a message forwarding method, is characterized in that, comprises: 接收业务报文,并确定所述业务报文的预设报文特征;receiving a service message, and determining preset message characteristics of the service message; 获取与所述预设报文特征对应的转发参数,所述转发参数是根据报文特征计算得到的,当所述业务报文通过正向路径传输时,所述报文特征是所述预设报文特征,当所述业务报文通过返程路径传输时,所述报文特征为所述预设报文特征的更新报文特征,所述更新报文特征是所述预设报文特征相同类别的元素互换位置得到的;Acquire forwarding parameters corresponding to the preset packet characteristics, the forwarding parameters are calculated according to packet characteristics, and when the service packet is transmitted through the forward path, the packet characteristics are the preset packet characteristics Message feature, when the service message is transmitted through the return path, the message feature is the update message feature of the preset message feature, and the update message feature is the same as the preset message feature The elements of the category are obtained by swapping positions; 根据所述转发参数封装所述业务报文,以得到封装后的业务报文;Encapsulate the service message according to the forwarding parameter to obtain the encapsulated service message; 根据所述转发参数确定转发路径中的下一跳的设备标识;Determine the device identifier of the next hop in the forwarding path according to the forwarding parameter; 向所述设备标识对应的所述下一跳发送所述封装后的业务报文。Send the encapsulated service message to the next hop corresponding to the device identifier. 2.根据权利要求1所述的报文转发方法,其特征在于,所述获取与所述预设报文特征对应的转发参数,包括:2. The packet forwarding method according to claim 1, wherein the acquiring forwarding parameters corresponding to the preset packet characteristics comprises: 生成参数查询请求消息,所述参数查询请求消息中携带有所述预设报文特征;generating a parameter query request message, where the parameter query request message carries the preset message feature; 向参数管理器发送所述参数查询请求消息;sending the parameter query request message to the parameter manager; 接收所述参数管理器根据所述参数查询请求返回的所述转发参数。The forwarding parameter returned by the parameter manager according to the parameter query request is received. 3.根据权利要求2所述的报文转发方法,其特征在于,所述生成所述参数查询请求消息包括:3. The packet forwarding method according to claim 2, wherein the generating the parameter query request message comprises: 在映射表中查找是否存在与所述预设报文特征对应的所述转发参数;Find out whether there is the forwarding parameter corresponding to the preset message feature in the mapping table; 当所述映射表中不存在与所述预设报文特征对应的所述转发参数时,生成所述参数查询请求消息;When the forwarding parameter corresponding to the preset message characteristic does not exist in the mapping table, generating the parameter query request message; 所述方法还包括:The method also includes: 当接收到所述参数管理器返回的所述转发参数时,将所述转发参数以及所述预设报文特征的对应关系加入所述映射表。When the forwarding parameter returned by the parameter manager is received, the corresponding relationship between the forwarding parameter and the preset packet feature is added to the mapping table. 4.根据权利要求1所述的报文转发方法,其特征在于,所述获取与所述预设报文特征对应的转发参数,包括:4. The message forwarding method according to claim 1, wherein the acquiring forwarding parameters corresponding to the preset message characteristics comprises: 在映射表中查找是否存在与所述预设报文特征对应的所述转发参数;Find out whether there is the forwarding parameter corresponding to the preset message feature in the mapping table; 当所述映射表中存在与所述预设报文特征对应的所述转发参数时,从所述映射表中获取与所述预设报文特征对应的所述转发参数。When the forwarding parameter corresponding to the preset packet feature exists in the mapping table, the forwarding parameter corresponding to the preset packet feature is acquired from the mapping table. 5.根据权利要求1-4中任意一项所述的报文转发方法,其特征在于,所述转发路径中包含至少一个业务功能组,每个所述业务功能组连接至少两个按照预设顺序排列的业务功能转发器;5. The message forwarding method according to any one of claims 1-4, wherein the forwarding path includes at least one service function group, and each of the service function groups connects at least two service function groups according to a preset Sequentially arranged business function repeaters; 根据所述转发参数确定转发路径中的下一跳,包括:Determine the next hop in the forwarding path according to the forwarding parameters, including: 对所述转发参数进行取模计算,得到运算结果;performing modulo calculation on the forwarding parameter to obtain an operation result; 确定所述运算结果所在的目标数量值区间;Determine the target quantity value range in which the operation result is located; 根据预设的数量值区间与设备标识的对应关系将所述目标数量值区间对应的设备标识确定为转发路径中的下一跳的业务功能转发器的设备标识。The device identifier corresponding to the target quantity value interval is determined as the device identifier of the service function repeater of the next hop in the forwarding path according to the corresponding relationship between the preset quantity value interval and the device identifier. 6.一种报文转发方法,其特征在于,所述方法包括:6. A message forwarding method, wherein the method comprises: 接收转发路径中上一跳设备转发的封装的业务报文,所述封装的业务报文中携带有转发参数,所述转发参数是根据报文特征计算得到的,当所述业务报文通过正向路径传输时,所述报文特征是预设报文特征,当所述业务报文通过返程路径传输时,所述报文特征为预设报文特征的更新报文特征,所述更新报文特征是所述预设报文特征相同类别的元素互换位置得到的;Receive the encapsulated service packet forwarded by the previous hop device in the forwarding path, the encapsulated service packet carries forwarding parameters, and the forwarding parameters are calculated according to the packet characteristics. When transmitting to the path, the message feature is a preset message feature, and when the service message is transmitted through the return path, the message feature is an update message feature of the preset message feature, and the update message The text feature is obtained by exchanging positions of elements of the same type of the preset message feature; 获取所述封装的业务报文中的转发参数;obtaining forwarding parameters in the encapsulated service message; 根据所述转发参数确定所述转发路径中下一跳设备标识;Determine the device identifier of the next hop in the forwarding path according to the forwarding parameter; 向所述设备标识对应的下一跳设备发送所述封装的业务报文。Send the encapsulated service message to the next-hop device corresponding to the device identifier. 7.根据权利要求6所述的方法,其特征在于,所述根据所述转发参数确定所述转发路径中下一跳设备标识,包括:7. The method according to claim 6, wherein the determining, according to the forwarding parameter, the identifier of the next-hop device in the forwarding path comprises: 根据预设转发表确定所述转发路径中下一跳设备的设备类型;Determine the device type of the next-hop device in the forwarding path according to the preset forwarding table; 当根据所述预设转发表确定的所述转发路径中下一跳设备的设备类型为业务功能转发器时,根据所述转发参数确定下一跳设备对应的业务功能转发器的设备标识。When the device type of the next-hop device in the forwarding path determined according to the preset forwarding table is a service function forwarder, the device identifier of the service function forwarder corresponding to the next-hop device is determined according to the forwarding parameter. 8.根据权利要求7所述的方法,其特征在于,所述业务功能转发器关联有多个业务功能实体;8. The method according to claim 7, wherein the service function repeater is associated with a plurality of service function entities; 所述根据所述转发参数确定所述转发路径中下一跳设备标识,还包括:The determining, according to the forwarding parameter, the identifier of the next-hop device in the forwarding path further includes: 当根据所述预设转发表确定的所述转发路径中下一跳设备的设备类型为业务功能实体时,根据所述转发参数确定下一跳设备对应的业务功能实体的设备标识。When the device type of the next-hop device in the forwarding path determined according to the preset forwarding table is a service function entity, the device identifier of the service function entity corresponding to the next-hop device is determined according to the forwarding parameter. 9.根据权利要求6至8任一项所述的方法,其特征在于,所述方法还包括:9. The method according to any one of claims 6 to 8, wherein the method further comprises: 当所述下一跳设备的设备标识与预设设备标识相同时,确定所述封装的业务报文中的预设报文特征;When the device identifier of the next-hop device is the same as the preset device identifier, determine the preset message feature in the encapsulated service message; 向参数管理器发送所述预设报文特征与所述转发参数之间的映射关系;sending the mapping relationship between the preset message feature and the forwarding parameter to the parameter manager; 将所述封装的业务报文解除封装以得到解封装的业务报文;decapsulating the encapsulated service message to obtain the decapsulated service message; 向所述转发路径的接收端发送所述解封装的业务报文。Send the decapsulated service message to the receiving end of the forwarding path. 10.一种报文转发装置,其特征在于,包括:10. A message forwarding device, comprising: 接收模块,用于接收业务报文,并确定所述业务报文的预设报文特征;a receiving module, configured to receive a service message and determine preset message characteristics of the service message; 获取模块,用于获取与所述预设报文特征对应的转发参数,所述转发参数是根据报文特征计算得到的,当所述业务报文通过正向路径传输时,所述报文特征是所述预设报文特征,当所述业务报文通过返程路径传输时,所述报文特征为所述预设报文特征的更新报文特征,所述更新报文特征是所述预设报文特征相同类别的元素互换位置得到的;an acquisition module, configured to acquire forwarding parameters corresponding to the preset message characteristics, the forwarding parameters are calculated according to the packet characteristics, and when the service packet is transmitted through the forward path, the packet characteristics is the preset message feature. When the service message is transmitted through the return path, the message feature is an update message feature of the preset message feature, and the update message feature is the preset message feature. It is obtained by assuming that elements of the same type of message feature exchange positions; 封装模块,用于根据所述转发参数封装所述业务报文,以得到封装后的业务报文;an encapsulation module, configured to encapsulate the service message according to the forwarding parameter to obtain an encapsulated service message; 确定模块,用于根据所述转发参数确定转发路径中的下一跳的设备标识;a determining module, configured to determine the device identifier of the next hop in the forwarding path according to the forwarding parameter; 发送模块,用于向所述设备标识对应的所述下一跳发送所述封装后的业务报文。A sending module, configured to send the encapsulated service message to the next hop corresponding to the device identifier. 11.根据权利要求10所述的报文转发装置,其特征在于,所述获取模块,用于:11. The message forwarding device according to claim 10, wherein the obtaining module is configured to: 生成参数查询请求消息,所述参数查询请求消息中携带有所述预设报文特征;generating a parameter query request message, where the parameter query request message carries the preset message feature; 向参数管理器发送所述参数查询请求消息;sending the parameter query request message to the parameter manager; 接收所述参数管理器根据所述参数查询请求返回的所述转发参数。The forwarding parameter returned by the parameter manager according to the parameter query request is received. 12.根据权利要求11所述的报文转发装置,其特征在于,所述获取模块,还用于:12. The message forwarding device according to claim 11, wherein the obtaining module is further configured to: 在映射表中查找是否存在与所述预设报文特征对应的所述转发参数;Find out whether there is the forwarding parameter corresponding to the preset message feature in the mapping table; 当映射表中不存在与所述预设报文特征对应的所述转发参数时,生成所述参数查询请求消息;When the forwarding parameter corresponding to the preset message characteristic does not exist in the mapping table, generating the parameter query request message; 当接收到所述参数管理器返回的所述转发参数时,将所述转发参数以及所述预设报文特征的对应关系加入所述映射表。When the forwarding parameter returned by the parameter manager is received, the corresponding relationship between the forwarding parameter and the preset packet feature is added to the mapping table. 13.根据权利要求10所述的报文转发装置,其特征在于,所述获取模块,用于:13. The message forwarding device according to claim 10, wherein the acquisition module is configured to: 在映射表中查找是否存在与所述预设报文特征对应的所述转发参数;Find out whether there is the forwarding parameter corresponding to the preset message feature in the mapping table; 当所述映射表中存在与所述预设报文特征对应的所述转发参数时,从所述映射表中获取与所述预设报文特征对应的所述转发参数。When the forwarding parameter corresponding to the preset packet feature exists in the mapping table, the forwarding parameter corresponding to the preset packet feature is acquired from the mapping table. 14.根据权利要求10-13中任意一项所述的报文转发装置,其特征在于,所述转发路径中包含至少一个业务功能组,每个所述业务功能组连接至少两个按照预设顺序排列的业务功能转发器;14. The packet forwarding device according to any one of claims 10-13, wherein the forwarding path includes at least one service function group, and each of the service function groups connects at least two service function groups according to a preset Sequentially arranged business function repeaters; 所述确定模块,用于:The determining module is used for: 对所述转发参数进行取模计算,得到运算结果;performing modulo calculation on the forwarding parameter to obtain an operation result; 确定所述运算结果所在的目标数量值区间;Determine the target quantity value range in which the operation result is located; 根据预设的数量值区间与设备标识的对应关系将所述目标数量值区间对应的设备标识确定为转发路径中的下一跳的业务功能转发器的设备标识。The device identifier corresponding to the target quantity value interval is determined as the device identifier of the service function repeater of the next hop in the forwarding path according to the corresponding relationship between the preset quantity value interval and the device identifier. 15.一种报文转发装置,其特征在于,所述装置包括:15. A message forwarding device, wherein the device comprises: 接收模块,用于接收转发路径中上一跳设备转发的封装的业务报文,所述封装的业务报文中携带有转发参数,所述转发参数是根据报文特征计算得到的,当所述业务报文通过正向路径传输时,所述报文特征是预设报文特征,当所述业务报文通过返程路径传输时,所述报文特征为预设报文特征的更新报文特征,所述更新报文特征是所述预设报文特征相同类别的元素互换位置得到的;A receiving module, configured to receive the encapsulated service message forwarded by the previous hop device in the forwarding path, the encapsulated service message carries forwarding parameters, and the forwarding parameters are calculated according to the characteristics of the message. When the service packet is transmitted through the forward path, the packet characteristic is a preset packet characteristic, and when the service packet is transmitted through the return path, the packet characteristic is an update packet characteristic of the preset packet characteristic , the update message feature is obtained by exchanging positions of elements of the same category of the preset message feature; 获取模块,用于获取所述封装的业务报文中的转发参数;an acquisition module for acquiring forwarding parameters in the encapsulated service message; 确定模块,用于根据所述转发参数确定所述转发路径中下一跳设备标识;a determining module, configured to determine the identifier of the next-hop device in the forwarding path according to the forwarding parameter; 发送模块,用于向所述设备标识对应的下一跳设备发送所述封装的业务报文。A sending module, configured to send the encapsulated service message to the next-hop device corresponding to the device identifier. 16.根据权利要求15所述的装置,其特征在于,所述确定模块,用于:16. The apparatus according to claim 15, wherein the determining module is configured to: 根据预设转发表确定所述转发路径中下一跳设备的设备类型;Determine the device type of the next-hop device in the forwarding path according to the preset forwarding table; 当根据所述预设转发表确定的所述转发路径中下一跳设备的设备类型为业务功能转发器时,根据所述转发参数确定下一跳设备对应的业务功能转发器的设备标识。When the device type of the next-hop device in the forwarding path determined according to the preset forwarding table is a service function forwarder, the device identifier of the service function forwarder corresponding to the next-hop device is determined according to the forwarding parameter. 17.根据权利要求16所述的装置,其特征在于,所述业务功能转发器关联有多个业务功能实体;17. The apparatus according to claim 16, wherein the service function forwarder is associated with a plurality of service function entities; 所述确定模块,还用于:The determining module is also used for: 当根据所述预设转发表确定的所述转发路径中下一跳设备的设备类型为业务功能实体时,根据所述转发参数确定下一跳设备对应的业务功能实体的设备标识。When the device type of the next-hop device in the forwarding path determined according to the preset forwarding table is a service function entity, the device identifier of the service function entity corresponding to the next-hop device is determined according to the forwarding parameter. 18.根据权利要求15至17任一项所述的装置,其特征在于,18. The device according to any one of claims 15 to 17, characterized in that, 所述确定模块还用于:当所述下一跳设备的设备标识与预设设备标识相同时,确定所述封装的业务报文中的预设报文特征;The determining module is further configured to: when the device identifier of the next hop device is the same as the preset device identifier, determine the preset message feature in the encapsulated service message; 所述发送模块还用于向参数管理器发送所述预设报文特征与所述转发参数之间的映射关系;The sending module is further configured to send the mapping relationship between the preset message feature and the forwarding parameter to the parameter manager; 所述装置还包括解除封装模块,用于将所述封装的业务报文解除封装,得到解封装的业务报文;The device further includes a decapsulation module for decapsulating the encapsulated service message to obtain the decapsulated service message; 所述发送模块还用于向所述转发路径的接收端发送所述解封装的业务报文。The sending module is further configured to send the decapsulated service message to the receiving end of the forwarding path.
CN202011368863.6A 2016-08-24 2016-08-24 Message forwarding method and device Active CN112671641B (en)

Priority Applications (1)

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

Applications Claiming Priority (2)

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

Related Parent Applications (1)

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

Publications (2)

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

Family

ID=61246334

Family Applications (2)

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

Family Applications After (1)

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

Country Status (2)

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

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110636003A (en) * 2018-06-21 2019-12-31 中国电信股份有限公司 Message forwarding method, device, system and computer readable storage medium
CN111200559B (en) * 2018-11-19 2022-05-10 中国电信股份有限公司 Routing method and routing device
CN111628921B (en) 2019-02-27 2021-07-20 华为技术有限公司 A message processing method, message forwarding device, and message processing device
CN111726293B (en) * 2019-03-18 2021-11-30 华为技术有限公司 Message transmission method and device
CN111147598B (en) * 2019-12-30 2023-04-25 杭州迪普科技股份有限公司 HTTP message processing method and device
CN113141311B (en) * 2020-01-19 2025-07-15 华为技术有限公司 A method and device for obtaining forwarding information
CN113746749A (en) * 2020-05-29 2021-12-03 阿里巴巴集团控股有限公司 Network connection device
CN114125080A (en) * 2021-09-29 2022-03-01 北京信息科技大学 A message chain terminal protocol stack construction method and analysis method, device and terminal
CN114448892B (en) * 2022-02-10 2024-08-20 珠海星云智联科技有限公司 Software and hardware routing method and device
CN117527693A (en) * 2022-08-03 2024-02-06 华为技术有限公司 Message forwarding method, device, system and storage medium
CN115865788B (en) * 2022-11-24 2025-07-11 武汉船舶通信研究所(中国船舶重工集团公司第七二二研究所) IPSec tunnel mode communication method and device for multi-link dynamic routing
CN116095024B (en) * 2023-01-19 2024-10-01 海光信息技术股份有限公司 Verification method, device, electronic device and computer-readable storage medium

Citations (3)

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

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101286936B (en) * 2008-05-16 2010-10-27 成都市华为赛门铁克科技有限公司 Method and apparatus for data message processing
CN102368736B (en) * 2011-11-10 2014-12-10 华为技术有限公司 Message sending method and equipment
WO2014176740A1 (en) * 2013-04-28 2014-11-06 华为技术有限公司 Stream classifier, service routing trigger, and message processing method and system
WO2015010256A1 (en) * 2013-07-23 2015-01-29 华为技术有限公司 Packet forwarding method and device
CN103581018B (en) * 2013-07-26 2017-08-11 北京华为数字技术有限公司 File transmitting method, router and operation exchange device
US20150124622A1 (en) * 2013-11-01 2015-05-07 Movik Networks, Inc. Multi-Interface, Multi-Layer State-full Load Balancer For RAN-Analytics Deployments In Multi-Chassis, Cloud And Virtual Server Environments
CN103607357A (en) * 2013-11-19 2014-02-26 曙光信息产业(北京)有限公司 Message distribution method and message distribution device in system
CN105099919B (en) * 2014-05-15 2018-07-31 华为技术有限公司 Message processing method and device
CN105379218B (en) * 2014-06-17 2018-09-07 华为技术有限公司 Processing method, device and the equipment of Business Stream
US10003530B2 (en) * 2014-07-22 2018-06-19 Futurewei Technologies, Inc. Service chain header and metadata transport
CN105453493B (en) * 2014-07-23 2019-02-05 华为技术有限公司 Service message forwarding method and device
CN104168201B (en) * 2014-08-06 2017-11-24 福建星网锐捷网络有限公司 A kind of method and device of multipath forwarding
CN104283806B (en) * 2014-10-31 2018-01-12 新华三技术有限公司 Business chain processing method and equipment
CN105681198B (en) * 2014-11-21 2018-11-20 华为技术有限公司 A kind of business chain processing method, equipment and system
CN105743822B (en) * 2014-12-11 2019-04-19 华为技术有限公司 A method and device for processing messages

Patent Citations (3)

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

Also Published As

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

Similar Documents

Publication Publication Date Title
CN112671641B (en) Message forwarding method and device
JP7520170B2 (en) Packet processing method and apparatus, device and system
CN107925624B (en) Message forwarding method, device and system based on service function chain SFC
CN107925613B (en) Method, device and system for forwarding message in service function chain SFC
EP2544417B1 (en) Communication system, path control apparatus, packet forwarding apparatus and path control method
KR100453055B1 (en) Method for path MTU discovery on IP network and apparatus thereof
US10148573B2 (en) Packet processing method, node, and system
CN109714274B (en) Method for acquiring corresponding relation and routing equipment
CN107046506B (en) Message processing method, flow classifier and service function example
CN108141416A (en) A kind of message processing method, computing device and message process device
CN110535768B (en) Multicast data transmission method and related equipment
CN111510365B (en) Wi-Fi data packet-based device bridging cloud method, device and medium
JP6195014B2 (en) COMMUNICATION SYSTEM, COMMUNICATION METHOD, RELAY DEVICE, AND COMMUNICATION PROGRAM
WO2017198131A1 (en) Method and system for redirecting data stream, and network device and control device
CN102957589A (en) Method, network node and system for service data transmission
CN109218111B (en) A method and forwarder for processing messages
CN105556916A (en) Network flow information statistics method and apparatus
CN108429680A (en) A virtual private cloud-based routing configuration method, system, medium and equipment
JP5534033B2 (en) Communication system, node, packet transfer method and program
CN110022263B (en) A data transmission method and related device
WO2015039616A1 (en) Method and device for packet processing
CN111526512A (en) Gateway bridging method, device, equipment and medium based on Wi-Fi data packet
JP4623317B2 (en) Communication apparatus, routing method and program
CN106302144B (en) Message processing method, equipment and system
CN117614894B (en) A UPF implementation method, system and device based on programmable switching chip

Legal Events

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