CN112688958B - Information processing method and electronic equipment - Google Patents

Information processing method and electronic equipment Download PDF

Info

Publication number
CN112688958B
CN112688958B CN202011610459.5A CN202011610459A CN112688958B CN 112688958 B CN112688958 B CN 112688958B CN 202011610459 A CN202011610459 A CN 202011610459A CN 112688958 B CN112688958 B CN 112688958B
Authority
CN
China
Prior art keywords
address
relation table
target
lease
electronic device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011610459.5A
Other languages
Chinese (zh)
Other versions
CN112688958A (en
Inventor
杨登富
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lenovo Future Communication Technology Chongqing Co Ltd
Original Assignee
Lenovo Future Communication Technology Chongqing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lenovo Future Communication Technology Chongqing Co Ltd filed Critical Lenovo Future Communication Technology Chongqing Co Ltd
Priority to CN202011610459.5A priority Critical patent/CN112688958B/en
Publication of CN112688958A publication Critical patent/CN112688958A/en
Application granted granted Critical
Publication of CN112688958B publication Critical patent/CN112688958B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Small-Scale Networks (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses an information processing method and electronic equipment, wherein the method comprises the following steps: receiving an address lease for assigning a dynamic IP address to a first electronic device; extracting a first MAC address and a first IP address from an address lease at least, and constructing a first relation table based on the first IP address and the first MAC address at least; receiving a first request sent by second electronic equipment and used for requesting to acquire a target MAC address of target equipment; and under the condition that the first relation table has a relation table item matched with the target IP address, acquiring the first MAC address in the relation table item, and sending the acquired first MAC address to the second electronic equipment. The method can inhibit the broadcast operation of executing the first request based on the address resolution protocol, is beneficial to saving bandwidth resources, can prevent illegal equipment from pretending to be deception behavior that target equipment feeds back illegal MAC addresses to the request equipment, and is beneficial to improving the security of network communication.

Description

Information processing method and electronic equipment
Technical Field
The present disclosure relates to the field of electronic devices, and in particular, to an information processing method and an electronic device.
Background
For a protocol data unit Session (PDU Session) of the Ethernet (Ethernet) type, packets of a User Equipment (UE) are packet-encapsulated based on the Ethernet protocol and support Internet Protocol (IP) communication. When one end (UE end) of IP communication initiates IP communication, if there is no corresponding Address Resolution Protocol (ARP) entry in the device, an ARP request needs to be initiated. The ARP request message is a data link layer broadcast message, which performs broadcast forwarding in a data link layer broadcast domain and consumes a large amount of bandwidth resources in the forwarding of a user plane conversion (UPF) device that acts as an anchor (PSA) for a protocol data unit session.
Content of application
In view of the foregoing problems in the prior art, the present application provides an information processing method and an electronic device, and an embodiment of the present application adopts the following technical solutions:
an information processing method comprising:
receiving an address lease used for allocating a dynamic IP address to a first electronic device, wherein the address lease at least comprises a first MAC address of the first electronic device and a first IP address permitted to be used by the first electronic device;
extracting the first MAC address and the first IP address from the address lease at least, and constructing a first relation table based on the first IP address and the first MAC address at least, wherein the first relation table comprises a relation table item containing the association relation between the first IP address and the first MAC address;
receiving a first request which is sent by second electronic equipment and used for requesting to acquire a target MAC address of target equipment, wherein the first request at least comprises a target IP address of the target equipment;
and under the condition that the first relation table has the relation table item matched with the target IP address, acquiring the first MAC address in the relation table item, and sending the acquired first MAC address to the second electronic equipment.
In some embodiments, the relationship table entry further includes a first identifier for identifying a virtual local area network to which the first electronic device belongs, and the first request further includes a second identifier for identifying the virtual local area network of the second electronic device;
in a case that the first relation table has the relation table entry matching the target IP address, acquiring the first MAC address in the relation table entry, and sending the acquired first MAC address to the second electronic device, the method includes:
and under the condition that the first target IP address contained in the relation table item is matched with the target IP address and the first identifier contained in the relation table item is matched with the second identifier, acquiring the first MAC address in the relation table item and sending the acquired first MAC address to the second electronic equipment.
In some embodiments, the first request is uplink information; executing a preset operation based on an address resolution protocol under the condition that the first relation table does not have the relation table item which contains the first IP address matched with the target IP address and contains the first identifier matched with the second identifier; or
The first request information is downlink information, and when the first relation table has the relation table item which contains the first IP address matched with the target IP address but contains the first identifier not matched with the second identifier, a preset operation is executed based on an address resolution protocol; or
The first request information is downlink information, and the first request is discarded when the first relation table does not have the relation table item, which is included in the first relation table and matches the first IP address with the target IP address.
In some embodiments, said extracting said first MAC address and said first IP address from at least said address lease and building a first relationship table based on at least said first IP address and said first MAC address comprises:
analyzing the address lease to obtain the first IP address, the first MAC address, the first identifier and a first lease term; wherein the first lease term is a term for permitting the first electronic device to use the first IP address;
constructing the first relationship table based on the first IP address, the first MAC address, the first identifier, and the first lease duration.
In some embodiments, the method further comprises:
updating the constructed first relationship table based at least on the obtained another address lease.
In some embodiments, the updating the built first relationship table based at least on the obtained another address lease comprises:
determining whether the first relation table has a relation table item matched with the first IP address in the other address lease or not under the condition of acquiring the other address lease;
adding a relationship entry in the first relationship table based on the first IP address, the first MAC address, the first identifier, and the first lease duration obtained from the other address lease if the first relationship table does not have a relationship entry matching the first IP address in the other address lease;
in the event that there is a relationship entry in the first relationship table that matches the first IP address in the other address lease, updating the relationship entry based on the first lease term in the other address lease.
In some embodiments, the updating the built first relationship table based at least on the obtained another address lease further comprises:
in the event that the first lease term expires, deleting the corresponding relationship table entry from the first relationship table.
In some embodiments, the updating the built first relationship table based at least on the obtained another address lease further comprises:
and deleting the relation table entry corresponding to the first IP address requested to be released in the first relation table under the condition that a second request for requesting to release the first IP address is received.
An electronic device, comprising:
a first receiving module, configured to receive an address lease used for allocating a dynamic IP address to a first electronic device, where the address lease includes at least a first MAC address of the first electronic device and a first IP address permitted to be used by the first electronic device;
a building module, configured to extract at least the first MAC address and the first IP address from the address lease, and build a first relation table based on at least the first IP address and the first MAC address, where the first relation table includes a relation table entry including an association relation between the first IP address and the first MAC address;
a second receiving module, configured to receive a first request sent by a second electronic device and used for requesting to acquire a target MAC address of a target device, where the first request at least includes a target IP address of the target device;
a sending module, configured to, when the first relation table has the relation table entry matching the target IP address, obtain the first MAC address in the relation table entry, and send the obtained first MAC address to the second electronic device.
An electronic device comprising at least a memory having an executable program stored thereon and a processor, the processor when executing the executable program on the memory implementing the steps of:
receiving an address lease for assigning a dynamic IP address to a first electronic device, wherein the address lease comprises at least a first MAC address of the first electronic device and a first IP address permitted for use by the first electronic device;
extracting the first MAC address and the first IP address from the address lease at least, and constructing a first relation table based on the first IP address and the first MAC address at least, wherein the first relation table comprises a relation table item containing the association relation between the first IP address and the first MAC address;
receiving a first request sent by a second electronic device and used for requesting to acquire a target MAC address of a target device, wherein the first request at least comprises a target IP address of the target device;
and under the condition that the first relation table has the relation table item matched with the target IP address, acquiring the first MAC address in the relation table item, and sending the acquired first MAC address to the second electronic equipment.
According to the information processing method, the intermediate device is responsible for forwarding the address lease, the address lease comprises the first MAC address and the first IP address of the first electronic device, the first MAC address and the first IP address are skillfully acquired from the address lease, and a first relation table is constructed on the basis of the first MAC address and the first IP address; when a first request for requesting to acquire a target MAC address of a target device is received, the first MAC address corresponding to the target IP address in the first relation table is matched based on the target IP address in the first request, and the acquired first MAC address is sent to the second electronic device as the target MAC address.
Drawings
FIG. 1 is a flow chart of an information processing method according to an embodiment of the present application;
FIG. 2 is a flowchart of step S2 of an information processing method according to an embodiment of the present application;
fig. 3 is a schematic diagram of a connection structure between a first electronic device and a second electronic device in an information processing method according to an embodiment of the present application;
fig. 4 is a schematic diagram of another connection structure of a first electronic device and a second electronic device in an information processing method according to an embodiment of the present application;
fig. 5 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Various aspects and features of the present application are described herein with reference to the drawings.
It should be understood that various modifications may be made to the embodiments of the present application. Accordingly, the foregoing description should not be considered as limiting, but merely as exemplifications of embodiments. Those skilled in the art will envision other modifications within the scope and spirit of the application.
The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the application and, together with a general description of the application given above, and the detailed description of the embodiments given below, serve to explain the principles of the application.
These and other characteristics of the present application will become apparent from the following description of preferred forms of embodiment, given as non-limiting examples, with reference to the attached drawings.
It is also to be understood that although the present application has been described with reference to some specific examples, those skilled in the art are able to ascertain many other equivalents to the practice of the present application.
The above and other aspects, features and advantages of the present application will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.
Specific embodiments of the present application are described hereinafter with reference to the accompanying drawings; however, it is to be understood that the disclosed embodiments are merely exemplary of the application, which can be embodied in various forms. Well-known and/or repeated functions and constructions are not described in detail to avoid obscuring the application of unnecessary or unnecessary detail. Therefore, specific structural and functional details disclosed herein are not to be interpreted as limiting, but merely as a basis for the claims and as a representative basis for teaching one skilled in the art to variously employ the present application in virtually any appropriately detailed structure.
The description may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," which may each refer to one or more of the same or different embodiments in accordance with the application.
An embodiment of the present application provides an information processing method, including:
receiving an address lease used for allocating a dynamic IP address to a first electronic device, wherein the address lease at least comprises a first MAC address of the first electronic device and a first IP address permitted to be used by the first electronic device;
extracting the first MAC address and the first IP address from the address lease at least, and constructing a first relation table based on the first IP address and the first MAC address at least, wherein the first relation table comprises a relation table item containing the association relation between the first IP address and the first MAC address;
receiving a first request sent by a second electronic device and used for requesting to acquire a target MAC address of a target device, wherein the first request at least comprises a target IP address of the target device;
and under the condition that the first relation table has the relation table item matched with the target IP address, acquiring the first MAC address in the relation table item, and sending the acquired first MAC address to the second electronic equipment.
According to the information processing method, the intermediate device is responsible for forwarding the address lease, the address lease comprises the first MAC address and the first IP address of the first electronic device, the first IP address and the first MAC address of the first electronic device are skillfully acquired from the address lease, and a first relation table is constructed on the basis of the acquired first MAC address and the acquired first IP address; when a first request for requesting to acquire a target MAC address of a target device is received, the first MAC address corresponding to the target IP address in the first relation table is matched based on the target IP address in the first request, and the acquired first MAC address is sent to the second electronic device as the target MAC address, so that the broadcast operation of the first request can be restrained, the bandwidth resource can be saved, the fraudulent behavior that the target device feeds back the illegal MAC address to the request device due to the fact that illegal devices are disguised can be prevented, and the network communication safety can be improved.
The steps and principles of the information processing method according to the embodiment of the present application will be described in detail below with reference to the specific embodiment and the drawings.
The information processing method of the embodiment of the application can be applied to an intermediate device connected between a terminal device used by a user and a digital network, and the intermediate device can be, for example, a user plane device (UPF), and of course, the intermediate device can also be other electronic devices connected between the terminal device and the digital network.
Fig. 1 is a flowchart of an information processing method according to an embodiment of the present application, and referring to fig. 1, the information processing method according to the embodiment of the present application specifically includes the following steps:
the method includes the steps of S1, receiving an address lease used for allocating a dynamic network protocol (IP) address to first electronic equipment, wherein the address lease at least comprises a first Media Access Control (MAC) address of the first electronic equipment and a first network protocol (IP) address allowed to be used by the first electronic equipment.
The first electronic device, which is a terminal device used by the user, may be connected to the digital network through an intermediate device, such as a user plane device. A dynamic host (DHCP server) may be provided in the intermediate device, the Digital Network (DN), or on a session management function device (SMF) connected to the intermediate device. When the first electronic equipment is connected to the digital network, a request for acquiring the dynamic IP address is sent to the dynamic host, the dynamic host sends an address lease for allocating the dynamic IP address to the first electronic equipment through the intermediate equipment, and in the process, the intermediate equipment can receive the address lease and is responsible for forwarding the address lease to the first electronic equipment. The address lease includes at least a first MAC address of the first electronic device and a first IP address permitted to be used by the first electronic device.
S2, at least extracting the first MAC address and the first IP address from the address lease, and constructing a first relation table at least based on the first IP address and the first MAC address, wherein the first relation table comprises a relation table item containing the incidence relation between the first IP address and the first MAC address.
Upon receiving the address lease, the intermediate device not only forwards the address lease to the first electronic device so that the first electronic device acquires the permitted first IP address, but also extracts the first MAC address and the first IP address of the first electronic device from the address lease. The intermediate device is used for forwarding the address lease and the characteristics that the address lease comprises the first MAC address and the first IP address of the first electronic device are utilized, so that the first IP address and the first MAC address of the first electronic device are skillfully obtained from the address lease.
In a specific implementation, the address lease may be resolved based on a Dynamic Host Configuration Protocol (DHCP), the first MAC address and the first IP address may be extracted from a data set obtained by resolving the address lease, and then a first relationship table may be constructed based on the obtained first IP address and the first MAC address, where the first relationship table may include a plurality of relationship entries, and each relationship entry may include at least one association relationship between the first IP address and the first MAC address. The constructed first relation table may be stored in the intermediate device, or may be stored in a storage device that is convenient for the user plane device to obtain.
In practical application, the first IP address and the first MAC address are not limited to be obtained from the address lease, the first relation table is not limited to be constructed based on the first IP address and the first MAC address, and the first relation table may further include other parameters.
S3, receiving a first request which is sent by second electronic equipment and used for requesting to acquire a target MAC address of target equipment, wherein the first request at least comprises the target IP address of the target equipment.
When a second electronic device needs to perform a protocol data unit session (PDU session) based on an Ethernet protocol (Ethernet) with a target device, the second electronic device first searches whether an Address Resolution Protocol (ARP) entry including a target IP address and a target MAC address of the target device is locally stored in the second electronic device, and sends a first request, that is, an ARP request, for requesting to acquire the target MAC address of the target device, where the first request at least includes the target IP address of the target device, under the condition that the second electronic device does not locally find the corresponding ARP entry.
The second electronic device may be a terminal device connected to the digital network through an intermediate device such as a user plane device; the second electronic device may also be a terminal device that is connected to the digital network through another intermediate device and is connected to the intermediate device applied to the information processing method according to the embodiment of the present application through the another intermediate device. That is, the first request sent by the second electronic device may be uplink information or downlink information.
S4, under the condition that the first relation table has the relation table item matched with the target IP address, the first MAC address in the relation table item is obtained, and the obtained first MAC address is sent to the second electronic equipment.
In the case of receiving the first request, the first request may be parsed based on an address resolution protocol, a target IP address of the target device may be obtained, and whether a relation table item matching the target IP address exists is searched in the first relation table, that is, whether a relation table item including the first IP address and the target IP address matches exists. And if the first relation table has a relation table item matched with the target IP address, regarding a first MAC address associated with the first IP address in the relation table item as the target MAC address, acquiring the first MAC address from the relation table item, feeding the first MAC address serving as the target MAC address back to the second electronic equipment, and stopping executing preset operation corresponding to the first request based on an Address Resolution Protocol (ARP).
According to the information processing method, the intermediate device is responsible for forwarding the address lease, the address lease comprises the first MAC address and the first IP address of the first electronic device, the first MAC address and the first IP address are skillfully acquired from the address lease, and a first relation table is constructed on the basis of the first MAC address and the first IP address; when a first request for requesting to acquire a target MAC address of a target device is received, the first MAC address corresponding to the target IP address in the first relation table is matched based on the target IP address in the first request, and the acquired first MAC address is sent to the second electronic device as the target MAC address.
In some embodiments, referring to fig. 2, in step S2, the extracting the first MAC address and the first IP address from the address lease and constructing a first relation table based on at least the first IP address and the first MAC address includes:
s21, resolving the address lease to obtain the first IP address, the first MAC address, the first identifier and a first lease term;
s22, building the first relation table based on the first IP address, the first MAC address, the first identifier, and the first lease term.
The address lease includes not only a first IP address permitted for the first electronic device and a first MAC address of the first electronic device itself, but also a first identifier for identifying the virtual local area network of the first electronic device and a first lease term, where the first lease term is a term for permitting the first electronic device to use the first IP address, that is, the first lease term can represent a validity period of the first IP address.
And acquiring the first IP address, the first MAC address, the first identifier and the first lease term, constructing the first relation table, and adding the first IP address, the first MAC address, the first identifier and the first lease term into the first relation table as contents in the same relation table item in the first relation table. The first identifier can be matched with the virtual local area network of the equipment, and whether the first IP address is in the validity period can be determined through the first lease term so as to determine the validity of the first IP address.
The format of part of the message content of an address lease may be as follows:
Client IP address:0.0.0.0
Your(client)IP address:1.1.1.2
Next server IP address:0.0.0.0
Relay agent IP address:0.0.0.0
Client MAC address:ca:02:04:94:00:08(ca:02:04:94:00:08)
Client hardware address padding:00000000000000000000
Server host name not given
Boot file name not given
Magic cookie:DHCP
Option:(53)DHCP Message Type(ACK)
Option:(54)DHCP Server Identifier
Option:(51)IP Address Lease Time
Option:(58)Renewal Time Value
Option:(59)Rebinding Time Value
Option:(1)Subnet Mask
Option:(3)Router
Option:(6)Domain Name Server
Option:(255)End
Padding:0000000000000000000000000000
in a specific implementation, the first IP Address may be obtained from a "Your (Client) IP Address:1.1.1.2" field, the first MAC Address is obtained from a "Client MAC Address: ca: 02. Further, the license expiration time of the first IP address may be determined based on the expiration of the first lease and the current time or time information in the address lease that characterizes its sending time.
In some embodiments, the relationship table entry further includes a first identifier for identifying a virtual local area network to which the first electronic device belongs, and the first request further includes a second identifier for identifying the virtual local area network of the second electronic device;
in a case that the first relation table has the relation table entry matching the target IP address, acquiring the first MAC address in the relation table entry, and sending the acquired first MAC address to the second electronic device, the method includes:
and under the condition that the first target IP address contained in the relation table item is matched with the target IP address and the first identifier contained in the relation table item is matched with the second identifier, acquiring the first MAC address in the relation table item, and sending the acquired first MAC address to the second electronic equipment.
Generally, a requesting device and a target device performing a protocol data unit session (PDU session) based on an Ethernet protocol (Ethernet) need to be located in the same virtual local area network, and the requesting device can directly establish a PDU session with the target device based on a target IP address and a target MAC address. By judging whether the first identifier is matched with the second identifier or not, whether the first electronic device and the second electronic device belong to the same virtual local area network or not can be determined, the target MAC address of the target device is matched in the first relation table, and the target MAC address is fed back to the request device when the target device and the request device belong to the same virtual local area network is determined.
In some embodiments, the first request is uplink information; executing a preset operation based on an address resolution protocol under the condition that the first relation table does not have the relation table item which contains the first IP address matched with the target IP address and the first identifier matched with the second identifier; or
The first request information is downlink information, and when the first relation table has the relation table item which contains the first IP address matched with the target IP address but contains the first identifier not matched with the second identifier, a preset operation is executed based on an address resolution protocol; or
The first request information is downlink information, and the first request is discarded when the first relation table does not have the relation table item, which is included in the first relation table and matches the first IP address with the target IP address.
In the following, a detailed description is given of a scheme of the embodiment of the present application with reference to fig. 3, in which a first electronic device 101 is connected to an intermediate device 104 through an access network 102 and an intermediate user plane device 103, a second electronic device 106 is connected to the intermediate device 104 through an access network 107 and an intermediate user plane device 108, the other side of the intermediate device 104 is connected to a digital network 105, the intermediate device 104 may specifically be an end user plane device (PSA UPF), and the information processing method of the embodiment of the present application is applied to the end user plane device.
When the intermediate device 104 receives the first request sent by the second electronic device 106 through the N9 interface, the first request is uplink information. Intermediary 104 matches the destination IP address and the second identification in the first request with the first relationship table. At this time, there are two cases, one is that the first relation table has a relation table entry in which the included first IP address matches the target IP address and the included first identifier matches the second identifier, the intermediate device 104 extracts the first MAC address from the relation table entry, feeds the first MAC address back to the second electronic device 106, and stops executing the preset operation corresponding to the first request based on an Address Resolution Protocol (ARP); in another case, the first relation table does not have a relation table entry that includes the first IP address matching the target IP address and the first identifier matching the second identifier, and the preset operation corresponding to the first request is executed based on the ARP protocol. The predetermined operation may include broadcasting the first request within a local area network, performing a redirection operation, or performing an ARP proxy operation, etc. In particular, the preset operation is configured to the intermediate device by, for example, the session management function device.
When the intermediate device 104 receives a first request sent by another electronic device in the digital network through the N6 interface, the first request is downlink information. The intermediate device matches the target IP address and the second identifier in the first request with the first relationship table. At this time, there are three cases, one of which is that the first relation table has a relation table entry in which the included first IP address matches the target IP address and the included first identifier matches the second identifier, the intermediate device 104 extracts the first MAC address from the relation table entry, feeds the first MAC address back to the other electronic device, and stops executing the preset operation corresponding to the first request based on the ARP protocol; in another case, if the first relation table has a relation table entry that includes the first IP address matching the target IP address but includes the first identifier not matching the second identifier, a preset operation corresponding to the first request is executed based on the ARP protocol, where the preset operation generally includes executing a redirection operation and executing an ARP proxy operation; in another case, the first relation table does not have a relation table entry containing a first IP address matching the target IP address, which indicates that the target device is not connected to the intermediate device 104, and the target MAC address of the target device cannot be acquired by the intermediate device 104 even if a downlink broadcast operation is performed, so that the first request may be discarded, and a preset operation corresponding to the first request is not performed based on the ARP protocol, so as to save bandwidth resources.
In the following, a detailed description is given to a scheme of the embodiment of the present application with reference to fig. 4, a first electronic device 201 is connected to a digital network 205 through an access network 202, an intermediate user plane device 203, and an intermediate device 204, which are sequentially connected, a second electronic device 206 is connected to the digital network 205 through an access network 207, an intermediate user plane device 208, and an intermediate device 209, which are sequentially connected, the intermediate device 204 and the intermediate device 209 are connected to each other, both the intermediate devices 204 and 209 may be end user plane devices (PSA UPFs), and an information processing method according to the embodiment of the present application is applied to the intermediate device 204 and the intermediate device 209.
When the intermediate device 209 receives the first request sent by the second electronic device 206 through the N9 interface, the first request is uplink information. Intermediary 209 matches the destination IP address and the second identification in the first request with the first relationship table. At this time, there are two cases, namely, in one case, the first relation table has a relation table entry that includes the first IP address matching the target IP address and the first identifier matching the second identifier, the intermediate device 209 extracts the first MAC address from the relation table entry, feeds the first MAC address back to the second electronic device 206, and stops executing the preset operation corresponding to the first request based on Address Resolution Protocol (ARP); in another case, the first relation table does not have a relation table entry that includes the first IP address matching the target IP address and the first identifier matching the second identifier, and the preset operation corresponding to the first request is executed based on the ARP protocol. The predetermined operation may include broadcasting the first request within a local area network, performing a redirection operation, or performing an ARP proxy operation.
When the first request is downlink information, there are two cases, in one case, the intermediate device 204 receives the first request sent by the second electronic device 206 through the N19 interface, and in the other case, the intermediate device 204 receives the first request sent by another electronic device in the digital network 205 through the N6 interface. Intermediary 204 matches the destination IP address and the second identification in the first request with the first relationship table. At this time, there are also three cases, in one case, the first relation table has a relation table item in which the included first IP address matches the target IP address and the included first identifier matches the second identifier, the intermediate device 204 extracts the first MAC address from the relation table item, feeds back the first MAC address to the second electronic device 206 or another electronic device, and stops executing the preset operation corresponding to the first request based on the ARP protocol; in another case, if the first relation table has a relation table entry that includes the first IP address matching the target IP address but includes the first identifier not matching the second identifier, a preset operation corresponding to the first request is executed based on the ARP protocol, where the preset operation generally includes executing a redirection operation or executing an ARP proxy operation; in another case, the first relation table does not have a relation table entry that includes a first IP address matching the target IP address, and the first request is discarded without performing a preset operation corresponding to the first request based on the ARP protocol.
Therefore, not only can bandwidth and system resources be saved by stopping executing the preset operation corresponding to the first request based on Address Resolution Protocol (ARP) when the target MAC address of the target device is matched in the first relation table, but also bandwidth and system resources can be saved by discarding the first request when the first request is downlink information and the target IP address of the target device is not matched in the first relation table. It should be noted that the above embodiments are only exemplary, and neither the connection between the devices nor the operation steps are limited to the contents described in the above embodiments.
In implementation, the dynamic IP address not only dynamically changes with login and logout of the permitted terminal device, but also has timeliness itself, and in order to maintain validity of the information in the first relation table, in some embodiments, the method further includes: updating the constructed first relationship table based at least on the obtained another address lease. Of course, the constructed first relational table may also be updated based on, for example, time information or other information. For example, adding a new relation table entry, deleting a relation table entry with invalid information, and the like. By updating the first relation table in real time, the information in the first relation table can be ensured to be effective in real time, so that the broadcast operation of the ARP request can be effectively inhibited, and the correct target MAC address can be fed back to the requesting equipment, so that the requesting equipment and the target equipment can be ensured to be capable of communicating smoothly.
In some embodiments, the updating the built first relationship table based at least on the obtained another address lease comprises:
determining whether the first relation table has a relation table item matching the first IP address in the other address lease under the condition of acquiring the other address lease;
adding a relationship entry in the first relationship table based on the first IP address, the first MAC address, the first identifier, and the first lease duration obtained from the other address lease if the first relationship table does not have a relationship entry matching the first IP address in the other address lease;
in the event that there is a relationship entry in the first relationship table that matches the first IP address in the other address lease, updating the relationship entry based on the first lease term in the other address lease.
When the first relation table does not have a relation table item which is matched with the first IP address in the other address lease, it indicates that the first IP address in the other address lease is not recorded in the first relation table, the dynamic host does not permit the dynamic IP address to the terminal equipment pointed by the other address lease, and a new relation table item can be added in the first relation table based on the information of the other address lease.
When the first relation table has a relation table entry matching the first IP address in the another address lease, it indicates that the first IP address in the another address lease has been recorded in the first relation table, that is, the dynamic host has already granted the dynamic IP address to the terminal device instructed by the another address lease, and possibly due to the expiration of the lease term, the dynamic host sends the address lease again to the terminal device to extend the grant term of the dynamic IP address, and at this time, the corresponding relation table entry may be updated based on the first lease term in the another address lease.
In some embodiments, the updating the built first relationship table based at least on the obtained another address lease further comprises:
in the event that the first lease term expires, deleting the corresponding relationship table entry from the first relationship table.
In a specific embodiment, when the sending time of the address lease is a first time, and a second time determined based on the first time and a first lease term is a permitted termination time of the first IP address permitted by the address lease, when it is determined that the current time has reached the second time, the first lease term has expired, and if an address lease for performing a deferral operation is not received, the first IP address has expired, and the requesting device cannot establish a call with the target device based on the first IP address, so that a corresponding relation table entry can be deleted from the first relation table, and the requesting device is prevented from acquiring an incorrect target MAC address.
In some embodiments, the updating the built first relationship table based at least on the obtained another address lease further comprises:
and deleting the relation table entry corresponding to the first IP address requested to be released in the first relation table under the condition that a second request for requesting to release the first IP address is received.
In the implementation, it is also possible that, in a case where the first lease term of the first IP address has not expired, the terminal device actively requests to disconnect the network connection, and at this time, the terminal device actively sends a second request for requesting to release the first IP address to the dynamic host through an intermediate device such as a user plane device. The user plane device receives the second request, can analyze the second request based on the dynamic host device protocol, and when determining that the second request is used for requesting to release the first IP address, can send the second request to the dynamic host to release the first IP address, and based on the first IP address included in the second request, match and delete the corresponding relation table entry in the first relation table to ensure that the information in the first relation table is valid.
Referring to fig. 5, an embodiment of the present application further provides an electronic device, including:
a first receiving module 301, configured to receive an address lease used for allocating a dynamic IP address to a first electronic device, where the address lease includes at least a first MAC address of the first electronic device and a first IP address permitted to be used by the first electronic device;
a building module 302, configured to extract at least the first MAC address and the first IP address from the address lease, and build a first relation table based on at least the first IP address and the first MAC address, where the first relation table includes a relation table entry including an association relation between the first IP address and the first MAC address;
a second receiving module 303, configured to receive a first request sent by a second electronic device and used to request to acquire a target MAC address of a target device, where the first request at least includes a target IP address of the target device;
a sending module 304, configured to, when the first relation table has the relation table entry matching the target IP address, obtain the first MAC address in the relation table, and send the obtained first MAC address to the second electronic device.
In some embodiments, the relationship table entry further includes a first identifier for identifying a virtual local area network to which the first electronic device belongs, and the first request further includes a second identifier for identifying the virtual local area network of the second electronic device; the sending module 304 is specifically configured to:
and under the condition that the first target IP address contained in the relation table item is matched with the target IP address and the first identifier contained in the relation table item is matched with the second identifier, acquiring the first MAC address in the relation table item and sending the acquired first MAC address to the second electronic equipment.
In some embodiments, the first request is uplink information; the sending module 304 is further configured to: executing a preset operation based on an address resolution protocol under the condition that the first relation table does not have the relation table item which contains the first IP address matched with the target IP address and contains the first identifier matched with the second identifier; or
The first request information is downlink information; the sending module 304 is further configured to: executing a preset operation based on an address resolution protocol under the condition that the first relation table has the relation table entry which contains the first IP address matched with the target IP address but does not contain the first identifier matched with the second identifier; or
The first request information is downlink information; the sending module 304 is further configured to: discarding the first request if the first relational table does not have the relational table entry in the first relational table that includes the first IP address that matches the target IP address.
In some embodiments, the building module 302 is specifically configured to:
analyzing the address lease to obtain the first IP address, the first MAC address, the first identifier and a first lease term; wherein the first lease term is a term for permitting the first electronic device to use the first IP address;
constructing the first relationship table based on the first IP address, the first MAC address, the first identifier, and the first lease term.
In some embodiments, the build module 302 is further configured to:
the built first relationship table is updated based at least on the obtained another address lease.
In some embodiments, the component module is specifically configured to:
determining whether the first relation table has a relation table item matched with the first IP address in the other address lease or not under the condition of acquiring the other address lease;
adding a relationship entry in the first relationship table based on the first IP address, the first MAC address, the first identifier, and the first lease duration obtained from the other address lease if the first relationship table does not have a relationship entry matching the first IP address in the other address lease;
in the event there is a relationship table entry in the first relationship table that matches the first IP address in the other address lease, updating the relationship table entry based on the first lease term in the other address lease.
In some embodiments, the component module is specifically configured to:
in the event that the first lease term expires, deleting the corresponding relationship table entry from the first relationship table.
In some embodiments, the component module is specifically configured to:
and deleting the relation table entry corresponding to the first IP address requested to be released in the first relation table under the condition that a second request for requesting to release the first IP address is received.
An embodiment of the present application further provides an electronic device, which at least includes a memory and a processor, where the memory stores an executable program, and the processor implements the following steps when executing the executable program on the memory:
receiving an address lease used for allocating a dynamic IP address to a first electronic device, wherein the address lease at least comprises a first MAC address of the first electronic device and a first IP address permitted to be used by the first electronic device;
extracting the first MAC address and the first IP address from the address lease at least, and constructing a first relation table based on the first IP address and the first MAC address at least, wherein the first relation table comprises a relation table item containing the association relation between the first IP address and the first MAC address;
receiving a first request sent by a second electronic device and used for requesting to acquire a target MAC address of a target device, wherein the first request at least comprises a target IP address of the target device;
and under the condition that the first relation table has the relation table item matched with the target IP address, acquiring the first MAC address in the relation table item, and sending the acquired first MAC address to the second electronic equipment.
In some embodiments, the relationship table entry further includes a first identifier for identifying a virtual local area network to which the first electronic device belongs, and the first request further includes a second identifier for identifying the virtual local area network of the second electronic device;
when the processor executes an executable program, stored in the memory, that has a relationship table entry matching the target IP address in the first relationship table, acquires the first MAC address in the relationship table entry, and sends the acquired first MAC address to the second electronic device, the following steps are specifically implemented:
and under the condition that the first target IP address contained in the relation table item is matched with the target IP address and the first identifier contained in the relation table item is matched with the second identifier, acquiring the first MAC address in the relation table item and sending the acquired first MAC address to the second electronic equipment.
In some embodiments, the first request is uplink information; the processor, when executing the executable program stored on the memory, further performs the steps of:
executing a preset operation based on an address resolution protocol under the condition that the first relation table does not have the relation table item which contains the first IP address matched with the target IP address and contains the first identifier matched with the second identifier; or
The first request information is downlink information; the processor, when executing the executable program stored on the memory, further performs the steps of:
performing a preset operation based on an address resolution protocol if the first relation table has the relation table entry which contains the first IP address matched with the target IP address but does not contain the first identifier matched with the second identifier; or
The first request information is downlink information; the processor, when executing the executable program stored on the memory, further performs the steps of:
discarding the first request if the first relational table does not have the relational table entry in the first relational table that contains the first IP address that matches the target IP address.
In some embodiments, the processor, when executing the executable program stored on the memory that extracts at least the first MAC address and the first IP address from the address lease and constructs a first relationship table based at least on the first IP address and the first MAC address, specifically implements the steps of:
analyzing the address lease to obtain the first IP address, the first MAC address, the first identifier and a first lease term; wherein the first lease term is a term for permitting the first electronic device to use the first IP address;
constructing the first relationship table based on the first IP address, the first MAC address, the first identifier, and the first lease duration.
In some embodiments, the processor, when executing the executable program stored on the memory, further performs the steps of:
updating the constructed first relationship table based at least on the obtained another address lease.
In some embodiments, the processor, when executing the executable program stored in the memory for updating the constructed first relationship table based on at least the obtained another address lease, specifically implements the following steps:
determining whether the first relation table has a relation table item matched with the first IP address in the other address lease or not under the condition of acquiring the other address lease;
in the case that the first relationship table does not have a relationship table entry matching the first IP address in the other address lease, adding a relationship table entry in the first relationship table based on the first IP address, the first MAC address, the first identifier and the first lease term obtained from the other address lease;
in the event that there is a relationship entry in the first relationship table that matches the first IP address in the other address lease, updating the relationship entry based on the first lease term in the other address lease.
In some embodiments, the processor, when executing the executable program stored in the memory for updating the constructed first relationship table based on at least the obtained another address lease, specifically implements the following steps:
in the event that the first lease term expires, deleting the corresponding relationship table entry from the first relationship table.
In some embodiments, the processor, when executing the executable program stored in the memory for updating the constructed first relationship table based on at least the obtained another address lease, specifically implements the following steps:
and deleting the relation table entry corresponding to the first IP address requested to be released in the first relation table under the condition that a second request for requesting to release the first IP address is received.
The above embodiments are only exemplary embodiments of the present application, and are not intended to limit the present application, and the protection scope of the present application is defined by the claims. Various modifications and equivalents may be made by those skilled in the art within the spirit and scope of the present application and such modifications and equivalents should also be considered to be within the scope of the present application.

Claims (10)

1. An information processing method applied to an intermediate device, one side of the intermediate device is connected with a first electronic device, the other side of the intermediate device is connected with a digital network, and the intermediate device is responsible for forwarding an address lease generated by a dynamic host, and the method comprises the following steps:
receiving an address lease used for allocating a dynamic IP address to a first electronic device, wherein the address lease at least comprises a first MAC address of the first electronic device and a first IP address permitted to be used by the first electronic device;
extracting the first MAC address and the first IP address from the address lease at least, and constructing a first relation table based on the first IP address and the first MAC address at least, wherein the first relation table comprises a relation table item containing the association relation between the first IP address and the first MAC address;
receiving a first request sent by a second electronic device for requesting to acquire a target MAC address of a target device, wherein the first request is an ARP request sent by the second electronic device under the condition that the second electronic device does not find a target IP address of the target device and an ARP table entry of the target MAC address locally, and the first request at least comprises the target IP address of the target device;
under the condition that the first relation table has the relation table item matched with the target IP address, the first MAC address in the relation table item is obtained, the obtained first MAC address is sent to the second electronic equipment, and the execution of corresponding preset operation of a first request based on an address resolution protocol is inhibited;
and if the first request is downlink information and the first relation table does not have the relation table item of which the first IP address is matched with the target IP address, discarding the first request.
2. The information processing method according to claim 1, wherein the relationship table entry further includes a first identifier for identifying a virtual local area network to which the first electronic device belongs, and the first request further includes a second identifier for identifying the virtual local area network of the second electronic device;
in a case that the first relation table has the relation table entry matching the target IP address, acquiring the first MAC address in the relation table entry, and sending the acquired first MAC address to the second electronic device, the method includes:
and under the condition that the first IP address contained in the relation table item is matched with the target IP address and the first identifier contained in the relation table item is matched with the second identifier, acquiring the first MAC address in the relation table item and sending the acquired first MAC address to the second electronic equipment.
3. The information processing method according to claim 2, wherein the first request is uplink information; executing a preset operation based on an address resolution protocol under the condition that the first relation table does not have the relation table item which contains the first IP address matched with the target IP address and contains the first identifier matched with the second identifier; or
The first request information is downlink information; in the case that the first relation table has the relation table entry which contains the first IP address matching the target IP address but does not contain the first identifier matching the second identifier, performing a preset operation based on an address resolution protocol.
4. The information processing method of claim 2, wherein the extracting the first MAC address and the first IP address from at least the address lease and building a first relationship table based on at least the first IP address and the first MAC address comprises:
analyzing the address lease to obtain the first IP address, the first MAC address, the first identifier and a first lease term; wherein the first lease term is a term for permitting the first electronic device to use the first IP address;
constructing the first relationship table based on the first IP address, the first MAC address, the first identifier, and the first lease duration.
5. The information processing method according to claim 4, wherein the method further comprises:
updating the constructed first relationship table based at least on the obtained another address lease.
6. The information processing method according to claim 5, wherein the updating of the built first relationship table based on at least the acquired another address lease comprises:
determining whether the first relation table has a relation table item matching the first IP address in the other address lease under the condition of acquiring the other address lease;
adding a relationship entry in the first relationship table based on the first IP address, the first MAC address, the first identifier, and the first lease duration obtained from the other address lease if the first relationship table does not have a relationship entry matching the first IP address in the other address lease;
in the event that there is a relationship entry in the first relationship table that matches the first IP address in the other address lease, updating the relationship entry based on the first lease term in the other address lease.
7. The information processing method according to claim 6, wherein the updating of the built first relationship table based on at least the acquired another address lease further comprises:
in the event that the first lease term expires, deleting the corresponding relationship table entry from the first relationship table.
8. The information processing method according to claim 6, wherein the updating of the built first relationship table based on at least the acquired another address lease further comprises:
and deleting the relation table entry corresponding to the first IP address requested to be released in the first relation table under the condition that a second request for requesting to release the first IP address is received.
9. An electronic device, one side of the electronic device being connected to a first electronic device and another side of the electronic device being connected to a digital network, the electronic device being responsible for forwarding dynamic host-generated address leases, comprising:
the first receiving module is used for receiving an address lease used for allocating a dynamic IP address to first electronic equipment, wherein the address lease at least comprises a first MAC address of the first electronic equipment and a first IP address allowed to be used by the first electronic equipment;
a building module, configured to extract at least the first MAC address and the first IP address from the address lease, and build a first relation table based on at least the first IP address and the first MAC address, where the first relation table includes a relation table entry including an association relation between the first IP address and the first MAC address;
a second receiving module, configured to receive a first request sent by a second electronic device for requesting to obtain a target MAC address of a target device, where the first request is an ARP request sent by the second electronic device when the second electronic device does not find a target IP address of the target device and an ARP entry of the target MAC address locally, and the first request at least includes the target IP address of the target device;
a sending module, configured to, when the first relation table has the relation table entry matching the target IP address, obtain the first MAC address in the relation table entry, send the obtained first MAC address to the second electronic device, and suppress execution of a preset operation corresponding to a first request based on an address resolution protocol; and the processor is further configured to discard the first request if the first request is downlink information and the first relation table does not have the relation table entry in which the first IP address and the target IP address are matched.
10. An electronic device applied to an electronic device, one side of the electronic device being connected to a first electronic device, the other side of the electronic device being connected to a digital network, the electronic device being responsible for forwarding address leases generated by a dynamic host, the electronic device at least comprising a memory and a processor, the memory having an executable program stored thereon, the processor implementing the following steps when executing the executable program on the memory:
receiving an address lease for assigning a dynamic IP address to a first electronic device, wherein the address lease comprises at least a first MAC address of the first electronic device and a first IP address permitted for use by the first electronic device;
extracting the first MAC address and the first IP address from the address lease at least, and constructing a first relation table based on the first IP address and the first MAC address at least, wherein the first relation table comprises a relation table item containing the association relation between the first IP address and the first MAC address;
receiving a first request sent by a second electronic device for requesting to acquire a target MAC address of a target device, wherein the first request is an ARP request sent by the second electronic device under the condition that the second electronic device does not find a target IP address of the target device and an ARP table entry of the target MAC address locally, and the first request at least comprises the target IP address of the target device;
under the condition that the first relation table has the relation table item matched with the target IP address, the first MAC address in the relation table item is obtained, the obtained first MAC address is sent to the second electronic equipment, and the execution of corresponding preset operation of a first request based on an address resolution protocol is inhibited;
and if the first request is downlink information and the first relation table does not have the relation table item of which the first IP address is matched with the target IP address, discarding the first request.
CN202011610459.5A 2020-12-30 2020-12-30 Information processing method and electronic equipment Active CN112688958B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011610459.5A CN112688958B (en) 2020-12-30 2020-12-30 Information processing method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011610459.5A CN112688958B (en) 2020-12-30 2020-12-30 Information processing method and electronic equipment

Publications (2)

Publication Number Publication Date
CN112688958A CN112688958A (en) 2021-04-20
CN112688958B true CN112688958B (en) 2023-03-21

Family

ID=75455177

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011610459.5A Active CN112688958B (en) 2020-12-30 2020-12-30 Information processing method and electronic equipment

Country Status (1)

Country Link
CN (1) CN112688958B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1925493A (en) * 2006-09-15 2007-03-07 杭州华为三康技术有限公司 Method and device for processing ARP message
CN101035012A (en) * 2006-03-09 2007-09-12 上海博达数据通信有限公司 Ethernet multi-layer switcher secure protection method based on DHCP and IP

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102546666B (en) * 2012-02-28 2016-04-27 神州数码网络(北京)有限公司 The method preventing IGMP from cheating and to attack and device
CN105208137A (en) * 2014-06-16 2015-12-30 中兴通讯股份有限公司 Internet Protocol (IP) address allocation methods, device, server and terminal
CN106487742B (en) * 2015-08-24 2020-01-03 阿里巴巴集团控股有限公司 Method and device for verifying source address validity
CN105245629B (en) * 2015-09-25 2018-10-16 互联网域名***北京市工程研究中心有限公司 Host communication method based on DHCP and device
CN108234522B (en) * 2018-03-01 2021-01-22 深圳市共进电子股份有限公司 Method and device for preventing Address Resolution Protocol (ARP) attack, computer equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101035012A (en) * 2006-03-09 2007-09-12 上海博达数据通信有限公司 Ethernet multi-layer switcher secure protection method based on DHCP and IP
CN1925493A (en) * 2006-09-15 2007-03-07 杭州华为三康技术有限公司 Method and device for processing ARP message

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
浅析DHCP服务器的运行机制;黄小花;《无线互联科技》;20150228;21-22 *

Also Published As

Publication number Publication date
CN112688958A (en) 2021-04-20

Similar Documents

Publication Publication Date Title
US11425202B2 (en) Session processing method and device
EP0943200B1 (en) Secure dhcp server
US11196767B2 (en) Front-end protocol for server protection
US9419999B2 (en) Method and device for preventing domain name system spoofing
US8935419B2 (en) Filtering device for detecting HTTP request and disconnecting TCP connection
US10897450B2 (en) Communication method and communication apparatus
US20080281973A1 (en) Management Method, Device And System For Session Connection
US7424538B2 (en) Service control network system
CN1300976C (en) Method for obtaining user identification information for network application entity
CN112688958B (en) Information processing method and electronic equipment
US7564854B2 (en) Network architecture with a light-weight TCP stack
JP2003179647A (en) Packet transfer device and packet transfer method
WO2014135102A1 (en) Wlan user management method, device and system
JP2007336401A (en) Communication control device, authentication system, and communication control program
CN110213399A (en) Dynamic Host Configuration Protocol server detection method, storage medium and terminal based on NETFILTER mechanism
CN108882224B (en) User identity information distribution method and access service router
CN116647538B (en) Connecting device capable of accessing different intranet services
US7813274B1 (en) Dynamic demultiplexing of network traffic
Bellis et al. DNS Stateful Operations
CN107579955B (en) Dynamic host configuration protocol monitoring and protecting method and system
CN115567942A (en) Safety protection method, device, network element and storage medium in 5G network
JP3898119B2 (en) Firewall multiplexer and packet distribution method
Bellis et al. RFC 8490: DNS Stateful Operations
CN118175463A (en) FTTR network message processing method, electronic equipment and message processing system
CN113726689A (en) Security service processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant