WO2020083095A1 - 反向路径检查方法、装置、设备以及存储介质 - Google Patents

反向路径检查方法、装置、设备以及存储介质 Download PDF

Info

Publication number
WO2020083095A1
WO2020083095A1 PCT/CN2019/111808 CN2019111808W WO2020083095A1 WO 2020083095 A1 WO2020083095 A1 WO 2020083095A1 CN 2019111808 W CN2019111808 W CN 2019111808W WO 2020083095 A1 WO2020083095 A1 WO 2020083095A1
Authority
WO
WIPO (PCT)
Prior art keywords
multicast
interface
layer
message
access
Prior art date
Application number
PCT/CN2019/111808
Other languages
English (en)
French (fr)
Inventor
李宁
Original Assignee
深圳市中兴微电子技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市中兴微电子技术有限公司 filed Critical 深圳市中兴微电子技术有限公司
Publication of WO2020083095A1 publication Critical patent/WO2020083095A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • 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/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]
    • H04L12/4675Dynamic sharing of VLAN information amongst network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/16Multipoint routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/18Loop-free operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/302Route determination based on requested QoS
    • H04L45/308Route determination based on user's profile, e.g. premium users

Definitions

  • Embodiments of the present application relate to, but are not limited to, the field of communication networks, for example, to a method and device for reverse path inspection.
  • IP Internet Protocol
  • IPTV Internet Protocol
  • the multicast model In the multicast service, the multicast model must perform certain checks on the incoming interface of the multicast packet to ensure that the multicast packet reaches the destination router through the shortest path in the tree topology, and also Prevent the formation of loops. To this end, Reverse Path Forwarding (RPF) technology is proposed.
  • RPF Reverse Path Forwarding
  • RPF The core idea of RPF technology is that when a multicast packet enters the router, the router performs the RPF check algorithm to confirm whether the multicast packet enters from the expected inbound interface. If it is incoming from the expected inbound interface, continue to forward; if it is not from the expected inbound interface, then discard the packet.
  • the RPF check ensures that only multicast packets coming in from one incoming interface will be forwarded, and multicast packets coming in from other incoming interfaces will be discarded. In this way, loops of multicast packets are avoided. For example, on device A, multicast packets come in from port 1, and out from port 2. After reaching device B, they are copied and then enter from device A through port 3. With RPF technology, only one port can be used. Multicast packets are forwarded, and multicast packets from other incoming interfaces are discarded, thereby avoiding multicast loops.
  • Embodiments of the present application provide a reverse path inspection method, device, equipment, and storage medium, which can reduce the complexity of implementing a reverse path inspection process and improve efficiency.
  • An embodiment of the present application provides a reverse path check method, including:
  • the reverse path forwarding RPF check passes to obtain the multicast member information, based on the multicast member information Copy and forward the message.
  • An embodiment of the present application provides a reverse path inspection device, including:
  • the acquisition module is set to parse the message and obtain the actual incoming interface of the received message
  • the table lookup module is set to check the multicast routing table based on the multicast source address, multicast group address, and actual inbound interface of the packet when it is determined that the packet is a multicast packet;
  • the processing module is configured to, when the multicast source address, the multicast group address and the actual inbound interface of the message are hit in the multicast routing table, the reverse path forwarding RPF check passes to obtain the multicast member Information, copy and forward packets based on multicast member information.
  • An embodiment of the present application provides a reverse path inspection device, including a processor and a computer-readable storage medium.
  • the computer-readable storage medium stores instructions, which are implemented when the instructions are executed by the processor. Apply for the reverse path inspection method provided by any embodiment.
  • An embodiment of the present application provides a computer-readable storage medium that stores a computer program, and when the computer program is executed by a processor, a reverse path inspection method provided by any embodiment of the present application is implemented.
  • Figure 1 is a flow chart of an RPF technology in the related art
  • FIG. 2 is a flowchart of another RPF technology in the related art
  • FIG. 3 is a flowchart of a reverse path inspection method provided by an embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of a reverse path inspection device provided by an embodiment of the present application.
  • the first uses Unicast Reverse Path Forwarding (URPF) technology, that is, after a message enters the device, it parses the message and obtains the actual inbound interface (iif_index), according to The destination address determines whether the packet is a multicast packet.
  • URPF Unicast Reverse Path Forwarding
  • the multicast routing table is checked according to the multicast source address and the multicast group address, and the multicast source address and Obtain the multicast member information after the multicast group address, and check the unicast routing table by the multicast source address in the multicast message to obtain the expected table lookup index of the inbound interface, and look up the table based on the expected inbound interface table lookup index to obtain the expected Incoming interface.
  • the table lookup index of the expected inbound interface is stored in the result table corresponding to the multicast routing table.
  • the packet After the packet enters the device, it parses the packet and obtains the actual inbound interface (iif_index), and determines whether the packet is a multicast packet based on the destination address. When the packet is a multicast packet, it is based on the multicast source address and group The multicast group address checks the multicast routing table. After the multicast source address and the multicast group address are hit in the multicast routing table, the multicast member information and an expected inbound interface lookup table index are obtained from the result table.
  • the table lookup index of the inbound interface looks up the table to obtain the expected inbound interface, compare the actual inbound interface with the expected inbound interface, and when the actual inbound interface is the same as the expected inbound interface, copy and forward the multicast report based on the multicast member information When the actual inbound interface is different from the expected inbound interface, the multicast packet is discarded.
  • the second method has one less process of checking the unicast routing table, which is more efficient, and there is no intersection between the unicast process and the multicast process, and the implementation process is simplified.
  • Both of the above methods need to first obtain an expected inbound interface table lookup index, use the expected inbound interface table lookup table lookup table to obtain the expected inbound interface, and compare the actual inbound interface with the expected inbound interface. That is to say, both need to look up the table and the comparison process, the implementation process is complicated, and the efficiency is low.
  • an embodiment of the present application proposes a reverse path check method, including:
  • Step 3000 Parse the message and obtain the actual incoming interface of the received message.
  • the inbound interface is also called an inbound port.
  • the actual incoming interface of the received message can be obtained according to the related technology.
  • obtaining the actual incoming interface of the received message includes: determining whether at least one of the following is configured: a first layer 3 access interface, a second layer 3 access interface, and a third layer 3 interface Incoming interface; according to the judgment result, the following one is determined as the actual inbound interface: the first layer 3 access interface, the second layer 3 access interface, and the third layer 3 access interface.
  • the first layer 3 access interface is obtained through a physical interface; the second layer 3 access interface is obtained through a physical interface and a virtual local area network (Virtual Local Area Network, VLAN) identifier carried in the packet ;
  • the Layer 3 and Layer 3 access interface is obtained by the VLAN identifier carried in the packet.
  • VLAN Virtual Local Area Network
  • the layer 3 access interface (L3_iif_index, L3 ingress interface) is a logical interface virtualized inside the device.
  • determining whether the first and third layer access interfaces are configured includes: when the first and third layer access interfaces corresponding to the physical interface are found in the ingress port attribute table, it is determined that the first and third layer interfaces are configured Access interface; when the first layer 3 access interface corresponding to the physical interface cannot be found in the ingress port attribute table, it is determined that the first layer 3 access interface is not configured.
  • the first layer 3 access interface is obtained directly from the ingress port attribute table according to the physical interface.
  • Determining whether the Layer 2 and Layer 3 access interface is configured includes: checking the incoming VLAN translation table based on the physical interface and VLAN ID, and judging whether the configuration is based on the result information when the physical interface and VLAN ID are hit in the VLAN translation table If the second and third layer access interfaces are included in the result information, it is determined that the second and third layer access interfaces are configured; the second and third layer access interfaces are not included in the result information In the case of, it is determined that the Layer 2 and Layer 3 access interfaces are not configured.
  • the incoming VLAN translation table is checked based on the physical interface and the VLAN identification, and the physical interface and the VLAN identification are missed in the VLAN translation table, it is judged that the Layer 2 and Layer 3 access interface is not configured.
  • the second and third layer access interfaces are obtained from the corresponding result information .
  • Determining whether the Layer 3 and Layer 3 access interface is configured includes: when the Layer 2 and Layer 3 access interface corresponding to the VLAN ID is found in the VLAN attribute table, it is determined that the Layer 3 and Layer 3 access interface is configured; in the VLAN attribute If the Layer 2 and Layer 3 access interface corresponding to the VLAN identifier cannot be found in the table, it is determined that the Layer 3 and Layer 3 access interface is not configured. In this embodiment, the layer 3 and layer 3 access interfaces are obtained directly from the VLAN attribute table according to the VLAN identifier.
  • determining the actual inbound interface according to the judgment result includes at least one of the following: in response to configuring only the first layer 3 access interface, the second layer 3 access interface, and the third layer 3
  • the judgment result of one of the access interfaces determines that the configured layer 3 access interface is the actual inbound interface; in response to the configuration of the first layer 3 access interface, the second layer 3 access interface,
  • the judgment result of at least two of the third layer 3 access interfaces uses the layer 3 access interface with the highest priority among the configured layer 3 access interfaces as the actual inbound interface.
  • the priority of the layer 3 access interface may be preset, for example, the priority of the second layer 3 access interface is set higher than the first layer 3 access interface, and the priority of the first layer 3 access interface Higher than the third and third layer access interface.
  • Step 3010 When it is determined that the packet is a multicast packet, check the multicast routing table according to the multicast source address, multicast group address, and actual inbound interface of the packet.
  • whether the message is a multicast message can be determined according to the destination Media Access Control (MAC) address and destination IP address of the message, and the destination MAC address in the message is the multicast MAC address , If the destination IP address is a multicast IP address, determine that the message is a multicast message; if the destination MAC address of the message is not a multicast MAC address, and / or the destination IP address is not a multicast IP address, Make sure that the message is not a multicast message.
  • MAC Media Access Control
  • the multicast routing table may be a multicast routing table obtained by adding an expected inbound interface as a lookup key value on the basis of the multicast routing table of the related art.
  • the multicast routing table may be checked according to related technologies.
  • Step 3020 In the case of hitting the multicast source address, multicast group address, and actual inbound interface of the packet in the multicast routing table, the reverse path forwarding RPF check passes to obtain multicast member information, based on The information is copied and the message is forwarded.
  • whether the multicast source address, the multicast group address and the actual inbound interface of the packet are hit in the multicast routing table may be similar to the related art, and will not be repeated here.
  • the method further includes: discarding the packet Text.
  • the method further includes: configuring the multicast routing table.
  • the lookup keys of the multicast routing table include: a multicast source address, a multicast group address, and an expected inbound interface.
  • the method further includes: initializing related configuration, such as power-on initialization of the device, and issuing the default configuration.
  • a multicast message can be constructed by the meter and sent to the device.
  • the device receives the message and forwards it according to the above method, thereby testing the RPF check function of the device.
  • the meaning of hit information in a table is to find the information in the table.
  • the expected inbound interface is directly used as the lookup key of the multicast routing table. Therefore, the multicast routing table is searched and the multicast source address, multicast group address, and actual address of the packet are hit in the multicast routing table
  • the RPF check is passed when the inbound interface is passed, without the need for additional table lookup and comparison processes, which reduces the complexity of the implementation process and improves efficiency.
  • another embodiment of the present application provides a reverse path inspection device, including: an acquisition module 401 configured to parse a message and obtain an actual incoming interface of a received message; a table lookup module 402 configured to When it is judged that the packet is a multicast packet, the multicast routing table is checked according to the multicast source address, multicast group address and actual inbound interface of the packet; the processing module 403 is set to be in the multicast routing table In the case of hitting the multicast source address, multicast group address, and actual inbound interface, the reverse path forwarding RPF check passes, obtains multicast member information, and copies and forwards the packet based on the multicast member information.
  • the inbound interface is also called an inbound port.
  • the obtaining module 401 can obtain the actual inbound interface of the message according to the related technology.
  • the obtaining module 401 is configured to obtain the actual incoming interface of the received packet by determining whether at least one of the following is configured: a first layer 3 access interface, a second layer 3 interface Incoming interface, Layer 3 and Layer 3 access interface; according to the judgment result, it is determined that the following one is the actual incoming interface: the first Layer 3 access interface, the second Layer 3 access interface, the third layer 3 Layer access interface; wherein, the first layer 3 access interface is obtained through a physical interface; the second layer 3 access interface is obtained through a physical interface and the VLAN identifier carried in the packet; the third layer 3 The access interface is obtained through the VLAN identifier carried in the message.
  • the layer 3 access interface (L3_iif_index, L3 ingress interface) is a logical interface virtualized inside the device.
  • the acquisition module 401 is configured to determine whether the first and third layer access interfaces are configured by: when the first and third layer access interfaces corresponding to the physical interface are found in the ingress port attribute table, It is determined that the first and third layer access interfaces are configured; when the first and third layer access interfaces corresponding to the physical interface cannot be found in the ingress port attribute table, it is determined that the first and third layer access interfaces are not configured.
  • the first layer 3 access interface is obtained directly from the ingress port attribute table according to the physical interface.
  • the acquisition module 401 is set to determine whether the Layer 2 and Layer 3 access interface is configured in the following manner: in the case of checking the incoming VLAN translation table hit based on the physical interface and the VLAN ID, determine whether the Layer 2 and Layer 3 is configured according to the result information Access interface, when the result information contains the layer 2 and layer 3 access interface, it is determined that the layer 2 and 3 access interface is configured; when the result information does not contain the layer 2 and 3 access interface, it is determined There is no Layer 2 or Layer 3 access interface configured. In the case where a miss to the VLAN translation table is checked based on the physical interface and the VLAN identifier, it is determined that the Layer 2 and Layer 3 access interface is not configured. In this embodiment, the layer 2 access interface is obtained from the corresponding result information when checking the entry into the VLAN translation table according to the physical interface and the VLAN identifier.
  • the acquisition module 401 is set to determine whether the Layer 3 and Layer 3 access interface is configured in the following way: when the Layer 2 and Layer 3 access interface corresponding to the VLAN identifier is found in the VLAN attribute table, it is determined that the Layer 3 and Layer 3 configuration interface is configured Layer access interface; when the layer 2 and layer 3 access interface corresponding to the VLAN identifier cannot be found in the VLAN attribute table, it is determined that the layer 3 and layer 3 access interface is not configured.
  • the layer 3 and layer 3 access interfaces are obtained directly from the VLAN attribute table according to the VLAN identifier.
  • the obtaining module 401 is configured to determine the actual inbound interface according to the judgment result in at least one of the following ways: in response to configuring only the first layer 3 access interface and the second layer 3 access interface 1.
  • a judgment result of one of the third layer 3 access interfaces determines that the configured layer 3 access interface is the actual incoming interface; in response to the configuration of the first layer 3 access interface, the first
  • the judgment result of at least two of the Layer 2 and Layer 3 access interfaces and the Layer 3 and Layer 3 access interfaces uses the Layer 3 access interface with the highest priority among the configured Layer 3 access interfaces as the actual incoming interface .
  • the priority of the layer 3 access interface may be preset, for example, the priority of the second layer 3 access interface is set higher than the first layer 3 access interface, and the priority of the first layer 3 access interface Higher than the third and third layer access interface.
  • the table lookup module 402 can determine whether the packet is a multicast packet based on the destination MAC address and the destination IP address of the packet.
  • the destination MAC address in the packet is the multicast MAC address and the destination IP address is In the case of a multicast IP address, the packet is determined to be a multicast packet; when the destination MAC address of the packet is not a multicast MAC address, and / or the destination IP address is not a multicast IP address, the packet is not a group Broadcast message.
  • the processing module 403 is further configured to: when the multicast source address, multicast group address, and actual inbound interface of the missed message in the multicast routing table are discarded Describe the message.
  • it further includes: a configuration module 404 configured to configure the multicast routing table, and the lookup keys of the multicast routing table include: multicast source address, multicast group address and expected Inbound interface.
  • the configuration module 404 is further configured to: initialize related configuration, such as power-on initialization of the device, and deliver the default configuration.
  • a multicast message can be constructed by the meter and sent to the device.
  • the device receives the message and forwards it according to the above method, thereby testing the RPF check function of the device.
  • the expected inbound interface is directly used as the lookup key of the multicast routing table. Therefore, the RPF check is passed when the lookup of the multicast routing table hits, without the need for an additional table lookup process and comparison process, reducing the implementation process Complexity improves efficiency.
  • a reverse path inspection device including a processor and a computer-readable storage medium
  • the computer-readable storage medium stores instructions, and when the instructions are executed by the processor, Implement any of the above reverse path inspection methods.
  • Another embodiment of the present application provides a computer-readable storage medium that stores a computer program, and when the computer program is executed by a processor, any of the foregoing reverse path inspection methods is implemented.
  • All or some of the steps, systems, and functional modules / units in the method disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof.
  • the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be composed of some physical
  • the components are executed in cooperation.
  • Some or all components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit.
  • Such software may be distributed on computer-readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media).
  • computer storage medium includes both volatile and nonvolatile implemented in any method or technology for storing information such as computer readable instructions, data structures, program modules, or other data Sex, removable and non-removable media.
  • Computer storage media include but are not limited to Random Access Memory (RAM), Read-Only Memory (ROM), Erasable Programmable Read-Only Memory (Electrically Programmable Read-Only Memory, EEPROM) , Flash memory or other memory technology, compact disc read-only memory (Compact Disc Read-Only Memory, CD-ROM), digital versatile disc (Digital Video Disc, DVD) or other optical disc storage, magnetic box, magnetic tape, magnetic disk storage or other magnetic A storage device, or any other medium that can be configured to store desired information and can be accessed by a computer.
  • the communication medium generally contains computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery medium .

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

本文公开了一种反向路径检查方法、装置、设备以及存储介质,所述反向路径检查方法包括:解析报文并获取接收报文的实际的入接口;在报文为组播报文的情况下,根据报文的组播源地址、组播组地址和实际的入接口查组播路由表;在在组播路由表中命中所述报文的组播源地址、组播组地址和所述实际的入接口的情况下,反向路径转发RPF检查通过,获取组播成员信息,根据组播成员信息进行复制并转发报文。

Description

反向路径检查方法、装置、设备以及存储介质
本申请要求在2018年10月25日提交中国专利局、申请号为201811252570.4的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及但不限于通信网络领域,例如涉及一种反向路径检查方法和装置。
背景技术
随着社会的快速发展以及物质的极大丰富,人们日益追寻更加高效、便捷、舒适的生活,对于生活品质,提出了越来越高的要求。而通信,作为与人们的日常生活、工作息息相关的一个领域,诞生出了多种通信业务需求。
组播技术的提出,有效地解决了点到多点的通信需求,实现了互联网协议(Internet Protocol,IP)网络中点到多点的高效数据的传送,能够有效的节省网络带宽,降低网络负载。通过相关的组播技术,可以实现电话会议、视频会议、交互式网络电视(Internet Protocol Television,IPTV)等应用,使人们的工作生活变得更加便捷、丰富。
而在组播业务中,组播模型必须对组播报文的入向接口进行一定的检查,以保证组播报文都是通过树形拓扑结构下的最短路径到达目的端路由器,同时也要防止环路的形成。为此,提出了反向路径转发(Reverse Path Forwarding,RPF)技术。
RPF技术的核心思想就是在某个组播报文进入本路由器时,本路由器执行RPF检查算法,确认该组播报文是否从预期的入接口进入。如果是从预期的入接口入,则继续转发;如果不是从预期的入接口入,则丢弃该数据包。通过RPF检查,保证了只有从一个入接口入的组播报文会被转发,从其他入接口入的组播报文则会被丢弃。这样,就避免了组播报文形成环路。例如,在设备A上,组播报文从1口入,从2口出,到达B设备后,经复制,又从A设备的3口入,采用RPF技术,就可以实现只有从1口入的组播报文被转发,从其他入接口入的组播报文被丢弃,从而避免了组播环路。
相关的RPF技术均需要先获得一个预期的入接口的查表索引,使用该预期的入接口的查表索引查表获得预期的入接口,将实际的入接口与预期的入接口进行比较,也就是说,均需要查表和比较过程,实现流程的复杂,效率较低。
发明内容
本申请实施例提供了一种反向路径检查方法、装置、设备以及存储介质,能够降低实现反向路径检查流程的复杂度,提升效率。
本申请实施例提供了一种反向路径检查方法,包括:
解析报文并获取接收报文的实际的入接口;
在判断出报文为组播报文的情况下,根据报文的组播源地址、组播组地址和实际的入接口检查组播路由表;
在在组播路由表中命中所述报文的组播源地址、组播组地址和实际的入接口的情况下,反向路径转发RPF检查通过,获取组播成员信息,根据组播成员信息进行复制并转发报文。
本申请实施例提供了一种反向路径检查装置,包括:
获取模块,设置为解析报文并获取接收报文的实际的入接口;
查表模块,设置为在判断出报文为组播报文的情况下,根据报文的组播源地址、组播组地址和实际的入接口检查组播路由表;
处理模块,设置为在在所述组播路由表中命中所述报文的组播源地址、组播组地址和实际的入接口的情况下,反向路径转发RPF检查通过,获取组播成员信息,根据组播成员信息进行复制并转发报文。
本申请实施例提供了一种反向路径检查设备,包括处理器和计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令被所述处理器执行时,实现本申请任意实施例提供的反向路径检查方法。
本申请实施例提供了一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现本申请任意实施例提供的反向路径检查方法。
附图说明
图1为相关技术中一种RPF技术的实现流程图;
图2为相关技术中另一种RPF技术的实现流程图;
图3为本申请实施例提供的一种反向路径检查方法的流程图;
图4为本申请实施例提供的一种反向路径检查装置的结构组成示意图。
具体实施方式
下文中将结合附图对本申请实施例进行说明。。
在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行。并且,虽然在流程图中示出了逻辑顺序,但是在一些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
相关RPF技术有两种实现方案。
第一种,如图1所示,复用单播反向路径转发(Unicast Reverse Path Forwarding,URPF)技术,即报文进入本设备后,解析报文并获取实际的入接口(iif_index),根据目的地址判断报文是否为组播报文,当报文为组播报文时,根据组播源地址和组播组地址检查组播路由表,在组播路由表中命中组播源地址和组播组地址后获取组播成员信息,并通过组播报文中的组播源地址检查单播路由表获得预期的入接口的查表索引,根据预期的入接口的查表索引查表获得预期的入接口,比较实际的入接口和预期的入接口,当实际的入接口和预期的入接口一致时,根据组播成员信息进行复制并转发组播报文;当实际的入接口和预期的入接口不一致时,丢弃组播报文。该方法需要多检查一次单播路由表,浪费了一次查表带宽,且组播流程与单播流程存在交叉,实现较复杂。
第二种,如图2所示,在组播路由表对应的结果表中存放预期的入接口的查表索引。报文进入本设备后,解析报文并获取实际的入接口(iif_index),根据目的地址判断报文是否为组播报文,当报文为组播报文时,根据组播源地址和组播组地址检查组播路由表,在组播路由表中命中组播源地址和组播组地址后从结果表中获取组播成员信息和一个预期的入接口的查表索引,通过该预期的入接口的查表索引查表获得预期的入接口,比较实际的入接口和预期的入接口,当实际的入接口和预期的入接口一致时,根据组播成员信息进行复制并转发组播报文;当实际的入接口和预期的入接口不一致时,丢弃组播报文。较第一种方法,第二种方法少了一次检查单播路由表的过程,效率较高,且单播流程与组播流程之间无交叉,实现流程得到了一定的简化。
上述两种方法均需要先获得一个预期的入接口的查表索引,使用该预期的入接口的查表索引查表获得预期的入接口,将实际的入接口与预期的入接口进行比较,也就是说,均需要查表和比较过程,实现流程的复杂,效率较低。
参见图3,本申请一个实施例提出了一种反向路径检查方法,包括:
步骤3000、解析报文并获取接收报文的实际的入接口。
在本申请实施例中,入接口也称为入端口。
在本申请一个实施例中,可以按照相关技术获取接收报文的实际的入接口。
在本申请另一个实施例中,获取接收报文的实际的入接口包括:判断是否配置了以下至少之一:第一三层接入接口、第二三层接入接口、第三三层接入 接口;根据判断结果确定以下一个为所述实际的入接口:所述第一三层接入接口、所述第二三层接入接口、所述第三三层接入接口。
本实施例中,所述第一三层接入接口通过物理接口获得;所述第二三层接入接口通过物理接口和所述报文携带的虚拟局域网(Virtual Local Area Network,VLAN)标识获得;所述第三三层接入接口通过所述报文携带的VLAN标识获得。
本实施例中,三层接入接口(L3_iif_index,L3 ingress interface index)是设备内部虚拟出的一个逻辑接口。
本实施例中,判断是否配置了第一三层接入接口包括:在入向端口属性表中查找到物理接口对应的第一三层接入接口的情况下,判断出配置了第一三层接入接口;在入向端口属性表中查找不到物理接口对应的第一三层接入接口的情况下,判断出没有配置第一三层接入接口。本实施例中,根据物理接口直接从入向端口属性表中获得第一三层接入接口。
判断是否配置了第二三层接入接口包括:在根据物理接口和VLAN标识检查入向VLAN翻译表,且在在VLAN翻译表中命中物理接口和VLAN标识的情况下,根据结果信息判断是否配置了第二三层接入接口,在结果信息中包含第二三层接入接口的情况下,判断出配置了第二三层接入接口;在结果信息中不包含第二三层接入接口的情况下,判断出没有配置第二三层接入接口。在根据物理接口和VLAN标识检查入向VLAN翻译表,且在在VLAN翻译表中未命中物理接口和VLAN标识的情况下,判断出没有配置第二三层接入接口。本实施例中,在根据物理接口和VLAN标识检查入向VLAN翻译表,且在在VLAN翻译表中命中物理接口和VLAN标识的情况下,从对应的结果信息中获得第二三层接入接口。
判断是否配置了第三三层接入接口包括:在VLAN属性表中查找到VLAN标识对应的第二三层接入接口的情况下,判断出配置了第三三层接入接口;在VLAN属性表中查找不到VLAN标识对应的第二三层接入接口的情况下,判断出没有配置第三三层接入接口。本实施例中,根据VLAN标识直接从VLAN属性表中获得第三三层接入接口。
本实施例中,根据判断结果确定实际的入接口包括以下至少之一:响应于只配置了所述第一三层接入接口、所述第二三层接入接口、所述第三三层接入接口中的一个的判断结果,确定配置的三层接入接口为所述实际的入接口;响应于配置了所述第一三层接入接口、所述第二三层接入接口、所述第三三层接入接口中的至少两个的判断结果,将配置的三层接入接口中优先级最高的三层接入接口作为所述实际的入接口。
本实施例中,三层接入接口的优先级可以预先设置,例如,设置第二三层接入接口的优先级高于第一三层接入接口,第一三层接入接口的优先级高于第三三层接入接口。
步骤3010、在判断出报文为组播报文的情况下,根据报文的组播源地址、组播组地址和实际的入接口检查组播路由表。
在本申请实施例中,可以根据报文的目的媒体访问控制(Media Access Control,MAC)地址和目的IP地址判断报文是否为组播报文,在报文的目的MAC地址为组播MAC地址,目的IP地址为组播IP地址的情况下,确定报文为组播报文;在报文的目的MAC地址不是组播MAC地址,和/或目的IP地址不是组播IP地址的情况下,确定报文不是组播报文。
在本申请实施例中,组播路由表可以是相关技术的组播路由表的基础上增加预期的入接口作为查找键值得到的组播路由表。
在本申请实施例中,可以按照相关技术来检查组播路由表。
步骤3020、在在组播路由表中命中报文的组播源地址、组播组地址和实际的入接口的情况下,反向路径转发RPF检查通过,获取组播成员信息,根据组播成员信息进行复制并转发报文。
在本申请实施例中,在组播路由表中是否命中报文的组播源地址、组播组地址和实际的入接口可以与相关技术类似,本文不再赘述。
在本申请另一个实施例中,在在所述组播路由表中未命中报文的组播源地址、组播组地址和实际的入接口的情况下,该方法还包括:丢弃所述报文。
在本申请另一个实施例中,该方法之前还包括:配置所述组播路由表,所述组播路由表的查找键值包括:组播源地址、组播组地址和预期的入接口。
在本申请另一个实施例中,该方法之前还包括:初始化相关配置,如设备的上电初始化,默认配置的下发。
在本申请实施例中,设备配置好以后,可以通过仪表构造组播报文并发送给设备,设备接收到报文,按照上述方法实现转发,从而测试设备的RPF检查功能。
在本申请实施例中,在一个表中命中信息的含义是在该表中查找到该信息。
本申请实施例将预期的入接口直接作为组播路由表的查找键值,因此在查找组播路由表,并在组播路由表中命中报文的组播源地址、组播组地址和实际的入接口时RPF检查通过,而不需要额外的查表过程和比较过程,降低了实现流程的复杂度,提升了效率。
参见图4,本申请另一个实施例提出了一种反向路径检查装置,包括:获取模块401,设置为解析报文并获取接收报文的实际的入接口;查表模块402,设置为在判断出报文为组播报文的情况下,根据报文的组播源地址、组播组地址和实际的入接口检查组播路由表;处理模块403,设置为在在组播路由表中命中报文的组播源地址、组播组地址和实际的入接口的情况下,反向路径转发RPF检查通过,获取组播成员信息,根据组播成员信息进行复制并转发报文。
在本申请实施例中,入接口也称为入端口。
在本申请一个实施例中,获取模块401可以按照相关技术获取报文的实际的入接口。
在本申请另一个实施例中,获取模块401是设置为通过以下方式获取接收报文的实际的入接口:判断是否配置了以下至少之一:第一三层接入接口、第二三层接入接口、第三三层接入接口;根据判断结果确定以下一个为所述实际的入接口:所述第一三层接入接口、所述第二三层接入接口、所述第三三层接入接口;其中,所述第一三层接入接口通过物理接口获得;所述第二三层接入接口通过物理接口和所述报文携带的VLAN标识获得;所述第三三层接入接口通过所述报文携带的VLAN标识获得。
本实施例中,三层接入接口(L3_iif_index,L3 ingress interface index)是设备内部虚拟出的一个逻辑接口。
本实施例中,获取模块401是设置为通过以下方式判断是否配置了第一三层接入接口:在入向端口属性表中查找到物理接口对应的第一三层接入接口的情况下,判断出配置了第一三层接入接口;在入向端口属性表中查找不到物理接口对应的第一三层接入接口的情况下,判断出没有配置第一三层接入接口。本实施例中,根据物理接口直接从入向端口属性表中获得第一三层接入接口。
获取模块401是设置为通过以下方式判断是否配置了第二三层接入接口:在根据物理接口和VLAN标识检查入向VLAN翻译表命中的情况下,根据结果信息判断是否配置了第二三层接入接口,在结果信息中包含第二三层接入接口的情况下,判断出配置了第二三层接入接口;在结果信息中不包含第二三层接入接口的情况下,判断出没有配置第二三层接入接口。在根据物理接口和VLAN标识查入向VLAN翻译表未命中的情况下,判断出没有配置第二三层接入接口。本实施例中,根据物理接口和VLAN标识检查入向VLAN翻译表命中时从对应的结果信息中获得第二三层接入接口。
获取模块401是设置为通过以下方式判断是否配置了第三三层接入接口:在VLAN属性表中查找到VLAN标识对应的第二三层接入接口的情况下,判断 出配置了第三三层接入接口;在VLAN属性表中查找不到VLAN标识对应的第二三层接入接口的情况下,判断出没有配置第三三层接入接口。本实施例中,根据VLAN标识直接从VLAN属性表中获得第三三层接入接口。
本实施例中,获取模块401是设置为通过以下至少之一方式根据判断结果确定实际的入接口:响应于只配置了所述第一三层接入接口、所述第二三层接入接口、所述第三三层接入接口中的一个的判断结果,确定配置的三层接入接口为所述实际的入接口;响应于配置了所述第一三层接入接口、所述第二三层接入接口、所述第三三层接入接口中的至少两个的判断结果,将配置的三层接入接口中优先级最高的三层接入接口作为所述实际的入接口。
本实施例中,三层接入接口的优先级可以预先设置,例如,设置第二三层接入接口的优先级高于第一三层接入接口,第一三层接入接口的优先级高于第三三层接入接口。
在本申请实施例中,查表模块402可以根据报文的目的MAC地址和目的IP地址判断报文是否为组播报文,在报文的目的MAC地址为组播MAC地址,目的IP地址为组播IP地址的情况下,确定报文为组播报文;在报文的目的MAC地址不是组播MAC地址,和/或目的IP地址不是组播IP地址的情况下,确定报文不是组播报文。
在本申请另一个实施例中,处理模块403还设置为:在在所述组播路由表中未命中报文的组播源地址、组播组地址和实际的入接口的情况下,丢弃所述报文。
在本申请另一个实施例中,还包括:配置模块404,设置为配置所述组播路由表,所述组播路由表的查找键值包括:组播源地址、组播组地址和预期的入接口。
在本申请另一个实施例中,配置模块404还设置为:初始化相关配置,如设备的上电初始化,默认配置的下发。
在本申请实施例中,设备配置好以后,可以通过仪表构造组播报文并发送给设备,设备接收到报文,按照上述方法实现转发,从而测试设备的RPF检查功能。
本申请实施例将预期的入接口直接作为组播路由表的查找键值,因此在查找组播路由表命中时RPF检查通过,而不需要额外的查表过程和比较过程,降低了实现流程的复杂度,提升了效率。
本申请另一个实施例提出了一种反向路径检查设备,包括处理器和计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令被所述处 理器执行时,实现上述任一种反向路径检查方法。
本申请另一个实施例提出了一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现上述任一种反向路径检查方法。
上文中所公开方法中的全部或一些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由一些物理组件合作执行。一些组件或所有组件可以被实施为由处理器,如数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于随机存取存储器(Random Access Memory,RAM)、只读存储器(Read-Only Memory,ROM)、带电可擦可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、闪存或其他存储器技术、光盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、数字多功能盘(Digital Video Disc,DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以设置为存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。

Claims (8)

  1. 一种反向路径检查方法,包括:
    解析报文并获取接收所述报文的实际的入接口;
    在判断出所述报文为组播报文的情况下,根据所述报文的组播源地址、组播组地址和所述实际的入接口检查组播路由表;
    在在所述组播路由表中命中所述报文的组播源地址、组播组地址和所述实际的入接口的情况下,反向路径转发RPF检查通过,获取组播成员信息,根据所述组播成员信息进行复制并转发所述报文。
  2. 根据权利要求1所述的方法,在在所述组播路由表中未命中所述报文的组播源地址、组播组地址和所述实际的入接口的情况下,还包括:丢弃所述报文。
  3. 根据权利要求1或2所述的方法,还包括:配置所述组播路由表,所述组播路由表的查找键值包括:组播源地址、组播组地址和预期的入接口。
  4. 根据权利要求1-3任一项所述的方法,其中,所述获取接收所述报文的实际的入接口包括:
    判断是否配置了以下至少之一:第一三层接入接口、第二三层接入接口、以及第三三层接入接口;
    根据判断结果确定以下一个为接收所述报文的实际的入接口:所述第一三层接入接口、所述第二三层接入接口、以及所述第三三层接入接口;
    其中,所述第一三层接入接口通过物理接口获得;所述第二三层接入接口通过物理接口和所述报文携带的虚拟局域网VLAN标识获得;所述第三三层接入接口通过所述报文携带的VLAN标识获得。
  5. 根据权利要求4所述的方法,其中,根据判断结果确定接收所述报文的实际的入接口包括以下至少之一:
    响应于只配置了所述第一三层接入接口、所述第二三层接入接口、所述第三三层接入接口中的一个的判断结果,确定配置的三层接入接口为所述报文的实际的入接口;
    响应于配置了所述第一三层接入接口、所述第二三层接入接口、所述第三三层接入接口中的至少两个的判断结果,将配置的至少两个三层接入接口中优先级最高的三层接入接口作为接收所述报文的实际的入接口。
  6. 一种反向路径检查装置,包括:
    获取模块,设置为解析报文并获取接收所述报文的实际的入接口;
    查表模块,设置为在所述判断出报文为组播报文的情况下,根据所述报文的组播源地址、组播组地址和所述实际的入接口检查组播路由表;
    处理模块,设置为在在所述组播路由表中命中所述报文的组播源地址、组播组地址和所述实际的入接口的情况下,反向路径转发RPF检查通过,获取组播成员信息,根据所述组播成员信息进行复制并转发所述报文。
  7. 一种反向路径检查设备,包括处理器和计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令被所述处理器执行时,实现如权利要求1-5任一项所述的反向路径检查方法。
  8. 一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1-5任一项所述的反向路径检查方法。
PCT/CN2019/111808 2018-10-25 2019-10-18 反向路径检查方法、装置、设备以及存储介质 WO2020083095A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811252570.4 2018-10-25
CN201811252570.4A CN111107008A (zh) 2018-10-25 2018-10-25 一种反向路径检查方法和装置

Publications (1)

Publication Number Publication Date
WO2020083095A1 true WO2020083095A1 (zh) 2020-04-30

Family

ID=70331846

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/111808 WO2020083095A1 (zh) 2018-10-25 2019-10-18 反向路径检查方法、装置、设备以及存储介质

Country Status (2)

Country Link
CN (1) CN111107008A (zh)
WO (1) WO2020083095A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113992565A (zh) * 2021-09-29 2022-01-28 新华三大数据技术有限公司 一种组播报文处理方法及装置

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113660667B (zh) * 2021-10-18 2021-12-28 四川浮舟科技有限责任公司 一种用于运营商网络的非法劫持快速监测方法及系统
CN115567436A (zh) * 2022-08-17 2023-01-03 北京东土军悦科技有限公司 组播报文的处理方法、系统、计算机设备和可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7289505B2 (en) * 2002-06-04 2007-10-30 Lucent Technologies Inc. Efficient reverse path forwarding check mechanism
CN101163103A (zh) * 2007-11-07 2008-04-16 孙先花 一种实现快速重路由的方法
CN101986601A (zh) * 2010-11-23 2011-03-16 杭州华三通信技术有限公司 一种组播数据的传输方法和设备
CN102457386A (zh) * 2010-10-25 2012-05-16 杭州华三通信技术有限公司 一种通信设备的双向pim中组播报文转发方法和通信设备

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100486207C (zh) * 2003-12-26 2009-05-06 华为技术有限公司 三层交换中ip组播精确端口转发的方法
CN101478477A (zh) * 2008-12-01 2009-07-08 北京星网锐捷网络技术有限公司 一种组播报文转发方法及装置
CN102064999B (zh) * 2009-11-18 2013-04-03 杭州华三通信技术有限公司 实现组播报文转发的方法和组播报文转发设备
CN102916893B (zh) * 2012-11-14 2015-06-03 迈普通信技术股份有限公司 三层交换机中设置ip组播转发端口的装置和方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7289505B2 (en) * 2002-06-04 2007-10-30 Lucent Technologies Inc. Efficient reverse path forwarding check mechanism
CN101163103A (zh) * 2007-11-07 2008-04-16 孙先花 一种实现快速重路由的方法
CN102457386A (zh) * 2010-10-25 2012-05-16 杭州华三通信技术有限公司 一种通信设备的双向pim中组播报文转发方法和通信设备
CN101986601A (zh) * 2010-11-23 2011-03-16 杭州华三通信技术有限公司 一种组播数据的传输方法和设备

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113992565A (zh) * 2021-09-29 2022-01-28 新华三大数据技术有限公司 一种组播报文处理方法及装置
CN113992565B (zh) * 2021-09-29 2023-11-07 新华三大数据技术有限公司 一种组播报文处理方法及装置

Also Published As

Publication number Publication date
CN111107008A (zh) 2020-05-05

Similar Documents

Publication Publication Date Title
US11601296B2 (en) Bit indexed explicit replication for layer 2 networking
US11206148B2 (en) Bit indexed explicit replication
US7590116B2 (en) Method for forwarding multicast message in network communication
EP2622805B1 (en) Method for pruning a multicast branch, protocol independent multicast router, and layer-2 exchange
WO2020083095A1 (zh) 反向路径检查方法、装置、设备以及存储介质
JP5752243B2 (ja) パケットを処理および/または転送するための方法および装置
US7933268B1 (en) IP multicast forwarding in MAC bridges
EP1942617B1 (en) Method, device and system for Ethernet-supported Source Specific Multicast forwarding
US10187293B2 (en) Apparatus and method for multicast data packet forwarding
CN110647698B (zh) 页面加载方法、装置、电子设备及可读存储介质
CN106685827B (zh) 一种下行报文的转发方法及ap设备
WO2009132568A1 (zh) 服务质量控制方法及网络设备
WO2020173340A1 (zh) 基于bier的双向转发检测会话创建方法及bfir、bfer、系统和存储介质
US7940765B2 (en) Limiting unauthorized sources in a multicast distribution tree
US7327730B2 (en) Data packet transmission method and network switch applying same thereto
WO2016197999A1 (zh) 一种bier边界节点标识方法和装置
RU2642812C2 (ru) Способ и устройство переадресации сообщений
CN109218191B (zh) 使群播封包得以穿越非群播网络的系统及方法
US9008091B1 (en) Methods, systems, and computer readable media for improved multicast scaling through policy based redirection
CN109067673B (zh) 堆叠系统中mac地址学习的方法及系统
CN110557411A (zh) 基于视联网的视频流处理方法及装置
WO2012016471A1 (zh) 一种拓扑收敛方法和服务提供商边缘设备
CN106059935B (zh) 未知组播报文的处理方法和装置
US9577930B2 (en) Method for determining multicast path, method for receiving data packet, and router
WO2024045599A1 (zh) 报文匹配方法、计算机设备和计算机可读存储介质

Legal Events

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

Ref document number: 19876100

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19876100

Country of ref document: EP

Kind code of ref document: A1