Method for upgrading version of network device and network device
First Claim
1. A method for upgrading a version of a network device, comprising:
- configuring, by the network device, a forwarding plane of the network device to be a first forwarding plane and a second forwarding plane, wherein the first forwarding plane runs a first version, the second forwarding plane runs a second version, and before version upgrade of the network device, the first forwarding plane is used for packet forwarding of the network device;
performing, by the network device in the first forwarding plane, sampling on forwarded packets using a preset sampling ratio, to obtain a sample packet, and copying the sample packet to the second forwarding plane;
forwarding, by the network device, the sample packet in a broadcast manner in the second forwarding plane, to learn a Media Access Control (MAC) address, and generating a MAC address entry according to the learned MAC address; and
in response to a quantity of MAC addresses learned by the second forwarding plane reaching a preset threshold, performing an upgrade so that the second forwarding plane is used for packet forwarding of the network device, wherein the preset threshold is a nonzero positive integer.
2 Assignments
0 Petitions
Accused Products
Abstract
Embodiments of the present invention disclose a method for upgrading a version of a network device and a device. A specific solution is: configuring a forwarding plane of the network device to be a first forwarding plane and a second forwarding plane; performing, in the first forwarding plane, sampling on forwarded packets by using a preset sampling ratio, to obtain a sample packet; forwarding, by the second forwarding plane, the sample packet in a broadcast manner, to learn a MAC address; and when a quantity of MAC addresses learned by the second forwarding plane reaches a preset threshold, performing upgrade so that the second forwarding plane is used for packet forwarding of the network device. The technical solution can effectively avoid generation of a large quantity of broadcast packets during a version upgrade process, can help reduce network bandwidth that is excessively occupied, and avoid network congestion.
-
Citations
15 Claims
-
1. A method for upgrading a version of a network device, comprising:
-
configuring, by the network device, a forwarding plane of the network device to be a first forwarding plane and a second forwarding plane, wherein the first forwarding plane runs a first version, the second forwarding plane runs a second version, and before version upgrade of the network device, the first forwarding plane is used for packet forwarding of the network device; performing, by the network device in the first forwarding plane, sampling on forwarded packets using a preset sampling ratio, to obtain a sample packet, and copying the sample packet to the second forwarding plane; forwarding, by the network device, the sample packet in a broadcast manner in the second forwarding plane, to learn a Media Access Control (MAC) address, and generating a MAC address entry according to the learned MAC address; and in response to a quantity of MAC addresses learned by the second forwarding plane reaching a preset threshold, performing an upgrade so that the second forwarding plane is used for packet forwarding of the network device, wherein the preset threshold is a nonzero positive integer. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A network device, comprising:
-
a configuration unit, configured to configure a forwarding plane of the network device to be a first forwarding plane and a second forwarding plane, wherein the first forwarding plane runs a first version, the second forwarding plane runs a second version, and before version upgrade of the network device, the first forwarding plane is used for packet forwarding of the network device; a sampling unit, configured to perform, in the first forwarding plane that is configured by the configuration unit, sampling on forwarded packets by using a preset sampling ratio, to obtain a sample packet, and copy the sample packet to the second forwarding plane; a generation unit, configured to forward the sample packet in a broadcast manner in the second forwarding plane that is configured by the configuration unit, to learn a media access control (MAC) address, and generate a MAC address entry according to the learned MAC address; and an upgrade unit, configured to, in response to a quantity of MAC addresses learned by the second forwarding plane reaching a preset threshold, perform an upgrade so that the second forwarding plane is used for packet forwarding of the network device, wherein the preset threshold is a nonzero positive integer. - View Dependent Claims (7, 8, 9, 10)
-
-
11. A network device, comprising a processor, a transmitter, a memory and a bus, wherein:
-
the processor, the transmitter and the memory are connected by using the bus;
the memory is configured to store data processed by the processor; andthe processor is configured to; configure a forwarding plane of the network device to be a first forwarding plane and a second forwarding plane, wherein the first forwarding plane runs a first version, the second forwarding plane runs a second version, and before version upgrade of the network device, the first forwarding plane is used for packet forwarding of the network device; perform, in the first forwarding plane, sampling on forwarded packets using a preset sampling ratio, to obtain a sample packet, and copy the sample packet to the second forwarding plane; forward, by using the transmitter, the sample packet in a broadcast manner in the second forwarding plane, to learn a media access control (MAC) address, and generate a MAC address entry according to the learned MAC address; and in response to a quantity of MAC addresses learned by the second forwarding plane reaching a preset threshold, perform an upgrade so that the second forwarding plane is used for packet forwarding of the network device, wherein the preset threshold is a nonzero positive integer. - View Dependent Claims (12, 13, 14, 15)
-
Specification