Method and system for expanding number of slave gateways of PON (Passive Optical Network) optical network

By creating virtual interfaces based on service types in PON optical networking and binding the source MAC, gemport ID, and cvlan ID of the service virtual interfaces with the records of the multi-service forwarding table, the problem of the limited number of slave gateway devices connected to the main gateway device is solved, realizing the rational use of resources and simplified network management.

CN121751028APending Publication Date: 2026-03-27FUJIAN STAR NET WISDOM TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

In existing PON optical networks, the number of slave gateway devices connected to the master gateway device is limited, and existing methods that create virtual interfaces suffer from excessive resource consumption, performance degradation, and increased network management complexity.

Method used

Instead of attaching a number of gateway devices, virtual interfaces are created based on the number of service types. By binding the source MAC address, gemport ID, and CVLAN ID of the service virtual interface to the service forwarding table, flexible expansion of the gateway devices can be achieved.

Benefits of technology

It reduces system resource consumption, lowers network management complexity, and supports flexible expansion from the number of gateway devices, thereby improving network stability and management efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121751028A_ABST
    Figure CN121751028A_ABST
Patent Text Reader

Abstract

The invention provides a method and system for expanding the number of slave gateways of a PON (Passive Optical Network) optical network, and the method comprises the steps: creating a plurality of service virtual interfaces for a certain network card of main gateway equipment according to the number of service types when equipment is started, and enabling the plurality of service virtual interfaces to be in one-to-one correspondence with the service types of a plurality of WAN connections of slave gateway equipment, if so, connecting the slave gateway devices under the same service virtual interface to form a service network; when the slave gateway equipment registers and authenticates the master gateway equipment, the master gateway equipment distributes different gemport intervals to the subordinate slave gateway equipment; subsequent packet forwarding between the master gateway device and the slave gateway device is double-layer vlan. A source mac, a geoort id and a cvlan id carried by an uplink message from gateway equipment are recorded through a multi-service forwarding table, and are bound with a service virtual interface to form forwarding table entries. Corresponding virtual interfaces do not need to be created according to the number of the subordinate gateway devices, resources are used reasonably, and expansion of the number of the subordinate gateway devices is more flexible.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of network, in particular to a method and system for expanding the number of slave gateways in PON optical networking. BACKGROUND

[0002] Unlike the OLT (optical line terminal) networking mode, FTTO (fiber to the office) and FTTR (fiber to the room) are more suitable for small and medium-sized enterprises, home users, parks and hotels, etc. scene, providing flexible, convenient and efficient network access service. Usually, the number of ONUs (Optical Network Unit, gateway device) that can be mounted under one PON (Passive Optical Network) port of the main gateway device in such networking scheme is limited, but with the development of the market, the number of slave gateway devices supported under the main gateway device needs to be increased, and the number of slave gateway devices needs to be expanded to meet market demand. The existing main gateway device receives and processes the uplink message of the slave gateway device by creating a virtual interface corresponding to the number of slave gateway devices. This method has some defects and is not conducive to the expansion of the number of slave gateway devices.

[0003] The original main gateway has a small number of slave gateways, such as 8 or 16, which are implemented by creating the same number of virtual interfaces on the main gateway according to the number of slave gateway devices to receive messages from different slave gateway devices. However, when the number of slave gateway devices is expanded, more virtual interfaces need to be created simultaneously. This method has obvious defects. First, creating too many virtual interfaces will occupy more system resources, including memory and CPU resources, and may be limited by the hardware of the NIC (Network Interface Card). Different NICs and their drivers may have different support for virtual interfaces, and some older or low-end NICs may not support the creation of too many virtual interfaces. Moreover, too many interfaces may consume system resources, leading to performance degradation or system instability. Second, introducing too many virtual interfaces also increases the complexity of network management, increasing the risk of network communication problems. SUMMARY

[0004] The technical problem to be solved by the present application is to provide a method and system for expanding the number of slave gateways in PON optical networking, without creating corresponding virtual interfaces according to the number of slave gateway devices. This not only makes the use of system resources more reasonable, but also makes the expansion of the number of slave gateway devices more flexible, and reduces the complexity of the entire network management.

