PON (Passive Optical Network)-based IP (Internet Protocol) address allocation method, device, equipment and medium

By configuring the mapping relationship between access port type and IP address pool in the optical modem, the static public or private network address pool can be dynamically allocated, solving the problem of fixed IP address allocation in enterprise office networks and improving network management and security.

CN120916083APending Publication Date: 2025-11-07SHENZHEN SKYWORTH SOFTWARE +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511083669.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-04
Publication Date
2025-11-07

AI Technical Summary

Technical Problem

Existing home-grade network access devices cannot provide enterprise-grade terminal devices with independent public IP addresses and static binding capabilities, thus failing to meet the needs of fixed allocation and persistent use of IP addresses in enterprise-grade office networks.

Method used

By pre-configuring the mapping relationship between access port type information and IP address pool in the optical modem, a static public network address pool or private network address pool is dynamically allocated according to the access port type, thereby implementing different traffic forwarding strategies and ensuring the fixed allocation and persistent use of IP addresses.

Benefits of technology

It enables rapid and accurate allocation of IP addresses in enterprise-level office networks, improves the flexibility and security of network management, meets the needs of enterprises for fixed public network access, and enhances the user network experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120916083A_ABST
    Figure CN120916083A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of PON passive optical fiber networks, is applied to fiber to room (FTTR), enterprise-level fiber to room-Bus (FTTR-B) and broadband fusion terminal products, and particularly relates to a PON-based IP address allocation method, device, equipment and medium, when a terminal device is accessed to an LAN interface of an optical modem, a DHCP dynamic address request from the terminal device is received, and the DHCP dynamic address request is sent to the terminal device. According to the access port type information in the DHCP dynamic address request and the corresponding relation between the pre-calibrated access port type information and the pre-configured IP address pool in the optical modem, the IP address pool fed back for the DHCP dynamic address request is determined, so that the IP address can be quickly and accurately allocated to the terminal equipment, and the user experience is improved. Therefore, the optical modem executes different flow forwarding strategies according to the IP address allocated by the terminal equipment, the problem that the prior art cannot meet the requirements of fixed allocation and persistent use of the IP address in an enterprise-level office network is solved, and the network experience of a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of PON passive optical network, and is applied to Fiber To The Room (FTTR), Fiber To The Room-Business (FTTR-B) and broadband fusion terminal products, in particular to an IP address allocation method, device and equipment based on PON and a medium. BACKGROUND

[0002] With the rapid development of the Internet, especially in the commercial office network architecture, it is particularly important for business systems facing external customers to have stable external access capability, which makes it necessary for key business terminal devices to apply for and bind public IP address resources. However, the typical networking architecture of existing home-level network access devices follows the basic operation mechanism of "single public IP multiplexing", but due to the limitations of its design positioning and functional characteristics, it cannot allocate independent public entrances for specific terminals, and usually only supports dynamic IP allocation strategies based on NAT conversion mechanisms, which leads to the fact that such devices are not customized for enterprise-level scenarios or protocol stack optimization, lacking both static binding capabilities of IP addresses and technical support for long-term holding of IP addresses. Therefore, how to meet the fixed allocation and persistent use requirements of IP addresses in enterprise-level office networks is a technical problem that needs to be solved. SUMMARY

[0003] Therefore, it is necessary to solve the above technical problems, and the embodiments of the present application provide an IP address allocation method, device, equipment and medium based on PON to solve the problem that the prior art cannot meet the fixed allocation and persistent use requirements of IP addresses in enterprise-level office networks.

[0004] The first aspect of the embodiments of the present application provides an IP address allocation method based on PON, which comprises: When a terminal device accesses the LAN interface of an optical modem, a DHCP dynamic address request from the terminal device is received, wherein the DHCP dynamic address request includes access port type information of the terminal device, and the access port type information includes a first LAN interface and a second LAN interface; According to the access port type information and the pre-labeled mapping relationship, an IP address pool is determined for the feedback of the DHCP dynamic address request, wherein the mapping relationship is a correspondence relationship between pre-labeled access port type information and a pre-configured IP address pool in the optical modem, and the pre-configured IP address pool in the optical modem includes a static public address pool and a private address pool; The allocation module allocates an IP address for the terminal device according to the IP address pool fed back for the DHCP dynamic address request, so that the optical modem performs different traffic forwarding strategies according to the IP address allocated for the terminal device, wherein the IP address includes a first IP address and a second IP address.

[0005] A second aspect of the embodiment of the application provides a PON-based IP address allocation device, which comprises: The receiving module is configured to receive a DHCP dynamic address request from the terminal device when the terminal device accesses a LAN interface of the optical modem, wherein the DHCP dynamic address request comprises access port type information of the terminal device, and the access port type information comprises a first LAN interface and a second LAN interface. The determining module is configured to determine an IP address pool fed back for the DHCP dynamic address request according to the access port type information and a pre-labeled mapping relationship, wherein the mapping relationship is a correspondence relationship between pre-labeled access port type information and a pre-configured IP address pool in the optical modem, and the pre-configured IP address pool in the optical modem comprises a static public network address pool and a private network address pool. The allocation module allocates an IP address for the terminal device according to the IP address pool fed back for the DHCP dynamic address request, so that the optical modem performs different traffic forwarding strategies according to the IP address allocated for the terminal device, wherein the IP address includes a first IP address and a second IP address.

