CN104601742A - Message transmission method and device - Google Patents

Message transmission method and device Download PDF

Info

Publication number
CN104601742A
CN104601742A CN201410840889.4A CN201410840889A CN104601742A CN 104601742 A CN104601742 A CN 104601742A CN 201410840889 A CN201410840889 A CN 201410840889A CN 104601742 A CN104601742 A CN 104601742A
Authority
CN
China
Prior art keywords
address
service server
temporary
mapping relations
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.)
Granted
Application number
CN201410840889.4A
Other languages
Chinese (zh)
Other versions
CN104601742B (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.)
Hangzhou H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies 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 Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201410840889.4A priority Critical patent/CN104601742B/en
Publication of CN104601742A publication Critical patent/CN104601742A/en
Application granted granted Critical
Publication of CN104601742B publication Critical patent/CN104601742B/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/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
    • 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/255Maintenance or indexing of mapping tables
    • H04L61/2553Binding renewal aspects, e.g. using keep-alive messages

Landscapes

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

Abstract

The invention discloses message transmission method and device. The method comprises the steps of receiving a DNS request message from a terminal device through an NAT device and transferring to a DNS server; receiving a DNS response message by the NAT device from the DNS server, wherein the DNS response message carries the domain name information and actual IP address of a service server; building a second mapping relation between the actual PI address and the temporary IP address of the service server by the NAT device according to the first mapping relation between the domain name information and the temporary IP address of the service server; receiving the service message from the terminal device and the service server by the NAT device; converting the IP address of the service server in the service message according to the second mapping relationship. With the adoption of the method, the actual IP address of the service server is not needed to be known in advance, so that the processing process is simple.

Description

