WO2017129011A1 - 一种报文处理方法以及网络设备 - Google Patents

一种报文处理方法以及网络设备 Download PDF

Info

Publication number
WO2017129011A1
WO2017129011A1 PCT/CN2017/071514 CN2017071514W WO2017129011A1 WO 2017129011 A1 WO2017129011 A1 WO 2017129011A1 CN 2017071514 W CN2017071514 W CN 2017071514W WO 2017129011 A1 WO2017129011 A1 WO 2017129011A1
Authority
WO
WIPO (PCT)
Prior art keywords
packet
address
network device
destination
routing entry
Prior art date
Application number
PCT/CN2017/071514
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 WO2017129011A1 publication Critical patent/WO2017129011A1/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/28Routing or path finding of packets in data switching networks using route fault recovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/20Hop count for routing purposes, e.g. TTL

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a packet processing method and a network device.
  • packet transmission loops may occur due to incorrect router configuration.
  • the network device 1 forwards the packet to the network device 6, the network device 2, the network device 3, the network device 4, and the network device 5 form a packet transmission loop, and the packet is forwarded by the network device 2.
  • the network device 4 it is forwarded by the network device 4 to the network device 5, then forwarded from the network device 5 to the network device 3, and finally forwarded by the network device 3 to the network device 2.
  • the packet is cyclically forwarded in the packet transmission loop until the time-to-live (English full name: Time To Live, TTL) of the packet is reduced to 0 or 1, and the packet is discarded.
  • TTL Time To Live
  • the packets that are cyclically forwarded in the routing loop occupy a large amount of network bandwidth and cannot be forwarded to the destination device. This affects the forwarding of other normal packets.
  • the embodiment of the invention provides a packet processing method and a network device, which are used to determine whether a routing loop exists in a packet transmission path.
  • the first aspect of the present invention provides a packet processing method.
  • the network device When the first packet received by the network device satisfies certain conditions, that is, the destination Internet protocol of the first packet that is parsed (English full name: Internet Protocol)
  • the English abbreviation: IP address is not the same as the IP address of the network device.
  • the network device pre-determines that there may be a routing loop in the packet transmission path.
  • the first packet described herein may be a packet or a plurality of packets.
  • the network device may generate a destination IP address and the purpose of the first packet.
  • the second packet with the same IP address, and the second packet is sent.
  • the network device confirms that there is a routing loop in the packet transmission path. .
  • a method for determining whether a routing loop exists in a packet transmission path is provided by the network device in the embodiment of the present invention.
  • the network device may further determine whether the TTL value of the first packet is 1 or not. If the TTL value of the packet is 1, the second packet is generated according to the destination IP address of the first packet, that is, the second packet with the same destination IP address as the first packet is generated.
  • the network The network device may further determine whether the TTL value of the first packet is 1.
  • the TTL value of the first packet is 1, the second packet is generated according to the destination IP address of the first packet, and the foregoing embodiment.
  • the TTL value of the first packet is determined to be 1, the second packet with the same destination IP address as the first packet is generated according to the destination IP address of the first packet.
  • the final network device can more accurately determine whether there is a routing loop in the packet transmission path.
  • the network device may further determine whether the transmission rate of the first packet reaches a preset value. If the transmission rate of the first packet is greater than or equal to the preset value, the first packet may be a TTL.
  • a malicious attack packet with a lower value or a special protocol packet, such as a packet under the multicast protocol.
  • the network device does not generate the second packet according to the destination IP address of the first packet, but may choose to discard the first packet or not process the packet, which is not limited herein to reduce the network.
  • the working load of the device if the network device determines that the transmission rate of the first packet is less than the preset value, the second packet is further generated according to the destination IP address of the first packet.
  • the network device may also generate a blackhole routing entry with the same destination IP address as the destination IP address of the first packet.
  • a packet matching the blackhole routing entry when the network device determines that there is a routing loop in the packet transmission path, the packet that is cyclically forwarded in the routing loop cannot be forwarded to the destination device normally due to the existence of the routing loop, and the network is easily formed.
  • a storm can occupy a large amount of bandwidth resources and affect other services.
  • the network device can generate a blackhole routing entry with the same destination IP address as the destination IP address of the first packet.
  • a packet of a blackhole routing entry can effectively prevent packets from being cyclically forwarded in the routing loop, effectively avoiding the formation of network storms and occupying a large amount of bandwidth resources.
  • the network device after the network device generates the black hole routing entry, the network device starts a timer; if the timer reaches a preset duration, the network device deletes the black hole routing entry.
  • the black hole routing entry After the black hole routing entry is generated by the network device, the black hole routing entry needs to be timed out, that is, there is a certain life cycle. After the preset time length is reached, the network device deletes the black hole routing entry to recover.
  • the normal service is used to prevent packets with the same destination IP address and the destination IP address of the blackhole routing entry from being discarded by the network device when there is no routing loop.
  • the second packet may be a control packet protocol ICMP packet.
  • the second packet may be an ICMP packet, or may be other packet types in the existing network protocol, and may have various options in practical applications, thereby increasing the diversity of the scheme.
  • an embodiment of the present invention provides a network device, where the network device has a function to implement network device design in the foregoing method design.
  • the functions may be implemented by hardware or by corresponding software implemented by hardware.
  • the hardware or software includes one or more modules corresponding to the functions described above.
  • the modules can be software and/or hardware.
  • the network device may specifically include a receiving module, a processing module, a sending module, and a processing module.
  • the receiving module is configured to receive the first packet
  • the processing module is configured to parse the first packet received by the receiving module to obtain a destination IP address of the first packet, where the destination IP address of the first packet is If the IP address of the network device is different, the second packet is generated according to the destination IP address of the first packet, and the destination IP address of the second packet is the same as the destination IP address of the first packet.
  • the second packet, the processing module is further configured to confirm that a routing loop exists if the network device receives the second packet within the preset time.
  • the network device includes a receiver, a processor, and a transmitter for receiving the first message.
  • the processor is configured to parse the first packet received by the receiving module to obtain a destination IP address of the first packet. If the destination IP address of the first packet is different from the IP address of the network device, the first packet is obtained according to the first packet.
  • the destination IP address of the text generates a second packet, and the destination IP address of the second packet is the same as the destination IP address of the first packet.
  • the transmitter is configured to send a second packet according to the destination IP address of the second packet, where the processor is further configured to: if the network device receives the second packet within the preset time, confirm that the routing loop exists .
  • an embodiment of the present invention provides a computer storage medium, where the program storage code stores program code, and the program code is used to indicate that the method of the first aspect is performed.
  • the present invention can obtain the destination IP address of the first packet by using the network device to parse the received first packet. If the destination IP address of the first packet is different from the IP address of the network device, and the first packet is If the transmission rate is greater than or equal to the preset value, the network device may generate a second packet with the same destination IP address as the destination IP address of the first packet, and send the second packet according to the destination IP address of the second packet. If the network device receives the second packet within the preset time, it confirms that there is a routing loop, that is, a method for determining whether a routing loop exists in the packet transmission path.
  • Figure 1 is a schematic diagram of a routing loop
  • FIG. 2 is a schematic diagram of an embodiment of a packet processing method according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of an application scenario in an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a routing loop of an application scenario in an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of an embodiment of a network device according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of another embodiment of a network device according to an embodiment of the present invention.
  • the embodiment of the invention provides a packet processing method and a network device, and provides a method for determining whether a routing loop exists in a packet transmission path.
  • the packets in the transmission path are cyclically forwarded in the routing loop until the TTL value of the packet is reduced to 0. If the network device in the packet transmission path, such as the router, discards the packet, the method in the prior art does not effectively detect the existence of a routing loop in the packet transmission path.
  • the network may determine the routing loop problem in the transmission path of the packet by using the characteristics of the received packet, and then generate a probe packet to determine whether there is a routing loop in the packet transmission path.
  • an embodiment of a packet processing method according to an embodiment of the present invention includes:
  • the network device receives the first packet.
  • the network device can receive the first packet, and the network device can be a network device such as a router or a switch, and the first packet can be a packet or multiple packets.
  • the first message in the embodiment of the present invention refers to a message.
  • the network device parses the first packet to obtain a destination IP address of the first packet.
  • the network device may parse the first packet to obtain a destination IP address of the first packet.
  • the network device If the destination IP address of the first packet is different from the IP address of the network device, the network device generates the second packet according to the destination IP address of the first packet, and the destination IP address of the second packet is the first packet.
  • the destination IP address of the text is the same;
  • the embodiment of the present invention after the network device parses the destination IP address of the first packet, the embodiment of the present invention further includes:
  • the network device determines whether the destination IP address of the first packet is the same as the IP address of the network device itself.
  • the network device may generate a second packet according to the destination IP address of the first packet, where the destination IP address of the second packet is the first packet.
  • the destination IP address of the text is the same.
  • the network device when the destination IP address of the first packet is different from the IP address of the network device, the network device The TTL value of the first packet is further determined to be 1.
  • the network device When the TTL value of the first packet is 1, the network device generates the second packet according to the destination IP address of the first packet. That is, when the TTL value of the first packet is 1, and the destination IP address of the first packet is different from the IP address of the network device, the first packet cannot reach the device pointed to by the destination IP address of the first packet. It is more certain that there may be a routing loop in the message transmission path.
  • the network device may further determine whether the transmission rate of the first packet is greater than or equal to a preset. The value, if no, the network device generates the second packet according to the destination IP address of the first packet.
  • the preset value may be set according to the empirical data. If the transmission rate of the first packet is greater than or equal to the preset value, the first packet may be a malicious attack packet with a low TTL value or some special packet.
  • the network device does not generate the second packet according to the destination IP address of the first packet, but may discard the first packet or not process the packet to reduce the workload of the network device.
  • the step generates the second packet according to the destination IP address of the first packet.
  • the format of the second packet generated by the network device according to the destination IP address of the first packet may be a customized packet format, or may be a packet of an existing protocol, such as a transmission control protocol/Internet.
  • Interconnection protocol English full name: Transmission Control Protocol/Internet Protocol, English abbreviation: TCP/IP
  • user datagram protocol English full name: User Datagram Protocol, English abbreviation: UDP
  • the network device sends the second packet according to the destination IP address of the second packet.
  • the network device may send the second packet according to the transmission path indicated by the destination IP address of the second packet. Message.
  • the network device receives the second packet within the preset time, determine that a routing loop exists.
  • the network device after the network device sends the second packet according to the destination IP address of the second packet, if the network device can receive the second packet within the preset time, the second packet is confirmed. There is a routing loop in the transmission path. It can be understood that the specific duration of the preset time is not limited in the embodiment of the present invention, and may be selected according to actual application conditions.
  • the network device generates a blackhole routing entry, and the destination IP address of the blackhole routing entry is the same as the destination IP address of the first packet.
  • the network device can generate a blackhole routing entry with the same destination IP address as the destination IP address of the first packet.
  • the network device discards the packet that matches the blackhole routing entry.
  • the network device after the network device generates the blackhole routing entry with the same destination IP address as the destination IP address of the first packet, the network device discards the packet matching the blackhole routing entry, that is, discards the destination IP address and A blackhole routing entry has the same IP address. This prevents the packets from being circulated and forwarded due to routing loops. This prevents network storms caused by routing loops.
  • the network device starts a timer. If the timer reaches a preset duration, the network device deletes the blackhole routing entry.
  • the blackhole routing entry needs to be aged within a specified time, that is, the network device starts a timer, and when the timer reaches a preset duration, for example, 5 minutes, the network The device deletes the black hole routing entry, wherein the embodiment of the present invention does not set any specific duration of the preset duration. It should be noted that, in actual applications, the network device may generate the timer before the timer reaches the preset duration. The second second packet is used to determine whether there is a routing loop. If it is determined that the routing loop still exists, the network device continues to save the blackhole routing entry before the timer reaches the preset duration. The network device can delete the black hole routing entry in advance.
  • the black hole routing entry may be manually deleted by means of manual intervention, which is not limited herein.
  • the network device can parse the received first packet to obtain the destination IP address of the first packet. If the destination IP address of the first packet is different from the IP address of the network device, If the transmission rate of the first packet is greater than or equal to the preset value, the network device may generate a second packet whose destination IP address is the same as the destination IP address of the first packet, and according to the destination IP address of the second packet. Sending the second packet, if the network device receives the second packet within the preset time, it confirms that there is a routing loop, that is, provides a certain packet transmission.
  • a method of routing a loop exists in the path, and after determining that the routing loop exists, a black hole routing entry may be generated, so that the network device discards the packet that is cyclically forwarded in the routing loop, which can effectively Packets are forwarded cyclically in the routing loop, which affects the normal transmission of packets.
  • FIG. 3 For the above embodiment, for the sake of easy understanding, the network topology scenario shown in FIG. 3 is used as an example, as shown in FIG. 3:
  • Router A is connected to device 1 on the network segment 190.2.0.0 through interface E0, and is connected to device 2 on the network segment 190.3.0.0 through interface S0.
  • Router B is connected to the network segment 190.3.0.0 through interface S1, and through interface E1 and network segment 190.4. .0.0 network segment connection.
  • the IP address of device 1 is 190.2.0.3, which is under the network segment 190.2.0.0.
  • the IP address of device 2 is 190.4.0.2, which is under the network segment 190.4.0.0.
  • the device 1 and the device 2 are in different network segments.
  • the router A receives the packet sent by the device 1 through the E0 interface, and sends the packet through the S0 port.
  • Router B forwards the packet, and Router B receives the packet forwarded by Router A through the S1 interface, and then forwards the packet to Device 2 through the E1 interface. That is, the packet sent by Device 1 to Device 2 needs to be forwarded through Router A and Router B.
  • the details of the Layer 3 packet forwarding are specific to the prior art and are not described here.
  • the network device is used as the router A as an example.
  • the router A can receive the packet sent to the router A. After receiving the packet, the router A can parse the packet from the packet header of the packet. The destination IP address and the TTL value. If the destination IP address of the packet is 190.4.0.2, the destination IP address of the packet (that is, 190.4.0.2) is different from the IP address of the router A itself.
  • the TTL value of the packet is 1, indicating that the packet cannot reach the network segment 190.4.0.0 before the TTL value is exhausted, that is, the device 2 pointed to by the destination IP address 190.4.0.2 of the packet cannot be reached, and finally stays at the router A.
  • the network device can further determine whether the transmission rate of the packet is greater than or equal to a certain transmission rate. If yes, the packet may be a special protocol packet with a very short TTL value, such as a multicast protocol. The TTL value is already 1 when the packet is received on the network device. In this case, the router does not determine whether the route has a routing loop. In this case, the network device can choose to discard the packet or not. Packets do anything. When the transmission rate of the packet is less than the preset value, Router A pre-determines that there may be a routing loop in the packet transmission path, and the packet cannot reach the device 2. In this case, Router A generates a destination IP address.
  • the packet may be a special protocol packet with a very short TTL value, such as a multicast protocol.
  • the TTL value is already 1 when the packet is received on the network device. In this case, the router does not determine whether the route has a routing loop. In this case, the network device can choose to discard the packet or not. Pack
  • the ICMP probe packet of the Internet Control Message Protocol of 190.4.0.2 that is, the destination IP address of the ICMP probe packet is the same as the destination IP address of the packet, and the ICMP probe is sent according to the destination IP address of the ICMP probe packet. If the packet receives the ICMP probe packet sent by the router, the router A determines that there is a routing loop between Router A and Router B. That is, the ICMP probe packet of Router A cannot reach the router through Router B. The device 2 of the destination IP address of the ICMP probe packet is located in the transmission path of the packet with the destination IP address of 190.4.0.2. The packet is looped between the router A and the router B. As shown in Figure 4. The reason for the routing loop may be that the network segment directly connected to the router is faulty, or the configuration of the routing table information of the router is incorrectly configured.
  • a blackhole routing entry is generated in the routing table of Router A, as shown in Table 1 below.
  • the routing table information shown in Table 1 above is only a part of the routing information of the router A. Only the key information related to the present invention is listed here, and the rest of the content is not described herein.
  • the black hole routing entry may be updated to the existing routing table in the router A, or may be the routing table reset in the router A, which is not limited herein.
  • Router A when Router A receives the packet with the destination IP address of 190.4.0.2, the destination IP address of the packet matches the destination IP address 190.4.0.2 in Table 1, and the outbound interface is NULL empty. If the packet is not forwarded, Router A will discard the packet with the destination IP address of 190.4.0.2. Therefore, the packets whose destination IP address is 190.4.0.2 are continuously cyclically forwarded, and the routing loops that occur due to the cyclic forwarding of the packets are eliminated.
  • the blackhole routing entry needs to be timed out and has a lifetime (for example, 5 minutes).
  • Router A deletes the blackhole routing entry and generates a second destination IP address of 190.4.
  • the detection packet of .0.2 is sent, and if the packet is received, the router A receives the probe packet, indicating that there is still a routing loop between the routers A and B. If the router does not receive the probe packet within the preset time, the routing table configuration information between the routers A and B is restored. The probe packet is not generated on the router A. And the cyclic forwarding between the Bs. In this case, the router A does not generate the blackhole routing entries to restore the normal service, and the packets sent to the device 2 are discarded by the router A, which affects the normal operation of other services.
  • the router A can directly generate the second probe packet with the destination IP address of 190.4.0.2 within the lifetime of the blackhole route, that is, within 5 minutes.
  • the probe packet is received, indicating that there is still a routing loop between the routers A and B.
  • the blackhole routing entry as shown in Table 1 above is maintained. If the probe does not receive the probe within the preset time.
  • the packet indicates that the routing table configuration information between the routers A and B has been restored.
  • the detection packet is not forwarded between the routers A and B. In this case, the router A deletes the blackhole routing entries in advance. In order to restore normal services, packets sent to device 2 are discarded by router A, which affects the normal operation of other services.
  • a packet processing method in the embodiment of the present invention is described above.
  • the network device in the embodiment of the present invention is described below.
  • an embodiment of the network device of the present invention includes: a receiving module 501, a processing module 502, and a sending module 503.
  • the receiving module 501 is configured to receive the first packet.
  • the processing module 502 is configured to parse the first packet received by the receiving module 501 to obtain a destination IP address of the first packet, and determine whether the destination IP address of the first packet is the same as the IP address of the network device itself. If the destination IP address of the first packet is different from the IP address of the network packet, the second packet is generated according to the destination IP address of the first packet, and the destination IP address of the second packet and the destination IP address of the first packet. the same;
  • the sending module 503 is configured to send the second packet according to the destination IP address of the second packet.
  • the processing module 502 is configured to determine that a routing loop exists if the network device receives the second packet within the preset time.
  • the processing module 502 is further configured to determine whether the TTL value of the first packet is 1, when the first packet is used. When the TTL value of the text is 1, the second packet is generated according to the destination IP address of the first packet.
  • the processing module is further configured to determine whether the transmission rate of the first packet is greater than or equal to a preset value, when the first When the transmission rate of the packet is less than the preset value, the second packet is generated according to the destination IP address of the first packet.
  • the processing module 502 is further configured to generate a black hole routing entry, the destination IP address of the black hole routing entry and the first packet.
  • the destination IP address is the same, and the packets matching the blackhole routing entry are discarded.
  • the processing module 502 is further configured to delete the black hole routing entry.
  • the network device in the embodiment of the present invention is described above from the perspective of a modular functional entity. The following describes the network device in the embodiment of the present invention from the perspective of hardware processing.
  • a network provided by the embodiment of the present invention is provided.
  • the network device 600 may have a large difference due to different configurations or performances, such as the physical device receiver 601 corresponding to the receiving module 501 in the foregoing embodiment, and may further include one or more of the foregoing processing modules 502.
  • Corresponding physical device processor 602 eg, one or more processors
  • physical device transmitter 603 and memory 604 corresponding to transmitting module 503, one or more data 605 or storage medium 607 storing program code 606 (eg, one Or a storage device in Shanghai).
  • the memory 604 and the storage medium 607 may be short-term storage or persistent storage.
  • the program stored on storage medium 607 may include one or more modules (not shown), each of which may include a series of instruction operations in network device 600.
  • the processor 602 can be configured to communicate with the storage medium 607 to perform a series of instruction operations in the storage medium 607 on the network device 600.
  • the memory 604 and the storage medium 607 can also be implemented using the same storage device.
  • storage medium 607 can store operating system 608, data 605, and program code 606.
  • Network device 600 may also include one or more power sources, one or more operating systems 608.
  • the steps performed by the network device in this embodiment may be based on the structure of the network device shown in FIG. 6.
  • the steps performed by the network device in this embodiment may be based on the structure of the network device shown in FIG. 6.
  • the steps performed by the network device in this embodiment may be based on the structure of the network device shown in FIG. 6.
  • the processor involved in the foregoing device embodiment may be a central processing unit (English name: central processing unit, English abbreviation: CPU), a network processor (English full name: network processor, English abbreviation: NP) or A combination of CPU and NP.
  • the processor may further include a hardware chip, which may be an application-specific integrated circuit (English name: ASIC), a programmable logic device (English full name: programmable logic device, English abbreviation: PLD) or combination.
  • the PLD can be a complex programmable logic device (English full name: complex programmable logic device, English abbreviation: CPLD), field programmable logic gate array (English full name: field-programmable gate array, English abbreviation: FPGA), general array logic ( The full name of the English: general array logic (English abbreviation: GAL) or any combination thereof is not limited in the present invention.
  • CPLD complex programmable logic device
  • FPGA field programmable logic gate array
  • GAL general array logic
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium may be at least one of the following: a USB flash drive, a mobile hard disk, a read-only memory (English full name: Read-Only Memory, English abbreviation: ROM), and a random access memory (English full name: Random Access Memory, English referred to as RAM), disk or optical disk, and other media that can store program code.
  • the foregoing memory may be at least one of the following: a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
  • the medium of the program code is not limited to, a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.

Landscapes

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

Abstract

本发明实施例公开了一种报文处理方法,用于确定报文传输路径中是否存在路由环路。本发明实施例方法包括:网络设备接收第一报文;网络设备对第一报文进行解析得到第一报文的目的IP地址;若第一报文的目的IP地址与网络设备的IP地址不相同,则网络设备根据第一报文的目的IP地址生成第二报文,第二报文的目的IP地址与第一报文的目的IP地址相同;网络设备根据第二报文的目的IP地址发送第二报文;若网络设备在预置时间内接收到第二报文,则确定存在路由环路。本发明实施例还公开了一种网络设备,用于确定报文传输路径中是否存在路由环路。

Description

一种报文处理方法以及网络设备
本申请要求于2016年01月29日提交中国专利局、申请号为201610066882.0、发明名称为“一种报文处理方法以及网络设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及通信技术领域,尤其涉及一种报文处理方法以及网络设备。
背景技术
在网路部署过程中,由于路由器配置错误等原因,可能会产生报文传输环路。如图1所示,当网络设备1向网络设备6转发报文时,由于网络设备2、网络设备3、网络设备4和网络设备5形成一个报文传输环路,报文由网络设备2转发至网络设备4,再由网络设备4转发至网络设备5,再从网络设备5转发至网络设备3,最后由网络设备3转发至网络设备2。在该报文传输环路中循环转发所述报文,直至该报文的生存时间(英文全称:Time To Live,英文简称:TTL)减到0或1时,才会丢弃该报文。在这种情况下,在路由环路中循环转发的报文大量占用网络带宽而不能被正常转发至目的设备,还会影响其他正常报文的转发。但是,目前现有技术中并没有能够有效的检测到报文传输路径存在路由环路的方法。
发明内容
本发明实施例提供了一种报文处理方法以及网络设备,用于确定报文传输路径中是否存在路由环路。
有鉴于此,本发明实施例提供如下技术方案:
本发明实施例第一方面提供了一种报文处理方法,当网络设备接收到的第一报文满足一定条件时,即当解析得到的第一报文的目的互联网协议(英文全称:Internet Protocol,英文简称:IP)地址与网络设备的IP地址不相同,此时网络设备预判断报文传输路径中可能存在路由环路。需要说明的是,这里描述的第一报文可以指一个报文的情况,也可以指多个报文的情况,此时,网络设备可以通过生成一个目的IP地址与上述第一报文的目的IP地址相同的第二报文,并下发该第二报文,当在预置的时间内该网络设备可以接收到该第二报文,则网络设备确认报文传输路径中存在路由环路。
现有技术中,通常都是由人工定位发现是否存在路由环路,在本发明实施例中,提供了一种由网络设备确定报文传输路径中是否存在路由环路的方法。
在一种可能的设计中,若第一报文的目的IP地址与网络设备的IP地址不相同时,网络设备可以进一步确定第一报文的生存时间TTL值是否为1,若确定该第一报文的TTL值为1,则根据该第一报文的目的IP地址生成第二报文,即生成与第一报文的目的IP地址相同的第二报文。
本发明实施例中,当第一报文的目的IP地址与网络设备的IP地址不相同,时,网 络设备可以进一步的确定第一报文的TTL值是否为1,当该第一报文的TTL值为1时,根据该第一报文的目的IP地址生成第二报文,与上述实施例相比,本发明实施例中,当确定第一报文的TTL值为1时,才根据该第一报文的目的IP地址生成与第一报文的目的IP地址相同的第二报文,在实际应用中,最终网络设备可以更准确地确定报文传输路径中是否存在路由环路。
结合上述实施例,在一种可能的设计中,网络设备接收第一报文之后,若第一报文的目的IP地址与网络设备的IP地址不相同,且,且该第一报文的TTL值为1时,网络设备可以进一步确定第一报文的传输速率是否达到预置数值,若确定第一报文的传输速率大于或等于了上述预置数值,说明该第一报文可能是TTL值较低的恶意攻击报文或者一些特殊协议报文,如组播协议下的报文。此时网络设备不根据该第一报文的目的IP地址生成上述第二报文,而是可以选择丢弃该第一报文或不对该报文做处理,具体此处不做限定,以减轻网络设备的工作负荷;若网络设备确定第一报文的传输速率小于上述预置数值,则进一步根据该第一报文的目的IP地址生成上述第二报文。
在一种可能的设计中,当网络设备确认存在路由环路时,该网络设备还可以生成目的IP地址与第一报文的目的IP地址相同的黑洞路由表项,此时,网络设备可以丢弃匹配到黑洞路由表项的报文。本发明实施例中,当网络设备确定报文传输路径中存在路由环路时,由于路由环路的存在,在路由环路中循环转发的报文不能被正常的转发至目的设备,容易形成网络风暴,会大量占用带宽资源,影响其他的业务,此时网络设备可以通过生成目的IP地址与第一报文的目的IP地址相同的黑洞路由表项,通过该黑洞路由表项,可以丢弃匹配到黑洞路由表项的报文,即可以有效的阻止报文在路由环路中循环转发,有效的避免了形成网络风暴,大量占用带宽资源的情况。
在一种可能的设计中,当网络设备生成黑洞路由表项之后,所述网络设备启动定时器;若所述定时器达到预置时长,则网络设备删除所述黑洞路由表项。本发明实施例中,网络设备生成黑洞路由表项之后,黑洞路由表项需要定时老化,即存在一定的生命周期,当达到预置时长后,则该网络设备删除该黑洞路由表项,以便恢复正常业务,防止当不存在路由环路时,目的IP地址与黑洞路由表项的目的IP地址相同的报文被网络设备丢弃掉。
在一种可能的设计中,上述第二报文具体可以为控制报文协议ICMP报文。
本发明实施例中,上述第二报文除了可以为ICMP报文外,还可以是现有网络协议中的其他报文类型,在实际应用中可以有多种选择,增加了方案的多样性。
第二方面,本发明实施例提供了一种网络设备,该网络设备具有实现上述方法设计中网络设备执行的功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。所述模块可以是软件和/或硬件。
在一种可能的设计中,该网络设备具体可以包括接收模块、处理模块、发送模块和处理模块。其中:接收模块,用于接收第一报文;处理模块,用于对接收模块接收到的第一报文进行解析得到第一报文的目的IP地址,若第一报文的目的IP地址与网络设备的IP地址不相同,则根据第一报文的目的IP地址生成第二报文,第二报文的目的IP地址与第一报文的目的IP地址相同;发送模块,用于根据第二报文的目的IP地址发送 第二报文;处理模块,还用于若网络设备在预置时间内接收到第二报文,则确认存在路由环路。
在一种可能的设计中,网络设备包括接收器、处理器以及发送器,所述接收器用于接收第一报文。所述处理器用于对接收模块接收到的第一报文进行解析得到第一报文的目的IP地址,若第一报文的目的IP地址与网络设备的IP地址不相同,则根据第一报文的目的IP地址生成第二报文,第二报文的目的IP地址与第一报文的目的IP地址相同。所述发送器用于根据第二报文的目的IP地址发送第二报文,其中,所述处理器还用于若网络设备在预置时间内接收到第二报文,则确认存在路由环路。
第三方面,本发明实施例提供了一种计算机存储介质,该计算机存储介质中存储有程序代码,该程序代码用于指示执行上述第一方面方法。
本发明可以通过网络设备对接收到的第一报文进行解析得到第一报文的目的IP地址,若第一报文的目的IP地址与网络设备的IP地址不相同,且第一报文的传输速率大于或等于预置数值,则网络设备可以生成目的IP地址与第一报文的目的IP地址相同的第二报文,并根据该第二报文的目的IP地址发送第二报文,若网络设备在预置时间内接收到第二报文,则确认存在路由环路,即提供了一种确定报文传输路径中是否存在路由环路的方法。
附图说明
图1为路由环路示意图;
图2为本发明实施例中一种报文处理方法一个实施例示意图;
图3为本发明实施例中一个应用场景示意图;
图4为本发明实施例中一个应用场景的路由环路示意图;
图5为本发明实施例中的网络设备一个实施例示意图;
图6为本发明实施例中的网络设备另一实施例示意图。
具体实施方式
本发明实施例提供了一种报文处理方法以及网络设备,提供了一种用于确定报文传输路径中是否存在路由环路的方法。
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。
本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产 品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
如图1所示,在报文传输过程中,当出现了报文传输路由环路后,传输路径中的报文会在该路由环路中循环转发,直至报文的TTL值减到0或1时,报文传输路径中的网络设备,如路由器,才会丢弃该报文,现有技术中没有有效检测到报文传输路径存在路由环路的方法,为解决该问题,本发明实施例中,网络通过接收到的报文的特征预判断报文的传输路径中可能存在路由环路问题,接着生成一个探测报文,用来确定报文传输路径是否存在路由环路,具体提供了如下技术方案。
具体请参阅图2,本发明实施例一种报文处理方法一个实施例,包括:
201、网络设备接收第一报文;
在本发明实施例中,网络设备可以接收第一报文,需要说明的是,该网络设备可以是指路由器或交换机等网络设备,另外该第一报文可以指一个报文或多个报文,具体这里不做任何限定,为了便于理解与叙述,本发明实施例中的第一报文均指一个报文的情况。
202、网络设备对第一报文进行解析得到第一报文的目的IP地址;
本发明实施例中,在网络设备接收到上述第一报文后,可以对第一报文进行解析,得到第一报文的目的IP地址。
203、若第一报文的目的IP地址与网络设备的IP地址不相同,则网络设备根据第一报文的目的IP地址生成第二报文,第二报文的目的IP地址与第一报文的目的IP地址相同;
本发明实施例中,网络设备解析得到第一报文的目的IP地址之后,本发明实施例还包括:
网络设备判断该第一报文的目的IP地址与网络设备自身的IP地址是否相同;
若第一报文的目的IP地址与网络设备的IP地址不相同,网络设备可以根据第一报文的目的IP地址生成第二报文,其中,第二报文的目的IP地址与第一报文的目的IP地址相同。
需要说明的是,为了使本发明确定存在路由环路的结果更为准确,在本发明的一些实施例中,当第一报文的目的IP地址与网络设备的IP地址不相同时,网络设备可以进一步确定该第一报文的TTL值是否为1,当该第一报文的TTL值为1时,则该网络设备才根据第一报文的目的IP地址生成第二报文。即当第一报文TTL值为1,且第一报文的目的IP地址又与网络设备的IP地址不相同,说明第一报文无法到达第一报文目的IP地址所指向的设备,即更加确定报文传输路径中可能存在路由环路的可能。另外,在本发明的另一些实施中,当网络设备确定所述第一报文的TTL值为1时,该网络设备可以再进一步确定所述第一报文的传输速率是否大于或等于预置数值,若否,则该网络设备才根据第一报文的目的IP地址生成所述第二报文。其中,该预置数值可以根据经验数据进行设置,若第一报文的传输速率大于或等于预置数值,说明该第一报文可能是TTL值较低的恶意攻击报文或者一些特殊报文,此时网络设备不根据该第一报文的目的IP地址生成上述第二报文,而是可以选择丢弃该第一报文或不对该报文做处理,以减轻网络设备的工作负荷。当网络设备确定第一报文的传输速率小于上述预置数值时,才进一 步根据该第一报文的目的IP地址生成上述第二报文。
另外需要说明的是,网络设备根据第一报文的目的IP地址生成的第二报文的格式可以为自定义的报文格式,也可以是现有协议的报文,如传输控制协议/因特网互联协议(英文全称:Transmission Control Protocol/Internet Protocol,英文简称:TCP/IP)报文、用户数据报协议(英文全称:User Datagram Protocol,英文简称:UDP)报文等等,具体此处不做限定。
204、网络设备根据第二报文的目的IP地址发送第二报文;
本发明实施例中,网络设备生成目的IP地址与第一报文的目的IP地址相同的第二报文后,网络设备可以根据第二报文的目的IP地址所指示的传输路径发送该第二报文。
205、若网络设备在预置时间内接收到第二报文,则确定存在路由环路;
本发明实施例中,网络设备根据第二报文的目的IP地址发送第二报文后,若在预置时间内,网络设备可以接收到该第二报文,则确认该第二报文的传输路径中存在路由环路,可以理解的是,本发明实施例中对该预置时间的具体时长不做任何限定,可以根据实际应用情况选取。
206、网络设备生成黑洞路由表项,黑洞路由表项的目的IP地址与第一报文的目的IP地址相同;
本发明实施例中,网络设备确认存在路由环路后,可以生成目的IP地址与第一报文的目的IP地址相同的黑洞路由表项。
207、网络设备丢弃匹配到黑洞路由表项的报文;
本发明实施例中,当网络设备生成目的IP地址与第一报文的目的IP地址相同的黑洞路由表项后,该网络设备丢弃匹配到黑洞路由表项的报文,即丢弃目的IP地址与黑洞路由表项IP地址相同的报文,从而避免由于路由环路导致报文不断循环转发,即可以有效的避免由于路由环路而导致的网络风暴。
208、网络设备启动定时器,若所述定时器达到预置时长,则网络设备删除黑洞路由表项。
本发明实施例中,当网络设备生成黑洞路由表项后,黑洞路由表项需要在规定时间内老化,即网络设备启动一个定时器,当定时器达到预置时长时,例如5分钟,该网络设备删除上述黑洞路由表项,其中,本发明实施例不对该预置时长具体时长做任何设定,这里需要说明的是,在实际应用中,在定时器达到预置时长之前,网络设备可以生成第二个第二报文,以确定是否存在路由环路,若确定还是存在路由环路,则在定时器达到预置时长之前,该网络设备继续保存上述黑洞路由表项,若不存在,则该网络设备可以提前删除上述黑洞路由表项。
另外需要说明的是,在实际应用中,还可以通过人工干预的方式,即还可以通过人为删除该黑洞路由表项,具体此处不做限定。
本发明实施例中,本发明可以通过网络设备对接收到的第一报文进行解析得到第一报文的目的IP地址,若第一报文的目的IP地址与网络设备的IP地址不相同,且第一报文的传输速率大于或等于预置数值,则网络设备可以生成目的IP地址与第一报文的目的IP地址相同的第二报文,并根据该第二报文的目的IP地址发送第二报文,若网络设备在预置时间内接收到第二报文,则确认存在路由环路,即提供了一种确定报文传输 路径中是否存在路由环路的方法,并且当确定存在上述路由环路后,可以生成一个黑洞路由表项,用于使网络设备丢弃在所述路由环路中循环转发的报文,可以有效地避免报文在所述路由环路中循环转发,影响报文的正常发送。
针对上述实施例,为了便于理解,下面以图3所示的网络拓扑场景进行举例说明,如图3所示:
路由器A通过接口E0与190.2.0.0网段的设备1连接,通过接口S0与190.3.0.0网段的设备2连接;路由器B通过接口S1与190.3.0.0网段连接,通过接口E1与网段190.4.0.0网段连接。设备1的IP地址为190.2.0.3,处于190.2.0.0网段下,设备2的IP地址为190.4.0.2,处于190.4.0.0网段下。
可以理解的是,图3所涉及的网段在此只是举例说明,不对本发明做任何的限定。
按照图3所示的网络拓扑,由于设备1以及设备2处于不同的网段,当设备1向设备2发送报文时,路由器A通过E0口接收设备1发送的报文,并通过S0口向路由器B转发报文,路由器B通过S1口接收路由器A转发的报文,再通过E1口将报文转发至设备2,即设备1向设备2发送的报文需经由路由器A以及路由器B转发才能发送至设备2,具体地三层报文转发细节属现有技术,此处不做赘述。
这里,针对上述实施例,以网络设备为路由器A为例进行说明:路由器A可以接收发送至路由器A报文,路由器A接收到该报文后,可以从报文的报文头解析得到报文的目的IP地址以及TTL值,其中,若解析得到该报文的目的IP地址为190.4.0.2,该报文的目的IP地址(即190.4.0.2)跟路由器A自身的IP地址不相同,且该报文的TTL值为1,说明该报文在TTL值耗尽前不能到达190.4.0.0网段,即不能到达该报文目的IP地址190.4.0.2所指向的设备2,而最终停留在路由器A,这里需要指出的是,网络设备可以再进一步确定报文的传输速率是否大于或等于一定的传输速率,若是,说明该报文可能是一些TTL值极短的特殊协议报文,如组播协议中的报文,即到达网络设备时,TTL值就已经为1,这种情况下不作为路由器判断路由是否存在路由环路的依据,此时网络设备可以选择丢弃该报文或不对该报文做任何处理。当上述报文的传输速率小于所述预置数值时,路由器A才预判断该报文传输路径中可能存在路由环路,导致报文无法到达设备2,此时,路由器A生成一个目的IP地址为190.4.0.2的因特网控制报文协议ICMP探测报文,即该ICMP探测报文的目的IP地址与上述报文的目的IP地址相同,并根据该ICMP探测报文的目的IP地址发送该ICMP探测报文,若在预置时间内,路由器A接收到自身发送的ICMP探测报文,则确定路由器A与路由器B之间存在路由环路,即路由器A的ICMP探测报文不能通过路由器B到达该ICMP探测报文目的IP地址10.4.0.2所指向的设备2,即,目的IP地址为190.4.0.2的报文的传输路径存在路由环路,导致该报文在路由器A与路由器B间不断循环,如图4所示。其中,造成该路由环路的原因可能是由于与路由器直连的网段出现故障,或人工配置导致路由器的路由表信息配置出错等,具体此处不做赘述。
此时在路由器A路由表中生成一个黑洞路由表项,如下表1所示:
表1
Figure PCTCN2017071514-appb-000001
Figure PCTCN2017071514-appb-000002
本领域技术人员知道,上述表1所示的路由表信息只是路由器A路由表信息中的一部分,这里只是列举出与本发明有关的关键信息,其余部分内容此处不做赘述。另外需要说明的是,该黑洞路由表项可以更新至路由器A中已有路由表中,也可以为路由器A中重新设置的路由表,具体此处不做限定。
此时,当路由器A接收到目的IP地址为190.4.0.2的报文时,由于该报文的目的IP地址与表1中的目的IP地址190.4.0.2相匹配,且出接口为NULL空,即不对该报文进行转发,路由器A会选择丢弃目的IP地址为190.4.0.2的报文。从而避免了目的IP地址为190.4.0.2的报文不断循环转发,破除了由于该报文循环转发而出现的路由环路。
其中,该黑洞路由表项需要定时老化,存在生命周期(比如5分钟),生成黑洞路由表项5分钟过后,路由器A即会删除该黑洞路由表项,并生成第二个目的IP地址为190.4.0.2的探测报文,并发送该报文,若在预置时间内,路由器A接收到了该探测报文,说明路由器A以及B之间仍然存在路由环路,此时重新生成表1所示的黑洞路由表项;若在预置时间内,路由器A没有接收到该探测报文,则说明路由器A以及B之间的路由表配置信息已经恢复正常,不会导致该探测报文在路由器A以及B之间循环转发,此时,路由器A不再生成上述黑洞路由表项,以便恢复正常业务,避免发送至设备2的报文被路由器A丢弃掉,影响其他业务的正常进行。
这里需要说明的是,路由器A也可以在上述黑洞路由生命周期内,即5分钟内,就直接生成第二个目的IP地址为190.4.0.2的探测报文,若在预置时间内,路由器A接收到了该探测报文,说明路由器A以及B之间仍然存在路由环路,此时继续保持如上述表1所示的黑洞路由表项;若在预置时间内,路由器A没有接收到该探测报文,则说明路由器A以及B之间的路由表配置信息已经恢复正常,不会导致该探测报文在路由器A以及B之间循环转发,此时,路由器A提前删除上述黑洞路由表项,以便恢复正常业务,避免发送至设备2的报文被路由器A丢弃掉,影响其他业务的正常进行。
以上对本发明实施例中的一种报文处理方法进行了描述,下面对本发明实施例中的网络设备进行描述。
具体请参阅图5,本发明网络设备一个实施例,包括:接收模块501、处理模块502以及发送模块503。
接收模块501,用于接收第一报文;
处理模块502,用于对接收模块501接收到的第一报文进行解析得到第一报文的目的IP地址,判断该第一报文的目的IP地址与网络设备自身的IP地址是否相同,若第一报文的目的IP地址与网络设备的IP地址不相同,则根据第一报文的目的IP地址生成第二报文,第二报文的目的IP地址与第一报文的目的IP地址相同;
发送模块503,用于根据第二报文的目的IP地址发送第二报文;
所述处理模块502,用于若网络设备在预置时间内接收到第二报文,则确定存在路由环路。
结合上述实施例,当第一报文的目的IP地址与网络设备的IP地址不相同时,所述处理模块502还用于确定该第一报文的TTL值是否为1,当该第一报文的TTL值为1时,则根据第一报文的目的IP地址生成第二报文。
结合上述实施例,若所述网络设备确定第一报文的TTL值为1时,所述处理模块还用于确定该第一报文的传输速率是否大于或等于预置数值,当该第一报文的传输速率小于预置数值时,则根据第一报文的目的IP地址生成第二报文。
结合上述实施例,当所述处理模块502确定存在路由环路后,所述处理模块502还用于生成黑洞路由表项,所述黑洞路由表项的目的IP地址与所述第一报文的目的IP地址相同,丢弃匹配到所述黑洞路由表项的报文。
结合上述实施例,若所述路由环路已被解除,所述处理模块502还用于删除所述黑洞路由表项。
上面从模块化功能实体的角度对本发明实施例中的网络设备进行描述,下面从硬件处理的角度对本发明实施例中的网络设备进行描述,请参阅图6,本发明实施例提供的一种网络结构示意图,该网络设备600可因配置或性能不同而产生比较大的差异,如与上述实施例中接收模块501对应的实体装置接收器601,还可以包括一个或多个上述实施例处理模块502对应的实体装置处理器602(例如,一个或一个以上处理器),发送模块503对应的实体装置发送器603以及存储器604,一个或一个以上数据605或存储程序代码606的存储介质607(例如一个或一个以上海量存储设备)。其中,存储器604和存储介质607可以是短暂存储或持久存储。存储在存储介质607的程序可以包括一个或一个以上模块(图示没标出),每个模块可以包括对网络设备600中的一系列指令操作。更进一步地,处理器602可以设置为与存储介质607通信,在网络设备600上执行存储介质607中的一系列指令操作。
可选地,存储器604与存储介质607也可以使用同一存储设备来实现。
可选地,存储介质607可以存储操作系统608、数据605及程序代码606。
网络设备600还可以包括一个或一个以上电源,一个或一个以上操作系统608。
本实施例中由网络设备所执行的步骤可以基于该图6所示的网络设备结构示意图,具体可以参考前述实施例中的对应过程,在此不再赘述。
需要说明的是,上述装置实施例所涉及到的处理器可以是中央处理器(英文全称: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)或其任意组合,在本发明中不做任何限定。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质可以是以下中的至少一种:U盘、移动硬盘、只读存储器(英文全称:Read-Only Memory,英文简称:ROM)、随机存取存储器(英文全称:Random Access Memory,英文简称RAM)、磁碟或者光盘等各种可以存储程序代码的介质,前述的存储器可以是以下中的至少一种:U盘、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。

Claims (17)

  1. 一种报文处理方法,其特征在于,包括:
    网络设备接收第一报文;
    所述网络设备对所述第一报文进行解析得到所述第一报文的目的互联网协议IP地址;
    若所述第一报文的目的IP地址与所述网络设备的IP地址不相同,则所述网络设备根据所述第一报文的目的IP地址生成第二报文,所述第二报文的目的IP地址与所述第一报文的目的IP地址相同;
    所述网络设备根据所述第二报文的目的IP地址发送所述第二报文;
    若所述网络设备在预置时间内接收到所述第二报文,则确定存在路由环路。
  2. 根据权利要求1所述的报文处理方法,其特征在于,若所述第一报文的目的IP地址与所述网络设备的IP地址不相同,所述网络设备根据所述第一报文的目的IP地址生成第二报文包括:
    所述网络设备确定所述第一报文的生存时间TTL值是否为1;
    若是,则所述网络设备根据所述第一报文的目的IP地址生成所述第二报文。
  3. 根据权利要求2所述的报文处理方法,其特征在于,若所述网络设备确定所述第一报文的TTL值为1时,所述网络设备根据所述第一报文的目的IP地址生成所述第二报文包括:
    所述网络设备确定所述第一报文的传输速率是否大于或等于预置数值;
    若否,则所述网络设备根据所述第一报文的目的IP地址生成所述第二报文。
  4. 根据权利要求1至3中任一项所述的报文处理方法,其特征在于,所述确定存在路由环路之后还包括:
    所述网络设备生成黑洞路由表项,所述黑洞路由表项的目的IP地址与所述第一报文的目的IP地址相同;
    所述网络设备丢弃匹配到所述黑洞路由表项的报文。
  5. 根据权利要求4所述的报文处理方法,其特征在于,所述网络设备生成黑洞路由表项之后还包括:
    所述网络设备启动定时器;
    若所述定时器达到预置时长,则所述网络设备删除所述黑洞路由表项。
  6. 根据权利要求5所述的报文处理方法,其特征在于,所述第二报文为控制报文协议ICMP报文。
  7. 一种网络设备,其特征在于,包括:
    接收模块,用于接收第一报文;
    处理模块,用于对所述接收模块接收到的所述第一报文进行解析得到所述第一报文的目的互联网协议IP地址,若所述第一报文的目的IP地址与所述网络设备的IP地址不相同,则根据所述第一报文的目的IP地址生成第二报文,所述第二报文的目的IP地址与所述第一报文的目的IP地址相同;
    发送模块,用于根据所述第二报文的目的IP地址发送所述第二报文;
    所述处理模块,还用于若所述网络设备在预置时间内接收到所述第二报文,则确定 存在路由环路。
  8. 根据权利要求7所述的网络设备,其特征在于,若所述第一报文的目的IP地址与所述网络设备的IP地址不相同时,所述处理模块还用于:
    确定所述第一报文的TTL值是否为1;
    若确定所述第一报文的TTL值为1,则根据所述第一报文的目的IP地址生成所述第二报文。
  9. 根据权利要求8所述的网络设备,其特征在于,若所述网络设备确定所述第一报文的TTL值为1时,所述处理模块还用于:
    确定所述第一报文的传输速率是否大于或等于预置数值;
    若否,则根据所述第一报文的目的IP地址生成所述第二报文。
  10. 根据权利要求7至8中任一项所述的网络设备,其特征在于,所述处理模块还用于:
    生成黑洞路由表项,所述黑洞路由表项的目的IP地址与所述第一报文的目的IP地址相同;
    丢弃匹配到所述黑洞路由表项的报文。
  11. 根据权利要求10所述的网络设备,其特征在于,所述处理模块还用于:
    启动定时器;
    若所述定时器达到预置时长,则删除所述黑洞路由表项。
  12. 一种网络设备,其特征在于,包括处理器和存储器,所述处理器用于执行所述存储器包括的指令,以执行权利要求1-6中任一所述的方法。
  13. 一种网络设备,其特征在于,包括:
    接收器,用于接收第一报文;
    处理器,用于对所述接收模块接收到的所述第一报文进行解析得到所述第一报文的目的互联网协议IP地址,若所述第一报文的目的IP地址与所述网络设备的IP地址不相同,则根据所述第一报文的目的IP地址生成第二报文,所述第二报文的目的IP地址与所述第一报文的目的IP地址相同;
    发送器,用于根据所述第二报文的目的IP地址发送所述第二报文;
    所述处理器,还用于若所述网络设备在预置时间内接收到所述第二报文,则确定存在路由环路。
  14. 根据权利要求13所述的网络设备,其特征在于,若所述第一报文的目的IP地址与所述网络设备的IP地址不相同时,所述处理器还用于:确定所述第一报文的TTL值是否为1;若确定所述第一报文的TTL值为1,则根据所述第一报文的目的IP地址生成所述第二报文。
  15. 根据权利要求14所述的网络设备,其特征在于,若所述网络设备确定所述第一报文的TTL值为1时,所述处理器还用于:确定所述第一报文的传输速率是否大于或等于预置数值;若否,则根据所述第一报文的目的IP地址生成所述第二报文。
  16. 根据权利要求13至15中任一项所述的网络设备,其特征在于,所述处理器还用于:生成黑洞路由表项,所述黑洞路由表项的目的IP地址与所述第一报文的目的IP地址相同;丢弃匹配到所述黑洞路由表项的报文。
  17. 根据权利要求16所述的网络设备,其特征在于,所述处理器还用于:
    启动定时器;
    若所述定时器达到预置时长,则删除所述黑洞路由表项。
PCT/CN2017/071514 2016-01-29 2017-01-18 一种报文处理方法以及网络设备 WO2017129011A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610066882.0A CN105577536A (zh) 2016-01-29 2016-01-29 一种报文处理方法以及网络设备
CN201610066882.0 2016-01-29

Publications (1)

Publication Number Publication Date
WO2017129011A1 true WO2017129011A1 (zh) 2017-08-03

Family

ID=55887224

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/071514 WO2017129011A1 (zh) 2016-01-29 2017-01-18 一种报文处理方法以及网络设备

Country Status (2)

Country Link
CN (1) CN105577536A (zh)
WO (1) WO2017129011A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105577536A (zh) * 2016-01-29 2016-05-11 华为技术有限公司 一种报文处理方法以及网络设备
CN112152972A (zh) * 2019-06-28 2020-12-29 北京奇虎科技有限公司 检测iot设备漏洞的方法和装置、路由器
CN110351193B (zh) * 2019-07-05 2022-02-25 京信网络系统股份有限公司 一种路由更新方法及装置、计算机装置及可读存储介质
CN110351148A (zh) * 2019-07-21 2019-10-18 汪勤思 一种网络三层转发路径诊断方法和系统
CN112448912B (zh) * 2019-08-27 2023-08-01 中兴通讯股份有限公司 一种防报文攻击方法、装置及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1691640A (zh) * 2004-04-30 2005-11-02 华为技术有限公司 一种在弹性分组环网中选环的方法
CN101299722A (zh) * 2008-07-02 2008-11-05 杭州华三通信技术有限公司 一种改进的快速重路由方法和一种网络设备
US8908539B1 (en) * 2012-05-25 2014-12-09 Google Inc. Systems and methods for testing network connections of a centrally-controlled network
CN104852826A (zh) * 2015-04-13 2015-08-19 北京华为数字技术有限公司 一种环路检测方法及装置
CN105577536A (zh) * 2016-01-29 2016-05-11 华为技术有限公司 一种报文处理方法以及网络设备

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101764750B (zh) * 2009-12-07 2012-02-22 福建星网锐捷网络有限公司 报文封装方法和检测转发环路的方法、装置及网络设备
CN101764812B (zh) * 2009-12-30 2012-10-03 华为技术有限公司 一种转发活跃源报文的方法、路由器及网络系统
CN102045218B (zh) * 2010-12-07 2012-11-07 成都市华为赛门铁克科技有限公司 一种环路检测方法及防火墙设备
CN104869063B (zh) * 2014-02-21 2019-02-12 华为技术有限公司 虚拟子网中的主机路由处理方法及相关设备和通信系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1691640A (zh) * 2004-04-30 2005-11-02 华为技术有限公司 一种在弹性分组环网中选环的方法
CN101299722A (zh) * 2008-07-02 2008-11-05 杭州华三通信技术有限公司 一种改进的快速重路由方法和一种网络设备
US8908539B1 (en) * 2012-05-25 2014-12-09 Google Inc. Systems and methods for testing network connections of a centrally-controlled network
CN104852826A (zh) * 2015-04-13 2015-08-19 北京华为数字技术有限公司 一种环路检测方法及装置
CN105577536A (zh) * 2016-01-29 2016-05-11 华为技术有限公司 一种报文处理方法以及网络设备

Also Published As

Publication number Publication date
CN105577536A (zh) 2016-05-11

Similar Documents

Publication Publication Date Title
WO2017129011A1 (zh) 一种报文处理方法以及网络设备
CN107241186B (zh) 网络设备和用于网络通信的方法
US9544273B2 (en) Network traffic processing system
JP5510687B2 (ja) ネットワークシステム、及び通信トラフィック制御方法
CN107710680B (zh) 网络攻击防御策略发送、网络攻击防御的方法和装置
EP3188450B1 (en) Reducing false alarms when using network keep-alive messages
US9537846B2 (en) Integrity check optimization systems and methods in live connectivity frames
WO2019029318A1 (zh) 网络拥塞的通告方法、代理节点及计算机设备
CN110191066B (zh) 一种确定最大传输单元pmtu的方法、设备及系统
WO2018077100A1 (zh) Tcp拥塞窗口的确定方法和装置
US10791051B2 (en) System and method to bypass the forwarding information base (FIB) for interest packet forwarding in an information-centric networking (ICN) environment
WO2011032321A1 (zh) 一种数据转发方法、数据处理方法、系统以及相关设备
WO2019085923A1 (zh) 数据处理方法、装置及计算机
CN110784436B (zh) 用于维持互联网协议安全隧道的方法和设备
WO2022100001A1 (zh) 网络安全防护方法以及防护设备
CN112887312B (zh) 一种慢协议报文处理方法及相关装置
WO2017118428A1 (zh) 实现报文检错的方法及装置
CN114268592A (zh) 一种报文的处理方法、系统及设备
CN114221867A (zh) 一种操作管理维护oam报文处理方法及设备
CN114726797B (zh) 加速传输方法、装置、设备、系统和存储介质
Achar et al. Border gateway protocol performance and its protection against disturbed denial of service attack
TWI828347B (zh) 使用硬體設備減輕DDoS攻擊的方法及其設備
CN114553446B (zh) 网络安全防护方法以及防护设备
JP2009212985A (ja) マルウェア特定処理システム、マルウェア特定処理装置、マルウェア特定処理方法およびマルウェア特定処理プログラム
AV Juniper Networks ScreenOS Release

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

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

Country of ref document: EP

Kind code of ref document: A1