[0006] In a third aspect, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the PON-based IP address allocation method according to the first aspect when executing the computer program.

[0007] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program, and the computer program is executable on a processor to implement the PON-based IP address allocation method according to the first aspect.

[0008] To sum up, the application provides a PON-based IP address allocation method, device, equipment and medium, when a terminal device accesses a LAN interface of an optical modem, a DHCP dynamic address request from the terminal device is received, wherein the DHCP dynamic address request includes access port type information of the terminal device, wherein the access port type information includes a first LAN interface and a second LAN interface, an IP address pool fed back for the DHCP dynamic address request is determined according to the access port type information and a pre-labeled mapping relationship, wherein the mapping relationship is a correspondence relationship between the pre-labeled access port type information and an IP address pool pre-configured in the optical modem, the IP address pool pre-configured in the optical modem includes a static public network address pool and a private network address pool, and an IP address allocated for the terminal device is determined according to the IP address pool fed back for the DHCP dynamic address request, so that the optical modem executes different traffic forwarding strategies according to the IP address allocated for the terminal device, wherein the IP address includes a first IP address and a second IP address. It can be seen that the application determines the IP address pool fed back for the DHCP dynamic address request according to the access port type information and the pre-labeled mapping relationship, so that the IP address allocated for the terminal device can be quickly and accurately determined, so that the optical modem executes different traffic forwarding strategies according to the IP address allocated for the terminal device, solves the problem that the prior art cannot meet the fixed allocation and persistent use requirements of IP addresses in enterprise-level office networks, and improves user network experience. BRIEF DESCRIPTION OF DRAWINGS

[0009] In order to more clearly illustrate the technical solutions of the embodiments of the application, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the application. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can also be obtained by those skilled in the art without creative labor.

[0010] Figure 1 is a flow diagram of a PON-based IP address allocation method provided by an embodiment of the application; Figure 2 is a structural diagram of a PON-based IP address allocation device provided by an embodiment of the application; Figure 3 is a structural diagram of an electronic device provided by an embodiment of the application. DETAILED DESCRIPTION

[0011] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0012] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0013] It should also be understood that the term “and / or” as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0014] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," or "in response to determination." Similarly, the phrase "if determined" or "if matched to [described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once matched to [described condition or event]," or "in response to matched to [described condition or event]."

[0015] Furthermore, in the description of this invention and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0016] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of the invention include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0017] It should be understood that the sequence number of each step in the following embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0018] In order to illustrate the technical solutions of the present application, the following will be illustrated by specific embodiments.

[0019] Referring to Figure 1 , it is a flowchart of a PON-based IP address allocation method provided by an embodiment of the present application, as Figure 1 shown, the PON-based IP address allocation method can be implemented by the following steps.

[0020] S101: When a terminal device accesses a LAN interface of an optical modem, receiving a DHCP dynamic address request from the terminal device, wherein the DHCP dynamic address request comprises access port type information of the terminal device, wherein the access port type information comprises a first LAN interface and a second LAN interface.

[0021] In step S101, the optical modem is an access device of a home or enterprise network, and is usually equipped with multiple LAN interfaces (such as LAN1, LAN2, etc.) for connecting terminal devices such as computers, routers, set-top boxes, etc. When a terminal device accesses a certain LAN interface through a network cable, it will automatically initiate a network configuration request, of which the most core is the DHCP dynamic address request. After the terminal device accesses the network, it will send the DHCP dynamic address request in the form of broadcast, and the optical modem will respond after receiving it, so as to complete the IP address allocation subsequently. The access port type information refers to the identification of the LAN interface of the optical modem accessed by the terminal device, including the first LAN interface and the second LAN interface, i.e. the first LAN interface corresponds to LAN1 and the second LAN interface corresponds to LAN2. The access port type information is contained in the DHCP dynamic address request, which is used to distinguish devices accessed by different interfaces, and then to realize targeted IP address configuration. It should be noted that the terminal device in the present application can be any device such as a mobile phone, a smart terminal, a multimedia device, a streaming media device, etc., which can be set according to actual conditions, and the present application does not make any limitation thereto.

[0022] In the present embodiment, when a terminal device accesses a LAN interface of an optical modem, a DHCP dynamic address request from the terminal device is received. By using the reserved Option field of the DHCP protocol, the optical modem automatically adds the identification of the access port in the message after receiving the terminal request, and then forwards it to the DHCP server. Then, a special logic is developed in the optical modem, which associates the access port type information to the request when analyzing the DHCP dynamic address request. In the management interface of the optical modem, corresponding IP address pools are configured for different LAN interfaces in advance. When receiving the DHCP dynamic address request containing the access port type information, the port identification is matched with the preset strategy and the IP address pool pre-configured in the optical modem, and a corresponding IP address is generated and sent to the terminal device to complete the IP address allocation configuration.

