CN104378456B - A kind of IP Address in LAN distributes optimization method - Google Patents

A kind of IP Address in LAN distributes optimization method Download PDF

Info

Publication number
CN104378456B
CN104378456B CN201410666700.4A CN201410666700A CN104378456B CN 104378456 B CN104378456 B CN 104378456B CN 201410666700 A CN201410666700 A CN 201410666700A CN 104378456 B CN104378456 B CN 104378456B
Authority
CN
China
Prior art keywords
address
terminal
allocation table
mac
request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410666700.4A
Other languages
Chinese (zh)
Other versions
CN104378456A (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.)
WUXI WUSHEN TECHNOLOGY Co Ltd
Original Assignee
WUXI WUSHEN TECHNOLOGY 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 WUXI WUSHEN TECHNOLOGY Co Ltd filed Critical WUXI WUSHEN TECHNOLOGY Co Ltd
Priority to CN201410666700.4A priority Critical patent/CN104378456B/en
Publication of CN104378456A publication Critical patent/CN104378456A/en
Application granted granted Critical
Publication of CN104378456B publication Critical patent/CN104378456B/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/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses

Landscapes

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

Abstract

The invention discloses a kind of IP Address in LAN to distribute optimization method.This method first builds IP address of terminal allocation table and free IP addresses list,When there is terminal request to access route,First determine that the MAC Address of the terminal belongs in IP address of terminal allocation table whether the IP address IP address corresponding with the terminal MAC address stored in IP address of terminal allocation table that the MAC Address stored judges that this request of the terminal accesses route again matches,Upon a match,The current state for recording the IP address is 1,When mismatching,Further according to the terminal, this asks the affiliated situation of IP address that access is route to determine the distribution of IP address,So even if allocated IP address is under non-access state when the terminal of its distribution,IP address can also be utilized temporarily,Improve the utilization of resources of IP address,Simultaneously,The problem of also for IP address conflict is avoided the occurrence of.

Description

