CN109639845A - The resource allocation methods and equipment of network address translation NAT - Google Patents

The resource allocation methods and equipment of network address translation NAT Download PDF

Info

Publication number
CN109639845A
CN109639845A CN201710929605.2A CN201710929605A CN109639845A CN 109639845 A CN109639845 A CN 109639845A CN 201710929605 A CN201710929605 A CN 201710929605A CN 109639845 A CN109639845 A CN 109639845A
Authority
CN
China
Prior art keywords
port
nat
net side
outer net
user
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
CN201710929605.2A
Other languages
Chinese (zh)
Other versions
CN109639845B (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201710929605.2A priority Critical patent/CN109639845B/en
Publication of CN109639845A publication Critical patent/CN109639845A/en
Application granted granted Critical
Publication of CN109639845B publication Critical patent/CN109639845B/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

Landscapes

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

Abstract

The invention discloses the resource allocation methods and equipment of a kind of network address translation NAT, which comprises according to the NAT IP of user, distributes nat port in preset port allocation table and distributes list item;S102 distributes the outer net side conversational list that list item establishes the user according to the nat port, to complete to create outer net side session.The port block method of salary distribution of the problem of using the identical address NAT present invention efficiently solves same user and user, the reusing degree of the address NAT are expanded by port allocation table, to efficiently solve the problems, such as that the address NAT is inadequate.

Description

The resource allocation methods and equipment of network address translation NAT
Technical field
The present invention relates to network technique fields, a kind of resource allocation methods more particularly to network address translation NAT and Equipment.
Background technique
NAT (network address translation, Network Address Translation) technology is that the current address IPv4 that solves lacks A kind of weary basic service.NAT Port-range technology, by specifying one piece of port range of the address NAT to user, so that Tracing to the source becomes simpler.A+P (address adds port, Address plus Port) technology, is added by issuing specified public network address The address port range, so that user carries out network address translation with the port range of specified address.
In exemplary network address translation process, either v4 to v4 conversion or v4 and v6 mutually turn, all unavoidably there are State conversion, that is, conversion equipment such as CGN (carrier-class NAT, Carrier Grade NAT) must save conversion front and back Information.The information for converting front and back, generally comprises source IP, source PORT, destination IP, purpose PORT, protocol number, NAT IP, NAT PORT.Interior net side can see source IP, source PORT, destination IP, purpose PORT, protocol number, referred to herein as interior net side session.Outer net side Can see source IP 2 (i.e. NAT IP), source PORT2 (i.e. NAT PORT), destination IP (DST IP), destination port (DST PORT), Protocol number (PROTOCAL), referred to herein as outer net side session.
For interior net side session, corresponding outer net side session and interrelated is quickly established, is the key that NAT conversion Technology.When establishing outer net side session, corresponding NAT IP is distributed, NAT PORT is key technology, referred to herein as resource allocation.Money Source is distributed in the prior art, relatively bitmap is mostly used to distribute, most 65535 ports a NAT IP, multiple users can share This 65535 ports.For example each user distributes 2048 ports, 65535 except 2048 be 32, then a NAT IP at most gives 32 A user uses.When the complete then resource exhaustion of 65535 port assignments of NAT IP, user can not create connection.
Summary of the invention
In order to overcome drawbacks described above, the technical problem to be solved in the present invention is to provide the moneys of network address translation NAT a kind of Source distribution method and equipment, to solve the problems, such as NAT address shortage.
In order to solve the above technical problems, the resource allocation methods of one of present invention network address translation NAT, the side Method includes:
According to the NAT IP of user, nat port is distributed in preset port allocation table and distributes list item;
The outer net side conversational list that list item establishes the user is distributed according to the nat port, to complete to create outer net side meeting Words.
In order to solve the above technical problems, one of present invention network address translation device, including memory and processing Device, the memory are stored with the resource allocation computer program of network address translation NAT, and the processor executes the journey Sequence, to realize following steps:
According to the NAT IP of user, nat port is distributed in preset port allocation table and distributes list item;
The outer net side conversational list that list item establishes the user is distributed according to the nat port, to complete to create outer net side meeting Words.
The present invention has the beneficial effect that:
Method and apparatus in the present invention distributes nat port point by the NAT IP of user in preset port allocation table The outer net side conversational list that list item establishes the user is distributed with list item, and according to the nat port, to complete to create outer net side meeting Words solve the problems, such as same user using the identical address NAT and the port block method of salary distribution of user, by port assignment Table expands the reusing degree of the address NAT, to efficiently solve the problems, such as that the address NAT is inadequate.
Detailed description of the invention
Fig. 1 is the flow chart of the resource allocation methods of network address translation NAT in the embodiment of the present invention;
Fig. 2 is middle port of embodiment of the present invention distribution schematic diagram;
Fig. 3 is the flow chart of optionally resource allocation methods in the embodiment of the present invention;
Fig. 4 is the flow chart of another optionally resource allocation methods in the embodiment of the present invention;
Fig. 5 is a kind of structural schematic diagram of network address translation device in the embodiment of the present invention.
Specific embodiment
In order to solve the problems, such as NAT address shortage, the present invention provides the resource allocation sides of network address translation NAT a kind of Method and equipment, below in conjunction with attached drawing and embodiment, the present invention will be described in further detail.It should be appreciated that this place is retouched It states that specific examples are only used to explain the present invention, does not limit the present invention.
Embodiment one
As shown in Figure 1, the embodiment of the present invention provides the resource allocation methods of network address translation NAT a kind of, the method Include:
S101 distributes nat port in preset port allocation table and distributes list item according to the NAT IP of user;
S102 distributes the outer net side conversational list that list item establishes the user according to the nat port, to complete creation outer net Side session.
The embodiment of the present invention passes through the NAT IP of user, and nat port is distributed in preset port allocation table and distributes list item, And the outer net side conversational list that list item establishes the user is distributed according to the nat port, to complete to create outer net side session, preferably Same user is solved the problems, such as using the identical address NAT and the port block method of salary distribution of user, is expanded by port allocation table The big reusing degree of the address NAT, to efficiently solve the problems, such as that the address NAT is inadequate.
As shown in Fig. 2, for there was only 1 NAT IP in nat address pool, if there is multiple similar.Nat port Duan Weiyi Section port range, such as 1-2048,2049-4096, this Figure illustrates the multiplexing of nat port (abbreviation port) signals.
On the basis of the above embodiments, it is further proposed that the modification of above-described embodiment.
In embodiments of the present invention, optionally, the NAT IP according to user, is distributed in preset port allocation table Nat port distributes list item, comprising:
According to the NAT IP of user, searches in the port allocation table and do not conflict with already present outer net side session entry Nat port distribute list item.
Wherein, the nat port distribution list item includes preset outer net side resource parameters information and port array PortCurrent。
The outer net side resource parameters information includes SRC IP2 (NAT IP), DST IP, DST PORT, PROTOCAL.
Further, the NAT IP according to user is searched and already present outer net in preset port allocation table The list item that side session entry does not conflict, comprising:
In the port allocation table corresponding with the NAT IP of the user, port number is chosen from the port array Value, and it is assigned to nat port value;
If the nat port value and the outer net side resource parameters information and the already present outer net side session entry are not Conflict then distributes list item using the nat port value and the outer net side resource parameters information as the nat port.
Further, described that port values are chosen from the port array, and as nat port value, comprising:
Port number is chosen from the port array by way of cumulative according to preset cumulative step value (such as 1) Value;Alternatively,
Port values are randomly selected from the port array.
That is, middle port of embodiment of the present invention distribution list item is subsequent in use, PortCurrent is using cumulative side Formula often creates 1 outer net side session cumulative 1.It may be random fashion, in specified port range (the i.e. model of port array Enclose) in be randomly assigned.
Wherein, described that port is chosen from the port array by way of cumulative according to preset cumulative step value Numerical value, comprising:
It is cumulative by current port values according to the cumulative step value in the port array, until that will add up To port values be assigned to nat port value when, the nat port value and the outer net side resource parameters information have been deposited with described Outer net side session entry do not conflict.
For example, each PROTOCAL, each DST IP, each DST PORT for each NAT IP safeguard one PortCurrent (range can customize, such as 2048 to 65535).By NAT IP, PROTOCAL, DST IP, DST PORT, PortCurrent is write as table, HASH lookup is established, to generate port allocation table.
1 outer net side session is often created, takes the PortCurrent of corresponding ports allocation table to add 1 and is assigned to SRC PORT2 (NAT PORT).Outer net side conversational list is searched, if it find that having had identical SRC IP2 (NAT IP), SRC PORT2 (NAT PORT), DST IP, DST PORT, PROTOCAL, then repeatedly PortCurrent adds 1.If without identical outer net side session Table then forms outer net side NAT session insertion with the SRC PORT2 (NAT PORT) being assigned to.And it establishes outer net side conversational list and is somebody's turn to do The HASH tabular value of list item, convenient for quickly searching.When 1 NAT IP gives 100 user's used times, this 100 users access one simultaneously The cumulative conflict of a purpose, PortCurrent 65535 should be unable to be big.
With next specific scene, the effect of the lower embodiment of the present invention is described.In existing scene, hardware components are by 1 NAT device, 5 terminals with network communicating function form.Terminal 1 and terminal 2 are in Intranet;Terminal 3, terminal 4, terminal 5 exist Outer net, as server.
Step 1: carrying out the relevant configuration of NAT on NAT device:
(1) configuration rule, 11.1.1.2 is as NAT IP.Such as:
ip nat pool zte 11.1.1.2 11.1.1.2 prefiex 24
ip nat inside source list 1 pool zte overload
(2) configuration NAT Intranet side interface, outer net side interface, such as:
interface fei_1/1
ip address 10.1.1.1 255.255.255.0
interface fei_1/2
ip address 11.1.1.1 255.255.255.0
Step 2: configurating terminal.1 address of terminal is 10.1.1.2, and 2 address of terminal is 10.1.1.3.3 address of terminal is 110.1.1.2,4 address of terminal is 110.1.1.3, and 5 address of terminal is 110.1.1.4.Terminal 3, terminal 4 open net in terminal 5 Page service, in 80 port snoop of TCP.
Step 3: terminal 1 accesses terminal 3, interior net side branch list item 1 is formed, outer net side session entry 1 is formed, forms end The 1st article of list item of mouth distribution (PortCurrent assigns initial value 2048).
Terminal 1 accesses terminal 3 again, forms interior net side branch list item 2, forms outer net side session entry 2, updates port point With the 1st article of list item (PortCurrent is added to 2049 from 2048).
Terminal 2 accesses terminal 3, forms interior net side branch list item 3, forms outer net side session entry 3, updates port allocation table The 1st article (PortCurrent is added to 2050 from 2049) of item.
Terminal 1 accesses terminal 4, forms interior net side branch list item 4, forms outer net side session entry 4, forms port allocation table The 2nd article of item (PortCurrent assigns initial value 2048).
Terminal 1 accesses terminal 5, forms interior net side branch list item 5, forms outer net side session entry 5, forms port allocation table The 3rd article of item (PortCurrent assigns initial value 2048).
Step 4: list item is checked on NAT device, it is probably as follows.
Port allocation table:
Outer net side conversational list:
Interior net side conversational list:
In embodiments of the present invention, optionally, the port array includes port initial value and port greatest measure;
Wherein, it when the cumulative obtained port values are greater than the port greatest measure, cumulative is obtained described Port values put back into the port initial value, and continue further to add up, until by the obtained port values that further add up When being assigned to nat port value, the nat port value and the outer net side resource parameters information and the already present outer net side meeting Words list item does not conflict.
For example, port assignment list item is for the first time in use, PortCurrent initial value (i.e. port initial value) can be as Under type determines.It can be fixed value, such as 2048.It can also be order Configuration Values, for example have range limit to NAT IP distribution port The order Configuration Values of system.It can be port block starting point slogan if user is with the distribution of port block mode.It can also be NAT IP Accumulated value under the port block of distribution (or user), the initial value of accumulated value can be fixed value or order Configuration Values, the NAT IP (or The port block of user's distribution) a port assignment list item is often created, which adds 1, and accumulated value reaches maximum value, and (port is maximum Numerical value) put back into initial value again afterwards.It can also use and be randomly assigned, be randomly assigned in specified port range.
In embodiments of the present invention, optionally, described that the outer net that list item establishes the user is distributed according to the nat port Side conversational list, after the outer net side session of completion creation, comprising:
The session count SessionCount value of count area preset in institute's port allocation table is added 1, meeting after adding 1 When talking about count value greater than preset threshold value, nat port is distributed no longer from the port allocation table and distributes list item;
When deleting the outer net side session, corresponding nat port distribution list item is discharged, and by the meeting of the count area Words count value subtracts 1.
For example, increasing count area for port allocation table list item, and SessionCount (initial value 0) is set, is distributed To a session entry, SessionCount adds 1, discharges a session entry, and SessionCount subtracts 1.When the value is greater than one When definite value, it can not reallocate and return to mistake.It can effectively inhibit to conflict so excessive.
In embodiments of the present invention, optionally, the NAT IP according to user, is searched in preset port allocation table Before the nat port distribution list item not conflicted with already present outer net side session entry, comprising:
It chooses the least NAT IP of active user's number and distributes to the user;Alternatively,
The port block resource for allocating NAT IP in advance is given into the user;Alternatively,
Obtain the NAT IP that the user has used.
For example, NAT device receives interior net side message, and when needing newly-built session, point following three kinds of situations processing:
(1) if the user also no distribution session, selects active user's number most from NAT POOL (NAT resource pool) Few NAT IP distributes resource.It can be accomplished by the shared rate management of NAT IP.
(2) if the user the allocated session, used NAT IP distributes resource before use.User can be passed through Management is to accomplish.
(3) optional, user is to allocate port block (one section of port range of a NAT IP, for example 1 arrive of NAT IP in advance 1024 port ranges) mode distributes resource.After all of the port block of NAT IP has all divided, the port block after distribution can be again Secondary, even repeated dispensing is to different user.Namely the same end buccal mass can be used simultaneously by multiple users.
In embodiments of the present invention, optionally, the NAT IP according to user, is distributed in preset port allocation table Nat port distributes list item, comprising:
The nat port, which is distributed, according to port bitmap corresponding with the NAT IP distributes list item;
When the port bitmap exhausts, according to the NAT IP of user, nat port is distributed in preset port allocation table Distribute list item.
For example, NAT IP enables port bitmap, 1 port of every 1 expression.Port is distributed from port bitmap, is dispensed A port sets corresponding positions, and recycling a port removes corresponding positions.Preferential distribution port bitmap, when port, bitmap exhausts and just makes It is distributed with port assignment list item multiplexing port.Port bitmap sets corresponding positions when having the session entry of certain Single port, certain Single port All session entries delete when port bitmap remove corresponding positions (can be by identical NAT IP, identical nat port and same protocol Number session entry carry out by HASH table organization, or to each port using counting).It can guarantee that all of the port is made in this way After being finished, then carry out multiplexed port.
In embodiments of the present invention, optionally, described that the outer net that list item establishes the user is distributed according to the nat port Side conversational list, after the outer net side session of completion creation, comprising:
Net side conversational list in establishing, to complete interior net side session;
It is associated with the outer net side session and the interior net side session, and respectively in the outer net side conversational list and the Intranet The table item index of other side is added in the conversational list of side.
For example, establishing corresponding interior net side session after outer net side session establishment is good.List item includes field: SRC IP, SRC PORT、DST IP、DST PORT、PROTOCAL。
The HASH tabular value of the list item is established, convenient for quickly searching.
After session entry establishes in two sides, it is associated with interior net side session and outer net side session, is added in respective list item The table item index of other side.
Interior net side session and outer net side session can be same conversational list, and multiplexed port table can also be shared with conversational list Public field handles different HASH conflict chains in the table entry, separates for convenience of description in the embodiment of the present invention.
The embodiment of the present invention illustrated below.
As shown in figure 3, resource allocation process includes:
Step 11, NAT device receives interior net side message, and user needs newly-built session entry.
Step 12, the NAT IP of user is obtained.
Step 13, port assignment list item is searched, judges whether to have existed.
Step 14, and if it exists, PortCurrent adds 1, forms outer net side session entry, whether inquires outer net side conversational list There is identical session entry, if having identical, PortCurrent adds 1, if not identical, executes step 16.
Step 15, if it does not exist, port assignment list item is created, PortCurrent initial value executes step 16.
Step 16, outer net side session entry is created.
Step 17, net side session entry in creating, and it is associated with inside and outside session entry.
As shown in figure 4, resource allocation process includes:
Step 21, NAT device receives interior net side message, and user needs newly-built session entry.
Step 22, the NAT IP of user is obtained.
Step 23, port bitmap is searched, if port can be distributed and search port assignment list item, if so, step 24 is executed, if It is no, execute step 27.
Step 24, port is distributed, port assignment list item is searched, if is existed, is executed step 26 if it exists, hold if it does not exist Row step 27.
Step 25, port assignment list item is created, PortCurrent sets initial value.The session of outer net side is formed using distribution port List item executes step 30.
Step 26, port assignment list item SessionCount adds 1, PortCurrent value to distribute port, uses distribution port Outer net side session entry is formed, step 30 is executed.
Step 27, port assignment list item is searched, if having existed.If it is not, step 28 is executed, if so, executing step 29.
Step 28, port assignment list item is created, PortCurrent sets initial value, forms outer net side session entry, executes step 30。
Step 29, PortCurrent adds 1, forms outer net side session entry.Inquire whether outer net side conversational list has identical meeting List item is talked about, if having identical, PortCurrent adds 1, if not identical, executes step 30.
Step 30, outer net side session entry is created.
Step 31, net side session entry in creating, and it is associated with inside and outside session entry.
Embodiment two
The embodiment of the present invention provides a kind of network address translation device, and the NAT device includes memory and processing Device, the memory are stored with the resource allocation computer program of network address translation NAT, and the processor executes the journey Sequence, to realize such as the step of any one of embodiment one the method.
The embodiment of the present invention passes through the NAT IP of user, and nat port is distributed in preset port allocation table and distributes list item, And the outer net side conversational list that list item establishes the user is distributed according to the nat port, to complete to create outer net side session, preferably Same user is solved the problems, such as using the identical address NAT and the port block method of salary distribution of user, is expanded by port allocation table The big reusing degree of the address NAT, to efficiently solve the problems, such as that the address NAT is inadequate.
Specifically, the processor executes described program, to realize following steps:
According to the NAT IP of user, nat port is distributed in preset port allocation table and distributes list item;
The outer net side conversational list that list item establishes the user is distributed according to the nat port, to complete to create outer net side meeting Words.
In embodiments of the present invention, optionally, the NAT IP according to user, is distributed in preset port allocation table Nat port distributes list item, comprising:
According to the NAT IP of user, searches in the port allocation table and do not conflict with already present outer net side session entry Nat port distribute list item.
Wherein, the nat port distribution list item includes preset outer net side resource parameters information and port array.
In embodiments of the present invention, optionally, the NAT IP according to user, is searched in preset port allocation table The list item not conflicted with already present outer net side session entry, comprising:
In the port allocation table corresponding with the NAT IP of the user, port number is chosen from the port array Value, and it is assigned to nat port value;
If the nat port value and the outer net side resource parameters information and the already present outer net side session entry are not Conflict then distributes list item using the nat port value and the outer net side resource parameters information as the nat port.
In embodiments of the present invention, optionally, described that port values are chosen from the port array, and as the end NAT Mouth value, comprising:
Port values are chosen from the port array by way of cumulative according to preset cumulative step value;Or Person,
Port values are randomly selected from the port array.
Further, described to be chosen from the port array by way of cumulative according to preset cumulative step value Port values, comprising:
It is cumulative by current port values according to the cumulative step value in the port array, until that will add up To port values be assigned to nat port value when, the nat port value and the outer net side resource parameters information have been deposited with described Outer net side session entry do not conflict.
Further, the port array includes port initial value and port greatest measure;
When the cumulative obtained port values are greater than the port greatest measure, by the cumulative obtained port number Value puts back into the port initial value, and continues further to add up, and until will further add up, obtained port values are assigned to When nat port value, the nat port value and the outer net side resource parameters information and the already present outer net side session entry Do not conflict.
In embodiments of the present invention, optionally, described that the outer net that list item establishes the user is distributed according to the nat port Side conversational list, after the outer net side session of completion creation, comprising:
The session count value of count area preset in institute's port allocation table is added 1, session count value after adding 1 is greater than When preset threshold value, nat port is distributed no longer from the port allocation table and distributes list item;
When deleting the outer net side session, corresponding nat port distribution list item is discharged, and by the meeting of the count area Words count value subtracts 1.
In embodiments of the present invention, optionally, the NAT IP according to user, is searched in preset port allocation table Before the nat port distribution list item not conflicted with already present outer net side session entry, comprising:
It chooses the least NAT IP of active user's number and distributes to the user;Alternatively,
The port block resource for allocating NAT IP in advance is given into the user;Alternatively,
Obtain the NAT IP that the user has used.
In embodiments of the present invention, optionally, the NAT IP according to user, is distributed in preset port allocation table Nat port distributes list item, comprising:
The nat port, which is distributed, according to port bitmap corresponding with the NAT IP distributes list item;
When the port bitmap exhausts, according to the NAT IP of user, nat port is distributed in preset port allocation table Distribute list item.
In embodiments of the present invention, optionally, described that the outer net that list item establishes the user is distributed according to the nat port Side conversational list, after the outer net side session of completion creation, comprising:
Net side conversational list in establishing, to complete interior net side session;
It is associated with the outer net side session and the interior net side session, and respectively in the outer net side conversational list and the Intranet The table item index of other side is added in the conversational list of side.
The embodiment of the present invention in specific implementation can be refering to embodiment one, the technical effect with embodiment one.
Embodiment three
The embodiment of the present invention provides a kind of computer readable storage medium, and the media storage has network address translation NAT Resource allocation computer program, when described program is executed by least one processor, to realize as any one in embodiment one The step of item the method.
Computer readable storage medium can be RAM memory, flash memory, ROM memory, EPROM in the embodiment of the present invention Memory, eeprom memory, register, hard disk, mobile hard disk, CD-ROM or any other form known in the art Storage medium.A kind of storage medium lotus root can be connected to processor, thus enable a processor to from the read information, And information can be written to the storage medium;Or the storage medium can be the component part of processor.Processor and storage are situated between Matter can be located in specific integrated circuit.
The embodiment of the present invention in specific implementation, can be imitated refering to embodiment one and embodiment two based on corresponding technology Fruit.
Above-described specific embodiment has carried out further the purpose of the present invention, technical scheme and beneficial effects It is described in detail, it should be understood that being not intended to limit the present invention the foregoing is merely a specific embodiment of the invention Protection scope, all within the spirits and principles of the present invention, any modification, equivalent substitution, improvement and etc. done should all include Within protection scope of the present invention.

Claims (12)

1. a kind of resource allocation methods of network address translation NAT, which is characterized in that the described method includes:
According to the NAT IP of user, nat port is distributed in preset port allocation table and distributes list item;
The outer net side conversational list that list item establishes the user is distributed according to the nat port, to complete to create outer net side session.
2. the method as described in claim 1, which is characterized in that the NAT IP according to user, in preset port assignment Nat port is distributed in table distributes list item, comprising:
According to the NAT IP of user, lookup does not conflict with already present outer net side session entry in the port allocation table Nat port distributes list item.
3. method according to claim 2, which is characterized in that the nat port distribution list item includes preset outer net side money Source parameter information and port array.
4. method as claimed in claim 3, which is characterized in that the NAT IP according to user, in preset port assignment The list item not conflicted with already present outer net side session entry is searched in table, comprising:
In the port allocation table corresponding with the NAT IP of the user, port values are chosen from the port array, And it is assigned to nat port value;
If the nat port value and the outer net side resource parameters information are not rushed with the already present outer net side session entry It is prominent, then list item is distributed using the nat port value and the outer net side resource parameters information as the nat port.
5. method as claimed in claim 4, which is characterized in that it is described to choose port values from the port array, and make For nat port value, comprising:
Port values are chosen from the port array by way of cumulative according to preset cumulative step value;Alternatively,
Port values are randomly selected from the port array.
6. method as claimed in claim 5, which is characterized in that it is described according to preset cumulative step value, pass through cumulative side Formula chooses port values from the port array, comprising:
It is cumulative by current port values according to the cumulative step value in the port array, until what will be added up When port values are assigned to nat port value, the nat port value and the outer net side resource parameters information with it is described already present Outer net side session entry does not conflict.
7. method as claimed in claim 6, which is characterized in that the port array includes that port initial value and port are maximum Numerical value;
When the cumulative obtained port values are greater than the port greatest measure, the cumulative obtained port values are set The port initial value is returned, and continues further to add up, obtained port values are assigned to the end NAT until will further add up When mouth value, the nat port value and the outer net side resource parameters information are not rushed with the already present outer net side session entry It is prominent.
8. the method as described in claim 1, which is characterized in that described to establish the use according to nat port distribution list item The outer net side conversational list at family, after the outer net side session of completion creation, comprising:
The session count value of count area preset in institute's port allocation table is added 1, session count value after adding 1 is greater than default Threshold value when, no longer from the port allocation table distribute nat port distribute list item;
When deleting the outer net side session, corresponding nat port distribution list item is discharged, and by the session meter of the count area Numerical value subtracts 1.
9. the method as described in claim 1, which is characterized in that the NAT IP according to user, in preset port assignment It searches in table and is distributed before list item with the nat port that already present outer net side session entry does not conflict, comprising:
It chooses the least NAT IP of active user's number and distributes to the user;Alternatively,
The port block resource for allocating NAT IP in advance is given into the user;Alternatively,
Obtain the NAT IP that the user has used.
10. the method as described in claim 1, which is characterized in that the NAT IP according to user, in preset port assignment Nat port is distributed in table distributes list item, comprising:
The nat port, which is distributed, according to port bitmap corresponding with the NAT IP distributes list item;
When the port bitmap exhausts, according to the NAT IP of user, nat port distribution is distributed in preset port allocation table List item.
11. the method as described in any one of claim 1-10, which is characterized in that described to be distributed according to the nat port List item establishes the outer net side conversational list of the user, after the outer net side session of completion creation, comprising:
Net side conversational list in establishing, to complete interior net side session;
It is associated with the outer net side session and the interior net side session, and respectively in the outer net side conversational list and the interior net side meeting Talk about the table item index that other side is added in table.
12. a kind of network address translation device, which is characterized in that the NAT device includes memory and processor, described Memory is stored with the resource allocation computer program of network address translation NAT, and the processor executes described program, to realize Such as the step of any one of claim 1-11 the method.
CN201710929605.2A 2017-10-09 2017-10-09 Network Address Translation (NAT) resource allocation method and equipment Active CN109639845B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710929605.2A CN109639845B (en) 2017-10-09 2017-10-09 Network Address Translation (NAT) resource allocation method and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710929605.2A CN109639845B (en) 2017-10-09 2017-10-09 Network Address Translation (NAT) resource allocation method and equipment

Publications (2)

Publication Number Publication Date
CN109639845A true CN109639845A (en) 2019-04-16
CN109639845B CN109639845B (en) 2022-03-29

Family

ID=66051208

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710929605.2A Active CN109639845B (en) 2017-10-09 2017-10-09 Network Address Translation (NAT) resource allocation method and equipment

Country Status (1)

Country Link
CN (1) CN109639845B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111314505A (en) * 2020-04-21 2020-06-19 杭州迪普科技股份有限公司 Network address translation method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6381638B1 (en) * 1999-02-24 2002-04-30 3Com Corporation System and method for options based address reuse
CN101159693A (en) * 2007-10-16 2008-04-09 中兴通讯股份有限公司 Static PAT supporting arbitrary port method of multiplexing router interface address
CN101335770A (en) * 2008-08-06 2008-12-31 杭州华三通信技术有限公司 Method and apparatus for network port address conversion
CN103945014A (en) * 2013-01-21 2014-07-23 中国科学院声学研究所 Port multiplexing method in PAT mode and network address translation equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6381638B1 (en) * 1999-02-24 2002-04-30 3Com Corporation System and method for options based address reuse
CN101159693A (en) * 2007-10-16 2008-04-09 中兴通讯股份有限公司 Static PAT supporting arbitrary port method of multiplexing router interface address
CN101335770A (en) * 2008-08-06 2008-12-31 杭州华三通信技术有限公司 Method and apparatus for network port address conversion
CN103945014A (en) * 2013-01-21 2014-07-23 中国科学院声学研究所 Port multiplexing method in PAT mode and network address translation equipment
CN103945014B (en) * 2013-01-21 2017-09-26 中国科学院声学研究所 Multiplexed port method and network address translation apparatus under a kind of PAT patterns

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111314505A (en) * 2020-04-21 2020-06-19 杭州迪普科技股份有限公司 Network address translation method and device
CN111314505B (en) * 2020-04-21 2023-08-29 杭州迪普科技股份有限公司 Network address conversion method and device

Also Published As

Publication number Publication date
CN109639845B (en) 2022-03-29

Similar Documents

Publication Publication Date Title
CN107105061A (en) A kind of service registry method and device
US9219698B2 (en) Providing a layer-3 interface
CN104219125B (en) The method, apparatus and system to be E-Packeted centered on information in network ICN
CN105791254B (en) Network request processing method and device and terminal
CN103270727B (en) Bank aware multi-it trie
WO2015131612A1 (en) Method and device for allocating network address translation (nat) resources
CN105530202B (en) A kind of bandwidth allocation methods and server
CN103780712B (en) The method and address-translating device of a kind of address-translating device distribution port
CN114710467B (en) IP address storage method and device and hardware gateway
CN109639845A (en) The resource allocation methods and equipment of network address translation NAT
CN107809495A (en) Address management method and device
CN104488240B (en) Session management method, address management method and relevant device
CN104486453A (en) Ageing-time adjusting method and device
CN110855424A (en) Method and device for synthesizing asymmetric flow xDR in DPI field
CN104507067B (en) A kind of method and mobility management entity of determining registration area
CN108551485A (en) A kind of streaming medium content caching method, device and computer storage media
CN104519150B (en) Network address conversion port distribution method and system
CN105939404A (en) NAT (Network Address Translation) resource obtaining method and device
CN105357332B (en) A kind of method for network address translation and device
CN107483308A (en) A kind of ethernet communication method based on timeslice token mechanism
CN113543234A (en) Port resource reservation method, electronic device and storage medium
CN106294539A (en) Data directory list storage strategy under mixed cloud environment
CN111049758B (en) Method, system and equipment for realizing QoS processing of message
CN103544292B (en) Diameter message processing method and device based on HASH table
CN102377576B (en) Multicast realization method

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