CN108881178B - Information transmission method and apparatus, device, storage medium, and electronic apparatus - Google Patents

Information transmission method and apparatus, device, storage medium, and electronic apparatus Download PDF

Info

Publication number
CN108881178B
CN108881178B CN201810531686.5A CN201810531686A CN108881178B CN 108881178 B CN108881178 B CN 108881178B CN 201810531686 A CN201810531686 A CN 201810531686A CN 108881178 B CN108881178 B CN 108881178B
Authority
CN
China
Prior art keywords
address
gateway
equipment
mac address
source
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
CN201810531686.5A
Other languages
Chinese (zh)
Other versions
CN108881178A (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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN201810531686.5A priority Critical patent/CN108881178B/en
Publication of CN108881178A publication Critical patent/CN108881178A/en
Application granted granted Critical
Publication of CN108881178B publication Critical patent/CN108881178B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic
    • H04L63/1466Active attacks involving interception, injection, modification, spoofing of data unit addresses, e.g. hijacking, packet injection or TCP sequence number attacks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/10Mapping addresses of different types
    • H04L61/103Mapping addresses of different types across network layers, e.g. resolution of network layer into physical layer addresses or address resolution protocol [ARP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses

Abstract

The invention discloses an information sending method and device, equipment, a storage medium and an electronic device. Wherein, the method comprises the following steps: acquiring an Address Resolution Protocol (ARP) packet sent by first equipment through a first process, wherein the ARP packet carries an active Internet Protocol (IP) address and a gateway IP address; the first process is used for capturing a data packet which reaches the equipment where the first process is located; analyzing the ARP packet to obtain a source IP address and a gateway IP address; determining a Media Access Control (MAC) address corresponding to the gateway IP address according to the source IP address and the gateway IP address; and sending the MAC address corresponding to the gateway IP address to the first equipment through the first process. The invention solves the technical problem of long data acceleration time caused by the hijack of the data packet realized by an ICS technology and a route adding mode in the related technology.

Description

Information transmission method and apparatus, device, storage medium, and electronic apparatus
Technical Field
The present invention relates to the field of computers, and in particular, to an information sending method and apparatus, a device, a storage medium, and an electronic apparatus.
Background
Using a Personal Computer (PC for short) as a gateway to accelerate a host, first hijacking data sent by the host to the PC where an accelerator client is located, wherein the scheme in the related technology is as follows: setting an Internet Protocol (IP) address of a machine where an accelerator client is located as a gateway IP address of a host, and then implementing hijacking of a host IP packet by using an Internet Connection Sharing (ICS) technology provided by a windows operating system and a route adding mode. However, this has several problems: 1) the ICS of windows is extremely unstable, various problems exist, and especially system outage occurs when the virtual network card is set for sharing; 2) a virtual network card is required to be installed to add a route to hijack data, so that the route needs to be collected in advance, and if the main game is not completely connected with the route, the accelerated game fails; 3) if the network IP allocation is dhcp (Dynamic host configuration Protocol, abbreviated as dhcp) (the current home network is basically dhcp), then the static IP of the configured host may have IP collision (the IP set by the host is configured by the machine connected to the latter); 4) the peer-to-peer (P2P for short) type of Network Address Translation (NAT) cannot be opened, because the ICS mechanism is a NAT, and the host game data can reach the accelerator through the ICS, the accelerator cannot optimize the NAT type; 5) the start-up acceleration time is too long because of the long running logic involved from start of acceleration to end, such as installing a virtual network card, setting network card sharing, and adding a route.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides an information sending method and device, equipment, a storage medium and an electronic device, which at least solve the technical problem that in the related technology, hijacking of a data packet is realized through an ICS (Internet connection sharing) technology and a route adding mode, so that the data acceleration time is long.
According to an aspect of the embodiments of the present invention, there is provided an information sending method, including: acquiring an Address Resolution Protocol (ARP) packet sent by first equipment through a first process, wherein the ARP packet carries an active Internet Protocol (IP) Address and a gateway IP Address; the first process is used for capturing a data packet which reaches the equipment where the first process is located; analyzing the ARP packet to obtain a source IP address and a gateway IP address; determining a Media Access Control (MAC) address corresponding to the gateway IP address according to the source IP address and the gateway IP address; and sending the MAC address corresponding to the gateway IP address to the first equipment through the first process.
Optionally, determining the MAC address corresponding to the gateway IP address according to the source IP address and the gateway IP address includes: and under the condition that the source IP address is determined to be the IP address preset for the first equipment and the gateway IP address is determined to be the gateway IP address preset for the first equipment, determining the MAC address of the equipment where the first process is located as the MAC address corresponding to the gateway IP address.
Optionally, after the MAC address corresponding to the gateway IP address is sent to the first device by the first process, the method further includes at least one of: receiving a first data packet sent by first equipment through a first process, wherein the first data packet carries a first source MAC address and a first destination MAC address, the first source MAC address is an MAC address of the first equipment, and the first destination MAC address is an MAC address corresponding to a gateway IP address; sending a second data packet to the first device through the first process, wherein the second data packet carries a second source MAC address and a second destination MAC address; the second source MAC address is a MAC address corresponding to the gateway IP address, and the second destination MAC address is a MAC address of the first device.
Optionally, before acquiring, by the first process, an address resolution protocol ARP packet sent by the first device, the method further includes: sending specified information to the first device, wherein the specified information carries the following information: the IP address, the mask code, the gateway IP address and the domain name system DNS are set for the first device.
Optionally, before sending the specific information to the first device, the method further includes: and configuring specified information according to the IP address of the equipment where the first process is located, wherein the IP address set for the first equipment, the gateway IP address set for the first equipment and the IP address of the equipment where the first process is located are different in pairs.
Optionally, a first specified network segment of the gateway IP address set for the first device is different from a first specified network segment of the IP address of the device where the first process is located, and a second specified network segment of the gateway IP address set for the first device is the same as a second specified network segment of the IP address of the device where the first process is located; the first designated network segment of the IP address set for the first device is the same as the first designated network segment of the gateway IP address set for the first device, and the second designated network segment of the IP address set for the first device is partially the same as the second designated network segment of the gateway IP address set for the first device.
According to an aspect of an embodiment of the present invention, there is provided an information transmitting apparatus including: the acquisition module is used for acquiring an Address Resolution Protocol (ARP) packet sent by the first equipment through a first process, wherein the ARP packet carries an active Internet Protocol (IP) address and a gateway IP address; the first process is used for capturing a data packet which reaches the equipment where the first process is located; the analysis module is used for analyzing the ARP packet to obtain a source IP address and a gateway IP address; the determining module is used for determining a Media Access Control (MAC) address corresponding to the gateway IP address according to the source IP address and the gateway IP address; and the first sending module is used for sending the MAC address corresponding to the gateway IP address to the first equipment through the first process.
Optionally, the determining module is further configured to determine, when it is determined that the source IP address is an IP address set for the first device in advance and the gateway IP address is a gateway IP address set for the first device in advance, the MAC address of the device where the first process is located as the MAC address corresponding to the gateway IP address.
Optionally, the apparatus further comprises at least one of: the receiving module is used for receiving a first data packet sent by first equipment through a first process, wherein the first data packet carries a first source MAC address and a first destination MAC address, the first source MAC address is an MAC address of the first equipment, and the first destination MAC address is an MAC address corresponding to a gateway IP address; the second sending module is used for sending a second data packet to the first equipment through the first process, wherein the second data packet carries a second source MAC address and a second destination MAC address; the second source MAC address is a MAC address corresponding to the gateway IP address, and the second destination MAC address is a MAC address of the first device.
Optionally, the apparatus further comprises: a third sending module, configured to send, to the first device, designation information before obtaining, by the first process, an ARP packet sent by the first device, where the designation information carries the following information: the IP address, the mask code, the gateway IP address and the domain name system DNS are set for the first device.
Optionally, the apparatus further comprises: and the configuration module is used for configuring the designated information according to the IP address of the equipment where the first process is located, wherein the IP address set for the first equipment, the gateway IP address set for the first equipment and the IP address of the equipment where the first process is located are different in pairs.
According to an aspect of an embodiment of the present invention, there is provided an apparatus including: an accelerator client and a first process; the first process is used for acquiring an Address Resolution Protocol (ARP) packet sent by the first equipment and sending the ARP packet to the accelerator client; wherein, the ARP packet carries an active Internet protocol IP address and a gateway IP address; the accelerator client is used for analyzing the ARP packet to obtain a source IP address and a gateway IP address; determining a Media Access Control (MAC) address corresponding to the gateway IP address according to the source IP address and the gateway IP address; and sending the MAC address corresponding to the gateway IP address to the first device through the first process.
According to an aspect of embodiments of the present invention, there is provided a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the method of any one of the above when executed.
According to an aspect of embodiments of the present invention, there is provided an electronic apparatus, comprising a memory having a computer program stored therein and a processor configured to execute the computer program to perform the method of any one of the above.
In the embodiment of the invention, a first process for capturing data packets arriving at a first device is adopted to obtain an ARP packet, a MAC address corresponding to a gateway IP address is determined by analyzing the ARP packet, then the first process returns the MAC address corresponding to the determined gateway IP address to the first device, the operating system of the device in which the first process is located is bypassed by capturing data packets and sending the relevant data to the first device by the first process capturing data packets arriving at the device in which the first process is located, and can realize the capture of data packets without setting network card sharing and adding routing, thereby improving the acceleration speed of the data, reducing the acceleration time of the data, improving the experience of the user, and further, the technical problem that the data acceleration time is long due to the fact that hijack of the data packet is achieved through an ICS technology and a route adding mode in the related technology is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a block diagram of a hardware configuration of a computer terminal of an information transmission method according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating an information transmitting method according to an embodiment of the present invention;
fig. 3 is a block diagram of an information transmitting apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The method provided by the embodiment of the application can be executed in a mobile terminal, a computer terminal or a similar operation device. Taking an example of the operation on a computer terminal, fig. 1 is a hardware structure block diagram of a computer terminal of an information sending method according to an embodiment of the present invention. As shown in fig. 1, the computer terminal may include one or more (only one shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, and optionally, a transmission device 106 for communication functions and an input-output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the computer terminal. For example, the computer terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the object control method in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, so as to implement the method described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to a computer terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal. In one example, the transmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
An embodiment of the present application further provides a network architecture, where the network architecture includes: one or more hosts (which may correspond to the first device below) and one or more PCs, the PCs and hosts being in the same local area network, the PCs and hosts being capable of interacting with each other.
In accordance with an embodiment of the present invention, there is provided a method embodiment of an information transmission method, it should be noted that the steps illustrated in the flowchart of the accompanying drawings may be performed in a computer system such as a set of computer executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than that herein.
In this embodiment, an information sending method operating on the network architecture or the computer terminal is provided, and fig. 2 is a schematic flow chart of the information sending method according to the embodiment of the present invention, as shown in fig. 2, the method includes the following steps:
step S202, an Address Resolution Protocol (ARP) packet sent by first equipment is obtained through a first process, wherein the ARP packet carries an active Internet Protocol (IP) address and a gateway IP address; the first process is used for capturing a data packet which reaches the equipment where the first process is located;
step S204, analyzing the ARP packet to obtain a source IP address and a gateway IP address;
step S206, determining a Media Access Control (MAC) address corresponding to the gateway IP address according to the source IP address and the gateway IP address;
step S208, the MAC address corresponding to the gateway IP address is sent to the first device.
Through the steps, a first process for capturing data packets arriving at the first device is adopted to obtain an ARP packet, the MAC address corresponding to the gateway IP address is determined by analyzing the ARP packet, then the first process returns the MAC address corresponding to the determined gateway IP address to the first device, the operating system of the device in which the first process is located is bypassed by capturing data packets and sending the relevant data to the first device by the first process capturing data packets arriving at the device in which the first process is located, and can realize the capture of data packets without setting network card sharing and adding routing, thereby improving the acceleration speed of the data, reducing the acceleration time of the data, improving the experience of the user, and further, the technical problem that the data acceleration time is long due to the fact that hijack of the data packet is achieved through an ICS technology and a route adding mode in the related technology is solved.
The first process may also be referred to as a driver, but is not limited thereto.
It should be noted that, the ARP packet may further include: the source MAC address, but is not so limited. The above gateway IP address may be the gateway IP address of the first device, i.e. the gateway IP address that the first device requests to query. The first device may be a host in the network architecture, and the device where the first process is located may be a PC in the network architecture, but is not limited thereto.
It should be noted that, the first device may send the ARP packet by broadcasting the ARP packet.
In an alternative embodiment of the present application, the step S208 may be represented as: and returning an ARP packet to the first equipment through the first process, wherein the ARP packet carries the MAC address corresponding to the gateway IP address.
In an alternative embodiment of the present application, the step S206 may be represented as: and under the condition that the source IP address is determined to be the IP address preset for the first equipment and the gateway IP address is determined to be the gateway IP address preset for the first equipment, determining the MAC address of the equipment where the first process is located as the MAC address corresponding to the gateway IP address. The method comprises the steps of setting an IP address and a gateway IP address for first equipment which are stored locally, respectively matching the IP address and the gateway IP address carried in an ARP packet, and determining that the MAC address of the local equipment (the equipment where a first process is located) is the MAC address corresponding to the gateway IP address under the condition that matching is successful.
In an embodiment of the application, before the step S202, the method may further include: sending specified information to the first device, wherein the specified information carries the following information: the IP address, the mask code, the gateway IP address and the domain name system DNS are set for the first device.
It should be noted that, after the first device receives the designation information, the network may be set based on the designation information.
It should be noted that, before sending the specific information to the first device, the method may further include: and configuring specified information according to the IP address of the equipment where the first process is located, wherein the IP address set for the first equipment, the gateway IP address set for the first equipment and the IP address of the equipment where the first process is located are different in pairs. By the method, the problem of IP conflict in the local area network can be avoided. Compared with the mode that the IP of the equipment where the accelerator is arranged is set as the gateway IP in the related technology, the method does not need to set the static gateway IP on the PC of the equipment where the first process is arranged, and further can avoid the problem of short interruption of the network due to the fact that the static gateway IP is set and the user network is DHCP.
It should be noted that the IP address set for the first device, the gateway IP address set for the first device, and the IP address of the device where the first process is located may be ensured to be in conflict with each other in the following manner: the first specified network segment of the gateway IP address set for the first device is different from the first specified network segment of the IP address of the device where the first process is located, and the second specified network segment of the gateway IP address set for the first device is the same as the second specified network segment of the IP address of the device where the first process is located; the first designated network segment of the IP address set for the first device is the same as the first designated network segment of the gateway IP address set for the first device, and the second designated network segment of the IP address set for the first device is partially the same as the second designated network segment of the gateway IP address set for the first device.
The following are exemplified: assuming that the IP address of the device where the first process is located is d.c.b.a, the gateway IP address set for the first device may be f.e.b.a, the IP address set for the first device may be f.e. (b + 1)% 256.a, and the mask may be 255.255.0.0. it should be noted that the first specified network segment of the gateway IP address set for the first device may be f-segment and e-segment in f.e.b.a, the second specified network segment of the gateway IP address set for the first device may be b-segment and a-segment in f.e.b.a, the first specified network segment of the IP address of the device where the first process is located may be d-segment and c-segment in d.c.b.a, the second specified network segment of the IP address of the device where the first process is located may be b-segment and a-segment in d.c.b.a, the first specified network segment of the IP address set for the first process may be f.e. (b-segment and a)% 256-segment in f.e.b.b.a), and f.e% of the IP address set for the first specified network segment (b.b.b.b.b.b.b.a) and b.1)% Segment, but is not limited thereto.
In an embodiment of the application, after the step S208, the method may further include at least one of: receiving a first data packet sent by first equipment through a first process, wherein the first data packet carries a first source MAC address and a first destination MAC address, the first source MAC address is an MAC address of the first equipment, and the first destination MAC address is an MAC address corresponding to a gateway IP address; sending a second data packet to the first device through the first process, wherein the second data packet carries a second source MAC address and a second destination MAC address; the second source MAC address is a MAC address corresponding to the gateway IP address, and the second destination MAC address is a MAC address of the first device. That is, after the first device acquires the MAC address corresponding to the gateway IP, the destination MAC address is set as the MAC address corresponding to the gateway IP (the MAC address of the device to which the first process belongs) when subsequent data transmission is performed, and when a packet arrives at the device to which the MAC address corresponds (the device to which the first process belongs), the device corresponding to the MAC address in the related art does not have a function of forwarding data because the gateway IP is not configured, these packets are dropped, but the application performs packet grabbing through the first process, and thus these packets are received by the first process, subsequent interaction with the acceleration server or game server may be accomplished, and when data needs to be sent to the first device, the source MAC address may be set as a MAC address corresponding to the network card IP address, and the destination MAC address may be set as a MAC address of the first device, and then the bare packet may be sent to the host through the first process. Because there is no NAT between the first device and the device of the first process, and only bare packets are transmitted, the P2P game NAT type development can be realized as long as NAT restriction is bypassed between the device of the first process and the acceleration service group and the game server.
It should be noted that the main body of the step may be the device where the first process is located, and specifically may be an accelerator client in the device where the first process is located, but is not limited thereto.
The device where the first process is located may be the terminal shown in fig. 1, or may be a PC in the network architecture, but is not limited thereto.
The following describes the present embodiment by taking an example in which the device in which the first process is located is referred to as a PC, the first device is a host, and the first process is a driver.
An optional embodiment of the present application provides a method for data interception in a local area network based on a virtual gateway technology, including:
the PC (equivalent to the device where the first process is located) and the host are located in the same local area network (no matter wired or wireless network), first, an accelerator client program on the PC specifies, according to a current network address of a user (equivalent to the IP address of the device where the first process is located), an IP that the host network needs to set, a mask, a gateway IP (note that the IP is not set on any PC in the local area network), and a DNS, where the IP that the host network needs to set and the gateway IP are in the same network and do not conflict with the local network (specifically, see an IP setting anti-collision scheme). Then the host computer sets up the network according to the appointed information (including IP, mask, gateway IP and DNS, which are needed to be set by the host computer network; corresponding to the appointed information) on the accelerator client terminal on the PC, if the host computer wants to send data after the successful setting, the host computer firstly broadcasts an Address Resolution Protocol (ARP) packet (corresponding to the ARP packet) in the local area network to inquire the MAC address corresponding to the gateway IP, the PC operating system in the local area network receives the packet but only throws the packet away without any processing because the gateway IP is not configured, but the content of the packet can be known on the accelerator client terminal by a driving packet-grabbing technology, when the source IP is the IP set by the host computer and the requested IP is the gateway IP set by the host computer, the ARP response is directly sent by the driving (corresponding to the first process), the ARP response is correspondingly used for informing the host computer that the requested IP belongs to the MAC address of the current PC, and the accelerator client can know the network card MAC address of the host through the ARP response. When the host receives the ARP packet, the host knows the MAC address corresponding to the gateway IP; when the host subsequently sends a network request data packet, the destination MAC address is set to the MAC of the PC network card (corresponding to the MAC address corresponding to the gateway IP) so that the data packet can reach the PC, the PC does not have a function of forwarding data, and the data is normally discarded, but if the driving packet capturing is started, the data is driven to be received and then transmitted to the accelerator client, and the accelerator client then uses the data to complete subsequent interaction with the acceleration server or the game server. When data needs to be sent to the host, the accelerator client sets a source MAC address as a PC network card MAC (equivalent to a MAC address corresponding to a gateway IP), sets a destination MAC as a host MAC, and then directly sends a bare Ethernet data packet to the host through driving. This completes the accelerated flow of host network data.
Through the steps, as an operating system is bypassed, only a driver needs to be installed, if the driver is stable, the stability of data receiving and sending can be ensured, and the driver is developed by the driver and can be directly controlled, unlike the operating mechanism of ICS, which cannot be changed; since there is no need to set an actual static gateway IP on the PC (if a static gateway IP is set, it will cause a brief interruption of the network if the user network itself is dhcp), no local network interruption will be caused at acceleration; the data packet sent by the host can be completely intercepted by a driving packet capturing technology according to a source IP (IP set by the host), and the traditional routing mode must rely on the integrity of a collection route; the subnet independent of the local network and the complete IP setting anti-collision scheme can ensure that IP collision does not exist in the local network; because there is no NAT between the accelerator client and the host, only the bare Ethernet packet is transmitted, so as to bypass the NAT restriction between the accelerator client and the acceleration service group and the game server, the P2P game NAT type opening can be realized; because the driver is installed when the accelerator client is installed, the scheme does not need to install a virtual network card, set network card sharing and add a route, the acceleration speed of starting the host game is high, and the user experience is greatly improved.
It should be noted that, in the above method, the host needs to set two IPs, one is its own IP, and the other is the gateway IP (the IP does not actually have any PC configuration). If two PCs on the same LAN set the same IP, then network conflict occurs and network anomaly occurs. In order to prevent this, an alternative embodiment of the present application further provides an IP setting anti-collision method, including:
assuming in advance that there is no network conflict in the user's own network (in the case of not using the accelerator client, if the user's network normally does not have network conflict), if the IP of the PC where the accelerator client is located is d.c.b.a, the IP (gateway IP) set by the virtual gateway is f.e.b.a (such as 172.22.b.a), the IP of the host is set to f.e. (b + 1)% 256.a, and the mask is 255.255.0.0. If d is equal to f, c is equal to e, then the gateway IP is set to f.e +1.b.a, the host IP is set to f.e. (b + 1)% 256.a, such as 172.22.b.a for the PC itself, then the gateway IP is 172.23.b.a, and the host IP is 172.22.(b + 1)% 256. a). If there is no conflict with the user's own network, it can be determined b.a to be unique, as long as the B segment setting the IP is not the same as the previous segment (i.e., f.e is not the same as d.c), then the address of f.e.b.a is also unique, and f.e. (B + 1)% 256.a can also be determined to be unique.
An embodiment of the present invention further provides an information sending apparatus, and fig. 3 is a block diagram of a structure of an information sending apparatus provided according to an embodiment of the present invention, and as shown in fig. 3, the apparatus includes:
an obtaining module 32, configured to obtain, through a first process, an ARP packet sent by a first device, where the ARP packet carries an active internet protocol IP address and a gateway IP address; the first process is used for capturing a data packet which reaches the equipment where the first process is located;
an analyzing module 34, connected to the acquiring module 32, for analyzing the ARP packet to obtain a source IP address and a gateway IP address;
a determining module 36, connected to the parsing module 34, for determining a MAC address corresponding to the gateway IP address according to the source IP address and the gateway IP address;
and a first sending module 38, connected to the determining module 36, configured to send, by a first process, the MAC address corresponding to the gateway IP address to the first device.
By the device, the ARP packet is obtained by a first process for capturing the data packet arriving at the first equipment, the MAC address corresponding to the gateway IP address is determined by analyzing the ARP packet, then the first process returns the MAC address corresponding to the determined gateway IP address to the first device, the operating system of the device in which the first process is located is bypassed by capturing data packets and sending the relevant data to the first device by the first process capturing data packets arriving at the device in which the first process is located, and can realize the capture of data packets without setting network card sharing and adding routing, thereby improving the acceleration speed of the data, reducing the acceleration time of the data, improving the experience of the user, and further, the technical problem that the data acceleration time is long due to the fact that hijack of the data packet is achieved through an ICS technology and a route adding mode in the related technology is solved.
The first process may also be referred to as a driver, but is not limited thereto.
It should be noted that, the ARP packet may further include: the source MAC address, but is not so limited. The above gateway IP address may be the gateway IP address of the first device, i.e. the gateway IP address that the first device requests to query. The first device may be a host in the network architecture, and the device where the first process is located may be a PC in the network architecture, but is not limited thereto.
It should be noted that, the first device may send the ARP packet by broadcasting the ARP packet.
In an optional embodiment of the present application, the first sending module 38 may further be configured to send an ARP packet to the first device through the first process, where the ARP packet carries a MAC address corresponding to the gateway IP address.
In an optional embodiment of the present application, the determining module 36 may be further configured to determine, when it is determined that the source IP address is an IP address preset for the first device, and the gateway IP address is a gateway IP address preset for the first device, a MAC address of the device where the first process is located as a MAC address corresponding to the gateway IP address.
In an embodiment of the present application, the apparatus may further include at least one of: the receiving module is used for receiving a first data packet sent by first equipment through a first process, wherein the first data packet carries a first source MAC address and a first destination MAC address, the first source MAC address is an MAC address of the first equipment, and the first destination MAC address is an MAC address corresponding to a gateway IP address; the second sending module is used for sending a second data packet to the first equipment through the first process, wherein the second data packet carries a second source MAC address and a second destination MAC address; the second source MAC address is a MAC address corresponding to the gateway IP address, and the second destination MAC address is a MAC address of the first device.
The receiving module and/or the second transmitting module may be connected to the first transmitting module 38, or may not be connected to the first transmitting module, but is not limited thereto.
In an embodiment of the present application, the apparatus may further include: a third sending module, connected to the first sending module 38, configured to send specific information to the first device before obtaining an ARP packet sent by the first device through the first process, where the specific information carries the following information: the IP address, the mask code, the gateway IP address and the domain name system DNS are set for the first device.
It should be noted that the above apparatus may further include: and the configuration module is connected with the third sending module and is used for configuring the designated information according to the IP address of the equipment where the first process is located, wherein the IP address set for the first equipment, the gateway IP address set for the first equipment and the IP address of the equipment where the first process is located are different in pairs.
It should be noted that the IP address set for the first device, the gateway IP address set for the first device, and the IP address of the device where the first process is located may be ensured to be in conflict with each other in the following manner: the first specified network segment of the gateway IP address set for the first device is different from the first specified network segment of the IP address of the device where the first process is located, and the second specified network segment of the gateway IP address set for the first device is the same as the second specified network segment of the IP address of the device where the first process is located; the first designated network segment of the IP address set for the first device is the same as the first designated network segment of the gateway IP address set for the first device, and the second designated network segment of the IP address set for the first device is partially the same as the second designated network segment of the gateway IP address set for the first device.
It should be noted that the apparatus may be located in the device where the first process is located, and specifically may be in an accelerator client in the device where the first process is located, but is not limited thereto. The device where the first process is located may be the terminal shown in fig. 1, or may be a PC in the network architecture, but is not limited thereto.
The present application also provides an apparatus, comprising: an accelerator client and a first process; the first process is used for acquiring an Address Resolution Protocol (ARP) packet sent by the first equipment and sending the ARP packet to the accelerator client; wherein, the ARP packet carries an active Internet protocol IP address and a gateway IP address; the accelerator client is used for analyzing the ARP packet to obtain a source IP address and a gateway IP address; determining a Media Access Control (MAC) address corresponding to the gateway IP address according to the source IP address and the gateway IP address; and sending the MAC address corresponding to the gateway IP address to the first device through the first process.
By the above apparatus, acquiring an ARP packet by a first process for capturing a data packet arriving at a first apparatus, and determining a MAC address corresponding to a gateway IP address by parsing the ARP packet, then the first process returns the MAC address corresponding to the determined gateway IP address to the first device, the operating system of the device in which the first process is located is bypassed by capturing data packets and sending the relevant data to the first device by the first process capturing data packets arriving at the device in which the first process is located, and can realize the capture of data packets without setting network card sharing and adding routing, thereby improving the acceleration speed of the data, reducing the acceleration time of the data, improving the experience of the user, and further, the technical problem that the data acceleration time is long due to the fact that hijack of the data packet is achieved through an ICS technology and a route adding mode in the related technology is solved.
The first process may also be referred to as a driver, but is not limited thereto.
It should be noted that, the ARP packet may further include: the source MAC address, but is not so limited. The above gateway IP address may be the gateway IP address of the first device, i.e. the gateway IP address that the first device requests to query. The first device may be a host in the network architecture, and the device where the first process is located may be a PC in the network architecture, but is not limited thereto.
It should be noted that, the first device may send the ARP packet by broadcasting the ARP packet.
In an optional embodiment of the present application, the accelerator client may be further configured to return an ARP packet to the first device through the first process, where the ARP packet carries a MAC address corresponding to the gateway IP address.
In an optional embodiment of the present application, the accelerator client may be further configured to determine, when it is determined that the source IP address is an IP address preset for the first device, and the gateway IP address is a gateway IP address preset for the first device, a MAC address of the device where the first process is located as a MAC address corresponding to the gateway IP address.
In one embodiment of the present application, the accelerator client may be further configured to at least one of: receiving a first data packet sent by first equipment through a first process, wherein the first data packet carries a first source MAC address and a first destination MAC address, the first source MAC address is an MAC address of the first equipment, and the first destination MAC address is an MAC address corresponding to a gateway IP address; sending a second data packet to the first device through the first process, wherein the second data packet carries a second source MAC address and a second destination MAC address; the second source MAC address is a MAC address corresponding to the gateway IP address, and the second destination MAC address is a MAC address of the first device.
In an embodiment of the application, the accelerator client is further configured to send, to the first device, designation information before obtaining, by the first process, an address resolution protocol ARP packet sent by the first device, where the designation information carries the following information: the IP address, the mask code, the gateway IP address and the domain name system DNS are set for the first device.
It should be noted that the accelerator client is further configured to configure the specific information according to the IP address of the device where the first process is located, where the IP address set for the first device, the gateway IP address set for the first device, and the IP address of the device where the first process is located are different from each other two by two.
It should be noted that the IP address set for the first device, the gateway IP address set for the first device, and the IP address of the device where the first process is located may be ensured to be in conflict with each other in the following manner: the first specified network segment of the gateway IP address set for the first device is different from the first specified network segment of the IP address of the device where the first process is located, and the second specified network segment of the gateway IP address set for the first device is the same as the second specified network segment of the IP address of the device where the first process is located; the first designated network segment of the IP address set for the first device is the same as the first designated network segment of the gateway IP address set for the first device, and the second designated network segment of the IP address set for the first device is partially the same as the second designated network segment of the gateway IP address set for the first device.
It should be noted that, the device where the first process is located may be the terminal shown in fig. 1, or may be a PC in the network architecture, but is not limited thereto.
According to an embodiment of the present invention, there is also provided a storage medium including a stored program, wherein the apparatus on which the storage medium is located is controlled to perform the above-mentioned method when the program is executed. The storage medium may include, but is not limited to: various media capable of storing program codes, such as a U disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
There is also provided, in accordance with an embodiment of the present invention, a processor configured to execute a program, where the program executes to perform the above-mentioned method. The processor may include, but is not limited to: a Microprocessor (MCU) or a programmable logic device (FPGA), etc.
There is further provided, in accordance with an embodiment of the present invention, an electronic apparatus including a memory and a processor, wherein the memory stores therein a computer program, and the processor is configured to execute the computer program to perform the above-mentioned method.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
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 units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (12)