A kind of IP Address in LAN distributes optimization method
Technical field
The invention belongs to IP address to distribute field, more says it is a kind of IP Address in LAN distribution optimization method.
Background technology
Internet protocol address(English:Internet Protocol Address, are translated into internet protocol address again), contracting It is written as IP address(IP Address).IP address is a kind of unified address format that IP agreement provides, and it is on internet One logical address of each network and each host assignment, the difference of physical address is shielded with this.
Static allocation IP address is to show each computer all to distribute a fixed IP address, and advantage is easy for pipe Reason.Static ip address is particularly in the LAN of network traffics is limited according to IP address, with fixed IP address or IP address Flow caused by packet is according to managing, can exempt user when by user mode charging and surf the Net every time the body that must all carry out The complicated processes of part certification, while it also avoid the embarrassment that user often forgets about password.The weakness of static allocation IP address is to close The address of method user distribution may illegally be usurped, and not only the normal use of network is impacted, simultaneously because stolen Address often has higher authority, thus is also easily caused damage and potential potential safety hazard to validated user.Solve this The common method of problem is ip-mac address bindings, and usually the another kinds for gateway are to set static arp tables, local In net between the computer of exchanging visit in need, not spoofed to ensure, if necessary, each must all set the computer to be exchanged visits Static arp tables, but so MAC Address binding, the IP address is only capable of being used by the MAC Address, due to the IP of a network segment Location is limited, and when IP address is under idle condition, remaining MAC Address can not also use temporarily, cause the wave of IP address Take.
Such as application number " 200910205983.1 ", denomination of invention " recovery method and device of predistribution IP address " this hair Bright embodiment discloses a kind of recovery method and device for pre-allocating IP address, is related to the communications field, realization will not used Predistribution IP address discharge in time, avoid causing the waste of IP address resource.The present invention includes:Receive home agent or sheet The user terminal access request message that ground mobile anchor point is sent, user terminal mark is included in the user terminal access request message Know and determine to distribute to the IP address that the user terminal uses;The user terminal is inquired about according to the user terminal identification IP address assignment record, chosen from the IP address pre-allocated for the user terminal and be not yet assigned to what the user terminal used IP address;Reclaim the IP address for being not yet assigned to the user terminal and using of the selection.The embodiment of the present invention is mainly used in using During family terminal request networks.The predistribution IP address that the above method solves the problems, such as to be not used is released in time Put, avoid causing the waste of IP address resource, but when this method can not solve to the allocated IP address, when the IP address When corresponding terminal is not used, the problem of the wasting of resources of IP address.
The content of the invention
The technical problems to be solved by the invention are:There is provided it is a kind of according to IP address current state come to the allocated IP address utilizes to solve the IP Address in LAN of IP address wasting of resources distribution optimization method temporarily.
In order to solve the above technical problems, a kind of IP Address in LAN distribution optimization method of the present invention, comprises the following steps:
Step 1, route is arranged to IP address static allocation and non-mac address filter pattern;
Step 2, IP address of terminal allocation table and free IP addresses list are established, wherein, IP address of terminal allocation table is used for Storage is already allocated to the IP address of each terminal and corresponding terminal MAC address, and free IP addresses list is used to store the net Unappropriated IP address in section;
Step 3, when there is terminal request to access route, judge whether the MAC Address of the terminal belongs to IP address of terminal point With the MAC Address stored in table, if so, then performing step 4;Otherwise, step 7 is performed;
Step 4, judge that this request of the terminal accesses the IP address routeing and is somebody's turn to do with what is stored in IP address of terminal allocation table Whether IP address corresponding to terminal MAC address matches, if matching, the current state for recording the IP address represents for 1,1 Terminal corresponding to the IP address is in access state;If not matching that, step 5 is performed;
Step 5, judge that this request of the terminal accesses the affiliated situation of IP address of route:
A, when belonging to IP address corresponding to other-end MAC Address in IP address of terminal allocation table, the IP address is judged Current state whether be 1, if so, then prompting the IP address of terminal to take, if it is not, being then allocated temporarily to the IP address The terminal, remember that the current state of the IP address represents that terminal corresponding to the IP address is in non-access state for 0,0;
B, when belonging in free IP addresses list the IP address that stores, then by terminal MAC in IP address of terminal allocation table It is 1 that corresponding IP address refreshing, which is the IP address of this request access route and records the current state of the IP address, renewal sky Not busy IP address list;
C, when being both not belonging in IP address of terminal allocation table IP address corresponding to other-end MAC Address or be not belonging to the free time During the IP address stored in IP address list, then step 6 is performed;
Step 6, judge that this request of the terminal accesses the IP address that the IP address routeing is not belonging to the same network segment of the route;
Step 7, judge whether IP address that this request of the terminal accesses route belongs in free IP addresses list and store IP address, if so, then correspondingly store the MAC Address of the terminal and IP address into IP address of terminal allocation table, and remember should The current state of IP address is 1, updates free IP addresses list.
Preferably, in IP Address in LAN distribution optimization method of the present invention, in addition to IP address is allocated temporarily to terminal In the case of, when terminal MAC address request accesses corresponding to the IP address in IP address of terminal allocation table, preferably allow for terminal The access request of terminal MAC address corresponding to the IP address in IP address allocation table, forbid the terminal of interim distribution IP address Access.
Preferably, in IP Address in LAN distribution optimization method of the present invention, B updates free IP addresses list in step 5, Specially by terminal MAC in IP address of terminal allocation table, originally corresponding IP address is added in free IP addresses list, and This request accesses the IP address of route from free IP addresses list.
Preferably, in IP Address in LAN distribution optimization method of the present invention, free IP addresses list is updated in step 7, IP address will be specially stored into IP address of terminal allocation table to delete from free IP addresses list.
Preferably, in IP Address in LAN distribution optimization method of the present invention, routing address uses C classes address.
Compared with prior art, the present invention has the advantages that:Current state of the invention by recording IP address To determine whether terminal corresponding to the IP address is in access state so as to determine whether IP address can be taken temporarily, so make Even if obtaining allocated IP address when terminal of its distribution is under non-access state, IP address can also be utilized temporarily, be improved The utilization of resources of IP address, meanwhile, the problem of also for IP address conflict is avoided the occurrence of, as terminal MAC corresponding to IP address When Address requests access, the access request of terminal MAC address corresponding to the IP address in IP address of terminal allocation table is preferably allowed for, Forbid the access of the terminal of interim distribution IP address.
Embodiment
A kind of IP Address in LAN distribution optimization method of the present invention, comprises the following steps:
Step 1, route is arranged to IP address static allocation and non-mac address filter pattern;
Step 2, IP address of terminal allocation table and free IP addresses list are established, wherein, IP address of terminal allocation table is used for Storage is already allocated to the IP address of each terminal and corresponding terminal MAC address, and free IP addresses list is used to store the net Unappropriated IP address in section;
Step 3, when there is terminal request to access route, judge whether the MAC Address of the terminal belongs to IP address of terminal point With the MAC Address stored in table, if so, then performing step 4;Otherwise, step 7 is performed;
Step 4, judge that this request of the terminal accesses the IP address routeing and is somebody's turn to do with what is stored in IP address of terminal allocation table Whether IP address corresponding to terminal MAC address matches, if matching, the current state for recording the IP address represents for 1,1 Terminal corresponding to the IP address is in access state;If not matching that, step 5 is performed;
Step 5, judge that this request of the terminal accesses the affiliated situation of IP address of route:
A, when belonging to IP address corresponding to other-end MAC Address in IP address of terminal allocation table, the IP address is judged Current state whether be 1, if so, then prompting the IP address of terminal to take, if it is not, being then allocated temporarily to the IP address The terminal, remember that the current state of the IP address represents that terminal corresponding to the IP address is in non-access state for 0,0, now, when When terminal MAC address request accesses corresponding to the IP address in IP address of terminal allocation table, IP address of terminal is preferably allowed for distribute The access request of terminal MAC address corresponding to the IP address in table, forbid the access of the terminal of interim distribution IP address;
B, when belonging in free IP addresses list the IP address that stores, then by terminal MAC in IP address of terminal allocation table It is 1 that corresponding IP address refreshing, which is the IP address of this request access route and records the current state of the IP address, renewal sky Not busy IP address list, specially by terminal MAC in IP address of terminal allocation table, originally corresponding IP address is added to idle IP In address list, and this request accesses the IP address of route from free IP addresses list;
C, when being both not belonging in IP address of terminal allocation table IP address corresponding to other-end MAC Address or be not belonging to the free time During the IP address stored in IP address list, then step 6 is performed;
Step 6, judge that this request of the terminal accesses the IP address that the IP address routeing is not belonging to the same network segment of the route;
Step 7, judge whether IP address that this request of the terminal accesses route belongs in free IP addresses list and store IP address, if so, then correspondingly store the MAC Address of the terminal and IP address into IP address of terminal allocation table, and remember should The current state of IP address is 1, updates free IP addresses list, will specially store the IP address into IP address of terminal allocation table Deleted from free IP addresses list.
The present invention first builds IP address of terminal allocation table and free IP addresses list, when there is terminal request to access route, First determine that the MAC Address of the terminal belongs in IP address of terminal allocation table the MAC Address stored and judges this request of the terminal again Access route IP address IP address corresponding with the terminal MAC address stored in IP address of terminal allocation table whether phase Match somebody with somebody, upon a match, the current state for recording the IP address is 1, and when mismatching, further according to the terminal, this request accesses route IP address affiliated situation determine the distribution of IP address, so that even if allocated IP address works as the end of its distribution Under non-access state, IP address can also be utilized temporarily, improve the utilization of resources of IP address, meanwhile, also for avoiding out The problem of existing IP address conflict.
Embodiment
C classes address, C class address realms are used in the present embodiment:192.0.0.1 223.255.255.255 is arrived;C classes address Default subnet mask is 255.255.255.0, and the IP address of the same network segment used in the present embodiment is 192.168.1.2- 192.168.1.254;
It is as follows to build IP address of terminal allocation table A and free IP addresses list B.:
Table A:
Terminal MAC address The IP address of corresponding distribution
60-EC-79-C1-67-D5 192.168.1.77
51-FE-56-D7-89-C2 192.168.1.34
56-DF-34-F2-49-F1 192.168.1.12
59-D5-23-D7-22-D2 192.168.1.68
51-AD-53-E7-59-D2 192.168.1.243
Wherein, the IP address in free IP addresses list B being the same network segment is 192.168.1.2-192.168.1.254 In other IP address in addition to five stored IP address of Table A;
Work as terminal MAC address:56-DF-34-F2-49-F1, IP address:192.168.1.12 when request accesses route, by In the terminal MAC address belong to the terminal MAC address stored in Table A and IP address also with the terminal MAC address is corresponding in Table A deposits The IP address of storage matches, then the current state for now remembering 192.168.1.12 is 1.
Work as terminal MAC address:59-D5-23-D7-22-D2, IP address:192.168.1.55 when request accesses route, by In the terminal MAC address belong to the terminal MAC address stored in Table A but the IP address with the terminal MAC address is corresponding in Table A deposits The IP address of storage does not match that the IP address belongs in free IP addresses list B the IP address stored, now updates Table A and sky Not busy IP address list B, the current state for remembering 192.168.1.55 are 1
Table A after renewal:
Terminal MAC address The IP address of corresponding distribution
60-EC-79-C1-67-D5 192.168.1.77
51-FE-56-D7-89-C2 192.168.1.34
56-DF-34-F2-49-F1 192.168.1.12
59-D5-23-D7-22-D2 192.168.1.55
51-AD-53-E7-59-D2 192.168.1.243
Update free IP addresses list B:It will be deleted in 192.168.1.55 in idle IP address list B, will 192.168.1.68 added in free IP addresses list B.
Obviously, the above embodiment of the present invention is only intended to clearly illustrate example of the present invention, and is not to this The restriction of the embodiment of invention.For those of ordinary skill in the field, on the basis of the above description can be with Make other changes in different forms.There is no necessity and possibility to exhaust all the enbodiments.And these belong to Protection scope of the present invention is still fallen within the obvious changes or variations that the connotation of the present invention is extended out.