A kind of method and apparatus of message transmissions
Technical field
The present invention relates to communication technical field, especially relate to a kind of method and apparatus of message transmissions.
Background technology
Along with the fast development of Internet service, having occurred multistage operator run in grades business in a network, as shown in Figure 1, is the networking schematic diagram of multistage operator run in grades business.When the business that second-level runner rents one-level operator provides service for user, do not wish that user directly knows the IP address of the service server of one-level operator, wish that the IP address of the service server to one-level operator hides.Based on this, need NAT (the Network Address Translation at second-level runner, network address translation) equipment configures two-way NAT switch technology, this two-way NAT switch technology is used for the source IP address of message and object IP address to change simultaneously, realize the object being carried out the IP address of service server hiding, and make the user of second-level runner directly cannot know the IP address of the service server of one-level operator.
In prior art, in order to realize two-way NAT switch technology on NAT device, need the IP address of service server and the mapping relations of temporary ip address to be configured in overlapping address pond.Based on this, need the IP address knowing service server in advance, namely need the IP address obtaining a large number of services server in advance with the mapping relations of the IP address and temporary ip address of setting up service server, processing procedure is loaded down with trivial details.
Summary of the invention
The embodiment of the present invention provides a kind of method of message transmissions, be applied to the system comprising one-level carrier network and second-level runner network, one-level carrier network comprises service server and domain name system DNS server, second-level runner network packet includes network address transition NAT device and terminal equipment, described method comprises: described NAT device receives and forwards the DNS request message from terminal equipment to dns server;
Described NAT device receives the DNS response message from described dns server, carries domain-name information and the real ip address of described service server in described DNS response message;
Described NAT device, according to the first mapping relations between domain-name information and the temporary ip address of service server, sets up the second mapping relations between the real ip address of service server and described temporary ip address;
Described NAT device receives the service message between described terminal equipment and described service server, and changes according to the IP address of described second mapping relations to the service server in described service message.
Described NAT device receives and forwards the process from the DNS request message of terminal equipment to dns server, specifically comprises: described NAT device receives the DNS request message from described terminal equipment;
Described NAT device judges whether this NAT device have recorded the first mapping relations between the domain-name information of the service server carried in described DNS request message and temporary ip address;
If not, then described NAT device obtains the domain-name information of described service server from described DNS request message, domain-name information for described service server distributes a temporary ip address, and sets up the first mapping relations between domain name information and the described temporary ip address of current distribution;
Described DNS request message is sent to described dns server by described NAT device.
Described NAT device, according to the first mapping relations between domain-name information and the temporary ip address of service server, is set up the process of the second mapping relations between the real ip address of service server and described temporary ip address, is specifically comprised:
Described NAT device obtains domain-name information and the real ip address of described service server from DNS response message;
Described NAT device, by the first mapping relations described in the dns query message of described service server, obtains the temporary ip address that the domain-name information of described service server is corresponding;
Described NAT device sets up the second mapping relations between the real ip address of described service server and described temporary ip address;
Described NAT device utilizes the second mapping relations between the real ip address of service server and described temporary ip address, the real ip address of the service server in described DNS response message is revised as described temporary ip address, and the DNS response message carrying described temporary ip address is sent to terminal equipment.
Described NAT device is changed according to the IP address of described second mapping relations to the service server in described service message, specifically comprises:
When the described NAT device object IP address received from described terminal equipment is the first service message of temporary ip address, utilize described second mapping relations, the object IP address of described first service message is revised as the real ip address of described service server corresponding to described temporary ip address;
When the described NAT device source IP address received from described service server is the second service message of the real ip address of described service server, utilize described second mapping relations, the source IP address of described second service message is revised as the temporary ip address that the real ip address of described service server is corresponding.
Described method comprises further:
When described NAT device receives the DNS response message from described dns server, if carry the real ip address after the change of described service server in described DNS response message, then described NAT device is according to the domain-name information carried in described DNS response message and described first mapping relations, obtains the temporary ip address that the domain-name information of described service server is corresponding;
Described NAT device sets up the second mapping relations between the real ip address after the change of described service server and described temporary ip address, and the second mapping relations between the real ip address deleted before the change of described service server and described temporary ip address.
The embodiment of the present invention provides a kind of network address translation device, be applied to the system comprising one-level carrier network and second-level runner network, one-level carrier network comprises service server and domain name system DNS server, second-level runner network comprises NAT device and terminal equipment, described NAT device comprises: communication module, for receiving and forwarding the DNS request message from described terminal equipment to described dns server; Receive the DNS response message from described dns server, in described DNS response message, carry domain-name information and the real ip address of described service server;
Set up module, for according to the first mapping relations between domain-name information and the temporary ip address of service server, set up the second mapping relations between the real ip address of service server and temporary ip address;
Processing module, for receiving the service message between described terminal equipment and described service server, changes according to the IP address of described second mapping relations to the service server in described service message.
Described communication module, specifically for when receiving and forward the DNS request message from described terminal equipment to described dns server, receives the DNS request message from described terminal equipment; Judge whether described NAT device have recorded the first mapping relations between the domain-name information of the service server carried in described DNS request message and temporary ip address; If not, from described DNS request message, then obtain the domain-name information of described service server, domain-name information for described service server distributes a temporary ip address, and sets up the first mapping relations between domain name information and the described temporary ip address of current distribution; Described DNS request message is sent to described dns server.
Describedly set up module, specifically for obtaining domain-name information and the real ip address of described service server from described DNS response message; By the first mapping relations described in the dns query message of described service server, obtain the temporary ip address that the domain-name information of described service server is corresponding; Set up the second mapping relations between the real ip address of described service server and described temporary ip address; Utilize the second mapping relations between the real ip address of service server and described temporary ip address, the real ip address of the service server in described DNS response message is revised as described temporary ip address, and the DNS response message carrying described temporary ip address is sent to terminal equipment.
Described processing module, specifically for when to receive the object IP address from described terminal equipment be the first service message of temporary ip address, utilize described second mapping relations, the object IP address of described first service message is revised as the real ip address of described service server corresponding to described temporary ip address;
When to receive the source IP address from described service server be the second service message of the real ip address of described service server, utilize described second mapping relations, the source IP address of described second service message is revised as the temporary ip address that the real ip address of described service server is corresponding.
Describedly set up module, when being further used for receiving the DNS response message from described dns server, if carry the real ip address after the change of described service server in described DNS response message, then according to the domain-name information carried in described DNS response message and described first mapping relations, obtain the temporary ip address that the domain-name information of described service server is corresponding; Set up the second mapping relations between the real ip address after the change of described service server and described temporary ip address, and the second mapping relations between the real ip address deleted before the change of described service server and described temporary ip address.
Based on technique scheme, in the embodiment of the present invention, by the first mapping relations between the domain-name information of maintenance service server and the temporary ip address of service server, and based on the first mapping relations between domain-name information and temporary ip address, set up the second mapping relations between the real ip address of service server and temporary ip address, thus two-way NAT switch technology can be realized on NAT device, and do not need the real ip address knowing service server in advance, namely do not need the real ip address obtaining a large number of services server in advance with the mapping relations of the real ip address and temporary ip address of setting up service server, processing procedure is simple.
Accompanying drawing explanation
Fig. 1 is the networking schematic diagram of the multistage operator run in grades business proposed in prior art;
Fig. 2 is the method flow schematic diagram of a kind of message transmissions proposed in the embodiment of the present invention;
Fig. 3 is the structural representation of a kind of NAT device proposed in the embodiment of the present invention.
Embodiment
For problems of the prior art, embodiments provide a kind of method of message transmissions, the method is applied in the system comprising one-level carrier network and second-level runner network.Wherein, this one-level carrier network can comprise service server and DNS (Domain Name System, domain name system) server.This second-level runner network can comprise NAT device and terminal equipment.Under above-mentioned application scenarios, as shown in Figure 2, the method for this message transmissions specifically can comprise the following steps:
Step 201, NAT device receives and forwards the DNS request message from terminal equipment to dns server.
Step 202, NAT device receives the DNS response message from dns server.The domain-name information of service server and the real ip address of service server is at least carried in this DNS response message.
Step 203, NAT device, according to the first mapping relations between domain-name information and the temporary ip address of service server, sets up the second mapping relations between the real ip address of service server and temporary ip address.In actual applications, first mapping relations and the second mapping relations can be stored in mapping relations table by NAT device, and the first mapping relations and the second mapping relations can be stored in identical mapping relations table, also can be stored in different mapping relations tables.For convenience of description, in the embodiment of the present invention, with NAT device by the first mapping relations between the domain-name information of the first mapping relations table storage service server and the temporary ip address of service server, and be that example is described by the second mapping relations between the real ip address of the second mapping relations table storage service server and temporary ip address.
In the embodiment of the present invention, in order to realize said process, NAT device needs the first mapping relations between the domain-name information of maintenance service server and the temporary ip address of service server.Further, the process of the first mapping relations between the domain-name information and the temporary ip address of service server of NAT device maintenance service server, specifically includes but not limited to as under type:
Mode one, the first mapping relations in the first mapping relations table of NAT device between the domain-name information (as www.web.com) of pre-configured service server and the temporary ip address of service server.
In this mode, second-level runner only needs the domain-name information knowing service server in advance, just can the first mapping relations on NAT device between the domain-name information of configuration service server and the temporary ip address of service server, this temporary ip address is that second-level runner is selected arbitrarily according to actual needs, if temporary ip address can be 3.0.0.1.Based on the configuration of second-level runner, then can the first mapping relations in the first mapping relations table between the domain-name information of maintenance service server and the temporary ip address of service server, as set up the first mapping relations between www.web.com and 3.0.0.1 in the first mapping relations table.
Mode two, NAT device receive from terminal equipment carry the DNS request message of the domain-name information of service server time, judge further the first mapping relations that whether this NAT device have recorded between the domain-name information of service server and temporary ip address.If not, then NAT device is that the domain-name information of service server distributes a temporary ip address, and sets up the first mapping relations between the domain-name information of service server and the temporary ip address of current distribution.If so, then illustrate that NAT device has established the first mapping relations between the domain-name information of service server and temporary ip address, now NAT device no longer sets up the first mapping relations between the domain-name information of service server and temporary ip address.
In the embodiment of the present invention, be described in mode two.Based on this, NAT device receives and forwards the process from the DNS request message of terminal equipment to dns server, specifically includes but not limited to: NAT device receives the DNS request message from terminal equipment.NAT device judges whether this NAT device have recorded the first mapping relations between the domain-name information of the service server carried in this DNS request message and temporary ip address.If not, then NAT device obtains the domain-name information of service server from DNS request message, domain-name information for this service server distributes a temporary ip address, and the first mapping relations between the temporary ip address setting up this domain-name information and current distribution, and DNS request message is sent to dns server.If so, then DNS request message is directly sent to dns server by NAT device.Afterwards, NAT device receives the DNS response message from dns server; The domain-name information of service server and the real ip address of service server is carried in this DNS response message.
In the embodiment of the present invention, NAT device is according to the first mapping relations between domain-name information and the temporary ip address of service server, set up the process of the second mapping relations between the real ip address of service server and temporary ip address, specifically include but not limited to: NAT device obtains domain-name information and the real ip address of service server from DNS response message; NAT device, by dns query message first mapping relations of service server, obtains the temporary ip address that the domain-name information of service server is corresponding; Afterwards, NAT device sets up the second mapping relations between the real ip address of service server and temporary ip address.Afterwards, NAT device also utilizes the second mapping relations between the real ip address of service server and temporary ip address, the real ip address of the service server carried in this DNS response message is revised as corresponding temporary ip address, and the DNS response message carrying this temporary ip address is sent to terminal equipment.
Further, based on DNS response message, terminal equipment, when sending service message to service server, will send the service message that object IP address is this temporary ip address to service server.For convenience of description, in subsequent descriptions, sent to by terminal equipment the service message of service server to be called the first service message, sent to by service server the service message of terminal equipment to be called the second service message.
Step 204, the service message between NAT device receiving terminal apparatus and service server, and change according to the IP address of the second mapping relations to the service server in service message.
In the embodiment of the present invention, service message between NAT device receiving terminal apparatus and service server, and according to the process that the IP address of the second mapping relations to the service server in service message is changed, specifically include but not limited to as under type: when the NAT device object IP address received from terminal equipment is the first service message of temporary ip address, utilize the second mapping relations between the real ip address of service server and temporary ip address, the object IP address of this first service message is revised as the real ip address of service server corresponding to temporary ip address, and utilize the mapping relations between public network IP address and private network IP address recorded in nat translation table, the source IP address of this first service message is revised as public network IP address corresponding to private network IP address, and amended first service message is sent to service server.Further, when the NAT device source IP address received from service server is the second service message of the real ip address of service server, utilize the second mapping relations between the real ip address of service server and temporary ip address, the source IP address of this second service message is revised as the temporary ip address that the real ip address of service server is corresponding, and utilize the mapping relations between public network IP address and private network IP address recorded in nat translation table, private network IP address corresponding to public network IP address is revised as in the object IP address of this second service message, and amended second service message is sent to terminal equipment.
Wherein, NAT device utilizes the mapping relations between public network IP address and private network IP address recorded in nat translation table, the source IP address of this first service message is revised as the process of public network IP address corresponding to private network IP address, NAT device utilizes the mapping relations between public network IP address and private network IP address recorded in nat translation table, the object IP address of this second service message is revised as the process of private network IP address corresponding to public network IP address, identical with existing NAT transfer process, repeat no longer in detail at this.
Below in conjunction with concrete application scenarios, said process is described in detail.
Terminal equipment, when needs access service server, directly uses domain-name information (www.web.com) access service server, and sends DNS request message to NAT device.Wherein, the domain-name information (www.web.com) of service server is carried in this DNS request message.NAT device is after receiving DNS request message, suppose current the first mapping relations do not recorded between domain-name information (www.web.com) and temporary ip address in the first mapping relations table, then NAT device also needs for this domain-name information (www.web.com) distributes a temporary ip address (3.0.0.1), and in the first mapping relations table, record the first mapping relations between domain-name information (www.web.com) and temporary ip address (3.0.0.1).
DNS request message, after receiving DNS request message, is sent to dns server by NAT device.Dns server is after receiving DNS request message, obtain the real ip address (being assumed to be 202.120.10.2) of service server corresponding to domain-name information (www.web.com), and return DNS response message to NAT device, carry the domain-name information (www.web.com) of service server and the real ip address (202.120.10.2) of this service server in this DNS response message.NAT device is after receiving DNS response message, the real ip address (202.120.10.2) of service server corresponding to domain-name information (www.web.com) is obtained from DNS response message, and obtain temporary ip address (3.0.0.1) corresponding to domain-name information (www.web.com) from the first mapping relations table, and the second mapping relations in the second mapping relations table between the real ip address (202.120.10.2) of record traffic server and temporary ip address (3.0.0.1).
NAT device is after receiving DNS response message, also need the real ip address of the service server carried in DNS response message (202.120.10.2) to be revised as corresponding temporary ip address (3.0.0.1), and the DNS response message carrying this temporary ip address (3.0.0.1) is sent to terminal equipment.Based on this, terminal equipment is when needs send the first service message to the service server that domain-name information is www.web.com, and the object IP address of this first service message is the temporary ip address (3.0.0.1) of this service server.
NAT device is when receiving object IP address and being the first service message of temporary ip address (3.0.0.1), owing to have recorded the second mapping relations between the real ip address (202.120.10.2) of service server and temporary ip address (3.0.0.1) in the second mapping relations table, therefore NAT device obtains the real ip address (202.120.10.2) of service server corresponding to temporary ip address (3.0.0.1) from the second mapping relations table, the object IP address of the first service message is revised as the real ip address (202.120.10.2) of service server, and the first service message is sent to service server.In addition, NAT device also needs the source IP address of the first service message to be revised as public network address by private net address, and this NAT transfer process does not repeat them here.
NAT device is when receiving the second service message (response message of the first service message) of the real ip address (202.120.10.2) that source IP address is service server, owing to have recorded the second mapping relations between the real ip address (202.120.10.2) of service server and temporary ip address (3.0.0.1) in the second mapping relations table, therefore, NAT device obtains the temporary ip address (3.0.0.1) of real ip address (202.120.10.2) correspondence of service server from the second mapping relations table, and the source IP address of the second service message is revised as temporary ip address (3.0.0.1), and the second service message is sent to terminal equipment.In addition, NAT device also needs the object IP address of the second service message to be revised as private net address by public network address, and this NAT conversion repeats no longer in detail at this.
In the embodiment of the present invention, when NAT device receives the DNS response message from dns server, if carry the real ip address after the change of service server in DNS response message, then NAT device is according to the domain-name information carried in DNS response message and the first mapping relations, obtains the temporary ip address that the domain-name information of service server is corresponding; Further, NAT device sets up the second mapping relations between the real ip address after the change of service server and temporary ip address, and the second mapping relations between the real ip address deleted before the change of service server and temporary ip address.
Such as, when the real ip address of service server is changed to 202.120.10.3 by 202.120.10.2, based on the DNS request process of terminal equipment, real ip address (202.120.10.3) after NAT device can utilize the domain-name information of this service server (www.web.com) to obtain the change of service server, and real ip address (202.120.10.3) after the change of final record traffic server in the second mapping relations table and the second mapping relations between temporary ip address (3.0.0.1), and the second mapping relations between the real ip address (202.120.10.2) deleted before the change of the service server recorded in the second mapping relations table and temporary ip address (3.0.0.1).In above process, the first mapping relations between www.web.com and 3.0.0.1 in first mapping relations table can not change, without the need to the first mapping relations between this www.web.com and 3.0.0.1 of manual change, just in the process of terminal equipment access service server, the second mapping relations between real ip address (202.120.10.3) after change and temporary ip address (3.0.0.1) are learnt in the second mapping relations table, thus can the real ip address of Dynamic Acquisition service server.
Based on technique scheme, in the embodiment of the present invention, by setting up the first mapping relations between the domain-name information of service server and the temporary ip address of service server, and based on the first mapping relations between domain-name information and temporary ip address, set up the second mapping relations between the real ip address of service server and temporary ip address, thus two-way NAT switch technology can be realized on NAT device, and do not need the real ip address knowing service server in advance, namely do not need the real ip address obtaining a large number of services server in advance with the mapping relations of the real ip address and temporary ip address of setting up service server, processing procedure is simple.
Based on the inventive concept same with said method, a kind of network address translation device is additionally provided in the embodiment of the present invention, be applied to the system comprising one-level carrier network and second-level runner network, one-level carrier network comprises service server and domain name system DNS server, second-level runner network comprises NAT device and terminal equipment, as shown in Figure 3, described NAT device specifically comprises:
Communication module 11, for receiving and forwarding the DNS request message from described terminal equipment to described dns server; Receive the DNS response message from described dns server, in described DNS response message, carry domain-name information and the real ip address of described service server;
Set up module 12, for according to the first mapping relations between domain-name information and the temporary ip address of service server, set up the second mapping relations between the real ip address of service server and temporary ip address;
Processing module 13, for receiving the service message between described terminal equipment and described service server, changes according to the IP address of described second mapping relations to the service server in described service message.
Described communication module 11, specifically for when receiving and forward the DNS request message from described terminal equipment to described dns server, receives the DNS request message from described terminal equipment; Judge whether described NAT device have recorded the first mapping relations between the domain-name information of the service server carried in described DNS request message and temporary ip address; If not, from described DNS request message, then obtain the domain-name information of described service server, domain-name information for described service server distributes a temporary ip address, and sets up the first mapping relations between domain name information and the described temporary ip address of current distribution; Described DNS request message is sent to described dns server.
Describedly set up module 12, specifically for obtaining domain-name information and the real ip address of described service server from described DNS response message; By the first mapping relations described in the dns query message of described service server, obtain the temporary ip address that the domain-name information of described service server is corresponding; Set up the second mapping relations between the real ip address of described service server and described temporary ip address; Utilize the second mapping relations between the real ip address of service server and described temporary ip address, the real ip address of the service server in described DNS response message is revised as described temporary ip address, and the DNS response message carrying described temporary ip address is sent to terminal equipment.
Described processing module 13, specifically for when to receive the object IP address from described terminal equipment be the first service message of temporary ip address, utilize described second mapping relations, the object IP address of described first service message is revised as the real ip address of described service server corresponding to described temporary ip address; When to receive the source IP address from described service server be the second service message of the real ip address of described service server, utilize described second mapping relations, the source IP address of described second service message is revised as the temporary ip address that the real ip address of described service server is corresponding.
Describedly set up module 12, when being further used for receiving the DNS response message from described dns server, if carry the real ip address after the change of described service server in described DNS response message, then according to the domain-name information carried in described DNS response message and described first mapping relations, obtain the temporary ip address that the domain-name information of described service server is corresponding; Set up the second mapping relations between the real ip address after the change of described service server and described temporary ip address, and the second mapping relations between the real ip address deleted before the change of described service server and described temporary ip address.
Wherein, the modules of apparatus of the present invention can be integrated in one, and also can be separated deployment.Above-mentioned module can merge into a module, also can split into multiple submodule further.
Through the above description of the embodiments, those skilled in the art can be well understood to the mode that the present invention can add required general hardware platform by software and realize, and can certainly pass through hardware, but in a lot of situation, the former is better execution mode.Based on such understanding, technical scheme of the present invention can embody with the form of software product the part that prior art contributes in essence in other words, this computer software product is stored in a storage medium, comprising some instructions in order to make a computer equipment (can be personal computer, server, or the network equipment etc.) perform method described in each embodiment of the present invention.It will be appreciated by those skilled in the art that accompanying drawing is the schematic diagram of a preferred embodiment, the module in accompanying drawing or flow process might not be that enforcement the present invention is necessary.It will be appreciated by those skilled in the art that the module in the device in embodiment can carry out being distributed in the device of embodiment according to embodiment description, also can carry out respective change and be arranged in the one or more devices being different from the present embodiment.The module of above-described embodiment can merge into a module, also can split into multiple submodule further.The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.Be only several specific embodiment of the present invention above, but the present invention is not limited thereto, the changes that any person skilled in the art can think of all should fall into protection scope of the present invention.

Claims (10)

1. the method for a message transmissions, be applied to the system comprising one-level carrier network and second-level runner network, one-level carrier network comprises service server and domain name system DNS server, second-level runner network packet includes network address transition NAT device and terminal equipment, it is characterized in that, described method comprises:
Described NAT device receives and forwards the DNS request message from terminal equipment to dns server;
Described NAT device receives the DNS response message from described dns server, carries domain-name information and the real ip address of described service server in described DNS response message;
Described NAT device, according to the first mapping relations between domain-name information and the temporary ip address of service server, sets up the second mapping relations between the real ip address of service server and described temporary ip address;
Described NAT device receives the service message between described terminal equipment and described service server, and changes according to the IP address of described second mapping relations to the service server in described service message.
2. the method for claim 1, is characterized in that, described NAT device receives and forwards the process from the DNS request message of terminal equipment to dns server, specifically comprises:
Described NAT device receives the DNS request message from described terminal equipment;
Described NAT device judges whether this NAT device have recorded the first mapping relations between the domain-name information of the service server carried in described DNS request message and temporary ip address;
If not, then described NAT device obtains the domain-name information of described service server from described DNS request message, domain-name information for described service server distributes a temporary ip address, and sets up the first mapping relations between domain name information and the described temporary ip address of current distribution;
Described DNS request message is sent to described dns server by described NAT device.
3. method as claimed in claim 1 or 2, it is characterized in that, described NAT device is according to the first mapping relations between domain-name information and the temporary ip address of service server, set up the process of the second mapping relations between the real ip address of service server and described temporary ip address, specifically comprise:
Described NAT device obtains domain-name information and the real ip address of described service server from DNS response message;
Described NAT device, by the first mapping relations described in the dns query message of described service server, obtains the temporary ip address that the domain-name information of described service server is corresponding;
Described NAT device sets up the second mapping relations between the real ip address of described service server and described temporary ip address;
Described NAT device utilizes the second mapping relations between the real ip address of service server and described temporary ip address, the real ip address of the service server in described DNS response message is revised as described temporary ip address, and the DNS response message carrying described temporary ip address is sent to terminal equipment.
4. the method for claim 1, is characterized in that, described NAT device is changed according to the IP address of described second mapping relations to the service server in described service message, specifically comprises:
When the described NAT device object IP address received from described terminal equipment is the first service message of temporary ip address, utilize described second mapping relations, the object IP address of described first service message is revised as the real ip address of described service server corresponding to described temporary ip address;
When the described NAT device source IP address received from described service server is the second service message of the real ip address of described service server, utilize described second mapping relations, the source IP address of described second service message is revised as the temporary ip address that the real ip address of described service server is corresponding.
5. the method for claim 1, is characterized in that, described method comprises further:
When described NAT device receives the DNS response message from described dns server, if carry the real ip address after the change of described service server in described DNS response message, then described NAT device is according to the domain-name information carried in described DNS response message and described first mapping relations, obtains the temporary ip address that the domain-name information of described service server is corresponding;
Described NAT device sets up the second mapping relations between the real ip address after the change of described service server and described temporary ip address, and the second mapping relations between the real ip address deleted before the change of described service server and described temporary ip address.
6. a network address translation device, be applied to the system comprising one-level carrier network and second-level runner network, one-level carrier network comprises service server and domain name system DNS server, second-level runner network comprises NAT device and terminal equipment, it is characterized in that, described NAT device comprises:
Communication module, for receiving and forwarding the DNS request message from described terminal equipment to described dns server; Receive the DNS response message from described dns server, in described DNS response message, carry domain-name information and the real ip address of described service server;
Set up module, for according to the first mapping relations between domain-name information and the temporary ip address of service server, set up the second mapping relations between the real ip address of service server and temporary ip address;
Processing module, for receiving the service message between described terminal equipment and described service server, changes according to the IP address of described second mapping relations to the service server in described service message.
7. NAT device as claimed in claim 6, is characterized in that,
Described communication module, specifically for when receiving and forward the DNS request message from described terminal equipment to described dns server, receives the DNS request message from described terminal equipment; Judge whether described NAT device have recorded the first mapping relations between the domain-name information of the service server carried in described DNS request message and temporary ip address; If not, from described DNS request message, then obtain the domain-name information of described service server, domain-name information for described service server distributes a temporary ip address, and sets up the first mapping relations between domain name information and the described temporary ip address of current distribution; Described DNS request message is sent to described dns server.
8. NAT device as claimed in claims 6 or 7, is characterized in that,
Describedly set up module, specifically for obtaining domain-name information and the real ip address of described service server from described DNS response message; By the first mapping relations described in the dns query message of described service server, obtain the temporary ip address that the domain-name information of described service server is corresponding; Set up the second mapping relations between the real ip address of described service server and described temporary ip address; Utilize the second mapping relations between the real ip address of service server and described temporary ip address, the real ip address of the service server in described DNS response message is revised as described temporary ip address, and the DNS response message carrying described temporary ip address is sent to terminal equipment.
9. NAT device as claimed in claim 6, is characterized in that,
Described processing module, specifically for when to receive the object IP address from described terminal equipment be the first service message of temporary ip address, utilize described second mapping relations, the object IP address of described first service message is revised as the real ip address of described service server corresponding to described temporary ip address;
When to receive the source IP address from described service server be the second service message of the real ip address of described service server, utilize described second mapping relations, the source IP address of described second service message is revised as the temporary ip address that the real ip address of described service server is corresponding.
10. NAT device as claimed in claim 6, is characterized in that,
Describedly set up module, when being further used for receiving the DNS response message from described dns server, if carry the real ip address after the change of described service server in described DNS response message, then according to the domain-name information carried in described DNS response message and described first mapping relations, obtain the temporary ip address that the domain-name information of described service server is corresponding; Set up the second mapping relations between the real ip address after the change of described service server and described temporary ip address, and the second mapping relations between the real ip address deleted before the change of described service server and described temporary ip address.
CN201410840889.4A 2014-12-29 2014-12-29 A kind of method and apparatus of message transmissions Active CN104601742B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410840889.4A CN104601742B (en) 2014-12-29 2014-12-29 A kind of method and apparatus of message transmissions

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410840889.4A CN104601742B (en) 2014-12-29 2014-12-29 A kind of method and apparatus of message transmissions

Publications (2)

Publication Number Publication Date
CN104601742A true CN104601742A (en) 2015-05-06
CN104601742B CN104601742B (en) 2018-02-09

Family

ID=53127234

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410840889.4A Active CN104601742B (en) 2014-12-29 2014-12-29 A kind of method and apparatus of message transmissions

Country Status (1)

Country Link
CN (1) CN104601742B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106411742A (en) * 2016-10-26 2017-02-15 杭州数梦工场科技有限公司 Message transmission method and device
CN107154927A (en) * 2017-03-28 2017-09-12 北京安博通科技股份有限公司 Message processing method and device
CN107517488A (en) * 2016-06-15 2017-12-26 华为技术有限公司 The method and apparatus of Message processing
CN108173768A (en) * 2016-12-07 2018-06-15 北京京东尚科信息技术有限公司 For in method and apparatus of the gateway based on gateway configuration route service
CN109495570A (en) * 2018-11-20 2019-03-19 锐捷网络股份有限公司 Sample retransmission method, device and the data center of message
CN109510882A (en) * 2018-11-19 2019-03-22 网易(杭州)网络有限公司 Communication means, device, storage medium and electronic device between game client
CN113194076A (en) * 2021-04-16 2021-07-30 中盈优创资讯科技有限公司 Safety controller and implementation method thereof
CN114257651A (en) * 2021-12-09 2022-03-29 山石网科通信技术股份有限公司 Request response method, device, network equipment and computer readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101043447A (en) * 2007-04-23 2007-09-26 重庆大学 Method for mapping dynamically inside and outside network of server based on DDNS and NAT
US7818454B2 (en) * 2005-09-15 2010-10-19 Hostway Corporation Host migration system
CN103369065A (en) * 2013-07-05 2013-10-23 杭州华三通信技术有限公司 Massage forwarding method and equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7818454B2 (en) * 2005-09-15 2010-10-19 Hostway Corporation Host migration system
CN101043447A (en) * 2007-04-23 2007-09-26 重庆大学 Method for mapping dynamically inside and outside network of server based on DDNS and NAT
CN103369065A (en) * 2013-07-05 2013-10-23 杭州华三通信技术有限公司 Massage forwarding method and equipment

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11343192B2 (en) 2016-06-15 2022-05-24 Huawei Technologies Co., Ltd. Packet processing method, and device
CN107517488A (en) * 2016-06-15 2017-12-26 华为技术有限公司 The method and apparatus of Message processing
CN107517488B (en) * 2016-06-15 2020-10-23 华为技术有限公司 Message processing method and device
CN106411742B (en) * 2016-10-26 2019-08-16 杭州数梦工场科技有限公司 A kind of method and apparatus of message transmissions
CN106411742A (en) * 2016-10-26 2017-02-15 杭州数梦工场科技有限公司 Message transmission method and device
CN108173768A (en) * 2016-12-07 2018-06-15 北京京东尚科信息技术有限公司 For in method and apparatus of the gateway based on gateway configuration route service
CN107154927A (en) * 2017-03-28 2017-09-12 北京安博通科技股份有限公司 Message processing method and device
CN109510882A (en) * 2018-11-19 2019-03-22 网易(杭州)网络有限公司 Communication means, device, storage medium and electronic device between game client
CN109510882B (en) * 2018-11-19 2022-05-03 网易(杭州)网络有限公司 Communication method and device between game clients, storage medium and electronic device
CN109495570A (en) * 2018-11-20 2019-03-19 锐捷网络股份有限公司 Sample retransmission method, device and the data center of message
CN109495570B (en) * 2018-11-20 2022-04-26 锐捷网络股份有限公司 Method and device for forwarding sampling message and data center
CN113194076A (en) * 2021-04-16 2021-07-30 中盈优创资讯科技有限公司 Safety controller and implementation method thereof
CN114257651A (en) * 2021-12-09 2022-03-29 山石网科通信技术股份有限公司 Request response method, device, network equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN104601742B (en) 2018-02-09

