The present application provides a
packet forwarding method and apparatus, and an electronic device. In an embodiment, each node in a
ring network enables a
ring network protection function for a local
ring network interface, such that when any node determines that an egress interface of a
route to a destination node is a local ring
network interface with the ring network protection function enabled, the
route is taken as a primary
route from the present node to the destination node, and a
backup route for the primary route is determined (an egress interface of the
backup route is a ring
network interface on the present node with the ring network protection function enabled), and then, a packet can be forwarded on the basis of the primary route and the
backup route. For example, after reception of a packet, if an ingress interface through which the packet was received is the same as a primary egress interface of the primary route, the packet is directly forwarded via a backup egress interface of the backup route, so as to avoid a
packet forwarding loop caused when a node on the ring network, after receiving the packet, fails to successfully adjust the route in the event of an
abnormality in the ring network, such as a node failure in the ring network or a link failure between any two nodes.