CN106973126A - A kind of arp reply method and device - Google Patents
A kind of arp reply method and device Download PDFInfo
- Publication number
- CN106973126A CN106973126A CN201710386729.0A CN201710386729A CN106973126A CN 106973126 A CN106973126 A CN 106973126A CN 201710386729 A CN201710386729 A CN 201710386729A CN 106973126 A CN106973126 A CN 106973126A
- Authority
- CN
- China
- Prior art keywords
- address
- corresponding relation
- host
- mac address
- arp
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 38
- 230000004044 response Effects 0.000 claims description 25
- 238000012544 monitoring process Methods 0.000 claims description 7
- 230000006855 networking Effects 0.000 abstract description 18
- 238000013507 mapping Methods 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 17
- 238000004904 shortening Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 230000007547 defect Effects 0.000 description 3
- 230000005856 abnormality Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/10—Mapping addresses of different types
- H04L61/103—Mapping addresses of different types across network layers, e.g. resolution of network layer into physical layer addresses or address resolution protocol [ARP]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Small-Scale Networks (AREA)
Abstract
The present invention provides a kind of arp reply method and device.In the embodiment of the present invention, management equipment can make access device accordingly generate corresponding relation list item by the way that the corresponding relation of the IP address of the main frame of acquisition and MAC Address is sent to access device;After the ARP request message that request equipment is sent is received, access device can search the corresponding relation list item matched with the purpose IP address in ARP request message in mapping table, and after the corresponding relation list item of matching is found, arp reply message is directly generated according to MAC Address corresponding with purpose IP address, and the arp reply message of the generation is back to request equipment.Thus shorten request equipment and wait the waiting time of arp reply message, and save the processor resource of bandwidth resources limited in networking and non-targeted equipment.
Description
Technical Field
The present invention relates to the field of network communication technologies, and in particular, to an ARP reply method and apparatus.
Background
In the networking environment shown in fig. 1, if the host 1 needs to communicate with the host 4, but does not know the MAC (Media Access Control) address of the host 4, the MAC address of the host 4 may be obtained by broadcasting an ARP (address resolution Protocol) request message in networking, so as to implement communication with the host 4.
However, in this manner, the ARP request message sent by the host 1 reaches the non-target devices, i.e. the host 2, the gateway device, the access device 2, and the host 3, in the networking before reaching the target device, i.e. the host 4. This not only prolongs the waiting time for the host 1 to obtain the MAC address of the host 4, but also occupies limited bandwidth resources in the networking and processor resources of non-target devices.
Disclosure of Invention
In view of this, the present invention provides an ARP reply method and apparatus to overcome the defects in the prior art that a request device has a long time to wait for an ARP reply packet, and a broadcasted ARP request packet occupies limited bandwidth resources in a network and processor resources of a non-target device.
According to a first aspect of a first embodiment of the present invention, there is provided an ARP reply method, which is applied to an access device, and includes:
receiving an ARP request message sent by a request device;
judging whether a corresponding relation table item matched with the target IP address in the ARP request message exists in a corresponding relation table or not; the corresponding relation table records the corresponding relation between the IP address and the MAC address of the host;
if the ARP response message exists, generating an ARP response message according to the MAC address corresponding to the target IP address, and returning the ARP response message to the request equipment;
if not, the ARP request message is broadcasted.
According to a second aspect of the first embodiment of the present invention, there is provided an ARP reply apparatus, which is applied to an access device, and includes:
a receiving unit, configured to receive an ARP request packet sent by a requesting device;
a judging unit, configured to judge whether a corresponding relationship table item matching a destination IP address in the ARP request message exists in a corresponding relationship table; the corresponding relation table records the corresponding relation between the IP address and the MAC address of the host;
a returning unit, configured to generate an ARP reply message according to the MAC address corresponding to the destination IP address when the determination result of the determining unit is yes, and return the ARP reply message to the requesting device;
and the broadcasting unit is used for broadcasting the ARP request message when the judgment result of the judging unit is negative.
According to a first aspect of a second embodiment of the present invention, there is provided an ARP reply method, which is applied to a management device, the method including:
acquiring the corresponding relation between the IP address and the MAC address of the host;
and sending the corresponding relation between the IP address and the MAC address of the host to access equipment so that the access equipment generates a corresponding relation table entry, and responding to the received ARP request message according to the corresponding relation table entry.
According to a second aspect of a second embodiment of the present invention, there is provided an ARP reply device, the device being applied to a management apparatus, the device including:
an obtaining unit, configured to obtain a correspondence between an IP address and an MAC address of a host;
and the sending unit is used for sending the corresponding relation between the IP address and the MAC address of the host to the access equipment so as to enable the access equipment to generate a corresponding relation table item and respond to the received ARP request message according to the corresponding relation table item.
In the embodiment of the invention, the management equipment can enable the access equipment to generate a corresponding relation table entry according to the obtained corresponding relation between the IP address and the MAC address of the host computer by sending the corresponding relation to the access equipment; after receiving an ARP request message sent by a requesting device, an access device may search a corresponding relationship entry matching a target IP address in the ARP request message in a corresponding relationship table, and directly generate an ARP reply message according to an MAC address corresponding to the target IP address after finding the matching corresponding relationship entry, and return the generated ARP reply message to the requesting device. Therefore, by applying the embodiment of the invention, the access device directly connected with the request device can replace the target device to carry out ARP response on the ARP request message sent by the request device, so that the ARP request message does not need to be transmitted to the target device, and further does not need to be transmitted to the non-target device between the request device and the target device, thereby shortening the waiting time of the request device for waiting the ARP response message, and saving limited bandwidth resources and processor resources of the non-target device in a network.
Drawings
FIG. 1 is a schematic diagram of a prior art ARP request method for networking;
FIG. 2 is a schematic diagram of a first network of an ARP request method according to the invention;
FIG. 3 is a flow chart of a first embodiment of an ARP reply method of the present invention;
FIG. 4 is a flow chart of a second embodiment of an ARP reply method of the present invention;
FIG. 5 is a schematic diagram of a second networking of the ARP reply method of the present invention;
FIG. 6 is a block diagram of an ARP answering device of the present invention;
FIG. 7 is another block diagram of an ARP answering device of the present invention;
fig. 8 is another configuration diagram of an ARP reply device according to the present invention.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present invention. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
Referring to fig. 2, fig. 2 is a schematic diagram of a first networking of an ARP request method according to the present invention, where the schematic diagram may include a gateway device, an access device, a host, a management device, a PORTAL authentication server, and the like. The gateway equipment is connected with each access equipment, and each access equipment is respectively connected with a plurality of hosts; the management device establishes network connection with the gateway device, the access device and the PORTAL authentication server respectively; the gateway device also establishes a network connection with the authentication server.
In order to make the technical solutions in the embodiments of the present invention better understood and make the above objects, features and advantages of the embodiments of the present invention more comprehensible, the technical solutions in the embodiments of the present invention are described in further detail below with reference to the accompanying drawings.
Referring to fig. 3, fig. 3 is a flowchart of a first embodiment of an ARP reply method according to the present invention, which is applied to an access device, and includes the following steps:
step 301: and receiving an ARP request message sent by the request equipment.
In this embodiment, the requesting device may be any host.
Step 302: judging whether a corresponding relation table item matched with the target IP address in the ARP request message exists in the corresponding relation table, if so, executing the step 303; if not, go to step 304.
In this embodiment, the correspondence table records the correspondence between the IP address and the MAC address of the host, and according to the correspondence table, the access device can respond to an ARP request packet that requests to obtain the MAC address of any host in the networking.
Specifically, the correspondence between the IP address and the MAC address of the host recorded in the correspondence table by the access device may be obtained in a variety of ways before this step 302:
in the first mode, the access device may obtain a correspondence between an IP address and an MAC address of the host from the management device, and add a correspondence entry in a correspondence table, where the correspondence entry records a correspondence between the IP address and the MAC address of the host, and the correspondence between the IP address and the MAC address of the host is sent to the management device after the PORTAL authentication server successfully authenticates the host;
in the 2 nd mode, the access device may obtain a correspondence between an IP address and an MAC address of the host from the gateway device, and add a correspondence entry in a correspondence table, where the correspondence entry records a correspondence between the IP address and the MAC address of the host, and the correspondence between the IP address and the MAC address of the host is sent to the gateway device after the PORTAL authentication server successfully authenticates the host;
in the 3 rd mode, the access device may monitor an authentication request message sent by the host to the PORTAL authentication server for PORTAL authentication, or monitor an authentication success message sent by the PORTAL authentication server to the host, obtain a correspondence between the IP address and the MAC address of the host from the authentication request message or the authentication success message, and add a correspondence table entry in the correspondence table, where the correspondence table entry records the correspondence between the IP address and the MAC address of the host.
In this embodiment, in order to overcome the defects in the prior art that the time for the requesting device to wait for the ARP reply message is long, and the broadcasted ARP request message occupies limited bandwidth resources in the network and processor resources of the non-target device, a correspondence table is generated in the access device in the embodiment of the present invention, and is used for recording the correspondence between the IP address and the MAC address of the host. Specifically, the above-mentioned 1 st and 2 nd modes generate the corresponding relationship table by fully utilizing the corresponding relationship of the accurate IP address MAC address of the host that can be obtained after the PORTAL authentication server successfully authenticates the host, and the 3 rd mode generates the corresponding relationship table by actively monitoring the authentication request message or the authentication success message transmitted for completing the network access authentication between the host and the PORTAL authentication server. Therefore, when the ARP request message is received, the ARP response can be completed according to the generated corresponding relation table, thereby overcoming the defects of the prior art.
As an embodiment, the access device may further obtain a corresponding relationship between an IP address and an MAC address of the gateway device, so as to respond to an ARP request packet requesting to obtain the MAC address of the gateway device.
Specifically, the access device may obtain a correspondence between an IP address and an MAC address of the gateway device from the gateway device, and add a correspondence table entry in the correspondence table, where the correspondence table entry records a correspondence between the IP address and the MAC address of the gateway device; or,
the access device may obtain a correspondence between the IP address and the MAC address of the gateway device from a management device, and add a correspondence table entry in the correspondence table, where the correspondence table entry records a correspondence between the IP address and the MAC address of the gateway device, and the correspondence between the IP address and the MAC address of the gateway device is obtained by the management device from the gateway device.
Step 303: and generating an ARP response message according to the MAC address corresponding to the target IP address, and returning the ARP response message to the request equipment.
In this embodiment, the access device may fill the MAC address corresponding to the destination IP address into a "hardware address of a sender" field and an "ethernet source address" field in the ARP reply message, and return the ARP reply message to the requesting device.
Step 304: broadcasting the received ARP request message.
In this embodiment, if there is no corresponding relationship table entry matching the destination IP address in the received ARP request message in the corresponding relationship table, the received ARP request message is broadcasted, so that the target device corresponding to the MAC address requested by the requesting device returns an ARP request message to the requesting device.
It should be noted that, an ARP reply method according to the present invention may also be applied to the gateway device, and in this case, the correspondence table in step 302 may specifically be an ARP table.
Referring to fig. 4, fig. 4 is a flowchart of a second embodiment of an ARP reply method according to the present invention, which is applied to a management device and may include the following steps:
step 401: acquiring the corresponding relation between the IP address and the MAC address of the host;
in this embodiment, the management device may obtain a correspondence between the IP address and the MAC address of the host sent by the PORTAL authentication server after the PORTAL authentication server successfully authenticates the host.
Step 402: and sending the corresponding relation between the IP address and the MAC address of the host to the access equipment so that the access equipment generates a corresponding relation table item, and responding to the received ARP request message according to the corresponding relation table item.
As an embodiment, the access device may further obtain, from the gateway device, a correspondence between an IP address and an MAC address of the gateway device; and the corresponding relation between the IP address and the MAC address of the gateway equipment is sent to the access equipment so that the access equipment generates a corresponding relation table item, and the received ARP request message is responded according to the corresponding relation table item.
In the embodiment of the invention, the management equipment can enable the access equipment to generate a corresponding relation table entry according to the obtained corresponding relation between the IP address and the MAC address of the host computer by sending the corresponding relation to the access equipment; after receiving an ARP request message sent by a requesting device, an access device may search a corresponding relationship entry matching a target IP address in the ARP request message in a corresponding relationship table, and directly generate an ARP reply message according to an MAC address corresponding to the target IP address after finding the matching corresponding relationship entry, and return the generated ARP reply message to the requesting device. Therefore, by applying the embodiment of the invention, the access device directly connected with the request device can replace the target device to carry out ARP response on the ARP request message sent by the request device, so that the ARP request message does not need to be transmitted to the target device, and further does not need to be transmitted to the non-target device between the request device and the target device, thereby shortening the waiting time of the request device for waiting the ARP response message, and saving limited bandwidth resources and processor resources of the non-target device in a network.
Referring to fig. 5, a third embodiment of an ARP reply method according to the present invention is provided, where fig. 5 is a second networking schematic diagram of an ARP reply method according to the present invention, and different from the networking schematic diagram shown in fig. 2, the networking schematic diagram shown in fig. 5 does not include a management device. To describe the present embodiment more clearly, it is assumed that the host 1 requests the MAC address of the host 4. Specifically, the present embodiment may specifically include the following steps:
step 1: the host 4 sends an authentication request message to the gateway device.
In this embodiment, the authentication request message sent by the host 4 carries the correspondence between the IP address and the MAC address of the host 4.
Step 2: the gateway device receives the authentication request message sent by the host 4, and sends the authentication request message sent by the host 4 to the PORTAL authentication server.
In this embodiment, it may be assumed that the host 4 needs to perform network access authentication, and therefore the gateway device needs to send the authentication request message sent by the host 4 to the PORTAL authentication server for network access authentication.
And step 3: the PORTAL authentication server authenticates the host 4 according to the received authentication request message, and returns the successful authentication message to the gateway equipment after the successful authentication.
In this embodiment, if the authentication fails, the authentication failure message is returned to the gateway device.
In this embodiment, the PORTAL authentication server may also carry the IP address and the MAC address of the host 4 in the successful authentication message in the notification message, and send the notification message to the gateway device.
And 4, step 4: the gateway device obtains the correspondence between the IP address and the MAC address of the host 4 from the received authentication success message, and sends the obtained correspondence between the IP address and the MAC address of the host 4 to the access device 1.
And 5: after receiving the correspondence between the IP address and the MAC address of the host 4, the access device 1 adds a correspondence table entry in the correspondence table, and records the correspondence between the IP address and the MAC address of the host 4.
In this embodiment, if it is assumed that the IP address of the host 4 is IP4 and the MAC address is MAC4, the added corresponding table entry may be represented as the following table 1:
| host 4 | IP4 | MAC4 |
TABLE 1
It should be noted that, in practical application, in step 4, the gateway device may simultaneously send the correspondence between the IP address and the MAC address of the host 4 to the access device 2, so that the access device 2 also generates a corresponding relationship table entry for subsequent query when needed.
As an embodiment, the receiving device 1 may obtain the corresponding relationship between the IP address and the MAC address of each host in the networking schematic diagram of fig. 5 through the methods shown in steps 1 to 5, and in this process, the management device may send the corresponding relationship between the IP address and the MAC address to each access device in the networking after obtaining the corresponding relationship between the IP address and the MAC address of a certain host; for the networking schematic diagram with a smaller scale as shown in fig. 5, after the corresponding relationship between the IP address and the MAC address of the host 1-4 is obtained, the obtained corresponding relationship between the IP address and the MAC address of the host 1-4 is sent to the access device 1 and the access device 2 in the networking.
As an embodiment, the receiving device 1 may further request to obtain a corresponding relationship between the IP address and the MAC address of the gateway device, add a corresponding relationship table entry in the corresponding relationship table, and record the corresponding relationship between the IP address and the MAC address of the gateway device.
Step 6: the access device 1 receives an ARP request message sent by the host 1, and searches a corresponding relation table item matched with the IP address of the host 4 according to the IP address of the host 4 carried in the ARP request message.
In this embodiment, the IP address of host 4 may carry a "receiver IP address" field in the ARP request message.
In this embodiment, if the corresponding relationship table entry matching the IP address of the host 4 is found, step 7 is executed; otherwise, the received ARP request message is broadcasted so that the host 4 returns an ARP reply message to the host 1.
And 7, the access equipment 1 generates an ARP response message according to the MAC address of the host 4 in the searched corresponding relation table entry, and returns the generated ARP response message to the host 1.
In this embodiment, compared with the prior art that the ARP request message sent by the host 1 needs to reach the host 2, the gateway device, the access device 2, and the host 3 in the networking schematic diagram of fig. 5, and finally the host 4 returns the ARP reply message to the host 1, in the present invention, the ARP request message sent by the host 1 only needs to reach the access device 1 directly connected to the host 1, and the ARP reply message can be returned to the host 1 by the access device 1, which not only shortens the time period for the host 1 to wait for the ARP reply message, but also saves the bandwidth resources occupied by the ARP request message broadcast in the networking in the prior art and the processor resources of the host 2, the gateway device, the access device 2, and the host 3.
It should be noted that, in step 4, if the gateway device receives the authentication failure message, the process may be ended to avoid that the access device generates an erroneous corresponding relationship table entry according to the corresponding relationship between the IP address and the MAC address of the erroneous host 4, so that the host 1 receives the MAC address of the erroneous host 4, which causes communication abnormality.
In the embodiment of the present invention, the gateway device may obtain the corresponding relationship between the IP address and the MAC address of the host 4 in an authentication success message sent after the PORTAL authentication server successfully authenticates the host 4, and send the corresponding relationship between the IP address and the MAC address of the host 4 to the access device 1, so that the access device 1 generates a corresponding relationship table entry according to the corresponding relationship table entry; after receiving the ARP request message sent by the host 1 requesting the MAC address of the host 4, the ARP reply message can be directly generated according to the MAC address in the corresponding table entry, and returned to the host 1.
Therefore, by applying the embodiment of the invention, the access device directly connected with the request device can replace the target device to carry out ARP response on the ARP request message sent by the request device, so that the ARP request message does not need to be transmitted to the target device, and further does not need to be transmitted to the non-target device between the request device and the target device, thereby shortening the waiting time of the request device for waiting the ARP response message, and saving limited bandwidth resources and processor resources of the non-target device in a network.
Referring to fig. 2, a fourth embodiment of an ARP reply method of the present invention is provided. For a more clear description of the embodiment, the embodiment still assumes that the host 1 requests the MAC address of the host 4. Specifically, the present embodiment may include the following steps:
step 1: the host 4 sends an authentication request message to the gateway device.
Step 2: the gateway device receives the authentication request message sent by the host 4, and sends the authentication request message sent by the host 4 to the PORTAL authentication server.
In this embodiment, the steps 1-2 can be referred to the third embodiment, and are not described herein again.
And step 3: the PORTAL authentication server authenticates the host 4 according to the received authentication request message, and after the authentication is successful, the PORTAL authentication server sends the corresponding relation between the IP address and the MAC address of the host 4 in the authentication request message to the management device.
In this embodiment, the management device may be a UMC (unified management Center) device.
And 4, step 4: the management device receives the correspondence between the IP address and the MAC address of the host 4, and sends the correspondence between the IP address and the MAC address of the host 4 to the access device 1.
In this embodiment, the management device may send the obtained correspondence between the IP address and the MAC address of the host 4 to the access device 1 through a TCP (Transmission Control Protocol) connection or a UDP (User Datagram Protocol).
And 5: after receiving the correspondence between the IP address and the MAC address of the host 4, the access device 1 adds a correspondence table entry in the correspondence table, and records the correspondence between the IP address and the MAC address of the host 4.
Step 6: the access device 1 receives an ARP request message sent by the host 1, and searches a corresponding relation table item matched with the IP address of the host 4 according to the IP address of the host 4 carried in the ARP request message.
And 7: the access equipment 1 generates an ARP response message according to the MAC address of the host 4 in the searched corresponding relation table entry, and returns the generated ARP response message to the host 1.
In this embodiment, the steps 5-7 can be referred to the third embodiment, and are not described herein again.
As a preferred embodiment, taking the case that the host 1 requests to obtain the host 2 as an example, the access device 1 may monitor an authentication request message sent by the host 2 to the PORTAL authentication server for PORTAL authentication, or monitor an authentication success message sent by the PORTAL authentication server to the host 2, obtain a corresponding relationship between the IP address and the MAC address of the host 2 from the monitored authentication request message or authentication success message, and generate a corresponding relationship table entry. After receiving the ARP request message of the host 1 requesting to acquire the MAC address of the host 2, the ARP reply message may be directly returned to the host 1 according to the MAC address of the host 2 recorded in the generated correspondence table entry.
In the embodiment of the present invention, the management device sends the obtained correspondence between the IP address and the MAC address of the host 4 to the access device 1, so that the access device 1 can generate a correspondence table entry according to the correspondence; after receiving the ARP request message requesting the MAC address of the host 4 sent by the host 1, the ARP reply message can be directly generated according to the MAC address in the corresponding table entry, and the generated ARP reply message is returned to the host 1.
Therefore, by applying the embodiment of the invention, the access device directly connected with the request device can replace the target device to carry out ARP response on the ARP request message sent by the request device, so that the ARP request message does not need to be transmitted to the target device, and further does not need to be transmitted to the non-target device between the request device and the target device, thereby shortening the waiting time of the request device for waiting the ARP response message, and saving limited bandwidth resources and processor resources of the non-target device in a network.
Corresponding to the aforementioned embodiment of the ARP reply method, the present invention also provides an embodiment of an ARP reply device. The embodiment of the device is applied to the access equipment and can comprise: the receiving unit 610, the determining unit 620, the returning unit 630, and the broadcasting unit 640 may specifically refer to fig. 6, and fig. 6 is a structural diagram of an ARP reply device according to the present invention.
The receiving unit 610 is configured to receive an ARP request packet sent by a requesting device;
a determining unit 620, configured to determine whether a corresponding relationship table item matching the destination IP address in the ARP request message exists in the corresponding relationship table; the corresponding relation table records the corresponding relation between the IP address and the MAC address of the host;
a returning unit 630, configured to, if the determination result of the determining unit 620 is yes, generate an ARP reply message according to the MAC address corresponding to the destination IP address, and return the ARP reply message to the requesting device;
the broadcasting unit 640 is configured to broadcast the ARP request packet if the determination result of the determining unit 620 is negative.
Referring to fig. 7, fig. 7 is another structural diagram of an ARP reply device according to the present invention, in which the ARP reply device may further include:
a correspondence obtaining unit 600, configured to obtain, before determining whether a correspondence table entry matching a destination IP address in an ARP request message exists in a correspondence table, a correspondence between an IP address of a host and an MAC address from a management device, and add a correspondence table entry in the correspondence table, where the correspondence records a correspondence between the IP address of the host and the MAC address, and the correspondence between the IP address of the host and the MAC address is sent to the management device after a PORTAL authentication server successfully authenticates the host; or,
obtaining the corresponding relation between the IP address and the MAC address of the host from the gateway equipment, adding a corresponding relation table entry in the corresponding relation table, and recording the corresponding relation between the IP address and the MAC address of the host by the corresponding relation table entry, wherein the corresponding relation between the IP address and the MAC address of the host is sent to the gateway equipment after a PORTAL authentication server successfully authenticates the host; or,
monitoring an authentication request message sent by a host to a PORTAL authentication server for PORTAL authentication, or monitoring an authentication success message sent by the PORTAL authentication server to the host, obtaining the corresponding relation between the IP address and the MAC address of the host from the authentication request message or the authentication success message, and adding a corresponding relation table item in the corresponding relation table, wherein the corresponding relation table item records the corresponding relation between the IP address and the MAC address of the host.
Corresponding to the aforementioned embodiment of the ARP reply method, the present invention also provides an embodiment of an ARP reply device. The embodiment of the device is applied to management equipment and can comprise: the obtaining unit 810 and the sending unit 820 may specifically refer to fig. 8, and fig. 8 is another structural diagram of an ARP reply device according to the present invention.
The obtaining unit 810 is configured to obtain a corresponding relationship between an IP address and an MAC address of a host;
a sending unit 820, configured to send the correspondence between the IP address and the MAC address of the host to an access device, so that the access device generates a correspondence table entry, and responds to the received ARP request packet according to the correspondence table entry.
In an implementation manner, the obtaining unit 810 may specifically be configured to:
and obtaining the corresponding relation between the IP address and the MAC address of the host sent by the PORTAL authentication server after the host is successfully authenticated.
In the embodiment of the invention, the management equipment can enable the access equipment to generate a corresponding relation table according to the obtained corresponding relation between the IP address and the MAC address of the host computer by sending the obtained corresponding relation to the access equipment; after receiving the ARP request message sent by the requesting device, the access device may search the corresponding relationship table entry matching the destination IP address in the ARP request message in the corresponding relationship table, and after finding the matching corresponding relationship table entry, directly generate an ARP reply message according to the MAC address corresponding to the destination IP address, and return the generated ARP reply message to the requesting device. Therefore, by applying the embodiment of the invention, the access device directly connected with the request device can replace the target device to carry out ARP response on the ARP request message sent by the request device, so that the ARP request message does not need to be transmitted to the target device, and further does not need to be transmitted to the non-target device between the request device and the target device, thereby shortening the waiting time of the request device for waiting the ARP response message, and saving limited bandwidth resources and processor resources of the non-target device in a network.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the invention. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.
Claims (10)
1. An ARP answering method is applied to an access device, and is characterized by comprising the following steps:
receiving an ARP request message sent by a request device;
judging whether a corresponding relation table item matched with the target IP address in the ARP request message exists in a corresponding relation table or not; the corresponding relation table records the corresponding relation between the IP address and the MAC address of the host;
if the ARP response message exists, generating an ARP response message according to the MAC address corresponding to the target IP address, and returning the ARP response message to the request equipment;
if not, the ARP request message is broadcasted.
2. The method according to claim 1, wherein before determining whether there is a corresponding relationship entry in the corresponding relationship table that matches the destination IP address in the ARP request message, further comprising:
acquiring a corresponding relation between an IP address and an MAC address of a host from management equipment, and adding a corresponding relation table entry in a corresponding relation table, wherein the corresponding relation table entry records the corresponding relation between the IP address and the MAC address of the host, and the corresponding relation between the IP address and the MAC address of the host is sent to the management equipment after a PORTAL authentication server successfully authenticates the host; or,
acquiring a corresponding relation between an IP address and an MAC address of a host from gateway equipment, and adding a corresponding relation table entry in a corresponding relation table, wherein the corresponding relation table entry records the corresponding relation between the IP address and the MAC address of the host, and the corresponding relation between the IP address and the MAC address of the host is sent to the gateway equipment after a PORTAL authentication server successfully authenticates the host; or,
monitoring an authentication request message sent by a host to a PORTAL authentication server for PORTAL authentication, or monitoring an authentication success message sent by the PORTAL authentication server to the host, obtaining the corresponding relation between the IP address and the MAC address of the host from the authentication request message or the authentication success message, and adding a corresponding relation table entry in a corresponding relation table, wherein the corresponding relation table entry records the corresponding relation between the IP address and the MAC address of the host.
3. The method of claim 1, further comprising:
acquiring the corresponding relation between the IP address and the MAC address of the gateway equipment from the gateway equipment, and adding a corresponding relation table item in the corresponding relation table, wherein the corresponding relation table item records the corresponding relation between the IP address and the MAC address of the gateway equipment; or,
acquiring the corresponding relation between the IP address and the MAC address of the gateway device from a management device, and adding a corresponding relation table item in the corresponding relation table, wherein the corresponding relation table item records the corresponding relation between the IP address and the MAC address of the gateway device, and the corresponding relation between the IP address and the MAC address of the gateway device is acquired from the gateway device by the management device.
4. An ARP answering method, applied to a management device, the method comprising:
acquiring the corresponding relation between the IP address and the MAC address of the host;
and sending the corresponding relation between the IP address and the MAC address of the host to access equipment so that the access equipment generates a corresponding relation table entry, and responding to the received ARP request message according to the corresponding relation table entry.
5. The method of claim 4, wherein obtaining the correspondence between the IP address and the MAC address of the host comprises:
and obtaining the corresponding relation between the IP address and the MAC address of the host sent by the PORTAL authentication server after the host is successfully authenticated.
6. The method of claim 4, further comprising:
obtaining the corresponding relation between the IP address and the MAC address of the gateway equipment from the gateway equipment;
and sending the corresponding relation between the IP address and the MAC address of the gateway equipment to access equipment so that the access equipment generates a corresponding relation table entry, and responding to the received ARP request message according to the corresponding relation table entry.
7. An ARP reply apparatus, the apparatus being applied to an access device, the apparatus comprising:
a receiving unit, configured to receive an ARP request packet sent by a requesting device;
a judging unit, configured to judge whether a corresponding relationship table item matching a destination IP address in the ARP request message exists in a corresponding relationship table; the corresponding relation table records the corresponding relation between the IP address and the MAC address of the host;
a returning unit, configured to generate an ARP reply message according to the MAC address corresponding to the destination IP address when the determination result of the determining unit is yes, and return the ARP reply message to the requesting device;
and the broadcasting unit is used for broadcasting the ARP request message when the judgment result of the judging unit is negative.
8. The apparatus of claim 7, further comprising:
a correspondence obtaining unit, configured to obtain, from a management device, a correspondence between an IP address and an MAC address of a host before determining whether a correspondence entry matching a destination IP address in the ARP request message exists in a correspondence table, and add a correspondence entry in the correspondence table, where the correspondence entry records a correspondence between the IP address and the MAC address of the host, and the correspondence between the IP address and the MAC address of the host is sent to the management device after a PORTAL authentication server successfully authenticates the host; or,
acquiring a corresponding relation between an IP address and an MAC address of a host from gateway equipment, and adding a corresponding relation table entry in a corresponding relation table, wherein the corresponding relation table entry records the corresponding relation between the IP address and the MAC address of the host, and the corresponding relation between the IP address and the MAC address of the host is sent to the gateway equipment after a PORTAL authentication server successfully authenticates the host; or,
monitoring an authentication request message sent by a host to a PORTAL authentication server for PORTAL authentication, or monitoring an authentication success message sent by the PORTAL authentication server to the host, obtaining the corresponding relation between the IP address and the MAC address of the host from the authentication request message or the authentication success message, and adding a corresponding relation table entry in a corresponding relation table, wherein the corresponding relation table entry records the corresponding relation between the IP address and the MAC address of the host.
9. An ARP reply apparatus, the apparatus being applied to a management device, the apparatus comprising:
an obtaining unit, configured to obtain a correspondence between an IP address and an MAC address of a host;
and the sending unit is used for sending the corresponding relation between the IP address and the MAC address of the host to the access equipment so as to enable the access equipment to generate a corresponding relation table item and respond to the received ARP request message according to the corresponding relation table item.
10. The apparatus according to claim 9, wherein the obtaining unit is specifically configured to:
and obtaining the corresponding relation between the IP address and the MAC address of the host sent by the PORTAL authentication server after the host is successfully authenticated.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710386729.0A CN106973126A (en) | 2017-05-26 | 2017-05-26 | A kind of arp reply method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710386729.0A CN106973126A (en) | 2017-05-26 | 2017-05-26 | A kind of arp reply method and device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN106973126A true CN106973126A (en) | 2017-07-21 |
Family
ID=59327352
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201710386729.0A Pending CN106973126A (en) | 2017-05-26 | 2017-05-26 | A kind of arp reply method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN106973126A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107360184A (en) * | 2017-08-14 | 2017-11-17 | 杭州迪普科技股份有限公司 | terminal device authentication method and device |
| CN111107176A (en) * | 2019-12-16 | 2020-05-05 | 京信通信系统(中国)有限公司 | Data transmission method and device, computer equipment and storage medium |
Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101370019A (en) * | 2008-09-26 | 2009-02-18 | 北京星网锐捷网络技术有限公司 | Method and switchboard for preventing packet cheating attack of address analysis protocol |
| CN102739684A (en) * | 2012-06-29 | 2012-10-17 | 杭州迪普科技有限公司 | Portal authentication method based on virtual IP address, and server thereof |
| CN104219340A (en) * | 2014-09-25 | 2014-12-17 | 杭州华三通信技术有限公司 | ARP (Address Resolution Protocol) response proxy method and apparatus |
| CN105245629A (en) * | 2015-09-25 | 2016-01-13 | 互联网域名系统北京市工程研究中心有限公司 | DHCP-based host communication method and device |
| CN105592178A (en) * | 2015-09-17 | 2016-05-18 | 杭州华三通信技术有限公司 | Method and device for determining position of data node |
| CN106059929A (en) * | 2016-06-02 | 2016-10-26 | 杭州华三通信技术有限公司 | Message responding method and device |
| CN106101297A (en) * | 2016-06-02 | 2016-11-09 | 杭州华三通信技术有限公司 | A kind of message answer method and device |
-
2017
- 2017-05-26 CN CN201710386729.0A patent/CN106973126A/en active Pending
Patent Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101370019A (en) * | 2008-09-26 | 2009-02-18 | 北京星网锐捷网络技术有限公司 | Method and switchboard for preventing packet cheating attack of address analysis protocol |
| CN102739684A (en) * | 2012-06-29 | 2012-10-17 | 杭州迪普科技有限公司 | Portal authentication method based on virtual IP address, and server thereof |
| CN104219340A (en) * | 2014-09-25 | 2014-12-17 | 杭州华三通信技术有限公司 | ARP (Address Resolution Protocol) response proxy method and apparatus |
| CN105592178A (en) * | 2015-09-17 | 2016-05-18 | 杭州华三通信技术有限公司 | Method and device for determining position of data node |
| CN105245629A (en) * | 2015-09-25 | 2016-01-13 | 互联网域名系统北京市工程研究中心有限公司 | DHCP-based host communication method and device |
| CN106059929A (en) * | 2016-06-02 | 2016-10-26 | 杭州华三通信技术有限公司 | Message responding method and device |
| CN106101297A (en) * | 2016-06-02 | 2016-11-09 | 杭州华三通信技术有限公司 | A kind of message answer method and device |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107360184A (en) * | 2017-08-14 | 2017-11-17 | 杭州迪普科技股份有限公司 | terminal device authentication method and device |
| CN107360184B (en) * | 2017-08-14 | 2020-09-08 | 杭州迪普科技股份有限公司 | Terminal equipment authentication method and device |
| US10944744B2 (en) | 2017-08-14 | 2021-03-09 | Hangzhou Dptech Technologies Co., Ltd. | Verifying terminal device |
| CN111107176A (en) * | 2019-12-16 | 2020-05-05 | 京信通信系统(中国)有限公司 | Data transmission method and device, computer equipment and storage medium |
| WO2021121286A1 (en) * | 2019-12-16 | 2021-06-24 | 京信网络系统股份有限公司 | Data transmission method and apparatus, computer device and storage medium |
| CN111107176B (en) * | 2019-12-16 | 2021-08-24 | 京信网络系统股份有限公司 | Data transmission method, apparatus, computer equipment and storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN107395683B (en) | A method for selecting a back-to-source path and a server | |
| CN110247999B (en) | Domain name resolution method, domain name resolution device, household appliance and storage medium | |
| US12010091B2 (en) | Topic handling in MQTT networks | |
| CN106412142B (en) | Resource equipment address obtaining method and device | |
| US20130136126A1 (en) | Data center network system and packet forwarding method thereof | |
| US8478891B1 (en) | Employing socket ranges to ascertain layer 2 addresses | |
| WO2017140216A1 (en) | Method and device for network load balancing, control, and network interaction | |
| CN104219340A (en) | ARP (Address Resolution Protocol) response proxy method and apparatus | |
| JP2025528269A (en) | CDN network request scheduling method, device, electronic device, and storage medium | |
| GB2582477A (en) | Accessing gateway management console | |
| US9654439B2 (en) | Methods and gateways for processing DNS request | |
| CN106657434B (en) | method and device for checking IP address | |
| CN103873826B (en) | Media stream control method and device | |
| CN104168140B (en) | VTEP abnormal conditions processing method and processing devices | |
| CN103997479B (en) | A kind of asymmetric services IP Proxy Methods and equipment | |
| CN106982234A (en) | A kind of ARP attack defense methods and device | |
| CN112866413A (en) | Data transmission method and device, electronic equipment and computer readable storage medium | |
| WO2017215492A1 (en) | Device detection method and apparatus | |
| CN107959613B (en) | Message forwarding method and device | |
| CN104639385A (en) | Method and equipment for detecting connectivity of L2VPN (layer 2 virtual private network) user node interface | |
| WO2017166524A1 (en) | Domain name parsing method and apparatus | |
| US20150237005A1 (en) | Address processing | |
| CN106973126A (en) | A kind of arp reply method and device | |
| CN106027354A (en) | Backflow method and device for VPN (Virtual Private Network) client | |
| US20080301273A1 (en) | Centrally assigning branch specific network addresses |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170721 |