摘要:
Embodiments of the present invention provide a forwarding table generation method. The method includes: determining, by a forwarding device, a first timeslot set, where the first timeslot set includes multiple timeslots used when the forwarding device sends, to a first device by using a first flexible Ethernet group, multiple encoded data blocks generated by a physical coding sublayer; determining, by the forwarding device, a second timeslot set, where the second timeslot set includes multiple timeslots used when the forwarding device receives, by using a second FlexE group, the multiple encoded data blocks sent by a second device; and generating, by the forwarding device, a forwarding table, where the forwarding table includes a mapping relationship between the second FlexE group and the multiple timeslots included in the second timeslot set, and between the first FlexE group and the multiple timeslots included in the first timeslot set. According to the forwarding table generation method in the embodiments of the present invention, a FlexE client is forwarded by using a generated forwarding table, so as to reduce a transmission delay, and improve transmission efficiency.
摘要:
Embodiments of the present invention provide a method and a device for classifying a packet, which relates to the field of communications technologies, so as to reduce rule duplication in a classification process and improve classification efficiency. The method for classifying a packet provided by the embodiment of the present invention includes: receiving a packet (201); searching for a rule matching the packet in at least one created decision tree, in which the decision tree is a decision tree created after an original rule set is divided based on a segmentation code (202); and classifying the packet according to a found rule (203). The method and the device provided in the embodiments of the present invention are applicable to a router.
摘要:
An embodiment of the present invention provides a code loading method, including: obtaining, by a control plane of a network apparatus, a process to be executed by a forwarding plane of the network apparatus and code that executes the process, where the code is described by using a high-level programming language; determining, by the control plane of the network apparatus, that service configuration information of the network apparatus corresponds to the code; compiling, by the control plane of the network apparatus, the code to generate compiled code; and loading, by the control plane of the network apparatus, the compiled code to the forwarding plane of the network apparatus. In addition, an embodiment of the present invention further provides a corresponding network apparatus. A new service may be deployed by using the foregoing technical solutions, which helps meet a requirement for a new service.
摘要:
Embodiments of the present invention provide a network device, including a programmable processor and a non-programmable processor, where the programmable processor includes a first control port; the non-programmable processor includes a second control port, and the second control port is coupled with the first control port; the programmable processor is configured to receive a first packet, and a protocol corresponding to a packet header of the first packet is a first protocol; and the first control port and the second control port are configured to connect the programmable processor and the non-programmable processor, the programmable processor and the non-programmable processor are configured to collaboratively execute the first protocol on the first packet, the non-programmable processor is configured to determine an action of the first protocol to be executed by the programmable processor on the first packet, and the programmable processor is configured to execute the action. In addition, the embodiments of the present invention further provide a packet processing method. The foregoing technical solutions help reduce occupation of storage space of a programmable processor.
摘要:
This application discloses a method for generating a segment list used for packet forwarding in an SRv6 network. The method includes: A network device obtains an original segment list corresponding to a packet forwarding path, where the original segment list includes original segment identifiers that are sequentially arranged, and each of the original segment identifiers that are sequentially arranged corresponds to one node or link on the packet forwarding path; the network device compares a plurality of successively adjacent original segment identifiers in the original segment list, to generate a plurality of successively adjacent compressed segment identifiers, where a length of each compressed segment identifier is less than a length of a corresponding original segment identifier; and the network device generates a compressed segment list, where the compressed segment list includes a plurality of compressed segment identifiers, and the compressed segment list is used to forward a packet along the packet forwarding path. In the method, the compressed segment identifier is generated based on the original segment identifier, where the length of the compressed segment identifier is less than that of the original segment identifier, and a length of the compressed segment list is less than that of the original segment list. This improves packet transmission efficiency and processing efficiency in an SR network.
摘要:
Embodiments of the present invention provide a packet processing method, including: receiving, by a forwarding element, a packet through an inbound port; searching for, by the forwarding element, a port table according to the inbound port, and determining a first offset, a first length, and an identifier of a first table, where the first offset, the first length, and the identifier of the first table correspond to the inbound port; determining, by the forwarding element, a first key according to the first offset and the first length, searching for the first table according to the first key, and determining a first instruction; and processing, by the forwarding element, the packet according to the first instruction. In addition, a corresponding forwarding element is further provided. In the foregoing technical solutions, before processing a packet, the forwarding element does not need to interpret a data format of the packet, so that the forwarding element can flexibly support packets in different data formats.
摘要:
Embodiments of the present invention provide a data sending method, including: respectively receiving, by a forwarding device by using a first FlexE group and in multiple timeslots included in a first timeslot set, multiple first encoded data blocks generated by a physical coding sublayer; determining, by the forwarding device according to the multiple timeslots included in the first timeslot set and the first FlexE group, a second FlexE group and multiple timeslots included in a second timeslot set; and respectively sending, by the forwarding device, the multiple first encoded data blocks by using the second FlexE group and in the multiple timeslots included in the second timeslot set. According to the data sending method in the embodiments of the present invention, the forwarding device does not need to process the first encoded data blocks in a conventional layer 2 (link layer) or layer 3 (network layer) forwarding mode. Therefore, a processing delay can be reduced, and a transmission delay can be reduced.