Claims (5)

1. a kind of IP Address in LAN distributes optimization method, it is characterised in that comprises the following steps:
Step 1, route is arranged to IP address static allocation and non-mac address filter pattern;
Step 2, IP address of terminal allocation table and free IP addresses list are established, wherein, IP address of terminal allocation table is used to store The IP address of each terminal and corresponding terminal MAC address are already allocated to, free IP addresses list is used to store in the network segment Unappropriated IP address;
Step 3, when have terminal request access route when, judge whether the MAC Address of the terminal belongs to IP address of terminal allocation table The MAC Address of middle storage, if so, then performing step 4;Otherwise, step 7 is performed;
Step 4, judge that this request of the terminal accesses the IP address of route and the terminal stored in IP address of terminal allocation table Whether IP address corresponding to MAC Address matches, if matching, the current state for recording the IP address represents the IP for 1,1 Terminal corresponding to address is in access state;If not matching that, step 5 is performed;
Step 5, judge that this request of the terminal accesses the affiliated situation of IP address of route:
A, when belonging to IP address corresponding to other-end MAC Address in IP address of terminal allocation table, working as the IP address is judged Whether preceding state is 1, if so, then prompting the IP address of terminal to take, if it is not, the IP address then is allocated temporarily into the end End, remember that the current state of the IP address represents that terminal corresponding to the IP address is in non-access state for 0,0;
B, it is when belonging in free IP addresses list the IP address that stores, then terminal MAC in IP address of terminal allocation table is corresponding IP address to refresh be that this request accesses the IP address routeing and record the current state of the IP address be 1, update idle IP Address list;
C, when being both not belonging in IP address of terminal allocation table IP address corresponding to other-end MAC Address or with being not belonging to idle IP During the IP address stored in the list of location, then step 5 is performed;
Step 6, judge that this request of the terminal accesses the IP address that the IP address routeing is not belonging to the same network segment of the route;
Step 7, judge whether the IP address that this request of the terminal accesses route belongs in free IP addresses list the IP stored Address, if so, then correspondingly store the MAC Address of the terminal and IP address into IP address of terminal allocation table, and with remembering the IP The current state of location is 1, updates free IP addresses list.
2. IP Address in LAN distribution optimization method according to claim 1, it is characterised in that also interim including IP address It is excellent when terminal MAC address request accesses corresponding to the IP address in IP address of terminal allocation table in the case of distributing to terminal Choosing allows the access request of terminal MAC address corresponding to the IP address in IP address of terminal allocation table, forbids temporarily with distributing IP The access of the terminal of location.
3. IP Address in LAN distribution optimization method according to claim 1, it is characterised in that situation B updates in step 5 Free IP addresses list, specially by terminal MAC in IP address of terminal allocation table, originally corresponding IP address is added to the free time In IP address list, and the IP address that this request accesses route is deleted from free IP addresses list.
4. IP Address in LAN distribution optimization method according to claim 1, it is characterised in that updated in step 7 idle IP address list, it will specially store into IP address of terminal allocation table IP address and be deleted from free IP addresses list.
5. IP Address in LAN distribution optimization method according to claim 1, it is characterised in that the routing address uses C classes address.
CN201410666700.4A 2014-11-20 2014-11-20 A kind of IP Address in LAN distributes optimization method Active CN104378456B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410666700.4A CN104378456B (en) 2014-11-20 2014-11-20 A kind of IP Address in LAN distributes optimization method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410666700.4A CN104378456B (en) 2014-11-20 2014-11-20 A kind of IP Address in LAN distributes optimization method

