Packet transmission method and device, and computer storage medium
Provided are a packet transmission method and device and a computer storage medium. The method includes: a FlexE shim receives an Ethernet packet forwarded by a switching module and sent by a processor, the FlexE shim being located between a PHY layer and a MAC layer, and the switching module including a data link layer and a network layer; and the FlexE shim converts the Ethernet packet into a PPP packet, codes the PPP packet, and then inserts the PPP packet into a FlexE overhead of a target FlexE port for transmission.
1. A packet transmission method, comprising:
receiving, by a Flexible-Ethernet (FlexE) shim, an Ethernet packet forwarded by a switching module and sent by a processor, the FlexE shim being located between a Physical (PHY) layer and a Media Access Control (MAC) layer, and the switching module comprising a data link layer and a network layer; and
converting, by the FlexE shim, the Ethernet packet into a Point-to-Point Protocol (PPP) packet, coding the PPP packet, and then inserting the PPP packet into a FlexE overhead of a target FlexE port for transmission.
2. The method according to claim 1 , wherein the Ethernet packet sent by the processor is generated in the following manners:
acquiring, by the processor, a Link Control Protocol (LCP) packet, and encapsulating an Ethernet header outside a PPP header of the LCP packet to obtain the Ethernet packet.
3. The method according to claim 2 , wherein converting, by the FlexE shim, the Ethernet packet into a PPP packet comprises:
removing, by the FlexE shim, the Ethernet header of the Ethernet packet, adding a PPP delimiter, and recalculating a Cyclic Redundancy Check (CRC) to obtain the PPP packet.
4. The method according to claim 2 , wherein receiving, by a FlexE shim, an Ethernet packet forwarded by a switching module and sent by a processor comprises:
receiving, by the FlexE shim, the Ethernet packet directly forwarded by the switching module through a target Data Communicate Network (DCN) overhead port.
5. The method according to claim 1 , wherein the Ethernet packet sent by the processor is generated in the following manners:
acquiring, by the processor, an Internet Protocol (IP) packet, and encapsulating an Ethernet header outside an IP header of the IP packet to obtain the Ethernet packet.
6. The method according to claim 5 , wherein converting, by the FlexE shim, the Ethernet packet into a PPP packet comprises:
extracting, by the FlexE shim, an IP payload from the Ethernet packet, adding a PPP delimiter and a PPP header to the IP payload, and recalculating a CRC to obtain the PPP packet.
7. The method according to claim 5 or 6 , wherein receiving, by a FlexE shim, an Ethernet packet forwarded by a switching module and sent by a processor comprises:
receiving, by the FlexE shim, an Ethernet packet forwarded by the switching module based on a L3 routing table; or,
receiving, by the FlexE shim, an Ethernet packet directly forwarded by the switching module through a target DCN overhead port.
8. The method according to claim 3 or 6 , wherein the switching module comprises at least one DCN overhead port, each DCN overhead port comprises at least one Virtual Local Area Network (VLAN) sub-interface, different VLAN sub-interfaces correspond to different data channels, and the data channels are DCN channels or client service channels; and
the Ethernet packet carries first identification information, the first identification information comprising at least one of the following: DCN overhead port information and VLAN sub-interface information, and the first identification information being used to identify a DCN channel corresponding to the Ethernet packet.
9. The method according to claim 8 , further comprising:
extracting the first identification information from the Ethernet packet in the case where the FlexE shim converts the Ethernet packet into a PPP packet,
wherein the step of coding the PPP packet and then inserting the PPP packet into a FlexE overhead of a target FlexE port for transmission comprises:
determining, by the FlexE shim, a DCN channel corresponding to the Ethernet packet according to the first identification information, and determining the target FlexE port according to the DCN channel corresponding to the Ethernet packet; and
performing, by the FlexE shim, 64-bit or 66-bit coding on the PPP packet, and then inserting the PPP packet into a manager channel of the FlexE overhead of the target FlexE port for transmission.
10. A packet transmission method, comprising:
extracting, by a Flexible-Ethernet (FlexE) shim, data from a FlexE overhead of a target FlexE port, and decoding the data to obtain a Point-to-Point Protocol (PPP) packet, the FlexE shim being located between a Physical (PHY) layer and a Media Access Control (MAC) layer; and
converting, by the FlexE shim, the PPP packet into an Ethernet packet, and sending the Ethernet packet to a switching module so that the switching module forwards the Ethernet packet to a processor or a FlexE shim corresponding to a port different from the target FlexE port, the switching module comprising a data link layer and a network layer.
11. The method according to claim 10 , wherein the PPP packet comprises a Link Control Protocol (LCP) packet;
converting, by the FlexE shim, the PPP packet into an Ethernet packet comprises:
removing, by the FlexE shim, a PPP delimiter and a Cyclic Redundancy Check (CRC) of the PPP packet, and adding an Ethernet header to obtain the Ethernet packet.
12. The method according to claim 11 , wherein sending the Ethernet packet to a switching module so that the switching module forwards the Ethernet packet to a processor comprises:
sending, by the FlexE shim, the Ethernet packet to a switching module so that the switching module forwards the Ethernet packet to a processor according to an Access Control List (ACL) rule.
13. The method according to claim 10 , wherein the PPP packet comprises an Internet Protocol (IP) packet;
converting, by the FlexE shim, the PPP packet into an Ethernet packet comprises:
removing, by the FlexE shim, a PPP delimiter, a PPP header and a CRC of the PPP packet to obtain an IP payload, and adding an Ethernet header to the IP payload to obtain the Ethernet packet.
14. The method according to claim 13 , wherein sending the Ethernet packet to a switching module so that the switching module forwards the Ethernet packet to a processor or a FlexE shim corresponding to a port different from the target FlexE port comprises:
sending, by the FlexE shim, the Ethernet packet to the switching module so that the switching module forwards the Ethernet packet to a processor or a FlexE shim corresponding to a port different from the target FlexE port based on a L3 routing table, or the switching module directly sends the Ethernet packet to a FlexE shim corresponding to a port different from the target FlexE port through a target Data Communicate Network (DCN) overhead port.
15. A packet transmission method, comprising:
extracting, by a Flexible-Ethernet (FlexE) shim, data from a FlexE overhead of a first FlexE port, and decoding the data to obtain a Data Communicate Network (DCN) packet, the FlexE shim being located between a Physical (PHY) layer and a Media Access Control (MAC) layer; and
sending, by the FlexE shim, the DCN packet to a switching module through a first Virtual Ethernet Interface (VEI) so that the switching module forwards the DCN packet to a processor based on a L3 routing table or forwards the DCN packet to the FlexE shim through a second VEI, coding, by the FlexE shim, the DCN packet, and then inserting the DCN packet into a FlexE overhead of a second FlexE port for transmission, the switching module comprising a data link layer and a network layer.
16. The method according to claim 15 , wherein the switching module comprises at least one DCN overhead port, each DCN overhead port comprises at least one Virtual Local Area Network (VLAN) sub-interface, different VLAN sub-interfaces correspond to different data channels, and the data channels are DCN channels or client service channels.
17. The method according to claim 16 , wherein
in the case where the DCN packet is a first type of DCN packet, the DCN packet is carried on a fixed time slot of the first FlexE port or the second FlexE port, the DCN packet and a client service packet being capable of multiplexing different time slots of one FlexE port, and the DCN packet and the client service packet being distinguished through different VLAN sub-interfaces; and
in the case where the DCN packet is a second type of DCN packet, the DCN packet is carried on an idle character (IDLE) code block or an error (ERROR) code block of a client service time slot of the first FlexE port or the second FlexE port.
18. The method according to claim 16 or 17 , wherein in the case where the DCN packet is a second type of DCN packet, the DCN packet is carried on a control code domain of an IDLE code block or an ERROR code block of a client service time slot of the first FlexE port or the second FlexE port.
19. The method according to claim 18 , further comprising:
performing, by the FlexE shim, 64-bit or 66-bit coding on the DCN packet to obtain a group of 64-bit or 66-bit blocks with formats of a start code block, a data code block and an end code block; and
starting with a start code block of the group of 64-bit or 66-bit blocks, converting, by the FlexE shim, a 66-bit block into a 55-bit block, and inserting the 55-bit block into a control code domain of the IDLE code block or the ERROR code block.
20. The method according to claim 19 , further comprising:
extracting, by the FlexE shim, 55-bit data from a control code domain of the IDLE code block or the ERROR code block, performing 64-bit or 66-bit decoding on the 55-bit data, and recovering the decoded data into the DCN packet after decoding an end code block.