[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN114615233B - Data transmission method, device and system, gateway equipment, terminal equipment and medium - Google Patents

Data transmission method, device and system, gateway equipment, terminal equipment and medium Download PDF

Info

Publication number
CN114615233B
CN114615233B CN202210236569.2A CN202210236569A CN114615233B CN 114615233 B CN114615233 B CN 114615233B CN 202210236569 A CN202210236569 A CN 202210236569A CN 114615233 B CN114615233 B CN 114615233B
Authority
CN
China
Prior art keywords
address
data packet
packet
data transmission
dns
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
CN202210236569.2A
Other languages
Chinese (zh)
Other versions
CN114615233A (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.)
Spreadtrum Semiconductor Chengdu Co Ltd
Original Assignee
Spreadtrum Semiconductor Chengdu 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 Spreadtrum Semiconductor Chengdu Co Ltd filed Critical Spreadtrum Semiconductor Chengdu Co Ltd
Priority to CN202210236569.2A priority Critical patent/CN114615233B/en
Publication of CN114615233A publication Critical patent/CN114615233A/en
Application granted granted Critical
Publication of CN114615233B publication Critical patent/CN114615233B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • 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/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/2521Translation architectures other than single NAT servers
    • H04L61/2528Translation at a proxy
    • 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/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/256NAT traversal

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a data transmission method, a data transmission device, a data transmission system, gateway equipment, terminal equipment and a medium. The data transmission method is applied to gateway equipment and comprises the steps of receiving a first data packet sent by terminal equipment; if the first data packet is determined to be a DNS request packet and the destination IP address in the first data packet is a local area network IP address, converting the source IP address in the first data packet into a wide area network IP address and converting the destination IP address in the first data packet into the IP address of a DNS server; sending a first data packet to a DNS server; receiving a second data packet sent by a DNS server; if the second data packet is determined to be a DNS response packet, converting a source IP address in the second data packet into a local area network IP address, and converting a destination IP address in the second data packet into an IP address of the terminal equipment; and sending the second data packet to the terminal equipment so that the gateway equipment can realize DNS proxy.

Description

Data transmission method, device and system, gateway equipment, terminal equipment and medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a data transmission method, apparatus and system, gateway device, terminal device, and medium.
Background
For a router, DNS (Domain Name System ) resolution is required for a host connecting the router to go to the extranet. To achieve this function, DNS servers of the external network may be directly assigned to host use. The host initiates a DNS request, the router performs NAT (Network Address Translation ) on the destination IP address, and forwards the DNS request to the DNS server through the external network card to implement DNS resolution. However, when the network connection between the router and the DNS server changes, DNS information of the network card outside the router also changes, so that the host cannot access the external network. At this time, the host computer needs to reinitiate the DNS request to obtain the correct DNS information, so as to recover the internet surfing of the host computer.
Disclosure of Invention
The invention aims to overcome the defect that a host cannot access to the external network due to the change of network connection between a router and a DNS server in the prior art, and provides a data transmission method, a device and a system, gateway equipment, terminal equipment and a medium.
The invention solves the technical problems by the following technical scheme:
a first aspect of the present invention provides a data transmission method, applied to a gateway device, where the data transmission method includes the following steps:
receiving a first data packet sent by terminal equipment;
if the first data packet is determined to be a DNS request packet and the destination IP address in the first data packet is the local area network IP address of the gateway device, converting the source IP address in the first data packet into the wide area network IP address of the gateway device and converting the destination IP address in the first data packet into the IP address of a DNS server;
sending the first data packet to the DNS server;
receiving a second data packet sent by the DNS server;
if the second data packet is determined to be a DNS response packet, converting a source IP address in the second data packet into a local area network IP address of the gateway device, and converting a destination IP address in the second data packet into an IP address of the terminal device;
and sending the second data packet to the terminal equipment.
Optionally, the data transmission method further includes the steps of: and determining whether the first data packet is a DNS request packet according to the destination port number in the first data packet.
Optionally, the data transmission method further includes the steps of: and determining whether the second data packet is a DNS response packet according to the source port number in the second data packet.
A second aspect of the present invention provides a data transmission apparatus, applied to a gateway device, the data transmission apparatus including:
the first receiving module is used for receiving a first data packet sent by the terminal equipment;
a first conversion module, configured to, when it is determined that the first data packet is a DNS request packet and a destination IP address in the first data packet is a local area network IP address of the gateway device, convert a source IP address in the first data packet to a wide area network IP address of the gateway device, and convert the destination IP address in the first data packet to an IP address of a DNS server;
a first sending module, configured to send the first data packet to the DNS server;
the second receiving module is used for receiving a second data packet sent by the DNS server;
the second conversion module is used for converting a source IP address in the second data packet into a local area network IP address of the gateway equipment and converting a destination IP address in the second data packet into an IP address of the terminal equipment when the second data packet is determined to be a DNS response packet;
and the second sending module is used for sending the second data packet to the terminal equipment.
Optionally, the data transmission device further includes a first determining module, configured to determine whether the first data packet is a DNS request packet according to a destination port number in the first data packet.
Optionally, the data transmission device further includes a second determining module, configured to determine whether the second data packet is a DNS response packet according to a source port number in the second data packet.
A third aspect of the present invention provides a gateway apparatus comprising:
at least one processor;
a memory communicatively coupled to the at least one processor; and
a transceiver for communicating with other devices;
wherein the memory stores instructions executable by the at least one processor to enable the gateway device to perform the data transmission method of the first aspect.
A fourth aspect of the present invention provides a data transmission method, comprising the steps of:
sending a DNS request packet to the gateway device according to the third aspect;
and receiving a DNS response packet sent by the gateway equipment.
A fifth aspect of the present invention provides a data transmission apparatus comprising:
a sending module, configured to send a DNS request packet to the gateway device according to the third aspect;
and the receiving module is used for receiving the DNS response packet sent by the gateway equipment.
A sixth aspect of the present invention provides a terminal device, comprising:
at least one processor;
a memory communicatively coupled to the at least one processor; and
a transceiver for communicating with other devices;
wherein the memory stores instructions executable by the at least one processor to enable the terminal device to perform the data transmission method of the fourth aspect.
A seventh aspect of the invention provides a data transmission system comprising a DNS server, a gateway device as described in the third aspect and a terminal device as described in the sixth aspect,
the DNS server is used for inquiring the IP address corresponding to the domain name according to the domain name in the DNS request packet, and packaging the IP address corresponding to the domain name into the DNS response packet.
An eighth aspect of the present invention provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the data transmission method according to the first aspect or the fourth aspect.
The invention has the positive progress effects that: the gateway device may implement DNS proxy by performing destination IP address translation on the received DNS request packet and source IP address translation on the received DNS response packet. Since the source IP address and the destination IP address of the DNS request packet and the source IP address and the destination IP address of the DNS response packet are not related to the IP address of the DNS server, even if the network connection between the gateway device and the DNS server changes, the internet surfing of the terminal device is not affected.
Drawings
Fig. 1 is a flowchart of a data transmission method provided in embodiment 1 of the present invention.
Fig. 2 is a schematic diagram of an application scenario provided in embodiment 1 of the present invention.
Fig. 3 is a block diagram of a data transmission device according to embodiment 1 of the present invention.
Fig. 4 is a flowchart of a data transmission method provided in embodiment 3 of the present invention.
Fig. 5 is a block diagram of a data transmission device according to embodiment 3 of the present invention.
Fig. 6 is a schematic structural diagram of a terminal device according to embodiment 4 of the present invention.
Fig. 7 is a flowchart of a data transmission method provided in embodiment 5 of the present invention.
Fig. 8 is a schematic structural diagram of a data transmission system according to embodiment 5 of the present invention.
Detailed Description
The invention is further illustrated by means of the following examples, which are not intended to limit the scope of the invention.
It should be noted that, the Gateway (Gateway) device provided in this embodiment is also called an Gateway connector and a protocol converter, and is a computer system or a device for providing a data conversion service between a plurality of networks. Gateway devices can be said to be connectors between different networks, i.e. devices that "negotiate" data from one network to another. In an implementation, the gateway device may be a router, and may also be MiFi (Mobile WIFI, mobile router or Mobile hotspot). The embodiment of the invention does not limit the specific technology and the specific equipment form adopted by the gateway equipment.
The Terminal device provided in this embodiment may be referred to as a host, a Terminal (Terminal), a Terminal device (UE), a Mobile Station (MS), a Mobile Terminal (MT), or the like. The terminal device may be a mobile phone, a wearable device, a tablet computer, a computer with a wireless transceiving function, a Virtual Reality (VR) terminal device, an augmented Reality (Augmented Reality, AR) terminal device, a wireless terminal in industrial control, a wireless terminal in unmanned-driving (self-driving), a wireless terminal in teleoperation, a wireless terminal in smart grid, a wireless terminal in transportation security, a wireless terminal in smart city, a wireless terminal in smart home, or the like. The embodiment of the invention does not limit the specific technology and the specific equipment form adopted by the terminal equipment.
Example 1
Fig. 1 is a flowchart of a data transmission method according to the present embodiment. The data transmission method provided in this embodiment may be performed by a data transmission device, where the data transmission device may be implemented by software and/or hardware, and the data transmission device may include part or all of the gateway device.
The data transmission method is described below in connection with the gateway apparatus as an execution subject. As shown in fig. 1, the data transmission method provided in this embodiment may include the following steps S11 to S16:
step S11, receiving a first data packet sent by the terminal equipment.
Step S12, if it is determined that the first data packet is a DNS request packet and the destination IP address in the first data packet is the local area network IP address of the gateway device, converting the source IP address in the first data packet to the wide area network IP address of the gateway device, and converting the destination IP address in the first data packet to the IP address of the DNS server.
In some examples, the local area network IP address of the gateway device is also referred to as an intranet IP address, and the wide area network IP address of the gateway device is also referred to as an extranet IP address.
In an alternative embodiment of step S12, it is determined whether the first data packet is a DNS request packet according to the destination port number in the first data packet. Specifically, if the destination port number in the first data packet is 53, it is determined that the first data packet is a DNS request packet.
In an alternative embodiment of step S12, it is determined whether the first data packet is a DNS request packet according to the destination port number in the first data packet and the protocol of the first data packet. Specifically, if the destination port number in the first data packet is 53 and the protocol of the first data packet is UDP (User Datagram Protocol ), it is determined that the first data packet is a DNS request packet.
In a specific implementation of step S12, before the gateway device performs network address conversion, the source IP address in the first data packet is the IP address of the terminal device, and the destination IP address is the local area network IP address of the gateway device. After the gateway device performs network address conversion, the source IP address in the first data packet is the wide area network IP address of the gateway device, and the destination IP address is the IP address of the DNS server.
After converting the source IP address in the first packet, it is necessary to update a checksum (checksum) of the corresponding modification field; similarly, after the destination IP address in the first data packet is converted, the checksum of the corresponding modification field needs to be updated, so that the DNS server may receive the accurate first data packet.
And step S13, the first data packet is sent to the DNS server.
In a specific implementation, the first data packet includes a source IP address, a destination address, a source port number, a destination port number, and a domain name. And the DNS server inquires an IP address corresponding to the domain name according to the domain name, and encapsulates the IP address corresponding to the domain name into a second data packet.
And step S14, receiving a second data packet sent by the DNS server.
In a specific implementation, the second data packet includes a source IP address, a destination address, a source port number, a destination port number, and an IP address corresponding to the domain name.
Step S15, if it is determined that the second data packet is a DNS response packet, converting the source IP address in the second data packet to the local area network IP address of the gateway device, and converting the destination IP address in the second data packet to the IP address of the terminal device.
In an alternative implementation manner of step S15, it is determined whether the second data packet is a DNS response packet according to the source port number in the second data packet. Specifically, if the source port number in the second data packet is 53, it is determined that the second data packet is a DNS response packet.
In an alternative embodiment of step S15, it is determined whether the second data packet is a DNS response packet according to the source port number in the second data packet and the protocol of the second data packet. Specifically, if the destination port number in the second data packet is 53 and the protocol of the second data packet is UDP, it is determined that the second data packet is a DNS response packet.
In a specific implementation of step S15, before the gateway device performs network address conversion, the source IP address in the second data packet is an IP address of the DNS server, and the destination IP address is a wide area network IP address of the gateway device. After the gateway device performs network address conversion, the source IP address in the second data packet is the local area network IP address of the gateway device, and the destination IP address is the IP address of the terminal device.
It should be noted that, after the source IP address in the second data packet is converted, a checksum (checksum) of the corresponding modification field needs to be updated; similarly, after the destination IP address in the second data packet is converted, the checksum of the corresponding modification field needs to be updated, so that the terminal device may receive the accurate second data packet.
And step S16, the second data packet is sent to the terminal equipment.
In a specific implementation, the gateway device sends a second data packet to the terminal device, so that the terminal device can access the external network based on the second data packet, and in particular, the terminal device can access a server corresponding to the domain name based on an IP address corresponding to the domain name in the second data packet. In a specific example, the first data packet includes a domain name of the a website, and the second data packet includes an IP address corresponding to the domain name of the a website, and the terminal device may access a server of the a website based on the IP address.
The above data transmission method will be described in detail with reference to a specific example.
In the example shown in fig. 2, the gateway device is a router and the terminal device is a host. The host had an IP address of 192.168.40.2, the router had a Local Area Network (LAN) IP address of 192.168.40.1, the router had a Wide Area Network (WAN) IP address of 14.0.25.239, and the dns server had an IP address of 14.0.25.200.
The host sends the first data packet to the router, and the router converts the source IP address in the first data packet from the IP address of the host (192.168.40.2) to the wide area network IP address of the router (14.0.25.239) and converts the destination address in the first data packet from the local area network IP address of the router (192.168.40.1) to the IP address of the DNS server (14.0.25.200) if it is determined that the first data packet is a DNS request packet and the destination IP address in the first data packet is 192.168.40.1. The router sends the first data packet after network address conversion to the DNS server.
The router receives a second data packet sent by the DNS server, translates a source IP address in the second data packet from an IP address of the DNS server (14.0.25.200) to a local area network IP address of the router (192.168.40.1), and translates a destination IP address in the second data packet from a wide area network IP address of the router (14.0.25.239) to an IP address of the host (192.168.40.2) if the second data packet is determined to be a DNS response packet.
In the above example, assuming that the network connection between the router and the DNS server changes, the IP address of the DNS server changes from 14.0.25.200 to 14.0.25.230. The source IP address in the second data packet sent to the host by the router is always the local area network IP address (192.168.40.1) of the router, and the destination IP address is always the IP address (192.168.40.2) of the host, so that the normal surfing of the host is not affected.
The present embodiment also provides a data transmission device 30 applied to a gateway device, as shown in fig. 3, including a first receiving module 31, a first converting module 32, a first transmitting module 33, a second receiving module 34, a second converting module 35, and a second transmitting module 36.
The first receiving module 31 is configured to receive a first data packet sent by a terminal device.
The first conversion module 32 is configured to, when it is determined that the first data packet is a DNS request packet and the destination IP address in the first data packet is the local area network IP address of the gateway device, convert the source IP address in the first data packet to the wide area network IP address of the gateway device, and convert the destination IP address in the first data packet to the IP address of the DNS server.
The first sending module 33 is configured to send the first data packet to the DNS server.
The second receiving module 34 is configured to receive a second data packet sent by the DNS server.
The second conversion module 35 is configured to, in a case where it is determined that the second data packet is a DNS response packet, convert a source IP address in the second data packet to a local area network IP address of the gateway device, and convert a destination IP address in the second data packet to an IP address of the terminal device.
The second sending module 36 is configured to send the second data packet to the terminal device.
In an optional implementation manner, the data transmission device further includes a first determining module, configured to determine whether the first data packet is a DNS request according to a destination port number in the first data packet.
In an optional implementation manner, the data transmission device further includes a second determining module, configured to determine whether the second data packet is a DNS response packet according to a source port number in the second data packet.
It should be noted that, the data transmission device in this embodiment may be a separate chip, a chip module or a terminal device, or may be a chip or a chip module integrated in the terminal device.
As for each module/unit included in the data transmission apparatus described in this embodiment, it may be a software module/unit, a hardware module/unit, or a software module/unit partially, a hardware module/unit partially.
Example 2
The present embodiment provides a gateway device comprising at least one processor, a memory communicatively coupled to the at least one processor, and a transceiver for communicating with other devices. Wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the data transmission method of embodiment 1.
Example 3
Fig. 4 is a flowchart of a data transmission method according to the present embodiment. The data transmission method provided in this embodiment may be performed by a data transmission device, where the data transmission device may be implemented by software and/or hardware, and the data transmission device may include part or all of a terminal device.
The data transmission method is described below in connection with a terminal device as an execution subject. As shown in fig. 4, the data transmission method provided in this embodiment may include the following steps S21 to S22:
step S21, a DNS request packet is sent to gateway equipment. The gateway device is provided in embodiment 2.
And step S22, receiving a DNS response packet sent by the gateway equipment.
The present embodiment also provides a data transmission device 50, as shown in fig. 5, including a sending module 51 and a receiving module 52. The sending module 51 is configured to send a DNS request packet to the gateway device. The gateway device is provided in embodiment 2. The receiving module 52 is configured to receive a DNS response packet sent by the gateway device.
It should be noted that, the data transmission device in this embodiment may be a separate chip, a chip module or a terminal device, or may be a chip or a chip module integrated in the terminal device.
As for each module/unit included in the data transmission apparatus described in this embodiment, it may be a software module/unit, a hardware module/unit, or a software module/unit partially, a hardware module/unit partially.
Example 4
Fig. 6 is a schematic structural diagram of a terminal device according to this embodiment. The terminal device includes at least one processor, a memory communicatively coupled to the at least one processor, and a transceiver for communicating with other devices. Wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the data transmission method of embodiment 3. The terminal device 3 shown in fig. 6 is only an example and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
The components of the terminal device 3 may include, but are not limited to: a transceiver, the at least one processor 4, the at least one memory 5, a bus 6 connecting the different system components, including the memory 5 and the processor 4.
The bus 6 includes a data bus, an address bus, and a control bus.
The memory 5 may include volatile memory such as Random Access Memory (RAM) 51 and/or cache memory 52, and may further include Read Only Memory (ROM) 53.
The memory 5 may also include a program/utility 55 having a set (at least one) of program modules 54, such program modules 54 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
The processor 4 executes various functional applications and data processing, such as the data transmission method in embodiment 3 of the present invention, by running a computer program stored in the memory 5.
The terminal device 3 may also communicate with one or more external devices 7, such as a keyboard, pointing device, etc. Such communication may be through an input/output (I/O) interface 8. And the terminal device 3 may also communicate with one or more networks through the network adapter 9. As shown in fig. 6, the network adapter 9 communicates with other modules of the terminal apparatus 3 via the bus 6. It should be appreciated that although not shown in fig. 6, other hardware and/or software modules may be used in connection with the terminal device 3, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, data backup storage systems, and the like.
It should be noted that although in the above detailed description several units/modules or sub-units/modules of a terminal device are mentioned, such a division is only exemplary and not mandatory. Indeed, the features and functionality of two or more units/modules described above may be embodied in one unit/module in accordance with embodiments of the present invention. Conversely, the features and functions of one unit/module described above may be further divided into ones that are embodied by a plurality of units/modules.
Example 5
As shown in fig. 7, the data transmission method provided in this embodiment may include the following steps S31 to S39:
step S31, the terminal equipment sends a first data packet to the gateway equipment.
Step S32, the gateway device judges whether the first data packet is a DNS request packet, and the destination IP address in the first data packet is the local area network IP address of the gateway device, if yes, step S33 is executed, and if not, the flow is ended.
Step S33, the gateway device converts the source IP address in the first data packet into a wide area network IP address of the gateway device, and converts the destination IP address in the first data packet into an IP address of the DNS server.
Step S34, the gateway equipment sends the first data packet to the DNS server.
Step S35, the DNS server inquires an IP address corresponding to the domain name according to the domain name in the DNS request packet, and encapsulates the IP address corresponding to the domain name into a second data packet.
Step S36, the DNS server sends the second data packet to gateway equipment.
Step S37, the gateway equipment judges whether the second data packet is a DNS response packet, if yes, step S38 is executed, and if not, the flow is ended.
Step S38, the gateway device converts the source IP address in the second data packet into the local area network IP address of the gateway device, and converts the destination IP address in the second data packet into the IP address of the terminal device.
And step S39, the gateway equipment sends the second data packet to the terminal equipment.
The present embodiment provides a data transmission system, as shown in fig. 8, including a terminal device, a gateway device, and a DNS server. The gateway device is the gateway device provided in embodiment 2, and the terminal device is the terminal device provided in embodiment 4. The DNS server is used for inquiring the IP address corresponding to the domain name according to the domain name in the DNS request packet, and packaging the IP address corresponding to the domain name into the DNS response packet.
Example 6
The present embodiment provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the data transmission method in embodiment 1 or 3.
More specifically, among others, readable storage media may be employed including, but not limited to: portable disk, hard disk, random access memory, read only memory, erasable programmable read only memory, optical storage device, magnetic storage device, or any suitable combination of the foregoing.
In a possible embodiment, the invention may also be implemented in the form of a program product comprising program code for causing a terminal device to carry out the data transmission method of embodiment 1 when said program product is run on the terminal device; the program code is for causing a network device to perform the data transmission method of embodiment 3 when the program product is run on the network device.
Wherein the program code for carrying out the invention may be written in any combination of one or more programming languages, such that the program code is executable entirely on the terminal device, partially on the terminal device, as a stand-alone software package, partially on the terminal device, partially on a remote device, or entirely on the remote device.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that this is by way of example only, and the scope of the invention is defined by the appended claims. Various changes and modifications to these embodiments may be made by those skilled in the art without departing from the principles and spirit of the invention, but such changes and modifications fall within the scope of the invention.

Claims (10)

1. A data transmission method, characterized in that it is applied in a gateway device, the data transmission method comprising the steps of:
receiving a first data packet sent by terminal equipment;
if the first data packet is determined to be a DNS request packet and the destination IP address in the first data packet is the local area network IP address of the gateway device, converting the source IP address in the first data packet into the wide area network IP address of the gateway device and converting the destination IP address in the first data packet into the IP address of a DNS server;
sending the first data packet to the DNS server;
receiving a second data packet sent by the DNS server;
if the second data packet is determined to be a DNS response packet, converting a source IP address in the second data packet into a local area network IP address of the gateway device, and converting a destination IP address in the second data packet into an IP address of the terminal device;
and sending the second data packet to the terminal equipment.
2. The data transmission method according to claim 1, wherein the data transmission method further comprises the steps of:
determining whether the first data packet is a DNS request packet according to a destination port number in the first data packet; and/or the number of the groups of groups,
and determining whether the second data packet is a DNS response packet according to the source port number in the second data packet.
3. A data transmission apparatus, for use in a gateway device, the data transmission apparatus comprising:
the first receiving module is used for receiving a first data packet sent by the terminal equipment;
a first conversion module, configured to, when it is determined that the first data packet is a DNS request packet and a destination IP address in the first data packet is a local area network IP address of the gateway device, convert a source IP address in the first data packet to a wide area network IP address of the gateway device, and convert the destination IP address in the first data packet to an IP address of a DNS server;
a first sending module, configured to send the first data packet to the DNS server;
the second receiving module is used for receiving a second data packet sent by the DNS server;
the second conversion module is used for converting a source IP address in the second data packet into a local area network IP address of the gateway equipment and converting a destination IP address in the second data packet into an IP address of the terminal equipment when the second data packet is determined to be a DNS response packet;
and the second sending module is used for sending the second data packet to the terminal equipment.
4. A data transmission device as claimed in claim 3, wherein the data transmission device further comprises:
a first determining module, configured to determine whether the first data packet is a DNS request packet according to a destination port number in the first data packet; and/or the number of the groups of groups,
and the second determining module is used for determining whether the second data packet is a DNS response packet according to the source port number in the second data packet.
5. A gateway device, comprising:
at least one processor;
a memory communicatively coupled to the at least one processor; and
a transceiver for communicating with other devices;
wherein the memory stores instructions executable by the at least one processor to enable the gateway device to perform the data transmission method of claim 1 or 2.
6. A data transmission method, comprising the steps of:
transmitting a DNS request packet to the gateway device according to claim 5;
and receiving a DNS response packet sent by the gateway equipment.
7. A data transmission apparatus, comprising:
a sending module, configured to send a DNS request packet to the gateway device according to claim 5;
and the receiving module is used for receiving the DNS response packet sent by the gateway equipment.
8. A terminal device, comprising:
at least one processor;
a memory communicatively coupled to the at least one processor; and
a transceiver for communicating with other devices;
wherein the memory stores instructions executable by the at least one processor to enable the terminal device to perform the data transmission method of claim 6.
9. A data transmission system comprising a DNS server, a gateway device according to claim 5 and a terminal device according to claim 8,
the DNS server is used for inquiring the IP address corresponding to the domain name according to the domain name in the DNS request packet, and packaging the IP address corresponding to the domain name into the DNS response packet.
10. A non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the data transmission method of any one of claims 1, 2, and 6.
CN202210236569.2A 2022-03-11 2022-03-11 Data transmission method, device and system, gateway equipment, terminal equipment and medium Active CN114615233B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210236569.2A CN114615233B (en) 2022-03-11 2022-03-11 Data transmission method, device and system, gateway equipment, terminal equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210236569.2A CN114615233B (en) 2022-03-11 2022-03-11 Data transmission method, device and system, gateway equipment, terminal equipment and medium

Publications (2)

Publication Number Publication Date
CN114615233A CN114615233A (en) 2022-06-10
CN114615233B true CN114615233B (en) 2023-08-04

Family

ID=81862519

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210236569.2A Active CN114615233B (en) 2022-03-11 2022-03-11 Data transmission method, device and system, gateway equipment, terminal equipment and medium

Country Status (1)

Country Link
CN (1) CN114615233B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103533103A (en) * 2013-10-31 2014-01-22 成都西加云杉科技有限公司 Communication method and device based on network address translation
CN105554179A (en) * 2016-01-08 2016-05-04 中国联合网络通信集团有限公司 DNS resolution method and system in local area network, Openflow switch and controller
CN106713524A (en) * 2016-12-28 2017-05-24 迈普通信技术股份有限公司 AP device, network address conversion method and communication system
CN111327720A (en) * 2020-02-21 2020-06-23 北京百度网讯科技有限公司 Network address conversion method, device, gateway equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6687245B2 (en) * 2001-04-03 2004-02-03 Voxpath Networks, Inc. System and method for performing IP telephony
WO2022005603A1 (en) * 2020-06-30 2022-01-06 Arris Enterprises Llc Method for providing multicast dns services across ip subnet boundaries

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103533103A (en) * 2013-10-31 2014-01-22 成都西加云杉科技有限公司 Communication method and device based on network address translation
CN105554179A (en) * 2016-01-08 2016-05-04 中国联合网络通信集团有限公司 DNS resolution method and system in local area network, Openflow switch and controller
CN106713524A (en) * 2016-12-28 2017-05-24 迈普通信技术股份有限公司 AP device, network address conversion method and communication system
CN111327720A (en) * 2020-02-21 2020-06-23 北京百度网讯科技有限公司 Network address conversion method, device, gateway equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"基于UDP/TCP协议的NAT穿越方案研究";蒙元胜;《中国优秀硕士学位论文全文数据库(电子期刊)信息科技辑》;全文 *

Also Published As

Publication number Publication date
CN114615233A (en) 2022-06-10

Similar Documents

Publication Publication Date Title
CN108449282B (en) Load balancing method and device
KR100322578B1 (en) Data communication device and method between WAP terminal and WAP server
US20130304866A1 (en) System and method of utilizing wireless usb device as local proxy for cloud storage
US8432877B2 (en) Routing control method and system
CN104969515A (en) Methods and gateways for processing DNS request
WO2020038443A1 (en) Bridging communication method and device
JP4475522B2 (en) Network address translation based mobility management
CN102801800A (en) Method and system for performing resource sharing processing among plurality of wireless terminals
US20060062176A1 (en) Mobile IP communication terminal, mobile IP communication method, and computer product
KR100425325B1 (en) Method for managing IP using NAT in mobile network and apparatus thereof
EP3086618A1 (en) Repeating method and corresponding communication network device, system, computer readable program product and computer readable storage medium
CN114615233B (en) Data transmission method, device and system, gateway equipment, terminal equipment and medium
CN107078941B (en) Method for transmitting IP data packet to IP address, processing device and mobile equipment
US20010014092A1 (en) Packet communication method, node apparatus and packet communication system
CN115225606B (en) Domain name access method and system of cross-network protocol of container cloud platform
KR20170025550A (en) Gateway and control method thereof
WO2021177243A1 (en) Communication device, program, communication method, information processing method, information processing device, and communication system
CN115002069A (en) Port mapping method and device, electronic equipment and storage medium
CN113630298A (en) Intelligent control system, method and device
JP5708288B2 (en) Satellite communication method, control station and earth station
CN112653627B (en) Data transmission method, device and system, computer equipment and computer readable storage medium
CN114650271B (en) Global load DNS neighbor site learning method and device
CN108710529A (en) A kind of remote task processing method, system and wireless router
CN117336136A (en) Remote Web management equipment method and related device
CN116634033A (en) Data transmission method, data transmission device, equipment 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