[0023] In an embodiment of the application, when the terminal device accesses the LAN interface of the optical modem, before receiving the DHCP dynamic address request from the terminal device, the following are included: When the optical modem adopts a target dialing mode to dial data with the operator network side, a pre-configured static public network IP address is sent to the operator network side, wherein the target dialing mode is a mode supporting multiple PPPoE dialing; In the case of successful data dialing, the WAN interface of the optical modem is called to obtain IP configuration parameters; According to the IP configuration parameters, the static public network address pool is configured for the optical modem on the original private network address pool.

[0024] Specifically, the optical cat performs data dialing by adopting a target dialing mode to establish a connection with the network side of the operator, wherein the dialing server of the operator allows the pppd client to carry static IP dialing in dialing, and after the user dialing succeeds, adds a backhaul route of a static public network IP segment to the link interface corresponding to the client. The target dialing mode can be a mode supporting multiple PPPoE dialing, in other words, the target dialing mode can support two or more data dialing. It should be noted that the "multiple PPPoE" involved in the present application does not exclude the mode of single PPPoE dialing, that is, the target dialing mode can perform both single PPPoE dialing and multiple PPPoE dialing. On the basis of the original dialing protocol and without changing the underlying communication process, the optical cat actively sends a pre-configured static public network IP to the network side of the operator during dialing in the IP address negotiation phase, to realize the fixation of the public network IP, which requires the network side of the operator to support static IP PPPoE dialing authentication. After successful dialing, the complete IP configuration parameters are obtained from the network side of the operator through the WAN interface of the optical cat, which include the static public network IP address, gateway address, DNS server address and the like consistent with the configuration, for completing the network configuration on the public network side. Then, according to the IP configuration parameters, the built-in LAN side DHCP server of the optical cat adds a static public network address pool to the original private network address pool after the static dialing of the optical cat is completed, so as to realize "parallel allocation of double address pools", that is, the default private network address pool is used for ordinary terminals: address range: private network IP address segment; gateway: IP of the LAN port of the optical cat itself; DNS: IP of the LAN port of the optical cat. The static public network address pool is used for special terminals: address range: same network segment as the WAN port public network IP of the optical cat; gateway: WAN port public network IP of the optical cat; DNS: public DNS of the operator. Moreover, when the WAN port public network IP obtained by the optical cat through PPPoE dialing is changed, the address range of the static public network address pool is automatically adjusted to be the same network segment as the changed WAN port public network IP. It can be seen that by pre-setting the static public network IP before dialing, the network side of the operator and the user can more flexibly manage the public network resources, ensure that the public network IP obtained by the optical cat is fixed and controllable, and after successful dialing, by dynamically obtaining the specific IP configuration parameters, the network parameters can be correctly configured at the optical cat end, so as to ensure the stability and consistency of the network connection, and improve the flexibility and efficiency of network management.

[0025] In an embodiment of the application, when the terminal device accesses the LAN interface of the optical cat, before receiving the DHCP dynamic address request from the terminal device, the following steps are included: obtaining the Protal authentication information of the optical cat; judging whether the security baseline condition of the optical cat meets the preset security baseline condition according to the Protal authentication information of the optical cat; If the security baseline condition of the optical cat meets the preset security baseline condition, it is judged whether the access port and IP address binding information of the optical cat match; If the access port and IP address binding information of the optical cat match, the LAN interface of the optical cat is accessed into the terminal device.

[0026] Specifically, the Portal authentication information of the optical cat includes the device identification (such as MAC address, SN serial number) of the optical cat, the completed authentication state (whether passing the identity verification of the operator / management platform), the authentication timestamp, the authentication key, etc. When the optical cat accesses the network for the first time, it needs to complete the authentication through the Portal server of the operator. After the authentication is successful, the Portal server synchronizes the authentication information to the management platform database, and stores the authentication token locally in the optical cat. Then, according to the Portal authentication information of the optical cat, it is judged whether the security baseline condition of the optical cat meets the preset security baseline condition. The security baseline is the minimum security configuration standard of the network device, and the preset condition may include whether the login password of the optical cat meets the complexity requirement (such as length ≥ 8 bits, containing uppercase and lowercase letters), whether the firewall is turned on, whether the default account is disabled, whether the unnecessary ports (such as Telnet, FTP) are closed, whether the firmware version is the latest (repairing known vulnerabilities), etc. By checking whether the optical cat meets these conditions, it is ensured that there is no obvious security risk in itself. If the security baseline condition of the optical cat meets the preset security baseline condition, it is judged whether the access port and IP address binding information of the optical cat match. The management platform configures the port-IP binding rule for the optical cat. The optical cat obtains the IP address of the terminal through the DHCP protocol and performs real-time matching verification. For example, LAN1→192.168.1.10-20, LAN2→192.168.1.21-30. If the IP range allowed by LAN2 contains 192.168.1.25, it is determined to match. If the terminal IP is 192.168.1.15 (belongs to the LAN1 range) but accesses LAN2, it is determined not to match. If the access port and IP address binding information of the optical cat match, the LAN interface of the optical cat is accessed into the terminal device. If any condition is not met, the optical cat will block the access (such as closing the port, refusing the DHCP response) and report the abnormal information to the management platform. It can be seen that by obtaining the Portal authentication information of the optical cat, combining the security baseline detection and the IP binding verification, it is ensured that only safe and reliable devices access the network, which helps to maintain the overall security and reliability of the network environment and improves the efficiency of network management.

[0027] In this embodiment, when a terminal device connects to the LAN interface of an optical modem, it can accurately identify the access port of the optical modem by receiving a DHCP dynamic address request from the terminal device. This allows for the provision of a corresponding IP address pool based on the access port type information, thereby allocating an IP address to the terminal device and improving the flexibility and security of network management.

[0028] S102: Determine the IP address pool for the DHCP dynamic address request feedback based on the access port type information and the pre-defined mapping relationship, wherein the mapping relationship is the correspondence between the pre-defined access port type information and the pre-configured IP address pool in the optical modem, and the pre-configured IP address pool in the optical modem includes a static public network address pool and a private network address pool.

[0029] In step S102, a private network address pool and a static public network address pool are pre-configured in the optical modem's management interface. The private network address pool is used for private IP addresses for intranet communication, which are only valid within the local area network and cannot directly access the public network. This includes the following address range: private network IP address segment; gateway: the optical modem's own LAN port IP; DNS: the optical modem's LAN port IP. The static public network address pool consists of public network IP addresses allocated by the operator that can directly access the public network. These are usually fixed addresses and are used for scenarios requiring public network access. This includes the following address range: the same network segment as the optical modem's WAN port public IP; gateway: the optical modem's WAN port public IP; DNS: the operator's public DNS. The access port type information is divided according to the optical modem's LAN interfaces. The first LAN interface corresponds to LAN1, which is a specific interface, and the second LAN interface corresponds to LAN2, which is a regular interface. The correspondence between the access port type information and the pre-configured IP address pool is pre-defined in the optical modem's DHCP service configuration. The first LAN interface is associated with a static public address pool, and the second LAN interface is associated with a private address pool. When the DHCP server of the optical modem receives a DHCP dynamic address request from a terminal, it first parses the access port type information carried in the DHCP dynamic address request, and then queries the pre-marked mapping relationship based on the access port type information to determine the IP address pool that is fed back for the DHCP dynamic address request.

[0030] In one embodiment of the invention, determining the IP address pool for DHCP dynamic address request feedback based on access port type information and a pre-defined mapping relationship includes: When the access port type information is the first LAN interface, the static public address pool for the DHCP dynamic address request feedback is determined according to the pre-defined mapping relationship. When the access port type information is the second LAN interface, then according to the pre-labeled mapping relationship, a private network address pool is determined for the feedback of the DHCP dynamic address request.

[0031] Specifically, the optical modem has pre-configured two types of address pools, i.e., a static public network address pool allocated by an operator and a private network address pool as an internal private network segment, and the mapping relationship between the first LAN interface and the static public network address pool is pre-labeled, and the mapping relationship between the second LAN interface and the private network address pool is pre-labeled, when the access port type information is the first LAN interface, then according to the pre-labeled mapping relationship, the static public network address pool is determined for the feedback of the DHCP dynamic address request, when the access port type information is the second LAN interface, then according to the pre-labeled mapping relationship, the private network address pool is determined for the feedback of the DHCP dynamic address request. Through the above steps, the IP address pool for the feedback of the DHCP dynamic address request can be accurately determined, the possibility of error is reduced, so that the IP address can be quickly and accurately allocated to the terminal device subsequently, which is beneficial to improve the stability and security of the network device operation.

[0032] In the embodiment, by pre-configuring the mapping relationship, different IP address pools can be dynamically selected according to the access port type information, so as to realize physical isolation of internal network and public network resources, avoid private network devices occupying public network addresses, prevent unauthorized devices from accessing public network resources, and improve the flexibility and controllability of network management.

[0033] S103: allocating an IP address to the terminal device according to the IP address pool for the feedback of the DHCP dynamic address request, so that the optical modem executes different traffic forwarding strategies according to the IP address allocated to the terminal device, wherein the IP address includes a first IP address and a second IP address.

[0034] In step S103, the first IP address is usually from the static public network address pool and is used for terminal devices that need to directly access the public network, and the second IP address is usually from the private network address pool and is used for terminal devices that only need internal network communication or share a public network exit through NAT, after determining the IP address pool for the feedback of the DHCP dynamic address request, the IP address allocated to the terminal device is determined according to the IP address pool for the feedback of the DHCP dynamic address request, so that the optical modem executes different traffic forwarding strategies according to the IP address allocated to the terminal device.

[0035] In an embodiment of the application, the IP address allocated to the terminal device according to the IP address pool for the feedback of the DHCP dynamic address request includes: a first IP address allocated to the terminal device when the IP address pool fed back in response to the DHCP dynamic address request is a static public network address pool, wherein the first IP address comprises a static public network IP address in the same network segment as the WAN interface of the optical modem, a first gateway IP address, and a first operator public DNS address; a second IP address allocated to the terminal device when the IP address pool fed back in response to the DHCP dynamic address request is a private network address pool, wherein the second IP address comprises a private network IP address, a second gateway IP address, and a second operator public DNS address.

[0036] Specifically, when the IP address pool fed back in response to the DHCP dynamic address request is a static public network address pool, a first IP address allocated to the terminal device, wherein the first IP address comprises a static public network IP address in the same network segment as the WAN interface of the optical modem, a first gateway IP address, and a first operator public DNS address, the static public network IP address in the same network segment as the WAN interface of the optical modem: for example, the public network IP address of the WAN interface of the optical modem is 203.0.113.1, and the IP address allocated to the terminal device can be 203.0.113.5, which belongs to the 203.0.113.0 / 28 network segment, so as to ensure that the terminal device directly communicates with the public network; the first gateway IP address: usually a public network gateway provided by an operator, through which the terminal device directly accesses the public network; the first operator public DNS address: a public network DNS server provided by the operator, used for resolving public network domain names. When the IP address pool fed back in response to the DHCP dynamic address request is a private network address pool, a second IP address allocated to the terminal device, wherein the second IP address comprises a private network IP address, a second gateway IP address, and a second operator public DNS address, the private network IP address: from a private network segment in the internal network, for example, 192.168.1.100, belonging to the 192.168.1.0 / 24 network segment; the second gateway IP address: usually the IP address of the LAN interface of the optical modem itself, through which the terminal device forwards traffic; the second operator public DNS address: can be the same as the first DNS, or use the DNS cache server built-in the optical modem. It should be noted that the first IP address makes the terminal directly in the public network environment, in the same network segment as the WAN interface of the optical modem, while the second IP address makes the terminal in the internal network environment, indirectly accesses the public network through the optical modem as a gateway, and the network reachability and forwarding path of the two are completely different. Through the above steps, the IP address allocated to the terminal device can be quickly and accurately, meeting the fixed allocation and persistent use requirements of IP addresses in enterprise-level office networks, thereby improving the efficiency of network management.

[0037] In an embodiment of the application, before the IP address allocated to the terminal device, comprising: judging whether the IP address is currently occupied by other terminal devices; if the IP address is not occupied by other terminal devices, then performing the step of assigning the IP address to the terminal device; if the IP address is occupied by other terminal devices, then reassigning an IP address to the terminal device.

[0038] Specifically, before assigning an IP address to a terminal device, it is necessary to check whether the IP is currently occupied by other terminal devices, i.e., whether other terminal devices have used the IP address through DHCP or static configuration. The optical modem needs to maintain a real-time updated IP address and terminal device occupation information relationship mapping table to record the assigned IP and the corresponding terminal identifier. By directly checking whether the IP address is in the occupation information relationship mapping table, if not, it is determined that the IP address is not occupied by other terminal devices, and the assignment process is directly performed. The optical modem sends the IP address to the terminal device through the DHCP response. If it is, it is detected that the IP address is occupied by other terminal devices, and the IP address is abandoned. A new unoccupied IP address is selected from the corresponding address pool for assignment, thereby avoiding IP address conflicts, ensuring that two devices in the same network segment use the same IP address, and ensuring that the terminal device can communicate normally. If all IP addresses in the address pool are occupied, the optical modem returns a DHCP NAK packet to inform the terminal device that the IP address cannot be assigned temporarily. It should be noted that even if it is not recorded in the occupation information relationship mapping table, a broadcast request is still sent to the network segment through ARP to request who is using the corresponding IP address. If a response is received, i.e., a terminal device returns its own MAC address, it means that the IP address is occupied by a device configured statically, and it is determined to be occupied. If no response is received, it is confirmed that the IP address is available. It can be seen that through the active detection and redistribution mechanism, the IP address duplication problem is eliminated from the source, and the device disconnection, data transmission failure and other faults caused by conflicts are prevented, thereby ensuring the uniqueness of the IP address assignment and reducing the complexity of network maintenance.

[0039] In an embodiment of the application, the optical modem is caused to perform different traffic forwarding strategies according to the IP address assigned to the terminal device, including: When the IP address assigned to the terminal device is a first IP address, it is checked whether the LAN interface of the optical modem accessed by the terminal device is the first LAN interface; If the LAN interface of the optical modem accessed by the terminal device is the first LAN interface, then the traffic is forwarded to the operator network side with the public IP address of the terminal device as the source address; When the IP address assigned to the terminal device is a second IP address, it is checked whether the LAN interface of the optical modem accessed by the terminal device is the second LAN interface; If the LAN interface of the terminal device accessing the optical modem is the second LAN interface, the private network IP address and the local port are replaced by the public network IP address and the dynamic port in the WAN interface of the optical modem respectively to forward the traffic.

[0040] Specifically, when the IP address assigned to the terminal device is the first IP address, it is checked whether the LAN interface of the terminal device accessing the optical modem is the first LAN interface, and the terminal device is prevented from obtaining the public network IP address through the second LAN interface, i.e., interface overreach. If it is determined that the LAN interface of the terminal device accessing the optical modem is the first LAN interface, the public network IP address of the terminal is directly used as the source address to forward the traffic to the operator network side, without address conversion, so that the public network device can directly communicate with the terminal through the IP, and the demand of enterprise-level business for a fixed public network entrance is met. When the IP address assigned to the terminal device is the second IP address, it is checked whether the LAN interface of the terminal device accessing the optical modem is the second LAN interface, and the private network device is prevented from occupying the public network interface resource. If it is determined that the LAN interface of the terminal device accessing the optical modem is the second LAN interface, the private network IP address and the local port of the terminal are replaced by the public network IP address and the dynamic port of the WAN interface of the optical modem through NAT network address translation, and then the traffic is forwarded, so that multiple devices share a single public network IP for online. If the LAN interface of the terminal device accessing the optical modem is not the first LAN interface or the second LAN interface, the optical modem can update the IP address type of the terminal device through the DHCP protocol in addition to intercepting the traffic. It can be seen that, through the checking of the IP address type and the interface, the terminal is prevented from obtaining IP resources that do not belong to itself by inserting the wrong interface, so that the access demand of the terminal device is ensured, and the network security is improved.

[0041] In the embodiment, the IP address assigned to the terminal device can be accurately assigned according to the IP address pool fed back to the DHCP dynamic address request, which helps to avoid allocation errors, meets the demand of fixed allocation and persistent use of IP addresses in enterprise-level office networks, and directly locks the corresponding forwarding rule through the type of the IP, so as to fundamentally prevent the terminal from bypassing the limitation by manually tampering with the IP address, avoid illegal occupation of public network resources or launching of network attacks, improve the network operation efficiency and security, and enhance the user network experience.

[0042] To sum up, the application provides a PON-based IP address allocation method, device, equipment and medium. When a terminal device accesses a LAN interface of an optical modem, a DHCP dynamic address request from the terminal device is received, wherein the DHCP dynamic address request includes access port type information of the terminal device, wherein the access port type information includes a first LAN interface and a second LAN interface; an IP address pool to be fed back for the DHCP dynamic address request is determined according to the access port type information and a pre-labeled mapping relationship, wherein the mapping relationship is a correspondence relationship between the pre-labeled access port type information and a pre-configured IP address pool in the optical modem, the pre-configured IP address pool in the optical modem includes a static public network address pool and a private network address pool; an IP address allocated for the terminal device is determined according to the IP address pool to be fed back for the DHCP dynamic address request, so that the optical modem performs different traffic forwarding strategies according to the IP address allocated for the terminal device, wherein the IP address includes a first IP address and a second IP address. It can be seen that the application determines the IP address pool to be fed back for the DHCP dynamic address request according to the access port type information and the pre-labeled mapping relationship, so that the IP address allocated for the terminal device can be quickly and accurately determined, so that the optical modem performs different traffic forwarding strategies according to the IP address allocated for the terminal device, solves the problem that the prior art cannot meet the fixed allocation and persistent use requirements of IP addresses in enterprise-level office networks, and improves user network experience.

[0043] Please refer to Figure 2 , Figure 2 is a structural schematic diagram of a PON-based IP address allocation device provided by the embodiment of the application. The PON-based IP address allocation device corresponds to the PON-based IP address allocation method in the above embodiment one by one. For details, please refer to the related description in the embodiment corresponding to Figure 1 and Figure 1 . For the convenience of illustration, only the part related to the present embodiment is shown. Please refer to Figure 2 , the PON-based IP address allocation device 20 includes a receiving module 21, a determining module 22 and an allocating module 23.

[0044] The receiving module 21 is configured to receive a DHCP dynamic address request from a terminal device when the terminal device accesses a LAN interface of an optical modem, wherein the DHCP dynamic address request includes access port type information of the terminal device, wherein the access port type information includes a first LAN interface and a second LAN interface; determining module 22 is configured to determine an IP address pool for the DHCP dynamic address request feedback according to the access port type information and a pre-labeled mapping relationship, wherein the mapping relationship is a pre-labeled correspondence between the access port type information and an IP address pool pre-configured in the optical modem, and the IP address pool pre-configured in the optical modem includes a static public network address pool and a private network address pool; allocating module 23 is configured to allocate an IP address for the terminal device according to the IP address pool for the DHCP dynamic address request feedback, so that the optical modem performs different traffic forwarding strategies according to the IP address allocated for the terminal device, wherein the IP address includes a first IP address and a second IP address.

[0045] Optionally, the receiving module 21 is specifically configured to: when the optical modem adopts a target dialing mode to dial data with the operator network side, send a pre-configured static public network IP address to the operator network side, wherein the target dialing mode is a mode supporting multiple PPPoE dialing; in the case of successful data dialing, call the WAN interface of the optical modem to obtain IP configuration parameters; according to the IP configuration parameters, configure the static public network address pool for the optical modem on the original private network address pool.

[0046] Optionally, the receiving module 21 is further configured to: obtain the Protal authentication information of the optical modem; determine whether the security baseline condition of the optical modem meets a preset security baseline condition according to the Protal authentication information of the optical modem; if the security baseline condition of the optical modem meets the preset security baseline condition, determine whether the access port and IP address binding information of the optical modem match; if the access port and IP address binding information of the optical modem match, then connect the LAN interface of the optical modem to the terminal device.

[0047] Optionally, the determining module 22 is specifically configured to: when the access port type information is the first LAN interface, determine a static public network address pool for the DHCP dynamic address request feedback according to the pre-labeled mapping relationship; when the access port type information is the second LAN interface, determine a private network address pool for the DHCP dynamic address request feedback according to the pre-labeled mapping relationship.

[0048] Optionally, the allocating module 23 is specifically configured to: when the IP address pool fed back in response to the DHCP dynamic address request is a static public network address pool, a first IP address allocated to the terminal device, wherein the first IP address comprises a static public network IP address, a first gateway IP address and a first operator public DNS address in the same network segment as a WAN interface of the optical modem; when the IP address pool fed back in response to the DHCP dynamic address request is a private network address pool, a second IP address allocated to the terminal device, wherein the second IP address comprises a private network IP address, a second gateway IP address and a second operator public DNS address.

[0049] Optionally, the allocation module 23 is further configured to: when the IP address allocated to the terminal device is the first IP address, checking whether a LAN interface of the optical modem accessed by the terminal device is the first LAN interface; when the LAN interface of the optical modem accessed by the terminal device is the first LAN interface, forwarding the traffic to the operator network side with the public network IP address of the terminal device as a source address; when the IP address allocated to the terminal device is the second IP address, checking whether a LAN interface of the optical modem accessed by the terminal device is the second LAN interface; when the LAN interface of the optical modem accessed by the terminal device is the second LAN interface, respectively replacing the private network IP address and the local port with the public network IP address and the dynamic port in the WAN interface of the optical modem for traffic forwarding.

[0050] Optionally, the allocation module 23 is further configured to: checking whether the IP address is currently occupied by other terminal devices; when the IP address is not occupied by other terminal devices, performing the step of allocating the IP address to the terminal device; when the IP address is occupied by other terminal devices, re-allocating an IP address to the terminal device.

[0051] It should be noted that the information interaction, execution process and the like between the above units are based on the same concept as the method embodiments of the present application, and the specific functions and the technical effects brought by the same can be referred to the method embodiments part, which will not be described here.

[0052] Figure 3 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. As shown in the figure, the electronic device of this embodiment comprises at least one processor (CPU) Figure 3 Figure 3 ​The electronic device can include, but is not limited to, a processor, a memory, and a computer program stored in the memory and executable on the at least one processor, the processor implementing the steps of any of the above-described embodiments of the method for allocating IP addresses based on a PON when executing the computer program.

[0053] The electronic device can include, but is not limited to, a processor, a memory, and a computer program stored in the memory and executable on the at least one processor, the processor implementing the steps of any of the above-described embodiments of the method for allocating IP addresses based on a PON when executing the computer program. Figure 3 The electronic device is merely an example and does not limit the electronic device, the electronic device can include more or less components than shown, or combine certain components, or include different components, for example, the electronic device can also include a network interface, a display screen, an input system, and the like.

[0054] In an embodiment, a computer readable storage medium is provided, when instructions in the computer readable storage medium are executed by a processor in an electronic device, the electronic device is enabled to perform each step of any of the embodiments of the method for allocating IP addresses based on a PON as disclosed in the present disclosure, which is not repeated here. The computer readable storage medium can be non-volatile or volatile.

[0055] The processor can be a CPU, and the processor can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.

[0056] The memory includes a readable storage medium, an internal memory, etc., wherein the internal memory can be the memory of the electronic device, and the internal memory provides an environment for the operation system and the computer readable instructions in the readable storage medium. The readable storage medium can be the hard disk of the electronic device, and in other embodiments, the readable storage medium can also be the external storage device of the electronic device, for example, the plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. equipped on the electronic device. Further, the memory can include both the internal storage unit of the electronic device and the external storage device. The memory is used to store the operation system, the cooperative application, the boot loader, the data, and other programs, such as the program code of the computer program, etc. The memory can also be used to temporarily store the data that has been output or will be output.

[0057] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the embodiments described above can be implemented by a computer program instructing relevant hardware, and the computer program can be stored in a nonvolatile computer readable storage medium. When the computer program is executed, the processes of the embodiments of the methods described above can be included. Any reference to memory, storage, database, or other medium used in the embodiments provided in the present application can include nonvolatile and / or volatile memory. Nonvolatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct RAM bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0058] Those of ordinary skill in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units and modules is exemplified, and in actual applications, the above functions can be completed by different functional units and modules according to needs, that is, the internal structure of the system is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit or module in the embodiments can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or software. In addition, the specific name of each functional unit or module is only for easy distinction, and does not limit the protection scope of the present application. The specific working process of the unit or module in the system can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here. If the integrated unit is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.

[0059] The above-described embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit the present application; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that the technical solutions recorded in the foregoing embodiments can still be modified, or some technical features can be replaced by equivalent replacements; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.

Claims

1. A PON-based IP address allocation method, characterized by, The method comprises the following steps: When a terminal device accesses a LAN interface of an optical modem, a DHCP dynamic address request from the terminal device is received, wherein the DHCP dynamic address request comprises access port type information of the terminal device, and the access port type information comprises a first LAN interface and a second LAN interface; According to the access port type information and a pre-labeled mapping relationship, an IP address pool to be fed back for the DHCP dynamic address request is determined, wherein the mapping relationship is a correspondence relationship between pre-labeled access port type information and a pre-configured IP address pool in the optical modem, and the pre-configured IP address pool in the optical modem comprises a static public network address pool and a private network address pool; According to the IP address pool to be fed back for the DHCP dynamic address request, an IP address is allocated to the terminal device, so that the optical modem performs different traffic forwarding strategies according to the IP address allocated to the terminal device, wherein the IP address comprises a first IP address and a second IP address.

2. The PON-based IP address allocation method of claim 1, wherein, The step of determining the IP address pool to be fed back for the DHCP dynamic address request according to the access port type information and the pre-labeled mapping relationship comprises: When the access port type information is the first LAN interface, a static public network address pool to be fed back for the DHCP dynamic address request is determined according to the pre-labeled mapping relationship; When the access port type information is the second LAN interface, a private network address pool to be fed back for the DHCP dynamic address request is determined according to the pre-labeled mapping relationship.

3. The PON-based IP address allocation method of claim 1, wherein, The step of allocating the IP address to the terminal device according to the IP address pool to be fed back for the DHCP dynamic address request comprises: When the IP address pool to be fed back for the DHCP dynamic address request is a static public network address pool, a first IP address is allocated to the terminal device, wherein the first IP address comprises a static public network IP address, a first gateway IP address and a first operator public DNS address in the same network segment as a WAN interface of the optical modem; When the IP address pool to be fed back for the DHCP dynamic address request is a private network address pool, a second IP address is allocated to the terminal device, wherein the second IP address comprises a private network IP address, a second gateway IP address and a second operator public DNS address.

4. The PON-based IP address allocation method of claim 1, wherein, The step of causing the optical modem to perform different traffic forwarding strategies according to the IP address allocated to the terminal device comprises: When the IP address allocated to the terminal device is the first IP address, it is checked whether the LAN interface of the optical modem accessed by the terminal device is the first LAN interface; If the LAN interface of the optical modem accessed by the terminal device is the first LAN interface, the traffic is forwarded to an operator network side with a public network IP address of the terminal device as a source address; When the IP address allocated to the terminal device is the second IP address, it is checked whether the LAN interface of the optical modem accessed by the terminal device is the second LAN interface; If the LAN interface of the terminal device accessing the optical modem is the second LAN interface, the private network IP address and the local port are replaced by the public network IP address and the dynamic port in the WAN interface of the optical modem respectively to forward the traffic.

5. The PON-based IP address allocation method of claim 1, wherein, Before receiving the DHCP dynamic address request from the terminal device when the terminal device accesses the LAN interface of the optical modem, the method comprises the following steps of: When the optical modem adopts a target dialing mode to dial data with the operator network side, a pre-configured static public network IP address is sent to the operator network side, wherein the target dialing mode is a mode supporting multiple PPPoE dialing; In the case of successful data dialing, the WAN interface of the optical modem is called to obtain IP configuration parameters; According to the IP configuration parameters, the static public address pool is configured for the optical modem on the original private address pool.

6. The PON-based IP address allocation method of claim 1, wherein, Before receiving the DHCP dynamic address request from the terminal device when the terminal device accesses the LAN interface of the optical modem, the method further comprises the following steps of: Obtaining the Protal authentication information of the optical modem; According to the Protal authentication information of the optical modem, it is judged whether the security baseline condition of the optical modem meets the preset security baseline condition; If the access port and IP address binding information of the optical modem match, the LAN interface of the optical modem is accessed to the terminal device. Before the IP address is allocated to the terminal device, the method comprises the following steps of:

7. The PON-based IP address allocation method of claim 1, wherein, It is judged whether the IP address is currently occupied by other terminal devices; ​ If the IP address is not occupied by other terminal devices, the step of allocating the IP address to the terminal device is executed; If the IP address is occupied by other terminal devices, the terminal device is re-allocated an IP address. The method comprises the following steps of:

8. A PON-based IP address allocation apparatus characterized by comprising: The receiving module is configured to receive a DHCP dynamic address request from the terminal device when the terminal device accesses the LAN interface of the optical modem, wherein the DHCP dynamic address request comprises access port type information of the terminal device, and the access port type information comprises a first LAN interface and a second LAN interface. The determining module is configured to determine an IP address pool to be fed back for the DHCP dynamic address request according to the access port type information and a pre-labeled mapping relationship, wherein the mapping relationship is a pre-labeled correspondence between the access port type information and a pre-configured IP address pool in the optical modem, and the pre-configured IP address pool in the optical modem comprises a static public network address pool and a private network address pool. The allocation module is configured to allocate an IP address to the terminal device according to the IP address pool to be fed back for the DHCP dynamic address request, so that the optical modem executes different traffic forwarding strategies according to the IP address allocated to the terminal device, wherein the IP address comprises a first IP address and a second IP address. The processor executes the computer program to realize the PON-based IP address allocation method according to any one of claims 1 to 7.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, ​ 10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. The computer program, when executed by a processor, implements the PON-based IP address allocation method according to any one of claims 1 to 7.