Publications (2)

Publication Number Publication Date
CN104378456A CN104378456A (en) 2015-02-25
CN104378456B true CN104378456B (en) 2017-12-15

Family

ID=52557102

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410666700.4A Active CN104378456B (en) 2014-11-20 2014-11-20 A kind of IP Address in LAN distributes optimization method

Country Status (1)

Country Link
CN (1) CN104378456B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106713142B (en) * 2015-11-17 2019-12-24 陕西重型汽车有限公司 Method for transmitting IP message on CAN bus and IP local area network constructed by CAN bus network
CN105872130A (en) * 2016-06-14 2016-08-17 浪潮电子信息产业股份有限公司 Method for distributing IP (Internet Protocol) addresses and cloud management platform
CN106790740B (en) * 2016-11-24 2020-12-01 上海易杵行智能科技有限公司 Method for intelligently distributing static management address of switch in local area network
CN108848200A (en) * 2018-06-13 2018-11-20 郑州云海信息技术有限公司 Equipment adding method, device, equipment and medium in a kind of local area network
CN109769030B (en) * 2019-02-02 2022-01-11 京东科技控股股份有限公司 Method and apparatus for controlling access of applications
CN110149422A (en) * 2019-06-25 2019-08-20 苏州梦嘉信息技术有限公司 A kind of domain name management method and system
CN110855605B (en) * 2019-09-26 2022-05-13 山东鲁能软件技术有限公司 Safety protection method, system, equipment and readable storage medium for terminal equipment
CN113438330A (en) * 2021-05-07 2021-09-24 安徽亮亮电子科技有限公司 Adaptive local area network address allocation method for LED lamp
CN115604228A (en) * 2021-07-12 2023-01-13 中移(成都)信息通信科技有限公司(Cn) Communication method, device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1585360A (en) * 2004-05-28 2005-02-23 港湾网络有限公司 Addressing section recovering method between DSLAM apparatus
CN1770779A (en) * 2004-11-05 2006-05-10 泛泰·科力特株式会社 Method and system for managing ip address assigned to mobile station
CN102083059A (en) * 2009-11-30 2011-06-01 华为终端有限公司 Method and device for withdrawing preassigned IP addresses
CN103476143A (en) * 2012-06-07 2013-12-25 中国移动通信集团公司 Method, device and system for IP resource releasing of WLAN
WO2014178602A1 (en) * 2013-05-03 2014-11-06 Samsung Electronics Co., Ltd. Method and apparatus for assigning ip address in mobile communication network

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1585360A (en) * 2004-05-28 2005-02-23 港湾网络有限公司 Addressing section recovering method between DSLAM apparatus
CN1770779A (en) * 2004-11-05 2006-05-10 泛泰·科力特株式会社 Method and system for managing ip address assigned to mobile station
CN102083059A (en) * 2009-11-30 2011-06-01 华为终端有限公司 Method and device for withdrawing preassigned IP addresses
CN103476143A (en) * 2012-06-07 2013-12-25 中国移动通信集团公司 Method, device and system for IP resource releasing of WLAN
WO2014178602A1 (en) * 2013-05-03 2014-11-06 Samsung Electronics Co., Ltd. Method and apparatus for assigning ip address in mobile communication network

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"IP Address Allocation";Timothy Rooney;《IP Address Management Principles and Practice》;20111230;第35-64页 *
"IP地址管理系统的研究与实现";韩军浩;《北京邮电大学硕士学位论文》;20081106;全文 *

