A home intelligent gateway
By using the switching chip and data processing chip of the home smart gateway to monitor and adjust the connection relationship of Ethernet ports, the problem of information forwarding between router LAN ports is solved, achieving secure binding and high-speed network.
Patent Information
- Application Number
- CN202211129520.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-31
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2042-05-31
AI Technical Summary
Information forwarding between different LAN ports of the router does not pass through the CPU, causing the CPU to be unable to recognize the packets and thus unable to perform binding, parental controls, or packet security checks.
A home smart gateway, including a switching chip and a data processing chip, is used to monitor the network speed of the Ethernet port. When the network speed exceeds a preset threshold, the relationship between the Ethernet port and the cascaded port is adjusted. A conflict handling module in the data processing center is configured to realize the identification and security check of the cascaded port.
It improves the network speed of the home smart gateway, avoids Ethernet port congestion, and enables secure binding and packet security checks between LAN ports.
Smart Images

Figure CN115514705B_ABST
Abstract
Description
[0001] This application is a divisional application. The application number of the original application is 202210611792.0, and the filing date of the original application is May 31, 2022. The entire contents of the original application are incorporated into this application by reference. Technical Field
[0002] The present application relates to the field of communication technology, and in particular to a home smart gateway. Background Art
[0003] A router is a device that connects the local area networks and wide area networks on the Internet. It automatically selects and sets routes based on the channel conditions, sending signals in a forward and backward order via the best path.
[0004] The router has multiple LAN ports, one of which is connected to the CPU, and the other LAN ports first send messages to the LAN port connected to the CPU, and then to the CPU. The information forwarding between different LAN ports does not pass through the CPU, resulting in the CPU being unable to identify the Ethernet port that receives the message, and unable to implement binding, parental control or message security inspection. Summary of the invention
[0005] The present application provides a home smart gateway to improve the security of connection information between different LAN ports inside a router.
[0006] In order to solve the above technical problems, the embodiments of the present application disclose the following technical solutions:
[0007] The embodiment of the present application discloses a home intelligent gateway, including: a switching chip and a data processing chip,
[0008] The switching chip comprises:
[0009] The Ethernet port is connected to the user terminal and includes: a first port, a second port and a third port;
[0010] A first cascade port, the first port and the second port being connected to the first cascade port;
[0011] a second cascade port, wherein the second cascade port is connected to the third port;
[0012] The data processing chip comprises:
[0013] A first main port connected to the first cascade port;
[0014] A second main port connected to the second cascade port;
[0015] The data processing center is connected to the first main port and the second main port. When the message of the first port flows to the second port and the current rate of the first port is greater than the upper limit of a preset threshold, the first port is configured to be connected to the second cascade port.
[0016] Beneficial effects:
[0017] The embodiment of the present application provides a home smart gateway, including: a switching chip and a data processing chip. The switching chip includes: an Ethernet port connected to a user terminal, including: a first port, a second port and a third port; a first cascade port, the first port and the second port are connected to the first cascade port; a second cascade port, the second cascade port is connected to the third port. The data processing chip includes: a first main port connected to the first cascade port; a second main port connected to the second cascade port; a data processing center connected to the first main port and the second main port, the message of the first port flows to the second port, and when the current rate of the first port is greater than the upper limit of a preset threshold, the first port is configured to be connected to the second cascade port. The home smart gateway provided by the present application can monitor the network speed of the Ethernet port, and when the network speed exceeds the preset threshold, adjust the relationship between the Ethernet port and the cascade port to avoid congestion of the Ethernet port and improve the network speed of the home smart gateway. The data processing center is provided with a conflict handling module, which is used to modify the value of the current VLAN to an unused VLAN value when the value of the newly added service VLAN is equal to the value of the current VLAN, and synchronously update the configuration of the switching chip, so as to realize the recognition of the cascade port for the port to which it is connected.
[0018] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0020] Figure 1 An application scenario of a home smart gateway provided in an embodiment of the present application;
[0021] Figure 2 A schematic diagram of a router structure provided in an embodiment of the present application;
[0022] Figure 3 The port-vlan relationship shown in this application is intended to represent the intent;
[0023] Figure 4 For this application Figure 2 The cascade relationship indicates the intention;
[0024] Figure 5 The port-mac relationship provided for this application is intended;
[0025] Figure 6 A schematic diagram of the structure of a data processing chip provided in an embodiment of the present application;
[0026] Figure 7 A flow chart of a cascade acceleration method provided in this application;
[0027] Figure 8 A schematic diagram of another router structure provided in an embodiment of the present application;
[0028] Fig. 9 For this application Figure 8 The router cascade relationship diagram shown;
[0029] Fig.10 A cascade acceleration method process provided in the embodiment of the present application Figure 2 . DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0031] Figure 1 This is an application scenario of a home smart gateway provided by an embodiment of the present application. Figure 1 As shown, the user terminal 100 provides access information. The home intelligent gateway includes a router 200, which selects a message path and connects to an external server 300 according to routing, bridging or other business rules.
[0032] The external server 300 responds to the access information by sending a response message. The router 200 receives the response message and forwards the response message to the user terminal.
[0033] Figure 2 A schematic diagram of a router structure provided in an embodiment of the present application. Figure 2As shown in , the router includes: a switching chip and a CPU. Among them: the switching chip is provided with an Ethernet port and a cascade port. The Ethernet port includes a plurality of LAN ports or WAN ports, or a plurality of LAN ports and WAN ports. In the example of the present application, the router is provided with a first LAN port, a second LAN port, and a third LAN port, which are connected to the user terminal, and the WAN port is connected to the wide area network communication device. The user terminal can be an Internet access device such as a mobile phone or a computer. In the present application, for the convenience of introduction, the first LAN port is referred to as port1, the second LAN port is referred to as port2, the third LAN port is referred to as port3, and the WAN port is referred to as port4.
[0034] The cascade ports include a first cascade port referred to as port5 and a second cascade port referred to as port6. The CPU includes: a first master port and a second master port. A cascade acceleration module is set in the CPU. According to the message flow direction in the router, the connection mode of the cascade port and the master port is configured. The first master port cport1 is connected to the first cascade port port5, and the second master port port2 is connected to the second cascade port port6. The CPU records the cascade relationship table.
[0035] In the present application, the first cascade port port5 is a LAN cascade port; the second cascade port port6 is a WAN cascade port.
[0036] The port-vlan relationship table of the Ethernet port preset in the CPU, where port refers to the Ethernet port of the switching chip. The number of ports is related to the product form. In this application, there are 4 Ethernet ports, namely port1, port2, port3, and port4.
[0037] The Ethernet port receives the message and adds a VLAN tag field to the message to distinguish the port. The CPU processes the tagged message, identifies the port according to the port-VLAN relationship table, and removes or modifies the VLAN tag field in the message to achieve advanced functions such as security and binding between Ethernet ports.
[0038] Specifically, in an embodiment of the present application, the vlan tag field may be an 802.1Q tag field according to the protocol.
[0039] For example, when a message enters the first cascade port port5 of the CPU from the first LAN port via the LAN cascade port, the message carries a VLAN tag field. The CPU performs port identification on the message according to the port-VLAN relationship table. If the corresponding VLAN in the configuration is allowed to pass, the CPU removes the VLAN tag field in the message and reports the message. If the corresponding VLAN in the configuration is not allowed to pass, the CPU removes the VLAN tag field in the message and discards the message.
[0040] Figure 3 The port-vlan relationship shown in this application is schematic. Figure 4 For this application Figure 2 The cascade relationship is shown in Figure 1. Figure 3 The port-vlan relationship table in the CPU shown in FIG. 1 includes: port name and vlan. The vlan includes: identification vlan and service vlan. The vlan includes vlan index and vlan id value. The index represents the type and port attributes of the vlan. The vlan id value represents the vlan tag value, which corresponds to the vlan field in the message.
[0041] The CPU also sets a cascade relationship table, such as Figure 4 As shown, it indicates the connection relationship between the cascade port and the Ethernet port. Figure 2 Correspondingly, as shown in , the first LAN port, the second LAN port, and the third LAN port are connected to the LAN cascade port, and the WAN port is connected to the WAN cascade port; the LAN cascade port is connected to the first main port, and the WAN cascade port is connected to the second main port.
[0042] The router service VLAN index of the present application includes: Ethernet port index, configuration type index, index of the VLAN sequence of this type configured on the Ethernet port, and conversion type index.
[0043] Specifically, the service vlan index of the router in the present application can be vlan xyzt, where x represents the Ethernet port index; y represents the configuration type index, y is 0 for adding the specified vlan type, y is 1 for allowing the specified vlan to pass; z represents the sequence index of the type of vlan configured for the Ethernet port; t is the vlan conversion mode mark, t is 0 for the service vlan configured by the user, and t is 1 for the conversion vlan of the corresponding service vlan. For example, vlan 1.0.1.0 represents the service vlan that needs to be added to the Ethernet port port1 in the user configuration; vlan2.1.2.0 represents the second vlan that needs to be allowed to pass through the Ethernet port port2 in the user configuration.
[0044] Identify the vlan index as vlan px, where px represents the Ethernet port index.
[0045] After receiving the message, the Ethernet port of the switching chip adds the message VLAN tag field to the message according to the VLAN configuration, or modifies the VLAN tag and releases / discards the message.
[0046] The CPU can determine the type of the message by comparing the message VLAN tag field with the port-VLAN, and then process it according to the message type.
[0047] In the application, when the system starts, a port-vlan relationship table is generated. The vlan is identified by vlan_px, and its value selects the unused vlan id as the default value. For example, the values of vlan_p1, vlan_p2, vlan_p3, and vlan_p4 are 101, 102, 103, and 104 respectively. The service vlan is empty.
[0048] The identification VLAN is configured to the corresponding port respectively. The rule is to add the identification VLAN tag to the untag (uplink) message, which is recorded as VLANC. According to the hardware configuration relationship at this time, the VLAN under the Ethernet port corresponding to the first cascade port is configured to the first cascade port; the VLAN under the Ethernet port corresponding to the second cascade port is configured to the second cascade port.
[0049] As shown in the figure, the identification VLANs of the first LAN port, the second LAN port, and the third LAN port are configured to the LAN cascade port, and the identification VLAN corresponding to the WAN port is configured to the WAN cascade port.
[0050] In this application, the data processing center is provided with a conflict handling module. When configuring the service vlan, if the value of the newly added service vlan is the same as the value of the current vlan, the value of the current vlan is modified to an unused vlan value. Among them, the selection range of the unused vlan value is 1-4095, and it is different from all other service vlans and identification vlans, and the configuration of the modified current vlan value in the hardware is synchronously updated.
[0051] When the QinQ mode is configured:
[0052] Processing of identification VLAN: configure the identification VLAN of the Ethernet port to the corresponding port of the switching chip and the corresponding cascade port. The rule is to add the value of the identification VLAN corresponding to the Ethernet port to all messages as the outer VLAN tag field of the message, which is used to mark the Ethernet port that receives the message.
[0053] The service VLAN is configured to the corresponding service VLAN index vlan xyz0, and the hardware configuration is not updated and it is returned directly.
[0054] When configured in VLAN translation mode:
[0055] Configure the identification vlan to the corresponding cascade port. As shown in the figure, according to the hardware configuration relationship at this time, the vlan under the Ethernet port corresponding to the first cascade port is configured to the first cascade port; the vlan under the Ethernet port corresponding to the second cascade port is configured to the second cascade port. The rule for identifying vlan is to add the value of identifying vlan to the message as the outer vlan tag field of the message.
[0056] Service VLAN: save the service VLAN to the corresponding service VLAN index vlanx.yz0 according to the type, number and corresponding Ethernet port of the service VLAN.
[0057] The specific configuration process of adding a new service VLAN under the VLAN conversion function is as follows:
[0058] If the y in the newly added service VLAN index vlan xyz0 is type 0, then:
[0059] Traverse all identification vlans. If the value is different from all identification vlans, the hardware configuration is not updated and it is returned directly. If the value is the same as a certain identification vlan value, the value of the identification vlan is replaced with an unused vlan value. The selection range of this unused vlan value is 1-4095, and it is different from all other identification vlan values and business vlan values. The configuration of the conversion vlan value corresponding to this identification vlan value or business vlan in the hardware is updated synchronously.
[0060] If the y in the newly added service VLAN index vlan xyz0 is type 1, then:
[0061] First, all identification vlans are traversed. If the value of the newly added service vlan is the same as the value of a certain identification vlan, the identification vlan is replaced with an unused vlan value. The selection range of this unused vlan value is 1-4095, and it is different from all other identification vlan values and service vlan values. The configuration of the identification vlan value in the hardware is updated synchronously.
[0062] Then traverse the service VLANs of other Ethernet ports. If the service VLANs of other Ethernet ports are all different from the newly added service VLAN values, configure the newly added service VLAN index vlanx.yz0 to the corresponding port of the switch chip and the corresponding cascade port, and configure the rule of the newly added service VLAN to allow vlanx.yz0 to pass. If it is the same as the service VLAN of other ports, create a new vlan xyz1 (x, y, z values are the same as the newly added service VLAN xyz0), and select an unused VLAN value for it. The unused VLAN value selection range is 1-4095, and it is different from the identification VLAN and service VLAN. Add the newly added service VLAN index vlan xyz0 and vlanx.yz1 to the corresponding port of the switch chip and the corresponding cascade port. The rule is that for the message of vlan xyz0 received by the corresponding port, the vlan tag is converted to vlan xyz1.
[0063] When other modes are configured, the switch chip does not have the VLAN conversion function or the QinQ function:
[0064] If the y in the newly added service VLAN index vlan xyz0 is type 0, then:
[0065] Traverse all identification vlans. If the value is different from all identification vlans, the hardware configuration is not updated and it is returned directly. If the value is the same as a certain identification vlan value, the value of the identification vlan is replaced with an unused vlan value. The selection range of this unused vlan value is 1-4095, and it is different from all other identification vlan values and business vlan values. The configuration of the conversion vlan value corresponding to this identification vlan value or business vlan in the hardware is updated synchronously.
[0066] If the y in the newly added service VLAN index vlan xyz0 is type 1, then:
[0067] First, all identification vlan values are traversed. If the value of the newly added service vlan is the same as the value of a certain identification vlan, the identification vlan is replaced with an unused vlan value. The selection range of this unused vlan value is 1-4095, and it is different from all other identification vlan values and service vlan values. The configuration of the identification vlan value in the hardware is updated synchronously.
[0068] Then traverse the service VLANs of other Ethernet ports. If the service VLANs of other Ethernet ports are all different from the newly added service VLAN values, configure the newly added service VLAN index vlanx.yz0 to the corresponding port of the switching chip and the corresponding cascade port, and configure the rule of the newly added service VLAN to allow vlanx.yz0 to pass. If it is the same as the service VLAN of other ports, enable the port-mac relationship table, configure the newly added service VLAN index vlanx.yz0 to the corresponding port of the switching chip and the corresponding cascade port, and the rule is to allow vlanx.yz0 to pass; the port-mac relationship table fills in the table items as needed when receiving packets, and when the corresponding port is disconnected, clear all table items associated with the port. Figure 5 The port-mac relationship table provided for this application shows the mapping relationship between the Ethernet port and the source mac.
[0069] The message processing flow is as follows:
[0070] The Ethernet port of the switching chip receives the message and adds or modifies the vlan tag field to the message. The CPU data processing center first parses the vlan tag field of the received message, and performs port identification on the message according to the port-vlan relationship table, and then decides to release or discard the message, and strips or modifies the vlan tag field in the released message according to the requirements of the original business vlan.
[0071] In some embodiments of the present application, the CPU data processing center first parses the vlan tag carried in the message. When the message carries two layers of vlan tag fields, they are identified as outer vlan tag fields and inner vlan tag fields respectively. When the message carries only one layer of vlan tag, it is identified as outer vlan tag field. The outer vlan tag field is identified by vlanO, and the inner vlan tag field is identified by vlanI.
[0072] If vlanI exists, then search for all identification vlan indexes, vlanO must be the same as the vlanid value of a certain identification vlan, and the port corresponding to the identification vlan is the Ethernet port that receives the packet. Then traverse all service vlan indexes under the port, if there is a service vlan with the same vlan id value as vlanI, then strip the outer vlan tag field of the message and release it; if there is no service vlan with the same vlan id value as vlanI, then directly discard the message.
[0073] If vlanI does not exist, first search all identification vlan indexes, if vlan0 is the same as the vlan id value of a certain identification vlan, the corresponding port of the identification vlan is the receiving Ethernet port of the message. Then traverse all service vlan indexes under the port, if there is an index with a y value of type 0, modify the outer vlan tag field of the message to the vlan id value corresponding to the index with a y value of type 0.
[0074] If vlanI does not exist, and vlanO is different from the vlan id values of all identified vlans, then search for all service vlan indexes with t value of type 0. If vlanO is the same as the vlan id value of only one vlan index, the port corresponding to the vlan index is the receiving Ethernet port. The packet vlan tag is not processed subsequently and is directly released.
[0075] If vlanI does not exist, and vlanO is different from the vlan id values of all identified vlans, and is different from all service vlan indexes with t values of type 0. Then search for all service vlan indexes with t values of type 1. If vlanO is the same as the vlan id value of a certain vlan index, the port corresponding to the vlan index is the receiving Ethernet port. Then modify the outer vlan tag field of the message to the vlan id value corresponding to the service vlan index with the same value as the vlan index xyz but t value of 1, and release it.
[0076] If vlanI does not exist, and vlanO is different from the vlan id values of all identified vlans, and is the same as multiple service vlan indexes with t values of type 0. Then parse the source mac of the message and search the software port-mac table. If the search is successful, the corresponding port is the receiving Ethernet port. If the search is unsuccessful, search the switching chip hardware mac table. At this time, the search must be successful, and the corresponding port is the receiving Ethernet port. Then synchronize the mac table in the switching chip to the software port-mac table. The vlan tag of the message is not processed later and it is directly released.
[0077] When the QinQ mode is configured:
[0078] The CPU data processing center first parses the vlan tag field carried in the message. The outer vlan tag field is identified by vlanO, and the inner vlan tag field is identified by vlanI. When the message carries two layers of vlan tag fields, they are identified as vlanO and vlanI respectively. When the message carries only one layer of vlan tag field, it is identified as the outer vlan tag field vlanO.
[0079] If the value of the outer VLAN tag field vlan0 is the same as that of a certain identification VLAN, the port corresponding to the identification VLAN is the receiving Ethernet port of the message.
[0080] If the message does not have an inner vlan tag field vlanI, find the service vlan index corresponding to the receiving Ethernet port of the message according to the port-vlan relationship table. If the y value corresponding to the receiving Ethernet port of the message is type 0 index vlan x.0.zt, then modify the outer vlan tag field in the message to vlan x.0.zt; if the y value corresponding to the receiving Ethernet port of the message does not exist and is type 0 index vlan x.0.zt, then strip off the outer vlan tag field vlanO in the message.
[0081] If the message has an inner vlan tag field vlanI, then search for the vlan index vlanx.yz0 corresponding to the receiving Ethernet port of the message. If there is a vlan index vlan x.1.z.0 with the same value as vlanI, then directly strip off the outer vlan tag field vlanO; if there is no vlan index with the same value as the inner vlan tag field vlanI, then discard the message.
[0082] When configured in VLAN translation mode:
[0083] If the outer vlan tag field vlanO is the same as the value of a certain identification vlan, the port corresponding to the identification vlan is the receiving Ethernet port of the message. Find all the service vlan indexes corresponding to the receiving Ethernet port of the current message. If there is a y value corresponding to the receiving Ethernet port of the message with the index vlan x.0.zt of type 0, then modify the outer port index vlanO in the message to vlan x.0.zt. If vlan x.0.zt does not exist, remove the outer vlan tag field vlanO in the message.
[0084] Otherwise, if the outer vlan tag field vlan0 has the same value as a service vlan, the port corresponding to the service vlan is the receiving Ethernet port of the message. If t in the index of the service vlan is 0 (the vlan is the service vlan), the message is released; if t in the index of the service vlan is 1 (the vlan is the conversion vlan corresponding to the service vlan), the outer vlan tag field vlan0 is modified to the index vlanx.yz0 of the service vlan corresponding to the conversion vlan.
[0085] In other modes:
[0086] If the outer vlan tag field vlanO is the same as the value of a certain identification vlan, the port corresponding to the identification vlan is the receiving Ethernet port of the message. Find all the service vlan indexes corresponding to the receiving Ethernet port of the current message. If there is a y value corresponding to the receiving Ethernet port of the message with the index vlan x.0.zt of type 0, then modify the outer port index vlany in the message to vlan x.0.zt. If vlan x.0.zt does not exist, remove the outer vlan tag field vlanO in the message.
[0087] If the outer VLAN tag field vlan0 has the same value as only one service VLAN, the port corresponding to the service VLAN is the receiving Ethernet port of the message, and the message is released.
[0088] If the outer VLAN tag field vlanO has the same value as at least two business VLANs, the packet is released and the software port-mac relationship table is searched based on the source MAC in the packet. If the software port-mac relationship table cannot find the MAC, the hardware MAC table is searched and the found MAC is synchronized to the software port-mac relationship table.
[0089] In this application, CPU refers to the functional set required for processing message forwarding, including corresponding software or supporting hardware acceleration modules, etc.; CPU is also the running carrier of software configuration program.
[0090] In the present application, the sum of the bandwidths of the first LAN port, the second LAN port, and the third LAN port is greater than the bandwidth of the first cascade port. Because all messages from one LAN port to another LAN port need to be processed by the LAN cascade port to the CPU, and then sent to the corresponding LAN port through the LAN cascade port, during the user's use, there may be a total demand bandwidth of the first cascade port, the second cascade port, and the third cascade port greater than the bandwidth of the first cascade port, causing network congestion and poor customer experience. In order to improve the speed of network communication, the CPU provided in the present application is provided with a cascade acceleration module, a speed measurement module, and a message parsing module. The message parsing module analyzes the received message and generates message flow information. The speed measurement module tests the corresponding Ethernet port according to the message flow information. If the message port flow direction is from a certain LAN port to another LAN port, the speed measurement module measures the speed of the Ethernet port that generates the message flow direction to obtain the current rate of the flow direction. The cascade acceleration module receives the current rate, adjusts the cascade state according to the current rate, marks the current system as accelerated when acceleration is required, records the accelerated port, and changes the connection relationship between the lan port and the cascade port in the cascade relationship table.
[0091] Figure 6A schematic diagram of the structure of a data processing chip provided in an embodiment of the present application. Figure 7 This is a flow chart of a cascade acceleration method provided by this application. Figure 6 and Figure 7 As shown in , the CPU is provided with a cascade acceleration module, a speed measurement module, and a message parsing module. The message parsing module analyzes the received message and generates message flow information. The speed measurement module performs a network speed test on the corresponding Ethernet port according to the message flow information. If the message port flow direction is from a certain LAN port to another LAN port, the speed measurement module measures the speed of the LAN port that generates the message flow direction to obtain the current rate of the LAN port. The cascade acceleration module receives the current rate, adjusts the cascade state according to the current rate, marks the current system as an accelerated state when acceleration is required, records the accelerated port, and changes the connection relationship between the LAN port and the cascade port in the cascade relationship table.
[0092] The cascade state in this application refers to the connection relationship between the LAN port and the cascade port. In this application, the cascade acceleration module, the speed measurement module, and the message analysis module can be set in the data processing center.
[0093] Figure 8 Another schematic diagram of a router structure provided in an embodiment of the present application is shown in FIG. Fig. 9 For this application Figure 8 The router cascade relationship diagram is shown.
[0094] If the current rate of the Ethernet port is higher than the preset upper threshold, a certain LAN port that generates the message flow will be connected to another cascade port. For example, in the present application, the message parsing module parses the current message flow as the first LAN port → the third LAN port, and the speed measurement module measures the speed of the message flow corresponding to the first LAN port and the third LAN port. If the current rate of the message flow is greater than the preset threshold, one of the first LAN port and the third LAN port is added to the WAN cascade port, that is, the first LAN port is added to the WAN cascade port, or the third LAN port is added to the WAN cascade port, and the current system is marked as accelerated, and the connection relationship between the LAN port and the cascade port in the cascade relationship table is changed. If the third LAN port is added to the WAN cascade port in the present application, the original cascade relationship table is changed to Figure 8 , Fig. 9 shown.
[0095] In some embodiments of the present application, global variables are created in the CPU software part to record the acceleration status and acceleration port.
[0096] Fig.10 A cascade acceleration method process provided in the embodiment of the present application Figure 2 .like Fig.10As shown, the cascade acceleration module compares the received current rate with the preset upper threshold value, and performs cascade switching if the current rate is greater than the preset upper threshold value.
[0097] In this application, the selection of the preset threshold upper limit can be set according to actual needs or experience. Usually, half of the physical bandwidth of the cascade port is its actual bandwidth, and 70%, 80% or 85% of the actual bandwidth can be selected as the preset threshold upper limit. If the physical bandwidth of the cascade port is 1000Mbps and its actual bandwidth is 500Mbps, the preset threshold upper limit can be 80% of its actual bandwidth, that is, 400Mbps. Of course, the preset threshold upper limit can also be other required values or experience values.
[0098] During the accelerated switching, the CPU searches the port-vlan relationship table, configures the VLAN of the LAN port to be changed on the WAN cascade port to allow traffic to pass, and removes the VLAN configuration from the LAN cascade port.
[0099] When restoring the switch, by searching the current port-vlan relationship table, configure the VLAN of the LAN port to be changed on the LAN cascade port to allow traffic to pass through, and remove the VLAN configuration from the WAN cascade port.
[0100] In the present application, the message parsing module analyzes the received message and generates message flow information. The speed measurement module tests the corresponding Ethernet port according to the message flow information. In the accelerated state, the speed measurement module measures the speed of the accelerated data flow to obtain the current rate. The cascade acceleration module receives the current rate. If the current rate is less than the preset threshold lower limit, the cascade acceleration module cancels the cascade state according to the current rate, cancels the cascade state mark, and changes the connection relationship between the LAN port and the LAN port in the cascade relationship table.
[0101] In this application, the selection of the preset threshold lower limit can be set according to actual needs or experience. Usually, half of the physical bandwidth of the cascade port is its actual bandwidth, and 10%, 20% or 15% of the actual bandwidth can be selected as the preset threshold lower limit. If the physical bandwidth of the cascade port is 1000Mbps and its actual bandwidth is 500Mbps, the preset threshold lower limit can be 10% of its actual bandwidth, that is, 50Mbps. Of course, the preset threshold lower limit can also be other required values or experience values.
[0102] In some embodiments of the present application, the speed measurement module measures the speed of the LAN port that generates the message flow direction to obtain the current speed and speed measurement time of the LAN port. The cascade acceleration module presets an upper threshold value, a lower threshold value, and a time threshold value. If the current speed is less than the lower threshold value, and the duration is greater than the time threshold, the cascade state is canceled, the cascade state mark is canceled, and the connection relationship between the LAN port and the cascade port in the cascade relationship table is changed.
[0103] Since the above embodiments are all described by citing and combining with other embodiments, different embodiments have the same parts, and the same and similar parts between the embodiments in this specification can be referred to each other. No further detailed description is given here.
[0104] It should be noted that, in this specification, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a circuit structure, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such circuit structure, article or device. In the absence of further restrictions, an element defined by the phrase "includes a ..." does not exclude the existence of other identical elements in the circuit structure, article or device including the element.
[0105] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the disclosure of the invention herein. The present application is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present application and include common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the content of the claims.
[0106] The above-described embodiments of the present application do not constitute a limitation on the protection scope of the present application.
Claims
1. A home smart gateway, characterized in that: include: Switching chips and data processing chips, The switching chip comprises: The Ethernet port is connected to the user terminal and includes: a first port, a second port and a third port, and is used to add or modify the vlan tag field of the received message; A first cascade port, the first port and the second port are connected to the first cascade port; a second cascade port, wherein the second cascade port is connected to the third port; The data processing chip comprises: A first main port connected to the first cascade port; A second main port connected to the second cascade port; A data processing center is connected to the first main port and the second main port, and when the message of the first port flows to the second port and the current rate of the first port is greater than the upper limit of a preset threshold, the first port is configured to be connected to the second cascade port; The data processing center is provided with a conflict handling module, which is used to modify the value of the current vlan to an unused vlan value when the value of the newly added service vlan is equal to the value of the current vlan, and to synchronously update the configuration of the switching chip.
2. The home smart gateway according to claim 1, characterized in that: The data processing center includes: A message analysis module receives the message, analyzes the message, and generates message flow information; A speed measurement module, for measuring the current speed of the Ethernet port related to the message port according to the message flow direction information; The cascade acceleration module adjusts the connection relationship between the Ethernet port and the cascade port according to the current rate and a preset threshold.
3. The home smart gateway according to claim 2, characterized in that: The cascade acceleration module is provided with a port-vlan relationship table of the mapping relationship between the Ethernet port and the VLAN. When the connection relationship between the Ethernet port and the cascade port changes, the port-vlan relationship table is modified.
4. The home smart gateway according to claim 3, characterized in that: The cascade acceleration module is also provided with a cascade state mark, and when the connection relationship between the Ethernet port and the cascade port changes, the cascade state mark is modified.
5. The home smart gateway according to claim 4, characterized in that: The cascade acceleration module is further configured as follows: The current rate is greater than the preset upper threshold, and the cascade state mark is a non-accelerated state mark, and the message flows from the first port to the second port, then the second port is connected to the second cascade port; The current rate is less than the preset threshold lower limit, and the cascade state mark is an acceleration state mark, and the message flows from the first port to the second port, then the second port is connected to the first cascade port.
6. The home smart gateway according to claim 1, characterized in that: The first port and the second port are LAN ports, and the third port is a WAN port; The data processing center is provided with a port-vlan relationship table representing the mapping relationship between the Ethernet port and the vlan, identifies the receiving Ethernet port of the message according to the vlan tag field, strips the vlan tag field, modifies the vlan tag field or discards the message.
7. The home smart gateway according to claim 6, characterized in that: The vlan includes an identification vlan and a service vlan; The identification vlan index is vlan_px; The service vlan index includes vlanx.yzt, where: x is the Ethernet port index; y is the configuration type index. If y is 0, it means adding the specified VLAN type. If y is 1, it means allowing the specified VLAN to pass through. z is the vlan sequence index of the type; t is the conversion type index. t=0 represents the configured service VLAN, and t=1 represents the conversion VLAN of the corresponding service VLAN.
8. The home smart gateway according to claim 6, characterized in that: Identifying a packet receiving Ethernet port according to the vlan tag field, stripping the vlan tag field, modifying the vlan tag field or discarding the message, including: The data processing center parses the message to obtain a vlan tag field of the message; the vlan tag field includes an outer vlan tag field and an inner vlan tag field; The receiving Ethernet port of the message is identified according to the outer VLAN tag field, and the VLAN tag field of the message is stripped, the VLAN tag field is modified, or the message is discarded.
9. The home smart gateway according to claim 8, characterized in that: The method further comprises searching the receiving Ethernet port of the message according to the outer VLAN tag field, and stripping the VLAN tag field of the message, modifying the VLAN tag field or discarding the message, and further comprising: If the outer VLAN tag field is the same as at least two of the service VLAN values, the source MAC of the message is searched and the message is released; The source mac does not exist in the port-mac table, the hardware mac table is searched, and the mac table is synchronized to the port-mac table.
10. The home smart gateway according to claim 8, characterized in that: Searching for the packet receiving Ethernet port of the message according to the outer VLAN tag field, and stripping the VLAN tag field of the message, modifying the VLAN tag field or discarding the message includes: If the inner vlan tag field exists, the port corresponding to the identification vlan that is the same as the outer vlan tag field is the receiving Ethernet port of the message, and the outer vlan tag field is stripped; If the inner vlan tag field does not exist, and the outer vlan tag field is the same as a certain identification vlan, then the port corresponding to the identification vlan that is the same as the outer vlan tag field is the receiving Ethernet port of the message; If the inner vlan tag field does not exist, and the outer vlan tag field is the same as a certain service vlan, then the port corresponding to the service vlan that is the same as the outer vlan tag field is the receiving Ethernet port of the message; If the inner vlan tag field does not exist and the outer vlan tag field is the same as multiple business vlans, the source mac of the message is parsed and the software port-mac table is searched.
