Routing loop determining method and device
First Claim
1. A routing loop determining method, wherein the method comprises:
- recording, by a forwarding device in a layer 3 network, a destination Internet Protocol (IP) address of a first packet when a time to live (TTL) value of the first packet is 1 and is reduced to 0 by the forwarding device;
discarding, by the forwarding device, the first packet;
acquiring, by the forwarding device, a second packet whose destination IP address is the same as that of the first packet;
recording, by the forwarding device, a feature of the second packet, wherein the feature of the second packet comprises a source IP address, the destination IP address, and a sequence number of the second packet;
forwarding, by the forwarding device, the second packet based on the destination IP address and a routing table when a TTL value obtained by reducing a TTL value of the second packet by 1 is greater than 0;
acquiring, by the forwarding device, a third packet according to the feature of the second packet, wherein a feature of the third packet is the same as the recorded feature of the second packet, wherein a source IP address of the third packet is the same as the source IP address of the second packet, wherein a destination IP address of the third packet is the same as the destination IP address of the second packet, and wherein a sequence number of the third packet is the same as the sequence number of the second packet; and
determining that a routing loop exists in response to acquiring the third packet.
1 Assignment
0 Petitions
Accused Products
Abstract
A routing loop determining method and a device. The method includes: acquiring, by a forwarding device in a layer 3 network, a first packet, where a time to live (TTL) value of the first packet is reduced to 0 by the forwarding device; acquiring, by the forwarding device, a second packet whose destination Internet Protocol IP address is the same as that of the first packet; recording, by the forwarding device, a feature of the second packet; forwarding, by the forwarding device, the second packet; and acquiring, by the forwarding device, a third packet according to the feature of the second packet, where a feature of the third packet is the same as that of the second packet, and determining that a routing loop exists. The present disclosure resolves a problem that a loop in a layer 3 network cannot be detected, and improves accuracy of sending a packet.
20 Citations
13 Claims
-
1. A routing loop determining method, wherein the method comprises:
-
recording, by a forwarding device in a layer 3 network, a destination Internet Protocol (IP) address of a first packet when a time to live (TTL) value of the first packet is 1 and is reduced to 0 by the forwarding device; discarding, by the forwarding device, the first packet; acquiring, by the forwarding device, a second packet whose destination IP address is the same as that of the first packet; recording, by the forwarding device, a feature of the second packet, wherein the feature of the second packet comprises a source IP address, the destination IP address, and a sequence number of the second packet; forwarding, by the forwarding device, the second packet based on the destination IP address and a routing table when a TTL value obtained by reducing a TTL value of the second packet by 1 is greater than 0; acquiring, by the forwarding device, a third packet according to the feature of the second packet, wherein a feature of the third packet is the same as the recorded feature of the second packet, wherein a source IP address of the third packet is the same as the source IP address of the second packet, wherein a destination IP address of the third packet is the same as the destination IP address of the second packet, and wherein a sequence number of the third packet is the same as the sequence number of the second packet; and determining that a routing loop exists in response to acquiring the third packet. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A forwarding device, applied to a layer 3 network, wherein the forwarding device comprises:
-
a network interface; and at least one processor coupled to the network interface, wherein the at least one processor is configured to; record a destination Internet Protocol (IP) address of a first packet using the network interface when a time to live (TTL) value of the first packet is 1 and is reduced to 0 by the forwarding device; discard the first packet; acquire a second packet whose destination IP address is the same as that of the first packet using the network interface; record a feature of the second packet, wherein the feature of the second packet comprises a source IP address, the destination IP address, and a sequence number of the second packet; forward the second packet using the network interface based on the destination IP address and a routing table when a TTL value obtained by reducing a TTL value of the second packet by 1 is greater than 0; acquire a third packet, using the network interface and according to the feature of the second packet, wherein a feature of the third packet is the same as the recorded feature of the second packet, wherein a source IP address of the third packet is the same as the source IP address of the second packet, wherein a destination IP address of the third packet is the same as the destination IP address of the second packet, and wherein a sequence number of the third packet is the same as the sequence number of the second packet; and determine that a routing loop exists in response to acquiring the third packet. - View Dependent Claims (7, 8, 9, 10)
-
-
11. A non-transitory computer-readable storage medium comprising instructions which, when executed by a computer, cause the computer to:
-
record a destination Internet Protocol (IP) address of a first packet when a time to live (TTL) value of the first packet is 1 and is reduced to 0; discard the first packet; acquire a second packet whose destination IP address is the same as that of the first packet; record a feature of the second packet, wherein the feature of the second packet comprises a source IP address, a destination IP address, and a sequence number of the second packet; forward the second packet based on the destination IP address and a routing table when a TTL value obtained by reducing a TTL value of the second packet by 1 is greater than 0; acquire a third packet according to the feature of the second packet, wherein a feature of the third packet is the same as the recorded feature of the second packet, wherein a source IP address of the third packet is the same as the source IP address of the second packet, wherein a destination IP address of the third packet is the same as the destination IP address of the second packet, and wherein a sequence number of the third packet is the same as the sequence number of the second packet; and determine that a routing loop exists in response to acquiring the third packet. - View Dependent Claims (12, 13)
-
Specification