Device and method for detecting network information
Abstract
Problem to be solved.To provide a network information detection device capable of detecting network information without requiring a server function for providing network information.
Solution.A packet monitor (23) that monitors a packet on a LAN to which a plurality of devices are connected, and a network device that uses the IP address based on the IP address contained in at least one monitored packet. It has a subnet mask detection unit (24) that detects the set subnet mask. If the destination IP address and destination MAC address included in the monitored packet do not indicate the same network device, the router detector (26) detects the IP address corresponding to the destination MAC address as the router IP address. ). [Selection diagram] Fig. 2
Term
Term ended
Projected expiry passed 25 June 2023, 3.2 years ago.
- Priority
- Filed
- Published
- Projected expiry
- Today
31 claims: 9 independent, 22 dependent
- 1複数のネットワーク機器が接続されたローカルネットワークのネットワーク情報を検出する装置において、前記ローカルネットワーク上のパケットをモニタするパケットモニタ手段と、前記パケットモニタ手段によりモニタされた少なくとも1個のパケットに含まれるIP(Internet Protocol)アドレスに基づいて、前記モニタされたパケットに関係するネットワーク機器に設定されたサブネットマスクを検出するサブネットマスク検出手段と、を有することを特徴とするネットワーク情報検出装置。
- 2前記サブネットマスク検出手段は、前記モニタされた少なくとも1個のパケットに含まれる送信元IPアドレスおよび送信先IPアドレスの最大IPアドレスと最小IPアドレスとを求め、前記最大IPアドレスおよび前記最小IPアドレスのサブネットホスト部における異なるビットの最上位を特定することで前記サブネットマスクを検出することを特徴とする請求項1記載のネットワーク情報検出装置。
- 3前記サブネットマスク検出手段は、モニタされた複数のパケットの各々に含まれる送信元IPアドレスおよび送信先IPアドレスから各パケットのIP領域を求め、前記モニタされた複数のパケットのIP領域が重なる場合にはそれらを1つのIP領域とし、最終的に求められた少なくとも1個のIP領域から最大IPアドレスと最小IPアドレスとを求め、前記最大IPアドレスおよび前記最小IPアドレスのサブネットホスト部における異なるビットの最上位を特定することで前記サブネットマスクを検出することを特徴とする請求項1記載のネットワーク情報検出装置。
- 4前記サブネットマスク検出手段は、モニタされた1個のパケットに含まれるIPアドレスとネットワーク層で通信可能な他のIPアドレスの範囲を求め、当該IPアドレス範囲に従って前記サブネットマスクを検出することを特徴とする請求項1記載のネットワーク情報検出装置。
- 5さらに、前記サブネットマスク検出手段により検出されたサブネットマスクにより示されるサブネット内のIPアドレスに対してARP要求を送信し、ARP応答が返信されないIPアドレスを割当可能なIPアドレスとして決定するIPアドレス決定手段を有することを特徴とする請求項1記載のネットワーク情報検出装置。
- 6さらに、前記サブネットマスク検出手段により検出されたサブネットマスクにより示されるサブネット内のIPアドレスに対してICMPエコー要求を順次送信し、それに対するICMP応答からルータのIPアドレスを検出するルータ検出手段を有することを特徴とする請求項1記載のネットワーク情報検出装置。
- 7前記ICMP応答はICMP経路変更要求メッセージおよびICMP時間切れメッセージのいずれかであることを特徴とする請求項6記載のネットワーク情報検出装置。
- 8さらに、前記パケットモニタ手段によりモニタされたパケットに含まれる送信先IPアドレスと送信先MACアドレスとが同一のネットワーク機器を指示しない場合、当該送信先MACアドレスに対応するIPアドレスをルータのIPアドレスとして検出するルータ検出手段を有することを特徴とする請求項1記載のネットワーク情報検出装置。
- 9さらに、ICMPのエコー要求およびエコー応答機能を用いて、モニタされたIPアドレスを使用している他のネットワーク機器のサブネットマスクと自己のサブネットマスクとの同一性を判定するサブネットマスク同一性判定手段を有し、前記他のネットワーク機器のサブネットマスクと前記自己のサブネットマスクとが異なる場合、前記サブネットマスク検出手段により当該他のネットワーク機器のサブネットマスクを検出することを特徴とする請求項1記載のネットワーク情報検出装置。
- 10複数のネットワーク機器が接続されたローカルネットワークのネットワーク情報を検出する装置において、前記ローカルネットワーク上のパケットをモニタするパケットモニタ手段と、前記パケットモニタ手段によりモニタされたパケットに含まれる送信先IPアドレスと送信先MACアドレスとが同一のネットワーク機器を指示しない場合、当該送信先MACアドレスに対応するIPアドレスをルータのIPアドレスとして検出するルータ検出手段と、を有することを特徴とするネットワーク情報検出装置。
- 11複数のネットワーク機器が接続されたローカルネットワークにおけるネットワーク情報を検出する方法において、a)前記ローカルネットワーク上のパケットをモニタするステップと、b)モニタされた少なくとも1個のパケットに含まれるIPアドレスに基づいて、前記モニタされたパケットに関係するネットワーク機器に設定されたサブネットマスクを検出するステップと、を有することを特徴とするネットワーク情報検出方法。
- 12前記ステップb)は、前記モニタされた少なくとも1個のパケットに含まれる送信元IPアドレスおよび送信先IPアドレスの最大IPアドレスと最小IPアドレスとを検出し、前記最大IPアドレスおよび前記最小IPアドレスのサブネットホスト部における異なるビットのうち最上位を特定し、前記異なる最上位ビットより1つ上位のビットから上位すべてのビットをセット状態とし、前記異なる最上位ビット以下のビットをすべてリセット状態にすることで前記サブネットマスクを生成する、ことを特徴とする請求項11記載のネットワーク情報検出方法。
- 13前記ステップb)は、モニタされた複数のパケットの各々に含まれる送信元IPアドレスおよび送信先IPアドレスから各パケットのIP領域を生成し、前記モニタされた複数のパケットのIP領域が互いに重なる場合にはそれらを1つのIP領域に結合し、最終的に求められた少なくとも1個のIP領域から最大IPアドレスと最小IPアドレスとを検出し、前記最大IPアドレスおよび前記最小IPアドレスのサブネットホスト部における異なるビットのうち最上位を特定し、前記異なる最上位ビットより1つ上位のビットから上位すべてのビットをセット状態とし、前記異なる最上位ビット以下のビットをすべてリセット状態にすることで前記サブネットマスクを生成する、ことを特徴とする請求項11記載のネットワーク情報検出方法。
- 14前記ステップb)は、モニタされた1個のパケットからモニタIPアドレスを検出し、前記モニタIPアドレスから増加する方向および減少する方向へ1ビットずつ変化させた検査IPアドレスを順次生成し、生成された検査IPアドレスと前記モニタIPアドレスとの間でネットワーク層での通信が可能か否かを判定し、前記増加する方向および減少する方向のそれぞれの方向においてネットワーク層での通信が初めてできなくなった時のビット位置のうち上位のビットを特定し、前記上位ビットより1つ上位のビットから上位すべてのビットをセット状態にし、前記上位ビット以下のビットをすべてリセット状態にすることで前記サブネットマスクを生成する、ことを特徴とする請求項11記載のネットワーク情報検出方法。
- 15さらに、c)検出されたサブネットマスクにより示されるサブネット内のIPアドレスに対してARP要求を送信し、d)ARP応答が返信されないIPアドレスを割当可能なIPアドレスとして決定するを有することを特徴とする請求項11記載のネットワーク情報検出方法。
- 16さらに、c)モニタされたパケットに含まれる送信先IPアドレスと送信先MACアドレスとが同一のネットワーク機器を指示しない場合、当該送信先MACアドレスをターゲットハードウエアアドレスとするInARP要求を送信し、d)前記InARP要求に対するInARP応答を受信した場合に、前記InARP応答に含まれる送信元IPアドレスをルータのIPアドレスとして検出することを特徴とする請求項11記載のネットワーク情報検出方法。
- 17さらに、c)検出されたサブネットマスクにより示されるサブネット内のIPアドレスを検査IPアドレスとして順次生成し、検査IPアドレスに対してICMPエコー要求を送信し、d)前記ICMPエコー要求に対してICMP経路変更要求を受信すれば、当該ICMP経路変更要求からルータのIPアドレスを検出し、e)前記ICMPエコー要求に対してICMP時間切れを受信すれば、当該ICMP時間切れの送信元IPアドレスをルータのIPアドレスとして検出する、ことを特徴とする請求項11記載のネットワーク情報検出方法。
- 18さらに、c)ICMPのエコー要求およびエコー応答機能を用いて、モニタされたIPアドレスを使用している他のネットワーク機器のサブネットマスクと自己のサブネットマスクとの同一性を判定し、d)前記他のネットワーク機器のサブネットマスクと前記自己のサブネットマスクとが異なる場合、前記ステップb)を実行する、ことを特徴とする請求項11記載のネットワーク情報検出方法。
- 19複数のネットワーク機器が接続されたローカルネットワークにおけるネットワーク情報を検出する方法において、a)前記ローカルネットワーク上のパケットをモニタするステップと、b)モニタされたパケットに含まれる送信先IPアドレスと送信先MACアドレスとが同一のネットワーク機器を指示しない場合、当該送信先MACアドレスをターゲットハードウエアアドレスとするInARP要求を送信するステップと、c)前記InARP要求に対するInARP応答を受信した場合に、前記InARP応答に含まれる送信元IPアドレスをルータのIPアドレスとして検出するステップと、を有することを特徴とするネットワーク情報検出方法。
- 20複数のネットワーク機器が接続されたローカルネットワークにおけるネットワーク情報を検出する方法において、a)前記ローカルネットワーク上のパケットをモニタするステップと、b)モニタされたパケットのIPアドレス(以下、モニタIPアドレスという。)のネットワークアドレスと自己のネットワークアドレスとを比較するステップと、c)ネットワークアドレスが同一の場合、ICMPのエコー要求およびエコー応答機能を用いて、前記モニタIPアドレスを使用している他のネットワーク機器のサブネットマスクと自己のサブネットマスクとの同一性を判定するステップと、を有することを特徴とするネットワーク情報検出方法。
- 21前記ステップc)は、c.1)前記自己のIPアドレスおよび前記モニタIPアドレスのいずれかのホスト部をすべて0およびすべて1のいずれかに設定した送信元IPアドレスを有するICMPエコー要求を前記他のネットワーク機器へ送信し、c.2)前記他のネットワーク機器から前記ICMPエコー要求に対するICMPエコー応答をユニキャストで受信した場合、自己のサブネットマスク値は前記他のネットワーク機器のそれより大きいと判定し、c.3)前記他のネットワーク機器から前記ICMPエコー応答がない場合およびブロードキャストで受信した場合のいずれかの場合には、自己のサブネットマスク値は前記他のネットワーク機器のそれ以下であると判定する、ことを特徴とする請求項20記載のネットワーク情報検出方法。
- 22さらに、c.4)前記ステップc.3)において、自己のサブネットマスク値は前記他のネットワーク機器のそれ以下であると判定された場合、前記自己のIPアドレスおよび前記モニタIPアドレスのいずれかのホスト部の少なくとも最上位ビットを反転させた送信元IPアドレスを有するICMPエコー要求を前記他のネットワーク機器へ送信し、c.5)前記他のネットワーク機器から前記ICMPエコー要求に対するICMPエコー応答をユニキャストで受信した場合、自己のサブネットマスク値は前記他のネットワーク機器のそれより小さいと判定し、c.6)前記他のネットワーク機器から前記ICMPエコー応答がない場合には、自己のサブネットマスク値と前記他のネットワーク機器のそれとは等しいと判定する、ことを特徴とする請求項21記載のネットワーク情報検出方法。
- 23前記ステップc)は、c.1) 前記自己のIPアドレスおよび前記モニタIPアドレスのいずれかのホスト部の少なくとも最上位ビットを反転させた送信元IPアドレスを有するICMPエコー要求を前記他のネットワーク機器へ送信し、c.2)前記他のネットワーク機器から前記ICMPエコー要求に対するICMPエコー応答をユニキャストで受信した場合、自己のサブネットマスク値は前記他のネットワーク機器のそれ以上であると判定し、c.3)前記他のネットワーク機器から前記ICMPエコー応答がない場合には、自己のサブネットマスク値は前記他のネットワーク機器のそれより小さいと判定する、ことを特徴とする請求項20記載のネットワーク情報検出方法。
- 24さらに、c.4)前記ステップc.2)において、自己のサブネットマスク値は前記他のネットワーク機器のそれ以上であると判定された場合、前記自己のIPアドレスおよび前記モニタIPアドレスのいずれかのホスト部をすべて0およびすべて1のいずれかに設定した送信元IPアドレスを有するICMPエコー要求を前記他のネットワーク機器へ送信し、c.5)前記他のネットワーク機器から前記ICMPエコー要求に対するICMPエコー応答をユニキャストで受信した場合、自己のサブネットマスク値は前記他のネットワーク機器のそれより大きいと判定し、c.6)前記他のネットワーク機器から前記ICMPエコー応答がない場合およびブロードキャストで受信した場合のいずれかの場合には、自己のサブネットマスク値と前記他のネットワーク機器のそれとは等しいと判定する、ことを特徴とする請求項23記載のネットワーク情報検出方法。
- 25さらに、c.4)前記ステップc.2)において、自己のサブネットマスク値は前記他のネットワーク機器のそれ以上であると判定された場合、前記自己のIPアドレスおよび前記モニタIPアドレスのいずれかのネットワークアドレスの最下位ビットを反転させた送信元IPアドレスを有するICMPエコー要求を前記他のネットワーク機器へ送信し、c.5)前記他のネットワーク機器から前記ICMPエコー要求に対するICMPエコー応答をユニキャストで受信した場合、自己のサブネットマスク値は前記他のネットワーク機器のそれより大きいと判定し、c.6)前記他のネットワーク機器から前記ICMPエコー応答がない場合には、自己のサブネットマスク値と前記他のネットワーク機器のそれとは等しいと判定する、ことを特徴とする請求項23記載のネットワーク情報検出方法。
- 26前記ステップc)は、c.1) 前記自己のIPアドレスおよび前記モニタIPアドレスのいずれかのネットワークアドレスの最下位ビットを反転させた送信元IPアドレスを有するICMPエコー要求を前記他のネットワーク機器へ送信し、c.2)前記他のネットワーク機器から前記ICMPエコー要求に対するICMPエコー応答をユニキャストで受信した場合、自己のサブネットマスク値は前記他のネットワーク機器のそれより大きいと判定し、c.3)前記他のネットワーク機器から前記ICMPエコー応答がない場合には、自己のサブネットマスク値は前記他のネットワーク機器のそれ以下であると判定する、ことを特徴とする請求項20記載のネットワーク情報検出方法。
- 27さらに、c.4)前記ステップc.3)において、自己のサブネットマスク値は前記他のネットワーク機器のそれ以下であると判定された場合、前記自己のIPアドレスおよび前記モニタIPアドレスのいずれかのホスト部の少なくとも最上位ビットを反転させた送信元IPアドレスを有するICMPエコー要求を前記他のネットワーク機器へ送信し、c.5)前記他のネットワーク機器から前記ICMPエコー要求に対するICMPエコー応答をユニキャストで受信した場合、自己のサブネットマスク値は前記他のネットワーク機器のそれと等しいと判定し、c.6)前記他のネットワーク機器から前記ICMPエコー応答がない場合には、自己のサブネットマスク値は前記他のネットワーク機器のそれより小さいと判定する、ことを特徴とする請求項26記載のネットワーク情報検出方法。
- 28複数のネットワーク機器が接続されたローカルネットワークにおけるネットワーク情報を検出する方法において、a)前記ローカルネットワーク上のARPパケットをモニタするステップと、b)モニタされたARPパケットのIPアドレス(以下、モニタIPアドレスという。)のネットワークアドレスと自己のネットワークアドレスとを比較するステップと、c)ネットワークアドレスが同一の場合、ICMPエコー要求を前記モニタIPアドレスを使用している他のネットワーク機器へ送信し、d)前記ICMPエコー要求に対するICMPエコー応答の有無に応じて、前記他のネットワーク機器のサブネットマスク値と自己のサブネットマスク値との同一性を判定するステップと、を有することを特徴とするネットワーク情報検出方法。
- 29コンピュータに、複数のネットワーク機器が接続されたローカルネットワークにおけるネットワーク情報を検出するように動作させるネットワーク情報検出プログラムにおいて、a)前記ローカルネットワーク上のパケットをモニタするステップと、b)モニタされた少なくとも1個のパケットに含まれるIPアドレスに基づいて、前記モニタされたパケットに関係するネットワーク機器に設定されたサブネットマスクを検出するステップと、を有することを特徴とするネットワーク情報検出プログラム。
- 30コンピュータに、複数のネットワーク機器が接続されたローカルネットワークにおけるネットワーク情報を検出するように動作させるネットワーク情報検出プログラムにおいて、a)前記ローカルネットワーク上のパケットをモニタするステップと、b)モニタされたパケットに含まれる送信先IPアドレスと送信先MACアドレスとが同一のネットワーク機器を指示しない場合、当該送信先MACアドレスをターゲットハードウエアアドレスとするInARP要求を送信するステップと、c)前記InARP要求に対するInARP応答を受信した場合に、前記InARP応答に含まれる送信元IPアドレスをルータのIPアドレスとして検出するステップと、を有することを特徴とするネットワーク情報検出プログラム。
- 31コンピュータに、複数のネットワーク機器が接続されたローカルネットワークにおけるネットワーク情報を検出するように動作させるネットワーク情報検出プログラムにおいて、a)前記ローカルネットワーク上のパケットをモニタするステップと、b)モニタされたパケットのIPアドレス(以下、モニタIPアドレスという。)のネットワークアドレスと自己のネットワークアドレスとを比較するステップと、c)ネットワークアドレスが同一の場合、ICMPのエコー要求およびエコー応答機能を用いて、前記モニタIPアドレスを使用している他のネットワーク機器のサブネットマスクと自己のサブネットマスクとの同一性を判定するステップと、を有することを特徴とするネットワーク情報検出プログラム。
Independent claims31
282 paragraphs in 1 section, as filed
【0001】
[Technical field to which the invention belongs]
The present invention relates to an automatic acquisition technique of network information in a network system, and particularly relates to a device and a method for detecting network information such as a subnet mask and a router IP address.
【0002】
[Conventional technology]
To connect a computer to a network, it is necessary to acquire network information such as subnet mask, IP address, and router address and set it on the computer. Such network information can be set manually, but manual setting requires knowledge of the network, and it takes time and effort to investigate the network information. In addition, if network information is set incorrectly, the entire network may be confused.
【0003】
On the other hand, if a DHCP (Dynamic Host Configuration Protocol) server exists, network information can be automatically obtained from the DHCP server. However, in order to automatically acquire network information, it is necessary to construct a server for the purpose of providing network information.
【0004】
Japanese Unexamined Patent Publication No. 2002-190811 (Patent Document 1) discloses a method for automatically acquiring an IP address, subnet mask, or the like of a device on a network. In this conventional method, when network information cannot be obtained from the DHCP server, an ICMP (Internet Control Message Protocol) address mask request is sent, and a valid subnet is determined from the response and network traffic (paragraph numbers 0018 to 0021). ). Then, within the determined subnet, the detection of the unused IP address and the detection of the default router using the ICMP router selection message are executed (paragraph numbers 0025 to 0027).
【0005】
[Patent Document 1]
Japanese Unexamined Patent Publication No. 2002-190811 (paragraph numbers 0025 to 0027, abstract, FIGS. 3 to 5).
【0006】
[Problems to be Solved by the Invention]
However, in the IP configuration automatic acquisition method disclosed in Patent Document 1, since the ICMP address mask request is transmitted to the network and the subnet mask is detected by using the response to the ICMP address mask request, the load on the network is only increased. It is not possible to speed up subnet mask detection. Further, in the conventional router detection method, only the IP address detection method of the router described in RFC1256 is used as it is, and the speeding up of router detection is not considered. In addition, the router may not be detected by the conventional method because some routers do not support the ICMP router selection message.
【0007】
An object of the present invention is to provide a network information detection device and a method capable of automatically and at high speed acquiring network information without requiring a server function for providing network information.
【0008】
Another object of the present invention is to provide a network information detection device and method capable of detecting a subnet mask at high speed.
【0009】
Still another object of the present invention is to provide a network information detection device and method capable of detecting a router IP address at high speed.
【0010】
[Means for solving problems]
According to the present invention, in a device for detecting network information of a local network to which a plurality of network devices are connected, a packet monitoring means for monitoring packets on the local network and at least one monitored by the packet monitoring means. It is characterized by having a subnet mask detecting means for detecting a subnet mask set in a network device related to the monitored packet based on an IP (Internet Protocol) address included in the packet.
【0011】
In the first form of the subnet mask detecting means, the maximum IP address and the minimum IP address of the source IP address and the destination IP address contained in at least one monitored packet are obtained, and the maximum IP address and the said are described. The subnet mask is detected by specifying the most significant bit of a different bit in the subnet host portion of the minimum IP address.
【0012】
The second form of the subnet mask detecting means obtains the IP area of each packet from the source IP address and the destination IP address included in each of the monitored plurality of packets, and obtains the IP area of the plurality of monitored packets. If they overlap, they are regarded as one IP area, the maximum IP address and the minimum IP address are obtained from at least one IP area finally obtained, and the subnet host unit of the maximum IP address and the minimum IP address is obtained. It is characterized in that the subnet mask is detected by specifying the most significant bit of different bits in.
【0013】
The third form of the subnet mask detecting means obtains a range of an IP address contained in one monitored packet and another IP address that can communicate at the network layer, and detects the subnet mask according to the IP address range. It is characterized by that.
【0014】
According to the present invention, an ARP request is further transmitted to an IP address in the subnet indicated by the subnet mask detected by the subnet mask detecting means, and an IP address for which an ARP response is not returned can be assigned as an IP address that can be assigned. It is desirable to have a means of determining the IP address to determine.
【0015】
According to the present invention, further, the ICMP echo request is sequentially transmitted to the IP address in the subnet indicated by the subnet mask detected by the subnet mask detecting means, and the IP address of the router is detected from the ICMP response to the ICMP echo request. It is desirable to have a router detection means. According to the present invention, further, when the destination IP address and the destination MAC address included in the packet monitored by the packet monitoring means do not indicate the same network device, the IP address corresponding to the destination MAC address. It is desirable to have a router detection means that detects as the IP address of the router.
【0016】
According to the present invention, the subnet mask of another network device using the monitored IP address and its own subnet mask are further used by using the echo request and echo response functions of ICMP (Internet Control Message Protocol). Subnet mask for determining identity When the subnet mask of the other network device is different from the subnet mask of its own, the subnet mask detecting means detects the subnet mask of the other network device. It is desirable to do.
【0017】
According to another aspect of the present invention, the packet monitoring means for monitoring the packet on the local network and the network device having the same destination IP address and destination MAC address included in the packet monitored by the packet monitoring means. When is not instructed, it is characterized by having a router detecting means for detecting the IP address corresponding to the destination MAC address as the IP address of the router.
【0018】
According to yet another aspect of the present invention, in a method of detecting network information in a local network to which a plurality of network devices are connected, a) a step of monitoring a packet on the local network and b) a monitored packet. The step of comparing the network address of the IP address (hereinafter referred to as the monitor IP address) with its own network address, and c) the echo request and echo response function of ICMP (Internet Control Message Protocol) when the network address is the same. It is characterized by having a step of determining the identity between the subnet mask of another network device using the monitor IP address and its own subnet mask.
【0019】
BEST MODE FOR CARRYING OUT THE INVENTION
FIG. 1 is a schematic configuration diagram showing an example of a network including a network information detection device according to the present invention. In this example, a plurality of network devices such as a network information detection device 20, host A30, host B40, host 50, and router 60 are connected to the network (LAN) transmission line 10. As will be described later, the network information detection device 20 according to the present invention uses IP packets and ARP (Address Resolution Protocol) packets communicated in a network to detect a subnet mask, determine an IP address, detect a router, or detect a router. , Set network information, etc.
【0020】
1. First Embodiment FIG. 2 is a block configuration diagram showing a network information detection device according to the first embodiment of the present invention. The network information detection device 20 according to the present embodiment has a network interface unit 21 for connecting to the network transmission line 10. The network interface unit 21 is connected to the packet monitor 23, the subnet mask detection unit 24, the IP address determination unit 25, the router detection unit 26, and the network information transmission unit 28, and is connected to the LAN transmission path 10 for an IP packet or an ARP packet. Send or receive. The network interface unit 21 sends all the packets on the LAN transmission line 10 to the packet monitor 23.
【0021】
The packet monitor 23 is connected to the subnet mask detection unit 24 and monitors the IP packet or ARP packet input from the network interface unit 21. Further, the subnet mask detection unit 24, the IP address determination unit 25, the router detection unit 26, and the network information transmission unit 28 are connected to the network information setting unit 27, respectively. Further, the overall operation of the network information detection device 20 is controlled by the control unit 22.
【0022】
The packet flowing on the LAN transmission path 10 is, for example, a data link layer packet having the format shown in FIG. 3 if the LAN is Ethernet (registered trademark, IEEE802.3), and is shown in FIG. 4 if it is an IP packet. It has a format, and if it is an ARP packet, it has the format shown in Fig. 5.
【0023】
The subnet mask detection unit 24 analyzes the IP packet or ARP packet monitored by the packet monitor 23, detects the subnet mask information set in the host of the source or destination IP address of the packet, and / or determines the subnet. (Details will be described with reference to FIGS. 8 to 12). Figure 6 shows the general configuration of IP addresses.
【0024】
The IP address determination unit 25 detects an IP address that has not yet been assigned in the subnet mask detected by the subnet mask detection unit 24, and determines the IP address to be set in the network information detection device (see FIG. 13 for details). I will explain in detail while).
【0025】
The router detection unit 26 detects the router 60 by determining whether or not the IP packet monitored by the packet monitor 23 has the characteristics of the IP packet transmitted to the router 60 (for details, see FIGS. 14 to 15). Details with reference). Alternatively, the router detection unit 26 sequentially transmits ICMP (Internet Control Message Protocol) echo requests in the format shown in FIG. 7 (A) to the IP addresses in the subnet detected by the subnet mask detection unit 24, and the router detection unit 26 sequentially transmits FIG. 7 (A). Detects router 60 by receiving an ICMP time-out message in the format shown in B) or an ICMP route change request message in the format shown in FIG. 7 (C) (details will be described with reference to FIG. 16). ).
【0026】
The network information setting unit 27 is a network consisting of at least one of the subnet mask detected by the subnet mask detection unit 24, the unassigned IP address detected by the IP address determination unit 25, and the router IP address detected by the router detection unit 26. The information is received and set in its own device or transmitted to the network information transmission unit 28 so that it can be used in another device.
【0027】
The network information transmission unit 28 transmits the network information acquired from the network information setting unit 27 to the LAN transmission line 10 through the network interface unit 21 in order to make it available to other devices.
【0028】<u style="single">Network information detection operation</u>Hereinafter, the operation of this embodiment will be described in detail with reference to the packet formats shown in FIGS. 3 to 7 and the flowcharts shown in FIGS. 8 to 16.
【0029】
(1) Subnet Mask Detection Process (First Example) FIG. 8 is a flowchart showing a first example of the subnet mask detection process in the present embodiment. First, the packet monitor 23 monitors the ARP packet or the IP packet for a specified time under the control of the control unit 22 (step S2401). As shown in FIG. 3, the packet type is determined to be an ARP packet if the type included in the ether header is 0x806, and an IP packet if it is 0x800. If one or more ARP or IP packets are monitored within the specified time (YES in step S2402), the monitored packets are passed to the subnet mask detector 24. If neither ARP packet nor IP packet is monitored (NO in step S2402), the process returns to step S2401.
【0030】
The subnet mask detector 24 reads the source IP address and the destination IP address from the IP packet (see FIG. 4) or ARP packet (see FIG. 5) received from the packet monitor 23, and sets their maximum values as the maximum IP (see FIG. 5). Step S2403), set the minimum value as the minimum IP (step S2404). Then, the maximum IP and the minimum IP are compared, and the most significant bit with a different value is set as the most significant bit in the host part of the subnet (step S2405). Then, the most significant bit to the least significant bit of the host part of the subnet are set, the other bits are reset, the 32-bit value is calculated, and the subnet mask is detected by taking the one's complement (step S2406).
【0031】
For example, if the maximum IP = 10.56.88.5 and the minimum IP = 10.56.88.3, the lower 8 bits are the maximum IP 00000.<u style="single">1</u>01 , minimum IP 00000 <u style="single">0</u>11 . Since the upper 24 bits of the maximum IP and the minimum IP are the same, the most significant bit with a different value is the underlined third bit 2 from the lowest bit, which is the most significant bit of the host part of the subnet. Is found to be bit 2. By resetting all the bits above the most significant bit (bit 2) of the host part of the detected subnet and setting bits 2 to 0, the 32-bit value 0.0.0.7 is obtained. The complement of 1 can be calculated to obtain the subnet mask 255.255.255.248 = 11111111.11111111.11111111.11111000 .
【0032】
Next, the case where four ARP or IP packets are monitored will be taken as an example, and the subnet mask detection process will be specifically described.
【0033】
FIG. 9 is a schematic diagram showing the IP address and IP area included in each packet when four ARP or IP packets are monitored. Here, it is assumed that ARP / IP packets No. 1 to No. 4 are monitored. According to the subnet mask detection process shown in FIG. 8, the IP area A is determined to be a subnet. The minimum IP address of IP area A is the minimum IP address of No. 1 packet, and the maximum IP address of IP area A is the maximum IP address of No. 4 packet.
【0034】
(2) Subnet Mask Detection Process (Second Example) FIG. 10 is a flowchart showing a second example of the subnet mask detection process in the present embodiment. First, the packet monitor 23 monitors the ARP packet or the IP packet for a specified time under the control of the control unit 22 (step S2411). If two or more ARP or IP packets are monitored within the specified time (YES in step S2412), the monitored packets are passed to the subnet mask detector 24. If two or more ARP or IP packets are not monitored (NO in step S2412), the process returns to step S2401.
【0035】
For each monitored packet, the subnet mask detector 24 detects an IP area determined by the source IP address and the destination IP address (step S2413), and then detects the overlap of these IP areas (step S2414). ~ S2416).
【0036】
Specifically, assuming that the maximum IP address of a certain IP area α is MAXα and the minimum IP address is MINα, does the condition that MINa MAXb and MAXa MINb are satisfied for any two IP areas A and B? Determine if not (step S2414). If this condition is met (YES in step S2414), the IP areas A and B are combined into a single IP area (step S2415). For example, when the IP area A is MAXa = 192.168.0.40 and MINa = 192.168.0.20, and the IP area B is MAXb = 192.168.0.30 and MINb = 192.168.0.10, the above judgment conditions are satisfied. Therefore, IP areas A and B are judged to be one new IP area that combines them. As a result, the maximum IP of the new IP area is "192.168.0.40" and the minimum IP is "192.168.0.10".
【0037】
The above overlap detection process (steps S2414 to S2416) is repeated for all combinations of IP areas, and when overlap detection is completed (YES in step S2416), the maximum value of at least one finally determined IP area is set as the maximum IP. (Step S2417), set the minimum value as the minimum IP (step S2418). Then, as in the first example shown in FIG. 8, the maximum IP and the minimum IP are compared, and the most significant bit with a different value is set as the most significant bit of the host portion of the subnet (step S2419). Then, the most significant bit to the least significant bit of the host part of the subnet are set, the other bits are reset, the 32-bit value is calculated, and the subnet mask is detected by taking the one's complement (step S2420). Repeat steps S2417 to S2420 above until a subnet mask is detected for all IP regions (NO in step S2421).
【0038】
When the subnet mask detection for all the IP areas is completed (YES in step S2421), the subnet mask detection unit 24 determines that the subnets having the same value in the network part and the subnet part are the same subnet using the detected subnet mask. (Step S2422).
【0039】
When the second example of this subnet mask detection process is applied when monitoring the four ARP or IP packets shown in Fig. 9, it becomes as follows. That is, since the IP areas of packets No. 2 to No. 4 overlap each other, the subnet mask detection unit 24 determines that these are one IP area C. Therefore, based on the four monitored packets, the subnet mask detection unit 24 determines that the IP area B and the IP area C are subnets, respectively. As shown in FIG. 9, the minimum IP address and the maximum IP address of the IP area B are the minimum IP address and the maximum IP address of the packet No. 1, respectively. The minimum IP address of IP area C is the minimum IP address of packet No. 2, and the maximum IP address is the maximum IP address of packet No. 4.
【0040】
(3) Subnet Mask Detection Process (Third Example) FIG. 11 is a flowchart showing a third example of the subnet mask detection process in the present embodiment. First, the packet monitor 23 monitors the ARP packet or the IP packet under the control of the control unit 22 (step S2441). If the ARP or IP packet is monitored (YES in step S2441), the monitored packet is passed to the subnet mask detector 24.
【0041】
The subnet mask detection unit 24 reads the source IP address or the destination IP address from the monitor packet received from the packet monitor 23, sets it as the monitor IP, sets the monitor IP as the inspection IP, and sets the bit counter to 0. And set the set bit to 1 (step S2442). Then, the OR (logical sum) of the inspection IP and the set bit is calculated, the result is set to the inspection IP, 1 is added to the bit counter, and the set bit is shifted to the left by 1 bit (step S2443). ).
【0042】
Subsequently, the subnet mask detection unit 24 generates an ICMP echo request (see FIG. 7 (A)) in which the above inspection IP is set as the source IP address and the above monitor IP is set as the destination IP address, and the network interface. Send to the network through section 21 (step S2444).
【0043】
When the ICMP echo request packet is transmitted, the subnet mask detector 24 determines whether or not an ICMP echo response (see FIG. 7 (A)) that does not use the broadcast address as the destination MAC address of the ether header has been received. (Step S2445). If the received ICMP echo response does not use a broadcast address for the destination MAC address (YES in step S2445), the check IP address and monitor address can communicate at the network layer without using a broadcast for the MAC address. It is determined that this is the case, and the process returns to step S2443.
【0044】
On the other hand, if an ICMP echo response that does not use a broadcast address for the destination MAC address of the ether header is not received (NO in step S2445), the network layer does not use a broadcast for the MAC address. It is determined that communication is not possible, and the value obtained by subtracting 1 from the bit counter is set in bit number A (step S2446), 0 is set in the bit counter, and 1 is set in the reset bit (step S2447).
【0045】
Subsequently, the subnet mask detection unit 24 calculates the logical product (AND) of the inspection IP and the one's complement of the reset bit, sets the result in the inspection IP, adds 1 to the bit counter, and reset bits. To the left by one bit (step S2448).
【0046】
Subsequently, the subnet mask detection unit 24 generates an ICMP echo request (see FIG. 7 (A)) in which the above inspection IP is set as the source IP address and the above monitor IP is set as the destination IP address, and the network interface. Send to the network through part 21 (step S2449).
【0047】
When the ICMP echo request packet is transmitted, the subnet mask detector 24 determines whether or not an ICMP echo response that does not use the broadcast address as the destination MAC address of the ether header has been received (step S2450). If the received ICMP echo response does not use a broadcast address for the destination MAC address (YES in step S2450), the check IP address and monitor address can communicate at the network layer without using a broadcast for the MAC address. It is determined that this is the case, and the process returns to step S2448.
【0048】
On the other hand, if an ICMP echo response that does not use a broadcast address for the destination MAC address of the ether header is not received (NO in step S2450), the network layer does not use a broadcast for the MAC address. It is determined that communication is not possible, and the value obtained by subtracting 1 from the bit counter is set in bit number B (step S2451). Set this bit number B as the most significant bit number of the host part of the subnet (step S2452).
【0049】
Then, it is determined whether or not the bit number A is larger than the bit number B (step S2453), and if the bit number A> the bit number B (YES in the step S2453), the most significant bit number of the host part of the subnet is determined. Set the value of bit number A to (step S2454), and execute step S2455. If bit number A bit number B (NO in step S2453), step S2454 is skipped and step S2455 is executed. In step S2455, as already described, the subnet mask is set by setting the most significant bit to the least significant bit of the host part of the subnet, resetting the other bits, calculating the 32-bit value, and taking the one's complement. Is detected.
【0050】
As described above, in the subnet mask detection process shown in FIG. 11, the inspection IP address is sequentially generated based on the monitor IP address, and the broadcast address is not used between the generated inspection IP address and the monitor IP address. The subnet range is specified by determining whether communication is possible. As an example, a case where four inspection IP addresses are generated based on the source or destination IP address of the monitored ARP / IP packet to perform subnet mask detection will be described.
【0051】
FIG. 12 is a schematic diagram showing the subnet mask detection process when four inspection IP addresses are generated. Here, it is assumed that the inspection IP addresses No. 1 and No. 2 are adjacent IP addresses, and the inspection IP addresses No. 3 and No. 4 are adjacent IP addresses. In Fig. 12, an ICMP echo response that does not use a broadcast address for the MAC address is returned from the monitor IP address to the inspection IP addresses No. 2 and No. 3 (communication OK), and the inspection IP addresses No. 1 and No. For 4, the case where it was not returned (communication NG) is shown.
【0052】
In this case, the inspection IP addresses No. 1 and No. 4 are determined to be the maximum or minimum IP address in the subnet, that is, the broadcast address that cannot be assigned to the device. In other words, it is possible to communicate between the monitor IP address and the inspection IP addresses No. 2 and No. 3 at the network layer without using the broadcast address as the MAC address, but the monitor IP address and the inspection IP address No. 1 Communication with No. 4 and No. 4 cannot be performed at the network layer without using the broadcast address for the MAC address, and therefore ICMP echo communication cannot be performed without using the broadcast address for the MAC address. As a result, it is determined that the subnet range is the range indicated by the inspection IP addresses No. 1 to No. 4.
【0053】
(4) Assignable IP address determination process When the subnet mask is detected by the above-mentioned subnet mask detection process, the IP address determination unit 25 determines the IP address that can be assigned within the subnet.
【0054】
FIG. 13 is a flowchart showing the assignable IP address determination process in the IP address determination unit 25. First, the IP address determination unit 25 sets the subnet minimum IP address to the inspection IP address (step S2591), and adds 1 to the inspection IP address (step S2592).
【0055】
Subsequently, the IP address determination unit 25 determines whether or not the inspection IP address and the maximum IP address of the subnet are equal (step S2593), and if the inspection IP address = the maximum subnet IP address (YES in step S2593). , Judges that there is no assignable IP address and ends the process. If the check IP address is not the subnet maximum IP address (NO in step S2593), an ARP request with the target IP address as the check IP address is generated and sent to network 10 through the network interface section 21 (step S2594).
【0056】
When the ARP request is sent, the IP address determination unit 25 determines whether or not the ARP response to the ARP request has been received within the specified time (step S2595), and if so (YES in step S2595), it has already been assigned. Since it is the IP address, return to step S2592 and check the next IP address. If the ARP response to the ARP request is not received within the specified time (NO in step S2595), it is determined that the inspection IP address is not assigned to any network device, and the IP address determination unit 25 determines this IP. Determine the address as an assignable IP address (step S2596).
【0057】
(5) Router detection process (1st example) FIG. 14 is a flowchart showing a first example of the router detection operation in the router detection unit 26. When the packet monitor 23 monitors the IP packet (YES in step S2681), the router detector 26 determines whether the monitor IP address is outside the subnet (step S2682), and if it is within the subnet (step S2682). NO), return to step S2681. The determination of whether or not it is outside the subnet will be described later.
【0058】
If the monitor IP address is an address outside the subnet (YES in step S2682), the router detector 26 sets the destination MAC address of the monitor IP packet as the MAC address of the router (step S2683), and this router MAC address. Is sent to network 10 through the network interface section 21 as an In ARP (Inverse Address Resolution Protocol) request with the target hardware address (step S2684).
【0059】
When the InARP request is transmitted, the router detection unit 26 determines whether or not the InARP response has been received within the specified time (step S2685). If the InARP response is not received within the specified time (NO in step S2685), the process returns to step S2681. If the InARP response is received within the specified time (YES in step S2685), the source protocol address included in the received InARP response packet is determined as the IP address of the router (step S2686), and the process ends.
【0060】
By monitoring the IP packet sent to the host outside the subnet in this way, the IP address of the router of the subnet can be detected. Hereinafter, the characteristics of the IP packet transmitted to the outside of the subnet will be described with reference to FIG.
【0061】
FIG. 15 is a schematic diagram showing a network for explaining the characteristics of IP packets transmitted to a host connected to a network outside the subnet. In the case of an IP packet (1) transmitted from host B to host A in the same subnet, the destination IP address is the IP address of host A that next receives the IP packet (1). On the other hand, when sending an IP packet (2) from Host B to Host Z connected to a network outside the subnet, the destination IP address is not the IP address of the router that will receive the IP packet next. The IP address of the external host Z. Therefore, it can be determined that the destination IP address of the IP packet (2) is an IP address outside the subnet, and the MAC address of the router is determined to be the destination MAC address of the IP packet (2). Therefore, the IP address of the router can be detected by the InARP request and response process.
【0062】
(6) Router Detection Process (Second Example) FIG. 16 is a flowchart showing a second example of the router detection operation in the router detection unit 26. First, set the subnet minimum IP address to the inspection IP address (step S2691), and add 1 to the inspection IP address (step S2692). Subsequently, the router detection unit 26 determines whether or not the inspection IP address and the subnet maximum IP address are equal (step S2693). If the check IP address = the maximum subnet IP address (YES in step S2693), it is determined that there is no router in the subnet and the process ends.
【0063】
If the inspection IP address and the maximum subnet IP address are different (NO in step S2693), the ICMP echo request packet (NO) with the inspection IP address set as the destination IP address and the desired value set as TTL (Time To Live). Send (see Figure 7 (A)) (step S2694). Here, it is assumed that TTL = 2, that is, the number of passable router stages is 2.
【0064】
When the ICMP echo request packet is transmitted, the router detection unit 26 determines whether or not the ICMP route change request message (see FIG. 7C) for the ICMP echo request has been received within the specified time (step S2695).
【0065】
If the ICMP route change request message is not received (NO in step S2695), it is determined whether or not the ICMP time-out message (Fig. 7 (B)) for the ICMP echo request is received within the specified time (step S2696). ). If the ICMP time-out message is not received (No in step S2696), the process returns to step S2692. If an ICMP time-out message is received within the specified time (YES in step S2696), it is determined that the source IP address included in the time-out message packet is the IP address of the router (step S2697), and the router detection operation is performed. To finish.
【0066】
On the other hand, when the ICMP route change request message is received (YES in step S2695), it is determined that the router IP address included in the route change request message is the IP address of the router (step S2698), and the router detection operation is terminated. To do. In this way, the IP address of the router is detected.
【0067】
By the subnet mask detection process, the IP address determination process, and the router detection process described above, the subnet mask, the assignable IP address, and the router IP address can be detected as network information, respectively. These network information is output to the network information setting unit 27.
【0068】
2. FIG. 17 of the second embodiment is a block configuration diagram showing a network information detection device according to the second embodiment of the present invention. The network information detection device 20 according to the present embodiment is different from the first embodiment shown in FIG. 2 in that it has a subnet mask identity determination unit 29 controlled by the control unit 22. Therefore, here, the circuit blocks having the same configuration and function as those in the first embodiment are designated by the same reference numbers 21 to 28, and the description thereof will be omitted, and the operation of the subnet mask identity determination unit 29 will be described in detail.
【0069】
(1) Subnet Mask Identity Check (1st Example) FIGS. 18A and 18B are sequence diagrams showing a first example of the subnet mask identity check method according to the second embodiment. Hereinafter, for the sake of simplicity, the network device for which the subnet mask values are compared is referred to as "device 1", and the network device to be compared is referred to as "device 2".
【0070】
First, as shown in FIG. 18A, the device 1 has an IP address in which the host portion of the IP address of the device 1 or the device 2 is 0 (all 0) or -1 (all 1) (details will be described later). ) Is the source IP address, and an ICMP echo request is sent to device 2. If the subnet mask of device 1 is larger than that of device 2, device 2 sends a unicast ICMP echo response back to device 1, and if the subnet mask of device 1 is less than or equal to that of device 2, device 2 Do not send a unicast ICMP echo response to device 1 or respond by broadcast.
【0071】
If there is no unicast ICMP echo response, as shown in FIG. 18 (B), the device 1 sends the IP address to the device 2 in which each bit of the host part of the device 2 is inverted. Send an ICMP echo request with an IP address. If the subnet mask of device 1 is equal to that of device 2, device 2 returns a unicast ICMP echo response to device 1, and if the subnet mask of device 1 is smaller than that of device 2, device 2 is device 1. Do not send echo responses to.
【0072】
FIG. 19 is a flowchart showing a first example of the subnet mask identity check operation in the present embodiment. This subnet mask identity check process is executed by the subnet mask identity determination unit 29 in FIG. Here, device 1 and device 2 in FIG. 18 correspond to own device and device using monitor IP address, respectively.
【0073】
In FIG. 19, the packet monitor 23 first monitors the packet flowing through the LAN 10 (step S3001) under the control of the control unit 22, and determines whether or not the packet is an ARP packet (step S3002). If it is not an ARP packet (NO in step S3002), it is subsequently determined whether it is an IP packet (step S3003). If it is not an IP packet (NO in step S3003), return to step S3001.
【0074】
If the monitored packet is an IP packet (YES in step S3003), the subnet mask identity determination unit 29 sets the source IP address as the IP address of its own device and the destination IP address as the monitor IP address. Generates and sends the configured ARP request (step S3004) and waits for the response.
【0075】
If there is no ARP response to the ARP request within the specified time (NO in step S3005), it is determined that the monitor IP address is outside LAN10, and the process returns to step S3001.
【0076】
If the ARP response to the ARP request is received within the specified time (YES in step S3005), or if the ARP packet is monitored in step S3002 (YES in step S3002), the subnet mask identity determination unit 29 will perform the subnet mask identity determination unit 29. It is determined that the monitor IP address is inside LAN10, and it is determined whether or not the network address (network part + subnet part) of the monitor IP address is equal to that of the own device (step S3006). If the network address of the monitor IP address is different from that of the own device (NO in step S3006), this inspection process is terminated.
【0077】
If the network address of the monitor IP address is equal to that of the own device (YES in step S3006), the source IP address is the IP address of the own device or the value where the host part of the monitor IP address is 0 or -1, and the monitor is monitored. Generate and send an ICMP echo request with the IP address as the destination IP address (step S3007). Here, setting the host part to 0 means setting all the bits of the host part to 0, and setting the host part to -1 means setting all the bits to 1. The host part is set to 0 when the LSB of the network address of the own device IP address is 1, and the host part is set to -1 when the LSB of the network address of the own device IP address is 0. For example, if the IP address of the own device is "10.56.88.1" and the subnet mask is "255.255.255.0", the source IP address of the ICMP echo request is set to "10.56.88.255". When the IP address of the own device is "10.56.89.1" and the subnet mask is "255.255.255.0", the source IP address of the ICMP echo request is set to "10.56.89.0".
【0078】
When the ICMP echo request is transmitted, the subnet mask identity determination unit 29 determines whether or not there is a unicast ICMP echo response from the device with the monitor IP address (device using the monitor IP address) (step S3008).
【0079】
If there is no unicast ICMP echo response (NO in step S3008), the subnet mask identity determination unit 29 uses the inverted value of each bit of the host unit of the monitor IP address as the source IP address and the monitor IP. Generate and send an ICMP echo request with the address set for each destination IP address (step S3009). Here, the source IP address of the ICMP echo request inverts the most significant bit (MSB) of the host part of the monitor IP address, and the other bits may be any value that does not make the entire host part 0 or -1. For example, if the monitor IP address is "10.56.88.2" and the subnet mask of the own device is "255.255.255.0", the source IP address of the ICMP echo request is which of "10.56.88.254" to "10.56.88.128". But it may be.
【0080】
Subsequently, the subnet mask identity determination unit 29 determines whether or not there is a unicast echo response from the monitor IP address-using device in response to this ICMP echo request (step S3010). If there is a unicast echo response (YES in step S3010), it is determined that the subnet mask value of the own device is smaller than that of the device using the monitor IP address (step S3011), and the process ends. On the contrary, if there is no unicast echo response (NO in step S3010), it is determined that the subnet mask value of the own device and that of the device using the monitor IP address are equal (step S3013), and the process ends.
【0081】
If there is a unicast ICMP echo response in step S3008 (YES in step S3008), it is determined that the subnet mask value of the own device is larger than that of the device using the monitor IP address (step S3012). End the process.
【0082】
In this way, the identity of the subnet masks used by the two devices can be verified. When it is determined that these subnet masks are different, the control unit 22 controls the subnet mask detection unit 24, the IP address determination unit 25, and the router detection unit 26 to obtain the desired subnet mask as described above. Subnet mask, detection of unassigned IP address and router IP address, transfer of these network information to network information setting unit 27, transfer from network information setting unit 27 to network information transmission unit 28, and network information transmission unit 28 The transfer from to the network interface unit 21 is selectively executed or re-executed as necessary.
【0083】
In addition, the network device determined to have a different subnet mask or the network device determined to have a different network address is notified via communication means such as e-mail that the network address and subnet mask settings are incorrect. May be good. At that time, necessary network information may be transmitted from the network information transmission unit 28 in order to automatically set the network address and subnet mask.
【0084】
(2) Subnet Mask Identity Check (2nd Example) FIGS. 20A and 20B are sequence diagrams showing a second example of the subnet mask identity check method according to the second embodiment. Hereinafter, for the sake of simplicity, the network device for which the subnet mask values are compared is referred to as "device 1", and the network device to be compared is referred to as "device 2".
【0085】
First, as shown in FIG. 20 (A), the device 1 transmits an ICMP echo request to the device 2 with the IP address in which each bit of the host unit of the device 2 is inverted as the source IP address. If the subnet mask of device 1 is greater than or equal to that of device 2, device 2 returns a unicast ICMP echo response to device 1, and if the subnet mask of device 1 is smaller than that of device 2, device 2 is device. Do not send a unicast ICMP echo response to 1.
【0086】
When there is a unicast ICMP echo response, as shown in Figure 20 (B), device 1 sets the host part of the IP address of device 1 or device 2 to 0 (all 0) or -1 (all 1). ) Is used as the source IP address to send an ICMP echo request to device 2. If the subnet mask of device 1 is larger than that of device 2, device 2 sends a unicast ICMP echo response back to device 1, and if the subnet mask of device 1 and that of device 2 are equal, then device 2 Do not send a unicast ICMP echo response to device 1 or respond by broadcast.
【0087】
FIG. 21 is a flowchart showing a second example of the subnet mask identity check operation in the present embodiment. This subnet mask identity check process is executed by the subnet mask identity determination unit 29 in FIG. Here, device 1 and device 2 in FIG. 20 correspond to own device and device using monitor IP address, respectively. In FIG. 21, steps S4001 to S4006 correspond to steps S3001 to S3006 in FIG. 19, so description thereof will be omitted.
【0088】
In step S4006, if the network address of the monitor IP address is equal to that of the own device (YES in step S4006), the subnet mask identity determination unit 29 transmits the inverted value of each bit of the host unit of the monitor IP address. Generate and send an ICMP echo request with the monitor IP address set as the source IP address and the monitor IP address set as the destination IP address (step S4007). Here, the source IP address of the ICMP echo request inverts the most significant bit (MSB) of the host part of the monitor IP address, and the other bits may be any value that does not make the entire host part 0 or -1. For example, if the monitor IP address is "10.56.88.2" and the subnet mask of the own device is "255.255.255.0", the source IP address of the ICMP echo request is which of "10.56.88.254" to "10.56.88.128". But it may be.
【0089】
When the ICMP echo request is transmitted, the subnet mask identity determination unit 29 determines whether or not there is a unicast ICMP echo response from the device with the monitor IP address (device using the monitor IP address) (step S4008).
【0090】
If there is a unicast ICMP echo response (YES in step S4008), the subnet mask identity determination unit 29 sends a value with the host unit of its own device's IP address or monitor IP address set to 0 or -1. Generate and send an ICMP echo request with the original IP address and the monitor IP address as the destination IP address (step S4009). Here, setting the host part to 0 means setting all the bits of the host part to 0, and setting the host part to -1 means setting all the bits to 1. Also, the host part is set to 0 when the LSB of the network address of the own device IP address is 1, and the host part is set to -1 when the LSB of the network address of the own device IP address is 0. ..
【0091】
Subsequently, the subnet mask identity determination unit 29 determines whether or not there is a unicast echo response from the monitor IP address-using device in response to this ICMP echo request (step S4010). If there is a unicast echo response (YES in step S4010), it is determined that the subnet mask value of the own device is larger than that of the device using the monitor IP address (step S4011), and the process ends. On the contrary, if there is no unicast echo response (NO in step S4010), it is determined that the subnet mask value of the own device and that of the device using the monitor IP address are equal (step S4013), and the process ends.
【0092】
If there is no unicast ICMP echo response in step S4008 (NO in step S4008), it is determined that the subnet mask value of the own device is smaller than that of the device using the monitor IP address (step S4012). End the process.
【0093】
In this way, the identity of the subnet masks used by the two devices can be verified. When it is determined that these subnet masks are different, the control unit 22 controls the subnet mask detection unit 24, the IP address determination unit 25, and the router detection unit 26 to obtain the desired subnet mask as described above. Subnet mask, detection of unassigned IP address and router IP address, transfer of these network information to network information setting unit 27, transfer from network information setting unit 27 to network information transmission unit 28, and network information transmission unit 28 The transfer from to the network interface unit 21 is selectively executed or re-executed as necessary.
【0094】
In addition, the network device determined to have a different subnet mask or the network device determined to have a different network address is notified via communication means such as e-mail that the network address and subnet mask settings are incorrect. May be good. At that time, necessary network information may be transmitted from the network information transmission unit 28 in order to automatically set the network address and subnet mask.
【0095】
(3) Subnet Mask Identity Check (Third Example) FIGS. 22 (A) and 22 (B) are sequence diagrams showing a third example of the subnet mask identity check method according to the second embodiment. Hereinafter, for the sake of simplicity, the network device for which the subnet mask values are compared is referred to as "device 1", and the network device to be compared is referred to as "device 2".
【0096】
First, as shown in FIG. 22 (A), the device 1 transmits an ICMP echo request to the device 2 with the IP address in which each bit of the host unit of the device 2 is inverted as the source IP address. If the subnet mask of device 1 is greater than or equal to that of device 2, device 2 returns a unicast ICMP echo response to device 1, and if the subnet mask of device 1 is smaller than that of device 2, device 2 is device. Do not send a unicast ICMP echo response to 1.
【0097】
When there is a unicast ICMP echo response, as shown in Fig. 22 (B), device 1 uses the inverted LSB of the network address in the IP address of device 1 or device 2 as the source IP address. Send the received ICMP echo request to device 2. If the subnet mask of device 1 is larger than that of device 2, device 2 sends a unicast ICMP echo response back to device 1, and if the subnet mask of device 1 and that of device 2 are equal, then device 2 Do not send a unicast ICMP echo response to device 1.
【0098】
FIG. 23 is a flowchart showing a third example of the subnet mask identity check operation in the present embodiment. This subnet mask identity check process is executed by the subnet mask identity determination unit 29 in FIG. Here, device 1 and device 2 in FIG. 22 correspond to own device and device using monitor IP address, respectively. In FIG. 23, steps S5001 to S5006 correspond to steps S3001 to S3006 in FIG. 19, so description thereof will be omitted.
【0099】
In step S5006, if the network address of the monitor IP address is equal to that of the own device (YES in step S5006), the subnet mask identity determination unit 29 transmits the inverted value of each bit of the host unit of the monitor IP address. Generate and send an ICMP echo request with the monitor IP address set as the source IP address and the monitor IP address set as the destination IP address (step S5007). Here, the source IP address of the ICMP echo request inverts the most significant bit (MSB) of the host part of the monitor IP address, and the other bits may be any value that does not make the entire host part 0 or -1. For example, if the monitor IP address is "10.56.88.2" and the subnet mask of the own device is "255.255.255.0", the source IP address of the ICMP echo request is which of "10.56.88.254" to "10.56.88.128". But it may be.
【0100】
When the ICMP echo request is transmitted, the subnet mask identity determination unit 29 determines whether or not there is a unicast ICMP echo response from the device with the monitor IP address (device using the monitor IP address) (step S5008).
【0101】
If there is a unicast ICMP echo response (YES in step S5008), the source IP address is the inverted value of the LSB of the network address indicated by the subnet mask of the own device in the own device IP address or monitor IP address. Generate and send an ICMP echo request with the monitor IP address as the destination IP address (step S5009).
【0102】
Subsequently, the subnet mask identity determination unit 29 determines whether or not there is a unicast echo response from the monitor IP address-using device in response to this ICMP echo request (step S5010). If there is a unicast echo response (YES in step S5010), it is determined that the subnet mask value of the own device is larger than that of the device using the monitor IP address (step S5011), and the process ends. On the contrary, if there is no unicast echo response (NO in step S5010), it is determined that the subnet mask value of the own device and that of the device using the monitor IP address are equal (step S5013), and the process ends.
【0103】
If there is no unicast ICMP echo response in step S5008 (NO in step S5008), it is determined that the subnet mask value of the own device is smaller than that of the device using the monitor IP address (step S5012). End the process.
【0104】
In this way, the identity of the subnet masks used by the two devices can be verified. When it is determined that these subnet masks are different, the control unit 22 controls the subnet mask detection unit 24, the IP address determination unit 25, and the router detection unit 26 to obtain the desired subnet mask as described above. Subnet mask, detection of unassigned IP address and router IP address, transfer of these network information to network information setting unit 27, transfer from network information setting unit 27 to network information transmission unit 28, and network information transmission unit 28 The transfer from to the network interface unit 21 is selectively executed or re-executed as necessary.
【0105】
In addition, the network device determined to have a different subnet mask or the network device determined to have a different network address is notified via communication means such as e-mail that the network address and subnet mask settings are incorrect. May be good. At that time, necessary network information may be transmitted from the network information transmission unit 28 in order to automatically set the network address and subnet mask.
【0106】
(4) Subnet Mask Identity Check (Fourth Example) FIGS. 24 (A) and 24 (B) are sequence diagrams showing a fourth example of the subnet mask identity check method according to the second embodiment. Hereinafter, for the sake of simplicity, the network device for which the subnet mask values are compared is referred to as "device 1", and the network device to be compared is referred to as "device 2".
【0107】
First, as shown in FIG. 24 (A), the device 1 transmits an ICMP echo request to the device 2 with the LSB of the network address in the IP address of the device 1 or the device 2 inverted as the source IP address. If the subnet mask of device 1 is larger than that of device 2, device 2 sends a unicast ICMP echo response back to device 1, and if the subnet mask of device 1 is less than or equal to that of device 2, device 2 Do not send a unicast ICMP echo response to device 1.
【0108】
If there is no unicast ICMP echo response, as shown in FIG. 24 (B), the device 1 sends the IP address to the device 2 with each bit of the host part of the device 2 inverted. Send an ICMP echo request with an IP address. If the subnet mask of device 1 is equal to that of device 2, device 2 returns a unicast ICMP echo response to device 1, and if the subnet mask of device 1 is smaller than that of device 2, device 2 is device 2. Do not send a unicast ICMP echo response to 1.
【0109】
FIG. 25 is a flowchart showing a fourth example of the subnet mask identity check operation in the present embodiment. This subnet mask identity check process is executed by the subnet mask identity determination unit 29 in FIG. Here, device 1 and device 2 in FIG. 24 correspond to own device and device using monitor IP address, respectively. In FIG. 25, steps S6001 to S6006 correspond to steps S3001 to S3006 in FIG. 19, so description thereof will be omitted.
【0110】
In step S6006, if the network address of the monitor IP address is equal to that of the own device (YES in step S6006), the value obtained by reversing the LSB of the network address indicated by the own device IP address or the subnet mask of the own device in the monitor IP address. Generates and sends an ICMP echo request with the source IP address as the source IP address and the monitor IP address as the destination IP address (step S6007).
【0111】
When the ICMP echo request is transmitted, the subnet mask identity determination unit 29 determines whether or not there is a unicast ICMP echo response from the device with the monitor IP address (device using the monitor IP address) (step S6008).
【0112】
If there is no unicast ICMP echo response (NO in step S6008), the subnet mask identity determination unit 29 uses the inverted value of each bit of the host unit of the monitor IP address as the source IP address and the monitor IP. Generate and send an ICMP echo request with the address set for each destination IP address (step S6009). Here, the source IP address of the ICMP echo request inverts the most significant bit (MSB) of the host part of the monitor IP address, and the other bits may be any value that does not make the entire host part 0 or -1. For example, if the monitor IP address is "10.56.88.2" and the subnet mask of the own device is "255.255.255.0", the source IP address of the ICMP echo request is which of "10.56.88.254" to "10.56.88.128". But it may be.
【0113】
Subsequently, the subnet mask identity determination unit 29 determines whether or not there is a unicast echo response from the monitor IP address-using device in response to this ICMP echo request (step S6010). If there is a unicast echo response (YES in step S6010), it is determined that the subnet mask value of the own device and that of the device using the monitor IP address are equal (step S6011), and the process ends. On the contrary, if there is no unicast echo response (NO in step S6010), it is determined that the subnet mask value of the own device is smaller than that of the device using the monitor IP address (step S6013), and the process ends.
【0114】
If there is a unicast ICMP echo response in step S6008 (YES in step S6008), it is determined that the subnet mask value of the own device is larger than that of the device using the monitor IP address (step S6012). End the process.
【0115】
In this way, the identity of the subnet masks used by the two devices can be verified. When it is determined that these subnet masks are different, the control unit 22 controls the subnet mask detection unit 24, the IP address determination unit 25, and the router detection unit 26 to obtain the desired subnet mask as described above. Subnet mask, detection of unassigned IP address and router IP address, transfer of these network information to network information setting unit 27, transfer from network information setting unit 27 to network information transmission unit 28, and network information transmission unit 28 The transfer from to the network interface unit 21 is selectively executed or re-executed as necessary.
【0116】
In addition, the network device determined to have a different subnet mask or the network device determined to have a different network address is notified via communication means such as e-mail that the network address and subnet mask settings are incorrect. May be good. At that time, necessary network information may be transmitted from the network information transmission unit 28 in order to automatically set the network address and subnet mask.
【0117】
3. FIG. 26 is a block configuration diagram showing a network information detection device according to the third embodiment of the present invention. The network information detection device 20 according to the present embodiment includes a network interface 201 for connecting to the network transmission line 10 and a transmission / reception control unit 202 for transmitting / receiving the above-mentioned IP packet or ARP packet, and is a program control processor 203. Controls the above-mentioned processing such as detection, determination, and setting of network information.
【0118】
The program control processor 203 reads and executes the subnet mask detection program, the IP address determination program, the router detection program, and the subnet mask identity determination program stored in the program memory 204, respectively, to perform the above-mentioned network information detection operation. That is, it is possible to perform processing of subnet mask detection, IP address determination and router detection, and further processing of subnet mask identity determination. The network information detected in this way is stored in the network information memory 205 and set in the own device. Alternatively, it is transmitted for the configuration of other devices on the network.
【0119】
The present invention is not limited to the above-described embodiment, and can be applied in various modifications according to the gist of the invention. The network information to be detected does not have to be all of the above-mentioned explanations, and the corresponding function may be implemented as necessary. It is also conceivable to implement a configuration in which only one of the IP address determination unit and the network information transmission unit is implemented.
【0120】
[Effect of the invention]
As described in detail above, according to the present invention, it is possible to acquire the subnet mask information used in the network without using the IP address outside the subnet. By not using an IP address outside the subnet, you don't have to send packets outside the subnet. As a result, even if there is a network device that uses the IP address outside the subnet, it is possible to eliminate the possibility of transmitting an IP packet to the network device and hindering normal operation.
【0121】
In addition, the network device can be automatically set by automatically determining the unassigned IP address from the detected subnet and further detecting the IP address of the router. Therefore, there is an effect of eliminating the manual input work of the network information by the user and preventing the network from being confused when the user inputs the network information by mistake.
【0122】
Furthermore, by simply connecting the network device purchased at the store to the user's network, it is possible to communicate with other network devices at the network layer without the need for special network information setting operations.
【0123】
Further, even when the network device is moved to another network, there is an effect that the network information can be communicated with the other network device at the network layer without manually setting the network information.
【0124】
Further, according to the present invention, since the identity of the network address and the subnet mask can be determined, the administrator of the network device using the monitored IP address can be notified by mail, dedicated application software, dedicated device, or verbally. It notifies that the network address and subnet mask settings are incorrect, and can automatically set the network address and subnet mask.
[Simple explanation of drawings]
FIG. 1 is a schematic configuration diagram showing an example of a network including a network information detection device according to the present invention.
FIG. 2 is a block configuration diagram showing a network information detection device according to the first embodiment of the present invention.
FIG. 3 is a diagram showing a format of an Ethernet® packet.
FIG. 4 is a diagram showing an IP packet format.
FIG. 5 is a diagram showing an ARP packet format.
FIG. 6 is a diagram showing an IP address format.
7A is a diagram showing the format of an ICMP echo request / response packet, FIG. 7B is a diagram showing the format of an ICMP time-out notification packet, and FIG. 7C is a diagram showing the format of an ICMP route change request packet. is there.
FIG. 8 is a flowchart showing a first example of subnet mask detection processing in the present embodiment.
FIG. 9 is a schematic diagram showing an IP address and an IP area included in each packet when four ARP or IP packets are monitored.
FIG. 10 is a flowchart showing a second example of the subnet mask detection process in the present embodiment.
FIG. 11 is a flowchart showing a third example of the subnet mask detection process in the present embodiment.
FIG. 12 is a schematic diagram showing a subnet mask detection process when four inspection IP addresses are generated.
FIG. 13 is a flowchart showing an assignable IP address determination process in the IP address determination unit 25.
FIG. 14 is a flowchart showing a first example of a router detection operation in the router detection unit 26.
FIG. 15 is a schematic diagram showing a network for explaining the characteristics of an IP packet transmitted to a host connected to a network outside the subnet.
FIG. 16 is a flowchart showing a second example of a router detection operation in the router detection unit 26.
FIG. 17 is a block configuration diagram showing a network information detection device according to a second embodiment of the present invention.
18A and 18B are sequence diagrams showing a first example of the subnet mask identity check method according to the second embodiment.
FIG. 19 is a flowchart showing a first example of a subnet mask identity check operation in the present embodiment.
20A and 20B are sequence diagrams showing a second example of the subnet mask identity check method according to the second embodiment.
FIG. 21 is a flowchart showing a second example of the subnet mask identity check operation in the present embodiment.
22 (A) and 22 (B) are sequence diagrams showing a third example of the subnet mask identity check method according to the second embodiment.
FIG. 23 is a flowchart showing a third example of the subnet mask identity check operation in the present embodiment.
FIG. 24 (A) and (B) are sequence diagrams showing a fourth example of the subnet mask identity check method according to the second embodiment.
FIG. 25 is a flowchart showing a fourth example of the subnet mask identity check operation in the present embodiment.
FIG. 26 is a block configuration diagram showing a network information detection device according to a third embodiment of the present invention.
[Explanation of symbols]
Ten LAN transmission line 20 Network information detector 21 Network interface unit 22 Control unit 23 Packet monitor 24 Subnet mask detection unit 25 IP address determination unit 26 Router detection unit 27 Network information setting unit 28 Network information transmission unit 29 Subnet mask identity determination unit 30 ~ 50 Host 60 Router
Every citation, both ways
| Document | Relation | Office | Cited during |
|---|---|---|---|
| JP2008028989A | Cited by | Japan | Examiner |
| JP2007325154A | Cited by | Japan | Examiner |
| JP2010068152A | Cited by | Japan | Examiner |
| US8254388B2 | Cited by | United States of America | Applicant |
| JP2007221565A | Cited by | Japan | Search report |
6 members in 2 offices
Priority claims6
| Document | Office | Kind | Date |
|---|---|---|---|
| 2002191717 | Japan | A | |
| 2002191717 | Japan | – | |
| 2003180537 | Japan | A | |
| 20022002191717 | – | – | – |
| JP20020191717 | – | – | – |
| JP20030180537 | – | – | – |
Members6
| Document | Office | Kind | |
|---|---|---|---|
| US2004017814A1 | United States of America | A1 | |
| JP2004088747AThis record | Japan | A | |
| JP2009017605A | Japan | A | |
| JP4232550B2 | Japan | B2 | |
| US7724679B2 | United States of America | B2 | |
| JP4883325B2 | Japan | B2 |
18 legal events, as the office reported them to INPADOC
Over the term
Point at a mark for the eventEvents
| Event | Code | |
|---|---|---|
| Cancellation because of no payment of annual feesLAPS | LAPS | |
| Renewal fee payment (event date is renewal date of database)FPAY | FPAY | |
| Renewal fee payment (event date is renewal date of database)FPAY | FPAY | |
| Renewal fee payment (event date is renewal date of database)FPAY | FPAY | |
| Renewal fee payment (event date is renewal date of database)FPAY | FPAY | |
| Renewal fee payment (event date is renewal date of database)FPAY | FPAY | |
| Certificate of patent or registration of utility modelJAPANESE INTERMEDIATE CODE: R150R150 | R150 | |
| Certificate of patent or registration of utility modelJAPANESE INTERMEDIATE CODE: R150R150 | R150 | |
| First payment of annual fees (during grant procedure)JAPANESE INTERMEDIATE CODE: A61A61 | A61 | |
| Written decision to grant a patent or to grant a registration (utility model)JAPANESE INTERMEDIATE CODE: A01A01 | A01 | |
| Written decision to grant a patent or to grant a registration (utility model)JAPANESE INTERMEDIATE CODE: A01A01 | A01 | |
| Decision of grant or rejection writtenTRDD | TRDD | |
| Request for written amendment filedJAPANESE INTERMEDIATE CODE: A523A521 | A521 | |
| Notification of reasons for refusalJAPANESE INTERMEDIATE CODE: A131A131 | A131 | |
| Request for written amendment filedJAPANESE INTERMEDIATE CODE: A523A521 | A521 | |
| Notification of reasons for refusalJAPANESE INTERMEDIATE CODE: A131A131 | A131 | |
| Report on retrievalJAPANESE INTERMEDIATE CODE: A971007A977 | A977 | |
| Written request for application examinationJAPANESE INTERMEDIATE CODE: A621A621 | A621 |
Numbers
- Publication
- 2004088747
- Publication, DOCDB
- 2004088747
- Publication, EPODOC
- JP2004088747
- Application
- 180537
- Application, DOCDB
- 2003180537
- Application, EPODOC
- JP20030180537
Titles3
- Japanese
- ネットワーク情報検出装置および方法
- English
- Network information detector and method
- English
- DEVICE AND METHOD FOR DETECTING NETWORK INFORMATION
Classification
- CPC, 7
- H04L61/2092
- H04L29/1232
- H04L29/12801
- H04L41/0853
- H04L41/0866
- H04L43/028
- H04L61/6004
- IPC, 4
- H04L12 28
- H04L12 24
- H04L12 26
- H04L29 12