Also Published As

Publication number Publication date
CN104378456A (en) 2015-02-25

Similar Documents

Publication Publication Date Title
CN104378456B (en) A kind of IP Address in LAN distributes optimization method
CN103795602B (en) Network strategy configuration method and device of virtual network
CN101577675B (en) Method and device for protecting neighbor table in IPv6 network
CN104935572B (en) Multi-layer right management method and device
CN105245629B (en) Host communication method based on DHCP and device
CN105472048B (en) A kind of address distribution method, information aggregation method and relevant device
CN111107171B (en) Security defense method and device for DNS (Domain name Server), communication equipment and medium
CN103607432B (en) A kind of method and system of network creation and the network control center
CN101827138B (en) Optimized method and device for processing IPV6 filter rule
CN104040964B (en) Method, device and data center network across service area communication
CN101753458B (en) Method and device for processing ND neighbor table entry
US8855113B2 (en) Link state identifier collision handling
CN103595638B (en) A kind of MAC address learning method and device
CN104429028A (en) Network configuration method, device and system based on sdn
CN104468568A (en) Virtual machine security isolation method
CN106453690A (en) IP address allocation method and apparatus
CN111064793A (en) Method and system for maintaining and managing elastic public network IP address pool under public cloud platform
WO2007006200A1 (en) A method and system for realizing the access management of the network devices
CN102710452B (en) Method and device for managing visit of multiple clients
KR101039092B1 (en) Method for protecting and isolating host in internet protocol version 6 network
CN110505187B (en) Security rule management method, system, server and storage medium in hybrid cloud
CN115250264B (en) Controlling network traffic associated with domain names based on DNS-IP mapping
CN106789757B (en) Access control method and device
CN115766170A (en) Method and device for controlling trusted SDP network, storage medium and electronic device
JP4833249B2 (en) Connection control system, connection control method, and connection control program

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant