Method for acquiring DHCP (Dynamic Host Configuration Protocol) information on FTTR gateway in unvarnished transmission mode

By using the NETFILTER mechanism to obtain and parse DHCP messages on the FTTR gateway device, the problem of not being able to perceive DHCP information in the bridge mode is solved, and efficient acquisition and management of DHCP client information is achieved.

CN119030955APending Publication Date: 2024-11-26ITIBIA TECH (SUZHOU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411030666.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

When the FTTR gateway device connects to the network device in a bridge mode, it is unable to perceive and manage DHCP information, resulting in difficulty in obtaining DHCP information.

Method used

By configuring the bridge interface, the gateway device uses the Linux kernel NETFILTER mechanism to mount HOOK points on the FORWARD forwarding chain, obtain and parse messages between the DHCP client and the server, and record key DHCP information to the PROC file system.

Benefits of technology

It realizes that the gateway device efficiently obtains the MAC address, IP address and lease duration of the DHCP client in bridge mode, solving the problem of being unable to perceive and manage DHCP clients.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119030955A_ABST
    Figure CN119030955A_ABST
Patent Text Reader

Abstract

The invention discloses a method for acquiring DHCP (Dynamic Host Configuration Protocol) information on an FTTR (Fiber To The Rate) gateway in an unvarnished transmission mode, gateway equipment is set as a bridge interface, and the gateway equipment is in downlink connection with DHCP client equipment; the gateway device is in a transparent transmission mode, and the gateway device obtains a DHCP message sent to a local area network by a DHCP client through a kernel NETFILTER mechanism; and the gateway equipment analyzes the content of the DHCP message and records key information to the PROC file system. Through a kernel NETFILTER mechanism, a HOOK point is mounted on an FORWARD forwarding chain, a DHCP message sent by a DHCP client side is obtained, key information carried in the DHCP message is analyzed according to DHCP protocol specifications, and the problem that gateway equipment cannot sense and manage the DHCP client side in a bridge interface transparent transmission mode is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method for obtaining DHCP information in a transparent transmission mode on an FTTR gateway, and belongs to the technical field of network communication. Background Art

[0002] When the gateway device is connected to the network device in routing mode in the local area network, it can act as a DHCP server or DHCP relay server. At this time, the gateway device can obtain detailed DHCP information of the connected device through the DHCP service. However, when the gateway device is connected to the network device in bridging mode, it only forwards the message of the connected device to the Internet. The message content is transparent to the gateway device, and the gateway device cannot perceive and manage the connected network devices. For the gateway device and the management platform, obtaining DHCP and other information has become a real need. Summary of the invention

[0003] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a method for obtaining DHCP information in transparent transmission mode on an FTTR gateway, aiming to solve the problem that the gateway device cannot perceive DHCP messages in bridge transparent transmission mode.

[0004] The purpose of the present invention is achieved through the following technical solutions:

[0005] The method for obtaining DHCP information in the transparent transmission mode on the FTTR gateway has the following characteristics: the gateway device in the FTTR network architecture is configured with a bridge interface, the gateway device is downstream connected to the DHCP client device, for the DHCP client device, the DHCP message is only forwarded by the gateway device, and the DHCP message is transparent to the gateway device; the gateway device is in the transparent transmission mode, and the gateway device obtains the DHCP message sent by the DHCP client to the local area network through the Linux kernel NETFILTER mechanism; the gateway device parses the obtained DHCP message according to the DHCP protocol, and records the key DHCP information to the PROC file system.

[0006] Further, in the above-mentioned method for obtaining DHCP information in the transparent transmission mode on the FTTR gateway, the gateway device is configured with a bridge interface, the gateway device is downstream connected to the DHCP client device, the DHCP client device actively broadcasts and sends a DHCPDISCOVER message, after the DHCP client receives the DHCP OFFER message unicasted by the DHCP server in the local area network forwarded by the gateway device, it broadcasts and sends a DHCP REQUEST message, and receives the DHCP ACK message unicasted by the DHCP server, and the gateway device and the DHCP client device go through the complete process required by the DHCP protocol;

[0007] The DHCP client sends a DHCP RELEASE message after releasing the IP or the DHCP lease expires. The message is forwarded to the DHCP server via the gateway device.

[0008] Furthermore, in the above-mentioned method for obtaining DHCP information in transparent transmission mode on the FTTR gateway, the DHCP ACK message includes the Internet Protocol IP address provided by the DHCP server and the lease time provided by the DHCP server.

[0009] Furthermore, in the above-mentioned method for obtaining DHCP information in transparent transmission mode on the FTTR gateway, the DHCPRELEASE message includes the Internet Protocol IP address provided by the DHCP server.

[0010] Furthermore, in the above-mentioned method for obtaining DHCP information in transparent transmission mode on the FTTR gateway, the gateway device is in transparent transmission mode after configuring the bridge interface, and the gateway device mounts a HOOK point on the FORWARD forwarding chain through the kernel NETFILTER mechanism, obtains the DHCP message sent by the DHCP client to the local area network at the HOOK point, and in the process of the DHCP client and the DHCP server interacting to obtain an available IP address, the gateway device obtains a DHCP ACK message at the HOOK point; when the DHCP client releases the IP address or the lease expires, the gateway device obtains a DHCP RELEASE message at the HOOK point.

[0011] Furthermore, in the above-mentioned method for obtaining DHCP information in transparent transmission mode on the FTTR gateway, the gateway device parses the obtained DHCP ACK or DHCP RELEASE message according to the DHCP protocol at the mounted HOOK point, and the parsing steps are as follows:

[0012] Get the UDP message on the FORWARD forwarding chain in the kernel NETFILTER framework;

[0013] Obtain the source port and destination port information of the UDP message to determine that the message is a DHCP message;

[0014] According to the DHCP protocol specification, parse the message type in the DHCP OPTION content to determine whether the current message is a DHCP ACK or DHCP RELEASE type;

[0015] According to the DHCP protocol specification, parse and save the lease duration information in the DHCP OPTION content;

[0016] According to the DHCP protocol specification, parse and save the MAC address of the DHCP client in the DHCP message;

[0017] According to the DHCP protocol specification, parse and save the IP address assigned by the DHCP server to the DHCP client in the DHCP message;

[0018] A timer is set according to the lease duration in the DHCP message, and the saved DHCP information is automatically cleared when the timer times out.

[0019] Furthermore, in the above-mentioned method for obtaining DHCP information in transparent transmission mode on the FTTR gateway, the key information in the DHCP message parsed by the gateway device is recorded in the PROC file of the Linux system and provided to the Linux application layer for use, and the steps are as follows:

[0020] Create a PROC file for outputting DHCP information recorded by the gateway device to a user-readable file;

[0021] When the user layer reads the PROC file, it outputs key DHCP information.

[0022] Furthermore, in the above-mentioned method for obtaining DHCP information in transparent transmission mode on the FTTR gateway, the DHCP information includes the MAC address of the DHCP client, the IP address assigned to the DHCP client by the DHCP server, and the DHCP lease duration.

[0023] Compared with the prior art, the present invention has significant advantages and beneficial effects, which are specifically embodied in the following aspects:

[0024] The present invention provides a method for efficiently acquiring DHCP information when the gateway device is in a bridge transparent transmission mode for a gateway device in an FTTR network architecture; through the kernel NETFILTER mechanism, a HOOK point is mounted on the FORWARD forwarding chain to acquire the DHCP message sent by the DHCP client, and the key information carried in the DHCP message is parsed according to the DHCP protocol specification, thereby solving the problem that the gateway device cannot perceive and manage the DHCP client in the bridge interface transparent transmission mode.

[0025] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or be understood by practicing the specific embodiments of the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0027] Figure 1 : Schematic diagram of the process of the present invention;

[0028] Figure 2 : Schematic diagram of the process of parsing DHCP messages;

[0029] Figure 3 : A structural diagram that stores key information of DHCP messages. DETAILED DESCRIPTION

[0030] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents the selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention.

[0031] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, directional terms and order terms are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0032] The invention provides a method for efficiently obtaining DHCP (Dynamic Host Configuration Protocol) information in a gateway device in a FTTR (Fiber To The Room) network architecture when the gateway device is a bridge transparent transmission mode.

[0033] like Figure 1 As shown, the method for obtaining DHCP information in transparent transmission mode on the FTTR gateway includes the following steps:

[0034] Step S101, a gateway device in the FTTR network architecture configures a bridge interface, and the gateway device is downstream connected to a DHCP client device. For the DHCP client device, a DHCP message is only forwarded by the gateway device, and the DHCP message is transparent to the gateway device;

[0035] The gateway device is configured with a bridge interface, and the gateway device is connected to the DHCP client device downstream. The DHCP client device actively broadcasts and sends a DHCP DISCOVER message. After receiving the DHCP OFFER message unicasted by the DHCP server in the LAN forwarded by the gateway device, the DHCP client broadcasts and sends a DHCP REQUEST message, and receives the DHCP ACK message unicasted by the DHCP server. The DHCP ACK message contains the Internet Protocol IP address provided by the DHCP server and the lease time provided by the DHCP server. The gateway device and the DHCP client device go through the complete process required by the DHCP protocol. After releasing the IP or the DHCP lease expires, the DHCP client sends a DHCP RELEASE message. The DHCP RELEASE message contains the Internet Protocol IP address provided by the DHCP server. The message is forwarded to the DHCP server via the gateway device.

[0036] Step S102, the gateway device is in transparent transmission mode, and the gateway device obtains the DHCP message sent by the DHCP client to the local area network through the Linux kernel NETFILTER mechanism;

[0037] Step S103: the gateway device parses the acquired DHCP message according to the DHCP protocol, and records key DHCP information to the PROC file system.

[0038] Step S102 further comprises:

[0039] After the gateway device is configured with a bridge interface, it is in transparent transmission mode. The gateway device obtains the DHCP message sent by the DHCP client to the LAN through the Linux kernel NETFILTER mechanism, mounts the HOOK point on the FORWARD forwarding chain of the NETFILTER framework, and obtains the DHCP message sent by the DHCP client to the LAN at the HOOK point. During the process of the DHCP client and the DHCP server interacting to obtain an available IP address, the gateway device obtains the DHCP ACK message at the HOOK point; when the DHCP client releases the IP address or the lease expires, the gateway device obtains the DHCP RELEASE message at the HOOK point.

[0040] like Figure 2 As shown, the gateway device parses the obtained DHCP ACK or DHCP RELEASE message according to the DHCP protocol at the mounted HOOK point. First, it determines whether the message obtained from the FORWARD forwarding chain in the kernel NETFILTER framework is a UDP message; if it is not a UDP message, it exits the parsing; if it is a UDP message, it parses the source port and destination port information of the UDP message;

[0041] Secondly, determine whether the message is a DHCP message based on the source port and destination port of the UDP message. If it is not a DHCP message, exit the parsing process; if it is a DHCP message, parse the message type in the DHCP OPTION content according to the DHCP protocol specification;

[0042] Then, according to the DHCP message type, determine whether the current message is a DHCP ACK or DHCP RELEASE type; and according to the DHCP protocol specification, parse the lease duration information in the DHCP OPTION content, the MAC address of the DHCP client in the DHCP message, and the IP address assigned to the DHCP client by the DHCP server in the DHCP message;

[0043] Finally, if the message is a DHCP RELEASE message, a timer is set according to the lease duration in the DHCP message, and the saved DHCP information is automatically cleared when the timer times out; if it is a DHCP ACK message, the lease duration information, the MAC address of the DHCP client, and the IP address of the DHCP client are saved.

[0044] like Figure 3 ,Schematic diagram of the structure used to store DHCP key information, which includes, in addition to the above DHCP key information, a timer, a hash value of a MAC address, an information record validity flag, and the initial time of record generation.

[0045] Step S103 mainly outputs the stored DHCP information through the PROC file when the upper layer application needs it.

[0046] Record the key information in the DHCP message parsed by the gateway device into the PROC file of the Linux system and provide it to the Linux application layer. The steps are as follows:

[0047] Create a PROC file for outputting DHCP information recorded by the gateway device to a user-readable file;

[0048] When the user layer reads the PROC file, it outputs key DHCP information, including: the MAC address of the DHCP client, the IP address assigned to the DHCP client by the DHCP server, and the DHCP lease duration.

[0049] In summary, the present invention uses the kernel NETFILTER mechanism to mount a HOOK point on the FORWARD forwarding chain, obtains the DHCP message sent by the DHCP client, and parses the key information carried in the DHCP message according to the DHCP protocol specification, thereby solving the problem that the gateway device cannot perceive and manage the DHCP client in the bridge interface transparent transmission mode.

[0050] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention. It should be noted that similar numbers and letters represent similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.

[0051] The above is only a specific implementation of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

[0052] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

Claims

1. A method for obtaining DHCP information in transparent transmission mode on an FTTR gateway, characterized in that: The gateway device in the FTTR network architecture is configured with a bridge interface. The gateway device is downstream connected to the DHCP client device. For the DHCP client device, the DHCP message is only forwarded by the gateway device, and the DHCP message is transparent to the gateway device. The gateway device is in transparent transmission mode. The gateway device obtains the DHCP message sent by the DHCP client to the LAN through the Linux kernel NETFILTER mechanism. The gateway device parses the obtained DHCP message according to the DHCP protocol and records the key DHCP information to the PROC file system.

2. The method for obtaining DHCP information in transparent transmission mode on the FTTR gateway according to claim 1, characterized in that: The gateway device is configured with a bridge interface. The gateway device is connected to the DHCP client device downstream. The DHCP client device actively broadcasts a DHCP DISCOVER message. After receiving the DHCP OFFER message unicasted by the DHCP server in the LAN forwarded by the gateway device, the DHCP client broadcasts a DHCP REQUEST message and receives the DHCPACK message unicasted by the DHCP server. The gateway device and the DHCP client device go through the complete process required by the DHCP protocol. The DHCP client sends a DHCP RELEASE message after releasing the IP or the DHCP lease expires. The message is forwarded to the DHCP server via the gateway device.

3. The method for obtaining DHCP information in transparent transmission mode on the FTTR gateway according to claim 2 is characterized in that: The DHCP ACK message contains the Internet Protocol IP address provided by the DHCP server and the lease time provided by the DHCP server.

4. The method for obtaining DHCP information in transparent transmission mode on the FTTR gateway according to claim 2, characterized in that: The DHCP RELEASE message contains the Internet Protocol (IP) address offered by the DHCP server.

5. The method for obtaining DHCP information in transparent transmission mode on the FTTR gateway according to claim 1, characterized in that: After the gateway device is configured with a bridge interface, it is in transparent transmission mode. The gateway device mounts a HOOK point on the FORWARD forwarding chain through the kernel NETFILTER mechanism, and obtains the DHCP message sent by the DHCP client to the LAN at the HOOK point. During the process of the DHCP client and the DHCP server interacting to obtain an available IP address, the gateway device obtains a DHCP ACK message at the HOOK point. When the DHCP client releases the IP address or the lease expires, the gateway device obtains the DHCP RELEASE message at the HOOK point.

6. The method for obtaining DHCP information in transparent transmission mode on the FTTR gateway according to claim 5, characterized in that: The gateway device parses the obtained DHCP ACK or DHCP RELEASE message according to the DHCP protocol at the mounted HOOK point. The parsing steps are as follows: Get the UDP message on the FORWARD forwarding chain in the kernel NETFILTER framework; Obtain the source port and destination port information of the UDP message to determine that the message is a DHCP message; According to the DHCP protocol specification, parse the message type in the DHCP OPTION content to determine whether the current message is a DHCP ACK or DHCPRELEASE type; According to the DHCP protocol specification, parse and save the lease duration information in the DHCP OPTION content; According to the DHCP protocol specification, parse and save the MAC address of the DHCP client in the DHCP message; According to the DHCP protocol specification, parse and save the IP address assigned by the DHCP server to the DHCP client in the DHCP message; A timer is set according to the lease duration in the DHCP message, and the saved DHCP information is automatically cleared when the timer times out.

7. The method for obtaining DHCP information in transparent transmission mode on the FTTR gateway according to claim 1, characterized in that: Record the key information in the DHCP message parsed by the gateway device into the PROC file of the Linux system and provide it to the Linux application layer. The steps are as follows: Create a PROC file for outputting DHCP information recorded by the gateway device to a user-readable file; When the user layer reads the PROC file, it outputs key DHCP information.

8. The method for obtaining DHCP information in transparent transmission mode on the FTTR gateway according to claim 7, characterized in that: DHCP information includes the MAC address of the DHCP client, the IP address assigned to the DHCP client by the DHCP server, and the DHCP lease duration.