1. An information transmission method, comprising:
the method comprises the steps that equipment where a first process is located obtains an ARP packet sent by the first equipment through the first process, wherein the ARP packet carries a source IP address and a gateway IP address; the first process is used for capturing a data packet which reaches the equipment where the first process is located;
the equipment where the first process is located analyzes the ARP packet to obtain the source IP address and the gateway IP address;
the equipment where the first process is located determines an MAC address corresponding to the gateway IP address according to the source IP address and the gateway IP address;
the equipment where the first process is located sends the MAC address corresponding to the gateway IP address to the first equipment through the first process;
determining the MAC address corresponding to the gateway IP address according to the source IP address and the gateway IP address comprises: and respectively matching the IP address and the gateway IP address which are stored by the equipment where the first process is located and are set for the first equipment with the source IP address and the gateway IP address carried in the ARP packet, and determining the MAC address of the equipment where the first process is located as the MAC address corresponding to the gateway IP address carried in the ARP packet under the condition of successful matching.
2. The method of claim 1, wherein after sending a MAC address corresponding to the gateway IP address to the first device through the first process, the method further comprises at least one of:
receiving a first data packet sent by the first device through the first process, wherein the first data packet carries a first source MAC address and a first destination MAC address, the first source MAC address is an MAC address of the first device, and the first destination MAC address is an MAC address corresponding to the gateway IP address;
sending a second data packet to the first device through the first process, wherein the second data packet carries a second source MAC address and a second destination MAC address; the second source MAC address is a MAC address corresponding to a gateway IP address, and the second destination MAC address is a MAC address of the first device.
3. The method of claim 1, wherein before acquiring, by the first process, the address resolution protocol, ARP, packet sent by the first device, the method further comprises:
sending specified information to the first device, wherein the specified information carries the following information: an IP address, a mask, a gateway IP address, a DNS set for the first device.
4. The method of claim 3, wherein prior to sending the designation information to the first device, the method further comprises:
and configuring the designated information according to the IP address of the equipment where the first process is located, wherein the IP address set for the first equipment, the gateway IP address set for the first equipment and the IP address of the equipment where the first process is located are different in pairs.
5. The method according to claim 4, wherein a first specified network segment of the gateway IP address set for the first device is different from a first specified network segment of the IP address of the device where the first process is located, and a second specified network segment of the gateway IP address set for the first device is the same as a second specified network segment of the IP address of the device where the first process is located; the first specified network segment of the IP address set for the first device is the same as the first specified network segment of the gateway IP address set for the first device, and the second specified network segment of the IP address set for the first device is partially different from the second specified network segment of the gateway IP address set for the first device.
6. An information transmission apparatus, comprising:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for enabling the device where the first process is located to acquire an ARP packet sent by the first device through the first process, and the ARP packet carries a source IP address and a gateway IP address; the first process is used for capturing a data packet which reaches the equipment where the first process is located;
the analysis module is used for enabling the equipment where the first process is located to analyze the ARP packet to obtain the source IP address and the gateway IP address;
the determining module is used for enabling the equipment where the first process is located to determine the MAC address corresponding to the gateway IP address according to the source IP address and the gateway IP address;
a first sending module, configured to enable the device where the first process is located to send, to the first device through the first process, the MAC address corresponding to the gateway IP address;
the determining module is further configured to enable the device where the first process is located to determine, according to the source IP address and the gateway IP address, an MAC address corresponding to the gateway IP address by: and respectively matching the IP address and the gateway IP address which are stored by the equipment where the first process is located and are set for the first equipment with the source IP address and the gateway IP address carried in the ARP packet, and determining the MAC address of the equipment where the first process is located as the MAC address corresponding to the gateway IP address carried in the ARP packet under the condition of successful matching.
7. The apparatus of claim 6, further comprising at least one of:
a receiving module, configured to receive a first data packet sent by the first device through the first process, where the first data packet carries a first source MAC address and a first destination MAC address, the first source MAC address is an MAC address of the first device, and the first destination MAC address is an MAC address corresponding to the gateway IP address;
a second sending module, configured to send a second data packet to the first device through the first process, where the second data packet carries a second source MAC address and a second destination MAC address; the second source MAC address is a MAC address corresponding to a gateway IP address, and the second destination MAC address is a MAC address of the first device.
8. The apparatus of claim 6, further comprising:
a third sending module, configured to send, to a first device, designation information before obtaining an ARP packet sent by the first device through a first process, where the designation information carries the following information: and setting an IP address, a mask code, a gateway IP address and a Domain Name System (DNS) for the first equipment.
9. The apparatus of claim 8, further comprising:
and the configuration module is used for configuring the designated information according to the IP address of the equipment where the first process is located, wherein the IP address set for the first equipment, the gateway IP address set for the first equipment and the IP address of the equipment where the first process is located are different in pairs.
10. An information transmission apparatus characterized by comprising: an accelerator client and a first process; wherein the content of the first and second substances,
the first process is used for acquiring an ARP packet sent by first equipment and sending the ARP packet to the accelerator client; wherein, the ARP packet carries an active IP address and a gateway IP address;
the accelerator client is used for analyzing the ARP packet to obtain the source IP address and the gateway IP address; determining an MAC address corresponding to the gateway IP address according to the source IP address and the gateway IP address; sending the MAC address corresponding to the gateway IP address to the first equipment through the first process;
the acceleration client is further configured to enable the device where the first process is located to determine, according to the source IP address and the gateway IP address, a MAC address corresponding to the gateway IP address by the following steps: and respectively matching the IP address and the gateway IP address which are stored by the equipment where the first process is located and are set for the first equipment with the source IP address and the gateway IP address carried in the ARP packet, and determining the MAC address of the equipment where the first process is located as the MAC address corresponding to the gateway IP address carried in the ARP packet under the condition of successful matching.
11. A storage medium, in which a computer program is stored, wherein the computer program is arranged to, when executed by a processor, perform the method of any one of claims 1 to 5.
12. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor is arranged to execute the computer program to perform the method of any of claims 1 to 5.
CN201810531686.5A 2018-05-29 2018-05-29 Information transmission method and apparatus, device, storage medium, and electronic apparatus Active CN108881178B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810531686.5A CN108881178B (en) 2018-05-29 2018-05-29 Information transmission method and apparatus, device, storage medium, and electronic apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810531686.5A CN108881178B (en) 2018-05-29 2018-05-29 Information transmission method and apparatus, device, storage medium, and electronic apparatus

Publications (2)

Publication Number Publication Date
CN108881178A CN108881178A (en) 2018-11-23
CN108881178B true CN108881178B (en) 2020-02-14

Family

ID=64336820

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810531686.5A Active CN108881178B (en) 2018-05-29 2018-05-29 Information transmission method and apparatus, device, storage medium, and electronic apparatus

Country Status (1)

Country Link
CN (1) CN108881178B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112217913B (en) * 2020-09-16 2023-04-18 杭州安恒信息技术股份有限公司 Method and device for negotiating IP address
CN112245907A (en) * 2020-11-10 2021-01-22 网易(杭州)网络有限公司 Game data acceleration method, storage medium, electronic device and system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104243333A (en) * 2013-06-24 2014-12-24 阿里巴巴集团控股有限公司 Traffic control method for address resolution protocol messages
CN105407184A (en) * 2015-11-04 2016-03-16 北京星网锐捷网络技术有限公司 Initial configuration method and device in equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101098292B (en) * 2006-06-29 2011-11-30 中兴通讯股份有限公司 Method for reducing user address analysis protocol broadcast on access equipment
CN101827013A (en) * 2009-03-05 2010-09-08 华为技术有限公司 Method, device and system for balancing multi-gateway load
CN102209124B (en) * 2011-06-08 2014-03-12 杭州华三通信技术有限公司 Method for communication between private network and public network and network address translation equipment
US9565098B2 (en) * 2015-05-27 2017-02-07 Arista Netwroks, Inc. Method and system for implementing border gateway protocol on network devices
CN105872117A (en) * 2015-10-26 2016-08-17 乐视云计算有限公司 Method and system for obtaining MAC address and virtual machine manager

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104243333A (en) * 2013-06-24 2014-12-24 阿里巴巴集团控股有限公司 Traffic control method for address resolution protocol messages
CN105407184A (en) * 2015-11-04 2016-03-16 北京星网锐捷网络技术有限公司 Initial configuration method and device in equipment

Also Published As

Publication number Publication date
CN108881178A (en) 2018-11-23

Similar Documents

Publication Publication Date Title
CN107070691B (en) Cross-host communication method and system of Docker container
EP2866389B1 (en) Method and device thereof for automatically finding and configuring virtual network
CN101883158B (en) Method and client for acquiring VLAN (Virtual Local Area Network) IDs (Identifiers) and network protocol addresses
EP3905598B1 (en) Message processing method and apparatus, control plane device, and computer storage medium
EP1894352B1 (en) Device and method for managing two types of devices
US9832136B1 (en) Streaming software to multiple virtual machines in different subnets
US20040240440A1 (en) Virtual network addresses
EP2343867B1 (en) System and method of reducing intranet traffic on bottleneck links in a telecommunications network
CN102710811B (en) Realize method and the switch of dhcp address safety distribution
JP3885585B2 (en) Router device and network system using the same
CN110198229B (en) Network configuration method and device, storage medium and electronic device
CN100471148C (en) Apparatus and method for establishing network
CN107623752B (en) Network management method and device based on link layer
CN108881178B (en) Information transmission method and apparatus, device, storage medium, and electronic apparatus
CN102904902B (en) A kind of based on DHCP method for blocking bypass by
US20150229520A1 (en) Network monitoring system, communication device, network management method
WO2016042397A1 (en) Enhanced dynamic host configuration protocol (dhcp)
US8443094B2 (en) Computer system comprising a communication device
CN109788528B (en) Access point and method and system for opening internet access service thereof
CN106375489B (en) Method and device for processing Media Access Control (MAC) address
CN109842692B (en) VxLAN switch, system and method for obtaining host information in physical network
EP2568666A1 (en) Ip address obtaining method and network access device
EP3340542B1 (en) Method for configuring a device connected to a field bus
CN115499392A (en) Tenant isolation service method and device, and electronic equipment
CN114584496A (en) Device discovery method, device, client and storage medium

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