JP2005033302A - Method of automatically assigning ip address, and terminal device - Google Patents
Method of automatically assigning ip address, and terminal device Download PDFInfo
- Publication number
- JP2005033302A JP2005033302A JP2003193439A JP2003193439A JP2005033302A JP 2005033302 A JP2005033302 A JP 2005033302A JP 2003193439 A JP2003193439 A JP 2003193439A JP 2003193439 A JP2003193439 A JP 2003193439A JP 2005033302 A JP2005033302 A JP 2005033302A
- Authority
- JP
- Japan
- Prior art keywords
- address
- arp
- network
- response
- temporary
- 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.)
- Pending
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
- Small-Scale Networks (AREA)
Abstract
Description
【0001】
【発明の属する技術分野】
本発明はネットワークに接続される装置のIPアドレス自動割当て方法に関するものである。
【0002】
【従来の技術】
IPネットワーク環境に装置を接続する場合は、他のネットワーク装置と重複しない固有のIPアドレスの設定が必要となる。
【0003】
IPアドレスの設定には、ユーザがIPアドレスをネットワーク装置へ手動で入力する方法か、IPアドレスを動的に割当てる方法が用いられる。動的アドレス割当て方式の代表例には、DHCP(Dynamic Host Configuration Protocol)(参考文献:Droms, R., “Dynamic Host Configuration Protocol”, March 1997, RFC2131)がある。DHCPでは、IPアドレスを一元管理するサーバを設け、ネットワーク装置からの問い合わせに応じてネットワーク装置へIPアドレスの割当てを行う。
【0004】
手動でのIPアドレス設定の場合、ユーザが任意に設定できるためにネットワークに接続する装置が増えるとIPアドレスを重複して設定するなどの人為的ミスが起こりやすくなる。重複しないIPアドレスを確認しながら設定すると作業工数がかかる。また、DHCPサーバによる動的アドレス割当ての場合、接続をしようとしているネットワーク上にDHCPサーバが存在する場合はIPアドレスが一意に決まり通信ができるが、DHCPサーバが存在しない場合はIPアドレスが割当てられず通信できなくなる。
【0005】
上記課題を解決する方法の一例として、IPアドレスの自動割当て方法が提案されている(非特許文献1)。
【0006】
以下、非特許文献1に記載されているIPアドレス自動割当て方法について図を参照して説明する。図4はネットワーク装置の従来のIPアドレス割当て方法を示すフローチャート、図5は従来のIPアドレス割当て方法におけるネットワーク構成図である。
【0007】
DHCPサーバにアドレスを問い合わせる。(ステップ51)
アドレス問い合わせに対するDHCPサーバからの応答を受信したかどうか判定する。(ステップ52)
DHCPサーバからの応答を受信した場合、DHCPサーバから割当てられたIPアドレスを装置のIPアドレスとして決定する。(ステップ53)
DHCPサーバからの応答を受信しなかった場合、IPアドレスの自動割当てを行う。割当てるアドレスの範囲は、リンクローカルネットワークとして国際機関IANA(Internet Assigned Numbers Association)に登録されている“169.254/16”のネットワークアドレスを使用する。(参考文献:Manning, B., “Documenting Special Use IPv4 Address Blocks that have been registered with IANA/RIR”, May 2002)(ステップ54)
ホストアドレスとしてランダムな値を選択する。(ステップ55)
選択したIPアドレスが他のネットワーク装置で使用されていないかを検出するためにARP(Address Resolution Protocol)要求を送出する。(参考文献:Plummer, D., “An Ethernet Address Resolution Protocol −− or −− Converting Network Protocol Addresses to 48.bit Ethernet Address for Transmission on Ethernet Hardware”, November 1982) ARPは、IPアドレスからイーサネット(R)の物理アドレス(MACアドレス)を求めるのに使われるプロトコルである。(ステップ56)
ARP要求に対するARP応答を受信したかどうか判定する。(ステップ57)
ARP応答を受信できなかった場合、他のネットワーク装置が選択したIPアドレスを使用していないとみなし、自アドレスとして決定する。(ステップ58)
ARP応答を受信した場合、他のネットワーク装置が選択したIPアドレスを使用しているため、別のランダムなホストアドレスを選択する。(ステップ55)の処理へ戻ってその後の処理を繰り返す。(ステップ59)
また、IPv6(Internet Protocol version 6)では、IPアドレスの自動割当て方法が提案されている。(参考文献:Thomson, S., “IPv6 Stateless Address Auto−configuration”, December 1998, RFC2462)
上記のIPアドレス割当て方法は、各装置はルータに対し、IPアドレスのネットワークアドレスを示すプレフィックスを問い合わせる。ルータから送られるプレフィックスと自装置のMACアドレスとを合わせて自装置のIPアドレスに設定する。IPv6のアドレス長は128ビットと長く、MACアドレスをそのままIPアドレスのホストアドレスとして使用することができるため、IPアドレスが重複する可能性は少ない。
【0008】
しかしながら、現在のIPネットワークで用いられているのはIPv4(Internet Protocol version 4)である。ネットワークに接続するユーザが増加し、IPv4はアドレス長が32ビットと短く、IPv4のアドレスが枯渇する方向にあるが、ネットワーク全体をIPv6ネットワークに移行するにはまだ時間がかかるという問題がある。
【0009】
【非特許文献1】
Troll, R., “Automatically Choosingan IP Address in an Ad−Hoc IPv4 Network”, March 2000
【0010】
【発明が解決しようとする課題】
従来のIPアドレスの自動割当て方法では、IPアドレスが他の装置で使用されていないことを判定する条件としてARP応答が無いこととしていた。しかしながら、異なるネットワークアドレスをもつIPアドレス宛てのARP要求に対して、代理で自身のアドレスをARP応答する機能をもつ装置が同一ネットワーク上に設置されている場合、設定しようとしているIPアドレスによってはARP応答が必ず返ってくる場合がある。上記機能をもつ装置には一般的にルータが該当する。図3を用いて、上記機能を説明する。図3において、ネットワーク400は、IPネットワークに準拠するネットワークであり、ネットワーク装置501はネットワーク400に接続されている。ネットワーク600は、IPネットワークに準拠するネットワークであり、ネットワーク装置701はネットワーク600に接続されている。中継装置801はネットワーク400とネットワーク600との中継点に設置されており、異なるネットワークアドレスをもつパケット宛てのARP要求に応答する。
【0011】
ネットワーク400は「192.168.0/24」のネットワークアドレスとし、ネットワーク装置501のIPアドレスは「192.168.0.10/24」とする。ネットワーク600は「192.168.1/24」のネットワークアドレスとし、ネットワーク装置701のIPアドレスは「192.168.1.10/24」とする。中継装置801のネットワーク400側のインタフェースはIPアドレス「192.168.0.1」、MACアドレス「00:00:BE:78:00:5E」、ネットワーク600側のインタフェースはIPアドレス「192.168.1.1」、MACアドレス「00:00:BE:78:00:5F」が設定されている装置とする。
【0012】
ネットワーク装置501から異なるネットワーク上にあるネットワーク装置701へのARP要求が発生した場合、中継装置801はネットワーク装置701の代理として、中継装置801自身のインタフェースのMACアドレス「00:00:BE:78:00:5F」を応答する。
【0013】
特に、ネットワーク装置がDHCPサーバからのアドレス取得に失敗してリンクローカルネットワークをもつIPアドレスを決定するときに、ARPを代理応答する装置が存在する場合、選択した仮のIPアドレスが接続するネットワーク上で使用されていないIPアドレスだったとしても、代理応答する装置とは異なるネットワークアドレスであるIPアドレス宛てのARP要求であれば必ずARP応答が返ってきてしまう。このような装置が同一ネットワーク上にある場合、ARP応答が必ず返ってくるため、前述した従来のアドレスの自動割当て方法のようにARP応答が無いことがIPアドレスを決定する判断条件が成り立たなくなる。また、ARP要求を無駄に繰り返し送信しつづけることにもなるため、ネットワークに負担をかけるという問題がある。
【0014】
本発明は、従来の問題を解決するためになされたもので、異なるネットワークアドレスをもつIPアドレス宛てのARP要求に対して代理で自身のアドレスをARP応答する機能をもつ装置が同一ネットワーク上に設置されている場合でも、ネットワーク装置に自動的に固有のIPアドレスを設定することのできる方法を提供することを目的とする。
【0015】
【課題を解決するための手段】
本発明のIPアドレス割り当て方法は、ネットワークに接続する装置が、IPアドレス自動割当て用に予め予約されたネットワークアドレスとランダムに選択したホストアドレスからなる仮のIPアドレスを選択し、前記仮のIPアドレス宛てにARP(Address Resolution Protocol)要求を行い、ARP応答が無い場合、前記仮のIPアドレスを正式なIPアドレスとして利用し、ARP応答が複数である場合、仮のIPアドレスを使用している装置と、異なるネットワークアドレスをもつIPアドレス宛てのARP要求に対して代理で自身のアドレスをARP応答する機能をもつ装置が同一ネットワーク上にいると判断し、ARP情報を保持し、別の仮のIPアドレスを選択してARP要求を繰り返し、ARP応答がひとつである場合で、受信したARP応答と保持しているARP応答のMACアドレスを比較して同じであれば、代理でARP応答する機能をもつ装置からの応答であると判断し、前記仮のIPアドレスを正式なIPアドレスとして利用し、ARP応答がひとつである場合で、受信したARP応答と保持しているARP応答のMACアドレスを比較して異なっていれば、仮のIPアドレスを使用している装置と、異なるネットワークアドレスをもつIPアドレス宛てのARP要求に対して代理で自身のアドレスをARP応答する機能をもつ装置が同一ネットワーク上にいると判断し、ARP情報を保持し、別の仮のIPアドレスを選択してARP要求を繰り返すことを特徴とする方法をとっている。
【0016】
この方法によれば、ネットワーク上にARPを代理応答する装置が存在してもしなくても、ネットワークに接続する装置に固有のIPアドレスを割当てることができる。
【0017】
また、本発明のIPアドレス割り当て方法は、上記IPアドレス割り当て方法において、仮IPアドレスのホストアドレスに(MACアドレスの下位2バイト+仮IPアドレスを選択した回数)を選択することを特徴とする方法をとっている。
【0018】
この方法によれば、ハードウェアに固有のMACアドレスをホストアドレスに利用することで重複しにくい仮のIPアドレスを選択することができる。
【0019】
また、各端末装置は、受信するARP応答の数とMACアドレスの比較によりネットワークに接続する装置に固有のIPアドレスを割当てる手段を備えている。
【0020】
更に、各端末装置は、仮IPアドレスのホストアドレスに(MACアドレスの下位2バイト+仮IPアドレスを選択した回数)を選択する手段を備えている。
【0021】
各端末装置の機能は、コンピュータを受信するARP応答の数とMACアドレスの比較によりネットワークに接続する装置に固有のIPアドレスを割当てる手段として動作させるためのプログラムや、コンピュータを仮IPアドレスのホストアドレスに(MACアドレスの下位2バイト+仮IPアドレスを選択した回数)を選択する手段として動作させるためのプログラムを記録している媒体を、各端末装置にインストールすることにより実現される。
【0022】
【発明の実施の形態】
以下、本発明の実施の形態について、図面を用いて説明する。
【0023】
図1は、本発明の一実施の形態のIPアドレスの自動割当て処理を説明するネットワーク装置のフローチャートである。図2は本発明の一実施の形態のIPアドレス割当て方法におけるネットワーク構成図である。
【0024】
DHCPサーバにアドレスを問い合わせる。(ステップ11)
アドレス問い合わせに対するDHCPサーバからの応答を受信したかどうか判定する。(ステップ12)
DHCPサーバからの応答を受信した場合、DHCPサーバから割当てられたアドレスを自アドレスとして決定する。(ステップ13)
DHCPサーバからの応答を受信しなかった場合、IPアドレスの自動割当てを行う。リンクローカルネットワーク“169.254/16”をネットワークアドレスとして使用する。(ステップ14)
ホストアドレスとしてハードウェア固有のMACアドレスの下位2バイトを選択する。(ステップ15)
ステップ14とステップ15で選択した仮のIPアドレスが、他の装置で使用されていないか検出するためARP要求を送出する。(ステップ16)
ARP応答受信を判定する。(ステップ17)
ARP応答を受信しなかった場合、仮のIPアドレスを使用している装置も、代理でARP応答する機能をもつ装置も、接続しようとしているネットワーク上に存在しないと判断し、仮のIPアドレスを自アドレスとして決定する。(ステップ17、20)
ARP応答を一つ受信した場合、受信したARP情報のMACアドレスと保持しているARP情報のMACアドレスを比較する。(ステップ17,18,19)
比較したMACアドレスが同じである場合、代理でARP応答する機能をもつ装置が接続しようとしているネットワーク上に存在し、その装置からの応答であると判断し、仮のIPアドレスを自アドレスとして決定する。(ステップ19、20)
比較したMACアドレスが異なる場合、または、比較するARP情報が無い場合、代理でARP応答する機能をもつ装置からの応答であるか判断できないため、ARP情報を保持し、別の仮のホストアドレスとして(ハードウェア固有のMACアドレスの下位2バイト+仮のホストアドレスを選択した回数)を選択してステップ16の処理へ戻ってその後の処理を繰り返す。(ステップ19、21)ARP応答を複数受信した場合、仮のIPアドレスを使用している装置と代理でARP応答する機能をもつ装置が同一ネットワーク上に存在していると判断する。ARP情報を保持し、別の仮のホストアドレスとして(ハードウェア固有のMACアドレスの下位2バイト+仮のホストアドレスを選択した回数)を選択して、ステップ16の処理へ戻ってその後の処理を繰り返す。(ステップ17、18、21)
以上の手順により、最終的に重複しないIPアドレスを決定し、IPアドレスの自動割当てが達成される。
【0025】
次に、上述した本発明の実施の形態について図面を用いて更に詳細に説明する。
【0026】
図2において、ネットワーク100は、IPネットワークに準拠するネットワークであり、ネットワーク装置201〜204はネットワーク100に接続されている。中継装置301はネットワーク100に接続されており、異なるネットワークアドレスをもつIPパケット宛てのARP要求に代理で自身のアドレスを代理応答する。また、DHCPサーバは接続されていない状態とする。
【0027】
ネットワーク100は「192.168.0/24」のネットワークアドレス、また、ネットワーク装置201はネットワーク100に接続しようとしているMACアドレスの下位2バイトが「100.10」である装置、ネットワーク202はリンクローカルアドレス「169.254.100.10」、MACアドレス「00:00:BE:78:00:6A」が設定されている装置、ネットワーク装置203とネットワーク装置204はネットワーク100と同じネットワークアドレスのIPアドレス「192.168.0.3」、「192.168.0.4」がそれぞれ設定されている装置、中継装置301のネットワーク100側のインタフェースはIPアドレス「192.168.0.1」、MACアドレス「00:00:BE:78:00:6B」が設定されている装置とする。仮のIPアドレスのホストアドレスは(MACアドレスの下位2ビット+仮のIPアドレス選択回数)を選択することとする。
【0028】
ネットワーク装置201は、ネットワーク100に接続されるとDHCPサーバにアドレスの問い合わせをする。(ステップ11)
DHCPサーバが存在していないため、アドレスの問い合わせに対するDHCPサーバからの応答が無い。(ステップ12)
DHCPサーバからの応答を受信しなかったため、ネットワーク装置201はIPアドレスの自動割当てを行う。リンクローカルネットワーク「169.254/16」をネットワークアドレスとして使用する。(ステップ14)
ネットワーク装置201は、ホストアドレスとしてMACアドレスの下位2バイトである「100.10」を選択する。(ステップ15)
ネットワーク装置201は、選択したアドレス「169.254.100.10」を仮のIPアドレスとし、このアドレスが他の装置で使用されていないか検出するため「169.254.100.10」宛てにARP要求を送出する。(ステップ16)
中継装置301がネットワーク100と異なるネットワークアドレス宛てのARP要求であるため代理で自身のアドレスをARP応答する。また、ネットワーク装置202がIPアドレスが同じであるためARP応答する。ネットワーク装置201は、中継装置301およびネットワーク装置202からのARP応答を受信する。(ステップ17)
受信したARP応答はふたつである。(ステップ18)
ネットワーク装置201は、仮のIPアドレスを使用している装置と代理でARP応答する機能をもつ装置が同一ネットワーク上に存在していると判断する。受信したARP情報を図6に示すようなアドレステーブルに保持し、別のホストアドレスとしてMACアドレスの下位2バイトである「100.10」に仮のIPアドレス選択回数を足した「100.11」を選択する。(ステップ21)
「169.254.100.11」宛てにARP要求を送出する。(ステップ16)
中継装置301がネットワーク100と異なるネットワークアドレス宛てのARP要求であるため代理で自身のアドレスのARP応答する。ネットワーク装置201は、中継装置301からのARP応答を受信する。(ステップ17)
受信したARP応答はひとつである。(ステップ18)
ネットワーク装置201は、受信したARP情報のMACアドレスと図6のアドレステーブルに保持していたARP情報のMACアドレスを比較する。最初に受信したARP応答の送信元MACアドレスは「00:00:BE:78:00:6A」と「00:00:BE:78:00:6B」である。受信したARP応答のMACアドレスは「00:00:BE:78:00:6B」であり、最初のARP応答の送信元のうち一台は、受信したARP応答の送信元の装置と同じであることがわかる。(ステップ19)
MACアドレスが同じであるため、受信したARP応答は代理でARP応答する機能をもつ装置からの応答であると判断する。他の装置が仮アドレスを使用していないことがわかり、「169.254.100.11」を自アドレスとして決定する。(ステップ20)
【0029】
【発明の効果】
以上のように本発明は、ネットワークに接続する装置が、IPアドレス自動割当て用に予め予約されたネットワークアドレスとランダムに選択したホストアドレスからなる仮のIPアドレスを選択し、前記仮のIPアドレス宛てにARP(Address Resolution Protocol)要求を行い、ARP応答が無い場合、前記仮のIPアドレスを正式なIPアドレスとして利用し、ARP応答が複数である場合、仮のIPアドレスを使用している装置と、異なるネットワークアドレスをもつIPアドレス宛てのARP要求に対して代理で自身のアドレスをARP応答する機能をもつ装置が同一ネットワーク上にいると判断し、ARP情報を保持し、別の仮のIPアドレスを選択してARP要求を繰り返し、ARP応答がひとつである場合で、受信したARP応答と保持しているARP応答のMACアドレスを比較して同じであれば、代理でARP応答する機能をもつ装置からの応答であると判断し、前記仮のIPアドレスを正式なIPアドレスとして利用し、ARP応答がひとつである場合で、受信したARP応答と保持しているARP応答のMACアドレスを比較して異なっていれば、仮のIPアドレスを使用している装置と、異なるネットワークアドレスをもつIPアドレス宛てのARP要求に対して代理で自身のアドレスをARP応答する機能をもつ装置が同一ネットワーク上にいると判断し、ARP情報を保持し、別の仮のIPアドレスを選択してARP要求を繰り返す手段を設けることにより、代理で自身のアドレスをARP応答する機能をもつ装置が存在してもしなくても重複しないIPアドレスを決定できるという効果を有するIPアドレスの自動割当て方法を提供することができるものである。
【0030】
また、上記IPアドレス割り当て方法において、仮IPアドレスのホストアドレスに(MACアドレスの下位2バイト+仮IPアドレスを選択した回数)を選択する手段を設けることにより、ハードウェアに固有のMACアドレスをホストアドレスに利用することで重複しにくい仮のIPアドレスを選択することができるという効果を有するIPアドレスの自動割当て方法を提供することができるものである。
【図面の簡単な説明】
【図1】本発明の一実施の形態におけるIPアドレス自動割当て方法の動作説明のためのネットワーク装置のフロー図
【図2】本発明のIPアドレス自動割当て方法のネットワーク構成図
【図3】代理ARP応答の特徴的な動作手順を説明するための図
【図4】従来のIPアドレス自動割当て方法の動作説明のためのネットワーク装置のフロー図
【図5】従来のIPアドレス自動割当て方法のネットワーク構成図
【図6】ARP応答した装置のMACアドレスを保持するテーブルの一例を示す図
【符号の説明】
100 IPネットワーク
201〜204 ネットワーク装置
301 中継装置
400 IPネットワーク
501 ネットワーク装置
600 IPネットワーク
701 ネットワーク装置
801 中継装置
901〜904 ネットワーク装置[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a method for automatically assigning IP addresses of devices connected to a network.
[0002]
[Prior art]
When connecting a device to an IP network environment, it is necessary to set a unique IP address that does not overlap with other network devices.
[0003]
For setting the IP address, a method in which the user manually inputs the IP address to the network device or a method in which the IP address is dynamically assigned is used. A typical example of the dynamic address allocation method is DHCP (Dynamic Host Configuration Protocol) (reference: Droms, R., “Dynamic Host Configuration Protocol”, March 1997, RFC2131). In DHCP, a server that centrally manages IP addresses is provided, and IP addresses are assigned to network devices in response to inquiries from network devices.
[0004]
In the case of manual IP address setting, since the user can arbitrarily set the IP address, an increase in the number of devices connected to the network tends to cause human error such as setting an IP address redundantly. If it is set while confirming the IP addresses that do not overlap, it will take time. In addition, in the case of dynamic address assignment by a DHCP server, if there is a DHCP server on the network to be connected, the IP address is uniquely determined and communication is possible, but if there is no DHCP server, an IP address is assigned. Communication is impossible.
[0005]
As an example of a method for solving the above problem, an automatic IP address assignment method has been proposed (Non-Patent Document 1).
[0006]
Hereinafter, an IP address automatic assignment method described in Non-Patent Document 1 will be described with reference to the drawings. FIG. 4 is a flowchart showing a conventional IP address assignment method of a network apparatus, and FIG. 5 is a network configuration diagram in the conventional IP address assignment method.
[0007]
Queries the address to the DHCP server. (Step 51)
It is determined whether a response from the DHCP server to the address inquiry is received. (Step 52)
When the response from the DHCP server is received, the IP address assigned by the DHCP server is determined as the IP address of the apparatus. (Step 53)
When a response from the DHCP server is not received, an IP address is automatically assigned. As a range of addresses to be allocated, a network address of “169.254 / 16” registered in an international organization IANA (Internet Assigned Numbers Association) as a link local network is used. (Reference: Manning, B., “Documenting Special Use IPv4 Address Blocks that have bean registered with IANA / RIR”, May 2002) (Step 54).
Select a random value as the host address. (Step 55)
An ARP (Address Resolution Protocol) request is sent to detect whether the selected IP address is not being used by another network device. (Reference: Plummer, D., “An Ethernet Address Resolution Protocol --- or --- Converting Network Protocol Address to 48.bit Ethernet Address for Transnet Address, HR, and RB,” Is a protocol used to obtain the physical address (MAC address) of (Step 56)
It is determined whether an ARP response to the ARP request has been received. (Step 57)
When the ARP response cannot be received, it is determined that the IP address selected by the other network device is not used, and is determined as its own address. (Step 58)
When the ARP response is received, another random host address is selected because another network device uses the selected IP address. Returning to the process of (Step 55), the subsequent processes are repeated. (Step 59)
In IPv6 (Internet Protocol version 6), an automatic IP address assignment method has been proposed. (Reference: Thomson, S., “IPv6 Stateless Address Auto-configuration”, December 1998, RFC 2462)
In the above IP address assignment method, each device inquires the router for a prefix indicating the network address of the IP address. The prefix sent from the router and the MAC address of the own device are combined and set as the IP address of the own device. Since the IPv6 address length is as long as 128 bits and the MAC address can be used as the host address of the IP address as it is, there is little possibility that the IP address will be duplicated.
[0008]
However, IPv4 (Internet Protocol version 4) is used in the current IP network. Although the number of users connected to the network increases and IPv4 has a short address length of 32 bits and IPv4 addresses are in a depletion direction, there is a problem that it still takes time to move the entire network to the IPv6 network.
[0009]
[Non-Patent Document 1]
Troll, R.M. , “Automatically Choosingan IP Address in an Ad-Hoc IPv4 Network”, March 2000.
[0010]
[Problems to be solved by the invention]
In the conventional automatic IP address assignment method, there is no ARP response as a condition for determining that the IP address is not used by another device. However, when a device having the function of ARP replying to its own address on behalf of an ARP request addressed to an IP address having a different network address is installed on the same network, depending on the IP address to be set, the ARP A response may always be returned. A router generally corresponds to a device having the above functions. The above function will be described with reference to FIG. In FIG. 3, a
[0011]
The
[0012]
When an ARP request is issued from the
[0013]
In particular, when a network device fails to obtain an address from a DHCP server and determines an IP address having a link local network, if there is a device that makes a proxy response to ARP, the selected temporary IP address is connected to the network. Even if the IP address is not used in, if the ARP request is for an IP address that is a network address different from that of the proxy responding device, an ARP response is always returned. When such a device is on the same network, an ARP response is always returned, so that there is no determination condition for determining an IP address if there is no ARP response as in the conventional automatic address assignment method described above. In addition, since the ARP request is repeatedly transmitted unnecessarily, there is a problem of placing a burden on the network.
[0014]
The present invention has been made to solve the conventional problems, and an apparatus having a function of ARP replying on its own address on behalf of an ARP request addressed to an IP address having a different network address is installed on the same network. It is an object of the present invention to provide a method capable of automatically setting a unique IP address in a network device even when the network device is used.
[0015]
[Means for Solving the Problems]
In the IP address assignment method of the present invention, a device connected to a network selects a temporary IP address consisting of a network address reserved in advance for automatic IP address assignment and a randomly selected host address, and the temporary IP address A device that makes an ARP (Address Resolution Protocol) request to an address and uses the temporary IP address as an official IP address when there is no ARP response, and uses a temporary IP address when there are multiple ARP responses In response to an ARP request addressed to an IP address having a different network address, it is determined that a device having a function of performing an ARP response on its own address as a proxy is on the same network, holds ARP information, and uses another temporary IP. Select the address and repeat the ARP request, AR If the response is one and the MAC address of the received ARP response is the same as the MAC address of the held ARP response, it is determined that the response is from a device having a function of making an ARP response on behalf of the response, If the temporary IP address is used as a formal IP address and there is only one ARP response, and the MAC address of the received ARP response is different from the MAC address of the stored ARP response, the temporary IP address is It is determined that a device having the function of ARP replying its own address on behalf of an ARP request addressed to an IP address having a different network address from the device being used is on the same network, and holding ARP information, The method is characterized by selecting another temporary IP address and repeating the ARP request.
[0016]
According to this method, a unique IP address can be assigned to a device connected to the network regardless of whether or not there is a device that makes a proxy response to ARP on the network.
[0017]
The IP address assignment method of the present invention is characterized in that, in the above IP address assignment method, (the lower 2 bytes of the MAC address + the number of times the temporary IP address is selected) is selected as the host address of the temporary IP address. Have taken.
[0018]
According to this method, it is possible to select a temporary IP address that is unlikely to overlap by using a MAC address unique to hardware as a host address.
[0019]
Each terminal device includes means for assigning a unique IP address to a device connected to the network by comparing the number of received ARP responses with the MAC address.
[0020]
Each terminal device further includes means for selecting (the lower 2 bytes of the MAC address + the number of times the temporary IP address is selected) as the host address of the temporary IP address.
[0021]
The function of each terminal device is a program for operating as a means for assigning a unique IP address to a device connected to the network by comparing the number of ARP responses received by the computer and the MAC address, or the host address of the temporary IP address. This is realized by installing in each terminal device a medium that records a program for operating as a means for selecting (lower 2 bytes of MAC address + number of times a temporary IP address has been selected).
[0022]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[0023]
FIG. 1 is a flowchart of a network apparatus for explaining an IP address automatic assignment process according to an embodiment of the present invention. FIG. 2 is a network configuration diagram in the IP address assignment method according to the embodiment of the present invention.
[0024]
Queries the address to the DHCP server. (Step 11)
It is determined whether a response from the DHCP server to the address inquiry is received. (Step 12)
When the response from the DHCP server is received, the address assigned from the DHCP server is determined as the own address. (Step 13)
When a response from the DHCP server is not received, an IP address is automatically assigned. The link local network “169.254 / 16” is used as the network address. (Step 14)
The lower 2 bytes of the hardware-specific MAC address are selected as the host address. (Step 15)
In order to detect whether or not the temporary IP address selected in
ARP response reception is determined. (Step 17)
If the ARP response is not received, it is determined that neither the device using the temporary IP address nor the device having the function of performing the ARP response on behalf of the device exists on the network to be connected, and sets the temporary IP address. It is determined as its own address. (Steps 17 and 20)
When one ARP response is received, the MAC address of the received ARP information is compared with the MAC address of the held ARP information. (Steps 17, 18, and 19)
If the compared MAC addresses are the same, a device having a function of making an ARP response on behalf of the device is present on the network to be connected, and it is determined that the response is from the device, and a temporary IP address is determined as its own address. To do. (Steps 19 and 20)
If the compared MAC addresses are different, or if there is no ARP information to be compared, it is impossible to determine whether the response is from a device having a function of making an ARP response on behalf of the proxy, so the ARP information is retained and used as another temporary host address. (The lower 2 bytes of the hardware-specific MAC address + the number of times the temporary host address has been selected) is selected and the processing returns to step 16 to repeat the subsequent processing. (Steps 19 and 21) When a plurality of ARP responses are received, it is determined that a device using a temporary IP address and a device having a function of making an ARP response on behalf exist on the same network. Holds the ARP information, selects (the lower two bytes of the hardware-specific MAC address + the number of times the temporary host address has been selected) as another temporary host address, returns to the processing of
By the above procedure, IP addresses that do not overlap each other are finally determined, and automatic IP address assignment is achieved.
[0025]
Next, the embodiment of the present invention described above will be described in more detail with reference to the drawings.
[0026]
In FIG. 2, a network 100 is a network that conforms to an IP network, and
[0027]
The network 100 is a network address “192.168.0 / 24”, the
[0028]
When the
Since there is no DHCP server, there is no response from the DHCP server to the address inquiry. (Step 12)
Since the response from the DHCP server has not been received, the
The
The
Since the relay device 301 is an ARP request addressed to a network address different from that of the network 100, the proxy device ARP responds with its own address. Further, since the network device 202 has the same IP address, it makes an ARP response. The
There are two ARP responses received. (Step 18)
The
An ARP request is sent to “169.254.100.11”. (Step 16)
Since the relay device 301 is an ARP request addressed to a network address different from that of the network 100, the ARP response of its own address is made by proxy. The
One ARP response is received. (Step 18)
The
Since the MAC addresses are the same, it is determined that the received ARP response is a response from a device having a function of making an ARP response on behalf of the proxy. It can be seen that another device is not using the temporary address, and “169.254.100.11” is determined as its own address. (Step 20)
[0029]
【The invention's effect】
As described above, according to the present invention, a device connected to a network selects a temporary IP address composed of a network address reserved in advance for automatic IP address assignment and a randomly selected host address, and is addressed to the temporary IP address. When there is no ARP response, the temporary IP address is used as the formal IP address, and when there are a plurality of ARP responses, the device using the temporary IP address is used. It is determined that a device having a function of ARP replying its own address on behalf of an ARP request addressed to an IP address having a different network address is on the same network, holds ARP information, and has another temporary IP address Select ARP and repeat the ARP request, one ARP response In some cases, if the MAC address of the received ARP response is the same as the MAC address of the held ARP response, it is determined that the response is from a device having a function of ARP response on behalf of the proxy, and the temporary IP address Is used as a formal IP address, and if the MAC address of the received ARP response is different from the MAC address of the stored ARP response, the temporary IP address is used. It is determined that the device and the device having the function of ARP replying its own address on behalf of the ARP request destined for the IP address having a different network address are on the same network, holding the ARP information, and another temporary There is a device that has the function of ARP response of its own address on behalf of the proxy by providing means to select the IP address and repeat the ARP request It is possible to provide an IP address automatic assignment method that has the effect of being able to determine IP addresses that do not overlap even if they are not.
[0030]
Further, in the above IP address assignment method, by providing means for selecting (the lower 2 bytes of the MAC address + the number of times the temporary IP address is selected) as the host address of the temporary IP address, the MAC address unique to the hardware is hosted. It is possible to provide an IP address automatic assignment method that has the effect of being able to select a temporary IP address that is unlikely to be duplicated when used as an address.
[Brief description of the drawings]
FIG. 1 is a flow diagram of a network device for explaining the operation of an automatic IP address assignment method according to an embodiment of the present invention. FIG. 2 is a network configuration diagram of an automatic IP address assignment method according to the present invention. FIG. 4 is a flow diagram of a network device for explaining the operation of the conventional automatic IP address assignment method. FIG. 5 is a network configuration diagram of the conventional automatic IP address assignment method. FIG. 6 is a diagram showing an example of a table holding MAC addresses of devices that have made an ARP response.
100 IP network 201-204 network device 301
Claims (5)
ARP応答が無い場合、前記仮のIPアドレスを正式なIPアドレスとして利用し、
ARP応答が複数である場合、前記仮のIPアドレスを使用している装置と、異なるネットワークアドレスをもつIPアドレス宛てのARP要求に対して代理で自身のアドレスをARP応答する機能をもつ装置と、が同一ネットワーク上にいると判断し、ARP情報を保持し、別の仮のIPアドレスを選択してARP要求を繰り返し、
ARP応答がひとつである場合で、受信したARP応答と保持しているARP応答のMACアドレスを比較して同じであれば、代理でARP応答する機能をもつ装置からの応答であると判断し、前記仮のIPアドレスを正式なIPアドレスとして利用し、
ARP応答がひとつである場合で、受信したARP応答と保持しているARP応答のMACアドレスをそれぞれ比較して異なっているかまたはARP応答を保持しておらず比較できない場合には、前記受信したARP情報を保持し、別の仮のIPアドレスを選択してARP要求を繰り返す、
ことを特徴とするIPアドレスの自動割当て方法。A device connected to the network selects a temporary IP address composed of a network address reserved in advance for automatic IP address assignment and a randomly selected host address, and an ARP (Address Resolution Protocol) request is sent to the temporary IP address. And
If there is no ARP response, use the temporary IP address as the official IP address,
When there are a plurality of ARP responses, a device using the temporary IP address, a device having a function of ARP replying its own address on behalf of an ARP request addressed to an IP address having a different network address, Are in the same network, hold the ARP information, select another temporary IP address and repeat the ARP request,
If there is only one ARP response and the MAC address of the received ARP response and the stored ARP response are the same, it is determined that the response is from a device having a function of ARP response on behalf of the proxy, Use the temporary IP address as the official IP address,
If there is only one ARP response, the received ARP response and the MAC address of the held ARP response are different from each other, or if the ARP response is not held and cannot be compared, the received ARP response Keep the information, select another temporary IP address and repeat the ARP request,
A method of automatically assigning an IP address.
前記ARPを記憶するARP記憶手段と、を具備する端末装置であって、
前記ARP要求手段は、
ARP応答が無い場合、前記仮のIPアドレスを正式なIPアドレスとして選択し、
ARP応答が複数である場合、仮のIPアドレスを使用している装置と、異なるネットワークアドレスをもつIPアドレス宛てのARP要求に対して代理で自身のアドレスをARP応答する機能をもつ装置が同一ネットワーク上にいると判断し前記ARP記憶手段にARP情報を記憶させ、別の仮のIPアドレスを選択してARP要求を繰り返し、
ARP応答がひとつである場合で、受信したARP応答と保持しているARP応答のMACアドレスを比較して同じであれば、代理でARP応答する機能をもつ装置からの応答であると判断し、前記仮のIPアドレスを正式なIPアドレスとして選択し、
ARP応答がひとつである場合で、受信したARP応答と保持しているARP応答のMACアドレスを比較して異なるかもしくは前記ARP記憶手段に比較対照のARPが無い場合には、前記受信したARP情報を前記ARP記憶手段に保持させ、別の仮のIPアドレスを選択してARP要求を繰り返す、
ことを特徴とする端末装置。ARP request means for selecting a temporary IP address composed of a network address reserved in advance for automatic IP address allocation and a randomly selected host address, and making an ARP (Address Resolution Protocol) request to the temporary IP address;
ARP storage means for storing the ARP, and a terminal device comprising:
The ARP request means includes
If there is no ARP response, select the temporary IP address as the formal IP address,
When there are a plurality of ARP responses, the device using the temporary IP address and the device having the function of ARP replying its own address on behalf of the ARP request addressed to the IP address having a different network address are in the same network. ARP information is stored in the ARP storage means, another tentative IP address is selected, and the ARP request is repeated.
If there is only one ARP response and the MAC address of the received ARP response and the stored ARP response are the same, it is determined that the response is from a device having a function of ARP response on behalf of the proxy, Select the temporary IP address as the official IP address,
If there is only one ARP response and the MAC address of the received ARP response is different from the MAC address of the held ARP response or if there is no comparison ARP in the ARP storage means, the received ARP information In the ARP storage means, select another temporary IP address and repeat the ARP request,
A terminal device characterized by that.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003193439A JP2005033302A (en) | 2003-07-08 | 2003-07-08 | Method of automatically assigning ip address, and terminal device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003193439A JP2005033302A (en) | 2003-07-08 | 2003-07-08 | Method of automatically assigning ip address, and terminal device |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2005033302A true JP2005033302A (en) | 2005-02-03 |
Family
ID=34204902
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2003193439A Pending JP2005033302A (en) | 2003-07-08 | 2003-07-08 | Method of automatically assigning ip address, and terminal device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2005033302A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2007034751A (en) * | 2005-07-27 | 2007-02-08 | Noritsu Koki Co Ltd | Program for ordering photo print |
JP2007158569A (en) * | 2005-12-02 | 2007-06-21 | Fujitsu Ltd | Network fault detecting apparatus |
US7849218B2 (en) | 2006-05-19 | 2010-12-07 | Panasonic Corporation | HDMI logical address assignment method for use in wireless communication system |
US9021132B2 (en) | 2011-01-24 | 2015-04-28 | Fujitsu Limited | Address translation method, address translation proxy response method, address translation device, and address translation proxy response device |
-
2003
- 2003-07-08 JP JP2003193439A patent/JP2005033302A/en active Pending
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2007034751A (en) * | 2005-07-27 | 2007-02-08 | Noritsu Koki Co Ltd | Program for ordering photo print |
JP4731236B2 (en) * | 2005-07-27 | 2011-07-20 | Nkワークス株式会社 | Photo print ordering program |
JP2007158569A (en) * | 2005-12-02 | 2007-06-21 | Fujitsu Ltd | Network fault detecting apparatus |
JP4510751B2 (en) * | 2005-12-02 | 2010-07-28 | 富士通株式会社 | Network failure detection device |
US7849218B2 (en) | 2006-05-19 | 2010-12-07 | Panasonic Corporation | HDMI logical address assignment method for use in wireless communication system |
US9021132B2 (en) | 2011-01-24 | 2015-04-28 | Fujitsu Limited | Address translation method, address translation proxy response method, address translation device, and address translation proxy response device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6697360B1 (en) | Method and apparatus for auto-configuring layer three intermediate computer network devices | |
US6532217B1 (en) | System for automatically determining a network address | |
USRE42078E1 (en) | Method for preventing IP address cheating in dynamic address allocation | |
US7152099B1 (en) | Friend configuration and method for network devices | |
US6856602B1 (en) | Method and system for communication | |
JP4728792B2 (en) | IP communication apparatus, IP communication system including the same, and IP address setting method of IP communication apparatus | |
US10218671B2 (en) | Dynamic media access control address allocation and leasing for wireless network | |
WO2014094633A1 (en) | Method, relay device, and system for acquiring internet protocol address in network | |
US9118721B1 (en) | Socket-based internet protocol for wireless networks | |
JP5950699B2 (en) | COMMUNICATION DEVICE AND ITS CONTROL METHOD | |
WO2013064170A1 (en) | Discovery and disconnection of client addresses in an access node for an ip network | |
KR100864158B1 (en) | Address generation/allocation method based on wireless broadband access network, mobile resource configuration method using its | |
EP2888863B1 (en) | Method and apparatus for configuring dhcp client | |
CN107547528B (en) | IPv6 stateless address allocation method and device | |
JP2004507976A (en) | Assigning addresses to mobile stations | |
WO2014086167A1 (en) | Mobile terminal and address allocation method and system thereof | |
CN111935335A (en) | DHCP address allocation method and device | |
CN113660357A (en) | Method and device for automatically acquiring IP address by IPv6 dual-stack system | |
EP2178265A1 (en) | System and method for mobile IP | |
JP4549055B2 (en) | Setting method of network address in wireless personal area network | |
JP2005033302A (en) | Method of automatically assigning ip address, and terminal device | |
JP2001308909A (en) | Method for assigning logical network address and terminal | |
EP2961110A1 (en) | Packet transmission method and apparatus, and server | |
JP2006211347A (en) | Radio communication system | |
JP2002237816A (en) | Automatic address assigning method |