WO2023138351A1 - Traffic forwarding method, packet sending method, message sending method, and apparatus - Google Patents

Traffic forwarding method, packet sending method, message sending method, and apparatus Download PDF

Info

Publication number
WO2023138351A1
WO2023138351A1 PCT/CN2023/070024 CN2023070024W WO2023138351A1 WO 2023138351 A1 WO2023138351 A1 WO 2023138351A1 CN 2023070024 W CN2023070024 W CN 2023070024W WO 2023138351 A1 WO2023138351 A1 WO 2023138351A1
Authority
WO
WIPO (PCT)
Prior art keywords
tunnel
traffic
communication device
flow rule
vpn
Prior art date
Application number
PCT/CN2023/070024
Other languages
French (fr)
Chinese (zh)
Inventor
曹自清
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023138351A1 publication Critical patent/WO2023138351A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/25Routing or path finding in a switch fabric
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4633Interconnection of networks using encapsulation techniques, e.g. tunneling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]

Definitions

  • the present application relates to the field of communication technologies, and in particular to a flow forwarding method, a message sending method, a message sending method and a device.
  • VPN Virtual Private Network
  • IP Internet Protocol
  • a public network may be called a public network
  • an IP address of a device in the public network is called a public network IP address.
  • a VPN routing table can be deployed on the Provider Edge (PE) device.
  • the VPN routing table is independent of the public network routing table, including the correspondence between the private network IP address and the outgoing interface of the PE device. If the destination address of the packet is the private IP address of a device in the VPN, after receiving the packet, the PE device looks up the outgoing interface corresponding to the private IP address according to the VPN routing table, and sends the packet through the outgoing interface to forward VPN traffic.
  • the VPN routing table limits the forwarding performance of traffic. For example, as the number of devices in the VPN increases, the number of private network IP addresses recorded in the VPN routing table will also increase accordingly, resulting in an increase in the time consumed by the PE device to search the VPN routing table. In addition, the packet forwarding path cannot be flexibly controlled according to the VPN routing table.
  • the present application provides a traffic forwarding method, a message sending method, a message sending method and a device, which are used to forward VPN traffic without using a VPN routing table, and improve the forwarding performance of VPN traffic.
  • the present application provides a traffic forwarding method, which can be applied to a first communication device, where the first communication device is a network device for forwarding VPN traffic, such as a PE device in a public network.
  • the traffic forwarding method includes: the first communication device first acquires first traffic filtering information.
  • the first traffic filtering information may be sent by the controller to the first communication device through a notification message, or may be configured by the network management device on the first communication device.
  • the first traffic filtering information includes a VPN label, a first flow rule, and a first traffic filtering action, and the first traffic filtering action includes a first next hop as a redirection, and the first next hop is a first public network IP address of the second communication device.
  • the first traffic filtering action is used to instruct the first communication device to add a VPN label to the packet matching the first flow rule, and forward the VPN tagged packet to the first public network IP address of the second communication device according to the first traffic filtering action.
  • the first communication device forwards the traffic matching the first traffic rule according to the first traffic filtering information. That is to say, the first communication device forwards the packet matching the first flow rule and adding the VPN label to the specified public network IP address according to the indication of the first flow filtering information. In this way, according to the first traffic filtering information, the forwarding of VPN traffic is realized without using the VPN routing table, and the forwarding delay of VPN traffic is reduced.
  • the public network next hop of VPN traffic you can also specify the public network next hop of VPN traffic, flexibly adjust the forwarding path of VPN traffic, and improve the flexible forwarding of VPN traffic. In this way, forwarding the VPN traffic according to the first traffic filtering information can avoid searching the VPN routing table and improve the forwarding performance of the VPN traffic.
  • the first traffic filtering information further includes tunnel type information, where the tunnel type information indicates a tunnel type, and the tunnel is a tunnel for forwarding traffic matching the first flow rule.
  • the first communication device may select a public network tunnel from the multiple public network tunnels between the first communication device and the first IP address of the second communication device according to the tunnel type information as the public network tunnel for forwarding VPN traffic matching the first flow rule.
  • the public network tunnel used to forward the VPN traffic matching the first flow rule is called the first tunnel.
  • the first communication device acquires the first traffic filtering information through a notification message sent by the controller.
  • the notification message sent by the controller to the first communication device is a Border Gateway Protocol (Border Gateway Protocol, BGP) message, and the BGP message includes the first traffic filtering information.
  • BGP Border Gateway Protocol
  • the notification message sent by the controller to the first communication device is a Path Computation Element Communication Protocol (Path Computation Element Communication Protocol, PCEP) message.
  • PCEP Path Computation Element Communication Protocol
  • the VPN label in the first traffic filtering information may be carried as an extended community (Extended Community) attribute in a BGP message sent by the controller to the first communication device.
  • the BGP message includes a first extended community attribute, and the first extended community attribute is used to carry a VPN label.
  • the first extended community attribute further includes a tunnel type field
  • the tunnel type information field is used to carry tunnel type information
  • the tunnel type information is used to indicate the type of the tunnel
  • the tunnel is used to forward VPN traffic matching the first flow rule.
  • the tunnel type field in the first extended community attribute is used to carry tunnel type information of the first tunnel.
  • the first communication device forwards the VPN traffic matching the first flow rule through the first tunnel. Then, before forwarding the VPN traffic, the first communication device first determines the first tunnel. Specifically, the first communication device iterates the first tunnel according to the first public network IP address of the second communication device in the first traffic filtering information, and the identifier of the first tunnel is called a first tunnel identifier. Next, the first communication device associates and stores the VPN label, the first flow rule, the first public network IP address, and the first tunnel identifier on the forwarding plane of the first communication device. In this way, the forwarding plane of the first communication device includes the first association relationship, and the first association relationship includes the association relationship among the VPN label, the first flow rule, the first public network IP address, and the first tunnel identifier.
  • the first association relationship is stored on the forwarding plane of the first communication device in the form of a first flow rule forwarding entry.
  • the first flow rule forwarding entry includes a VPN label, a first index, a first public network IP address, and a first tunnel identifier.
  • the first index is used for indexing the first flow rule, and identifies a storage location of the first flow rule in the first communication device.
  • the first association relationship further includes the type of the first tunnel. That is to say, the first association relationship includes the association relationship among the VPN label, the first flow rule, the first public network IP address, the first tunnel identifier, and the type of the first tunnel.
  • the first flow rule forwarding entry includes a VPN label, a first index, a first public network IP address, a first tunnel identifier, and a type of the first tunnel.
  • the first communication device may also acquire the second traffic filtering information, and forward the VPN traffic according to the second traffic rule information.
  • the second traffic filtering information includes a VPN label, a second traffic rule, and a second traffic filtering action.
  • the VPN label in the second traffic filtering information is the same as the VPN label in the first traffic filtering information
  • the second traffic filtering action includes a redirected second next hop
  • the redirected second next hop is the second public network IP address of the second communication device. That is to say, the second traffic filtering information is used to instruct the first communication device to add a VPN label to the packet matching the second flow rule, and forward it to the second public network IP address of the second communication device.
  • the second traffic filtering information may be obtained by the first communication device according to the notification message sent by the controller, or may be configured by the network management device on the first communication device.
  • the first communication device forwards the VPN traffic matching the second flow rule through the public network tunnel.
  • the public network tunnel used to forward the VPN traffic matching the second flow rule is called the second tunnel.
  • the first communication device may iterate the second tunnel according to the second public network IP address of the second communication device.
  • the identity of the second tunnel is called the second tunnel identity.
  • the first communication device further stores the second association relationship on the forwarding plane of the first communication device.
  • the second association relationship includes the association relationship among the VPN label, the second flow rule, the second public network IP address, and the second tunnel identifier.
  • the first communication device stores the second association relationship in a form of a second flow rule forwarding entry.
  • the second flow rule forwarding entry includes a VPN label, a second index, a second public network IP address, and a second tunnel identifier.
  • the second index is used for indexing the second flow rule, and identifies a storage location of the second flow rule in the first communication device.
  • a method for the first communication device to forward packets according to the first traffic filtering information is introduced below.
  • the first communication device forwards the packet matching the first flow rule based on the first public network IP address. Specifically, the first communication device receives the first packet through the ingress interface bound to the first association relationship. Next, the first communication device determines whether the first packet matches the first flow rule. If the first packet matches the first flow rule, the first communication device adds a VPN label to the first packet, and sends the first packet with the VPN label added to the first next hop to implement forwarding of VPN traffic.
  • the first communication device may search the first flow rule forwarding entry, determine the first index, the VPN label, and the first public network IP address according to the first flow rule forwarding entry, and determine the first flow rule according to the first index.
  • the first communication device forwards the packets matching the first flow rule through the first tunnel. Specifically, the first communication device receives the second message through the ingress interface bound to the first association relationship. Next, the first communication device determines whether the second packet matches the first flow rule. If the second message matches the first flow rule, the first communication device adds a VPN label to the second message, and sends the second message with the VPN label added to the first public network IP address of the second communication device through the first tunnel to realize forwarding of VPN traffic.
  • the first communication device may determine the first tunnel identifier according to the first flow rule forwarding entry. Specifically, the first communication device receives the third packet through the ingress interface bound to the first flow rule forwarding entry. The first communication device determines the first index, the VPN label, the first public network IP address, and the first tunnel identifier according to the first flow rule forwarding entry, and determines the first flow rule according to the first index. Next, the first communication device determines whether the third packet matches the first flow rule. If the third message matches the first flow rule, the first communication device adds a VPN label to the third message, and sends the third message with the VPN label added to the first public network IP address of the second communication device through the first tunnel to realize forwarding of VPN traffic.
  • the first communication device if the first communication device also acquires the second flow matching information, the first communication device forwards the packet matching the second flow rule according to the second flow matching information. Specifically, the first communication device receives the fourth packet through the ingress interface bound to the first flow rule forwarding entry and the second flow rule forwarding entry. Next, the first communication device determines whether the fourth packet matches the first flow rule or the second flow rule. If the fourth packet matches the second flow rule, the first communication device adds a VPN label to the fourth packet, and sends the fourth packet with the VPN tag added to the second public network IP address of the second communication device to implement VPN traffic forwarding.
  • the first communication device may determine the second tunnel identifier according to the second flow rule forwarding entry. Specifically, the first communication device receives the fifth packet through the ingress interface bound to the first flow rule forwarding entry and the second flow rule forwarding entry. Next, the first communication device determines whether the fifth packet matches the first flow rule or the second flow rule.
  • the first communication device determines the VPN label, the second public network IP address and the second tunnel identifier according to the second flow rule forwarding entry, thereby adding the VPN label to the fifth message, and sending the fifth message with the VPN label added to the second public network IP address of the second communication device through the second tunnel to realize forwarding of VPN traffic.
  • the present application provides a message sending method, which can be applied to a first communication device, where the first communication device is a network device for forwarding VPN traffic, such as a PE device in a public network.
  • the message sending method includes: the first communication device receives the first message. Specifically, the inbound interface on which the first communication device receives the first packet is associated with the first association relationship.
  • the first association relationship includes the association relationship between the first flow rule, the VPN label, and the first traffic filtering action.
  • the first traffic filtering action includes a redirected first next hop, and the redirected first next hop is the first public network IP address of the second communication device.
  • the first communication device After receiving the first packet, the first communication device determines the first association relationship according to the incoming interface receiving the first packet, determines the first flow rule according to the first association relationship, and determines whether the first packet matches the first flow rule. If the first packet matches the first flow rule, the first communication device adds a VPN label to the first packet according to the first association relationship, and forwards the first packet with the VPN label added to the first IP address of the second communication device. In this way, the VPN traffic is forwarded according to the first traffic filtering information, the forwarding of the VPN traffic is realized without using the VPN routing table, the forwarding delay of the VPN traffic is reduced, and the forwarding performance of the VPN traffic is improved.
  • the first traffic filtering action further includes a first tunnel identifier, configured to instruct the first communication device to forward traffic matching the first flow rule through the first tunnel.
  • the first tunnel identifier is used to identify the first tunnel, and the first tunnel is the first public network tunnel established between the first communication device and the second communication device.
  • the first communication device when forwarding the first packet, sends the first packet with the VPN label added to the first next hop through the first tunnel.
  • the first association relationship is stored on the forwarding plane of the first communication device in the form of a first flow rule forwarding entry.
  • the first flow rule forwarding entry includes the VPN label, the first index, the first public network IP address of the second communication device, and the first tunnel identifier.
  • the first index is used to index the first flow rule.
  • the forwarding plane of the first communication device further includes a second association relationship
  • the second association relationship includes an association relationship between a second flow rule, a VPN label, and a second traffic filtering action
  • the second traffic filtering action includes a redirected second next hop
  • the redirected second next hop is a second public network IP address of the second communication device. That is to say, the second association relationship is used to instruct the first communication device to forward the VPN traffic matching the second flow rule to the second public network IP address of the second communication device.
  • the first communication device receives the second packet through the ingress interface bound to the first association relationship and the second association relationship, the first communication device first determines whether the second packet matches the first flow rule or the second flow rule. If the second packet matches the second flow rule, the first communication device adds a VPN label to the second packet, and sends the VPN-added second packet to the second next hop.
  • the second traffic filtering action further includes a second tunnel identifier, configured to instruct the first communication device to forward the traffic matching the second flow rule through the second tunnel.
  • the second tunnel identifier is used to identify the second tunnel
  • the second tunnel is a second public network tunnel established between the first communication device and the second communication device.
  • the first communication device sends the second packet with the VPN label added to the second next hop through the second tunnel.
  • the present application provides a message sending method, which is applied to a control and management device, and the control and management device may be a network management device or a controller. If the control management device is a controller, the control management device may be a controller for controlling PE devices in a multi-level controller architecture.
  • the message sending method includes: controlling the management device to acquire first traffic filtering information and sending the first traffic filtering information to the first communication device.
  • the first flow filtering information includes a VPN label, a first flow rule and a first flow filtering action.
  • the first traffic filtering action includes a redirected first next hop, the redirected first next hop is the first public network IP address of the second communication device, and the first traffic filtering action is used to instruct the first communication device to forward VPN traffic matching the first flow rule to the first next hop.
  • the first communication device can forward the VPN traffic according to the first traffic filtering information instead of the VPN routing table, avoiding searching the VPN routing table, and improving the forwarding performance of the VPN traffic.
  • control and management device is a network management device, and the control and management device may obtain first traffic filtering information configured on the network management device by a technician.
  • control management device is a controller, and the control management device may receive the first traffic filtering information sent by the network management device, or obtain the first traffic filtering information configured on the controller by a technician.
  • control management device is a controller used to control the PE device in the multi-level controller architecture
  • the first traffic filtering information may be sent to the control management device by the controller in the multi-level controller architecture that controls the control management device.
  • the first traffic filtering information further includes type information of the first tunnel, where the tunnel type information of the first tunnel is used to indicate the type of the first tunnel.
  • the first tunnel is a public network tunnel established between the first communication device and the second communication device, and is used to forward VPN traffic matching the first flow rule. That is to say, after determining that the message matches the first flow rule, the first communication device may forward the message with the VPN label to the first public network IP address of the second communication device through the first tunnel.
  • control management device is a controller, and the control management device may send the first traffic filtering information to the first communication apparatus by sending a notification message.
  • notification message sent by the control and management device may be a BGP message or a PCEP message.
  • control management device is a controller, and the control management device sends the first traffic filtering information to the first communication apparatus through a BGP message.
  • the VPN label in the first traffic filtering information may be carried in the BGP message as an extended community attribute.
  • the BGP message includes a first extended community attribute, and the first extended community attribute includes a VPN label.
  • the first extended community attribute further includes a tunnel type field, where the tunnel type field is used to carry tunnel type information, and the tunnel type information is used to be a tunnel type, and the tunnel is a public network tunnel that forwards traffic matching the first flow rule.
  • the tunnel type field may be used to carry the tunnel type information of the above-mentioned first tunnel.
  • the control and management device is a controller, and the control and management device sends the first traffic filtering information to the first communication device through a BGP message.
  • the BGP message also includes a route target (Route Target, RT).
  • the routing target RT is associated with the VPN instance in the first communication device.
  • the first traffic filtering information is used to filter the VPN traffic from the VPN site bound to the VPN instance.
  • the first communication device may perform route crossover according to the RT to determine the identifier of the VPN instance corresponding to the first traffic filtering information, thereby determining the ingress interface bound to the first association relationship.
  • the control and management device may also acquire second traffic filtering information, where the second traffic filtering information includes a VPN label, a second flow rule, and a second traffic filtering action, wherein the VPON label in the second traffic filtering information is the same as the VPN label in the first traffic filtering information, and the second traffic filtering action includes a redirected second next hop, and the redirected second next hop is the second public network IP address of the second communication device. That is to say, the second traffic filtering information is used to instruct the first communication device to add a VPN label to the packet matching the second flow rule, and forward it to the second public network IP address of the second communication device. In this way, through the first flow rule and the second flow rule, different VPN traffic flowing through the same device (that is, the second communication device) is distinguished, and flexible forwarding of VPN traffic is realized. .
  • the second traffic filtering information further includes type information of the second tunnel, and the tunnel type information of the second tunnel is used to indicate the type of the second tunnel.
  • the second tunnel is a public network tunnel established between the first communication device and the second communication device, and is used to forward VPN traffic matching the second flow rule. That is to say, after determining that the packet matches the second flow rule, the first communication device may forward the packet with the VPN label to the second public network IP address of the second communication device through the second tunnel.
  • the present application provides a network device for traffic forwarding, the network device is applied to a first communication device, and includes a processing module and a transceiver module.
  • the processing module is configured to acquire first traffic filtering information, the first traffic filtering information includes a VPN label, a first flow rule, and a first traffic filtering action, wherein the first traffic filtering action includes a redirected first next hop, the redirected first next hop is a first public network IP address of a second communication device, and the first traffic filtering action instructs the first communication device to forward traffic matching the first flow rule to the first next hop; the transceiver module is further configured to forward traffic matching the first traffic rule according to the first traffic filtering information.
  • the first traffic filtering information further includes tunnel type information, where the tunnel type information indicates a type of a tunnel, and the tunnel is used to forward traffic matching the first flow rule.
  • the transceiver module is further configured to receive a BGP message sent by the controller, where the BGP message includes the first traffic filtering information.
  • the BGP message includes a first extended community attribute, and the first extended community attribute carries the VPN label.
  • the first extended community attribute further includes a tunnel type field, where the tunnel type field carries tunnel type information, and the tunnel type information indicates a tunnel type, and the tunnel is used to forward traffic matching the first flow rule.
  • the transceiver module is further configured to receive a PCEP message sent by the controller, where the PCEP message includes the first traffic filtering information.
  • the processing module is configured to iterate a first tunnel according to the first public network IP address, and the first tunnel is a first public network tunnel established between the first communication device and the second communication device; a first association relationship is saved on a forwarding plane, and the first association relationship includes an association relationship between the VPN label, the first flow rule, the first public network IP address, and a first tunnel identifier, and the first tunnel identifier is used to identify the first tunnel.
  • the processing module is configured to store a first flow rule forwarding entry on the forwarding plane, where the first flow rule forwarding entry includes the VPN label, a first index, the first public network IP address, and the first tunnel identifier, and the first index is used to index the first flow rule.
  • the first association relationship further includes the type of the first tunnel.
  • the processing module is further configured to obtain second traffic filtering information, where the second traffic filtering information includes the VPN label, a second flow rule, and a second traffic filtering action, wherein the second traffic filtering action carries a redirected second next hop, the redirected second next hop is the second public network Internet Protocol IP address of the second communication device, and the second traffic filtering action instructs the first communication device to forward traffic matching the second flow rule to the second next hop; and forward traffic matching the second flow rule according to the second traffic filtering information.
  • the second traffic filtering information includes the VPN label, a second flow rule, and a second traffic filtering action, wherein the second traffic filtering action carries a redirected second next hop, the redirected second next hop is the second public network Internet Protocol IP address of the second communication device, and the second traffic filtering action instructs the first communication device to forward traffic matching the second flow rule to the second next hop; and forward traffic matching the second flow rule according to the second traffic filtering information.
  • the processing module is configured to iterate a second tunnel according to the second public network IP address, and the second tunnel is a second public network tunnel established between the first communication device and the second communication device; the second association relationship is saved on the forwarding plane, and the second association relationship includes the association relationship between the VPN label, the second flow rule, the second public network IP address, and a second tunnel identifier, and the second tunnel identifier is used to identify the second tunnel.
  • the transceiver module is configured to receive the first message
  • the processing module is configured to add the VPN label to the first packet in response to the first packet matching the first flow rule
  • the transceiver module is further configured to send the first packet with the VPN label added to the first next hop.
  • the transceiver module is configured to receive the second message
  • the processing module is configured to add the VPN label to the second packet in response to the second packet matching the first flow rule
  • the transceiver module is configured to send the second message added with the VPN label to the first next hop through the first tunnel.
  • the transceiver module is configured to receive a third message
  • the processing module is configured to, in response to the match between the third packet and the first flow rule, determine the VPN label and the first tunnel identifier corresponding to the first flow rule according to the forwarding entry of the first flow rule, and add the VPN label to the third packet;
  • the transceiver module is configured to send the third message added with the VPN label to the first next hop through the first tunnel.
  • the transceiver module is configured to receive a fourth message
  • the processing module is configured to add the VPN label to the fourth packet in response to the fourth packet matching the second flow rule;
  • the transceiver module is configured to send the fourth message added with the VPN label to the second next hop.
  • the transceiver module is configured to receive the fifth message
  • the processing module is configured to, in response to the fifth packet matching the second flow rule, determine the VPN label and the second tunnel identifier corresponding to the second flow rule according to the forwarding entry of the second flow rule, and add the VPN label to the fifth packet;
  • the transceiver module is configured to send the fifth packet with the VPN label added to the second next hop through the second tunnel.
  • the present application provides a network device for sending a message, the network device is applied to a first communication device, and includes a transceiver module and a processing module.
  • the transceiver module is configured to receive the first message
  • the processing module is configured to determine a VPN label and a first traffic filtering action according to a first association relationship in response to the first packet matching the first flow rule, the first association relationship includes the association relationship between the first flow rule, the VPN label, and the first traffic filtering action, the first traffic filtering action includes a redirected first next hop, and the redirected first next hop is a first public network IP address of the second communication device; adding the VPN label to the first message;
  • the transceiving module is configured to send the first packet with the VPN label added to the first next hop.
  • the first traffic filtering action further includes a first tunnel identifier, where the first tunnel identifier is used to identify a first tunnel, and the first tunnel is a first public network tunnel established between the first communication device and the second communication device;
  • the transceiver module is configured to send the first packet with the VPN label added to the first next hop through the first tunnel.
  • the processing module is configured to determine a VPN label corresponding to the first flow rule and the first tunnel identifier according to a first flow rule forwarding entry, where the first flow rule forwarding entry includes the VPN label, a first index, the first public network IP address, and a first tunnel identifier, and the first index is used to index the first flow rule.
  • the transceiver module is further configured to receive the second message
  • the processing module is further configured to determine the VPN label and a second traffic filtering action according to a second association relationship in response to the second message matching the second flow rule, the second association relationship includes the association relationship between the second flow rule, the VPN label, and the second traffic filtering action, and the second traffic filtering action includes a redirected second next hop, the redirected second next hop is a second public network Internet Protocol IP address of the second communication device; adding the VPN label to the second message;
  • the transceiving module is further configured to send the second message with the VPN label added to the second next hop.
  • the second traffic filtering action further includes a second tunnel identifier, where the second tunnel identifier is used to identify a second tunnel, and the second tunnel is a second public network tunnel established between the first communication device and the second communication device;
  • the transceiver module is configured to send the second message added with the VPN label to the second next hop through the second tunnel.
  • the present application provides a control and management device for sending messages, the control and management device is applied to a controller or a network management device, and the control and management device includes a processing module and a transceiver module.
  • the processing module is configured to obtain first traffic filtering information, the first traffic filtering information includes a VPN label, a first flow rule, and a first traffic filtering action, wherein the first traffic filtering action includes a redirected first next hop, the redirected first next hop is a first public network IP address of the second communication device, and the first traffic filtering action instructs the first communication device to forward VPN traffic that matches the first flow rule to the first next hop;
  • the transceiver module is configured to send the first traffic filtering information to the first communication device.
  • the first traffic filtering information further includes tunnel type information of a first tunnel, where the tunnel type information of the first tunnel indicates the type of the first tunnel, the first tunnel is used to forward traffic matching the first flow rule, and the first tunnel is a first public network tunnel established between the first communication device and the second communication device.
  • control management device is a controller
  • transceiver module is configured to send a BGP message to the first communication device, where the BGP message includes the first traffic filtering information.
  • the BGP message includes a first extended community attribute, and the first extended community attribute carries the VPN label.
  • the first extended community attribute further includes a tunnel type field, where the tunnel type field carries tunnel type information, and the tunnel type information indicates a tunnel type, and the tunnel is used to forward traffic matching the first flow rule.
  • the BGP message further includes an RT
  • the routing target is associated with a VPN instance in the first communication device
  • the first traffic filtering information is used to filter VPN traffic from a VPN site bound to the VPN instance.
  • the transceiver module is configured to send a PCEP message to the first communication device, where the PCEP message includes the first traffic filtering information.
  • the processing module is further configured to obtain second traffic filtering information, where the second traffic filtering information includes the VPN label, a second flow rule, and a second traffic filtering action, where the second traffic filtering action includes a redirected second next hop, the redirected second next hop is a second public network IP address of the second communication device, and the second traffic filtering action instructs the first communication device to forward traffic matching the second flow rule to the second next hop; and send the second traffic filtering information to the first communication device.
  • the second traffic filtering information includes the VPN label, a second flow rule, and a second traffic filtering action, where the second traffic filtering action includes a redirected second next hop, the redirected second next hop is a second public network IP address of the second communication device, and the second traffic filtering action instructs the first communication device to forward traffic matching the second flow rule to the second next hop; and send the second traffic filtering information to the first communication device.
  • the second traffic filtering information further includes tunnel type information of a second tunnel, where the tunnel type information of the second tunnel indicates the type of the second tunnel, the second tunnel is used to forward traffic matching the second flow rule, and the second tunnel is a second public network tunnel established between the first communication device and the second communication device.
  • the present application provides a network device, the network device includes a processor and a memory, the memory is used to store instructions or program codes, and the processor is used to call and run the instructions or program codes from the memory, so that the network device executes the method in the first aspect or any one of the possible implementations of the first aspect, or executes the second aspect or the method in any one of the possible implementations of the second aspect.
  • the present application provides a control and management device, the control and management device includes a processor and a memory, the memory is used to store instructions or program codes, and the processor is used to call and run the instructions or program codes from the memory, and make the control and management device execute the third aspect and the method in any possible implementation manner of the third aspect.
  • the present application provides a network system, and the network system includes the network device described in the fourth aspect or the fifth aspect, and the control management device described in the sixth aspect.
  • the present application provides a computer-readable storage medium, including instructions, programs or codes, which, when executed on a processor, implement the traffic forwarding method in the first aspect or in any possible implementation of the first aspect, or the message sending method in the second aspect or in any of the possible implementations of the second aspect, or the message sending method in the third aspect or in any of the possible implementations of the third aspect.
  • FIG. 1-A is a schematic diagram of a network architecture provided by an embodiment of the present application.
  • FIG. 1-B is a schematic diagram of another network architecture provided by the embodiment of the present application.
  • FIG. 1-C is a schematic diagram of another network architecture provided by the embodiment of the present application.
  • FIG. 1-D is a schematic diagram of another network architecture provided by the embodiment of the present application.
  • FIG. 2 is a signaling interaction diagram of a traffic forwarding method provided in an embodiment of the present application
  • FIG. 3 is a signaling interaction diagram of a message sending method provided in an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a format of the first extended community attribute provided by the embodiment of the present application.
  • FIG. 5 is a signaling interaction diagram of a message sending method provided in an embodiment of the present application.
  • FIG. 6 is another signaling interaction diagram of the traffic forwarding method provided by the embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a device provided in an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a device provided by an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a device provided by an embodiment of the present application.
  • VPN routing table affects the forwarding performance of VPN traffic. For example, if the number of IP addresses in the VPN routing table is large, it takes a long time for the PE device to search the VPN routing table, which increases the delay of packets in the VPN traffic.
  • the VPN routing table specifies the outbound interface and next hop for transmitting packets, which fixes the forwarding path of VPN traffic and limits the flexibility of VPN traffic forwarding.
  • FIG. 1-A A network architecture of the embodiment of the present application will be briefly introduced below with reference to FIG. 1-A.
  • FIG. 1-A this figure is a schematic structural diagram of a system provided by an embodiment of the present application.
  • the system shown in Figure 1-A it includes device 1, device 2, device 3, CE 1, CE 2, PE 1, PE 2, and P1.
  • CE1 is connected to equipment 1 and PE1 respectively
  • P1 is connected to PE1 and PE2 respectively
  • CE2 is connected to PE2, equipment 2 and equipment 3 respectively.
  • Device 1, Device 2, Device 3, CE1, and CE2 belong to VPN1, and PE1, PE2, and P1 belong to the public network.
  • the private network IP address of device 1 is 100.1.1.1, the private network IP address of device 2 is 200.2.2.2, and the private network IP address of device 3 is 300.3.3.3.
  • the ID of the incoming interface connected to CE1 on PE1 is A1
  • the ID of the outgoing interface connected to P1 on PE1 is A2
  • the ID of the incoming interface connected to P1 on PE2 is B1.
  • VPN instances are created on the PE device, and each VPN instance maintains a separate VPN routing table (also called a private network routing table), among which, a VPN instance can also be called a virtual routing forwarding (Virtual Routing Forwarding, VRF).
  • VRF Virtual Routing Forwarding
  • Different VPN instances on the PE device can be distinguished through the Virtual Routing Forwarding Identifier (VRF ID). Assuming that the VRF ID of the VPN instance corresponding to VPN1 on PE1 is 1, then the VPN routing table corresponding to VPN1 includes the first correspondence between VRF ID1, the private IP address 200.2.
  • the VPN instance on the PE device can be bound to the inbound interface of the PE device, which means that the traffic received through the inbound interface is forwarded through the VPN instance.
  • the inbound interface A1 of PE1 is bound to the VPN instance of VPN1, that is, the inbound interface A1 is associated with VRF ID1.
  • PE1 receives packet 1 with the destination address 200.2.2.2 through ingress interface A1. After receiving packet 1, PE1 determines according to inbound interface A1 that packet 1 is forwarded based on the VPN routing table of VPN1. Next, according to the destination address 200.2.2.2 of the packet 1, PE1 searches the VPN routing table of VPN1 to determine that the outgoing interface corresponding to the packet 1 is the outgoing interface A2, and then forwards the packet 1 through the outgoing interface A2.
  • PE1 receives packet 2 with the destination address 300.3.3.3 through ingress interface A1. After receiving packet 2, PE1 determines according to the inbound interface A1 that packet 2 is forwarded based on the VPN routing table of VPN1. Next, according to the destination address 300.3.3.3 of the packet 2, PE1 searches the VPN routing table of VPN1, determines that the outgoing interface corresponding to the packet 2 is the outgoing interface A2, and forwards the packet 2 through the outgoing interface A2.
  • FIG. 1-B Another network architecture of the embodiment of the present application will be briefly introduced below with reference to FIG. 1-B .
  • FIG. 1-B this figure is another schematic structural diagram of the system provided by the embodiment of the present application.
  • the system shown in Fig. 1-B also includes P2.
  • P2 is connected to PE1 and PE2 respectively.
  • the ID of the outgoing interface connected to P2 on PE1 is A3
  • the ID of the incoming interface connected to P2 on PE2 is B2.
  • PE1 When generating the VPN routing table, PE1 obtains two routes from CE2, one of which includes device 2's private IP address 200.2.2.2, and the other route includes device 3's private IP address 300.3.3.3. After route calculation, the VPN routing table generated by PE1 includes the correspondence between VPN1's VRF ID1, private network IP address 200.2.2.2, and outgoing interface A2, and the correspondence between VPN1's VRF ID1, private network IP address 300.3.3.3, and outgoing interface A2.
  • PE1 forwards the VPN traffic whose destination address is device 2 or device 3 through outbound interface A2.
  • the VPN routing table also includes masks. According to the mask and the private network IP address, the private network routing prefix can be obtained.
  • the above-mentioned determination of the outgoing interface according to the destination address of the message refers to searching the VPN routing table for a private network routing prefix matching the destination address of the message, and then determining the outgoing interface according to the private network routing prefix.
  • the impact of the VPN routing table on the forwarding performance of VPN traffic includes but is not limited to the following three aspects.
  • the first aspect With the continuous increase of VPN routes, the time for querying the VPN routing table continues to increase, thus increasing the forwarding delay of VPN traffic.
  • the VPN routing table includes private IP addresses of devices in the VPN. Then, with the increase of devices in the VPN, the amount of data in the VPN routing table gradually increases. Correspondingly, the time for PE1 to search the VPN routing table will also increase. In this way, the time-consuming for PE1 to forward packets is increased, which affects the forwarding delay of VPN traffic.
  • the VPN routing table limits the forwarding path of packets, reducing the flexibility of VPN traffic forwarding.
  • the VPN routing table specifies the outbound interface and next hop for forwarding packets. That is, after receiving VPN traffic, PE1 forwards it to the next hop through the specified outbound interface according to the VPN routing table. In this way, the forwarding path of the message is limited, and the flexible forwarding of the message cannot be realized.
  • the traffic destined for Device 2 and Device 3 is forwarded through the same outbound interface A2, and the traffic destined for different devices cannot be forwarded through different outbound interfaces, and flexible forwarding of traffic cannot be realized.
  • the VPN routing table is generated based on the VPN routes advertised by other devices. Therefore, if the forwarding path of traffic needs to be adjusted, the VPN routing table of VPN1 needs to be modified by device 2 and/or device 3 to perform route advertisement again. It can be seen that forwarding VPN traffic based on the VPN routing table cannot flexibly adjust the traffic forwarding path.
  • an embodiment of the present application provides a traffic filtering method, in which the first communication device can forward the traffic matching the traffic rule to the next hop of the public network according to the indication of the traffic filtering information.
  • VPN traffic is forwarded based on traffic filtering information instead of the VPN routing table, and VPN traffic can be forwarded without using the VPN routing table. In this way, searching the VPN routing table is avoided, and the forwarding performance of VPN traffic is improved.
  • the PE device may be a device with a forwarding function, such as a router (Router) or a switch (Switch).
  • PE1 and PE2 are capable of forwarding packets based on a Multiprotocol Label Switching (Multiprotocol Label Switching, MPLS) protocol.
  • MPLS Multiprotocol Label Switching
  • the first communication device may be, for example, PE1 in FIG. 1-A and FIG. 1-B, and is used to execute the steps performed by the first communication device in the methods shown in FIG. 2, FIG. 3, FIG. 5 and FIG. 6 below.
  • the second communication device may be, for example, PE2 in FIG. 1-A and FIG. 1-B .
  • the systems shown in Fig. 1-A and Fig. 1-B also include control and management equipment.
  • the control and management device is used to manage PE1.
  • the control and management device may be a controller, a network management device, or other devices capable of controlling and/or managing.
  • the control and management device may be configured to configure first traffic filtering information on PE1 for performing the steps performed by the network management device in the embodiment shown in FIG. 2 .
  • the control management device is a controller
  • the control management device may be used to execute the steps performed by the controller in the embodiments shown in FIG. 2 , FIG. 3 and FIG. 6 below.
  • the system where the control and management device is located may include a multi-level controller architecture.
  • a multi-level controller architecture higher-level controllers can control lower-level controllers.
  • a typical multi-level controller architecture includes a parent controller and multiple child controllers.
  • the control management device (and the controller shown in FIG. 2 , FIG. 3 and FIG. 6 ) in this embodiment of the present application may be a controller for controlling PE devices. This controller can be a parent controller or a child controller.
  • the control management device establishes a neighbor relationship with PE1 and sends a message to PE1.
  • the neighbor relationship between the control management device and PE1 may be a VPN flow rule (Flow Specification, Flowspec) neighbor relationship, or a VPN neighbor relationship.
  • VPN neighbor relationship is established between the control and management device and PE1, it means that the control and management device and PE1 belong to the same VPN.
  • one or more public network tunnels may be established between PE1 and PE2, and the public network tunnels may be Label Distribution Protocol (Label Distribution Protocol, LDP) tunnels or Traffic Engineering (Traffic Engineering, TE) tunnels, or other types of tunnels.
  • LDP Label Distribution Protocol
  • TE Traffic Engineering tunnels
  • a public network tunnel 1 may be established between PE1 and PE2, and the forwarding path corresponding to the public network tunnel 1 is "PE1 ⁇ P1 ⁇ PE2".
  • public network tunnel 1 and public network tunnel 2 are established between PE1 and PE2.
  • the forwarding path corresponding to the public network tunnel 1 is "PE1 ⁇ P1 ⁇ PE2"
  • the forwarding path corresponding to the public network tunnel 2 is "PE1 ⁇ P2 ⁇ PE2”.
  • the tunnel types of the public network tunnels established between PE1 and PE2 can be the same or different.
  • this figure is a signaling interaction diagram of the traffic forwarding method 200 provided in the embodiment of the present application, specifically including the following S201 , S202 and S203 .
  • S201 The control management device acquires first traffic filtering information.
  • the first traffic filtering information is introduced.
  • the first traffic filtering information includes a VPN label, a first traffic filtering action, and a first flow rule, and is used to instruct the communication device to add the VPN label to a message matching the first flow rule, and forward the message to the first public network IP address of the second communication device.
  • the VPN label is a label assigned by the second communication device to the VPN route.
  • the VPN label may be, for example, an MPLS label.
  • the second communication device may allocate VPN labels in a manner of per VPN instance per label, or may allocate VPN labels in a manner of per VPN route per label.
  • the second communication device allocates a VPN label in a manner of per VPN instance per label, multiple VPN routes belonging to the same VPN have the same VPN label. If the second communication device allocates VPN labels in a per-VPN-route-per-label manner, multiple VPN routes belonging to the same VPN have different VPN labels.
  • VPN routes in VPN1 correspond to the same VPN label, and the VPN routes corresponding to device 2 and device 3 correspond to the same VPN label; if PE2 allocates VPN labels per VPN route per label, different VPN routes in VPN1 correspond to different VPN labels, and the VPN routes corresponding to device 2 and VPN routes corresponding to device 3 correspond to different VPN labels.
  • the second communication device uses a label per VPN instance as an example for introduction in the following.
  • the first flow rule is a restriction on packets, and is used to determine whether the packets need to be redirected to the first next hop.
  • a packet matching the first flow rule is added with a VPN label by the first communication device, and forwarded to the first next hop.
  • the first flow rule may include at least one matching rule for matching the value of the characteristic field of the packet, and is used for limiting the value of the characteristic field in the packet.
  • the value of the feature field is consistent with the value defined in the matching rule.
  • the first flow rule includes a first matching rule and a second matching rule. Packets matching the first flow rule are respectively matched with the first matching rule and the second matching rule.
  • the first matching rule is used to limit the value of the destination address field in the message
  • the second matching rule is used to limit the value of the source address field in the message
  • the first matching rule includes the first private network IP address
  • the second matching rule includes the second private network IP address.
  • the destination address of the packet matching the first flow rule is the first private network IP address
  • the source address is the second private network IP address.
  • the first matching rule in the first flow rule includes the private network IP address 200.2.2.2, which is used to limit the value of the message destination address field to 200.2.2.2; the second matching rule in the first flow rule includes the private network IP address 100.1.1.1, and is used to limit the value of the message source address field to 100.1.1.1.
  • PE1 receives packet X, and the destination address of packet X is 200.2.2.2, and the source address is 100.1.1.1, then PE1 determines that packet X matches the first flow rule.
  • the first matching rule and/or the second matching rule may further include a network segment. If the destination address of the packet belongs to the network segment included in the first matching rule, and the source address of the packet belongs to the network segment included in the second matching rule, then the packet matches the first flow rule.
  • the first traffic filtering action includes the first public network IP address of the second communication device, and is used to instruct the first communication device to redirect traffic matching the first flow rule to the first public network IP address of the second communication device.
  • the first public network IP address of the second communication device may also be referred to as the redirected first next hop.
  • the second communication device may correspond to one or more public network IP addresses.
  • the second communication device has multiple interfaces, and each interface may correspond to a public network IP address.
  • the public network IP address corresponding to one interface of the second communication device is the above-mentioned first next hop, that is, the first public network IP address.
  • the first traffic filtering action is used to instruct the first communication device to redirect the traffic matching the first flow rule to the first public network IP address of the second communication device.
  • the second communication device receives traffic matching the first flow rule through the interface corresponding to the first public network IP address.
  • the first traffic filtering information further includes a first tunnel identifier and/or tunnel type information of the first tunnel.
  • the first tunnel identifier is used to identify the first tunnel, for example, it may be a tunnel identifier (Tunnel ID) of the first tunnel.
  • the tunnel type information of the first tunnel is used to indicate the type of the first tunnel.
  • the first tunnel is a first public network tunnel established between the first communication device and the second communication device. Specifically, the first tunnel is a public network tunnel from the first communication device to an interface corresponding to the first public network IP address on the second communication device.
  • the first communication device may determine the first tunnel from the multiple public network tunnels according to the first tunnel type, or the first communication device may select a public network tunnel whose tunnel type matches the tunnel type information of the first tunnel from the multiple public network tunnels as the first tunnel according to the tunnel type information of the first tunnel. That is to say, the first tunnel identifier and/or the tunnel type information of the first tunnel are used to determine the first tunnel.
  • the first traffic filtering information may be configured by a technician on the control and management device.
  • the control management device is a controller
  • the first traffic filtering information may also be generated by the control management device according to the control message.
  • the control message is a message sent by the upper-level controller of the control and management device to the control and management device, and includes first traffic filtering information.
  • S202 The control and management device sends first traffic filtering information to the first communication apparatus.
  • the control management device may send the first traffic filtering information to the first communication device.
  • the control and management device may be a network management device or a controller.
  • the sending of the first traffic filtering information by the control and management device to the first communication device specifically includes but is not limited to the following two manners.
  • Way 1 The control and management device configures first traffic filtering information on the first communication device.
  • control and management device is a network management device
  • the control and management device can configure the first traffic filtering information on the first communication device through a command line or a network configuration protocol (Network Configuration Protocol, NETCONF).
  • the above process may also be referred to as static configuration.
  • the first communication device may acquire the first traffic filtering information based on the content configured by the network management device.
  • control management device may configure the first flow rule forwarding entry on the forwarding plane of the first communication device, so that the forwarding plane of the first communication device forwards traffic according to the first flow rule forwarding entry.
  • first-rate rule forwarding entry refer to the relevant introduction in FIG. 3 , and will not be repeated here.
  • Manner 2 The control and management device sends a first notification message including the first traffic filtering information to the first communication device.
  • the control management device may send the first traffic filtering information to the first communication apparatus through a first notification message.
  • the first notification message includes first traffic filtering information.
  • the first notification message may be generated by the control and management device. Alternatively, if there are multiple levels of controllers in the system, the first notification message may also be generated by the upper-level controller of the control and management device and sent to the control and management device. After receiving the first notification message sent by the superior controller, the control management device may forward the first notification message to the first communication device.
  • the first notification message may include one piece of traffic filtering information (that is, first traffic filtering information), or may include multiple pieces of traffic filtering information.
  • the first notification message may include first traffic filtering information and second traffic filtering information.
  • the first communication device may also obtain the first traffic filtering information through the first notification message.
  • the first notification message is a notification message sent by the controller to the first communication device.
  • S203 The first communication device forwards the traffic matching the first flow rule according to the first traffic filtering information.
  • the first communication device receives multiple packets matching the first flow rule, it may be said that the first communication device has received traffic matching the first flow rule.
  • the first communication device adds a VPN label to the packet matching the first flow rule, and forwards the packet with the VPN label added to the first public network IP address of the second communication device.
  • the foregoing process may be referred to as the first communication device forwarding the traffic matching the first flow rule according to the first traffic filtering information.
  • the control management device sends the first traffic filtering information to the first communication device.
  • the first communication device forwards the packet matching the first flow rule to the designated public network IP address according to the indication of the first flow filtering information. If the packet in the VPN flow matches the first flow rule, the first communication device may forward the packet with the VPN cousin added to the redirected first next hop. In this way, according to the first traffic filtering information, forwarding of VPN traffic is realized without using the VPN routing table. In this way, searching the VPN routing table is avoided, and the forwarding performance of VPN traffic is improved.
  • control management device may also send the second traffic filtering information to the first communication apparatus.
  • the second traffic filtering information includes a second flow rule, a second public network IP address of the second communication device serving as a redirected second next hop, and the VPN label.
  • the first communication device adds the VPN label to the packet matching the second flow rule, and sends it to the second public network IP address of the second communication device.
  • different traffic is forwarded to the second communication device through different transmission paths, thereby implementing differentiated transmission of traffic. It can better meet the requirements of traffic transmission and improve the flexible forwarding of VPN traffic.
  • the technical solution provided by the embodiment of the present application will be described in detail below by taking the first communication device determining the first traffic filtering information according to the first notification message sent by the controller (that is, the second method above) as an example.
  • this figure is a signaling interaction diagram of a message sending method 300 provided in an embodiment of the present application, specifically including the following S301-S303.
  • S301 The controller acquires a first notification message.
  • the controller In order to notify the first communication device of the first traffic filtering information, the controller first obtains a first notification message, and the first notification message includes the first traffic filtering information.
  • the first notification message is generated by the controller, or sent to the controller by a superior controller of the controller.
  • the first notification message may also include multiple pieces of traffic filtering information, for example, the first notification message may include first traffic filtering information and second traffic filtering information.
  • the basic introduction of the first traffic filtering information can be referred to above, and will not be repeated here.
  • the controller sends a first notification message to the first communication device for notifying the Flowspec route, where the first notification message includes a VPN label, a first flow rule and a first flow filtering action.
  • the above-mentioned first flow rule may also be called a matching item (Match), and the above-mentioned VPN label and first traffic filtering action may be called an action item (Action).
  • the VPN label may be reported by the second communication device to the controller, or may be uniformly assigned by the controller.
  • the first notification message may further include tunnel type information and/or a first tunnel identifier of the first tunnel.
  • the first notification message may be a BGP message or a PCEP message.
  • the method for carrying the first traffic filtering information in the first notification message is introduced below.
  • the first notification message may be a BGP update (BGP Update) message.
  • BGP Update BGP Update
  • the foregoing first flow rule may be carried in a Network Layer Reachability Information (Network Layer Reachability Information, NLRI) field of the first notification message.
  • NLRI Network Layer Reachability Information
  • the VPN label and the first traffic filtering action can be carried in the extended community attribute of the new BGP. Specifically, the VPN label and the first traffic filtering action may be carried in the same extended community attribute, or may be carried in different extended community attributes.
  • the first notification message may further include tunnel type information of the first tunnel.
  • the tunnel type information and the VPN label of the first tunnel may be carried in the same extended community attribute.
  • the extended community attribute carrying the tunnel type information and the VPN label of the first tunnel may be referred to as a first extended community attribute.
  • a specific format of the first extended community attribute may be as shown in FIG. 4 .
  • the value of the sub-type (Sub-Type) field of the first extended community attribute is used to identify that the first extended community attribute includes the tunnel type information of the VPN label and the first tunnel
  • the tunnel type (Tunnel Type) field of the first extended community attribute is used to carry the tunnel type information of the first tunnel
  • the MPLS label (MPLS Label) field is used to carry the VPN label.
  • tunnel type information of the first tunnel may also be carried in an independent extended community attribute.
  • a VPN Flowspec neighbor relationship may exist between the first communication device and the controller.
  • the first notification message also includes the first RT.
  • the first communication device may determine the VPN identifier corresponding to the first traffic filtering action according to the first RT.
  • the role of the first RT refer to the introduction of S303, and details will not be repeated here.
  • S302 The controller sends the first notification message to the first communication device.
  • the controller After obtaining the first notification message, the controller sends the first notification message to the first communication device, so that the first communication device obtains first traffic filtering information according to the first notification message.
  • the controller sending the first notification message to the first communication device may also be referred to as the controller sending the Flowspec route to the first communication device.
  • the first communication device generates a first association relationship according to the first traffic filtering information.
  • the first communication device After receiving the first notification message, the first communication device obtains first traffic filtering information according to the first notification message, and generates a first association relationship based on the first traffic filtering information. Next, the first communication device saves the first association relationship in the forwarding plane, so as to add a VPN label to the packet matching the first flow rule according to the first association relationship and forward it to the first public network IP address of the second communication device.
  • the first association relationship includes an association relationship between the VPN label, the first flow rule, and the first next-hop IP address.
  • the first association relationship specifically includes but is not limited to the following three implementation manners.
  • Implementation method 1 the first association relationship includes the association relationship between the VPN label, the first flow rule and the next hop, indicating that the packet matching the first flow rule needs to be added with a VPN label and sent to the first public network IP address of the second communication device.
  • Implementation mode 2 the first association relationship includes the association relationship between the VPN label, the first flow rule, the first tunnel identifier, and the next hop, indicating that the packet matching the first flow rule needs to be added with a VPN label, and sent to the first public network IP address of the second communication device via the first tunnel.
  • Implementation mode 3 the first association relationship includes the association relationship between the VPN label, the first flow rule, the first tunnel identifier, the tunnel type information of the first tunnel, and the next hop.
  • the first association relationship includes the first tunnel identifier.
  • the first tunnel identifier may be carried in the first notification message, or may be determined by the first communication device according to the notification message. Specifically, if the first notification message does not include the first tunnel identifier, the first communication device determines the first tunnel identifier according to the notification message. Specifically, determining the first tunnel identifier by the first communication device specifically includes but is not limited to the following two implementation manners.
  • Implementation manner 1 The first communication device iterates the first tunnel according to the first public network IP address to obtain the first tunnel identifier.
  • the first communication device may search for a public network tunnel reaching the first public network IP address of the second communication device from the multiple tunnels corresponding to the first communication device according to the first public network IP address, and determine the public network tunnel as the first tunnel to obtain the first tunnel identifier.
  • the first communication device determines the first tunnel according to the first public network IP address and the tunnel type information of the first tunnel, and obtains the first tunnel identifier.
  • the first communication device first determines one or more public network tunnels between the first communication device and the first public network IP address according to the first public network IP address, and then selects a public network tunnel whose tunnel type is consistent with that of the first tunnel from the one or more public network tunnels as the first tunnel, and obtains the first tunnel identifier.
  • Embodiment 2 is described with reference to FIG. 1-B. If the first notification message sent by the control and management device to PE1 includes tunnel type information of the first tunnel, and the tunnel type information of the first tunnel indicates that the first tunnel is an LDP-type public network tunnel, then PE1 may determine public network tunnel 1 as the first tunnel. If the tunnel type information of the first tunnel indicates that the first tunnel is a public network tunnel of the TE type, PE1 may determine public network tunnel 2 as the first tunnel.
  • the foregoing first association relationship may be stored in the forwarding plane of the first communication device in the form of a first flow rule forwarding entry.
  • the forwarding plane of the first communication device forwards the VPN traffic based on the first flow rule forwarding entry.
  • the first communication device generating the first association relationship according to the first traffic filtering information includes: the control plane of the first communication device generating a first flow rule forwarding entry according to the first traffic filtering information. After the first flow rule forwarding entry is generated, the control of the first communication device delivers the first flow rule forwarding entry to the forwarding plane of the first communication device.
  • the first flow rule forwarding entry includes the VPN label, the first index and the first public network IP address.
  • the first flow rule forwarding entry includes the VPN label, the first index, the first tunnel identifier and the first public network IP address.
  • the first flow rule forwarding entry includes the VPN label, the first index, the first tunnel identifier, the tunnel type information of the first tunnel, and the first public network IP address.
  • the first index is used to index the first flow rule, for example, may be used to identify a storage location of the first flow rule.
  • the forwarding plane of the first communication device uses the first flow rule to forward the entry, it can search the first flow rule according to the first index, so as to determine whether the packet matches the first flow rule.
  • the first-flow rule forwarding entry may also include the first-flow rule.
  • the first flow rule forwarding entry further includes the identifier of the VPN instance, and the VPN instance identifier is used to identify the VPN instance corresponding to the first flow rule, for example, it may be the VRF ID corresponding to the first flow rule.
  • the first communication device receives the traffic through the ingress interface corresponding to the VRF ID, it can determine according to the VRF ID that the traffic is forwarded based on the first flow rule forwarding entry.
  • the method for the first communication device to obtain the VPN identifier is introduced below.
  • Obtaining the VRF ID by the first communication device specifically includes but is not limited to the following two implementations.
  • Implementation mode 1 the first communication device obtains the VRF ID based on the neighbor relationship with the controller.
  • the first communication device may determine the VRF ID based on the interface receiving the first notification message after receiving the first notification message sent by the control management device.
  • Implementation manner 2 the first communication device obtains the VRF ID based on the first RT.
  • the first notification message sent by the controller also includes the first RT. Then, after receiving the first notification message, the first communication device may perform routing crossover according to the first RT, so as to determine the VRF ID according to the first RT.
  • the above describes the method for the first communication device to obtain the first traffic filtering information according to the first notification message sent by the controller.
  • the process of forwarding traffic by the first communication device will be introduced below with reference to FIG. 5 . It can be understood that, the method shown in FIG. 5 is executed by the forwarding plane of the first communication device.
  • the first flow rule forwarding entry may be generated by the first communication device according to the first notification message, or may be configured by the network management device on the first communication device.
  • this figure is a signaling interaction diagram of a message sending method 500 provided in an embodiment of the present application, specifically including the following S501-S504.
  • S501 The first communication device receives a first message.
  • the source device and the destination device of the first message are devices in the VPN, and the first communication device receives the first message through an inbound interface bound to the VPN.
  • the first message can be a message sent from device 1 to device 2 in Figure 1-A, then the destination address of the first message is the private network IP address 200.2.2.2 of device 2, and the source address of the first message is the private network IP address 100.1.1.1 of device 1.
  • PE1 receives the first packet through the inbound interface A1 bound to VPN1.
  • S502 The first communication device determines that the first packet matches the first flow rule.
  • the first communication device After receiving the first message, the first communication device determines the VRF ID corresponding to the first message according to the incoming interface receiving the first message, and then determines to forward the first message based on the first traffic filtering information according to the VRF ID. Next, the first communication device determines whether the first packet matches the first flow rule.
  • the first communication device stores the first association relationship with the first flow rule forwarding entry.
  • the first communication device may determine the first flow rule forwarding entry according to the VRF ID corresponding to the first message, and then determine the first flow rule according to the first index in the first flow rule forwarding entry, and then determine whether the first packet matches the first flow rule.
  • the first communication device forwards the first packet according to the first traffic filtering action, and performs S503 and S504. If the first packet does not match the first flow rule, and the first packet does not match any other flow rule corresponding to the VRF ID, the first communication device may search the VPN routing table and forward the first packet according to the VPN routing table.
  • the first communication device adds a VPN label to the first packet.
  • S504 The first communication device sends the first packet to which the VPN label is added to the first next hop.
  • the first communication device After determining that the first packet matches the first flow rule, the first communication device forwards the first packet according to the first traffic filtering action. Specifically, the first communication device adds a VPN label to the first message, and sends the first message with the VPN label added to the first public network IP address of the second communication device.
  • the first flow rule forwarding entry may include the first tunnel identifier.
  • the first communication device may determine the first tunnel according to the first tunnel identifier, and send the first packet with the VPN label added through the first tunnel.
  • the controller can configure the first association relationship on the first communication device.
  • the first telecommunications device may determine whether the VPN traffic matches the first flow rule. If the VPN flow matches the first flow rule, the first communication device determines the VPN label and the first next hop corresponding to the first flow rule according to the first association relationship, so as to add a VPN label to the packet in the VPN flow and forward it to the first next hop.
  • the first communication device may forward VPN traffic according to the first traffic filtering information. In this way, searching the VPN routing table is avoided, and the forwarding delay of traffic forwarded by the first communication device is reduced.
  • the first traffic filtering information is configured by the network management device on the first communication device, or the first traffic filtering information is obtained by the first communication device according to the first notification message sent by the controller. If the first association relationship needs to be adjusted, the first traffic filtering information can be reconfigured or a new first advertisement message can be sent, without re-advertising the route and adjusting the VPN routing table. In this way, the forwarding path of traffic can be flexibly adjusted.
  • FIGS. 3 and 5 will be introduced in combination with the application scenario shown in FIG. 1-A and taking the control management device as a controller as an example.
  • the controller To forward the VPN traffic of VPN1, the controller generates a notification message M1 and sends it to PE1.
  • the announcement message M1 includes the first RT, the VPN label 100 of VPN1, the flow rule 1, and the first public network IP address 1.1.1.1 of PE2 as the first next hop of redirection.
  • the first flow rule is used to match traffic sent from device 1 to device 2 .
  • Flow rule forwarding entry 1 includes VRF ID1, flow rule index 1 corresponding to flow rule 1, public network IP address 1.1.1.1 of PE2, tunnel type information LDP of public network tunnel 1, tunnel ID 1 of public network tunnel 1, and VPN label 100.
  • PE1 can receive packet N1 forwarded by CE1 through ingress interface A1. According to the inbound interface A1 that receives packet N1, PE1 determines that packet N1 corresponds to VRF ID1, and judges whether packet N1 matches flow rule 1 according to flow rule forwarding entry 1. After confirming that packet N1 matches flow rule 1, PE1 adds VPN1's VPN label 100 to packet N1, and sends packet N1 with VPN label 100 added to PE2 through public network tunnel 1 to implement VPN traffic forwarding. The transmission process of the packet N1 may be shown in FIG. 1-C.
  • PE1 can generate flow rule forwarding entry 1 according to the notification message sent by the controller.
  • Flow rule forwarding entry 1 instructs PE1 to forward packets matching the first flow rule to the first public IP address of PE2.
  • PE1 can determine whether the packet matches flow rule 1, and if so, PE1 determines VPN label 100 and public network tunnel 1 for forwarding the packet according to flow rule forwarding entry 1.
  • PE1 does not need to forward the traffic of VPN1 according to the VPN routing table of VPN1.
  • searching the VPN routing table is avoided, thereby reducing the time for PE1 to forward packets and improving the forwarding performance of VPN1 traffic.
  • multiple forwarding paths exist between the first communication device and the second communication device.
  • a traffic filtering action can be used to control specific traffic to be transmitted through a specific forwarding path.
  • the first communication device may acquire second traffic filtering information, where the second traffic filtering information includes a VPN label, a second traffic rule, and a second traffic filtering action.
  • the second traffic filtering action includes a redirected second next hop, where the redirected second next hop is the second public network IP address of the second communication device.
  • the first communication device forwards the traffic matching the second flow rule according to the second traffic filtering information. That is to say, for a message matching the second flow rule, the first communication device adds a VPN label to the message, and sends the message to the second public network IP address of the second communication device.
  • traffic matching the first flow rule in the VPN is sent to the first public network IP address of the second communication device, and traffic matching the second flow rule is sent to the second public network IP address of the second communication device.
  • traffic matching the second flow rule is sent to the second public network IP address of the second communication device.
  • the second traffic filtering information may be configured by the network management device on the first communication device, or may be acquired by the first communication device according to a notification message sent by the controller. If the first communication device obtains the second traffic filtering information according to the notification message sent by the controller, the second traffic filtering information and the first traffic filtering information may be carried in the same notification message or in different notification messages. If the second traffic filtering information is carried in an independent notification message, in order to distinguish the first notification message carrying the first traffic filtering information, the notification message carrying the second traffic filtering information is called a second notification message.
  • this figure is another signaling interaction diagram of the traffic forwarding method 600 provided in the embodiment of the present application, which specifically includes the following steps S601-S607. It can be understood that the solution shown in FIG. 6 may be implemented on the basis of any corresponding implementation manner in FIG. 2 , FIG. 3 and FIG. 5 .
  • S601 The controller acquires a second notification message.
  • the controller obtains a second notification message and sends it to the first communication device. Similar to the first notification message, the second notification message may be generated by the controller, or sent to the controller by a superior controller of the controller.
  • the second notification message is used to announce the second traffic filtering information, and the second traffic filtering information includes the VPN label, the second flow rule and the second traffic filtering action.
  • the VPN label in the second traffic filtering information and the VPN label in the first traffic filtering information are the same VPN label.
  • the second traffic filtering action includes a redirected second next hop.
  • the second next hop is the second public network IP address of the second communication device. That is to say, the second flow filtering information is used to instruct the device to add a VPN label to the packet matching the second flow rule, and send the packet to the second public network IP address of the second communication device.
  • the first public network IP address of the second communication device may be the public network IP address of an interface on the second communication device
  • the second public network IP address of the second communication device may be the public network IP address of another interface on the second communication device.
  • the first public IP address of the second communication device may be the public IP address 2.2.2.2 of the interface B1 on PE2
  • the second public IP address of the second communication device may be the public IP address 22.22.22.22 of the interface B2 on PE2.
  • the second notification message may include the second tunnel identifier and/or tunnel type information of the second tunnel.
  • the second tunnel identifier is used to identify the second tunnel
  • the second tunnel is a public network tunnel between the first communication device and the second public network IP address of the second communication device.
  • Figure 1-B as an example for illustration. If the first public network IP address of the second communication device is the public network IP address 2.2.2.2 of the interface B1, and the second public network IP address of the second communication device is the public network IP address 22.22.22.22 of the interface B2, then the first tunnel is the public network tunnel 1 in FIG. 1-B, and the second tunnel is the public network tunnel 2 in FIG. 1-B.
  • S602 The controller sends a second notification message to the first communication device.
  • the controller may send the first notification message and the second notification message together, or may send the first notification message and the second notification message separately.
  • the first traffic filtering information and the second traffic filtering information are sent through two different notification messages (ie, a first notification message and a second notification message). In some other implementations against you, the first traffic filtering information and the second traffic filtering information are sent through the same two notification messages.
  • S603 The first communication device generates a second association relationship according to the second notification message.
  • the first communication device After receiving the second notification message, the first communication device generates a second association relationship according to the second notification message.
  • the second association relationship indicates that packets matching the second flow rule need to be encapsulated with a VPN label and sent to the second public network IP address of the second communication device.
  • the second association relationship is the association relationship between the VPN label, the second flow rule, and the second public network IP address
  • the second association relationship is the association relationship between the VPN label, the second flow rule, the second tunnel identifier, and the second public network IP address
  • the second association relationship is the association relationship between the VPN label, the second flow rule, the second tunnel identifier, the tunnel type information of the second tunnel, and the second public network IP address
  • the second association relationship may be stored in the forwarding plane of the first communication device in the form of a second flow rule forwarding entry.
  • the second flow rule forwarding entry includes a VPN label, a second index, and a second public network IP address.
  • the second flow rule forwarding entry includes a VPN label, a second index, a second tunnel identifier, and a second public network IP address.
  • the second association relationship includes an association relationship among the VPN label, the second index, the second tunnel identifier, and the second public network IP address.
  • the second index is used to index the second flow rule, for example, may be used to identify the storage location of the second flow rule.
  • the second flow rule forwarding entry may also include the second flow rule.
  • the second association relationship is obtained by the first communication device according to the second notification message sent by the controller.
  • the second association relationship may also be configured on the first communication device by the network management device.
  • S604 The first communication device receives the second message.
  • the source device and the destination device of the second message are devices in the VPN, and the destination device of the second message and the source device of the second message are connected through a public network, and the first communication device receives the second message through an inbound interface bound to the VPN.
  • the destination device of the second packet is different from the destination device of the first packet. Taking FIG. 1-B as an example, if the first message is a message sent from device 1 to device 2, the second message may be a message sent from device 1 to device 3.
  • S605 The first communication device determines whether the second packet matches the first flow rule or the second flow rule.
  • the first communication device After receiving the second message, the first communication device determines the VPN identifier corresponding to the second message according to the incoming interface receiving the second message, and determines whether the second message matches the first flow rule in the first association relationship or the second flow rule in the second association relationship according to the VPN identifier. If the second packet matches the first flow rule in the first association relationship, the first communication device forwards the second packet according to the methods shown in S503 and S504. If the second packet matches the second flow rule in the second association relationship, the first communication device forwards the second packet according to the methods shown in S606 and S607. If the second packet does not match neither the first flow rule nor the second flow rule, and the second packet does not match any other flow rule corresponding to the VPN identifier, the first communication device forwards the second packet according to the VPN routing table.
  • S606 The first communication device adds a VPN label to the second packet.
  • S607 The first communication device sends the second packet to which the VPN label is added to the first next hop.
  • the first communication device After determining that the second packet matches the second flow rule, the first communication device adds a VPN label to the second packet, and sends the second packet with the VPN label added to the second public network IP address of the second communication device.
  • the second communication device sends the first packet to which the VPN label is added to the second communication device through the second tunnel.
  • the first communication device may transmit different traffic to the second communication device through different transmission paths.
  • different traffic is transmitted to the same device through different transmission paths, realizing differentiated transmission of traffic. It can better meet the requirements of traffic transmission.
  • the first service flow and the second service flow have different requirements on network performance indicators. Then the first service flow and the second service flow can be distinguished by the first flow rule and the second flow rule, and the first service flow is forwarded through the first tunnel meeting the requirements of the first service flow, and the second service flow is forwarded through the second tunnel meeting the requirements of the second service flow.
  • the VPN traffic can be distinguished by the first flow rule and the second flow rule, so as to forward the VPN traffic through two forwarding paths, realize load sharing, and reduce the pressure on the forwarding path.
  • first flow rule forwarding entry and the second flow rule forwarding entry are generated by the first communication device according to the notification message sent by the controller. If it is necessary to adjust the forwarding path corresponding to the first flow rule and/or the second flow rule, a new notification message may be issued, so that the first communication device generates a new flow rule forwarding entry. In this way, there is no need to re-advertise VPN routes, which improves the flexibility of VPN traffic forwarding.
  • the controller To forward the traffic of VPN1, the controller generates a notification message M1 and a notification message M2, and sends the notification message M1 and the notification message M2 to PE1.
  • the notification message M2 includes the first RT, the VPN label 100 of VPN1, the flow rule 2, and the second public IP address 22.22.22.22 of PE2 as the redirected second next hop.
  • Flow rule 2 is used to match traffic sent from device 1 to device 3
  • PE1 After receiving the notification message M2, PE1 performs route crossover according to the first RT to obtain the VRF ID1 of VPN1, and generates flow rule forwarding entry 2.
  • Flow rule forwarding entry 2 includes VRF ID1, flow rule index 2 corresponding to flow rule 1, second public IP address 22.22.22.22 of PE2, tunnel type information TE of public network tunnel 2, tunnel identifier 2 of public network tunnel 2, and VPN label 100.
  • PE1 can receive packet N1 through ingress interface A1, and forward packet N1 through public network tunnel 1.
  • ingress interface A1 For the specific forwarding process, please refer to the above.
  • PE1 can receive packet N2 through ingress interface A1. According to the inbound interface A1 that receives packet N2, PE1 determines that packet N2 corresponds to VRF ID1, and judges whether packet N2 matches flow rule 1 or flow rule 2 according to flow rule forwarding entry 1 and flow rule forwarding entry 2. After confirming that packet N2 matches flow rule 2, PE1 adds VPN label 100 of VPN1 to packet N2, and sends packet N2 with VPN label 100 added to PE2 through public network tunnel 2 to implement VPN traffic forwarding.
  • the transmission process of message N2 may be shown in Figure 1-D.
  • PE1 obtains flow rule forwarding entry 1 and flow rule forwarding entry 2 corresponding to VPN1.
  • Flow rule forwarding entry 1 instructs PE1 to forward packets matching flow rule 1 to the first public IP address of PE2, and flow rule forwarding entry 2 instructs PE1 to forward packets matching flow rule 2 to the second public IP address of PE2.
  • PE1 can determine whether the traffic matches flow rule 1 or flow rule 2. If the traffic matches flow rule 1, PE1 forwards the traffic to the first public IP address of PE2 according to the indication of flow rule forwarding entry 1; if the traffic matches flow rule 2, PE1 forwards the traffic to the second public IP address of PE2 according to the indication of flow rule forwarding entry 2. In this way, flow rules 1 and 2 are used to distinguish the traffic passing through PE2, realizing flexible forwarding of traffic.
  • the embodiment of the present application also provides a device 700, which can implement the function of the first communication device in the method 200 corresponding to the embodiment shown in FIG. 2, the method 300 corresponding to the embodiment shown in FIG. 3, the method 500 corresponding to the embodiment shown in FIG. 5, and the method 600 corresponding to the embodiment shown in FIG. 6.
  • the device 700 can also implement the method 200 corresponding to the embodiment shown in FIG. 2 , the method 300 corresponding to the embodiment shown in FIG. 3 , the method 500 corresponding to the embodiment shown in FIG. 5 , and the method 600 corresponding to the embodiment shown in FIG. 6 .
  • the device 700 includes a transceiver 10 and a processing module 720, wherein the transceiver module 710 is configured to perform receiving and/or sending operations performed by the first communication device in the methods corresponding to the above embodiments, and the processing module 720 is configured to perform other operations other than the receiving and/or sending operations performed by the first communication device in the methods corresponding to the above embodiments.
  • the transceiving module 710 is configured to perform receiving and/or sending operations performed by the control management device in the methods corresponding to the above embodiments
  • the processing module 720 is configured to perform operations other than the receiving and/or sending operations performed by the control management device in the methods corresponding to the above embodiments
  • the processing module 720 is configured to acquire first traffic filtering information, the first traffic filtering information includes a VPN label, a first flow rule, and a first traffic filtering action, wherein the first traffic filtering action includes a redirected first next hop, the redirected first next hop is the first public network IP address of the second communication device, and the first traffic filtering action instructs the first communication device to forward traffic matching the first flow rule to the first next hop;
  • the first traffic filtering information forwards traffic matching the first traffic rule.
  • the transceiver module 710 is configured to receive a first notification message sent by the controller, where the first notification message includes first traffic filtering information, and the first traffic filtering information includes a VPN label, a first flow rule, and a first traffic filtering action.
  • the first traffic filtering action includes a redirected first next hop, the redirected first next hop is the first public network IP address of the second communication device, and the first traffic filtering action instructs the first communication device to forward traffic matching the first flow rule to the first next hop.
  • the processing module 720 is configured to generate a first association relationship according to the first traffic filtering information.
  • the transceiving module 710 is configured to receive a first message and send a first message with a VPN label added
  • the processing module 720 is used to determine whether the first message matches a first flow rule, and determine a VPN label and a first traffic filtering action according to a first association relationship, the first association relationship includes an association relationship between the first flow rule, the VPN label, and the first traffic filtering action, and the first traffic filtering action includes a redirected first next hop, a redirected first next hop Jumping to the first public network IP address of the second communication device; adding the VPN label to the first message.
  • the transceiver module 710 is configured to receive the second notification message, receive the second message, and send the second message with the VPN tag added to the second communication device.
  • the second notification message includes second traffic filtering information
  • the second traffic filtering information includes the VPN label, the second flow rule and the second traffic filtering action
  • the second traffic filtering action carries a redirected second next hop
  • the redirected second next hop is the second public network IP address of the second communication device.
  • the processing module 720 is configured to generate a second association relationship according to the second notification message, and add a VPN label to the second packet in response to the second packet matching the second flow rule.
  • the processing module 720 is configured to obtain first traffic filtering information, the first traffic filtering information includes a VPN label, a first flow rule, and a first traffic filtering action, wherein the first traffic filtering action includes a redirected first next hop, the redirected first next hop is the first public network IP address of the second communication device, and the first traffic filtering action instructs the first communication device to forward traffic matching the first flow rule to the first next hop.
  • the transceiving module 710 is configured to send the first traffic filtering information to the first communication device.
  • the processing module 720 is used to obtain the first notice message.
  • the first notice message includes the first traffic filtration information includes the VPN label, the first -stage rules, and the first traffic filtration action.
  • the first and next jump is the first public network IP address of the second communication device.
  • the first traffic filtering action indicates the traffic that the first communication device is forwarded to the first jump to the first -class rule.
  • the transceiving module 710 is configured to send the first notification message to the first communication device.
  • the processing module 720 is configured to acquire a second notification message, the second notification message includes second traffic filtering information, and the second traffic filtering information includes a VPN label, a second flow rule, and a first traffic filtering action, wherein the first traffic filtering action includes a redirected second next hop, the redirected second next hop is a second public network IP address of the second communication device, and the second traffic filtering action instructs the first communication device to forward traffic matching the second traffic rule to the second next hop traffic.
  • the transceiving module 710 is configured to send the second notification message to the first communication device.
  • each functional module in the embodiment of the present application may be integrated into one processing module, or each module may exist separately physically, or two or more modules may be integrated into one unit.
  • the acquisition unit and the processing unit may be the same module or different modules.
  • the above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules.
  • the embodiment of the present application also provides a network system, which is used to implement the traffic forwarding method, the packet sending method, and the message sending method in the foregoing method embodiments.
  • the network system includes network equipment and control management equipment.
  • the network device may realize the function of the first communication device in the above method embodiment, and the control and management device may realize the function of the control and management device in the above method embodiment.
  • the specific execution process please refer to the detailed description of the corresponding steps in the above method embodiments, and details will not be repeated here.
  • FIG. 8 is a schematic structural diagram of a device 800 provided in an embodiment of the present application.
  • the above device 700 may be implemented by the device shown in FIG. 8 .
  • the device 800 includes at least one processor 801 , a communication bus 802 , a memory 803 and at least one network interface 804 .
  • the processor 801 may be a central processing unit (English: central processing unit, abbreviated: CPU), a network processor (English: network processor, abbreviated: NP) or a combination of CPU and NP.
  • the processor can also be an application-specific integrated circuit (English: application-specific integrated circuit, abbreviation: ASIC), a programmable logic device (English: programmable logic device, abbreviation: PLD) or a combination thereof.
  • Processor 801 may refer to one processor, or may include multiple processors. For example, processor 801 and processor 805 shown in FIG. 8 . Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor.
  • a processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions). Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor.
  • the processor may be configured to obtain first traffic filtering information, the first traffic filtering information includes a VPN label, a first flow rule, and a first traffic filtering action, wherein the first traffic filtering action includes a redirected first next hop, the redirected first next hop is the first public network IP address of the second communication device, and the first traffic filtering action instructs the first communication device to forward traffic matching the first flow rule to the first next hop; forward traffic matching the first flow rule according to the first traffic filtering information.
  • the first traffic filtering information includes a VPN label, a first flow rule, and a first traffic filtering action, wherein the first traffic filtering action includes a redirected first next hop, the redirected first next hop is the first public network IP address of the second communication device, and the first traffic filtering action instructs the first communication device to forward traffic matching the first flow rule to the first next hop; forward traffic matching the first flow rule according to the first traffic filtering information.
  • Communication bus 802 is used to transfer information between processor 801 , network interface 804 and memory 803 .
  • the memory 803 can be a read-only memory (Read-only Memory, ROM) or other types of static storage devices that can store static information and instructions.
  • the memory 803 can also be a random access memory (Random Access Memory, RAM) or other types of dynamic storage devices that can store information and instructions. Universal Disc, Blu-ray Disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
  • the memory 803 may exist independently, and is connected to the processor 801 through the communication bus 802 .
  • the memory 803 can also be integrated with the processor 801.
  • the storage 803 may refer to one storage, or may include multiple storages.
  • computer-readable instructions are stored in the memory 803, and the computer-readable instructions include a plurality of software modules, such as a transceiver module and a processing module. After executing each software module, the processor 1003 may perform corresponding operations according to the instructions of each software module. In this embodiment of the present application, an operation performed by a software module actually refers to an operation performed by a processor according to an instruction of the software module.
  • the processor 801 may also store program codes or instructions for executing the technical solutions provided by the embodiments of the present application. In this case, the processor 801 does not need to read the program codes or instructions from the memory 1003 .
  • the network interface 804 can be a device such as a transceiver for communicating with other devices or a communication network, and the communication network can be Ethernet, radio access network (RAN) or wireless local area network (Wireless Local Area Networks, WLAN).
  • the network interface 1004 may be used to receive messages sent by other nodes in the segment routing network, and may also send messages to other nodes in the segment routing network.
  • the network interface 804 may be an Ethernet interface (Ethernet), a Fast Ethernet (Fast Ethernet, FE) interface or a Gigabit Ethernet (Gigabit Ethernet, GE) interface, etc.
  • the device 800 may include multiple processors, for example, the processor 801 and the processor 805 shown in FIG. 8 .
  • Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor.
  • a processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
  • FIG. 9 is a schematic structural diagram of a device 900 provided by an embodiment of the present application. Each device in FIG. 1-A and FIG. 1-B can be realized by the device shown in FIG. 9 .
  • the device 900 may be specifically configured to implement any one or more operations in the methods corresponding to the foregoing method embodiments.
  • the device 900 includes a main control board and one or more interface boards.
  • the main control board is communicatively connected with the interface board.
  • the main control board is also called a main processing unit (Main Processing Unit, MPU) or a route processing card (Route Processor Card).
  • the main control board includes a CPU and a memory.
  • the main control board is responsible for the control and management of each component in the device 900, including routing calculation, device management and maintenance functions.
  • the interface board is also called a line processing unit (Line Processing Unit, LPU) or a line card (Line Card), which is used to receive and send packets.
  • the communication between the main control board and the interface board or between the interface board and the interface board is through a bus.
  • the interface boards communicate through the SFU.
  • the device 900 also includes the SFU.
  • the SFU communicates with the main control board and the interface board.
  • the SFU is used to forward data between the interface boards.
  • the SFU may also be called a Switch Fabric Unit (SFU).
  • the interface board includes a CPU, a memory, a forwarding engine, and an interface card (Interface Card, IC), where the interface card may include one or more network interfaces.
  • the network interface may be an Ethernet interface, an FE interface, or a GE interface.
  • the CPU communicates with the memory, the forwarding engine and the interface card respectively.
  • the memory is used to store the forwarding table.
  • the forwarding engine is used to forward the received message based on the forwarding table stored in the memory. If the destination address of the received message is the IP address of the device 900, the message is sent to the CPU of the main control board or the interface board for processing; if the destination address of the received message is not the IP address of the device 900, the forwarding table is checked according to the destination.
  • the forwarding engine may be a network processor (Network Processor, NP).
  • the interface card is also called a daughter card, which can be installed on the interface board. It is responsible for converting the photoelectric signal into a data frame, and checking the validity of the data frame before forwarding it to the forwarding engine for processing or the CPU of the interface board.
  • the CPU can also perform the function of the forwarding engine, such as implementing soft forwarding based on a general-purpose CPU, so that no forwarding engine is needed in the interface board.
  • the forwarding engine may be implemented by ASIC or Field Programmable Gate Array (Field Programmable Gate Array, FPGA).
  • the memory storing the forwarding table can also be integrated into the forwarding engine as a part of the forwarding engine.
  • An embodiment of the present application further provides a chip system, including: a processor, the processor is coupled to a memory, and the memory is used to store a program or an instruction.
  • the chip system implements the traffic forwarding method or message sending method performed by the first communication device in the embodiments shown in FIGS.
  • processors in the chip system there may be one or more processors in the chip system.
  • the processor can be realized by hardware or by software.
  • the processor may be a logic circuit, an integrated circuit, or the like.
  • the processor may be a general-purpose processor implemented by reading software codes stored in a memory.
  • the memory can be integrated with the processor, or can be set separately from the processor, which is not limited in this application.
  • the memory can be a non-transitory processor, such as a read-only memory ROM, which can be integrated with the processor on the same chip, or can be respectively arranged on different chips.
  • the application does not specifically limit the type of the memory and the arrangement of the memory and the processor.
  • the system-on-a-chip can be an FPGA, an ASIC, a system on chip (System on Chip, SoC), a CPU, an NP, a digital signal processing circuit (Digital Signal Processor, DSP), a microcontroller (Micro Controller Unit, MCU), a programmable controller (Programmable Logic Device, PLD) or other integrated chips.
  • SoC System on Chip
  • DSP Digital Signal Processor
  • MCU Micro Controller Unit
  • PLD Programmable Logic Device
  • each step in the foregoing method embodiments may be implemented by an integrated logic circuit of hardware in a processor or instructions in the form of software.
  • the method steps disclosed in connection with the embodiments of the present application may be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
  • the embodiment of the present application also provides a computer-readable storage medium, including instructions, which, when running on a processor, implement any one or more operations in the method performed by the first communication device provided in any of the above method embodiments, or implement any one or more operations in the method performed by the control management device provided in any of the above method embodiments.
  • the embodiment of the present application also provides a computer program product containing instructions, which, when running on a processor, implements any one or more operations in the method performed by the first communication device provided in any of the above method embodiments, or implements any one or more operations in the method performed by the control management device provided in any of the above method embodiments.
  • the disclosed system, device and method can be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical module division.
  • multiple units or components may be combined or integrated into another system, or some features may be ignored or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be obtained according to actual needs to achieve the purpose of the solution of this embodiment.
  • each module unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software module units.
  • the integrated unit is implemented in the form of a software module unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of the present application essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product
  • the computer software product is stored in a storage medium, and includes several instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the application.
  • the aforementioned storage medium includes: various media that can store program codes such as U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk.
  • the functions described in the present invention may be implemented by hardware, software, firmware or any combination thereof.
  • the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium.
  • Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another.
  • a storage media may be any available media that can be accessed by a general purpose or special purpose computer.

Landscapes

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

Abstract

The present application provides a traffic forwarding method, a packet sending method, a message sending method, and an apparatus, used for forwarding virtual private network (VPN) traffic when a VPN routing table is not used, and improving the forwarding performance of the VPN traffic. The traffic forwarding method is implemented by a first communication apparatus, and specifically comprises: obtaining first traffic filtering information, the first traffic filtering information comprising a VPN tag, a first flow rule, and a first traffic filtering action, wherein the first traffic filtering action comprises a redirected first next hop, the redirected first next hop is a first public Internet protocol (IP) address of a second communication apparatus, and the first traffic filtering action instructs the first communication apparatus to forward traffic matching the first flow rule to the first next hop; and forwarding, according to the first traffic filtering information, the traffic matching the first flow rule.

Description

一种流量转发方法、报文发送方法、消息发送方法及装置A flow forwarding method, message sending method, message sending method and device
本申请要求于2022年01月21日提交中国国家知识产权局、申请号为202210074405.4、发明名称为“一种流量转发方法、报文发送方法、消息发送方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed with the State Intellectual Property Office of China on January 21, 2022, with the application number 202210074405.4, and the title of the invention is "A traffic forwarding method, message sending method, message sending method and device", the entire content of which is incorporated in this application by reference.
技术领域technical field
本申请涉及通信技术领域,尤其涉及涉及一种流量转发方法、报文发送方法、消息发送方法及装置。The present application relates to the field of communication technologies, and in particular to a flow forwarding method, a message sending method, a message sending method and a device.
背景技术Background technique
虚拟专用网(Virtual Private Network,VPN)技术可以在公共网络中建立专用的通信网络。该专用的通信网络可以被称为VPN或者私网。设备在VPN中的互联网协议(Internet Protocol,IP)被称为私网IP地址。相应的,公共网络可以被称为公网,设备在公网中的IP地址被称为公网IP地址。Virtual Private Network (VPN) technology can establish a dedicated communication network in a public network. This dedicated communication network may be called a VPN or private network. The Internet Protocol (IP) of the device in the VPN is called the private network IP address. Correspondingly, a public network may be called a public network, and an IP address of a device in the public network is called a public network IP address.
为了转发VPN流量,可以在运营商边缘(Provider Edge,PE)设备上部署VPN路由表。VPN路由表独立于公网路由表,包括私网IP地址与PE设备的出接口之间的对应关系。如果报文的目的地址为VPN中某设备的私网IP地址,在接收到通过该报文之后,PE设备根据VPN路由表查找该私网IP地址对应的出接口,并通过出接口发送报文,实现VPN流量的转发。In order to forward VPN traffic, a VPN routing table can be deployed on the Provider Edge (PE) device. The VPN routing table is independent of the public network routing table, including the correspondence between the private network IP address and the outgoing interface of the PE device. If the destination address of the packet is the private IP address of a device in the VPN, after receiving the packet, the PE device looks up the outgoing interface corresponding to the private IP address according to the VPN routing table, and sends the packet through the outgoing interface to forward VPN traffic.
但是,VPN路由表限制了流量的转发性能。例如,随着VPN中设备数量的增加,VPN路由表中记载的私网IP地址的数量也会相应地增加,导致PE设备查找VPN路由表消耗的时间增加。另外,根据VPN路由表转发报文也无法灵活地控制报文的转发路径。However, the VPN routing table limits the forwarding performance of traffic. For example, as the number of devices in the VPN increases, the number of private network IP addresses recorded in the VPN routing table will also increase accordingly, resulting in an increase in the time consumed by the PE device to search the VPN routing table. In addition, the packet forwarding path cannot be flexibly controlled according to the VPN routing table.
发明内容Contents of the invention
本申请提供了一种流量转发方法、报文发送方法、消息发送方法及装置,用于在不使用VPN路由表的前提下转发VPN流量,提升VPN流量的转发性能。The present application provides a traffic forwarding method, a message sending method, a message sending method and a device, which are used to forward VPN traffic without using a VPN routing table, and improve the forwarding performance of VPN traffic.
第一方面,本申请提供了一种流量转发方法,该方法可以应用于第一通信装置,第一通信装置是用于转发VPN流量的网络设备,例如可以是公网中的PE设备。具体地,所述流量转发方法包括:第一通信装置先获取第一流量过滤信息。第一流量过滤信息可以是控制器通过通告报文向第一通信装置发送的,也可以是网管设备在第一通信装置上配置的。第一流量过滤信息包括VPN标签、第一流规则和第一流量过滤动作,第一流量过滤动作包括作为重定向的第一下一跳,该第一下一跳是第二通信装置的第一公网IP地址。第一流量过滤动作用于指示第一通信装置为与第一流规则匹配的报文添加VPN标签,并根据第一流量过滤动作将添加了VPN标签的报文向第二通信装置的第一公网IP地址。相应地,在获取到第一流量过滤信息之后,第一通信装置根据第一流量过滤信息转发与第一流规则匹配的流量。也就是说,第一通信装置根据第一流量过滤信息的指示,向指定的公网IP地址转发与第一流规则匹配、且添加了VPN标签的报文。这样,根据第一流量过滤信息,在不使用VPN路由表的前提下实现了VPN流量的转发,降低了VPN流量的转发时延。另外,通过第一流量过滤信息,还可以指定VPN流量的公网下一跳,灵活地调整VPN流量的转发路径,提升VPN流量的灵活转发。如此,根据第一流量过滤信息转发VPN流量,可以避 免查找VPN路由表,提升了VPN流量的转发性能。In a first aspect, the present application provides a traffic forwarding method, which can be applied to a first communication device, where the first communication device is a network device for forwarding VPN traffic, such as a PE device in a public network. Specifically, the traffic forwarding method includes: the first communication device first acquires first traffic filtering information. The first traffic filtering information may be sent by the controller to the first communication device through a notification message, or may be configured by the network management device on the first communication device. The first traffic filtering information includes a VPN label, a first flow rule, and a first traffic filtering action, and the first traffic filtering action includes a first next hop as a redirection, and the first next hop is a first public network IP address of the second communication device. The first traffic filtering action is used to instruct the first communication device to add a VPN label to the packet matching the first flow rule, and forward the VPN tagged packet to the first public network IP address of the second communication device according to the first traffic filtering action. Correspondingly, after acquiring the first traffic filtering information, the first communication device forwards the traffic matching the first traffic rule according to the first traffic filtering information. That is to say, the first communication device forwards the packet matching the first flow rule and adding the VPN label to the specified public network IP address according to the indication of the first flow filtering information. In this way, according to the first traffic filtering information, the forwarding of VPN traffic is realized without using the VPN routing table, and the forwarding delay of VPN traffic is reduced. In addition, through the first traffic filtering information, you can also specify the public network next hop of VPN traffic, flexibly adjust the forwarding path of VPN traffic, and improve the flexible forwarding of VPN traffic. In this way, forwarding the VPN traffic according to the first traffic filtering information can avoid searching the VPN routing table and improve the forwarding performance of the VPN traffic.
在一种可能的实现方式中,第一流量过滤信息还包括隧道类型信息,隧道类型信息指示隧道的类型,该隧道为用于转发与第一流规则匹配的流量的隧道。相应地,第一通信装置可以根据隧道类型信息,从第一通信装置到第二通信装置的第一IP地址之间的多条公网隧道之中选择一条公网隧道,作为转发与第一流规则匹配的VPN流量的公网隧道。在本申请技术方案中,该用于转发与第一流规则匹配的VPN流量的公网隧道被称为第一隧道。In a possible implementation manner, the first traffic filtering information further includes tunnel type information, where the tunnel type information indicates a tunnel type, and the tunnel is a tunnel for forwarding traffic matching the first flow rule. Correspondingly, the first communication device may select a public network tunnel from the multiple public network tunnels between the first communication device and the first IP address of the second communication device according to the tunnel type information as the public network tunnel for forwarding VPN traffic matching the first flow rule. In the technical solution of the present application, the public network tunnel used to forward the VPN traffic matching the first flow rule is called the first tunnel.
在一种可能的实现方式中,第一通信装置通过控制器发送的通告消息获取第一流量过滤信息。具体地,控制器向第一通信装置发送的通告消息是边界网关协议(Border Gateway Protocol,BGP)消息,BGP消息包括第一流量过滤信息。或者,控制器向第一通信装置发送的通告消息是路径计算单元通信协议(Path Computation Element Communication Protocol,PCEP)消息。In a possible implementation manner, the first communication device acquires the first traffic filtering information through a notification message sent by the controller. Specifically, the notification message sent by the controller to the first communication device is a Border Gateway Protocol (Border Gateway Protocol, BGP) message, and the BGP message includes the first traffic filtering information. Alternatively, the notification message sent by the controller to the first communication device is a Path Computation Element Communication Protocol (Path Computation Element Communication Protocol, PCEP) message.
在一种可能的实现方式中,第一流量过滤信息中的VPN标签可以作为扩展团体(Extended Community)属性被携带在控制器向第一通信装置发送的BGP消息中。具体地,BGP消息包括第一扩展团体属性,第一扩展团体属性用于携带VPN标签。In a possible implementation manner, the VPN label in the first traffic filtering information may be carried as an extended community (Extended Community) attribute in a BGP message sent by the controller to the first communication device. Specifically, the BGP message includes a first extended community attribute, and the first extended community attribute is used to carry a VPN label.
在一种可能的实现方式中,第一扩展团体属性还包括隧道类型字段,隧道类型信息字段用于承载隧道类型信息,隧道类型信息用于指示隧道的类型,隧道用于转发与第一流规则匹配的VPN流量。具体地,第一扩展团体属性中隧道类型字段用于携带第一隧道的隧道类型信息。In a possible implementation manner, the first extended community attribute further includes a tunnel type field, the tunnel type information field is used to carry tunnel type information, the tunnel type information is used to indicate the type of the tunnel, and the tunnel is used to forward VPN traffic matching the first flow rule. Specifically, the tunnel type field in the first extended community attribute is used to carry tunnel type information of the first tunnel.
在一种可能的实现方式中,第一通信装置通过第一隧道转发与第一流规则匹配的VPN流量。那么在转发VPN流量之前,第一通信装置先确定第一隧道。具体地,第一通信装置根据第一流量过滤信息中第二通信装置的第一公网IP地址迭代第一隧道,第一隧道的标识被称为第一隧道标识。接着,第一通信装置将VPN标签、第一流规则、第一公网IP地址和第一隧道标识关联存储到第一通信装置的转发面。这样,第一通信装置的转发面包括第一关联关系,第一关联关系包括VPN标签、第一流规则、第一公网IP地址和第一隧道标识之间的关联关系。In a possible implementation manner, the first communication device forwards the VPN traffic matching the first flow rule through the first tunnel. Then, before forwarding the VPN traffic, the first communication device first determines the first tunnel. Specifically, the first communication device iterates the first tunnel according to the first public network IP address of the second communication device in the first traffic filtering information, and the identifier of the first tunnel is called a first tunnel identifier. Next, the first communication device associates and stores the VPN label, the first flow rule, the first public network IP address, and the first tunnel identifier on the forwarding plane of the first communication device. In this way, the forwarding plane of the first communication device includes the first association relationship, and the first association relationship includes the association relationship among the VPN label, the first flow rule, the first public network IP address, and the first tunnel identifier.
在一种可能的实现中,第一关联关系以第一流规则转发表项的形式被存储在第一通信装置的转发面。其中,第一流规则转发表项包括VPN标签、第一索引、第一公网IP地址和第一隧道标识。其中,第一索引用于索引第一流规则,标识第一流规则在第一通信装置中的存储位置。In a possible implementation, the first association relationship is stored on the forwarding plane of the first communication device in the form of a first flow rule forwarding entry. Wherein, the first flow rule forwarding entry includes a VPN label, a first index, a first public network IP address, and a first tunnel identifier. Wherein, the first index is used for indexing the first flow rule, and identifies a storage location of the first flow rule in the first communication device.
在一种可能的实现中,第一关联关系还包括第一隧道的类型。也就是说,第一关联关系包括VPN标签、第一流规则、第一公网IP地址、第一隧道标识和第一隧道的类型之间的关联关系。相应地,第一流规则转发表项包括VPN标签、第一索引、第一公网IP地址、第一隧道标识和第一隧道的类型。In a possible implementation, the first association relationship further includes the type of the first tunnel. That is to say, the first association relationship includes the association relationship among the VPN label, the first flow rule, the first public network IP address, the first tunnel identifier, and the type of the first tunnel. Correspondingly, the first flow rule forwarding entry includes a VPN label, a first index, a first public network IP address, a first tunnel identifier, and a type of the first tunnel.
在一种可能的实现中,第一通信装置还可以获取第二流量过滤信息,并根据第二流量规律信息转发VPN流量。第二流量过滤信息包括VPN标签、第二流规则和第二流量过滤动作。其中,第二流量过滤信息中的VPN标签和第一流量过滤信息中的VPN标签相同,第二流量过滤动作包括重定向的第二下一跳,重定向的第二下一跳为第二通信装置的第二 公网IP地址。也就是说,第二流量过滤信息用于指示第一通信装置为与第二流规则匹配的报文添加VPN标签,并向第二通信装置的第二公网IP地址转发。这样,通过第一流规则和第二流规则,区分了流经同一设备(即第二通信装置)的不同VPN流量,实现了VPN流量的灵活转发。与获取第一流量过滤信息的方法相似,第二流量过滤信息可以是第一通信装置根据控制器发送的通告消息得到的,也可以是网管设备在第一通信装置上配置的。In a possible implementation, the first communication device may also acquire the second traffic filtering information, and forward the VPN traffic according to the second traffic rule information. The second traffic filtering information includes a VPN label, a second traffic rule, and a second traffic filtering action. Wherein, the VPN label in the second traffic filtering information is the same as the VPN label in the first traffic filtering information, and the second traffic filtering action includes a redirected second next hop, and the redirected second next hop is the second public network IP address of the second communication device. That is to say, the second traffic filtering information is used to instruct the first communication device to add a VPN label to the packet matching the second flow rule, and forward it to the second public network IP address of the second communication device. In this way, through the first flow rule and the second flow rule, different VPN traffic flowing through the same device (that is, the second communication device) is distinguished, and flexible forwarding of VPN traffic is realized. Similar to the method for obtaining the first traffic filtering information, the second traffic filtering information may be obtained by the first communication device according to the notification message sent by the controller, or may be configured by the network management device on the first communication device.
在一种可能的实现中,第一通信装置通过公网隧道转发与第二流规则匹配的VPN流量。该用于转发与第二流规则匹配的VPN流量的公网隧道被称为第二隧道。相应地,在接收第二流量过滤信息之后,第一通信装置可以根据第二通信装置的第二公网IP地址迭代第二隧道。第二隧道的标识被称为第二隧道标识。另外,第一通信装置还在第一通信装置的转发面保存第二关联关系。第二关联关系包括VPN标签、第二流规则、第二公网IP地址和第二隧道标识之间的关联关系。In a possible implementation, the first communication device forwards the VPN traffic matching the second flow rule through the public network tunnel. The public network tunnel used to forward the VPN traffic matching the second flow rule is called the second tunnel. Correspondingly, after receiving the second traffic filtering information, the first communication device may iterate the second tunnel according to the second public network IP address of the second communication device. The identity of the second tunnel is called the second tunnel identity. In addition, the first communication device further stores the second association relationship on the forwarding plane of the first communication device. The second association relationship includes the association relationship among the VPN label, the second flow rule, the second public network IP address, and the second tunnel identifier.
在一种可能的实现中,与第一关联关系类似,第一通信装置以第二流规则转发表项的形式存储第二关联关系。具体地,第二流规则转发表项包括VPN标签、第二索引、第二公网IP地址和第二隧道标识。第二索引用于索引第二流规则,标识第二流规则在第一通信装置中的存储位置。In a possible implementation, similar to the first association relationship, the first communication device stores the second association relationship in a form of a second flow rule forwarding entry. Specifically, the second flow rule forwarding entry includes a VPN label, a second index, a second public network IP address, and a second tunnel identifier. The second index is used for indexing the second flow rule, and identifies a storage location of the second flow rule in the first communication device.
下面介绍第一通信装置根据第一流量过滤信息转发报文的方法。A method for the first communication device to forward packets according to the first traffic filtering information is introduced below.
在一种可能的实现中,第一通信装置基于第一公网IP地址转发与第一流规则匹配的报文。具体地,第一通信装置通过与第一关联关系绑定的入接口接收第一报文。接着,第一通信装置判断第一报文是否与第一流规则相匹配。如果第一报文与第一流规则相匹配,第一通信装置在第一报文中添加VPN标签,并向第一下一跳发送添加了VPN标签的第一报文,实现VPN流量的转发。可选地,第一通信装置可以查找第一流规则转发表项,并根据第一流规则转发表项确定第一索引、VPN标签和第一公网IP地址,并根据第一索引确定第一流规则。In a possible implementation, the first communication device forwards the packet matching the first flow rule based on the first public network IP address. Specifically, the first communication device receives the first packet through the ingress interface bound to the first association relationship. Next, the first communication device determines whether the first packet matches the first flow rule. If the first packet matches the first flow rule, the first communication device adds a VPN label to the first packet, and sends the first packet with the VPN label added to the first next hop to implement forwarding of VPN traffic. Optionally, the first communication device may search the first flow rule forwarding entry, determine the first index, the VPN label, and the first public network IP address according to the first flow rule forwarding entry, and determine the first flow rule according to the first index.
在一种可能的实现中,第一通信装置通过第一隧道转发与第一流规则匹配的报文。具体地,第一通信装置通过与第一关联关系绑定的入接口接收第二报文。接着,第一通信装置判断第二报文是否与第一流规则相匹配。如果第二报文与第一流规则相匹配,第一通信装置在第二报文中添加VPN标签,并通过第一隧道向第二通信装置的第一公网IP地址发送添加了VPN标签的第二报文,实现VPN流量的转发。In a possible implementation, the first communication device forwards the packets matching the first flow rule through the first tunnel. Specifically, the first communication device receives the second message through the ingress interface bound to the first association relationship. Next, the first communication device determines whether the second packet matches the first flow rule. If the second message matches the first flow rule, the first communication device adds a VPN label to the second message, and sends the second message with the VPN label added to the first public network IP address of the second communication device through the first tunnel to realize forwarding of VPN traffic.
在一种可能的实现中,如果第一流规则转发表项包括第一索引、VPN标签、第一公网IP地址和第一隧道标识,第一通信装置可以根据第一流规则转发表项确定第一隧道标识。具体地,第一通信装置通过与第一流规则转发表项绑定的入接口接收第三报文。第一通信装置根据第一流规则转发表项确定第一索引、VPN标签、第一公网IP地址和第一隧道标识,并根据第一索引确定第一流规则。接着,第一通信装置判断第三报文是否与第一流规则相匹配。如果第三报文与第一流规则相匹配,第一通信装置在第三报文中添加VPN标签,并通过第一隧道向第二通信装置的第一公网IP地址发送添加了VPN标签的第三报文,实现VPN流量的转发。In a possible implementation, if the first flow rule forwarding entry includes the first index, the VPN label, the first public network IP address, and the first tunnel identifier, the first communication device may determine the first tunnel identifier according to the first flow rule forwarding entry. Specifically, the first communication device receives the third packet through the ingress interface bound to the first flow rule forwarding entry. The first communication device determines the first index, the VPN label, the first public network IP address, and the first tunnel identifier according to the first flow rule forwarding entry, and determines the first flow rule according to the first index. Next, the first communication device determines whether the third packet matches the first flow rule. If the third message matches the first flow rule, the first communication device adds a VPN label to the third message, and sends the third message with the VPN label added to the first public network IP address of the second communication device through the first tunnel to realize forwarding of VPN traffic.
在一种可能的实现中,如果第一通信装置还获取第二流量匹配信息,第一通信装置根 据第二流量匹配信息转发与第二流规则匹配的报文。具体地,第一通信装置通过与第一流规则转发表项和第二流规则转发表项绑定的入接口接收第四报文。接着,第一通信装置判断第四报文是否与第一流规则或第二流规则相匹配。如果第四报文与第二流规则相匹配,第一通信装置在第四报文中添加VPN标签,并向第二通信装置的第二公网IP地址发送添加了VPN标签的第四报文,实现VPN流量的转发。In a possible implementation, if the first communication device also acquires the second flow matching information, the first communication device forwards the packet matching the second flow rule according to the second flow matching information. Specifically, the first communication device receives the fourth packet through the ingress interface bound to the first flow rule forwarding entry and the second flow rule forwarding entry. Next, the first communication device determines whether the fourth packet matches the first flow rule or the second flow rule. If the fourth packet matches the second flow rule, the first communication device adds a VPN label to the fourth packet, and sends the fourth packet with the VPN tag added to the second public network IP address of the second communication device to implement VPN traffic forwarding.
在一种可能的实现中,如果第二流规则转发表项包括第二索引、VPN标签、第二公网IP地址和第二隧道标识,第一通信装置可以根据第二流规则转发表项确定第二隧道标识。具体地,第一通信装置通过与第一流规则转发表项和第二流规则转发表项绑定的入接口接收第五报文。接着,第一通信装置判断第五报文是否与第一流规则或第二流规则相匹配。如果第五报文与第二流规则相匹配,第一通信装置根据第二流规则转发表项确定VPN标签、第二公网IP地址和第二隧道标识,从而在第五报文中添加VPN标签,并通过第二隧道向第二通信装置的第二公网IP地址发送添加了VPN标签的第五报文,实现VPN流量的转发。In a possible implementation, if the second flow rule forwarding entry includes the second index, the VPN label, the second public network IP address, and the second tunnel identifier, the first communication device may determine the second tunnel identifier according to the second flow rule forwarding entry. Specifically, the first communication device receives the fifth packet through the ingress interface bound to the first flow rule forwarding entry and the second flow rule forwarding entry. Next, the first communication device determines whether the fifth packet matches the first flow rule or the second flow rule. If the fifth message matches the second flow rule, the first communication device determines the VPN label, the second public network IP address and the second tunnel identifier according to the second flow rule forwarding entry, thereby adding the VPN label to the fifth message, and sending the fifth message with the VPN label added to the second public network IP address of the second communication device through the second tunnel to realize forwarding of VPN traffic.
第二方面,本申请提供了一种报文发送方法,该方法可以应用于第一通信装置,第一通信装置是用于转发VPN流量的网络设备,例如可以是公网中的PE设备。所述报文发送方法包括:第一通信装置接收第一报文。具体地,第一通信装置接收第一报文的入接口与第一关联关系相关联。第一关联关系包括第一流规则、VPN标签和第一流量过滤动作之间的关联关系,第一流量过滤动作包括重定向的第一下一跳,重定向的第一下一跳为第二通信装置的第一公网IP地址。在接收到的第一报文之后,第一通信装置根据接收第一报文的入接口确定第一关联关系,根据第一关联关系确定第一流规则,并判断第一报文是否与第一流规则匹配。如果第一报文与第一流规则匹配,第一通信装置根据第一关联关系在第一报文中添加VPN标签,并向第二通信装置的第一IP地址转发添加了VPN标签的第一报文。这样,根据第一流量过滤信息转发VPN流量,在不使用VPN路由表的前提下实现了VPN流量的转发,降低了VPN流量的转发时延,提升了VPN流量的转发性能。In a second aspect, the present application provides a message sending method, which can be applied to a first communication device, where the first communication device is a network device for forwarding VPN traffic, such as a PE device in a public network. The message sending method includes: the first communication device receives the first message. Specifically, the inbound interface on which the first communication device receives the first packet is associated with the first association relationship. The first association relationship includes the association relationship between the first flow rule, the VPN label, and the first traffic filtering action. The first traffic filtering action includes a redirected first next hop, and the redirected first next hop is the first public network IP address of the second communication device. After receiving the first packet, the first communication device determines the first association relationship according to the incoming interface receiving the first packet, determines the first flow rule according to the first association relationship, and determines whether the first packet matches the first flow rule. If the first packet matches the first flow rule, the first communication device adds a VPN label to the first packet according to the first association relationship, and forwards the first packet with the VPN label added to the first IP address of the second communication device. In this way, the VPN traffic is forwarded according to the first traffic filtering information, the forwarding of the VPN traffic is realized without using the VPN routing table, the forwarding delay of the VPN traffic is reduced, and the forwarding performance of the VPN traffic is improved.
在一种可能的实现中,第一流量过滤动作还包括第一隧道标识,用于指示第一通信装置通过第一隧道转发与第一流规则匹配的流量。其中,第一隧道标识用于标识第一隧道,第一隧道为第一通信装置和第二通信装置之间建立的第一公网隧道。相应地,在转发第一报文时,第一通信装置通过第一隧道向第一下一跳发送添加了VPN标签的第一报文。In a possible implementation, the first traffic filtering action further includes a first tunnel identifier, configured to instruct the first communication device to forward traffic matching the first flow rule through the first tunnel. Wherein, the first tunnel identifier is used to identify the first tunnel, and the first tunnel is the first public network tunnel established between the first communication device and the second communication device. Correspondingly, when forwarding the first packet, the first communication device sends the first packet with the VPN label added to the first next hop through the first tunnel.
在一种可能的实现中,第一关联关系以第一流规则转发表项的形式被保存在第一通信装置的转发面。相应地,第一流规则转发表项包括VPN标签、第一索引、第二通信装置的第一公网IP地址和第一隧道标识。其中,第一索引用于索引第一流规则。In a possible implementation, the first association relationship is stored on the forwarding plane of the first communication device in the form of a first flow rule forwarding entry. Correspondingly, the first flow rule forwarding entry includes the VPN label, the first index, the first public network IP address of the second communication device, and the first tunnel identifier. Wherein, the first index is used to index the first flow rule.
在一种可能的实现中,第一通信装置的转发面还包括第二关联关系,第二关联关系包括第二流规则、VPN标签和第二流量过滤动作之间的关联关系,第二流量过滤动作包括重定向的第二下一跳,重定向的第二下一跳为第二通信装置的第二公网IP地址。也就是说,第二关联关系用于指示第一通信装置向第二通信装置的第二公网IP地址转发与第二流规则匹配的VPN流量。具体地,如果第一通信装置通过与第一关联关系和第二关联关系绑定的入接口接收第二报文,第一通信装置先判断第二报文是否与第一流规则或第二流规则匹配。 如果第二报文与第二流规则匹配,第一通信装置在第二报文中添加VPN标签,并向第二下一跳发送添加了VPN的第二报文。In a possible implementation, the forwarding plane of the first communication device further includes a second association relationship, the second association relationship includes an association relationship between a second flow rule, a VPN label, and a second traffic filtering action, and the second traffic filtering action includes a redirected second next hop, and the redirected second next hop is a second public network IP address of the second communication device. That is to say, the second association relationship is used to instruct the first communication device to forward the VPN traffic matching the second flow rule to the second public network IP address of the second communication device. Specifically, if the first communication device receives the second packet through the ingress interface bound to the first association relationship and the second association relationship, the first communication device first determines whether the second packet matches the first flow rule or the second flow rule. If the second packet matches the second flow rule, the first communication device adds a VPN label to the second packet, and sends the VPN-added second packet to the second next hop.
在一种可能的实现中,第二流量过滤动作还包括第二隧道标识,用于指示第一通信装置通过第二隧道转发与第二流规则匹配的流量。其中,第二隧道标识用于标识第二隧道,第二隧道为第一通信装置和第二通信装置之间建立的第二公网隧道。相应地,在转发第二报文时,第一通信装置通过第二隧道向第二下一跳发送添加了VPN标签的第二报文。In a possible implementation, the second traffic filtering action further includes a second tunnel identifier, configured to instruct the first communication device to forward the traffic matching the second flow rule through the second tunnel. Wherein, the second tunnel identifier is used to identify the second tunnel, and the second tunnel is a second public network tunnel established between the first communication device and the second communication device. Correspondingly, when forwarding the second packet, the first communication device sends the second packet with the VPN label added to the second next hop through the second tunnel.
第三方面,本申请提供了一种消息发送方法,该方法应用于控制管理设备,控制管理设备可以是网管设备,也可以是控制器。如果控制管理设备为控制器,控制管理设备可以是多级控制器架构中用于控制PE设备的控制器。具体地,所述消息发送方法包括:控制管理设备获取第一流量过滤信息并向第一通信装置发送第一流量过滤信息。其中,第一流量过滤信息包括VPN标签、第一流规则和第一流量过滤动作。第一流量过滤动作包括重定向的第一下一跳,重定向的第一下一跳为第二通信装置的第一公网IP地址,第一流量过滤动作用于指示第一通信装置向第一下一跳转发与第一流规则匹配的VPN流量。这样,在接收到第一流量过滤信息之后,第一通信装置可以根据第一流量过滤信息而非VPN路由表转发VPN流量,可以避免查找VPN路由表,提升了VPN流量的转发性能。In a third aspect, the present application provides a message sending method, which is applied to a control and management device, and the control and management device may be a network management device or a controller. If the control management device is a controller, the control management device may be a controller for controlling PE devices in a multi-level controller architecture. Specifically, the message sending method includes: controlling the management device to acquire first traffic filtering information and sending the first traffic filtering information to the first communication device. Wherein, the first flow filtering information includes a VPN label, a first flow rule and a first flow filtering action. The first traffic filtering action includes a redirected first next hop, the redirected first next hop is the first public network IP address of the second communication device, and the first traffic filtering action is used to instruct the first communication device to forward VPN traffic matching the first flow rule to the first next hop. In this way, after receiving the first traffic filtering information, the first communication device can forward the VPN traffic according to the first traffic filtering information instead of the VPN routing table, avoiding searching the VPN routing table, and improving the forwarding performance of the VPN traffic.
在一种可能的实现中,控制管理设备为网管设备,控制管理设备可以获取技术人员在网管设备上配置的第一流量过滤信息。In a possible implementation, the control and management device is a network management device, and the control and management device may obtain first traffic filtering information configured on the network management device by a technician.
在一种可能的实现中,控制管理设备为控制器,控制管理设备可以接收网管设备发送的第一流量过滤信息,或者获取技术人员在控制器上配置的第一流量过滤信息。或者,如果控制管理设备为多级控制器架构中用于控制PE设备的控制器,第一流量过滤信息可以是多级控制器架构中控制控制管理设备的控制器向控制管理设备发送的。In a possible implementation, the control management device is a controller, and the control management device may receive the first traffic filtering information sent by the network management device, or obtain the first traffic filtering information configured on the controller by a technician. Alternatively, if the control management device is a controller used to control the PE device in the multi-level controller architecture, the first traffic filtering information may be sent to the control management device by the controller in the multi-level controller architecture that controls the control management device.
在一种可能的实现中,第一流量过滤信息还包括第一隧道的类型信息,第一隧道的隧道类型信息用于指示第一隧道的类型。第一隧道为第一通信装置和第二通信装置之间建立的公网隧道,用于转发与第一流规则匹配的VPN流量。也就是说,第一通信装置在确定报文与第一流规则匹配之后,可以通过第一隧道向第二通信装置的第一公网IP地址转发添加了VPN标签的报文。In a possible implementation, the first traffic filtering information further includes type information of the first tunnel, where the tunnel type information of the first tunnel is used to indicate the type of the first tunnel. The first tunnel is a public network tunnel established between the first communication device and the second communication device, and is used to forward VPN traffic matching the first flow rule. That is to say, after determining that the message matches the first flow rule, the first communication device may forward the message with the VPN label to the first public network IP address of the second communication device through the first tunnel.
在一种可能的实现中,控制管理设备为控制器,控制管理设备可以通过发送通告报文向第一通信装置发送第一流量过滤信息。其中,控制管理设备发送的通告消息可以是BGP消息,也可以是PCEP消息。In a possible implementation, the control management device is a controller, and the control management device may send the first traffic filtering information to the first communication apparatus by sending a notification message. Wherein, the notification message sent by the control and management device may be a BGP message or a PCEP message.
在一种可能的实现中,控制管理设备为控制器,控制管理设备通过BGP消息向第一通信装置发送第一流量过滤信息。第一流量过滤信息中的VPN标签可以作为扩展团体属性被携带在BGP消息中。具体地,BGP消息包括第一扩展团体属性,第一扩展团体属性包括VPN标签。In a possible implementation, the control management device is a controller, and the control management device sends the first traffic filtering information to the first communication apparatus through a BGP message. The VPN label in the first traffic filtering information may be carried in the BGP message as an extended community attribute. Specifically, the BGP message includes a first extended community attribute, and the first extended community attribute includes a VPN label.
在一种可能的实现中,第一扩展团体属性还包括隧道类型字段,隧道类型字段用于承载隧道类型信息,隧道类型信息用于还是隧道的类型,该隧道为转发与第一流规则匹配的流量的公网隧道。例如,隧道类型字段可以用于携带上述第一隧道的隧道类型信息。In a possible implementation, the first extended community attribute further includes a tunnel type field, where the tunnel type field is used to carry tunnel type information, and the tunnel type information is used to be a tunnel type, and the tunnel is a public network tunnel that forwards traffic matching the first flow rule. For example, the tunnel type field may be used to carry the tunnel type information of the above-mentioned first tunnel.
在一种可能的实现中,控制管理设备为控制器,控制管理设备通过BGP消息向第一通 信装置发送第一流量过滤信息。BGP消息还包括路由目标(Route Target,RT)。路由目标RT关联第一通信装置中的VPN实例。第一流量过滤信息用于对来自与VPN实例绑定的VPN站点中的VPN流量进行过滤。相应地,第一通信装置在接收到BGP消息后,可以根据RT进行路由交叉,确定第一流量过滤信息对应的VPN实例的标识,从而确定与第一关联关系绑定的入接口。In a possible implementation, the control and management device is a controller, and the control and management device sends the first traffic filtering information to the first communication device through a BGP message. The BGP message also includes a route target (Route Target, RT). The routing target RT is associated with the VPN instance in the first communication device. The first traffic filtering information is used to filter the VPN traffic from the VPN site bound to the VPN instance. Correspondingly, after receiving the BGP message, the first communication device may perform route crossover according to the RT to determine the identifier of the VPN instance corresponding to the first traffic filtering information, thereby determining the ingress interface bound to the first association relationship.
在一种可能的实现中,控制管理设备还可以获取第二流量过滤信息,第二流量过滤信息包括VPN标签、第二流规则和第二流量过滤动作,其中,第二流量过滤信息中的VPON标签与第一流量过滤信息中的VPN标签相同,第二流量过滤动作包括重定向的第二下一跳,重定向的第二下一跳为第二通信装置的第二公网IP地址。也就是说,第二流量过滤信息用于指示第一通信装置为与第二流规则匹配的报文添加VPN标签,并向第二通信装置的第二公网IP地址转发。这样,通过第一流规则和第二流规则,区分了流经同一设备(即第二通信装置)的不同VPN流量,实现了VPN流量的灵活转发。。In a possible implementation, the control and management device may also acquire second traffic filtering information, where the second traffic filtering information includes a VPN label, a second flow rule, and a second traffic filtering action, wherein the VPON label in the second traffic filtering information is the same as the VPN label in the first traffic filtering information, and the second traffic filtering action includes a redirected second next hop, and the redirected second next hop is the second public network IP address of the second communication device. That is to say, the second traffic filtering information is used to instruct the first communication device to add a VPN label to the packet matching the second flow rule, and forward it to the second public network IP address of the second communication device. In this way, through the first flow rule and the second flow rule, different VPN traffic flowing through the same device (that is, the second communication device) is distinguished, and flexible forwarding of VPN traffic is realized. .
在一种可能的实现中,第二流量过滤信息还包括第二隧道的类型信息,第二隧道的隧道类型信息用于指示第二隧道的类型。第二隧道为第一通信装置和第二通信装置之间建立的公网隧道,用于转发与第二流规则匹配的VPN流量。也就是说,第一通信装置在确定报文与第二流规则匹配之后,可以通过第二隧道向第二通信装置的第二公网IP地址转发添加了VPN标签的报文。In a possible implementation, the second traffic filtering information further includes type information of the second tunnel, and the tunnel type information of the second tunnel is used to indicate the type of the second tunnel. The second tunnel is a public network tunnel established between the first communication device and the second communication device, and is used to forward VPN traffic matching the second flow rule. That is to say, after determining that the packet matches the second flow rule, the first communication device may forward the packet with the VPN label to the second public network IP address of the second communication device through the second tunnel.
第四方面,本申请提供一种用于流量转发的网络设备,该网络设备应用于第一通信装置,包括处理模块和收发模块。In a fourth aspect, the present application provides a network device for traffic forwarding, the network device is applied to a first communication device, and includes a processing module and a transceiver module.
其中,所述处理模块,用于获取第一流量过滤信息,所述第一流量过滤信息包括VPN标签、第一流规则和第一流量过滤动作,其中,所述第一流量过滤动作包括重定向的第一下一跳,所述重定向的第一下一跳为第二通信装置的第一公网IP地址,所述第一流量过滤动作指示所述第一通信装置向所述第一下一跳转发与所述第一流规则匹配的流量;所述收发模块,还用于根据所述第一流量过滤信息转发与所述第一流规则匹配的流量。Wherein, the processing module is configured to acquire first traffic filtering information, the first traffic filtering information includes a VPN label, a first flow rule, and a first traffic filtering action, wherein the first traffic filtering action includes a redirected first next hop, the redirected first next hop is a first public network IP address of a second communication device, and the first traffic filtering action instructs the first communication device to forward traffic matching the first flow rule to the first next hop; the transceiver module is further configured to forward traffic matching the first traffic rule according to the first traffic filtering information.
在一种可能的实现中,所述第一流量过滤信息还包括隧道类型信息,所述隧道类型信息指示隧道的类型,所述隧道用于转发与所述第一流规则匹配的流量。In a possible implementation, the first traffic filtering information further includes tunnel type information, where the tunnel type information indicates a type of a tunnel, and the tunnel is used to forward traffic matching the first flow rule.
在一种可能的实现中,所述收发模块,还用于接收控制器发送的BGP消息,所述BGP消息包括所述第一流量过滤信息。In a possible implementation, the transceiver module is further configured to receive a BGP message sent by the controller, where the BGP message includes the first traffic filtering information.
在一种可能的实现中,所述BGP消息包括第一扩展团体属性,所述第一扩展团体属性中携带所述VPN标签。In a possible implementation, the BGP message includes a first extended community attribute, and the first extended community attribute carries the VPN label.
在一种可能的实现中,所述第一扩展团体属性还包括隧道类型字段,所述隧道类型字段承载隧道类型信息,所述隧道类型信息指示隧道的类型,所述隧道用于转发与所述第一流规则匹配的流量。In a possible implementation, the first extended community attribute further includes a tunnel type field, where the tunnel type field carries tunnel type information, and the tunnel type information indicates a tunnel type, and the tunnel is used to forward traffic matching the first flow rule.
在一种可能的实现中,所述收发模块,还用于接收控制器发送的PCEP消息,所述PCEP消息包括所述第一流量过滤信息。In a possible implementation, the transceiver module is further configured to receive a PCEP message sent by the controller, where the PCEP message includes the first traffic filtering information.
在一种可能的实现中,所述处理模块,用于根据所述第一公网IP地址迭代第一隧道,所述第一隧道为所述第一通信装置和所述第二通信装置之间建立的第一公网隧道;在转发 面保存第一关联关系,所述第一关联关系包括所述VPN标签、所述第一流规则,所述第一公网IP地址和第一隧道标识之间的关联关系,所述第一隧道标识用于标识所述第一隧道。In a possible implementation, the processing module is configured to iterate a first tunnel according to the first public network IP address, and the first tunnel is a first public network tunnel established between the first communication device and the second communication device; a first association relationship is saved on a forwarding plane, and the first association relationship includes an association relationship between the VPN label, the first flow rule, the first public network IP address, and a first tunnel identifier, and the first tunnel identifier is used to identify the first tunnel.
在一种可能的实现中,所述处理模块,用于在所述转发面保存第一流规则转发表项,所述第一流规则转发表项包括所述VPN标签、第一索引,所述第一公网IP地址和所述第一隧道标识,所述第一索引用于索引所述第一流规则。In a possible implementation, the processing module is configured to store a first flow rule forwarding entry on the forwarding plane, where the first flow rule forwarding entry includes the VPN label, a first index, the first public network IP address, and the first tunnel identifier, and the first index is used to index the first flow rule.
在一种可能的实现中,所述第一关联关系还包括所述第一隧道的类型。In a possible implementation, the first association relationship further includes the type of the first tunnel.
在一种可能的实现中,所述处理模块,还用于获取第二流量过滤信息,所述第二流量过滤信息包括所述VPN标签、第二流规则和第二流量过滤动作,其中,所述第二流量过滤动作携带重定向的第二下一跳,所述重定向的第二下一跳为所述第二通信装置第二公网互联网协议IP地址,所述第二流量过滤动作指示所述第一通信装置向所述第二下一跳转发与所述第二流规则匹配的流量;根据所述第二流量过滤信息转发与所述第二流规则匹配的流量。In a possible implementation, the processing module is further configured to obtain second traffic filtering information, where the second traffic filtering information includes the VPN label, a second flow rule, and a second traffic filtering action, wherein the second traffic filtering action carries a redirected second next hop, the redirected second next hop is the second public network Internet Protocol IP address of the second communication device, and the second traffic filtering action instructs the first communication device to forward traffic matching the second flow rule to the second next hop; and forward traffic matching the second flow rule according to the second traffic filtering information.
在一种可能的实现中,所述处理模块,用于据所述第二公网IP地址迭代第二隧道,所述第二隧道为所述第一通信装置和所述第二通信装置之间建立的第二公网隧道;在所述转发面保存所述第二关联关系,所述第二关联关系包括所述VPN标签、所述第二流规则,所述第二公网IP地址和第二隧道标识之间的关联关系,所述第二隧道标识用于标识所述第二隧道。In a possible implementation, the processing module is configured to iterate a second tunnel according to the second public network IP address, and the second tunnel is a second public network tunnel established between the first communication device and the second communication device; the second association relationship is saved on the forwarding plane, and the second association relationship includes the association relationship between the VPN label, the second flow rule, the second public network IP address, and a second tunnel identifier, and the second tunnel identifier is used to identify the second tunnel.
在一种可能的实现中,所述收发模块,用于接收第一报文;In a possible implementation, the transceiver module is configured to receive the first message;
所述处理模块,用于响应于所述第一报文与所述第一流规则相匹配,在所述第一报文中添加所述VPN标签;The processing module is configured to add the VPN label to the first packet in response to the first packet matching the first flow rule;
所述收发模块,还用于向所述第一下一跳发送添加所述VPN标签后的第一报文。The transceiver module is further configured to send the first packet with the VPN label added to the first next hop.
在一种可能的实现中,所述收发模块,用于接收第二报文;In a possible implementation, the transceiver module is configured to receive the second message;
所述处理模块,用于响应于所述第二报文与所述第一流规则相匹配,在所述第二报文中添加所述VPN标签;The processing module is configured to add the VPN label to the second packet in response to the second packet matching the first flow rule;
所述收发模块,用于通过所述第一隧道向所述第一下一跳发送添加所述VPN标签后的第二报文。The transceiver module is configured to send the second message added with the VPN label to the first next hop through the first tunnel.
在一种可能的实现中,所述收发模块,用于接收第三报文;In a possible implementation, the transceiver module is configured to receive a third message;
所述处理模块,用于响应于所述第三报文与所述第一流规则相匹配,根据所述第一流规则转发表项,确定与所述第一流规则对应的所述VPN标签和所述第一隧道标识,在所述第三报文中添加所述VPN标签;The processing module is configured to, in response to the match between the third packet and the first flow rule, determine the VPN label and the first tunnel identifier corresponding to the first flow rule according to the forwarding entry of the first flow rule, and add the VPN label to the third packet;
所述收发模块,用于通过所述第一隧道向所述第一下一跳发送添加所述VPN标签后的第三报文。The transceiver module is configured to send the third message added with the VPN label to the first next hop through the first tunnel.
在一种可能的实现中,所述收发模块,用于接收第四报文;In a possible implementation, the transceiver module is configured to receive a fourth message;
所述处理模块,用于响应于所述第四报文与所述第二流规则相匹配,在所述第四报文中添加所述VPN标签;The processing module is configured to add the VPN label to the fourth packet in response to the fourth packet matching the second flow rule;
所述收发模块,用于向所述第二下一跳发送添加所述VPN标签后的第四报文。The transceiver module is configured to send the fourth message added with the VPN label to the second next hop.
在一种可能的实现中,所述收发模块,用于接收第五报文;In a possible implementation, the transceiver module is configured to receive the fifth message;
所述处理模块,用于响应于所述第五报文与所述第二流规则相匹配,根据所述第二流规则转发表项,确定与所述第二流规则对应的所述VPN标签和所述第二隧道标识,在所述第五报文中添加所述VPN标签;The processing module is configured to, in response to the fifth packet matching the second flow rule, determine the VPN label and the second tunnel identifier corresponding to the second flow rule according to the forwarding entry of the second flow rule, and add the VPN label to the fifth packet;
所述收发模块,用于通过所述第二隧道向所述第二下一跳发送添加所述VPN标签后的第五报文。The transceiver module is configured to send the fifth packet with the VPN label added to the second next hop through the second tunnel.
第五方面,本申请提供了一种用于发送报文的网络设备,该网络设备应用于第一通信装置,包括收发模块和处理模块。In a fifth aspect, the present application provides a network device for sending a message, the network device is applied to a first communication device, and includes a transceiver module and a processing module.
其中,所述收发模块,用于接收第一报文;Wherein, the transceiver module is configured to receive the first message;
所述处理模块,用于响应于所述第一报文与第一流规则相匹配,根据第一关联关系确定VPN标签和第一流量过滤动作,所述第一关联关系包括所述第一流规则、所述VPN标签和所述第一流量过滤动作之间的关联关系,所述第一流量过滤动作包括重定向的第一下一跳,所述重定向的第一下一跳为第二通信装置的第一公网IP地址;为所述第一报文添加所述VPN标签;The processing module is configured to determine a VPN label and a first traffic filtering action according to a first association relationship in response to the first packet matching the first flow rule, the first association relationship includes the association relationship between the first flow rule, the VPN label, and the first traffic filtering action, the first traffic filtering action includes a redirected first next hop, and the redirected first next hop is a first public network IP address of the second communication device; adding the VPN label to the first message;
所述收发模块,用于向所述第一下一跳发送添加所述VPN标签后的第一报文。The transceiving module is configured to send the first packet with the VPN label added to the first next hop.
在一种可能的实现中,所述第一流量过滤动作还包括第一隧道标识,所述第一隧道标识用于标识第一隧道,所述第一隧道为所述第一通信装置和所述第二通信装置之间建立的第一公网隧道;In a possible implementation, the first traffic filtering action further includes a first tunnel identifier, where the first tunnel identifier is used to identify a first tunnel, and the first tunnel is a first public network tunnel established between the first communication device and the second communication device;
所述收发模块,用于通过所述第一隧道向所述第一下一跳发送添加所述VPN标签后的第一报文。The transceiver module is configured to send the first packet with the VPN label added to the first next hop through the first tunnel.
在一种可能的实现中,所述处理模块,用于根据第一流规则转发表项,确定与所述第一流规则对应的VPN标签和所述第一隧道标识,所述第一流规则转发表项包括所述VPN标签、第一索引,所述第一公网IP地址和第一隧道标识,所述第一索引用于索引所述第一流规则。In a possible implementation, the processing module is configured to determine a VPN label corresponding to the first flow rule and the first tunnel identifier according to a first flow rule forwarding entry, where the first flow rule forwarding entry includes the VPN label, a first index, the first public network IP address, and a first tunnel identifier, and the first index is used to index the first flow rule.
在一种可能的实现中,所述收发模块,还用于接收第二报文;In a possible implementation, the transceiver module is further configured to receive the second message;
所述处理模块,还用于响应于所述第二报文与第二流规则相匹配,根据第二关联关系确定所述VPN标签和第二流量过滤动作,所述第二关联关系包括所述第二流规则、所述VPN标签和所述第二流量过滤动作之间的关联关系,所述第二流量过滤动作包括重定向的第二下一跳,所述重定向的第二下一跳为所述第二通信装置的第二公网互联网协议IP地址;为所述第二报文添加所述VPN标签;The processing module is further configured to determine the VPN label and a second traffic filtering action according to a second association relationship in response to the second message matching the second flow rule, the second association relationship includes the association relationship between the second flow rule, the VPN label, and the second traffic filtering action, and the second traffic filtering action includes a redirected second next hop, the redirected second next hop is a second public network Internet Protocol IP address of the second communication device; adding the VPN label to the second message;
所述收发模块,还用于向所述第二下一跳发送添加所述VPN标签后的第二报文。The transceiving module is further configured to send the second message with the VPN label added to the second next hop.
在一种可能的实现中,所述第二流量过滤动作还包括第二隧道标识,所述第二隧道标识用于标识第二隧道,所述第二隧道为所述第一通信装置和所述第二通信装置之间建立的第二公网隧道;In a possible implementation, the second traffic filtering action further includes a second tunnel identifier, where the second tunnel identifier is used to identify a second tunnel, and the second tunnel is a second public network tunnel established between the first communication device and the second communication device;
所述收发模块,用于通过所述第二隧道向所述第二下一跳发送添加所述VPN标签后的第二报文。The transceiver module is configured to send the second message added with the VPN label to the second next hop through the second tunnel.
第六方面,本申请提供了一种用于发送消息的控制管理设备,所述控制管理设备应用于控制器或网管设备,所述控制管理设备包括处理模块和收发模块。其中,所述处理模块, 用于获取第一流量过滤信息,所述第一流量过滤信息包括VPN标签、第一流规则和第一流量过滤动作,其中,所述第一流量过滤动作包括重定向的第一下一跳,所述重定向的第一下一跳为第二通信装置的第一公网IP地址,所述第一流量过滤动作指示第一通信装置向所述第一下一跳转发与所述第一流规则匹配的VPN流量;所述收发模块,用于向所述第一通信装置发送所述第一流量过滤信息。In a sixth aspect, the present application provides a control and management device for sending messages, the control and management device is applied to a controller or a network management device, and the control and management device includes a processing module and a transceiver module. Wherein, the processing module is configured to obtain first traffic filtering information, the first traffic filtering information includes a VPN label, a first flow rule, and a first traffic filtering action, wherein the first traffic filtering action includes a redirected first next hop, the redirected first next hop is a first public network IP address of the second communication device, and the first traffic filtering action instructs the first communication device to forward VPN traffic that matches the first flow rule to the first next hop; the transceiver module is configured to send the first traffic filtering information to the first communication device.
在一种可能的实现中,所述第一流量过滤信息还包括第一隧道的隧道类型信息,所述第一隧道的隧道类型信息指示第一隧道的类型,所述第一隧道用于转发与所述第一流规则匹配的流量,所述第一隧道为所述第一通信装置和所述第二通信装置之间建立的第一公网隧道。In a possible implementation, the first traffic filtering information further includes tunnel type information of a first tunnel, where the tunnel type information of the first tunnel indicates the type of the first tunnel, the first tunnel is used to forward traffic matching the first flow rule, and the first tunnel is a first public network tunnel established between the first communication device and the second communication device.
在一种可能的实现中,所述控制管理设备为控制器,所述收发模块,用于向所述第一通信装置发送BGP消息,所述BGP消息包括所述第一流量过滤信息。In a possible implementation, the control management device is a controller, and the transceiver module is configured to send a BGP message to the first communication device, where the BGP message includes the first traffic filtering information.
在一种可能的实现中,所述BGP消息包括第一扩展团体属性,所述第一扩展团体属性中携带所述VPN标签。In a possible implementation, the BGP message includes a first extended community attribute, and the first extended community attribute carries the VPN label.
在一种可能的实现中,所述第一扩展团体属性还包括隧道类型字段,所述隧道类型字段承载隧道类型信息,所述隧道类型信息指示隧道的类型,所述隧道用于转发与所述第一流规则匹配的流量。In a possible implementation, the first extended community attribute further includes a tunnel type field, where the tunnel type field carries tunnel type information, and the tunnel type information indicates a tunnel type, and the tunnel is used to forward traffic matching the first flow rule.
在一种可能的实现中,所述BGP消息还包括RT,所述路由目标关联所述第一通信装置中的VPN实例,第一流量过滤信息用于对来自与所述VPN实例绑定的VPN站点中的VPN流量进行过滤。In a possible implementation, the BGP message further includes an RT, the routing target is associated with a VPN instance in the first communication device, and the first traffic filtering information is used to filter VPN traffic from a VPN site bound to the VPN instance.
在一种可能的实现中,所述收发模块,用于向所述第一通信装置发送PCEP消息,所述PCEP消息包括所述第一流量过滤信息。In a possible implementation, the transceiver module is configured to send a PCEP message to the first communication device, where the PCEP message includes the first traffic filtering information.
在一种可能的实现中,所述处理模块,还用于获取第二流量过滤信息,所述第二流量过滤信息包括所述VPN标签、第二流规则和第二流量过滤动作,其中,所述第二流量过滤动作包括重定向的第二下一跳,所述重定向的第二下一跳为第二通信装置的第二公网IP地址,所述第二流量过滤动作指示第一通信装置向所述第二下一跳转发与所述第二流规则匹配的流量;向所述第一通信装置发送所述第二流量过滤信息。In a possible implementation, the processing module is further configured to obtain second traffic filtering information, where the second traffic filtering information includes the VPN label, a second flow rule, and a second traffic filtering action, where the second traffic filtering action includes a redirected second next hop, the redirected second next hop is a second public network IP address of the second communication device, and the second traffic filtering action instructs the first communication device to forward traffic matching the second flow rule to the second next hop; and send the second traffic filtering information to the first communication device.
在一种可能的实现中,所述第二流量过滤信息还包括第二隧道的隧道类型信息,所述第二隧道的隧道类型信息指示第二隧道的类型,所述第二隧道用于转发与所述第二流规则匹配的流量,所述第二隧道为所述第一通信装置和所述第二通信装置之间建立的第二公网隧道。In a possible implementation, the second traffic filtering information further includes tunnel type information of a second tunnel, where the tunnel type information of the second tunnel indicates the type of the second tunnel, the second tunnel is used to forward traffic matching the second flow rule, and the second tunnel is a second public network tunnel established between the first communication device and the second communication device.
第七方面,本申请提供一种网络设备,该网络设备包括处理器和存储器,存储器用于存储指令或程序代码,处理器用于从存储器中调用并运行指令或程序代码,使得所述网络设备执行第一方面、第一方面的任意一种可能的实现方式中的方法,或者执行第二方面或第二方面的任意一种可能的实现方式中的方法。In a seventh aspect, the present application provides a network device, the network device includes a processor and a memory, the memory is used to store instructions or program codes, and the processor is used to call and run the instructions or program codes from the memory, so that the network device executes the method in the first aspect or any one of the possible implementations of the first aspect, or executes the second aspect or the method in any one of the possible implementations of the second aspect.
第八方面,本申请提供一种控制管理设备,所述控制管理设备包括处理器和存储器,存储器用于存储指令或程序代码,处理器用于从存储器中调用并运行指令或程序代码,并使得所述控制管理设备执行第三方面、第三方面的任意一种可能的实现方式中的方法。In an eighth aspect, the present application provides a control and management device, the control and management device includes a processor and a memory, the memory is used to store instructions or program codes, and the processor is used to call and run the instructions or program codes from the memory, and make the control and management device execute the third aspect and the method in any possible implementation manner of the third aspect.
第九方面,本申请提供一种网络系统,网络系统包括如第四方面或者第五方面所述的网络设备,以及如第六方面所述的控制管理设备。In a ninth aspect, the present application provides a network system, and the network system includes the network device described in the fourth aspect or the fifth aspect, and the control management device described in the sixth aspect.
第十方面,本申请提供一种计算机可读存储介质,包括指令、程序或代码,当其在处理器上执行时,实现如第一方面或第一方面的任意一些可能的实现方式中的流量转发方法,或者如第二方面或第二方面的任意一种可能的实现方式中的报文发送方法,或者如第三方面或第三方面的任意一种可能的实现方式中的消息发送方法。In a tenth aspect, the present application provides a computer-readable storage medium, including instructions, programs or codes, which, when executed on a processor, implement the traffic forwarding method in the first aspect or in any possible implementation of the first aspect, or the message sending method in the second aspect or in any of the possible implementations of the second aspect, or the message sending method in the third aspect or in any of the possible implementations of the third aspect.
附图说明Description of drawings
图1-A为本申请实施例提供的一种网络架构的示意图;FIG. 1-A is a schematic diagram of a network architecture provided by an embodiment of the present application;
图1-B为本申请实施例提供的另一种网络架构的示意图;FIG. 1-B is a schematic diagram of another network architecture provided by the embodiment of the present application;
图1-C为本申请实施例提供的又一种网络架构的示意图;FIG. 1-C is a schematic diagram of another network architecture provided by the embodiment of the present application;
图1-D为本申请实施例提供的再一种网络架构的示意图;FIG. 1-D is a schematic diagram of another network architecture provided by the embodiment of the present application;
图2为本申请实施例提供的流量转发方法的一种信令交互图;FIG. 2 is a signaling interaction diagram of a traffic forwarding method provided in an embodiment of the present application;
图3为本申请实施例提供的消息发送方法的一种信令交互图;FIG. 3 is a signaling interaction diagram of a message sending method provided in an embodiment of the present application;
图4为本申请实施例提供的第一扩展团体属性的一种格式示意图;FIG. 4 is a schematic diagram of a format of the first extended community attribute provided by the embodiment of the present application;
图5为本申请实施例提供的报文发送方法的一种信令交互图;FIG. 5 is a signaling interaction diagram of a message sending method provided in an embodiment of the present application;
图6为本申请实施例提供的流量转发方法的另一种信令交互图;FIG. 6 is another signaling interaction diagram of the traffic forwarding method provided by the embodiment of the present application;
图7为本申请实施例提供的一种设备的一种结构示意图;FIG. 7 is a schematic structural diagram of a device provided in an embodiment of the present application;
图8为本申请实施例提供的一种设备的结构示意图;FIG. 8 is a schematic structural diagram of a device provided by an embodiment of the present application;
图9为本申请实施例提供的一种设备的结构示意图。FIG. 9 is a schematic structural diagram of a device provided by an embodiment of the present application.
具体实施方式Detailed ways
在传统的VPN技术中,PE设备基于VPN路由表转发VPN流量。但是,VPN路由表会影响VPN流量的转发性能。例如,如果VPN路由表中IP地址的数量较多,PE设备查找VPN路由表的耗时较长,增加了VPN流量中报文的时延。另外,VPN路由表指定了传输报文的出接口和下一跳,固定了VPN流量的转发路径,限制了VPN流量转发的灵活性。In traditional VPN technologies, PE devices forward VPN traffic based on VPN routing tables. However, the VPN routing table affects the forwarding performance of VPN traffic. For example, if the number of IP addresses in the VPN routing table is large, it takes a long time for the PE device to search the VPN routing table, which increases the delay of packets in the VPN traffic. In addition, the VPN routing table specifies the outbound interface and next hop for transmitting packets, which fixes the forwarding path of VPN traffic and limits the flexibility of VPN traffic forwarding.
下面结合附图1-A对本申请实施例的一种网络架构进行简单介绍。A network architecture of the embodiment of the present application will be briefly introduced below with reference to FIG. 1-A.
参见图1-A,该图为本申请实施例提供的系统的一种结构示意图。在图1-A所示的系统中,包括设备1、设备2、设备3、CE 1、CE 2、PE 1、PE 2和P1。其中,CE1分别与设备1和PE1连接,P1分别与PE1和PE2连接,CE2分别与PE2、设备2和设备3连接。设备1、设备2、设备3、CE1和CE2属于VPN1,PE1、PE2和P1属于公网。设备1的私网IP地址为100.1.1.1,设备2的私网IP地址为200.2.2.2,设备3的私网IP地址为300.3.3.3。PE1上与CE1连接的入接口的标识为A1,PE1上与P1设备连接的出接口的标识为A2,PE2上与P1连接的入接口的标识为B1。Referring to FIG. 1-A, this figure is a schematic structural diagram of a system provided by an embodiment of the present application. In the system shown in Figure 1-A, it includes device 1, device 2, device 3, CE 1, CE 2, PE 1, PE 2, and P1. Wherein, CE1 is connected to equipment 1 and PE1 respectively, P1 is connected to PE1 and PE2 respectively, and CE2 is connected to PE2, equipment 2 and equipment 3 respectively. Device 1, Device 2, Device 3, CE1, and CE2 belong to VPN1, and PE1, PE2, and P1 belong to the public network. The private network IP address of device 1 is 100.1.1.1, the private network IP address of device 2 is 200.2.2.2, and the private network IP address of device 3 is 300.3.3.3. The ID of the incoming interface connected to CE1 on PE1 is A1, the ID of the outgoing interface connected to P1 on PE1 is A2, and the ID of the incoming interface connected to P1 on PE2 is B1.
为了隔离不同的VPN,PE设备上创建不同的VPN实例,每个VPN实例维护一张单独的VPN路由表(也可以称之为私网路由表),其中,VPN实例,也可以称之为虚拟路由转发(Virtual Routing Forwarding,VRF)。通过虚拟路由转发标识(Virtual Routing Forwarding Identifier,VRF ID)可以区分PE设备上不同的VPN实例。假设PE1上VPN1对应的VPN实例的VRF ID为1,那么VPN1对应的VPN路由表包括VRF ID1、设备2的私网IP地址 200.2.2.2和出接口A2之间的第一对应关系,以及VPN1的VRF ID1,设备3的私网IP地址300.3.3.3和出接口A2之间的第二对应关系。In order to isolate different VPNs, different VPN instances are created on the PE device, and each VPN instance maintains a separate VPN routing table (also called a private network routing table), among which, a VPN instance can also be called a virtual routing forwarding (Virtual Routing Forwarding, VRF). Different VPN instances on the PE device can be distinguished through the Virtual Routing Forwarding Identifier (VRF ID). Assuming that the VRF ID of the VPN instance corresponding to VPN1 on PE1 is 1, then the VPN routing table corresponding to VPN1 includes the first correspondence between VRF ID1, the private IP address 200.2.
PE设备上VPN实例可以与PE设备的入接口绑定,表示通过该入接口接收的流量通过VPN实例转发。在图1-A所示的场景中,PE1的入接口A1与VPN1的VPN实例绑定,即入接口A1与VRF ID1相关联。The VPN instance on the PE device can be bound to the inbound interface of the PE device, which means that the traffic received through the inbound interface is forwarded through the VPN instance. In the scenario shown in Figure 1-A, the inbound interface A1 of PE1 is bound to the VPN instance of VPN1, that is, the inbound interface A1 is associated with VRF ID1.
如果设备1通过CE1发送向设备2发送报文1,那么PE1通过入接口A1接收目的地址为200.2.2.2的报文1。在接收到报文1之后,PE1根据入接口A1确定报文1基于VPN1的VPN路由表转发。接着,根据报文1的目的地址200.2.2.2,PE1查找VPN1的VPN路由表确定报文1对应的出接口为出接口A2,从而通过出接口A2转发报文1。If device 1 sends packet 1 to device 2 through CE1, then PE1 receives packet 1 with the destination address 200.2.2.2 through ingress interface A1. After receiving packet 1, PE1 determines according to inbound interface A1 that packet 1 is forwarded based on the VPN routing table of VPN1. Next, according to the destination address 200.2.2.2 of the packet 1, PE1 searches the VPN routing table of VPN1 to determine that the outgoing interface corresponding to the packet 1 is the outgoing interface A2, and then forwards the packet 1 through the outgoing interface A2.
相似地,如果设备1通过CE1发送目的设备为设备3的报文2,那么PE1通过入接口A1接收目的地址为300.3.3.3的报文2。在接收到报文2之后,PE1根据入接口A1确定报文2基于VPN1的VPN路由表转发。接着,根据报文2的目的地址300.3.3.3,PE1查找VPN1的VPN路由表,确定报文2对应的出接口为出接口A2,从而通过出接口A2转发报文2。Similarly, if device 1 sends packet 2 whose destination is device 3 through CE1, then PE1 receives packet 2 with the destination address 300.3.3.3 through ingress interface A1. After receiving packet 2, PE1 determines according to the inbound interface A1 that packet 2 is forwarded based on the VPN routing table of VPN1. Next, according to the destination address 300.3.3.3 of the packet 2, PE1 searches the VPN routing table of VPN1, determines that the outgoing interface corresponding to the packet 2 is the outgoing interface A2, and forwards the packet 2 through the outgoing interface A2.
下面结合图1-B对本申请实施例的另一种网络架构进行简单介绍。Another network architecture of the embodiment of the present application will be briefly introduced below with reference to FIG. 1-B .
参见图1-B,该图为本申请实施例提供的系统的另一种结构示意图。在图1-A所示系统的基础上,图1-B所示的系统还包括P2。P2分别与PE1和PE2连接。其中,PE1上与P2连接的出接口的标识为A3,PE2上与P2连接的入接口的标识为B2。Referring to FIG. 1-B, this figure is another schematic structural diagram of the system provided by the embodiment of the present application. On the basis of the system shown in Fig. 1-A, the system shown in Fig. 1-B also includes P2. P2 is connected to PE1 and PE2 respectively. Wherein, the ID of the outgoing interface connected to P2 on PE1 is A3, and the ID of the incoming interface connected to P2 on PE2 is B2.
在生成VPN路由表时,PE1获取来自CE2的两条路由,其中一条路由包括设备2的私网IP地址200.2.2.2,另一条路由包括设备3的私网IP地址300.3.3.3。经过路由计算,PE1生成的VPN路由表包括VPN1的VRF ID1、私网IP地址200.2.2.2和出接口A2之间的对应关系,以及VPN1的VRF ID1、私网IP地址300.3.3.3和出接口A2的对应关系。When generating the VPN routing table, PE1 obtains two routes from CE2, one of which includes device 2's private IP address 200.2.2.2, and the other route includes device 3's private IP address 300.3.3.3. After route calculation, the VPN routing table generated by PE1 includes the correspondence between VPN1's VRF ID1, private network IP address 200.2.2.2, and outgoing interface A2, and the correspondence between VPN1's VRF ID1, private network IP address 300.3.3.3, and outgoing interface A2.
相应地,PE1通过出接口A2转发目的地址为设备2或设备3的VPN流量。Correspondingly, PE1 forwards the VPN traffic whose destination address is device 2 or device 3 through outbound interface A2.
在一些可能的实现中,VPN路由表还包括掩码。根据掩码和私网IP地址,可以得到私网路由前缀。相应地,上述根据报文的目的地址确定出接口,是指从VPN路由表中查找与报文的目的地址相匹配的私网路由前缀,再根据所述私网路由前缀确定出接口。In some possible implementations, the VPN routing table also includes masks. According to the mask and the private network IP address, the private network routing prefix can be obtained. Correspondingly, the above-mentioned determination of the outgoing interface according to the destination address of the message refers to searching the VPN routing table for a private network routing prefix matching the destination address of the message, and then determining the outgoing interface according to the private network routing prefix.
通过上述介绍可以看出,VPN路由表对VPN流量的转发性能的影响具体包括但不限于以下三个方面。It can be seen from the above introduction that the impact of the VPN routing table on the forwarding performance of VPN traffic includes but is not limited to the following three aspects.
第一方面:随着VPN路由的不断增加,查询VPN路由表的时间不断增加,因而增加了VPN流量的转发时延。The first aspect: With the continuous increase of VPN routes, the time for querying the VPN routing table continues to increase, thus increasing the forwarding delay of VPN traffic.
具体来说,VPN路由表包括VPN中设备的私网IP地址。那么随着VPN中设备的增加,VPN路由表的数据量逐渐增加。相应地,PE1查找VPN路由表的用时也会增加。如此,增加了PE1转发报文的耗时,影响了VPN流量的转发时延。Specifically, the VPN routing table includes private IP addresses of devices in the VPN. Then, with the increase of devices in the VPN, the amount of data in the VPN routing table gradually increases. Correspondingly, the time for PE1 to search the VPN routing table will also increase. In this way, the time-consuming for PE1 to forward packets is increased, which affects the forwarding delay of VPN traffic.
第二方面,VPN路由表限制了报文的转发路径,降低了VPN流量转发的灵活性。Second, the VPN routing table limits the forwarding path of packets, reducing the flexibility of VPN traffic forwarding.
VPN路由表指定了转发报文的出接口和下一跳。即PE1收到VPN流量后,根据VPN路由表,通过指定的出接口向指定的下一跳转发。如此,限制了报文的转发路径,无法实现报文的灵活转发。The VPN routing table specifies the outbound interface and next hop for forwarding packets. That is, after receiving VPN traffic, PE1 forwards it to the next hop through the specified outbound interface according to the VPN routing table. In this way, the forwarding path of the message is limited, and the flexible forwarding of the message cannot be realized.
例如,在图1-B给出的实现方式中,发往设备2和设备3的流量通过相同的出接口A2转发,不能通过不同的出接口转发发往不同设备的流量,不能实现流量的灵活转发。For example, in the implementation shown in Figure 1-B, the traffic destined for Device 2 and Device 3 is forwarded through the same outbound interface A2, and the traffic destined for different devices cannot be forwarded through different outbound interfaces, and flexible forwarding of traffic cannot be realized.
第三方面,VPN路由表更改难度较大,降低了VPN流量转发的灵活性。In the third aspect, it is difficult to change the VPN routing table, which reduces the flexibility of VPN traffic forwarding.
VPN路由表基于其他设备通告的VPN路由生成。因此,如果需要调整流量的转发路径,需要设备2和/或设备3重新进行路由通告,才能修改VPN1的VPN路由表。可见,基于VPN路由表转发VPN流量也不能灵活地调整流量的转发路径。The VPN routing table is generated based on the VPN routes advertised by other devices. Therefore, if the forwarding path of traffic needs to be adjusted, the VPN routing table of VPN1 needs to be modified by device 2 and/or device 3 to perform route advertisement again. It can be seen that forwarding VPN traffic based on the VPN routing table cannot flexibly adjust the traffic forwarding path.
通过上述介绍可以看出,受到VPN路由表的限制,基于VPN路由表的流量转发技术无法保证VPN流量的转发性能。It can be seen from the above introduction that due to the limitation of the VPN routing table, the traffic forwarding technology based on the VPN routing table cannot guarantee the forwarding performance of VPN traffic.
为了解决上述问题,本申请实施例提供了一种流量过滤方法,第一通信装置可以根据流量过滤信息的指示,向公网下一跳转发与流规则匹配的流量。这样,根据流量过滤信息而非VPN路由表转发VPN流量,可以在不使用VPN路由表的前提下转发VPN流量。如此,避免查找VPN路由表,提升了VPN流量的转发性能。In order to solve the above problem, an embodiment of the present application provides a traffic filtering method, in which the first communication device can forward the traffic matching the traffic rule to the next hop of the public network according to the indication of the traffic filtering information. In this way, VPN traffic is forwarded based on traffic filtering information instead of the VPN routing table, and VPN traffic can be forwarded without using the VPN routing table. In this way, searching the VPN routing table is avoided, and the forwarding performance of VPN traffic is improved.
本申请实施例提供的方法可以应用于图1-A或图1-B所示的网络架构。其中,PE设备可以是具有转发功能的设备,比如:路由器(Router)或交换机(Switch)等设备。在一种可能的实现中,PE1和PE2具有基于多协议标记交换(Multiprotocol Label Switching,MPLS)协议转发报文的能力。一种具体的实现中,当本申请实施例的方法应用于图1-A或图1-B所示的网络架构时,第一通信装置例如可以是图1-A和图1-B中的PE1,用于执行下文图2、图3、图5和图6所示方法中第一通信装置执行的步骤。第二通信装置例如可以是图1-A和图1-B中的PE2。The method provided in the embodiment of the present application may be applied to the network architecture shown in FIG. 1-A or FIG. 1-B. Wherein, the PE device may be a device with a forwarding function, such as a router (Router) or a switch (Switch). In a possible implementation, PE1 and PE2 are capable of forwarding packets based on a Multiprotocol Label Switching (Multiprotocol Label Switching, MPLS) protocol. In a specific implementation, when the method of the embodiment of the present application is applied to the network architecture shown in FIG. 1-A or FIG. 1-B, the first communication device may be, for example, PE1 in FIG. 1-A and FIG. 1-B, and is used to execute the steps performed by the first communication device in the methods shown in FIG. 2, FIG. 3, FIG. 5 and FIG. 6 below. The second communication device may be, for example, PE2 in FIG. 1-A and FIG. 1-B .
在上文介绍的基础上,图1-A和图1-B所示的系统还包括控制管理设备。控制管理设备用于对PE1进行管理。在本申请实施例中,控制管理设备可以是控制器、网管设备或者其他能够实现控制和/或管理的设备。具体地,如果控制管理设备为网管设备,控制管理设备可以用于在PE1上配置第一流量过滤信息,用于执行图2所示实施例中网管设备执行的步骤。如果控制管理设备为控制器,控制管理设备可以用于执行下文图2、图3和图6所示实施例中控制器执行的步骤。On the basis of the above introduction, the systems shown in Fig. 1-A and Fig. 1-B also include control and management equipment. The control and management device is used to manage PE1. In this embodiment of the present application, the control and management device may be a controller, a network management device, or other devices capable of controlling and/or managing. Specifically, if the control and management device is a network management device, the control and management device may be configured to configure first traffic filtering information on PE1 for performing the steps performed by the network management device in the embodiment shown in FIG. 2 . If the control management device is a controller, the control management device may be used to execute the steps performed by the controller in the embodiments shown in FIG. 2 , FIG. 3 and FIG. 6 below.
如果控制管理设备为控制器,控制管理设备所在的系统可以包括多级控制器架构。在多级控制器架构中等级较高的控制器可以控制等级较低的控制器。典型的多级控制器架构包括一个父控制器和多个子控制器。本申请实施例中的控制管理设备(以及图2、图3和图6所示的控制器)可以是用于控制PE设备的控制器。该控制器可以是父控制器,也可以是子控制器。控制管理设备和PE1之间建立邻居关系,向PE1发送消息。作为一种可能的实现,控制管理设备和PE1之间的邻居关系可以是VPN流规则(Flow Specification,Flowspec)邻居关系,也可以是VPN邻居关系。控制管理设备和PE1之间建立VPN邻居关系时,表示控制管理设备和PE1属于同一个VPN。If the control and management device is a controller, the system where the control and management device is located may include a multi-level controller architecture. In a multi-level controller architecture, higher-level controllers can control lower-level controllers. A typical multi-level controller architecture includes a parent controller and multiple child controllers. The control management device (and the controller shown in FIG. 2 , FIG. 3 and FIG. 6 ) in this embodiment of the present application may be a controller for controlling PE devices. This controller can be a parent controller or a child controller. The control management device establishes a neighbor relationship with PE1 and sends a message to PE1. As a possible implementation, the neighbor relationship between the control management device and PE1 may be a VPN flow rule (Flow Specification, Flowspec) neighbor relationship, or a VPN neighbor relationship. When the VPN neighbor relationship is established between the control and management device and PE1, it means that the control and management device and PE1 belong to the same VPN.
在一种可能的实现方式中,PE1和PE2之间可以建立有一条或多条公网隧道,公网隧道可以是标签分发协议(Label Distribution Protocol,LDP)隧道或者流量工程(Traffic Engineering,TE)隧道,也可以是其他类型的隧道。例如,在图1-A所示的实现方式中,PE1和PE2之间可以建立有公网隧道1,公网隧道1对应转发路径为“PE1→P1→PE2”。 在图1-B所示的实现方式中,PE1和PE2之间建立有公网隧道1和公网隧道2。其中,公网隧道1对应转发路径为“PE1→P1→PE2”,公网隧道2对应转发路径为“PE1→P2→PE2”。PE1和PE2之间建立的公网隧道的隧道类型可以相同,也可以不同。In a possible implementation manner, one or more public network tunnels may be established between PE1 and PE2, and the public network tunnels may be Label Distribution Protocol (Label Distribution Protocol, LDP) tunnels or Traffic Engineering (Traffic Engineering, TE) tunnels, or other types of tunnels. For example, in the implementation shown in Figure 1-A, a public network tunnel 1 may be established between PE1 and PE2, and the forwarding path corresponding to the public network tunnel 1 is "PE1→P1→PE2". In the implementation shown in Figure 1-B, public network tunnel 1 and public network tunnel 2 are established between PE1 and PE2. Wherein, the forwarding path corresponding to the public network tunnel 1 is "PE1→P1→PE2", and the forwarding path corresponding to the public network tunnel 2 is "PE1→P2→PE2". The tunnel types of the public network tunnels established between PE1 and PE2 can be the same or different.
下面结合图2,以公网隧道1为LDP类型的公网隧道,公网隧道2为TE类型的公网隧道为例,对本申请实施例提供的技术方案进行介绍。参见图2,该图为本申请实施例提供的流量转发方法200的一种信令交互图,具体包括以下S201、S202和S203。The technical solution provided by the embodiment of the present application will be described below with reference to FIG. 2 , taking public network tunnel 1 as an LDP-type public network tunnel and public network tunnel 2 as a TE-type public network tunnel as an example. Referring to FIG. 2 , this figure is a signaling interaction diagram of the traffic forwarding method 200 provided in the embodiment of the present application, specifically including the following S201 , S202 and S203 .
S201:控制管理设备获取第一流量过滤信息。S201: The control management device acquires first traffic filtering information.
首先对第一流量过滤信息进行介绍。First, the first traffic filtering information is introduced.
在本申请实施例中,第一流量过滤信息包括VPN标签、第一流量过滤动作和第一流规则,用于指示通信装置为与第一流规则匹配的报文添加所述VPN标签,并向第二通信装置的第一公网IP地址转发所述报文。In this embodiment of the present application, the first traffic filtering information includes a VPN label, a first traffic filtering action, and a first flow rule, and is used to instruct the communication device to add the VPN label to a message matching the first flow rule, and forward the message to the first public network IP address of the second communication device.
在本申请实施例中,VPN标签是第二通信装置为VPN路由分配的标签,在本申请中,VPN标签例如可以是MPLS标签。具体地,第二通信装置可以以每VPN实例每标签的方式分配VPN标签,也可以以每VPN路由每标签的方式分配VPN标签。In the embodiment of the present application, the VPN label is a label assigned by the second communication device to the VPN route. In the present application, the VPN label may be, for example, an MPLS label. Specifically, the second communication device may allocate VPN labels in a manner of per VPN instance per label, or may allocate VPN labels in a manner of per VPN route per label.
如果第二通信装置以每VPN实例每标签的方式分配VPN标签,属于同一VPN的多个VPN路由具有相同的VPN标签。如果第二通信装置以每VPN路由每标签的方式分配VPN标签,属于同一VPN的多个VPN路由具有不同的VPN标签。If the second communication device allocates a VPN label in a manner of per VPN instance per label, multiple VPN routes belonging to the same VPN have the same VPN label. If the second communication device allocates VPN labels in a per-VPN-route-per-label manner, multiple VPN routes belonging to the same VPN have different VPN labels.
例如,在图1-A所示的实现方式中,如果PE2以每VPN实例每标签的方式分配VPN标签,VPN1中不同的VPN路由对应相同的VPN标签,设备2对应的VPN路由和设备3对应的VPN路由对应相同的VPN标签;如果PE2以每VPN路由每标签的方式分配VPN标签,VPN1中不同的VPN路由对应不同的VPN标签,设备2对应的VPN路由和设备3对应的VPN路由对应不同的VPN标签。For example, in the implementation shown in Figure 1-A, if PE2 allocates VPN labels per VPN instance, different VPN routes in VPN1 correspond to the same VPN label, and the VPN routes corresponding to device 2 and device 3 correspond to the same VPN label; if PE2 allocates VPN labels per VPN route per label, different VPN routes in VPN1 correspond to different VPN labels, and the VPN routes corresponding to device 2 and VPN routes corresponding to device 3 correspond to different VPN labels.
为了便于说明,后文中以第二通信装置以每VPN实例每标签的方式为例进行介绍。For ease of description, the second communication device uses a label per VPN instance as an example for introduction in the following.
在本申请实施例中,第一流规则是对报文的限制条件,用于判断报文是否需要被重定向到第一下一跳。与第一流规则匹配的报文被第一通信装置添加VPN标签,并向第一下一跳转发。In this embodiment of the present application, the first flow rule is a restriction on packets, and is used to determine whether the packets need to be redirected to the first next hop. A packet matching the first flow rule is added with a VPN label by the first communication device, and forwarded to the first next hop.
具体地,第一流规则可以包括至少一个用于匹配报文的特征字段的取值的匹配规则,用于限定报文中特征字段的取值。相应地,与第一流规则匹配的报文,其中特征字段的取值与匹配规则中限定的取值一致。Specifically, the first flow rule may include at least one matching rule for matching the value of the characteristic field of the packet, and is used for limiting the value of the characteristic field in the packet. Correspondingly, in the packet matching the first flow rule, the value of the feature field is consistent with the value defined in the matching rule.
举例说明。第一流规则包括第一匹配规则和第二匹配规则。与第一流规则匹配的报文分别与第一匹配规则和第二匹配规则匹配。假设第一匹配规则用于限定报文中目的地址字段的取值,第二匹配规则用于限定报文中源地址字段的取值,且第一匹配规则包括第一私网IP地址,第二匹配规则包括第二私网IP地址。那么与第一流规则匹配的报文的目的地址为第一私网IP地址,源地址为第二私网IP地址。for example. The first flow rule includes a first matching rule and a second matching rule. Packets matching the first flow rule are respectively matched with the first matching rule and the second matching rule. Suppose the first matching rule is used to limit the value of the destination address field in the message, the second matching rule is used to limit the value of the source address field in the message, and the first matching rule includes the first private network IP address, and the second matching rule includes the second private network IP address. Then, the destination address of the packet matching the first flow rule is the first private network IP address, and the source address is the second private network IP address.
以图1-A为例进行说明。如果第一流规则用于匹配从设备1发往设备2的报文,那么第一流规则中第一匹配规则包括私网IP地址200.2.2.2,用于限定报文目的地址字段的取值为200.2.2.2;第一流规则中第二匹配规则包括私网IP地址100.1.1.1,用于限定报文源地址 字段的取值为100.1.1.1。如果PE1接收到报文X,且报文X的目的地址为200.2.2.2,源地址为100.1.1.1,那么PE1确定报文X与第一流规则匹配。Take Figure 1-A as an example for illustration. If the first flow rule is used to match the message sent from device 1 to device 2, then the first matching rule in the first flow rule includes the private network IP address 200.2.2.2, which is used to limit the value of the message destination address field to 200.2.2.2; the second matching rule in the first flow rule includes the private network IP address 100.1.1.1, and is used to limit the value of the message source address field to 100.1.1.1. If PE1 receives packet X, and the destination address of packet X is 200.2.2.2, and the source address is 100.1.1.1, then PE1 determines that packet X matches the first flow rule.
可选地,上述第一匹配规则和/或第二匹配规则还可以包括网段。如果报文的目的地址属于第一匹配规则所包括的网段,且报文的源地址属于第二匹配规则所包括的网段,那么该报文与第一流规则相匹配。Optionally, the first matching rule and/or the second matching rule may further include a network segment. If the destination address of the packet belongs to the network segment included in the first matching rule, and the source address of the packet belongs to the network segment included in the second matching rule, then the packet matches the first flow rule.
在本申请实施例中,第一流量过滤动作包括第二通信装置的第一公网IP地址,用于指示第一通信装置将与第一流规则匹配的流量重定向到第二通信装置的第一公网IP地址。第二通信装置的第一公网IP地址又可以被称为重定向的第一下一跳。In this embodiment of the present application, the first traffic filtering action includes the first public network IP address of the second communication device, and is used to instruct the first communication device to redirect traffic matching the first flow rule to the first public network IP address of the second communication device. The first public network IP address of the second communication device may also be referred to as the redirected first next hop.
可选地,第二通信装置可以对应一个或多个公网IP地址。例如,第二通信装置具有多个接口,每个接口可以对应一个公网IP地址。其中,第二通信装置的一个接口对应的公网IP地址为上述第一下一跳,即第一公网IP地址。相应地,第一流量过滤动作用于指示第一通信装置将与第一流规则匹配的流量重定向到第二通信装置的第一公网IP地址。第二通信装置通过与第一公网IP地址对应的接口接收与第一流规则匹配的流量。Optionally, the second communication device may correspond to one or more public network IP addresses. For example, the second communication device has multiple interfaces, and each interface may correspond to a public network IP address. Wherein, the public network IP address corresponding to one interface of the second communication device is the above-mentioned first next hop, that is, the first public network IP address. Correspondingly, the first traffic filtering action is used to instruct the first communication device to redirect the traffic matching the first flow rule to the first public network IP address of the second communication device. The second communication device receives traffic matching the first flow rule through the interface corresponding to the first public network IP address.
在一些可能的实现中,第一流量过滤信息还包括第一隧道标识和/或第一隧道的隧道类型信息。第一隧道标识用于标识第一隧道,例如可以是第一隧道的隧道标识(Tunnel ID)。第一隧道的隧道类型信息用于指示第一隧道的类型。第一隧道为第一通信装置和第二通信装置之间建立的第一公网隧道。具体地,第一隧道为从第一通信装置到第二通信装置上第一公网IP地址对应的接口之间的公网隧道。In some possible implementations, the first traffic filtering information further includes a first tunnel identifier and/or tunnel type information of the first tunnel. The first tunnel identifier is used to identify the first tunnel, for example, it may be a tunnel identifier (Tunnel ID) of the first tunnel. The tunnel type information of the first tunnel is used to indicate the type of the first tunnel. The first tunnel is a first public network tunnel established between the first communication device and the second communication device. Specifically, the first tunnel is a public network tunnel from the first communication device to an interface corresponding to the first public network IP address on the second communication device.
这样,如果第一通信装置和第二通信装置之间存在多条公网隧道,第一通信装置可以根据第一隧道类型从多条公网隧道中确定第一隧道,或者,第一通信装置可以根据第一隧道的隧道类型信息,从多条公网隧道中选择隧道类型与第一隧道的隧道类型信息匹配的公网隧道作为第一隧道。也就是说,第一隧道标识和/或第一隧道的隧道类型信息用于确定第一隧道。In this way, if there are multiple public network tunnels between the first communication device and the second communication device, the first communication device may determine the first tunnel from the multiple public network tunnels according to the first tunnel type, or the first communication device may select a public network tunnel whose tunnel type matches the tunnel type information of the first tunnel from the multiple public network tunnels as the first tunnel according to the tunnel type information of the first tunnel. That is to say, the first tunnel identifier and/or the tunnel type information of the first tunnel are used to determine the first tunnel.
在本申请实施例中,第一流量过滤信息可以是技术人员在控制管理设备上配置的。可选地,如果控制管理设备为控制器,第一流量过滤信息也可以是控制管理设备根据控制消息生成的。控制消息是控制管理设备的上级控制器向控制管理设备发送的消息,包括第一流量过滤信息。In this embodiment of the present application, the first traffic filtering information may be configured by a technician on the control and management device. Optionally, if the control management device is a controller, the first traffic filtering information may also be generated by the control management device according to the control message. The control message is a message sent by the upper-level controller of the control and management device to the control and management device, and includes first traffic filtering information.
S202:控制管理设备向第一通信装置发送第一流量过滤信息。S202: The control and management device sends first traffic filtering information to the first communication apparatus.
在获取到第一流量过滤信息之后,控制管理设备可以向第一通信装置发送第一流量过滤信息。根据上文介绍可知,控制管理设备可以是网管设备,也可以是控制器。相应地,控制管理设备向第一通信装置发送第一流量过滤信息具体包括但不限于以下两种方式。After acquiring the first traffic filtering information, the control management device may send the first traffic filtering information to the first communication device. According to the above introduction, it can be seen that the control and management device may be a network management device or a controller. Correspondingly, the sending of the first traffic filtering information by the control and management device to the first communication device specifically includes but is not limited to the following two manners.
方式一:控制管理设备在第一通信装置上配置第一流量过滤信息。Way 1: The control and management device configures first traffic filtering information on the first communication device.
如果控制管理设备为网管设备,控制管理设备可以通过命令行或网络配置协议(Network Configuration Protocol,NETCONF)在第一通信装置上配置第一流量过滤信息。上述过程也可以被称为静态配置。相应地,第一通信装置可以基于网管设备配置的内容获取第一流量过滤信息。If the control and management device is a network management device, the control and management device can configure the first traffic filtering information on the first communication device through a command line or a network configuration protocol (Network Configuration Protocol, NETCONF). The above process may also be referred to as static configuration. Correspondingly, the first communication device may acquire the first traffic filtering information based on the content configured by the network management device.
在一种可能的实现中,控制管理设备可以在第一通信装置的转发面上配置第一流规则 转发表项,以便第一通信装置的转发面根据第一流规则转发表项转发流量。关于第一流规则转发表项的介绍可以参见图3相关的介绍,这里不再赘述。In a possible implementation, the control management device may configure the first flow rule forwarding entry on the forwarding plane of the first communication device, so that the forwarding plane of the first communication device forwards traffic according to the first flow rule forwarding entry. For the introduction of the first-rate rule forwarding entry, refer to the relevant introduction in FIG. 3 , and will not be repeated here.
方式二:控制管理设备向第一通信装置发送包括第一流量过滤信息的第一通告消息。Manner 2: The control and management device sends a first notification message including the first traffic filtering information to the first communication device.
如果控制管理设备为控制器,控制管理设备可以通过第一通告消息向第一通信装置发送第一流量过滤信息。其中,第一通告消息包括第一流量过滤信息。第一通告消息可以是控制管理设备生成的。或者,如果系统中存在多级控制器,第一通告消息也可以是控制管理设备的上级控制器生成并向控制管理设备发送的。控制管理设备在接收到上级控制器发送的第一通告消息之后,可以向第一通信装置转发第一通告消息。If the control management device is a controller, the control management device may send the first traffic filtering information to the first communication apparatus through a first notification message. Wherein, the first notification message includes first traffic filtering information. The first notification message may be generated by the control and management device. Alternatively, if there are multiple levels of controllers in the system, the first notification message may also be generated by the upper-level controller of the control and management device and sent to the control and management device. After receiving the first notification message sent by the superior controller, the control management device may forward the first notification message to the first communication device.
在本申请实施例中,第一通告消息可以包括一条流量过滤信息(即第一流量过滤信息),也可以包括多条流量过滤信息。例如,第一通告消息可以包括第一流量过滤信息和第二流量过滤信息。In this embodiment of the present application, the first notification message may include one piece of traffic filtering information (that is, first traffic filtering information), or may include multiple pieces of traffic filtering information. For example, the first notification message may include first traffic filtering information and second traffic filtering information.
也就是说,除了静态配置以外,第一通信装置也可以通过第一通告消息获取第一流量过滤信息。第一通告消息是控制器向第一通信装置发送的通告消息。方式二的具体实现过程将在下文中结合图3进行具体介绍,此处不再赘述。That is to say, in addition to the static configuration, the first communication device may also obtain the first traffic filtering information through the first notification message. The first notification message is a notification message sent by the controller to the first communication device. The specific implementation process of the second method will be described in detail below in conjunction with FIG. 3 , and will not be repeated here.
S203:第一通信装置根据第一流量过滤信息转发与第一流规则匹配的流量。S203: The first communication device forwards the traffic matching the first flow rule according to the first traffic filtering information.
如果第一通信装置接收到多条与第一流规则匹配的报文,可以称第一通信装置接收到与第一流规则匹配的流量。根据第一流量过滤信息,第一通信装置向与第一流规则匹配的报文中添加VPN标签,并向第二通信装置的第一公网IP地址转发添加了VPN标签的报文。上述过程可以被称为第一通信装置根据第一流量过滤信息转发与第一流规则匹配的流量。If the first communication device receives multiple packets matching the first flow rule, it may be said that the first communication device has received traffic matching the first flow rule. According to the first traffic filtering information, the first communication device adds a VPN label to the packet matching the first flow rule, and forwards the packet with the VPN label added to the first public network IP address of the second communication device. The foregoing process may be referred to as the first communication device forwarding the traffic matching the first flow rule according to the first traffic filtering information.
关于第一通信装置转发VPN流量的详细介绍可以参见图5所示实施例,这里不再赘述。For a detailed introduction about forwarding VPN traffic by the first communication device, reference may be made to the embodiment shown in FIG. 5 , which will not be repeated here.
在本申请实施例中,控制管理设备向第一通过信装置发送第一流量过滤信息。第一通信装置根据第一流量过滤信息的指示,向指定的公网IP地址转发与第一流规则匹配的报文。如果VPN流量中的报文与第一流规则相匹配,第一通信装置可以向重定向的第一下一跳转发添加了VPN表亲的报文。这样,根据第一流量过滤信息,在不使用VPN路由表的前提下实现了VPN流量的转发。如此,避免查找VPN路由表,提升了VPN流量的转发性能。In this embodiment of the present application, the control management device sends the first traffic filtering information to the first communication device. The first communication device forwards the packet matching the first flow rule to the designated public network IP address according to the indication of the first flow filtering information. If the packet in the VPN flow matches the first flow rule, the first communication device may forward the packet with the VPN cousin added to the redirected first next hop. In this way, according to the first traffic filtering information, forwarding of VPN traffic is realized without using the VPN routing table. In this way, searching the VPN routing table is avoided, and the forwarding performance of VPN traffic is improved.
进一步地,在一些可能的实现中,控制管理设备还可以向第一通信装置发送第二流量过滤信息。第二流量过滤信息包括第二流规则、作为重定向的第二下一跳的第二通信装置的第二公网IP地址和所述VPN标签。根据第二流量过滤信息,第一通信装置在与第二流规则匹配的报文中添加所述VPN标签,并向第二通信装置的第二公网IP地址发送。这样,通过不同的传输路径向第二通信装置转发不同的流量,实现了流量的差异化传输。可以更好地满足流量传输的要求,提升VPN流量的灵活转发。Further, in some possible implementations, the control management device may also send the second traffic filtering information to the first communication apparatus. The second traffic filtering information includes a second flow rule, a second public network IP address of the second communication device serving as a redirected second next hop, and the VPN label. According to the second traffic filtering information, the first communication device adds the VPN label to the packet matching the second flow rule, and sends it to the second public network IP address of the second communication device. In this way, different traffic is forwarded to the second communication device through different transmission paths, thereby implementing differentiated transmission of traffic. It can better meet the requirements of traffic transmission and improve the flexible forwarding of VPN traffic.
下面以第一通信装置根据控制器发送的第一通告消息确定第一流量过滤信息(即上述方式二)为例,对本申请实施例提供的技术方案进行详细介绍。The technical solution provided by the embodiment of the present application will be described in detail below by taking the first communication device determining the first traffic filtering information according to the first notification message sent by the controller (that is, the second method above) as an example.
参见图3,该图为本申请实施例提供的消息发送方法300的一种信令交互图,具体包括以下S301-S303。Referring to FIG. 3 , this figure is a signaling interaction diagram of a message sending method 300 provided in an embodiment of the present application, specifically including the following S301-S303.
S301:控制器获取第一通告消息。S301: The controller acquires a first notification message.
为了向第一通信装置通告第一流量过滤信息,控制器先获取第一通告消息,第一通告 消息包括第一流量过滤信息。其中,第一通告消息是控制器生成的,或者是控制器的上级控制器向控制器发送的。可选地,第一通告消息还可以包括多条流量过滤信息,例如,第一通告消息可以包括第一流量过滤信息和第二流量过滤信息。关于第一流量过滤信息的基本介绍可以参见上文,这里不再赘述。In order to notify the first communication device of the first traffic filtering information, the controller first obtains a first notification message, and the first notification message includes the first traffic filtering information. Wherein, the first notification message is generated by the controller, or sent to the controller by a superior controller of the controller. Optionally, the first notification message may also include multiple pieces of traffic filtering information, for example, the first notification message may include first traffic filtering information and second traffic filtering information. The basic introduction of the first traffic filtering information can be referred to above, and will not be repeated here.
作为一种可能的实现,控制器向第一通信装置发送第一通告消息,用于通告Flowspec路由,该第一通告消息包括VPN标签,第一流规则和第一流量过滤动作。相应地,上述第一流规则又可以被称为匹配项(Match),上述VPN标签和第一流量过滤动作可以被称为动作项(Action)。As a possible implementation, the controller sends a first notification message to the first communication device for notifying the Flowspec route, where the first notification message includes a VPN label, a first flow rule and a first flow filtering action. Correspondingly, the above-mentioned first flow rule may also be called a matching item (Match), and the above-mentioned VPN label and first traffic filtering action may be called an action item (Action).
所述VPN标签可以是第二通信装置向控制器上报,也可以由控制器统一分配。The VPN label may be reported by the second communication device to the controller, or may be uniformly assigned by the controller.
根据前文介绍可知,第一通告消息还可以包括第一隧道的隧道类型信息和/或第一隧道标识。According to the foregoing introduction, it can be known that the first notification message may further include tunnel type information and/or a first tunnel identifier of the first tunnel.
在本申请实施例中,第一通告消息可以是BGP消息,也可以是PCEP消息。下面以第一通告消息为BGP消息为例,对第一通告消息携带第一流量过滤信息的方法进行介绍。In this embodiment of the present application, the first notification message may be a BGP message or a PCEP message. Taking the first notification message as a BGP message as an example, the method for carrying the first traffic filtering information in the first notification message is introduced below.
第一通告消息可以是BGP更新(BGP Update)消息。上述第一流规则可以被携带在第一通告消息的网络层可达性信息(Network Layer Reachability Information,NLRI)字段中。VPN标签和第一流量过滤动作可以携带在新的BGP的扩展团体属性。具体地,VPN标签和第一流量过滤动作可以被携带在相同的扩展团体属性中,也可以被携带在不同的扩展团体属性中。The first notification message may be a BGP update (BGP Update) message. The foregoing first flow rule may be carried in a Network Layer Reachability Information (Network Layer Reachability Information, NLRI) field of the first notification message. The VPN label and the first traffic filtering action can be carried in the extended community attribute of the new BGP. Specifically, the VPN label and the first traffic filtering action may be carried in the same extended community attribute, or may be carried in different extended community attributes.
根据前文介绍可知,第一通告消息还可以包括第一隧道的隧道类型信息。一种具体的实现中,第一隧道的隧道类型信息和VPN标签可以携带在同一个扩展团体属性中。携带有第一隧道的隧道类型信息和VPN标签的扩展团体属性可以被称为第一扩展团体属性。示例性的,第一扩展团体属性的一种具体格式可以如图4所示。其中,第一扩展团体属性的子类型(Sub-Type)字段的值用于标识第一扩展团体属性包括VPN标签和第一隧道的隧道类型信息,第一扩展团体属性的隧道类型(Tunnel Type)字段用于携带第一隧道的隧道类型信息,MPLS标签(MPLS Label)字段用于携带所述VPN标签。According to the foregoing introduction, it can be known that the first notification message may further include tunnel type information of the first tunnel. In a specific implementation, the tunnel type information and the VPN label of the first tunnel may be carried in the same extended community attribute. The extended community attribute carrying the tunnel type information and the VPN label of the first tunnel may be referred to as a first extended community attribute. Exemplarily, a specific format of the first extended community attribute may be as shown in FIG. 4 . Wherein, the value of the sub-type (Sub-Type) field of the first extended community attribute is used to identify that the first extended community attribute includes the tunnel type information of the VPN label and the first tunnel, the tunnel type (Tunnel Type) field of the first extended community attribute is used to carry the tunnel type information of the first tunnel, and the MPLS label (MPLS Label) field is used to carry the VPN label.
可以理解的是,第一隧道的隧道类型信息也可以被携带在独立的扩展团体属性中。It can be understood that the tunnel type information of the first tunnel may also be carried in an independent extended community attribute.
根据前文介绍可知,第一通信装置和控制器之间可以存在VPN Flowspec邻居关系。那么第一通告消息还包括第一RT。在生成第一关联关系的过程中,第一通信装置可以根据第一RT确定第一流量过滤动作对应的VPN标识。关于第一RT的作用可以参见S303的介绍,这里不再赘述。According to the foregoing introduction, it can be known that a VPN Flowspec neighbor relationship may exist between the first communication device and the controller. Then the first notification message also includes the first RT. During the process of generating the first association relationship, the first communication device may determine the VPN identifier corresponding to the first traffic filtering action according to the first RT. For the role of the first RT, refer to the introduction of S303, and details will not be repeated here.
S302:控制器向第一通信装置发送所述第一通告消息。S302: The controller sends the first notification message to the first communication device.
在获取到第一通告消息之后,控制器向第一通信装置发送第一通告消息,以使第一通信装置根据第一通告消息得到第一流量过滤信息。可选地,控制器向第一通信装置发送第一通告消息,又可以被称为控制器向第一通信装置发送Flowspec路由。After obtaining the first notification message, the controller sends the first notification message to the first communication device, so that the first communication device obtains first traffic filtering information according to the first notification message. Optionally, the controller sending the first notification message to the first communication device may also be referred to as the controller sending the Flowspec route to the first communication device.
S303:第一通信装置根据第一流量过滤信息生成第一关联关系。S303: The first communication device generates a first association relationship according to the first traffic filtering information.
在接收到第一通告消息之后,第一通信装置根据第一通告消息得到第一流量过滤信息,并基于第一流量过滤信息生成第一关联关系。接着,第一通信装置在转发面中保存所述第 一关联关系,以便根据第一关联关系为与第一流规则匹配的报文添加VPN标签并向第二通信装置的第一公网IP地址转发。After receiving the first notification message, the first communication device obtains first traffic filtering information according to the first notification message, and generates a first association relationship based on the first traffic filtering information. Next, the first communication device saves the first association relationship in the forwarding plane, so as to add a VPN label to the packet matching the first flow rule according to the first association relationship and forward it to the first public network IP address of the second communication device.
所述第一关联关系包括所述VPN标签,所述第一流规则和所述第一下一跳的IP地址之间的关联关系。The first association relationship includes an association relationship between the VPN label, the first flow rule, and the first next-hop IP address.
在本申请中,所述第一关联关系具体包括但不限于以下三种实现方式。In this application, the first association relationship specifically includes but is not limited to the following three implementation manners.
实现方式一:第一关联关系包括VPN标签、第一流规则和下一跳之间的关联关系,表示与第一流规则相匹配的报文需要被添加VPN标签并向所述第二通信装置的第一公网IP地址发送。Implementation method 1: the first association relationship includes the association relationship between the VPN label, the first flow rule and the next hop, indicating that the packet matching the first flow rule needs to be added with a VPN label and sent to the first public network IP address of the second communication device.
实现方式二:第一关联关系包括VPN标签、第一流规则、第一隧道标识和下一跳之间的关联关系,表示与第一流规则相匹配的报文需要被添加VPN标签,并经由第一隧道向所述第二通信装置的第一公网IP地址发送。Implementation mode 2: the first association relationship includes the association relationship between the VPN label, the first flow rule, the first tunnel identifier, and the next hop, indicating that the packet matching the first flow rule needs to be added with a VPN label, and sent to the first public network IP address of the second communication device via the first tunnel.
实现方式三:第一关联关系包括VPN标签、第一流规则、第一隧道标识、第一隧道的隧道类型信息和下一跳之间的关联关系。Implementation mode 3: the first association relationship includes the association relationship between the VPN label, the first flow rule, the first tunnel identifier, the tunnel type information of the first tunnel, and the next hop.
在上述第二种实现方式和第三种实现方式中,第一关联关系包括第一隧道标识。第一隧道标识可以是第一通告消息中携带的,也可以是第一通信装置根据通告消息确定的。具体地,如果第一通告消息不包括第一隧道标识,第一通信装置根据通告消息确定第一隧道标识。具体地,第一通信装置确定第一隧道标识具体包括但不限于以下两种实现方式。In the foregoing second and third implementation manners, the first association relationship includes the first tunnel identifier. The first tunnel identifier may be carried in the first notification message, or may be determined by the first communication device according to the notification message. Specifically, if the first notification message does not include the first tunnel identifier, the first communication device determines the first tunnel identifier according to the notification message. Specifically, determining the first tunnel identifier by the first communication device specifically includes but is not limited to the following two implementation manners.
实现方式一:第一通信装置根据所述第一公网IP地址迭代第一隧道,得到第一隧道标识。Implementation manner 1: The first communication device iterates the first tunnel according to the first public network IP address to obtain the first tunnel identifier.
具体地,第一通信装置可以根据第一公网IP地址,从第一通信装置对应的多条隧道中查找到达第二通信装置的第一公网IP地址的公网隧道,并将该公网隧道确定为第一隧道,得到第一隧道标识。Specifically, the first communication device may search for a public network tunnel reaching the first public network IP address of the second communication device from the multiple tunnels corresponding to the first communication device according to the first public network IP address, and determine the public network tunnel as the first tunnel to obtain the first tunnel identifier.
实现方式二:第一通信装置根据第一公网IP地址和第一隧道的隧道类型信息确定第一隧道,得到第一隧道标识。Implementation Mode 2: The first communication device determines the first tunnel according to the first public network IP address and the tunnel type information of the first tunnel, and obtains the first tunnel identifier.
具体地,第一通信装置先根据第一公网IP地址确定第一通信装置和第一公网IP地址之间的一条或多条公网隧道,再从一条或多条公网隧道中选择隧道类型与第一隧道的隧道类型一致的公网隧道作为第一隧道,得到第一隧道标识。Specifically, the first communication device first determines one or more public network tunnels between the first communication device and the first public network IP address according to the first public network IP address, and then selects a public network tunnel whose tunnel type is consistent with that of the first tunnel from the one or more public network tunnels as the first tunnel, and obtains the first tunnel identifier.
结合图1-B对实现方式二进行说明,如果控制管理设备向PE1发送的第一通告消息包括第一隧道的隧道类型信息,且第一隧道的隧道类型信息指示第一隧道为LDP类型的公网隧道,那么PE1可以将公网隧道1确定为第一隧道。如果第一隧道的隧道类型信息指示第一隧道为TE类型的公网隧道,那么PE1可以将公网隧道2确定为第一隧道。 Embodiment 2 is described with reference to FIG. 1-B. If the first notification message sent by the control and management device to PE1 includes tunnel type information of the first tunnel, and the tunnel type information of the first tunnel indicates that the first tunnel is an LDP-type public network tunnel, then PE1 may determine public network tunnel 1 as the first tunnel. If the tunnel type information of the first tunnel indicates that the first tunnel is a public network tunnel of the TE type, PE1 may determine public network tunnel 2 as the first tunnel.
上述第一关联关系可以以第一流规则转发表项的形式保存到第一通信装置的转发面。第一通信装置的转发面基于第一流规则转发表项转发VPN流量。相应地,第一通信装置根据第一流量过滤信息生成第一关联关系包括:第一通信装置的控制面根据第一流量过滤信息生成第一流规则转发表项。在生成第一流规则转发表项之后,第一通信装置的控制面向第一通信装置的转发面下发第一流规则转发表项。The foregoing first association relationship may be stored in the forwarding plane of the first communication device in the form of a first flow rule forwarding entry. The forwarding plane of the first communication device forwards the VPN traffic based on the first flow rule forwarding entry. Correspondingly, the first communication device generating the first association relationship according to the first traffic filtering information includes: the control plane of the first communication device generating a first flow rule forwarding entry according to the first traffic filtering information. After the first flow rule forwarding entry is generated, the control of the first communication device delivers the first flow rule forwarding entry to the forwarding plane of the first communication device.
如果第一关联关系为VPN标签、第一流规则和第一公网IP地址之间的关联关系,第 一流规则转发表项包括VPN标签、第一索引和第一公网IP地址。If the first association relationship is the association relationship between the VPN label, the first flow rule and the first public network IP address, the first flow rule forwarding entry includes the VPN label, the first index and the first public network IP address.
如果第一关联关系为VPN标签、第一流规则、第一隧道标识和第一公网IP地址之间的关联关系,第一流规则转发表项包括VPN标签、第一索引、第一隧道标识和第一公网IP地址。If the first association relationship is the association relationship between the VPN label, the first flow rule, the first tunnel identifier and the first public network IP address, the first flow rule forwarding entry includes the VPN label, the first index, the first tunnel identifier and the first public network IP address.
如果第一关联关系为VPN标签、第一流规则、第一隧道标识、第一隧道的隧道类型信息和第一公网IP地址之间的关联关系,第一流规则转发表项包括VPN标签、第一索引、第一隧道标识、第一隧道的隧道类型信息和第一公网IP地址。If the first association relationship is the association relationship between the VPN label, the first flow rule, the first tunnel identifier, the tunnel type information of the first tunnel, and the first public network IP address, the first flow rule forwarding entry includes the VPN label, the first index, the first tunnel identifier, the tunnel type information of the first tunnel, and the first public network IP address.
其中,第一索引用于索引第一流规则,例如可以用于标识第一流规则的存储位置。这样,第一通信装置的转发面在使用第一流规则转发表项时,可以根据第一索引查找第一流规则,以便判断报文是否与第一流规则匹配。或者,在一些可能的实现方式中,第一流规则转发表项也可以包括第一流规则。Wherein, the first index is used to index the first flow rule, for example, may be used to identify a storage location of the first flow rule. In this way, when the forwarding plane of the first communication device uses the first flow rule to forward the entry, it can search the first flow rule according to the first index, so as to determine whether the packet matches the first flow rule. Or, in some possible implementation manners, the first-flow rule forwarding entry may also include the first-flow rule.
在一些可能的实现方式中,第一流规则转发表项还包括VPN实例的标识,该VPN实例标识用于标识第一流规则对应的VPN实例,例如可以是第一流规则对应的VRF ID。在这样,第一通信装置在通过与VRF ID对应的入接口接收到流量之后,可以根据VRF ID确定流量基于第一流规则转发表项转发。In some possible implementation manners, the first flow rule forwarding entry further includes the identifier of the VPN instance, and the VPN instance identifier is used to identify the VPN instance corresponding to the first flow rule, for example, it may be the VRF ID corresponding to the first flow rule. In this way, after the first communication device receives the traffic through the ingress interface corresponding to the VRF ID, it can determine according to the VRF ID that the traffic is forwarded based on the first flow rule forwarding entry.
下面介绍第一通信装置获取VPN标识的方法。第一通信装置获取VRF ID具体包括但不限于以下两种实现方式。The method for the first communication device to obtain the VPN identifier is introduced below. Obtaining the VRF ID by the first communication device specifically includes but is not limited to the following two implementations.
实现方式一:第一通信装置基于和控制器之间的邻居关系获取VRF ID。Implementation mode 1: the first communication device obtains the VRF ID based on the neighbor relationship with the controller.
如果第一通信装置和控制器之间为VPN邻居,第一通信装置上与控制器连接的接口与VPN实例绑定,那么第一通信装置在接收到控制管理设备发送的第一通告消息之后,可以基于接收第一通告消息的接口确定VRF ID。If the first communication device and the controller are VPN neighbors, and the interface connected to the controller on the first communication device is bound to the VPN instance, then the first communication device may determine the VRF ID based on the interface receiving the first notification message after receiving the first notification message sent by the control management device.
实现方式二:第一通信装置基于第一RT获取VRF ID。Implementation manner 2: the first communication device obtains the VRF ID based on the first RT.
根据前文介绍可知,如果第一通信装置和控制器之间为VPN Flowspec邻居,控制器发送的第一通告消息还包括第一RT。那么第一通信装置在接收到第一通告消息之后,可以根据第一RT进行路由交叉,从而根据第一RT确定VRF ID。According to the foregoing introduction, if the first communication device and the controller are VPN Flowspec neighbors, the first notification message sent by the controller also includes the first RT. Then, after receiving the first notification message, the first communication device may perform routing crossover according to the first RT, so as to determine the VRF ID according to the first RT.
上面介绍了第一通信装置根据控制器发送的第一通告消息获取第一流量过滤信息的方法。下面结合图5对第一通信装置转发流量的过程进行介绍。可以理解的是,图5所示的方法由第一通信装置的转发面执行。所述第一流规则转发表项可以是第一通信装置根据第一通告消息生成的,也可以是网管设备在第一通信装置上配置的。The above describes the method for the first communication device to obtain the first traffic filtering information according to the first notification message sent by the controller. The process of forwarding traffic by the first communication device will be introduced below with reference to FIG. 5 . It can be understood that, the method shown in FIG. 5 is executed by the forwarding plane of the first communication device. The first flow rule forwarding entry may be generated by the first communication device according to the first notification message, or may be configured by the network management device on the first communication device.
参见图5,该图为本申请实施例提供的报文发送方法500的一种信令交互图,具体包括以下S501-S504。Referring to FIG. 5 , this figure is a signaling interaction diagram of a message sending method 500 provided in an embodiment of the present application, specifically including the following S501-S504.
S501:第一通信装置接收第一报文。S501: The first communication device receives a first message.
在本申请实施例中,第一报文的源设备和目的设备为VPN中的设备,第一通信装置通过与VPN绑定的入接口接收第一报文。以图1-A为例,第一报文可以是图1-A中的设备1向设备2发送的报文,那么第一报文的目的地址为设备2的私网IP地址200.2.2.2,第一报文的源地址为设备1的私网IP地址100.1.1.1。PE1通过与VPN1绑定的入接口A1接收第一报文。In this embodiment of the present application, the source device and the destination device of the first message are devices in the VPN, and the first communication device receives the first message through an inbound interface bound to the VPN. Taking Figure 1-A as an example, the first message can be a message sent from device 1 to device 2 in Figure 1-A, then the destination address of the first message is the private network IP address 200.2.2.2 of device 2, and the source address of the first message is the private network IP address 100.1.1.1 of device 1. PE1 receives the first packet through the inbound interface A1 bound to VPN1.
S502:第一通信装置确定第一报文与第一流规则匹配。S502: The first communication device determines that the first packet matches the first flow rule.
在接收到第一报文之后,第一通信装置根据接收第一报文的入接口确定第一报文对应的VRF ID,进而根据VRF ID确定基于第一流量过滤信息转发第一报文。接着,第一通信装置判断第一报文是否与第一流规则匹配。After receiving the first message, the first communication device determines the VRF ID corresponding to the first message according to the incoming interface receiving the first message, and then determines to forward the first message based on the first traffic filtering information according to the VRF ID. Next, the first communication device determines whether the first packet matches the first flow rule.
根据图3对应实施例的介绍可知,第一通信装置以第一流规则转发表项保存第一关联关系。相应地,第一通信装置可以根据第一报文对应VRF ID确定第一流规则转发表项,再根据第一流规则转发表项中的第一索引确定第一流规则,进而判断第一报文是否与第一流规则匹配。According to the introduction of the embodiment corresponding to FIG. 3 , it can be known that the first communication device stores the first association relationship with the first flow rule forwarding entry. Correspondingly, the first communication device may determine the first flow rule forwarding entry according to the VRF ID corresponding to the first message, and then determine the first flow rule according to the first index in the first flow rule forwarding entry, and then determine whether the first packet matches the first flow rule.
如果第一报文与第一流规则匹配,第一通信装置根据第一流量过滤动作转发第一报文,执行S503和S504。如果第一报文与第一流规则不匹配,且第一报文不匹配VRF ID对应的其他任意流规则,第一通信装置可以查找VPN路由表,根据VPN路由表转发第一报文。If the first packet matches the first flow rule, the first communication device forwards the first packet according to the first traffic filtering action, and performs S503 and S504. If the first packet does not match the first flow rule, and the first packet does not match any other flow rule corresponding to the VRF ID, the first communication device may search the VPN routing table and forward the first packet according to the VPN routing table.
S503:第一通信装置为第一报文添加VPN标签。S503: The first communication device adds a VPN label to the first packet.
S504:第一通信装置向所述第一下一跳发送添加所述VPN标签后的第一报文。S504: The first communication device sends the first packet to which the VPN label is added to the first next hop.
在确定第一报文与第一流规则匹配之后,第一通信装置根据第一流量过滤动作转发第一报文。具体地,第一通信装置为第一报文添加VPN标签,并向第二通信装置的第一公网IP地址发送添加VPN标签后的第一报文。After determining that the first packet matches the first flow rule, the first communication device forwards the first packet according to the first traffic filtering action. Specifically, the first communication device adds a VPN label to the first message, and sends the first message with the VPN label added to the first public network IP address of the second communication device.
根据前文介绍可知,第一流规则转发表项可以包括第一隧道标识。相应地,第一通信装置可以根据第一隧道标识确定第一隧道,并通过第一隧道发送添加了VPN标签的第一报文。According to the foregoing introduction, it can be known that the first flow rule forwarding entry may include the first tunnel identifier. Correspondingly, the first communication device may determine the first tunnel according to the first tunnel identifier, and send the first packet with the VPN label added through the first tunnel.
通过上文介绍可以看出,通过第一流量过滤信息,控制器可以在第一通信装置上配置第一关联关系。在接收到VPN流量之后,第一通信装置可以判断VPN流量是否与第一流规则匹配。如果VPN流量与第一流规则匹配,第一通信装置根据第一关联关系确定第一流规则对应的VPN标签和第一下一跳,从而为VPN流量中的报文添加VPN标签,并向第一下一跳转发。第一通信装置可以根据第一流量过滤信息转发VPN流量。如此,避免查找VPN路由表,降低了第一通信装置转发流量的转发时延。It can be seen from the above introduction that, through the first traffic filtering information, the controller can configure the first association relationship on the first communication device. After receiving the VPN traffic, the first telecommunications device may determine whether the VPN traffic matches the first flow rule. If the VPN flow matches the first flow rule, the first communication device determines the VPN label and the first next hop corresponding to the first flow rule according to the first association relationship, so as to add a VPN label to the packet in the VPN flow and forward it to the first next hop. The first communication device may forward VPN traffic according to the first traffic filtering information. In this way, searching the VPN routing table is avoided, and the forwarding delay of traffic forwarded by the first communication device is reduced.
另外,由于第一流量过滤信息是网管设备在第一通信装置上配置的,或者第一流量过滤信息是第一通信装置根据控制器发送的第一通告消息得到的。如果需要调整第一关联关系,可以重新配置第一流量过滤信息或发送新的第一通告消息,无需重新进行路由通告并调整VPN路由表。如此,可以灵活调整流量的转发路径。In addition, because the first traffic filtering information is configured by the network management device on the first communication device, or the first traffic filtering information is obtained by the first communication device according to the first notification message sent by the controller. If the first association relationship needs to be adjusted, the first traffic filtering information can be reconfigured or a new first advertisement message can be sent, without re-advertising the route and adjusting the VPN routing table. In this way, the forwarding path of traffic can be flexibly adjusted.
下面结合图1-A所示的应用场景,以控制管理设备为控制器为例,对图3和图5所示的方法进行介绍。In the following, the methods shown in FIGS. 3 and 5 will be introduced in combination with the application scenario shown in FIG. 1-A and taking the control management device as a controller as an example.
为了转发VPN1的VPN流量,控制器生成通告消息M1并向PE1发送。其中,通告消息M1包括第一RT、VPN1的VPN标签100、流规则1、作为重定向的第一下一跳的PE2的第一公网IP地址1.1.1.1。其中,第一流规则用于匹配从设备1发往设备2的流量。To forward the VPN traffic of VPN1, the controller generates a notification message M1 and sends it to PE1. Wherein, the announcement message M1 includes the first RT, the VPN label 100 of VPN1, the flow rule 1, and the first public network IP address 1.1.1.1 of PE2 as the first next hop of redirection. Wherein, the first flow rule is used to match traffic sent from device 1 to device 2 .
在接收到通告消息M1后,PE1第一RT进行路由交叉得到VPN1的VRF ID1,并生成流规则转发表项1。流规则转发表项1包括VRF ID1、流规则1对应的流规则索引1、PE2的公网IP地址1.1.1.1,公网隧道1的隧道类型信息LDP、公网隧道1的隧道标识1和VPN 标签100。After receiving the notification message M1, the first RT of PE1 performs routing crossover to obtain VRF ID1 of VPN1, and generates flow rule forwarding entry 1. Flow rule forwarding entry 1 includes VRF ID1, flow rule index 1 corresponding to flow rule 1, public network IP address 1.1.1.1 of PE2, tunnel type information LDP of public network tunnel 1, tunnel ID 1 of public network tunnel 1, and VPN label 100.
假设设备1通过公网向设备2发送报文N1,PE1可以通过入接口A1接收CE1转发的报文N1。根据接收报文N1的入接口A1,PE1确定报文N1对应VRF ID1,并根据流规则转发表项1判断报文N1是否与流规则1匹配。在确定报文N1与流规则1匹配之后,PE1在报文N1中添加VPN1的VPN标签100,并通过公网隧道1向PE2发送添加了VPN标签100的报文N1,实现VPN流量的转发。报文N1的传输过程可以如图1-C所示。Assuming that device 1 sends packet N1 to device 2 through the public network, PE1 can receive packet N1 forwarded by CE1 through ingress interface A1. According to the inbound interface A1 that receives packet N1, PE1 determines that packet N1 corresponds to VRF ID1, and judges whether packet N1 matches flow rule 1 according to flow rule forwarding entry 1. After confirming that packet N1 matches flow rule 1, PE1 adds VPN1's VPN label 100 to packet N1, and sends packet N1 with VPN label 100 added to PE2 through public network tunnel 1 to implement VPN traffic forwarding. The transmission process of the packet N1 may be shown in FIG. 1-C.
通过上述介绍可知,PE1可以根据控制器发送的通告消息生成流规则转发表项1。流规则转发表项1指示PE1向PE2的第一公网IP地址转发与第一流规则匹配的报文。这样,在接收到报文之后,PE1可以判断报文是否与流规则1匹配,若匹配,PE1根据流规则转发表项1确定VPN标签100,以及转发报文的公网隧道1。这样,PE1可以不根据VPN1的VPN路由表转发VPN1的流量。如此,避免查找VPN路由表,从而降低了PE1转发报文的用时,提升了VPN1流量的转发性能。It can be seen from the above introduction that PE1 can generate flow rule forwarding entry 1 according to the notification message sent by the controller. Flow rule forwarding entry 1 instructs PE1 to forward packets matching the first flow rule to the first public IP address of PE2. In this way, after receiving the packet, PE1 can determine whether the packet matches flow rule 1, and if so, PE1 determines VPN label 100 and public network tunnel 1 for forwarding the packet according to flow rule forwarding entry 1. In this way, PE1 does not need to forward the traffic of VPN1 according to the VPN routing table of VPN1. In this way, searching the VPN routing table is avoided, thereby reducing the time for PE1 to forward packets and improving the forwarding performance of VPN1 traffic.
在一些可能的实现中,第一通信装置和第二通信装置之间存在多条转发路径。例如,在图1-B所示的应用场景中,PE1和PE2之间存在公网隧道1和公网隧道2两条公网隧道,对应2条转发路径。在本申请实施例中,可以通过流量过滤动作,控制特定的流量通过特定的转发路径传输。In some possible implementations, multiple forwarding paths exist between the first communication device and the second communication device. For example, in the application scenario shown in Figure 1-B, there are two public network tunnels, public network tunnel 1 and public network tunnel 2, between PE1 and PE2, corresponding to two forwarding paths. In this embodiment of the application, a traffic filtering action can be used to control specific traffic to be transmitted through a specific forwarding path.
具体地,第一通信装置可以获取第二流量过滤信息,第二流量过滤信息包括VPN标签、第二流规则和第二流量过滤动作。第二流量过滤动作包括重定向的第二下一跳,重定向的第二下一跳为第二通信装置的第二公网IP地址。第一通信装置根据第二流量过滤信息转发与第二流规则匹配的流量。也就是说,对于与第二流规则相匹配的报文,第一通信装置在报文中添加VPN标签,并向第二通信装置的第二公网IP地址发送。这样,VPN中与第一流规则匹配的流量被发往第二通信装置的第一公网IP地址,与第二流规则匹配的流量被发往第二通信装置的第二公网IP地址。如此,通过不同的传输路径发送经过同一设备(即第二通信装置)的VPN流量,实现了VPN流量的灵活转发。Specifically, the first communication device may acquire second traffic filtering information, where the second traffic filtering information includes a VPN label, a second traffic rule, and a second traffic filtering action. The second traffic filtering action includes a redirected second next hop, where the redirected second next hop is the second public network IP address of the second communication device. The first communication device forwards the traffic matching the second flow rule according to the second traffic filtering information. That is to say, for a message matching the second flow rule, the first communication device adds a VPN label to the message, and sends the message to the second public network IP address of the second communication device. In this way, traffic matching the first flow rule in the VPN is sent to the first public network IP address of the second communication device, and traffic matching the second flow rule is sent to the second public network IP address of the second communication device. In this way, the VPN traffic passing through the same device (that is, the second communication device) is sent through different transmission paths, thereby realizing flexible forwarding of the VPN traffic.
与第一流量过滤信息相似,第二流量过滤信息可以是网管设备在第一通信装置上配置的,也可以是第一通信装置根据控制器发送的通告消息获取的。如果第一通信装置根据控制器发送的通告消息获取第二流量过滤信息,第二流量过滤信息和第一流量过滤信息可以被携带在同一条通告消息中,也可以被携带在不同的通告消息中。如果第二流量过滤信息被携带在独立的通告消息中,为了区别携带第一流量过滤信息的第一通告消息,携带第二流量过滤信息的通告消息被称为第二通告消息。Similar to the first traffic filtering information, the second traffic filtering information may be configured by the network management device on the first communication device, or may be acquired by the first communication device according to a notification message sent by the controller. If the first communication device obtains the second traffic filtering information according to the notification message sent by the controller, the second traffic filtering information and the first traffic filtering information may be carried in the same notification message or in different notification messages. If the second traffic filtering information is carried in an independent notification message, in order to distinguish the first notification message carrying the first traffic filtering information, the notification message carrying the second traffic filtering information is called a second notification message.
下面以第一通信装置根据控制器发送的第二通告消息获取第二流量过滤信息为例,结合说明书附图进行介绍。The following uses an example in which the first communication device obtains the second traffic filtering information according to the second notification message sent by the controller, and will be introduced with reference to the accompanying drawings.
参见图6,该图为本申请实施例提供的流量转发方法600的另一种信令交互图,具体包括以下步骤S601-S607。可以理解的是,图6所示的方案可以在图2、图3和图5任一对应的实现方式的基础上实现。Referring to FIG. 6 , this figure is another signaling interaction diagram of the traffic forwarding method 600 provided in the embodiment of the present application, which specifically includes the following steps S601-S607. It can be understood that the solution shown in FIG. 6 may be implemented on the basis of any corresponding implementation manner in FIG. 2 , FIG. 3 and FIG. 5 .
S601:控制器获取第二通告消息。S601: The controller acquires a second notification message.
为使第一通信装置获取第二流量过滤信息,控制器获取第二通告消息并向第一通信装 置发送。与第一通告消息相似,第二通告消息可以是控制器生成的,也可以是控制器的上级控制器向控制器发送的。In order for the first communication device to obtain the second traffic filtering information, the controller obtains a second notification message and sends it to the first communication device. Similar to the first notification message, the second notification message may be generated by the controller, or sent to the controller by a superior controller of the controller.
第二通告消息用于通告第二流量过滤信息,第二流量过滤信息包括所述VPN标签、第二流规则和第二流量过滤动作。其中,第二流量过滤信息中的VPN标签和第一流量过滤信息中的VPN标签为相同的VPN标签。第二流量过滤动作包括重定向的第二下一跳。第二下一跳为第二通信装置的第二公网IP地址。也就是说,第二流量过滤信息用于指示设备为与第二流规则匹配的报文添加VPN标签,并向第二通信装置的第二公网IP地址发送。The second notification message is used to announce the second traffic filtering information, and the second traffic filtering information includes the VPN label, the second flow rule and the second traffic filtering action. Wherein, the VPN label in the second traffic filtering information and the VPN label in the first traffic filtering information are the same VPN label. The second traffic filtering action includes a redirected second next hop. The second next hop is the second public network IP address of the second communication device. That is to say, the second flow filtering information is used to instruct the device to add a VPN label to the packet matching the second flow rule, and send the packet to the second public network IP address of the second communication device.
在本申请实施例中,第二通信装置的第一公网IP地址可以是第二通信装置上一个接口的公网IP地址,第二通信装置的第二公网IP地址可以是第二通信装置上另一个接口的公网IP地址。以图1-B为例进行说明。第二通信装置的第一公网IP地址可以是PE2上接口B1的公网IP地址2.2.2.2,第二通信装置的第二公网IP地址可以是PE2上接口B2的公网IP地址22.22.22.22。In this embodiment of the application, the first public network IP address of the second communication device may be the public network IP address of an interface on the second communication device, and the second public network IP address of the second communication device may be the public network IP address of another interface on the second communication device. Take Figure 1-B as an example for illustration. The first public IP address of the second communication device may be the public IP address 2.2.2.2 of the interface B1 on PE2, and the second public IP address of the second communication device may be the public IP address 22.22.22.22 of the interface B2 on PE2.
与第一通告消息相似,第二通告消息可以包括第二隧道标识和/或第二隧道的隧道类型信息。其中,第二隧道标识用于标识第二隧道,第二隧道为从第一通信装置到第二通信装置的第二公网IP地址之间的公网隧道。仍然以图1-B为例进行说明。如果第二通信装置的第一公网IP地址为接口B1的公网IP地址2.2.2.2,且第二通信装置的第二公网IP地址为接口B2的公网IP地址22.22.22.22,,那么第一隧道为图1-B中的公网隧道1,第二隧道为图1-B中的公网隧道2。Similar to the first notification message, the second notification message may include the second tunnel identifier and/or tunnel type information of the second tunnel. Wherein, the second tunnel identifier is used to identify the second tunnel, and the second tunnel is a public network tunnel between the first communication device and the second public network IP address of the second communication device. Still take Figure 1-B as an example for illustration. If the first public network IP address of the second communication device is the public network IP address 2.2.2.2 of the interface B1, and the second public network IP address of the second communication device is the public network IP address 22.22.22.22 of the interface B2, then the first tunnel is the public network tunnel 1 in FIG. 1-B, and the second tunnel is the public network tunnel 2 in FIG. 1-B.
关于第二通告消息以及第二流量过滤信息的详细介绍可以参见图2和图3中对第一通告消息以及第一流量过滤信息的介绍,这里不再赘述。For the detailed introduction of the second notification message and the second traffic filtering information, refer to the introduction of the first notification message and the first traffic filtering information in FIG. 2 and FIG. 3 , which will not be repeated here.
S602:控制器向第一通信装置发送第二通告消息。S602: The controller sends a second notification message to the first communication device.
可以理解的是,控制器可以一起发送第一通告消息和第二通告消息,也可以分开发送第一通告消息和第二通告消息。在图6所示的实现方式中,第一流量过滤信息和第二流量过滤信息通过不同的两条通告消息(即第一通告消息和第二通告消息)发送。在一些其他坑你的实现中,第一流量过滤信息和第二流量过滤信息通过相同的两条通告消息发送。It can be understood that the controller may send the first notification message and the second notification message together, or may send the first notification message and the second notification message separately. In the implementation manner shown in FIG. 6 , the first traffic filtering information and the second traffic filtering information are sent through two different notification messages (ie, a first notification message and a second notification message). In some other implementations against you, the first traffic filtering information and the second traffic filtering information are sent through the same two notification messages.
S603:第一通信装置根据第二通告消息生成第二关联关系。S603: The first communication device generates a second association relationship according to the second notification message.
在接收到第二通告消息后,第一通信装置根据第二通告消息生成第二关联关系。其中,第二关联关系表示与第二流规则相匹配的报文需要被封装VPN标签,并向第二通信装置的第二公网IP地址发送。具体地,第二关联关系为VPN标签、第二流规则和第二公网IP地址之间的关联关系,或者,第二关联关系为VPN标签、第二流规则、第二隧道标识和第二公网IP地址之间的关联关系,或者,第二关联关系为VPN标签、第二流规则、第二隧道标识、第二隧道的隧道类型信息和第二公网IP地址之间的关联关系,After receiving the second notification message, the first communication device generates a second association relationship according to the second notification message. Wherein, the second association relationship indicates that packets matching the second flow rule need to be encapsulated with a VPN label and sent to the second public network IP address of the second communication device. Specifically, the second association relationship is the association relationship between the VPN label, the second flow rule, and the second public network IP address, or the second association relationship is the association relationship between the VPN label, the second flow rule, the second tunnel identifier, and the second public network IP address, or the second association relationship is the association relationship between the VPN label, the second flow rule, the second tunnel identifier, the tunnel type information of the second tunnel, and the second public network IP address,
与第一关联关系相似,第二关联关系可以以第二流规则转发表项的形式保存到第一通信装置的转发面。第二流规则转发表项包括VPN标签、第二索引和第二公网IP地址。或者,第二流规则转发表项包括VPN标签、第二索引、第二隧道标识和第二公网IP地址。或者,第二关联关系包括VPN标签、第二索引、第二隧道标识和第二公网IP地址之间的关联关系。其中,第二索引用于索引第二流规则,例如可以用于标识第二流规则的存储位 置。可选地,第二流规则转发表项也可以包括第二流规则。Similar to the first association relationship, the second association relationship may be stored in the forwarding plane of the first communication device in the form of a second flow rule forwarding entry. The second flow rule forwarding entry includes a VPN label, a second index, and a second public network IP address. Alternatively, the second flow rule forwarding entry includes a VPN label, a second index, a second tunnel identifier, and a second public network IP address. Alternatively, the second association relationship includes an association relationship among the VPN label, the second index, the second tunnel identifier, and the second public network IP address. Wherein, the second index is used to index the second flow rule, for example, may be used to identify the storage location of the second flow rule. Optionally, the second flow rule forwarding entry may also include the second flow rule.
在上述S601-S603中,第二关联关系是第一通信装置根据控制器发送的第二通告消息得到的。在一些其他可能的实现中,第二关联关系也可以网管设备是在第一通信装置上配置的。In the above S601-S603, the second association relationship is obtained by the first communication device according to the second notification message sent by the controller. In some other possible implementations, the second association relationship may also be configured on the first communication device by the network management device.
S604:第一通信装置接收第二报文。S604: The first communication device receives the second message.
在本申请实施例中,第二报文的源设备和目的设备为VPN中的设备,且第二报文的目的设备和第二报文的源设备之间通过公网连接,第一通信装置通过与VPN绑定的入接口接收第二报文。可选地,第二报文的目的设备与第一报文的目的设备不同。以图1-B为例,如果第一报文为设备1向设备2发送的报文,第二报文可以是设备1向设备3发送的报文。In this embodiment of the present application, the source device and the destination device of the second message are devices in the VPN, and the destination device of the second message and the source device of the second message are connected through a public network, and the first communication device receives the second message through an inbound interface bound to the VPN. Optionally, the destination device of the second packet is different from the destination device of the first packet. Taking FIG. 1-B as an example, if the first message is a message sent from device 1 to device 2, the second message may be a message sent from device 1 to device 3.
S605:第一通信装置判断第二报文是否与第一流规则或第二流规则匹配。S605: The first communication device determines whether the second packet matches the first flow rule or the second flow rule.
在接收到第二报文之后,第一通信装置根据接收第二报文的入接口确定第二报文对应的VPN标识,并根据VPN标识判断第二报文是否与第一关联关系中的第一流规则或第二关联关系中的第二流规则匹配。如果第二报文与第一关联关系中的第一流规则匹配,第一通信装置根据S503和S504所示的方法转发第二报文。如果第二报文与第二关联关系中的第二流规则匹配,第一通信装置根据S606和S607所示的方法转发第二报文。如果第二报文与第一流规则和第二流规则均不匹配,且第二报文不匹配VPN标识对应的其他任意流规则,第一通信装置根据VPN路由表转发第二报文。After receiving the second message, the first communication device determines the VPN identifier corresponding to the second message according to the incoming interface receiving the second message, and determines whether the second message matches the first flow rule in the first association relationship or the second flow rule in the second association relationship according to the VPN identifier. If the second packet matches the first flow rule in the first association relationship, the first communication device forwards the second packet according to the methods shown in S503 and S504. If the second packet matches the second flow rule in the second association relationship, the first communication device forwards the second packet according to the methods shown in S606 and S607. If the second packet does not match neither the first flow rule nor the second flow rule, and the second packet does not match any other flow rule corresponding to the VPN identifier, the first communication device forwards the second packet according to the VPN routing table.
S606:第一通信装置为第二报文添加VPN标签。S606: The first communication device adds a VPN label to the second packet.
S607:第一通信装置向所述第一下一跳发送添加所述VPN标签后的第二报文。S607: The first communication device sends the second packet to which the VPN label is added to the first next hop.
在确定第二报文与第二流规则匹配之后,第一通信装置在第二报文中添加VPN标签,并向第二通信装置的第二公网IP地址发送添加了VPN标签的第二报文。在一种可能的实现中,第二通信装置通过第二隧道向第二通信装置发送添加了VPN标签的第一报文。After determining that the second packet matches the second flow rule, the first communication device adds a VPN label to the second packet, and sends the second packet with the VPN label added to the second public network IP address of the second communication device. In a possible implementation, the second communication device sends the first packet to which the VPN label is added to the second communication device through the second tunnel.
在上述介绍中,第一通信装置可以通过不同的传输路径,向第二通信装置传输不同的流量。这样,通过不同的传输路径向相同的设备传输不同流量,实现了流量的差异化传输。可以更好地满足流量传输的要求。In the above introduction, the first communication device may transmit different traffic to the second communication device through different transmission paths. In this way, different traffic is transmitted to the same device through different transmission paths, realizing differentiated transmission of traffic. It can better meet the requirements of traffic transmission.
例如,假设第一业务流量与第二业务流量对网络性能指标的要求不同。那么可以通过第一流规则和第二流规则区分第一业务流量和第二业务流量,并通过满足第一业务流量的要求的第一隧道转发第一业务流量,通过满足第二业务流量的要求的第二隧道转发第二业务流量。或者,如果经第一通信装置发往和第二通信装置的VPN流量较多,可以通过第一流规则和第二流规则区分VPN流量,从而通过两条转发路径转发VPN流量,实现负载分担,降低了转发路径的压力。For example, assume that the first service flow and the second service flow have different requirements on network performance indicators. Then the first service flow and the second service flow can be distinguished by the first flow rule and the second flow rule, and the first service flow is forwarded through the first tunnel meeting the requirements of the first service flow, and the second service flow is forwarded through the second tunnel meeting the requirements of the second service flow. Alternatively, if the first communication device sends a lot of VPN traffic to the second communication device, the VPN traffic can be distinguished by the first flow rule and the second flow rule, so as to forward the VPN traffic through two forwarding paths, realize load sharing, and reduce the pressure on the forwarding path.
另外,第一流规则转发表项和第二流规则转发表项是第一通信装置根据控制器发送的通告消息生成的。如果需要调整第一流规则和/或第二流规则对应的转发路径,可以下发新的通告消息,以便第一通信装置生成新的流规则转发表项。如此,无需重新通告VPN路由,提升了VPN流量转发的灵活性。In addition, the first flow rule forwarding entry and the second flow rule forwarding entry are generated by the first communication device according to the notification message sent by the controller. If it is necessary to adjust the forwarding path corresponding to the first flow rule and/or the second flow rule, a new notification message may be issued, so that the first communication device generates a new flow rule forwarding entry. In this way, there is no need to re-advertise VPN routes, which improves the flexibility of VPN traffic forwarding.
下面结合图1-B所示的应用场景,以控制管理设备为控制器为例,对图6所示的方法进行介绍。In the following, the method shown in FIG. 6 will be introduced in combination with the application scenario shown in FIG. 1-B and taking the control management device as a controller as an example.
为了转发VPN1的流量,控制器生成通告消息M1和通告消息M2,并向PE1发送通告消息M1和通告消息M2。关于通告消息M1的介绍可以参见前文。通告消息M2包括第一RT、VPN1的VPN标签100、流规则2、作为重定向的第二下一跳的PE2的第二公网IP地址22.22.22.22。流规则2用于匹配从设备1发往设备3的流量To forward the traffic of VPN1, the controller generates a notification message M1 and a notification message M2, and sends the notification message M1 and the notification message M2 to PE1. For the introduction of the notification message M1, refer to the foregoing. The notification message M2 includes the first RT, the VPN label 100 of VPN1, the flow rule 2, and the second public IP address 22.22.22.22 of PE2 as the redirected second next hop. Flow rule 2 is used to match traffic sent from device 1 to device 3
在接收到通告消息M2后,PE1根据第一RT进行路由交叉得到VPN1的VRF ID1,并生成流规则转发表项2。流规则转发表项2包括VRF ID1、流规则1对应的流规则索引2、PE2的第二公网IP地址22.22.22.22,公网隧道2的隧道类型信息TE、公网隧道2的隧道标识2和VPN标签100。After receiving the notification message M2, PE1 performs route crossover according to the first RT to obtain the VRF ID1 of VPN1, and generates flow rule forwarding entry 2. Flow rule forwarding entry 2 includes VRF ID1, flow rule index 2 corresponding to flow rule 1, second public IP address 22.22.22.22 of PE2, tunnel type information TE of public network tunnel 2, tunnel identifier 2 of public network tunnel 2, and VPN label 100.
假设设备1通过公网向设备2发送报文N1。PE1可以通过入接口A1接收报文N1,并通过公网隧道1转发报文N1。具体转发过程可以参见上文。Assume that device 1 sends a message N1 to device 2 through the public network. PE1 can receive packet N1 through ingress interface A1, and forward packet N1 through public network tunnel 1. For the specific forwarding process, please refer to the above.
假设设备1通过公网向设备3发送报文N2。PE1可以通过入接口A1接收报文N2。根据接收报文N2的入接口A1,PE1确定报文N2对应VRF ID1,并根据流规则转发表项1和流规则转发表项2判断报文N2是否与流规则1或流规则2匹配。在确定报文N2与流规则2匹配之后,PE1在报文N2中添加VPN1的VPN标签100,并通过公网隧道2向PE2发送添加了VPN标签100的报文N2,实现VPN流量的转发。报文N2的传输过程可以如图1-D所示。Assume that device 1 sends a message N2 to device 3 through the public network. PE1 can receive packet N2 through ingress interface A1. According to the inbound interface A1 that receives packet N2, PE1 determines that packet N2 corresponds to VRF ID1, and judges whether packet N2 matches flow rule 1 or flow rule 2 according to flow rule forwarding entry 1 and flow rule forwarding entry 2. After confirming that packet N2 matches flow rule 2, PE1 adds VPN label 100 of VPN1 to packet N2, and sends packet N2 with VPN label 100 added to PE2 through public network tunnel 2 to implement VPN traffic forwarding. The transmission process of message N2 may be shown in Figure 1-D.
通过上述介绍可知可见,PE1获取VPN1对应的流规则转发表项1和流规则转发表项2。流规则转发表项1指示PE1向PE2的第一公网IP地址转发与流规则1匹配的报文,流规则转发表项2指示PE1向PE2的第二公网IP地址转发与流规则2匹配的报文。这样,在接收到VPN1对应的流量之后,PE1可以判断流量是否与流规则1或流规则2匹配。如果流量与流规则1匹配,PE1根据流规则转发表项1的指示向PE2的第一公网IP地址转发流量;如果流量与流规则2匹配,PE1根据流规则转发表项2的指示向PE2的第二公网IP地址转发流量。如此,通过流规则1和流规则2区分途经PE2的流量,实现了流量的灵活转发。From the above description, it can be seen that PE1 obtains flow rule forwarding entry 1 and flow rule forwarding entry 2 corresponding to VPN1. Flow rule forwarding entry 1 instructs PE1 to forward packets matching flow rule 1 to the first public IP address of PE2, and flow rule forwarding entry 2 instructs PE1 to forward packets matching flow rule 2 to the second public IP address of PE2. In this way, after receiving the traffic corresponding to VPN1, PE1 can determine whether the traffic matches flow rule 1 or flow rule 2. If the traffic matches flow rule 1, PE1 forwards the traffic to the first public IP address of PE2 according to the indication of flow rule forwarding entry 1; if the traffic matches flow rule 2, PE1 forwards the traffic to the second public IP address of PE2 according to the indication of flow rule forwarding entry 2. In this way, flow rules 1 and 2 are used to distinguish the traffic passing through PE2, realizing flexible forwarding of traffic.
参见图7,本申请实施例还提供了一种设备700,该设备700可以实现图2所示实施例所对应的方法200、图3所示实施例所对应的300、图5所示实施例所对应的方法500和图6所示实施例所对应的方法600中第一通信装置的功能。或者,该设备700也可以实现图2所示实施例所对应的方法200、图3所示实施例所对应的300、图5所示实施例所对应的方法500和图6所示实施例所对应的方法600中控制管理设备(或控制器)的功能。Referring to FIG. 7, the embodiment of the present application also provides a device 700, which can implement the function of the first communication device in the method 200 corresponding to the embodiment shown in FIG. 2, the method 300 corresponding to the embodiment shown in FIG. 3, the method 500 corresponding to the embodiment shown in FIG. 5, and the method 600 corresponding to the embodiment shown in FIG. 6. Alternatively, the device 700 can also implement the method 200 corresponding to the embodiment shown in FIG. 2 , the method 300 corresponding to the embodiment shown in FIG. 3 , the method 500 corresponding to the embodiment shown in FIG. 5 , and the method 600 corresponding to the embodiment shown in FIG. 6 .
该设备700包括收发10和处理模块720,其中,所述收发模块710用于执行上述各实施例所对应的方法中由第一通信装置所执行的接收和/或发送操作,所述处理模块720用于执行上述各实施例所对应的方法中由第一通信装置所执行的接收和/或发送操作之外的其它操作。或者,所述收发模块710用于执行上述各实施例所对应的方法中由控制管理设备所执行的接收和/或发送操作,所述处理模块720用于执行上述各实施例所对应的方法中由控制管理设备所执行的接收和/或发送操作之外的其它操作The device 700 includes a transceiver 10 and a processing module 720, wherein the transceiver module 710 is configured to perform receiving and/or sending operations performed by the first communication device in the methods corresponding to the above embodiments, and the processing module 720 is configured to perform other operations other than the receiving and/or sending operations performed by the first communication device in the methods corresponding to the above embodiments. Alternatively, the transceiving module 710 is configured to perform receiving and/or sending operations performed by the control management device in the methods corresponding to the above embodiments, and the processing module 720 is configured to perform operations other than the receiving and/or sending operations performed by the control management device in the methods corresponding to the above embodiments
举例来说,当设备700具体用于实现方法200中第一通信装置的功能时,所述处理模块720,用于获取第一流量过滤信息,所述第一流量过滤信息包括VPN标签、第一流规则 和第一流量过滤动作,其中,所述第一流量过滤动作包括重定向的第一下一跳,所述重定向的第一下一跳为第二通信装置的第一公网IP地址,所述第一流量过滤动作指示所述第一通信装置向所述第一下一跳转发与所述第一流规则匹配的流量;所述收发模块710,用于根据所述第一流量过滤信息转发与所述第一流规则匹配的流量。For example, when the device 700 is specifically used to implement the function of the first communication device in method 200, the processing module 720 is configured to acquire first traffic filtering information, the first traffic filtering information includes a VPN label, a first flow rule, and a first traffic filtering action, wherein the first traffic filtering action includes a redirected first next hop, the redirected first next hop is the first public network IP address of the second communication device, and the first traffic filtering action instructs the first communication device to forward traffic matching the first flow rule to the first next hop; The first traffic filtering information forwards traffic matching the first traffic rule.
在一个示例中,当设备700具体用于实现方法300中第一通信装置的功能时,所述收发模块710用于接收控制器发送的第一通告消息,所述第一通告消息包括第一流量过滤信息,所述第一流量过滤信息包括VPN标签、第一流规则和第一流量过滤动作。所述第一流量过滤动作包括重定向的第一下一跳,所述重定向的第一下一跳为第二通信装置的第一公网IP地址,所述第一流量过滤动作指示所述第一通信装置向所述第一下一跳转发与所述第一流规则匹配的流量。所述处理模块720用于根据第一流量过滤信息生成第一关联关系。In an example, when the device 700 is specifically used to implement the function of the first communication device in the method 300, the transceiver module 710 is configured to receive a first notification message sent by the controller, where the first notification message includes first traffic filtering information, and the first traffic filtering information includes a VPN label, a first flow rule, and a first traffic filtering action. The first traffic filtering action includes a redirected first next hop, the redirected first next hop is the first public network IP address of the second communication device, and the first traffic filtering action instructs the first communication device to forward traffic matching the first flow rule to the first next hop. The processing module 720 is configured to generate a first association relationship according to the first traffic filtering information.
在一个示例中,当设备700具体用于实现方法500中第一通信装置的功能时,所述收发模块710用于接收第一报文和发送添加了VPN标签的第一报文,所述处理模块720,用于判断所述第一报文是否与第一流规则相匹配,根据第一关联关系确定VPN标签和第一流量过滤动作,所述第一关联关系包括所述第一流规则、所述VPN标签和所述第一流量过滤动作之间的关联关系,所述第一流量过滤动作包括重定向的第一下一跳,所述重定向的第一下一跳为第二通信装置的第一公网IP地址;为所述第一报文添加所述VPN标签。In an example, when the device 700 is specifically used to realize the function of the first communication device in the method 500, the transceiving module 710 is configured to receive a first message and send a first message with a VPN label added, the processing module 720 is used to determine whether the first message matches a first flow rule, and determine a VPN label and a first traffic filtering action according to a first association relationship, the first association relationship includes an association relationship between the first flow rule, the VPN label, and the first traffic filtering action, and the first traffic filtering action includes a redirected first next hop, a redirected first next hop Jumping to the first public network IP address of the second communication device; adding the VPN label to the first message.
在一个示例中,当设备700具体用于实现方法600中第一通信装置的功能时,所述收发模块710,用于接收第二通告消息,接收第二报文,向第二通信装置发送添加了VPN标签的第二报文。其中,第二通告消息包括第二流量过滤信息,所述第二流量过滤信息包括所述VPN标签、第二流规则和第二流量过滤动作,所述第二流量过滤动作携带重定向的第二下一跳,所述重定向的第二下一跳为所述第二通信装置第二公网IP地址。所述处理模块720,用于根据第二通告消息生成第二关联关系,响应于第二报文与第二流规则匹配,为第二报文添加VPN标签。In an example, when the device 700 is specifically used to implement the function of the first communication device in the method 600, the transceiver module 710 is configured to receive the second notification message, receive the second message, and send the second message with the VPN tag added to the second communication device. Wherein, the second notification message includes second traffic filtering information, the second traffic filtering information includes the VPN label, the second flow rule and the second traffic filtering action, the second traffic filtering action carries a redirected second next hop, and the redirected second next hop is the second public network IP address of the second communication device. The processing module 720 is configured to generate a second association relationship according to the second notification message, and add a VPN label to the second packet in response to the second packet matching the second flow rule.
在一个示例中,当设备700具体用于实现方法200中控制管理设备的功能时,所述处理模块720用于获取第一流量过滤信息,所述第一流量过滤信息包括VPN标签、第一流规则和第一流量过滤动作,其中,所述第一流量过滤动作包括重定向的第一下一跳,所述重定向的第一下一跳为第二通信装置的第一公网IP地址,所述第一流量过滤动作指示所述第一通信装置向所述第一下一跳转发与所述第一流规则匹配的流量。所述收发模块710用于向所述第一通信装置发送所述第一流量过滤信息。In an example, when the device 700 is specifically used to implement the function of controlling and managing the device in method 200, the processing module 720 is configured to obtain first traffic filtering information, the first traffic filtering information includes a VPN label, a first flow rule, and a first traffic filtering action, wherein the first traffic filtering action includes a redirected first next hop, the redirected first next hop is the first public network IP address of the second communication device, and the first traffic filtering action instructs the first communication device to forward traffic matching the first flow rule to the first next hop. The transceiving module 710 is configured to send the first traffic filtering information to the first communication device.
在一个示例中,当设备700具体用于实现方法300中控制管理设备的功能时,所述处理模块720用于获取第一通告消息,第一通告消息包括第一流量过滤信息,所述第一流量过滤信息包括VPN标签、第一流规则和第一流量过滤动作,其中,所述第一流量过滤动作包括重定向的第一下一跳,所述重定向的第一下一跳为第二通信装置的第一公网IP地址,所述第一流量过滤动作指示所述第一通信装置向所述第一下一跳转发与所述第一流规则匹配的流量。所述收发模块710用于向所述第一通信装置发送所述第一通告消息。In one example, when the function of the device 700 is specifically used to control the function of controlling the device in the implementation method 300, the processing module 720 is used to obtain the first notice message. The first notice message includes the first traffic filtration information includes the VPN label, the first -stage rules, and the first traffic filtration action. The first and next jump is the first public network IP address of the second communication device. The first traffic filtering action indicates the traffic that the first communication device is forwarded to the first jump to the first -class rule. The transceiving module 710 is configured to send the first notification message to the first communication device.
在一个示例中,当设备700具体用于实现方法600中控制管理设备的功能时,所述处理模块720用于获取第二通告消息,第二通告消息包括第二流量过滤信息,所述第二流量 过滤信息包括VPN标签、第二流规则和第一流量过滤动作,其中,所述第一流量过滤动作包括重定向的第二下一跳,所述重定向的第二下一跳为第二通信装置的第二公网议IP地址,所述第二流量过滤动作指示所述第一通信装置向所述第二下一跳转发与所述第二流规则匹配的流量。所述收发模块710用于向所述第一通信装置发送所述第二通告消息。In an example, when the device 700 is specifically configured to implement the function of controlling and managing the device in method 600, the processing module 720 is configured to acquire a second notification message, the second notification message includes second traffic filtering information, and the second traffic filtering information includes a VPN label, a second flow rule, and a first traffic filtering action, wherein the first traffic filtering action includes a redirected second next hop, the redirected second next hop is a second public network IP address of the second communication device, and the second traffic filtering action instructs the first communication device to forward traffic matching the second traffic rule to the second next hop traffic. The transceiving module 710 is configured to send the second notification message to the first communication device.
具体执行过程请参上述图2、图3、图5和图6所示实施例中相应步骤的详细描述,这里不再一一赘述。For the specific execution process, please refer to the detailed description of the corresponding steps in the above embodiments shown in FIG. 2 , FIG. 3 , FIG. 5 and FIG. 6 , which will not be repeated here.
需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。本申请实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个单元中。例如,上述实施例中,获取单元和处理单元可以是同一个模块,也不同的模块。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。It should be noted that the division of modules in the embodiment of the present application is schematic, and is only a logical function division, and there may be other division methods in actual implementation. Each functional module in the embodiment of the present application may be integrated into one processing module, or each module may exist separately physically, or two or more modules may be integrated into one unit. For example, in the above embodiments, the acquisition unit and the processing unit may be the same module or different modules. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules.
本申请实施例还提供了一种网络系统,该网络系统用于实现前述方法实施例中的流量转发方法、报文发送方法和消息发送方法。其中,该网络系统包括网络设备和控制管理设备。网络设备可以实现上述方法实施例中第一通信装置的功能,控制管理设备可以实现上述方法实施例中控制管理设备的功能。具体执行过程请参考上述方法实施例中相应步骤的详细描述,这里不再一一赘述。The embodiment of the present application also provides a network system, which is used to implement the traffic forwarding method, the packet sending method, and the message sending method in the foregoing method embodiments. Wherein, the network system includes network equipment and control management equipment. The network device may realize the function of the first communication device in the above method embodiment, and the control and management device may realize the function of the control and management device in the above method embodiment. For the specific execution process, please refer to the detailed description of the corresponding steps in the above method embodiments, and details will not be repeated here.
图8是本申请实施例提供的一种设备800的结构示意图。上文中的设备700可以通过图8所示的设备来实现。参见图8,该设备800包括至少一个处理器801,通信总线802,存储器803以及至少一个网络接口804。FIG. 8 is a schematic structural diagram of a device 800 provided in an embodiment of the present application. The above device 700 may be implemented by the device shown in FIG. 8 . Referring to FIG. 8 , the device 800 includes at least one processor 801 , a communication bus 802 , a memory 803 and at least one network interface 804 .
处理器801可以是中央处理器(英文:central processing unit,缩写:CPU),网络处理器(英文:network processor,缩写:NP)或者CPU和NP的组合。处理器还可以是专用集成电路(英文:application-specific integrated circuit,缩写:ASIC),可编程逻辑器件(英文:programmable logic device,缩写:PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(英文:complex programmable logic device,缩写:CPLD),现场可编程逻辑门阵列(英文:field-programmable gate array,缩写:FPGA),通用阵列逻辑(英文:generic array logic,缩写:GAL)或其任意组合。处理器801可以是指一个处理器,也可以包括多个处理器。例如图8中所示的处理器801和处理器805。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。The processor 801 may be a central processing unit (English: central processing unit, abbreviated: CPU), a network processor (English: network processor, abbreviated: NP) or a combination of CPU and NP. The processor can also be an application-specific integrated circuit (English: application-specific integrated circuit, abbreviation: ASIC), a programmable logic device (English: programmable logic device, abbreviation: PLD) or a combination thereof. The above-mentioned PLD can be a complex programmable logic device (English: complex programmable logic device, abbreviated: CPLD), field-programmable logic gate array (English: field-programmable gate array, abbreviated: FPGA), general array logic (English: generic array logic, abbreviated: GAL) or any combination thereof. Processor 801 may refer to one processor, or may include multiple processors. For example, processor 801 and processor 805 shown in FIG. 8 . Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions). Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor.
比如,当图2中的第一通信装置通过图8所示的设备来实现时,该处理器可以用于,获取第一流量过滤信息,所述第一流量过滤信息包括VPN标签、第一流规则和第一流量过滤动作,其中,所述第一流量过滤动作包括重定向的第一下一跳,所述重定向的第一下一跳为第二通信装置的第一公网IP地址,所述第一流量过滤动作指示所述第一通信装置向所述第一下一跳转发与所述第一流规则匹配的流量;根据所述第一流量过滤信息转发与所述第一流规则匹配的流量。For example, when the first communication device in FIG. 2 is implemented by the device shown in FIG. 8 , the processor may be configured to obtain first traffic filtering information, the first traffic filtering information includes a VPN label, a first flow rule, and a first traffic filtering action, wherein the first traffic filtering action includes a redirected first next hop, the redirected first next hop is the first public network IP address of the second communication device, and the first traffic filtering action instructs the first communication device to forward traffic matching the first flow rule to the first next hop; forward traffic matching the first flow rule according to the first traffic filtering information.
通信总线802用于在处理器801、网络接口804和存储器803之间传送信息。 Communication bus 802 is used to transfer information between processor 801 , network interface 804 and memory 803 .
存储器803可以是只读存储器(Read-only Memory,ROM)或可存储静态信息和指令的其它类型的静态存储设备,存储器803还可以是随机存取存储器(Random Access Memory,RAM)或者可存储信息和指令的其它类型的动态存储设备,也可以是只读光盘(Compact Disc Read-only Memory,CD-ROM)或其它光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其它磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其它介质,但不限于此。存储器803可以是独立存在,通过通信总线802与处理器801相连接。存储器803也可以和处理器801集成在一起。存储器803可以是指一个存储器,也可以包括多个存储器。在一个实施方式中,存储器803中存储有计算机可读指令,所述计算机可读指令包括多个软件模块,例如收发模块和处理模块。处理器1003执行各个软件模块后可以按照各个软件模块的指示进行相应的操作。在本申请实施例中,一个软件模块所执行的操作实际上是指处理器根据所述软件模块的指示而执行的操作。The memory 803 can be a read-only memory (Read-only Memory, ROM) or other types of static storage devices that can store static information and instructions. The memory 803 can also be a random access memory (Random Access Memory, RAM) or other types of dynamic storage devices that can store information and instructions. Universal Disc, Blu-ray Disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto. The memory 803 may exist independently, and is connected to the processor 801 through the communication bus 802 . The memory 803 can also be integrated with the processor 801. The storage 803 may refer to one storage, or may include multiple storages. In one embodiment, computer-readable instructions are stored in the memory 803, and the computer-readable instructions include a plurality of software modules, such as a transceiver module and a processing module. After executing each software module, the processor 1003 may perform corresponding operations according to the instructions of each software module. In this embodiment of the present application, an operation performed by a software module actually refers to an operation performed by a processor according to an instruction of the software module.
可选地,处理器801也可以存储执行本申请实施例提供的技术方案的程序代码或指令,在这种情况下处理器801不需要到存储器1003中读取程序代码或指令。Optionally, the processor 801 may also store program codes or instructions for executing the technical solutions provided by the embodiments of the present application. In this case, the processor 801 does not need to read the program codes or instructions from the memory 1003 .
网络接口804可以为收发器一类的装置,用于与其它设备或通信网络通信,通信网络可以为以太网、无线接入网(RAN)或无线局域网(Wireless Local Area Networks,WLAN)等。在本申请实施例中,网络接口1004可以用于接收分段路由网络中的其他节点发送的报文,也可以向分段路由网络中的其他节点发送报文。网络接口804可以为以太接口(Ethernet)接口、快速以太(Fast Ethernet,FE)接口或千兆以太(Gigabit Ethernet,GE)接口等。The network interface 804 can be a device such as a transceiver for communicating with other devices or a communication network, and the communication network can be Ethernet, radio access network (RAN) or wireless local area network (Wireless Local Area Networks, WLAN). In this embodiment of the present application, the network interface 1004 may be used to receive messages sent by other nodes in the segment routing network, and may also send messages to other nodes in the segment routing network. The network interface 804 may be an Ethernet interface (Ethernet), a Fast Ethernet (Fast Ethernet, FE) interface or a Gigabit Ethernet (Gigabit Ethernet, GE) interface, etc.
在具体实现中,作为一种实施例,设备800可以包括多个处理器,例如图8中所示的处理器801和处理器805。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。In a specific implementation, as an embodiment, the device 800 may include multiple processors, for example, the processor 801 and the processor 805 shown in FIG. 8 . Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
图9是本申请实施例提供的一种设备900的结构示意图。图1-A和图1-B中的各个设备可以通过图9所示的设备来实现。设备900具体可以用于实现前述各方法实施例所对应的方法中的任意一个或多个操作。参见图9所示的设备结构示意图,设备900包括主控板和一个或多个接口板。主控板与接口板通信连接。主控板也称为主处理单元(Main Processing Unit,MPU)或路由处理卡(Route Processor Card),主控板包括CPU和存储器,主控板负责对设备900中各个组件的控制和管理,包括路由计算、设备管理和维护功能。接口板也称为线处理单元(Line Processing Unit,LPU)或线卡(Line Card),用于接收和发送报文。在一些实施例中,主控板与接口板之间或接口板与接口板之间通过总线通信。在一些实施例中,接口板之间通过交换网板通信,在这种情况下设备900也包括交换网板,交换网板与主控板、接口板通信连接,交换网板用于转发接口板之间的数据,交换网板也可以称为交换网板单元(Switch Fabric Unit,SFU)。接口板包括CPU、存储器、转发引擎和接口卡(Interface Card,IC),其中接口卡可以包括一个或多个网络接口。网络接口可以为Ethernet接口、FE接口或GE接口等。CPU与存储器、转发引擎和接口卡分别通信连接。存储器用 于存储转发表。转发引擎用于基于存储器中保存的转发表转发接收到的报文,如果接收到的报文的目的地址为设备900的IP地址,则将该报文发送给主控板或接口板的CPU进行处理;如果接收到的报文的目的地址不是设备900的IP地址,则根据该目的地查转发表,如果从转发表中查找到该目的地址对应的下一跳和出接口,将该报文转发到该目的地址对应的出接口。转发引擎可以是网络处理器(Network Processor,NP)。接口卡也称为子卡,可安装在接口板上,负责将光电信号转换为数据帧,并对数据帧进行合法性检查后转发给转发引擎处理或接口板CPU。在一些实施例中,CPU也可执行转发引擎的功能,比如基于通用CPU实现软转发,从而接口板中不需要转发引擎。在一些实施例中,转发引擎可以通过ASIC或现场可编程门阵列(Field Programmable Gate Array,FPGA)实现。在一些实施例中,存储转发表的存储器也可以集成到转发引擎中,作为转发引擎的一部分。FIG. 9 is a schematic structural diagram of a device 900 provided by an embodiment of the present application. Each device in FIG. 1-A and FIG. 1-B can be realized by the device shown in FIG. 9 . The device 900 may be specifically configured to implement any one or more operations in the methods corresponding to the foregoing method embodiments. Referring to the schematic structural diagram of the device shown in FIG. 9 , the device 900 includes a main control board and one or more interface boards. The main control board is communicatively connected with the interface board. The main control board is also called a main processing unit (Main Processing Unit, MPU) or a route processing card (Route Processor Card). The main control board includes a CPU and a memory. The main control board is responsible for the control and management of each component in the device 900, including routing calculation, device management and maintenance functions. The interface board is also called a line processing unit (Line Processing Unit, LPU) or a line card (Line Card), which is used to receive and send packets. In some embodiments, the communication between the main control board and the interface board or between the interface board and the interface board is through a bus. In some embodiments, the interface boards communicate through the SFU. In this case, the device 900 also includes the SFU. The SFU communicates with the main control board and the interface board. The SFU is used to forward data between the interface boards. The SFU may also be called a Switch Fabric Unit (SFU). The interface board includes a CPU, a memory, a forwarding engine, and an interface card (Interface Card, IC), where the interface card may include one or more network interfaces. The network interface may be an Ethernet interface, an FE interface, or a GE interface. The CPU communicates with the memory, the forwarding engine and the interface card respectively. The memory is used to store the forwarding table. The forwarding engine is used to forward the received message based on the forwarding table stored in the memory. If the destination address of the received message is the IP address of the device 900, the message is sent to the CPU of the main control board or the interface board for processing; if the destination address of the received message is not the IP address of the device 900, the forwarding table is checked according to the destination. If the next hop and the outgoing interface corresponding to the destination address are found in the forwarding table, the message is forwarded to the corresponding outgoing interface of the destination address. The forwarding engine may be a network processor (Network Processor, NP). The interface card is also called a daughter card, which can be installed on the interface board. It is responsible for converting the photoelectric signal into a data frame, and checking the validity of the data frame before forwarding it to the forwarding engine for processing or the CPU of the interface board. In some embodiments, the CPU can also perform the function of the forwarding engine, such as implementing soft forwarding based on a general-purpose CPU, so that no forwarding engine is needed in the interface board. In some embodiments, the forwarding engine may be implemented by ASIC or Field Programmable Gate Array (Field Programmable Gate Array, FPGA). In some embodiments, the memory storing the forwarding table can also be integrated into the forwarding engine as a part of the forwarding engine.
本申请实施例还提供一种芯片系统,包括:处理器,所述处理器与存储器耦合,所述存储器用于存储程序或指令,当所述程序或指令被所述处理器执行时,使得该芯片系统实现上述图2、图3、图5和图6所示实施例中第一通信装置执行的流量转发方法或报文发送方法,或使得该芯片系统实现上述图2、图3、图5和图6所示实施例中控制管理设备执行的消息发送方法。An embodiment of the present application further provides a chip system, including: a processor, the processor is coupled to a memory, and the memory is used to store a program or an instruction. When the program or instruction is executed by the processor, the chip system implements the traffic forwarding method or message sending method performed by the first communication device in the embodiments shown in FIGS.
可选地,该芯片系统中的处理器可以为一个或多个。该处理器可以通过硬件实现也可以通过软件实现。当通过硬件实现时,该处理器可以是逻辑电路、集成电路等。当通过软件实现时,该处理器可以是一个通用处理器,通过读取存储器中存储的软件代码来实现。Optionally, there may be one or more processors in the chip system. The processor can be realized by hardware or by software. When implemented in hardware, the processor may be a logic circuit, an integrated circuit, or the like. When implemented by software, the processor may be a general-purpose processor implemented by reading software codes stored in a memory.
可选地,该芯片系统中的存储器也可以为一个或多个。该存储器可以与处理器集成在一起,也可以和处理器分离设置,本申请并不限定。示例性的,存储器可以是非瞬时性处理器,例如只读存储器ROM,其可以与处理器集成在同一块芯片上,也可以分别设置在不同的芯片上,本申请对存储器的类型,以及存储器与处理器的设置方式不作具体限定。Optionally, there may be one or more memories in the chip system. The memory can be integrated with the processor, or can be set separately from the processor, which is not limited in this application. Exemplarily, the memory can be a non-transitory processor, such as a read-only memory ROM, which can be integrated with the processor on the same chip, or can be respectively arranged on different chips. The application does not specifically limit the type of the memory and the arrangement of the memory and the processor.
示例性的,该芯片系统可以是FPGA,可以是ASIC,还可以是系统芯片(System on Chip,SoC),还可以是CPU,还可以是NP,还可以是数字信号处理电路(Digital Signal Processor,DSP),还可以是微控制器(Micro Controller Unit,MCU),还可以是可编程控制器(Programmable Logic Device,PLD)或其他集成芯片。Exemplarily, the system-on-a-chip can be an FPGA, an ASIC, a system on chip (System on Chip, SoC), a CPU, an NP, a digital signal processing circuit (Digital Signal Processor, DSP), a microcontroller (Micro Controller Unit, MCU), a programmable controller (Programmable Logic Device, PLD) or other integrated chips.
应理解,上述方法实施例中的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。It should be understood that each step in the foregoing method embodiments may be implemented by an integrated logic circuit of hardware in a processor or instructions in the form of software. The method steps disclosed in connection with the embodiments of the present application may be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
本申请实施例还提供了一种计算机可读存储介质,包括指令,当其在处理器上运行时,实现以上任一方法实施例提供的、由第一通信装置执行的方法中的任意一个或多个操作,或实现以上任一方法实施例提供的、由控制管理设备执行的方法中的任意一个或多个操作。The embodiment of the present application also provides a computer-readable storage medium, including instructions, which, when running on a processor, implement any one or more operations in the method performed by the first communication device provided in any of the above method embodiments, or implement any one or more operations in the method performed by the control management device provided in any of the above method embodiments.
本申请实施例还提供了一种包含指令的计算机程序产品,当其在处理器上运行时,实现以上任一方法实施例提供的由第一通信装置执行的方法中的任意一个或多个操作,或实现以上任一方法实施例提供的、由控制管理设备执行的方法中的任意一个或多个操作。The embodiment of the present application also provides a computer program product containing instructions, which, when running on a processor, implements any one or more operations in the method performed by the first communication device provided in any of the above method embodiments, or implements any one or more operations in the method performed by the control management device provided in any of the above method embodiments.
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理 解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third", "fourth", etc. (if any) in the description and claims of the present application and the above drawings are used to distinguish similar objects and not necessarily to describe a specific order or sequence. It should be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having", and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or elements is not necessarily limited to those steps or elements explicitly listed, but may include other steps or elements not expressly listed or inherent to the process, method, product or device.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑模块划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical module division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要获取其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be obtained according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各模块单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件模块单元的形式实现。In addition, each module unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software module units.
所述集成的单元如果以软件模块单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software module unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, the computer software product is stored in a storage medium, and includes several instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the application. The aforementioned storage medium includes: various media that can store program codes such as U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk.
本领域技术人员应该可以意识到,在上述一个或多个示例中,本发明所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。Those skilled in the art should be aware that, in the above one or more examples, the functions described in the present invention may be implemented by hardware, software, firmware or any combination thereof. When implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
以上所述的具体实施方式,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施方式而已。The specific implementation manners described above further describe the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above descriptions are only specific implementation modes of the present invention.
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述 各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still modify the technical solutions described in the foregoing embodiments, or equivalently replace some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the various embodiments of the application.

Claims (37)

  1. 一种流量转发方法,其特征在于,由第一通信装置执行,所述方法包括:A traffic forwarding method, characterized in that it is performed by a first communication device, and the method includes:
    获取第一流量过滤信息,所述第一流量过滤信息包括虚拟专用网VPN标签、第一流规则和第一流量过滤动作,其中,所述第一流量过滤动作包括重定向的第一下一跳,所述重定向的第一下一跳为第二通信装置的第一公网互联网协议IP地址,所述第一流量过滤动作指示所述第一通信装置向所述第一下一跳转发与所述第一流规则匹配的流量;Obtaining first traffic filtering information, the first traffic filtering information includes a virtual private network VPN label, a first flow rule, and a first traffic filtering action, wherein the first traffic filtering action includes a redirected first next hop, the redirected first next hop is a first public network Internet protocol IP address of the second communication device, and the first traffic filtering action instructs the first communication device to forward traffic matching the first flow rule to the first next hop;
    根据所述第一流量过滤信息转发与所述第一流规则匹配的流量。Forwarding traffic matching the first flow rule according to the first traffic filtering information.
  2. 根据权利要求1所述的方法,其特征在于,所述第一流量过滤信息还包括隧道类型信息,所述隧道类型信息指示隧道的类型,所述隧道用于转发与所述第一流规则匹配的流量。The method according to claim 1, wherein the first traffic filtering information further includes tunnel type information, the tunnel type information indicates a type of tunnel, and the tunnel is used to forward traffic matching the first flow rule.
  3. 根据权利要求1所述的方法,其特征在于,所述获取第一流量过滤信息包括:The method according to claim 1, wherein said obtaining the first traffic filtering information comprises:
    接收控制器发送的边际网关协议BGP消息,所述BGP消息包括所述第一流量过滤信息。receiving a Border Gateway Protocol BGP message sent by the controller, where the BGP message includes the first traffic filtering information.
  4. 根据权利要求3所述的方法,其特征在于,所述BGP消息包括第一扩展团体属性,所述第一扩展团体属性中携带所述VPN标签。The method according to claim 3, wherein the BGP message includes a first extended community attribute, and the first extended community attribute carries the VPN label.
  5. 根据权利要求4所述的方法,其特征在于,所述第一扩展团体属性还包括隧道类型字段,所述隧道类型字段承载隧道类型信息,所述隧道类型信息指示隧道的类型,所述隧道用于转发与所述第一流规则匹配的流量。The method according to claim 4, wherein the first extended community attribute further includes a tunnel type field, the tunnel type field carries tunnel type information, the tunnel type information indicates a type of tunnel, and the tunnel is used to forward traffic matching the first flow rule.
  6. 根据权利要求1或2所述的方法,其特征在于,所述获取第一流量过滤信息包括:The method according to claim 1 or 2, wherein said obtaining the first traffic filtering information comprises:
    接收控制器发送的路径计算单元通信协议PCEP消息,所述PCEP消息包括所述第一流量过滤信息。Receive a path computation element communication protocol PCEP message sent by the controller, where the PCEP message includes the first traffic filtering information.
  7. 根据权利要求1-6任一项所述的方法,其特征在于,在根据所述第一流量过滤信息转发与所述第一流规则匹配的流量之前,所述方法还包括:The method according to any one of claims 1-6, wherein before forwarding traffic matching the first flow rule according to the first traffic filtering information, the method further comprises:
    根据所述第一公网IP地址迭代第一隧道,所述第一隧道为所述第一通信装置和所述第二通信装置之间建立的第一公网隧道;Iterating a first tunnel according to the first public network IP address, where the first tunnel is a first public network tunnel established between the first communication device and the second communication device;
    在转发面保存第一关联关系,所述第一关联关系包括所述VPN标签、所述第一流规则,所述第一公网IP地址和第一隧道标识之间的关联关系,所述第一隧道标识用于标识所述第一隧道。The first association relationship is saved on the forwarding plane, and the first association relationship includes the association relationship between the VPN label, the first flow rule, the first public network IP address and the first tunnel identifier, and the first tunnel identifier is used to identify the first tunnel.
  8. 根据权利要求7所述的方法,其特征在于,所述在转发面保存所述第一关联关系包括:The method according to claim 7, wherein storing the first association relationship on the forwarding plane comprises:
    在所述转发面保存第一流规则转发表项,所述第一流规则转发表项包括所述VPN标签、第一索引,所述第一公网IP地址和所述第一隧道标识,所述第一索引用于索引所述第一流规则。A first flow rule forwarding entry is stored on the forwarding plane, the first flow rule forwarding entry includes the VPN label, a first index, the first public network IP address and the first tunnel identifier, and the first index is used to index the first flow rule.
  9. 根据权利要求7或8所述的方法,其特征在于,所述第一关联关系还包括所述第一隧道的类型。The method according to claim 7 or 8, wherein the first association relationship further includes the type of the first tunnel.
  10. 根据权利要求1-9任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-9, wherein the method further comprises:
    获取第二流量过滤信息,所述第二流量过滤信息包括所述VPN标签、第二流规则和第 二流量过滤动作,其中,所述第二流量过滤动作携带重定向的第二下一跳,所述重定向的第二下一跳为所述第二通信装置第二公网互联网协议IP地址,所述第二流量过滤动作指示所述第一通信装置向所述第二下一跳转发与所述第二流规则匹配的流量;Acquiring second traffic filtering information, the second traffic filtering information includes the VPN label, a second flow rule, and a second traffic filtering action, wherein the second traffic filtering action carries a redirected second next hop, the redirected second next hop is the second public network Internet Protocol IP address of the second communication device, and the second traffic filtering action instructs the first communication device to forward traffic matching the second flow rule to the second next hop;
    根据所述第二流量过滤信息转发与所述第二流规则匹配的流量。Forwarding traffic matching the second flow rule according to the second traffic filtering information.
  11. 根据权利要求10所述的方法,其特征在于,所述方法还包括:The method according to claim 10, characterized in that the method further comprises:
    根据所述第二公网IP地址迭代第二隧道,所述第二隧道为所述第一通信装置和所述第二通信装置之间建立的第二公网隧道;Iterating a second tunnel according to the second public network IP address, where the second tunnel is a second public network tunnel established between the first communication device and the second communication device;
    在所述转发面保存所述第二关联关系,所述第二关联关系包括所述VPN标签、所述第二流规则,所述第二公网IP地址和第二隧道标识之间的关联关系,所述第二隧道标识用于标识所述第二隧道。The second association relationship is stored on the forwarding plane, and the second association relationship includes the association relationship between the VPN label, the second flow rule, the second public network IP address and a second tunnel identifier, and the second tunnel identifier is used to identify the second tunnel.
  12. 根据权利要求1-11任一项所述的方法,其特征在于,所述根据所述第一流量过滤信息转发与所述第一流规则匹配的流量包括:The method according to any one of claims 1-11, wherein the forwarding of the traffic matching the first flow rule according to the first traffic filtering information comprises:
    接收第一报文;receiving the first message;
    响应于所述第一报文与所述第一流规则相匹配,在所述第一报文中添加所述VPN标签;Adding the VPN label to the first packet in response to the first packet matching the first flow rule;
    向所述第一下一跳发送添加所述VPN标签后的第一报文。Send the first packet with the VPN label added to the first next hop.
  13. 根据权利要求7-9任一项所述的方法,其特征在于,所述根据所述第一流量过滤信息转发与所述第一流规则匹配的流量包括:The method according to any one of claims 7-9, wherein the forwarding of the traffic matching the first flow rule according to the first traffic filtering information comprises:
    接收第二报文;receiving the second message;
    响应于所述第二报文与所述第一流规则相匹配,在所述第二报文中添加所述VPN标签;Adding the VPN label to the second packet in response to the second packet matching the first flow rule;
    通过所述第一隧道向所述第一下一跳发送添加所述VPN标签后的第二报文。sending the second packet to which the VPN label is added to the first next hop through the first tunnel.
  14. 根据权利要求8所述的方法,其特征在于,所述根据所述第一流量过滤信息转发与所述第一流规则匹配的流量包括:The method according to claim 8, wherein the forwarding of the traffic matching the first flow rule according to the first traffic filtering information comprises:
    接收第三报文;receiving the third message;
    响应于所述第三报文与所述第一流规则相匹配,根据所述第一流规则转发表项,确定与所述第一流规则对应的所述VPN标签和所述第一隧道标识;In response to the match between the third packet and the first flow rule, determine the VPN label and the first tunnel identifier corresponding to the first flow rule according to the forwarding entry of the first flow rule;
    在所述第三报文中添加所述VPN标签;adding the VPN label to the third packet;
    通过所述第一隧道向所述第一下一跳发送添加所述VPN标签后的第三报文。sending the third packet with the VPN label added to the first next hop through the first tunnel.
  15. 根据权利要求10所述的方法,其特征在于,所述根据所述第二流量过滤信息转发与所述流规则匹配的流量包括:The method according to claim 10, wherein the forwarding of traffic matching the flow rule according to the second traffic filtering information comprises:
    接收第四报文;receiving the fourth message;
    响应于所述第四报文与所述第二流规则相匹配,在所述第四报文中添加所述VPN标签;Adding the VPN label to the fourth packet in response to the fourth packet matching the second flow rule;
    向所述第二下一跳发送添加所述VPN标签后的第四报文。Send the fourth packet after adding the VPN label to the second next hop.
  16. 根据权利要求11所述的方法,其特征在于,所述根据所述第二流量过滤信息转发与所述流规则匹配的流量包括:The method according to claim 11, wherein the forwarding of traffic matching the flow rule according to the second traffic filtering information comprises:
    接收第五报文;receiving the fifth message;
    响应于所述第五报文与所述第二流规则相匹配,根据所述第二流规则转发表项,确定与所述第二流规则对应的所述VPN标签和所述第二隧道标识;In response to the fifth packet matching the second flow rule, determine the VPN label and the second tunnel identifier corresponding to the second flow rule according to the second flow rule forwarding entry;
    在所述第五报文中添加所述VPN标签;adding the VPN label to the fifth message;
    通过所述第二隧道向所述第二下一跳发送添加所述VPN标签后的第五报文。sending the fifth packet with the VPN label added to the second next hop through the second tunnel.
  17. 一种报文发送方法,其特征在于,所述方法应用于第一通信装置,包括:A message sending method, characterized in that the method is applied to a first communication device, comprising:
    接收第一报文;receiving the first message;
    响应于所述第一报文与第一流规则相匹配,根据第一关联关系确定虚拟专用网VPN标签和第一流量过滤动作,所述第一关联关系包括所述第一流规则、所述VPN标签和所述第一流量过滤动作之间的关联关系,所述第一流量过滤动作包括重定向的第一下一跳,所述重定向的第一下一跳为第二通信装置的第一公网互联网协议IP地址;In response to the first packet matching the first flow rule, determining a virtual private network VPN label and a first traffic filtering action according to a first association relationship, the first association relationship including the first flow rule, the VPN label and the first traffic filtering action The association relationship between the first traffic filtering action includes a redirected first next hop, and the redirected first next hop is a first public network Internet Protocol IP address of the second communication device;
    为所述第一报文添加所述VPN标签;adding the VPN label to the first packet;
    向所述第一下一跳发送添加所述VPN标签后的第一报文。Send the first packet with the VPN label added to the first next hop.
  18. 根据权利要求17所述的方法,其特征在于,所述第一流量过滤动作还包括第一隧道标识,所述第一隧道标识用于标识第一隧道,所述第一隧道为所述第一通信装置和所述第二通信装置之间建立的第一公网隧道;The method according to claim 17, wherein the first traffic filtering action further includes a first tunnel identifier, the first tunnel identifier is used to identify a first tunnel, and the first tunnel is a first public network tunnel established between the first communication device and the second communication device;
    所述向所述第一下一跳发送添加所述VPN标签后的第一报文包括:The sending the first message after adding the VPN label to the first next hop includes:
    通过所述第一隧道向所述第一下一跳发送添加所述VPN标签后的第一报文。sending the first packet with the VPN label added to the first next hop through the first tunnel.
  19. 根据权利要求18所述的方法,其特征在于,所述方法还包括:The method according to claim 18, further comprising:
    根据第一流规则转发表项,确定与所述第一流规则对应的VPN标签和所述第一隧道标识,所述第一流规则转发表项包括所述VPN标签、第一索引,所述第一公网IP地址和第一隧道标识,所述第一索引用于索引所述第一流规则。According to the first flow rule forwarding entry, determine the VPN label corresponding to the first flow rule and the first tunnel identifier, the first flow rule forwarding entry includes the VPN label, a first index, the first public network IP address and a first tunnel identifier, and the first index is used to index the first flow rule.
  20. 根据权利要求17-19任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 17-19, wherein the method further comprises:
    接收第二报文;receiving the second message;
    响应于所述第二报文与第二流规则相匹配,根据第二关联关系确定所述VPN标签和第二流量过滤动作,所述第二关联关系包括所述第二流规则、所述VPN标签和所述第二流量过滤动作之间的关联关系,所述第二流量过滤动作包括重定向的第二下一跳,所述重定向的第二下一跳为所述第二通信装置的第二公网互联网协议IP地址;In response to the second packet matching the second flow rule, determining the VPN label and a second traffic filtering action according to a second association relationship, the second association relationship includes an association relationship between the second flow rule, the VPN label, and the second traffic filtering action, and the second traffic filtering action includes a redirected second next hop, and the redirected second next hop is a second public network Internet Protocol IP address of the second communication device;
    为所述第二报文添加所述VPN标签;adding the VPN label to the second packet;
    向所述第二下一跳发送添加所述VPN标签后的第二报文。Send the second packet to which the VPN label is added to the second next hop.
  21. 根据权利要求20所述的方法,其特征在于,所述第二流量过滤动作还包括第二隧道标识,所述第二隧道标识用于标识第二隧道,所述第二隧道为所述第一通信装置和所述第二通信装置之间建立的第二公网隧道;The method according to claim 20, wherein the second traffic filtering action further includes a second tunnel identifier, the second tunnel identifier is used to identify a second tunnel, and the second tunnel is a second public network tunnel established between the first communication device and the second communication device;
    所述向所述第二下一跳发送添加所述VPN标签后的第二报文包括:The sending the second message after adding the VPN label to the second next hop includes:
    通过所述第二隧道向所述第二下一跳发送添加所述VPN标签后的第二报文。sending the second packet to which the VPN label is added to the second next hop through the second tunnel.
  22. 一种消息发送方法,其特征在于,所述方法应用于控制管理设备,包括:A message sending method, characterized in that the method is applied to control and management equipment, including:
    获取第一流量过滤信息,所述第一流量过滤信息包括虚拟专用网VPN标签、第一流规 则和第一流量过滤动作,其中,所述第一流量过滤动作包括重定向的第一下一跳,所述重定向的第一下一跳为第二通信装置的第一公网互联网协议IP地址,所述第一流量过滤动作指示第一通信装置向所述第一下一跳转发与所述第一流规则匹配的VPN流量;Acquiring first traffic filtering information, the first traffic filtering information includes a virtual private network VPN label, a first flow rule, and a first traffic filtering action, wherein the first traffic filtering action includes a redirected first next hop, the redirected first next hop is a first public network Internet Protocol IP address of the second communication device, and the first traffic filtering action instructs the first communication device to forward VPN traffic that matches the first flow rule to the first next hop;
    向所述第一通信装置发送所述第一流量过滤信息。sending the first traffic filtering information to the first communication device.
  23. 根据权利要求22所述的方法,其特征在于,所述第一流量过滤信息还包括第一隧道的隧道类型信息,所述第一隧道的隧道类型信息指示第一隧道的类型,所述第一隧道用于转发与所述第一流规则匹配的流量,所述第一隧道为所述第一通信装置和所述第二通信装置之间建立的第一公网隧道。The method according to claim 22, wherein the first traffic filtering information further includes tunnel type information of a first tunnel, the tunnel type information of the first tunnel indicates the type of the first tunnel, the first tunnel is used to forward traffic matching the first flow rule, and the first tunnel is a first public network tunnel established between the first communication device and the second communication device.
  24. 根据权利要求22所述的方法,其特征在于,所述控制管理设备为控制器,所述向所述第一通信装置发送所述第一流量过滤信息包括:The method according to claim 22, wherein the control management device is a controller, and sending the first traffic filtering information to the first communication device comprises:
    向所述第一通信装置发送边际网关协议BGP消息,所述BGP消息包括所述第一流量过滤信息。sending a Border Gateway Protocol BGP message to the first communication device, where the BGP message includes the first traffic filtering information.
  25. 根据权利要求24所述的方法,其特征在于,所述BGP消息包括第一扩展团体属性,所述第一扩展团体属性中携带所述VPN标签。The method according to claim 24, wherein the BGP message includes a first extended community attribute, and the first extended community attribute carries the VPN label.
  26. 根据权利要求25所述的方法,其特征在于,所述第一扩展团体属性还包括隧道类型字段,所述隧道类型字段承载隧道类型信息,所述隧道类型信息指示隧道的类型,所述隧道用于转发与所述第一流规则匹配的流量。The method according to claim 25, wherein the first extended community attribute further includes a tunnel type field, and the tunnel type field carries tunnel type information, and the tunnel type information indicates a type of a tunnel, and the tunnel is used to forward traffic matching the first flow rule.
  27. 根据权利要求24-26任一项所述的方法,其特征在于,所述BGP消息还包括路由目标RT,所述路由目标关联所述第一通信装置中的VPN实例,第一流量过滤信息用于对来自与所述VPN实例绑定的VPN站点中的VPN流量进行过滤。The method according to any one of claims 24-26, wherein the BGP message further includes a routing target RT, the routing target is associated with the VPN instance in the first communication device, and the first traffic filtering information is used to filter VPN traffic from a VPN site bound to the VPN instance.
  28. 根据权利要求22或23所述的方法,其特征在于,所述控制管理设备为控制器,所述向所述第一通信装置发送所述第一流量过滤信息包括:The method according to claim 22 or 23, wherein the control management device is a controller, and sending the first traffic filtering information to the first communication device comprises:
    向所述第一通信装置发送路径计算单元通信协议PCEP消息,所述PCEP消息包括所述第一流量过滤信息。Sending a path computation element communication protocol PCEP message to the first communication device, where the PCEP message includes the first traffic filtering information.
  29. 根据权利要求22-28任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 22-28, further comprising:
    获取第二流量过滤信息,所述第二流量过滤信息包括所述VPN标签、第二流规则和第二流量过滤动作,其中,所述第二流量过滤动作包括重定向的第二下一跳,所述重定向的第二下一跳为第二通信装置的第二公网IP地址,所述第二流量过滤动作指示第一通信装置向所述第二下一跳转发与所述第二流规则匹配的流量;Acquire second traffic filtering information, where the second traffic filtering information includes the VPN label, a second flow rule, and a second traffic filtering action, wherein the second traffic filtering action includes a redirected second next hop, the redirected second next hop is a second public network IP address of the second communication device, and the second traffic filtering action instructs the first communication device to forward traffic matching the second flow rule to the second next hop;
    向所述第一通信装置发送所述第二流量过滤信息。sending the second traffic filtering information to the first communication device.
  30. 根据权利要求29所述的方法,其特征在于,所述第二流量过滤信息还包括第二隧道的隧道类型信息,所述第二隧道的隧道类型信息指示第二隧道的类型,所述第二隧道用于转发与所述第二流规则匹配的流量,所述第二隧道为所述第一通信装置和所述第二通信装置之间建立的第二公网隧道。The method according to claim 29, wherein the second traffic filtering information further includes tunnel type information of a second tunnel, the tunnel type information of the second tunnel indicates the type of the second tunnel, the second tunnel is used to forward traffic matching the second flow rule, and the second tunnel is a second public network tunnel established between the first communication device and the second communication device.
  31. 一种网络设备,其特征在于,所述网络设备,包括收发模块和处理模块,所述收发模块用于执行权利要求1-21任一项所述的方法中的接收和/或发送操作;所述处理模块用于执行权利要求1-21任一项所述的方法中接收和/或发送操作以外的操作。A network device, characterized in that the network device includes a transceiver module and a processing module, the transceiver module is used to perform the receiving and/or sending operation in the method according to any one of claims 1-21; the processing module is used to perform operations other than the receiving and/or sending operation in the method according to any one of claims 1-21.
  32. 一种控制管理设备,其特征在于,所述控制管理设备,包括收发模块和处理模块,所述收发模块用于执行权利要求22-30任一项所述的方法中的接收和/或发送操作,所述处理模块用于执行权利要求22-30任一项所述的方法中接收和/或发送操作以外的操作。A control and management device, characterized in that the control and management device includes a transceiver module and a processing module, the transceiver module is used to perform the receiving and/or sending operation in the method according to any one of claims 22-30, and the processing module is used to perform operations other than the receiving and/or sending operation in the method according to any one of claims 22-30.
  33. 一种网络设备,其特征在于,所述网络设备包括存储器和处理器,所述存储器用于存储指令,所述处理器用于运行所述指令,以使得所述网络设备执行如权利要求1-16任一项权利要求所述的流量转发方法,或执行如权利要求17-21任一项权利要求所述的报文发送方法。A network device, characterized in that the network device includes a memory and a processor, the memory is used to store instructions, and the processor is used to run the instructions, so that the network device executes the traffic forwarding method according to any one of claims 1-16, or executes the message sending method according to any one of claims 17-21.
  34. 一种控制管理设备,特征在于,所述控制管理设备包括存储器和处理器,所述存储器用于存储指令,所述处理器用于运行所述指令,以使得所述控制管理设备执行如权利要求22-30任一项所述的消息发送方法。A control management device, characterized in that the control management device includes a memory and a processor, the memory is used to store instructions, and the processor is used to run the instructions, so that the control management device executes the message sending method according to any one of claims 22-30.
  35. 一种网络系统,其特征在于,所述网络系统包括网络设备和控制管理设备,所述网络设备用于执行权利要求1-21任一项所述的方法,所述控制管理设备用于执行权利要求22-30任一项所述的方法。A network system, characterized in that the network system includes a network device and a control management device, the network device is used to execute the method according to any one of claims 1-21, and the control management device is used to execute the method according to any one of claims 22-30.
  36. 一种计算机可读存储介质,其特征在于,包括指令,当其在处理器上执行时,实现权利要求1-30任一项所述的方法。A computer-readable storage medium, characterized by comprising instructions, which, when executed on a processor, implement the method according to any one of claims 1-30.
  37. 一种计算机程序产品,其特征在于,包括程序,当所述程序在处理器上运行时,执行上述权利要求1-30任一项所述的方法。A computer program product, characterized in that it includes a program, and when the program is run on a processor, the method described in any one of claims 1-30 above is performed.
PCT/CN2023/070024 2022-01-21 2023-01-03 Traffic forwarding method, packet sending method, message sending method, and apparatus WO2023138351A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210074405.4A CN116506379A (en) 2022-01-21 2022-01-21 Flow forwarding method, message sending method and device
CN202210074405.4 2022-01-21

Publications (1)

Publication Number Publication Date
WO2023138351A1 true WO2023138351A1 (en) 2023-07-27

Family

ID=87318958

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/070024 WO2023138351A1 (en) 2022-01-21 2023-01-03 Traffic forwarding method, packet sending method, message sending method, and apparatus

Country Status (2)

Country Link
CN (1) CN116506379A (en)
WO (1) WO2023138351A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060050719A1 (en) * 2000-10-17 2006-03-09 Riverhead Networks, Inc. Selective diversion and injection of communication traffic
WO2018000443A1 (en) * 2016-07-01 2018-01-04 华为技术有限公司 Service function chaining (sfc)-based packet forwarding method, device and system
CN108259379A (en) * 2017-05-08 2018-07-06 新华三技术有限公司 A kind of flow forwarding method and device
US20180332045A1 (en) * 2014-12-25 2018-11-15 Zte Corporation Method and device for MPLS intermediate node to perform multicast forwarding, and node thereof
CN112787935A (en) * 2016-02-01 2021-05-11 华为技术有限公司 VPN route notification method, data flow forwarding method and related equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060050719A1 (en) * 2000-10-17 2006-03-09 Riverhead Networks, Inc. Selective diversion and injection of communication traffic
US20180332045A1 (en) * 2014-12-25 2018-11-15 Zte Corporation Method and device for MPLS intermediate node to perform multicast forwarding, and node thereof
CN112787935A (en) * 2016-02-01 2021-05-11 华为技术有限公司 VPN route notification method, data flow forwarding method and related equipment
WO2018000443A1 (en) * 2016-07-01 2018-01-04 华为技术有限公司 Service function chaining (sfc)-based packet forwarding method, device and system
CN108259379A (en) * 2017-05-08 2018-07-06 新华三技术有限公司 A kind of flow forwarding method and device

Also Published As

Publication number Publication date
CN116506379A (en) 2023-07-28

Similar Documents

Publication Publication Date Title
US10193812B2 (en) Multicast load balancing in multihoming EVPN networks
US9781032B1 (en) MPLS label usage in ethernet virtual private networks
US8300614B2 (en) Preventing packet loops in unified networks
CN108574616A (en) A kind of method, equipment and the system of processing routing
WO2021164249A1 (en) Method, device and system for sending message
CN108964940B (en) Message sending method and device and storage medium
WO2020135395A1 (en) Notification method and device for prefix identifier of cross-interior gateway protocol
WO2021000752A1 (en) Method and related device for forwarding packets in data center network
US20230300070A1 (en) Packet Sending Method, Device, and System
EP3396897B1 (en) Multicast load balancing in multihoming evpn networks
CN114598635A (en) Message transmission method and device
US20230353479A1 (en) Edge Computing Data and Service Discovery Using an Interior Gateway Protocol (IGP)
WO2023274083A1 (en) Route publishing method and apparatus, packet forwarding method and apparatus, device, and storage medium
WO2023138351A1 (en) Traffic forwarding method, packet sending method, message sending method, and apparatus
WO2022166465A1 (en) Message processing method and related apparatus
CN114301839B (en) Multicast message transmission method and device
WO2022007550A1 (en) Load balancing method, apparatus, network device, and system
CN115242699A (en) Message transmission method, slice generation method, device and system
WO2021179935A1 (en) Route determination method, apparatus and network device
CN113973072B (en) Message sending method, device and system
CN115473765A (en) Message transmission method, device and system
CN113595915A (en) Method for forwarding message and related equipment
CN112751766A (en) Message forwarding method and device and computer storage medium
WO2024007762A1 (en) Route publishing method, and communication method and apparatus
WO2023050818A1 (en) Data forwarding method and system, electronic device, and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23742667

Country of ref document: EP

Kind code of ref document: A1