Similar Documents

Publication Publication Date Title
CN104601742A (en) Message transmission method and device
CN102845123B (en) Virtual private cloud connection method and tunnel proxy server
CN103108089B (en) Connection establishment management method of network system and related system thereof
CN103401800B (en) A kind of balancing link load method and apparatus
CN102611763A (en) DNS (Domain Name Server) inquiring method and equipment
CN103650424A (en) Implementation method and server of home gateway service function
PE20060091A1 (en) WIRELESS TELECOMMUNICATION DEVICE AND METHOD TO GENERATE A DOMAIN IDENTIFIER FROM THE IDENTIFIER OF THE WIRELESS TELECOMMUNICATION NETWORK OF OTHER COMMUNICATION DEVICES
CN103346970B (en) A kind of SpaceWire dynamic routing implementation method
CN102185766A (en) Unicast forwarding method and forwarding equipment for responding messages by DHCP (Dynamic host configuration protocol) server
CN103414798B (en) The communication means of address transition Network Based, equipment and system
CN104994022A (en) Message transmission method and service board
CN105376347A (en) IP address allocation method and system
CN101860856A (en) Method and equipment for providing differentiated service in wireless local area network
CN103618801A (en) Method, device and system for sharing P2P (Peer-to-Peer) resources
CN104022936A (en) Method and device for establishing tunnel
CN102404193B (en) Method and edge device capable of generating forward list item, forwarding message and obtaining address
CN102546407A (en) Message sending method and device
CN102594839B (en) Method for distinguishing pseudo dynamic host configuration protocol (DHCP) servers and switchboards
CN103503413A (en) Method and device for transmitting network information
CN104079682A (en) Address translation method and device based on domain name system (DNS)
CN103051544B (en) Realize method and the access device of IPv4 private network access IPv6 network
CN104735174A (en) HTTP transparent proxy implementing method and device
CN102984697A (en) IP (communication method, equipment and system based on mobile terminals
CN106375489A (en) Processing method and apparatus for MAC address
CN102572006A (en) Data transmission method and device based on NAT (Network Address Translation) address translation

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Applicant after: Xinhua three Technology Co., Ltd.

Address before: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Applicant before: Huasan Communication Technology Co., Ltd.

GR01 Patent grant
GR01 Patent grant