[0005] In a first aspect, the application provides a method for expanding the number of slave gateway devices in a PON optical network, wherein when the device is started, a plurality of service virtual interfaces are created for a network card of a master gateway device according to the number of service types, and the service types of the plurality of WAN connections of a slave gateway device correspond to each other one by one, and then the slave gateway devices connected to the same service virtual interface form a service network; when the number of slave gateway devices needs to be increased in the network scene without changing the number of service types, the master gateway device does not need to be modified, and the number of service virtual interfaces does not need to be increased.

[0006] When the slave gateway device registers and authenticates with the master gateway device, the master gateway device allocates different gemport intervals to the slave gateway devices.

[0007] The source mac, gemport id and cvlanid carried by the uplink message of the slave gateway device are recorded by a multi-service forwarding table, and are bound to a service virtual interface to become a forwarding table entry.

[0008] When the slave gateway device creates a WAN connection in the uplink direction and sends a message to the master gateway device, a service virtual interface of the network card receives the message of the slave gateway device, and learns the binding relationship between the source mac, gemport id and cvlan id and the corresponding service virtual interface through the multi-service forwarding table.

[0009] In a second aspect, the application provides a system for expanding the number of slave gateway devices in a PON optical network, comprising a master gateway device, a network card and a slave gateway device.

[0010] When the device is started, a plurality of service virtual interfaces are created for a network card of a master gateway device according to the number of service types, and the service types of the plurality of WAN connections of a slave gateway device correspond to each other one by one, and then the slave gateway devices connected to the same service virtual interface form a service network; when the number of slave gateway devices needs to be increased in the network scene without changing the number of service types, the master gateway device does not need to be modified, and the number of service virtual interfaces does not need to be increased.

[0011] When the slave gateway device registers and authenticates with the master gateway device, the master gateway device allocates different gemport intervals to the slave gateway devices.

[0012] The source MAC address, gemport ID, and cvlan ID carried in the uplink packets from the gateway device are recorded in the multi-service forwarding table, and then bound to the service virtual interface to form forwarding table entries.

[0013] When a WAN connection is created from the gateway device and a packet is sent to the main gateway device in the uplink direction, a certain service virtual interface of the network card receives the packet from the gateway device and learns the binding relationship between the source MAC, gemport id, and cvlan id and the corresponding service virtual interface through the multi-service forwarding table.

[0014] The technical solution provided by this invention has at least the following technical effects or advantages: This invention modifies the existing method of creating corresponding virtual interfaces based on the number of downstream gateway devices to creating virtual interfaces based on the number of service types. Typically, the number of service types is much smaller than the number of downstream gateway devices. By dividing virtual interfaces by service type, when the networking scenario requires increasing the number of downstream gateway devices, the main gateway device requires virtually no modification and does not need to increase the number of virtual interfaces. Different service flows sent in the uplink direction by all downstream gateway devices connected to the main gateway device will be distributed to the corresponding service virtual interfaces for reception and processing. Compared to the existing technology of creating corresponding virtual interfaces based on the number of downstream gateway devices, this invention not only makes more rational use of system resources but also makes the expansion of the number of downstream gateway devices more flexible and reduces the complexity of overall network management. Furthermore, this invention introduces a multi-service forwarding table to record the source MAC address, SVLAN (gemport ID), and CVLAN ID (service VLAN) carried in the uplink packets of the downstream gateway devices. These are bound to virtual interfaces to form forwarding table entries, which not only facilitates correct interaction between the main and downstream gateway devices but also enables pontopon functionality and blacklist interception functionality.

[0015] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0016] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0017] Figure 1 This is a schematic diagram of the system framework of the present invention;

[0018] Figure 2 This is a flowchart of the method in Embodiment 1 of the present invention;

[0019] Figure 3 A schematic diagram of the business virtual interface created for this invention;

[0020] Figure 4 This is an example diagram of the multi-service forwarding table of the present invention;

[0021] Figure 5 This is a schematic diagram illustrating the process of the gateway receiving uplink messages according to the present invention.

[0022] Figure 6 This is a schematic diagram illustrating the process of the main gateway device sending downlink messages according to the present invention.

[0023] Figure 7 This is a flowchart illustrating the process of implementing the PON to PON forwarding function in this invention. Detailed Implementation

[0024] This application provides a method and system for expanding the number of slave gateways in a PON optical network. It eliminates the need to create corresponding virtual interfaces based on the number of slave gateway devices, making the use of system resources more reasonable, increasing the number of slave gateway devices more flexible, and reducing the complexity of the entire network management.

[0025] The technical solution in this application embodiment follows the general idea as follows: Virtual interfaces are created based on the number of service types performed by the slave gateway devices connected to the main gateway device. Typically, the number of service types is much smaller than the number of slave gateway devices. This way, when the network scenario requires increasing the number of slave gateway devices, the main gateway device requires minimal modification and does not need to increase the number of virtual interfaces. Different service flows sent in the uplink direction by all slave gateway devices connected to the main gateway device will be distributed to the corresponding service virtual interfaces for reception and processing. Compared to existing technologies that create corresponding virtual interfaces based on the number of connected slave gateway devices, this invention not only makes more rational use of system resources and allows for more flexible expansion of the number of connected slave gateway devices, but also reduces the complexity of overall network management.

[0026] Before introducing specific embodiments, the system framework corresponding to the method in the embodiments of this application will be introduced first, such as... Figure 1 As shown, the system can be roughly divided into two parts:

[0027] The main gateway device is a crucial component of the network architecture, playing a key role, especially in smart home and enterprise network systems. It typically acts as the core node, responsible for connecting different networks, managing network traffic, and controlling other network devices. The main gateway device is equipped with a network interface card (NIC) and a PON processing module. In this invention, the NIC refers to the physical network interface (eth1 in the diagram), and several virtual NIC interfaces (eth1.1 to eth1.8 in the diagram) are created based on this physical interface; these are the virtual service interfaces. The PON processing module is connected to the NIC via a parallel bus interface (serdes), and has multiple PON interfaces.

[0028] A splitter connects a PON interface to multiple slave gateway devices to split optical signals.

[0029] The slave gateway device connects to the master gateway via an optical splitter, executes the master gateway's commands, and extends the network coverage. The slave gateway device may forward data to the master gateway or communicate directly with other devices under the master gateway's instructions.

[0030] Example 1

[0031] like Figure 2 As shown, this embodiment provides a method for expanding the number of slave gateways in a PON optical network.

[0032] When the device starts up, based on the number of service types, multiple service virtual interfaces are created for a certain network card of the main gateway device, corresponding one-to-one with the service types of multiple WAN connections of the slave gateway device. Then, slave gateway devices connected to the same service virtual interface form a service network. Under the premise that the number of service types remains unchanged, when the networking scenario requires to increase the number of slave gateway devices, the main gateway device does not need to be modified and the number of service virtual interfaces does not need to be increased.

[0033] like Figure 3 As shown, taking a network scenario with one main gateway device supporting 128 slave gateway devices and 8 service network types as an example, to support the 128 slave gateway devices, the device creates 8 virtual service interfaces (eth1.1 to eth8) based on the network card eth1 upon startup, corresponding one-to-one with the 8 WAN connection services of the slave gateway devices. All slave gateway devices under one service virtual interface constitute one service network, namely eth1.1 to eth8, a total of 8 service networks.

[0034] When a slave gateway device registers and authenticates with the master gateway device, the master gateway device assigns different gemport ranges to the slave gateway devices. Subsequent packet forwarding between the master and slave gateway devices is done using a two-layer VLAN, where the outer svlan represents the gemport and the inner cvlan represents the service VLAN.

[0035] The source MAC address, gemport ID, and cvlan ID carried in the uplink packets from the gateway device are recorded in the multi-service forwarding table, and then bound to the service virtual interface to form forwarding table entries.

[0036] like Figure 4 The image shows an example of a multi-service forwarding table, where the mac column represents the MAC address, and the c_vlan and s_vlan columns represent the cvlan ID and gemport ID, respectively.

[0037] When a WAN connection is created from the gateway device and a packet is sent to the main gateway device in the uplink direction, a certain service virtual interface of the network card receives the packet from the gateway device and learns the binding relationship between the source MAC, gemport id, and cvlan id and the corresponding service virtual interface through the multi-service forwarding table.

[0038] The interaction between master and slave gateway devices includes the following scenarios:

[0039] Downlink direction of unicast stream: When the downlink packet is sent from the service virtual interface, the corresponding gemportid and service vlan id are first found through the multi-service forwarding table, and the correct svlantag and cvlantag are added to the downlink packet before it is sent;

[0040] Unicast stream uplink direction: When the uplink packet is received by the network card, the gemport id and service VLAN id in the uplink packet are obtained first. The binding relationship between the service VLAN id and the service virtual interface is learned through the multi-service forwarding table, so as to know which service virtual interface the uplink packet belongs to.

[0041] Downlink direction of multicast stream: When the downlink multicast stream is sent from the service virtual interface, the cvlan tag is added to the downlink packet according to the binding relationship between the service VLAN ID set in the downlink multicast stream and the service virtual interface, and the correct svlan tag is added according to the gemport ID set in the downlink multicast stream;

[0042] Uplink direction of multicast stream: When the uplink multicast stream is received by the network card, the gemport id and service VLAN id in the uplink packet are obtained first. The binding relationship between the service VLAN id and the service virtual interface is learned through the multi-service forwarding table, so as to know which service virtual interface the uplink packet belongs to.

[0043] Downlink direction of broadcast stream: When the downlink broadcast stream is sent from the service virtual interface, the cvlan tag is added to the downlink packet through the binding relationship between the service VLAN ID set in the downlink multicast stream and the service virtual interface, and the correct svlan tag is added through the gemport ID set in the downlink broadcast stream;

[0044] Uplink direction of broadcast stream: When the uplink broadcast stream is received by the network card, the gemport id and service VLAN id in the uplink packet are obtained first. The binding relationship between the service VLAN id and the service virtual interface is learned through the multi-service forwarding table, so as to know which service virtual interface the uplink packet belongs to.

[0045] Ponto Pon forwarding function: When the network card receives a packet carrying svlantag and cvlantag from a service virtual interface, it first removes the svlan tag and cvlantag and updates the forwarding table. Then, it checks whether there is a corresponding entry in the forwarding table based on the destination MAC address. If so, it determines whether the corresponding entry belongs to the same service network as the cvlan of the packet. If so, it forwards the packet to Ponto Pon.

[0046] like Figure 5 As shown, in the receiving direction, the network interface card (NIC) learns from the packets received by the virtual interface eth1.x, recording its svlan, cvlan, source MAC address, and virtual interface binding information, and also recording its aging time. The specific process for the NIC to receive uplink packets is as follows:

[0047] The network card checks if the packet contains an svlan. If it does, the svlan is removed and the process proceeds to the next step. If not, the packet is discarded and the process ends.

[0048] Check if the packet contains a CVLAN. If it does, remove the CVLAN and proceed to the next step. If not, discard the packet and end the process.

[0049] Determine if the CVLAN matches the service VLAN. If it does, search the multi-service forwarding table and proceed to the next step. If not, discard the packet and end the process.

[0050] Determine if the relevant entries in the multi-service forwarding table exist. If yes, update the aging time of the entries. If no, add the source MAC address and the stripped svlan and cvlan to the multi-service forwarding table.

[0051] The network interface card (NIC) sends messages to the main gateway device or forwards messages to another slave gateway device.

[0052] like Figure 6 As shown, when the primary gateway device sends a downlink packet, it first correctly encapsulates the packet using the multi-service forwarding table before forwarding it to the corresponding secondary gateway device. Specifically:

[0053] The main gateway device sends packets in the downlink direction and determines whether the packet type is unicast, multicast, or broadcast.

[0054] If the message type is unicast, check if there is a relevant entry in the multi-service forwarding table. If not, discard the message. If yes, obtain the relevant entry in the multi-service forwarding table, add svlan and cvlan encapsulation, and then continue to send the message.

[0055] If the message type is multicast or broadcast, the binding relationship between the service VLAN ID set in the multicast or broadcast stream and the service virtual interface, as well as the gemport ID set in the broadcast stream, are added to the message with a cvlan tag and the correct svlan tag before continuing to send the message.

[0056] like Figure 7 As shown, the pontopon function of this invention is essentially implemented through a multi-service forwarding table. When the service virtual network interface eth1.1 receives a packet carrying svlan=256 and cvlan=100, it first removes the tag and updates the multi-service forwarding table. Then, it checks whether a corresponding entry exists in the multi-service forwarding table based on the destination MAC address. If it exists, it further determines whether the destination corresponding to the entry belongs to the same service network as the packet's cvlan. If so, it indicates that the packet needs to go through the pontopon forwarding process. Figure 7 In the same example, since the CVLANs are all 100, they belong to the same service network. Therefore, PON-to-PON forwarding is performed, and the SVLAN is modified to VLAN 257, which is the same as the gemport assigned to the other slave gateway device recorded in the forwarding table, while the CVLAN remains unchanged.

[0057] In addition, the multi-service forwarding table can also be configured with a blacklist, allowing users to add entries as needed. This blacklist enables the interception of uplink packets from the gateway device. During the processing of packets received at the service virtual interface, a check is added to determine if the packet's source MAC address is in the blacklist; if so, the packet is discarded.

[0058] Example 2

[0059] Based on the same inventive concept, this application also provides an apparatus corresponding to the method in Embodiment 1, as detailed in Embodiment 2. Figure 1 As shown, this embodiment provides a system for expanding the number of slave gateways in a PON optical network, including a master gateway device, a network interface card (NIC), and slave gateway devices;

[0060] When the device starts up, based on the number of service types, multiple service virtual interfaces are created for a certain network card of the main gateway device, corresponding one-to-one with the service types of multiple WAN connections of the slave gateway device. Then, slave gateway devices connected to the same service virtual interface form a service network. Under the premise that the number of service types remains unchanged, when the networking scenario requires to increase the number of slave gateway devices, the main gateway device does not need to be modified and the number of service virtual interfaces does not need to be increased.

[0061] When a slave gateway device registers and authenticates with the master gateway device, the master gateway device assigns different gemport ranges to the slave gateway devices. Subsequent packet forwarding between the master and slave gateway devices is done using a two-layer VLAN, where the outer svlan represents the gemport and the inner cvlan represents the service VLAN.

[0062] The source MAC address, gemport ID, and cvlan ID carried in the uplink packets from the gateway device are recorded in the multi-service forwarding table, and then bound to the service virtual interface to form forwarding table entries.

[0063] When a WAN connection is created from the gateway device and a packet is sent to the main gateway device in the uplink direction, a certain service virtual interface of the network card receives the packet from the gateway device and learns the binding relationship between the source MAC, gemport id, and cvlan id and the corresponding service virtual interface through the multi-service forwarding table.

[0064] The interaction between master and slave gateway devices includes the following scenarios:

[0065] Downlink direction of unicast stream: When the downlink packet is sent from the service virtual interface, the corresponding gemportid and service vlan id are first found through the multi-service forwarding table, and the correct svlantag and cvlantag are added to the downlink packet before it is sent;

[0066] Unicast stream uplink direction: When the uplink packet is received by the network card, the gemport id and service VLAN id in the uplink packet are obtained first. The binding relationship between the service VLAN id and the service virtual interface is learned through the multi-service forwarding table, so as to know which service virtual interface the uplink packet belongs to.

[0067] Downlink direction of multicast stream: When the downlink multicast stream is sent from the service virtual interface, the cvlan tag is added to the downlink packet according to the binding relationship between the service VLAN ID set in the downlink multicast stream and the service virtual interface, and the correct svlan tag is added according to the gemport ID set in the downlink multicast stream;

[0068] Uplink direction of multicast stream: When the uplink multicast stream is received by the network card, the gemport id and service VLAN id in the uplink packet are obtained first. The binding relationship between the service VLAN id and the service virtual interface is learned through the multi-service forwarding table, so as to know which service virtual interface the uplink packet belongs to.

[0069] Downlink direction of broadcast stream: When the downlink broadcast stream is sent from the service virtual interface, the cvlan tag is added to the downlink packet through the binding relationship between the service VLAN ID set in the downlink multicast stream and the service virtual interface, and the correct svlan tag is added through the gemport ID set in the downlink broadcast stream;

[0070] Uplink direction of broadcast stream: When the uplink broadcast stream is received by the network card, the gemport id and service VLAN id in the uplink packet are obtained first. The binding relationship between the service VLAN id and the service virtual interface is learned through the multi-service forwarding table, so as to know which service virtual interface the uplink packet belongs to.

[0071] Ponto Pon forwarding function: When the network card receives a packet carrying svlantag and cvlantag from a service virtual interface, it first removes the svlan tag and cvlantag and updates the forwarding table. Then, it checks whether there is a corresponding entry in the forwarding table based on the destination MAC address. If so, it determines whether the corresponding entry belongs to the same service network as the cvlan of the packet. If so, it forwards the packet to Ponto Pon.

[0072] The specific process for the network card to receive uplink packets is as follows:

[0073] The network card checks if the packet contains an svlan. If it does, the svlan is removed and the process proceeds to the next step. If not, the packet is discarded and the process ends.

[0074] Check if the packet contains a CVLAN. If it does, remove the CVLAN and proceed to the next step. If not, discard the packet and end the process.

[0075] Determine if the CVLAN matches the service VLAN. If it does, search the multi-service forwarding table and proceed to the next step. If not, discard the packet and end the process.

[0076] Determine if the relevant entries in the multi-service forwarding table exist. If yes, update the aging time of the entries. If no, add the source MAC address and the stripped svlan and cvlan to the multi-service forwarding table.

[0077] The network interface card (NIC) sends messages to the main gateway device or forwards messages to another slave gateway device.

[0078] When the primary gateway device sends a downlink packet, it first correctly encapsulates the packet using the multi-service forwarding table before forwarding it to the corresponding secondary gateway device. Specifically:

[0079] The main gateway device sends packets in the downlink direction and determines whether the packet type is unicast, multicast, or broadcast.

[0080] If the message type is unicast, check if there is a relevant entry in the multi-service forwarding table. If not, discard the message. If yes, obtain the relevant entry in the multi-service forwarding table, add svlan and cvlan encapsulation, and then continue to send the message.

[0081] If the message type is multicast or broadcast, the binding relationship between the service VLAN ID set in the multicast or broadcast stream and the service virtual interface, as well as the gemport ID set in the broadcast stream, are added to the message with a cvlan tag and the correct svlan tag before continuing to send the message.

[0082] The multi-service forwarding table also includes a blacklist, which is used to intercept uplink packets from the gateway device. Since the apparatus described in Embodiment 2 of this invention is the same apparatus used to implement the method of Embodiment 1, those skilled in the art can understand the specific structure and variations of this apparatus based on the method described in Embodiment 1, and therefore will not be repeated here. All apparatuses used in the method of Embodiment 1 of this invention fall within the scope of protection of this invention.

[0083] While specific embodiments of the present invention have been described above, those skilled in the art should understand that the specific embodiments described are merely illustrative and not intended to limit the scope of the present invention. Equivalent modifications and variations made by those skilled in the art in accordance with the spirit of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A method for expanding the number of slave gateways in a PON optical network, characterized in that: When the device starts up, based on the number of service types, multiple service virtual interfaces are created for a certain network card of the main gateway device, corresponding one-to-one with the service types of multiple WAN connections of the slave gateway device. Then, slave gateway devices connected to the same service virtual interface form a service network. Under the premise that the number of service types remains unchanged, when the networking scenario requires to increase the number of slave gateway devices, the main gateway device does not need to be modified and the number of service virtual interfaces does not need to be increased. When a slave gateway device registers and authenticates with the master gateway device, the master gateway device assigns different gemport ranges to the slave gateway devices. Subsequent packet forwarding between master and slave gateway devices uses a two-layer VLAN, where the outer svlan represents gemport and the inner cvlan represents service VLAN; The source MAC address, gemport ID, and cvlan ID carried in the uplink packets from the gateway device are recorded in the multi-service forwarding table, and then bound to the service virtual interface to form forwarding table entries. When a WAN connection is created from the gateway device and a packet is sent to the main gateway device in the uplink direction, a certain service virtual interface of the network card receives the packet from the gateway device and learns the binding relationship between the source MAC, gemport id, and cvlan id and the corresponding service virtual interface through the multi-service forwarding table.

2. The method for expanding the number of slave gateways in a PON optical network according to claim 1, characterized in that: The interaction between master and slave gateway devices includes the following scenarios: Downlink direction of unicast stream: When the downlink packet is sent from the service virtual interface, the corresponding gemportid and service vlan id are first found through the multi-service forwarding table, and the correct svlantag and cvlantag are added to the downlink packet before it is sent; Unicast stream uplink direction: When the uplink packet is received by the network card, the gemport id and service VLAN id in the uplink packet are obtained first. The binding relationship between the service VLAN id and the service virtual interface is learned through the multi-service forwarding table, so as to know which service virtual interface the uplink packet belongs to. Downlink direction of multicast stream: When the downlink multicast stream is sent from the service virtual interface, the cvlan tag is added to the downlink packet according to the binding relationship between the service VLAN ID set in the downlink multicast stream and the service virtual interface, and the correct svlan tag is added according to the gemport ID set in the downlink multicast stream; Uplink direction of multicast stream: When the uplink multicast stream is received by the network card, the gemport id and service VLAN id in the uplink packet are obtained first. The binding relationship between the service VLAN id and the service virtual interface is learned through the multi-service forwarding table, so as to know which service virtual interface the uplink packet belongs to. Downlink direction of broadcast stream: When the downlink broadcast stream is sent from the service virtual interface, the cvlan tag is added to the downlink packet through the binding relationship between the service VLAN ID set in the downlink multicast stream and the service virtual interface, and the correct svlan tag is added through the gemport ID set in the downlink broadcast stream; Uplink direction of broadcast stream: When the uplink broadcast stream is received by the network card, the gemport id and service VLAN id in the uplink packet are obtained first. The binding relationship between the service VLAN id and the service virtual interface is learned through the multi-service forwarding table, so as to know which service virtual interface the uplink packet belongs to. Ponto Pon forwarding function: When the network card receives a packet carrying svlantag and cvlantag from a service virtual interface, it first removes the svlan tag and cvlantag and updates the forwarding table. Then, it checks whether there is a corresponding entry in the forwarding table based on the destination MAC address. If so, it determines whether the corresponding entry belongs to the same service network as the cvlan of the packet. If so, it forwards the packet to Ponto Pon.

3. The method for expanding the number of slave gateways in a PON optical network according to claim 1, characterized in that: The specific process for the network card to receive uplink packets is as follows: The network card checks if the packet contains an svlan. If it does, the svlan is removed and the process proceeds to the next step. If not, the packet is discarded and the process ends. Check if the packet contains a CVLAN. If it does, remove the CVLAN and proceed to the next step. If not, discard the packet and end the process. Determine if the CVLAN matches the service VLAN. If it does, search the multi-service forwarding table and proceed to the next step. If not, discard the packet and end the process. Determine if the relevant entries in the multi-service forwarding table exist. If yes, update the aging time of the entries. If no, add the source MAC address and the stripped svlan and cvlan to the multi-service forwarding table. The network interface card (NIC) sends messages to the main gateway device or forwards messages to another slave gateway device.

4. The method for expanding the number of slave gateways in a PON optical network according to claim 1, characterized in that: When the primary gateway device sends a downlink packet, it first correctly encapsulates the packet using the multi-service forwarding table before forwarding it to the corresponding secondary gateway device. Specifically: The main gateway device sends packets in the downlink direction and determines whether the packet type is unicast, multicast, or broadcast. If the message type is unicast, check if there is a relevant entry in the multi-service forwarding table. If not, discard the message. If yes, obtain the relevant entry in the multi-service forwarding table, add svlan and cvlan encapsulation, and then continue to send the message. If the message type is multicast or broadcast, the binding relationship between the service VLAN ID set in the multicast or broadcast stream and the service virtual interface, as well as the gemport ID set in the broadcast stream, are added to the message with a cvlan tag and the correct svlan tag before continuing to send the message.

5. The method for expanding the number of slave gateways in a PON optical network according to claim 1, characterized in that: The multi-service forwarding table also includes a blacklist, which is used to intercept uplink packets from the gateway device.

6. A system for expanding the number of gateways in a PON optical network, characterized in that: This includes the main gateway device, network interface card (NIC), and slave gateway devices; When the device starts up, based on the number of service types, multiple service virtual interfaces are created for a certain network card of the main gateway device, corresponding one-to-one with the service types of multiple WAN connections of the slave gateway device. Then, slave gateway devices connected to the same service virtual interface form a service network. Under the premise that the number of service types remains unchanged, when the networking scenario requires to increase the number of slave gateway devices, the main gateway device does not need to be modified and the number of service virtual interfaces does not need to be increased. When a slave gateway device registers and authenticates with the master gateway device, the master gateway device assigns different gemport ranges to the slave gateway devices. Subsequent packet forwarding between master and slave gateway devices uses a two-layer VLAN, where the outer svlan represents gemport and the inner cvlan represents service VLAN; The source MAC address, gemport ID, and cvlan ID carried in the uplink packets from the gateway device are recorded in the multi-service forwarding table, and then bound to the service virtual interface to form forwarding table entries. When a WAN connection is created from the gateway device and a packet is sent to the main gateway device in the uplink direction, a certain service virtual interface of the network card receives the packet from the gateway device and learns the binding relationship between the source MAC, gemport id, and cvlan id and the corresponding service virtual interface through the multi-service forwarding table.

7. A system for expanding the number of slave gateways in a PON optical network according to claim 6, characterized in that: The interaction between master and slave gateway devices includes the following scenarios: Downlink direction of unicast stream: When the downlink packet is sent from the service virtual interface, the corresponding gemportid and service vlan id are first found through the multi-service forwarding table, and the correct svlantag and cvlantag are added to the downlink packet before it is sent; Unicast stream uplink direction: When the uplink packet is received by the network card, the gemport id and service VLAN id in the uplink packet are obtained first. The binding relationship between the service VLAN id and the service virtual interface is learned through the multi-service forwarding table, so as to know which service virtual interface the uplink packet belongs to. Downlink direction of multicast stream: When the downlink multicast stream is sent from the service virtual interface, the cvlan tag is added to the downlink packet according to the binding relationship between the service VLAN ID set in the downlink multicast stream and the service virtual interface, and the correct svlan tag is added according to the gemport ID set in the downlink multicast stream; Uplink direction of multicast stream: When the uplink multicast stream is received by the network card, the gemport id and service VLAN id in the uplink packet are obtained first. The binding relationship between the service VLAN id and the service virtual interface is learned through the multi-service forwarding table, so as to know which service virtual interface the uplink packet belongs to. Downlink direction of broadcast stream: When the downlink broadcast stream is sent from the service virtual interface, the cvlan tag is added to the downlink packet through the binding relationship between the service VLAN ID set in the downlink multicast stream and the service virtual interface, and the correct svlan tag is added through the gemport ID set in the downlink broadcast stream; Uplink direction of broadcast stream: When the uplink broadcast stream is received by the network card, the gemport id and service VLAN id in the uplink packet are obtained first. The binding relationship between the service VLAN id and the service virtual interface is learned through the multi-service forwarding table, so as to know which service virtual interface the uplink packet belongs to. Ponto Pon forwarding function: When the network card receives a packet carrying svlantag and cvlantag from a service virtual interface, it first removes the svlan tag and cvlantag and updates the forwarding table. Then, it checks whether there is a corresponding entry in the forwarding table based on the destination MAC address. If so, it determines whether the corresponding entry belongs to the same service network as the cvlan of the packet. If so, it forwards the packet to Ponto Pon.

8. A system for expanding the number of slave gateways in a PON optical network according to claim 6, characterized in that: The specific process for the network card to receive uplink packets is as follows: The network card checks if the packet contains an svlan. If it does, the svlan is removed and the process proceeds to the next step. If not, the packet is discarded and the process ends. Check if the packet contains a CVLAN. If it does, remove the CVLAN and proceed to the next step. If not, discard the packet and end the process. Determine if the CVLAN matches the service VLAN. If it does, search the multi-service forwarding table and proceed to the next step. If not, discard the packet and end the process. Determine if the relevant entries in the multi-service forwarding table exist. If yes, update the aging time of the entries. If no, add the source MAC address and the stripped svlan and cvlan to the multi-service forwarding table. The network interface card (NIC) sends messages to the main gateway device or forwards messages to another slave gateway device.

9. A system for expanding the number of slave gateways in a PON optical network according to claim 6, characterized in that: When the primary gateway device sends a downlink packet, it first correctly encapsulates the packet using the multi-service forwarding table before forwarding it to the corresponding secondary gateway device. Specifically: The main gateway device sends packets in the downlink direction and determines whether the packet type is unicast, multicast, or broadcast. If the message type is unicast, check if there is a relevant entry in the multi-service forwarding table. If not, discard the message. If yes, obtain the relevant entry in the multi-service forwarding table, add svlan and cvlan encapsulation, and then continue to send the message. If the message type is multicast or broadcast, the binding relationship between the service VLAN ID set in the multicast or broadcast stream and the service virtual interface, as well as the gemport ID set in the broadcast stream, are added to the message with a cvlan tag and the correct svlan tag before continuing to send the message.

10. A system for expanding the number of slave gateways in a PON optical network according to claim 6, characterized in that: The multi-service forwarding table also includes a blacklist, which is used to intercept uplink packets from the gateway device.