JP2011077596A - Ip address determination device, terminal device, and computer program - Google Patents

Ip address determination device, terminal device, and computer program Download PDF

Info

Publication number
JP2011077596A
JP2011077596A JP2009224003A JP2009224003A JP2011077596A JP 2011077596 A JP2011077596 A JP 2011077596A JP 2009224003 A JP2009224003 A JP 2009224003A JP 2009224003 A JP2009224003 A JP 2009224003A JP 2011077596 A JP2011077596 A JP 2011077596A
Authority
JP
Japan
Prior art keywords
address
value
target
specific
printer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2009224003A
Other languages
Japanese (ja)
Other versions
JP5338597B2 (en
Inventor
Tomoko Ando
智子 安藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Brother Industries Ltd
Original Assignee
Brother Industries Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Brother Industries Ltd filed Critical Brother Industries Ltd
Priority to JP2009224003A priority Critical patent/JP5338597B2/en
Publication of JP2011077596A publication Critical patent/JP2011077596A/en
Application granted granted Critical
Publication of JP5338597B2 publication Critical patent/JP5338597B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To quickly determine a target IP address for a target device. <P>SOLUTION: The control unit 30 of a terminal device 10 combines the value of a network address part of a self-IP address 27 with a value generated by a random number or the like to generate a temporary candidate IP address. The control unit 30 specifies the range of an IP address that can be allocated by an external IP address allocation server from a table 23. The control unit 30 determines the temporary candidate IP address as a candidate IP address when the temporary candidate IP address is not included in the range of the IP address. The control unit 30 determines the temporary IP address as a target IP address when it is confirmed that the candidate IP address is not set in other devices. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本明細書によって開示される技術は、ネットワーク内で利用されるべき対象デバイスのための対象IPアドレスを決定する技術に関する。   The technology disclosed by this specification relates to a technology for determining a target IP address for a target device to be used in a network.

ネットワーク内の各デバイスにIPアドレスを割り当てるIPアドレス割り当てサーバ(例えばDHCP(Dynamic Host Configuration Protocol)サーバ、BOOTP(Bootstrap Protocol)サーバ等)が広く知られている。例えば、特許文献1には、DHCPサーバとして機能するIP電話装置が開示されている。IP電話装置は、自己のDHCPサーバが割り当て可能なIPアドレスの範囲を記憶している。IP電話装置は、上記のIPアドレスの範囲内から1個のIPアドレスを選択し、当該1個のIPアドレスを他のデバイスに割り当てる。これにより、上記の他のデバイスにIPアドレスが設定される。また、IP電話装置は、自己に設定されるべきIPアドレスを決定すべき際に、自己のDHCPサーバが割り当て可能な上記のIPアドレスの範囲に含まれない候補IPアドレスを生成する。これにより、IP電話装置は、自己のDHCPサーバによって他のデバイスに割り当てられている可能性があるIPアドレス以外の候補IPアドレスを生成することができる。次いで、IP電話装置は、候補IPアドレスがネットワーク内の他のデバイスに設定されているのか否かを確認する確認処理を実行する。候補IPアドレスが他のデバイスに設定されていないことが確認される場合に、IP電話装置は、候補IPアドレスを自己のIPアドレスとして設定する。一方において、候補IPアドレスが他のデバイスに設定されていることが確認される場合に、IP電話装置は、新たな候補IPアドレスの生成と上記の確認処理とを再び実行する。   An IP address assignment server (for example, a DHCP (Dynamic Host Configuration Protocol) server, a BOOTP (Bootstrap Protocol) server, etc.) that assigns an IP address to each device in a network is widely known. For example, Patent Document 1 discloses an IP telephone apparatus that functions as a DHCP server. The IP telephone device stores a range of IP addresses that can be assigned by its own DHCP server. The IP telephone apparatus selects one IP address from the above IP address range, and assigns the one IP address to another device. Thereby, an IP address is set to the other device. In addition, when determining an IP address to be set for itself, the IP telephone device generates candidate IP addresses that are not included in the range of the IP address that can be assigned by the DHCP server of the IP telephone device. As a result, the IP telephone apparatus can generate candidate IP addresses other than IP addresses that may be assigned to other devices by its own DHCP server. Next, the IP telephone apparatus executes a confirmation process for confirming whether the candidate IP address is set in another device in the network. When it is confirmed that the candidate IP address is not set in another device, the IP telephone apparatus sets the candidate IP address as its own IP address. On the other hand, when it is confirmed that the candidate IP address is set in another device, the IP telephone apparatus performs again the generation of a new candidate IP address and the above confirmation processing.

特開2007−166069号公報JP 2007-166069 A 特開平8−223206号公報JP-A-8-223206

しかしながら、IP電話装置内のDHCPサーバと異なる外部のIPアドレス割り当てサーバがネットワーク内に存在し、当該外部のIPアドレス割り当てサーバが、ネットワーク内の各デバイスにIPアドレスを割り当てる可能性がある。この場合、IP電話装置内のDHCPサーバが割り当て可能なIPアドレスの範囲に含まれない候補IPアドレスが生成されても、当該候補IPアドレスが、外部のIPアドレス割り当てサーバによって他のデバイスに既に割り当てられている可能性がある。この場合、上述したように、上記の確認処理において、候補IPアドレスが他のデバイスに設定されていることが確認されるために、IP電話装置は、新たな候補IPアドレスの生成と上記の確認処理とを再び実行しなければならない。即ち、特許文献1の技術では、IP電話装置のためのIPアドレスを決定する過程において、外部のIPアドレス割り当てサーバによって他のデバイスに既に割り当てられている候補IPアドレスが生成され得るために、IP電話装置のためのIPアドレスを決定するのに長時間を要する可能性がある。   However, there is a possibility that an external IP address assignment server different from the DHCP server in the IP telephone apparatus exists in the network, and the external IP address assignment server assigns an IP address to each device in the network. In this case, even if a candidate IP address that is not included in the range of IP addresses that can be assigned by the DHCP server in the IP telephone apparatus is generated, the candidate IP address is already assigned to another device by the external IP address assignment server. There is a possibility that. In this case, as described above, in the above confirmation process, since it is confirmed that the candidate IP address is set in another device, the IP telephone apparatus generates a new candidate IP address and performs the above confirmation. Processing must be performed again. That is, in the technique of Patent Document 1, in the process of determining an IP address for an IP telephone apparatus, a candidate IP address that has already been assigned to another device by an external IP address assignment server can be generated. It may take a long time to determine the IP address for the telephone device.

本明細書では、対象IPアドレスのための対象IPアドレスを迅速に決定し得る技術を開示する。   The present specification discloses a technique capable of quickly determining a target IP address for a target IP address.

本明細書では、ネットワーク内で利用されるべき対象デバイスのための対象IPアドレスを決定するIPアドレス決定装置を開示する。IPアドレス決定装置は、特定部と決定部とを備える。特定部は、外部のIPアドレス割り当てサーバが割り当て可能なIPアドレスの範囲を特定する。決定部は、IPアドレス決定装置自身に設定されている特定のIPアドレスと、IPアドレス決定装置自身に設定されている特定のサブネットマスクと、に基づいて、IPアドレスの範囲に含まれない対象IPアドレスを決定する。   The present specification discloses an IP address determination apparatus that determines a target IP address for a target device to be used in a network. The IP address determination device includes a specifying unit and a determination unit. The specifying unit specifies a range of IP addresses that can be assigned by an external IP address assignment server. The determination unit determines whether the target IP is not included in the IP address range based on the specific IP address set in the IP address determination device itself and the specific subnet mask set in the IP address determination device itself. Determine the address.

上記の構成によると、IPアドレス決定装置は、外部のIPアドレス割り当てサーバが割り当て可能なIPアドレスの範囲を特定することができるために、上記のIPアドレスの範囲を用いて、対象IPアドレスを決定することができる。例えば、IPアドレス決定装置は、上記のIPアドレスの範囲に含まれない候補IPアドレスを生成することができる。この場合、外部のIPアドレス割り当てサーバによって他のデバイスに既に割り当てられている候補IPアドレスが生成されるのを抑制することができるために、例えば、候補IPアドレスを用いて上記の確認処理を実行しても、候補IPアドレスが他のデバイスに設定されていることが確認される可能性が低い。従って、対象デバイスのための対象IPアドレスを迅速に決定することができる。この例で説明したように、上記のIPアドレスの範囲を用いれば、対象デバイスのための対象IPアドレスを迅速に決定し得る。しかも、上記の構成によると、IPアドレス決定装置は、上記の特定のIPアドレス(即ち自己のIPアドレス)と、上記の特定のサブネットマスク(即ち自己のサブネットマスク)と、に基づいて、対象IPアドレスを決定することができる。従って、例えば、上記の特定のIPアドレスに一致するIPアドレス(以下では「第1のIPアドレス」と呼ぶ)が、対象IPアドレスとして決定されるのを抑制することができる。また、例えば、上記の特定のIPアドレス及び上記の特定のサブネットマスクによって決まるネットワークアドレス部の値と異なるネットワークアドレス部の値を含むIPアドレス(以下では「第2のIPアドレス」と呼ぶ)が、対象IPアドレスとして決定されるのを抑制することができる。仮に、上記の第1又は第2のIPアドレスが対象デバイスに設定されると、対象デバイスは、IPアドレス決定装置と適切に通信することができない。上記の構成によると、例えば、上記の第1又は第2のIPアドレスが対象IPアドレスとして決定されるのを抑制することができるために、IPアドレス決定装置は、自身と適切に通信を実行し得るIPアドレスを、対象IPアドレスとして決定することができる。   According to the above configuration, since the IP address determination device can specify the range of IP addresses that can be allocated by the external IP address allocation server, the target IP address is determined using the range of IP addresses. can do. For example, the IP address determination device can generate candidate IP addresses that are not included in the above IP address range. In this case, since the candidate IP address already assigned to another device can be prevented from being generated by the external IP address assignment server, for example, the above confirmation process is executed using the candidate IP address. Even so, the possibility that the candidate IP address is set to another device is low. Therefore, the target IP address for the target device can be quickly determined. As described in this example, if the above IP address range is used, the target IP address for the target device can be quickly determined. In addition, according to the above configuration, the IP address determination device can determine the target IP address based on the specific IP address (that is, its own IP address) and the specific subnet mask (that is, its own subnet mask). An address can be determined. Therefore, for example, it can be suppressed that an IP address (hereinafter referred to as “first IP address”) that matches the specific IP address is determined as the target IP address. Further, for example, an IP address (hereinafter referred to as a “second IP address”) including a value of the network address part different from the value of the network address part determined by the specific IP address and the specific subnet mask is It is possible to suppress the determination as the target IP address. If the first or second IP address is set in the target device, the target device cannot appropriately communicate with the IP address determination apparatus. According to the above configuration, for example, since it is possible to suppress the determination of the first or second IP address as the target IP address, the IP address determination device appropriately communicates with itself. The IP address to be obtained can be determined as the target IP address.

決定部は、生成部と確認部とを備えていてもよい。生成部は、上記の特定のIPアドレスと、上記の特定のサブネットマスクと、に基づいて、上記のIPアドレスの範囲に含まれない候補IPアドレスを生成してもよい。確認部は、ネットワーク内の他のデバイスに候補IPアドレスが設定されているのか否かを確認してもよい。決定部は、他のデバイスに候補IPアドレスが設定されていないことが確認される場合に、候補IPアドレスを対象IPアドレスとして決定してもよい。この構成によると、外部のIPアドレス割り当てサーバによって他のデバイスに既に割り当てられている候補IPアドレスが生成されるのを抑制することができるために、他のデバイスに候補IPアドレスが設定されていないことが確認される可能性が高い。このために、IPアドレス決定装置は、対象デバイスのための対象IPアドレスを迅速に決定することができる。   The determination unit may include a generation unit and a confirmation unit. The generation unit may generate a candidate IP address that is not included in the range of the IP address based on the specific IP address and the specific subnet mask. The confirmation unit may confirm whether or not a candidate IP address is set for another device in the network. The determination unit may determine the candidate IP address as the target IP address when it is confirmed that the candidate IP address is not set in another device. According to this configuration, since it is possible to suppress generation of a candidate IP address that is already assigned to another device by the external IP address assignment server, no candidate IP address is set for the other device. There is a high probability that it will be confirmed. For this reason, the IP address determination apparatus can quickly determine the target IP address for the target device.

生成部は、上記の特定のIPアドレスのネットワークアドレス部の値と、上記の特定のIPアドレスのホストアドレス部の値とは異なる特定の値と、を組み合わせることによって、仮の候補IPアドレスを生成してもよい。生成部は、仮の候補IPアドレスが上記のIPアドレスの範囲に含まれない場合に、仮の候補IPアドレスを候補IPアドレスとして決定してもよい。上記の構成によると、IPアドレス決定装置は、上記の特定の値を含む仮の候補IPアドレスを生成すれば、上記の特定のIPアドレスに一致する仮の候補IPアドレス(即ち上記の第1のIPアドレス)が生成されるのを抑制することができる。しかも、IPアドレス生成装置は、上記の特定のIPアドレスのネットワーク部の値を含む仮の候補IPアドレスを生成する。このために、上記の特定のIPアドレスのネットワークアドレス部の値と異なるネットワークアドレス部の値を含むIPアドレス(即ち上記の第2のIPアドレス)が、仮の候補IPアドレスとして決定されるのを抑制することができる。上記の構成によると、IPアドレス決定装置と適切に通信を実行し得る仮の候補IPアドレスを生成することができ、しかも、仮の候補IPアドレスから対象IPアドレスを決定することによって、IPアドレス決定装置と適切に通信を実行し得る対象IPアドレスを決定することができる。   The generation unit generates a temporary candidate IP address by combining the value of the network address part of the specific IP address and a specific value different from the value of the host address part of the specific IP address. May be. The generation unit may determine the temporary candidate IP address as the candidate IP address when the temporary candidate IP address is not included in the above IP address range. According to the above configuration, when the IP address determination device generates a temporary candidate IP address including the specific value, the temporary candidate IP address that matches the specific IP address (that is, the first first IP address described above). (IP address) can be prevented from being generated. Moreover, the IP address generation device generates a temporary candidate IP address including the value of the network part of the specific IP address. For this reason, an IP address including a value of the network address part different from the value of the network address part of the specific IP address (that is, the second IP address) is determined as a temporary candidate IP address. Can be suppressed. According to the above configuration, a temporary candidate IP address that can appropriately execute communication with the IP address determination device can be generated, and the IP address determination can be performed by determining the target IP address from the temporary candidate IP address. The target IP address that can appropriately communicate with the apparatus can be determined.

生成部は、乱数を用いて、上記の特定の値を決定してもよい。この構成によると、上記の特定の値をランダムに決定することができる。   The generation unit may determine the specific value using a random number. According to this configuration, the specific value can be determined at random.

生成部は、上記の特定のサブネットマスクの値が第1の所定値よりも小さい第1の場合に、乱数を用いて、上記の特定の値を決定してもよい。また、生成部は、上記の特定のサブネットマスクの値が第1の所定値よりも大きい第2の場合に、乱数を用いずに、上記の特定の値を決定してもよい。上記の特定のサブネットマスクの値が第1の所定値よりも小さいということは、仮の候補IPアドレスのホストアドレス部として採り得る値の範囲が大きい(即ち選択肢が多い)ことを意味し、上記の特定のサブネットマスクの値が第1の所定値よりも大きいということは、仮の候補IPアドレスのホストアドレス部として採り得る値の範囲が小さい(即ち選択肢が少ない)ことを意味する。上記のIPアドレスの範囲は固定された範囲であるために、選択肢が多ければ、その選択肢の中では、上記のIPアドレスの範囲に含まれる値が占める割合が小さくなり、選択肢が少なければ、その選択肢の中では、上記のIPアドレスの範囲に含まれる値が占める割合が大きくなる。上記の構成では、IPアドレス決定装置は、選択肢が多い場合には、乱数を用いて上記の特定の値をランダムに決定し、ランダムに決定された上記の特定の値を含む仮の候補IPアドレスを生成する。即ち、IPアドレス決定装置は、選択肢が多い場合には、仮の候補IPアドレスをランダムに生成する。選択肢が多い場合には、上記の割合が小さいために、ランダムに生成する手法を採用しても、上記のIPアドレスの範囲に含まれない仮の候補IPアドレスを高い確率で生成することができる。一方において、IPアドレス決定装置は、選択肢が少ない場合には、仮の候補IPアドレスをランダムに生成しない。上記の割合が大きいために、上記のIPアドレスの範囲に含まれる仮の候補IPアドレスが生成される可能性が高いからである。この構成によると、上記のIPアドレスの範囲に含まれる仮の候補IPアドレスが生成されるのを抑制することができる。   The generation unit may determine the specific value using a random number in the first case where the value of the specific subnet mask is smaller than the first predetermined value. In addition, the generation unit may determine the specific value without using a random number in the second case where the value of the specific subnet mask is larger than the first predetermined value. That the value of the specific subnet mask is smaller than the first predetermined value means that the range of values that can be taken as the host address portion of the temporary candidate IP address is large (that is, there are many options). That the value of the specific subnet mask is larger than the first predetermined value means that the range of values that can be taken as the host address portion of the temporary candidate IP address is small (that is, there are few options). Since the range of the above IP address is a fixed range, if there are many options, the ratio of the values included in the range of the above IP address is small in the options. Among the options, the ratio of the values included in the above IP address range is large. In the above configuration, when there are many choices, the IP address determination device randomly determines the specific value using a random number, and the temporary candidate IP address including the specific value determined at random Is generated. That is, the IP address determination device randomly generates temporary candidate IP addresses when there are many options. When there are many options, the above-mentioned ratio is small, so even if a random generation method is adopted, a temporary candidate IP address that is not included in the IP address range can be generated with high probability. . On the other hand, the IP address determination device does not randomly generate temporary candidate IP addresses when there are few options. This is because, since the ratio is large, there is a high possibility that a temporary candidate IP address included in the IP address range is generated. According to this configuration, it is possible to suppress generation of a temporary candidate IP address included in the above IP address range.

生成部は、第2の場合において、上記の特定のIPアドレスのホストアドレス部の値が第2の所定値よりも大きい場合に、第2の所定値よりも小さい値を、上記の特定の値として決定してもよい。生成部は、第2の場合において、上記の特定のIPアドレスのホストアドレス部の値が第2の所定値よりも小さい場合に、第2の所定値よりも大きい値を、上記の特定の値として決定してもよい。IPアドレス割り当てサーバの中には、自己が割り当て可能なIPアドレスの範囲のうち、大きい値から順に割り当てる第1のタイプのサーバと、小さい値から順に割り当てる第2のタイプのサーバと、が存在する。例えば、上記の特定のIPアドレスがIPアドレス割り当てサーバによって割り当てられたものである場合には、上記の特定のIPアドレスのホストアドレス部の値に基づいて、当該IPアドレス割り当てサーバが、第1及び第2のタイプのどちらのサーバであるのかを推察することができる。即ち、上記の特定のIPアドレスのホストアドレス部の値が第2の所定値よりも大きい場合には、上記の第1のタイプのサーバによって上記の特定のIPアドレスが割り当てられたことが推察できる。この場合、上記の第1のタイプのサーバによって、第2の所定値よりも大きいホストアドレス部の値を含むIPアドレスが他のデバイスに割り当てられている可能性が高い。従って、上記の構成では、IPアドレス決定装置は、上記の特定のIPアドレスのホストアドレス部の値が第2の所定値よりも大きい場合に、第2の所定値よりも小さい値、即ち、他のデバイスに割り当てられている可能性が低い値を、上記の特定の値として決定する。一方において、上記の特定のIPアドレスのホストアドレス部の値が第2の所定値よりも小さい場合には、上記の第2のタイプのサーバによって上記の特定のIPアドレスが割り当てられたことが推察できる。従って、上記の構成では、IPアドレス決定装置は、上記の特定のIPアドレスのホストアドレス部の値が第2の所定値よりも小さい場合に、第2の所定値よりも大きい値、即ち、他のデバイスに割り当てられている可能性が低い値を、上記の特定の値として決定する。上記の構成によると、他のデバイスに割り当てられている可能性が低いホストアドレス部の値を含む仮の候補IPアドレスを生成することができる。   In the second case, when the value of the host address part of the specific IP address is larger than a second predetermined value, the generation unit sets a value smaller than the second predetermined value to the specific value. May be determined as In the second case, when the value of the host address part of the specific IP address is smaller than the second predetermined value, the generation unit sets the value larger than the second predetermined value to the specific value. May be determined as Among the IP address assignment servers, there are a first type server assigned in order from the largest value and a second type server assigned in order from the smallest value in the range of IP addresses that can be assigned by itself. . For example, when the specific IP address is assigned by an IP address assignment server, the IP address assignment server determines whether the first and second IP address assignment servers are based on the value of the host address part of the specific IP address. It can be inferred which server is the second type. That is, when the value of the host address part of the specific IP address is larger than the second predetermined value, it can be inferred that the specific IP address is assigned by the first type server. . In this case, there is a high possibility that the IP address including the host address part value larger than the second predetermined value is assigned to another device by the first type server. Therefore, in the above configuration, when the value of the host address part of the specific IP address is larger than the second predetermined value, the IP address determining device has a value smaller than the second predetermined value, that is, other values. A value that is unlikely to be assigned to the device is determined as the specific value. On the other hand, if the value of the host address portion of the specific IP address is smaller than the second predetermined value, it is inferred that the specific IP address is assigned by the second type server. it can. Therefore, in the above configuration, when the value of the host address part of the specific IP address is smaller than the second predetermined value, the IP address determining device has a value larger than the second predetermined value, ie, other A value that is unlikely to be assigned to the device is determined as the specific value. According to the above configuration, it is possible to generate a temporary candidate IP address including the value of the host address portion that is unlikely to be assigned to another device.

上記の「第2の所定値よりも小さい値」は、仮の候補IPアドレスのホストアドレス部の値として採り得る値の範囲のうち、最小値から順に選択される値であってもよい。また、上記の「第2の所定値よりも大きい値」は、仮の候補IPアドレスのホストアドレス部の値として採り得る値の範囲のうち、最大値から順に選択される値であってもよい。この構成によると、他のデバイスに割り当てられている可能性が低いホストアドレス部の値を含む仮の候補IPアドレスを、効率的に生成することができる。   The above “value smaller than the second predetermined value” may be a value selected in order from the smallest value in a range of values that can be taken as the value of the host address portion of the temporary candidate IP address. In addition, the above “value greater than the second predetermined value” may be a value selected in order from the maximum value in a range of values that can be taken as the value of the host address portion of the temporary candidate IP address. . According to this configuration, it is possible to efficiently generate a temporary candidate IP address including the value of the host address portion that is unlikely to be assigned to another device.

IPアドレス決定装置は、決定部によって決定される対象IPアドレスを対象デバイスに供給する供給部をさらに備えていてもよい。この構成によると、例えば、対象IPアドレスを対象デバイスに入力する作業をユーザが実行せずに済む。ユーザの作業負担を軽減することができる。   The IP address determination apparatus may further include a supply unit that supplies a target IP address determined by the determination unit to the target device. According to this configuration, for example, the user does not have to perform an operation of inputting the target IP address to the target device. The work burden on the user can be reduced.

特定部は、上記のIPアドレスの範囲が予め登録されているテーブルから、上記のIPアドレスの範囲を読み込むことによって、上記のIPアドレスの範囲を特定してもよい。   The specifying unit may specify the range of the IP address by reading the range of the IP address from a table in which the range of the IP address is registered in advance.

本明細書では、さらに、ネットワーク内で利用されるべき対象デバイスのためのデバイスドライバがインストールされる端末装置を開示する。端末装置は、情報取得部と、上記のIPアドレス決定装置と、ポート生成部と、インストール部と、を備えていてもよい。情報取得部は、対象デバイスから、対象デバイスに現在設定されているIPアドレスの設定手法を示す設定手法情報を取得してもよい。IPアドレス決定装置は、設定手法情報が、対象デバイスのIPアドレスが変更される可能性が高い特定の設定手法を示す場合であり、かつ、対象デバイスのデバイス名に対応する対応IPアドレスを名前解決によって取得することができない場合に、対象デバイスのための対象IPアドレスを決定してもよい。ポート生成部は、対象IPアドレスに対応するポートを生成してもよい。インストール部は、デバイスドライバをインストールしてもよい。この構成によると、端末装置は、対象デバイスのIPアドレスが変更される可能性が高く、かつ、名前解決によって適切なIPアドレスが得られない場合に、対象デバイスのための対象IPアドレスを迅速に決定し得る。   The present specification further discloses a terminal device in which a device driver for a target device to be used in a network is installed. The terminal device may include an information acquisition unit, the above IP address determination device, a port generation unit, and an installation unit. The information acquisition unit may acquire setting technique information indicating an IP address setting technique currently set for the target device from the target device. The IP address determination device is a case where the setting method information indicates a specific setting method that is highly likely to change the IP address of the target device, and the corresponding IP address corresponding to the device name of the target device is resolved. The target IP address for the target device may be determined if it cannot be obtained by The port generation unit may generate a port corresponding to the target IP address. The installation unit may install a device driver. According to this configuration, the terminal device can quickly determine the target IP address for the target device when the IP address of the target device is highly likely to be changed and an appropriate IP address cannot be obtained by name resolution. Can be determined.

なお、上記のIPアドレス決定装置を実現するための制御方法及びコンピュータプログラムも、新規で有用である。また、上記の端末装置を実現するための制御方法及びコンピュータプログラムも、新規で有用である。   Note that a control method and a computer program for realizing the above IP address determination device are also new and useful. Also, a control method and a computer program for realizing the above terminal device are novel and useful.

ネットワークシステムの構成の一例を示す。1 shows an example of the configuration of a network system. プリンタドライバをインストールするための処理のフローチャートを示す。3 shows a flowchart of a process for installing a printer driver. 図2の続きのフローチャートを示す。FIG. 3 is a flowchart continued from FIG. 2. FIG. IPアドレス決定処理のフローチャートを示す。The flowchart of an IP address determination process is shown. 図4のフローチャートを示す。The flowchart of FIG. 4 is shown. 仮の候補IPアドレスの生成手法の一例を説明するための図を示す。The figure for demonstrating an example of the production | generation method of a temporary candidate IP address is shown. 仮の候補IPアドレスの生成手法の別の例を説明するための図を示す。The figure for demonstrating another example of the production | generation method of a temporary candidate IP address is shown.

(システムの構成)
図面を参照して実施例を説明する。図1に示されるように、ネットワークシステム2は、LAN4と、端末装置10と、プリンタ60と、複数のサーバ62〜68と、を備える。各デバイス10,60,62〜68は、LAN4に接続されている。各デバイス10等は、LAN4を介して、相互に通信可能である。なお、本実施例では、ネットワークシステム2では、IPv4(Internet Protocol version4)のIPアドレスが利用される。
(System configuration)
Embodiments will be described with reference to the drawings. As illustrated in FIG. 1, the network system 2 includes a LAN 4, a terminal device 10, a printer 60, and a plurality of servers 62 to 68. Each device 10, 60, 62 to 68 is connected to the LAN 4. The devices 10 and the like can communicate with each other via the LAN 4. In the present embodiment, the network system 2 uses an IPv4 (Internet Protocol version 4) IP address.

(端末装置10の構成)
本実施例の端末装置10はPCである。端末装置10は、操作部12と、表示部14と、ネットワークインターフェイス16と、記録媒体読取部18と、記憶部24と、制御部30と、を備える。操作部12は、マウスとキーボードとによって構成される。ユーザは、操作部12を操作することによって、様々な指示を端末装置10に入力することができる。表示部14は、様々な情報を表示するためのディスプレイである。ネットワークインターフェイス16は、LAN4に接続されている。記録媒体読取部18は、記録媒体20に格納されているデータ(例えばプログラム22、テーブル23内のデータ)を読み取る。記録媒体20は、データを格納するためのCD、DVD等の媒体であり、プリンタ60のベンダによって製造されたものである。記録媒体20は、プリンタ60の出荷時には、プリンタ60と共にパッケージされている。記録媒体20に含まれるプログラム22は、プリンタ60のためのプリンタドライバと、当該プリンタドライバをインストールするためのプログラムと、を含む。記録媒体20に含まれるテーブル23は、複数種類のIPアドレス割り当てサーバのそれぞれについて、当該種類のIPアドレス割り当てサーバに対応する種類情報と、当該種類のIPアドレス割り当てサーバが割り当て可能なIPアドレスの範囲と、が対応づけられた情報を含む。IPアドレス割り当てサーバは、例えば、DHCPサーバ、BOOTPサーバ等である。記憶部24は、OS(Operating System)プログラム26を記憶する。記憶部24は、さらに、端末装置10自身に現在設定されているIPアドレス27及びサブネットマスク28を記憶する。なお、IPアドレス27は、DHCPサーバ62によって端末装置10に割り当てられる。制御部30は、プログラム22,26に従って、様々な処理を実行する。制御部30がプログラム22に従って処理を実行することによって、各部32〜46の機能が実現される。
(Configuration of terminal device 10)
The terminal device 10 of this embodiment is a PC. The terminal device 10 includes an operation unit 12, a display unit 14, a network interface 16, a recording medium reading unit 18, a storage unit 24, and a control unit 30. The operation unit 12 includes a mouse and a keyboard. The user can input various instructions to the terminal device 10 by operating the operation unit 12. The display unit 14 is a display for displaying various information. The network interface 16 is connected to the LAN 4. The recording medium reading unit 18 reads data stored in the recording medium 20 (for example, data in the program 22 and the table 23). The recording medium 20 is a medium such as a CD or DVD for storing data, and is manufactured by the vendor of the printer 60. The recording medium 20 is packaged together with the printer 60 when the printer 60 is shipped. The program 22 included in the recording medium 20 includes a printer driver for the printer 60 and a program for installing the printer driver. The table 23 included in the recording medium 20 includes, for each of a plurality of types of IP address allocation servers, type information corresponding to the type of IP address allocation server and a range of IP addresses that can be allocated by the type of IP address allocation server. And information associated with each other. The IP address assignment server is, for example, a DHCP server, a BOOTP server, or the like. The storage unit 24 stores an OS (Operating System) program 26. The storage unit 24 further stores the IP address 27 and subnet mask 28 currently set in the terminal device 10 itself. The IP address 27 is assigned to the terminal device 10 by the DHCP server 62. The control unit 30 executes various processes according to the programs 22 and 26. When the control unit 30 executes processing according to the program 22, the functions of the units 32 to 46 are realized.

(他のデバイス60〜68の構成)
プリンタ60は、少なくとも印刷機能を有するデバイスである。プリンタ60は、スキャナ機能、コピー機能、FAX機能、電話機能等をさらに有する多機能機であってもよい。プリンタ60は、ベンダによって予め決められるMACアドレスを有する。また、プリンタ60には、ノード名が設定されている。プリンタ60の出荷時には、プリンタ60には、デフォルトのノード名が設定されている。ユーザは、プリンタ60の操作部(図示省略)を操作することによって、所望のノード名をプリンタ60に入力することができる。この結果、プリンタ60には、デフォルトのノード名に代えて、入力されたノード名が設定される。さらに、プリンタ60には、IPアドレスが設定されている。IPアドレスの設定手法については、後で詳しく説明する。なお、以下では、「デバイス(例えばプリンタ60、端末装置10)に設定されているIPアドレス(又はノード名)」、及び、「デバイスのIPアドレス(又はノード名)」という用語を使用することがあるが、これらの用語は、例えば、「デバイスが自己のIPアドレス(又はノード名)として使用しているIPアドレス(又はノード名)」と言い換えることができる。
(Configuration of other devices 60 to 68)
The printer 60 is a device having at least a printing function. The printer 60 may be a multi-function device that further includes a scanner function, a copy function, a FAX function, a telephone function, and the like. The printer 60 has a MAC address predetermined by the vendor. A node name is set for the printer 60. When the printer 60 is shipped, a default node name is set in the printer 60. The user can input a desired node name to the printer 60 by operating an operation unit (not shown) of the printer 60. As a result, the input node name is set in the printer 60 instead of the default node name. Furthermore, an IP address is set for the printer 60. The IP address setting method will be described in detail later. In the following, the terms “IP address (or node name) set in the device (for example, printer 60, terminal device 10)” and “device IP address (or node name)” are used. However, these terms can be rephrased as, for example, “IP address (or node name) used by the device as its own IP address (or node name)”.

DHCPサーバ62は、LAN4に接続されている対象デバイス(プリンタ60、端末装置10等)にIPアドレスを割り当てる。DHCPサーバ62は、対象デバイスからの要求に応じて、LAN4に接続されている他のデバイスに設定されていないIPアドレスを対象デバイスに送信する。この結果、対象デバイスは、DHCPサーバ62から送信されるIPアドレスを、自己のIPアドレスとして、新たに設定する。なお、テーブル23に複数種類のIPアドレス割り当てサーバが登録されていることから理解できるように、複数種類のDHCPサーバが知られている。各種類のDHCPサーバが割り当て可能なIPアドレスの範囲は、例えばDHCPサーバのメーカによって予め決められている。例えば、DHCPサーバ62がテーブル23の「S1」に対応するものである場合には、DHCPサーバ62は、「192.168.1.100」〜「192.168.1.150」の範囲内の1個のIPアドレスを対象デバイスに割り当てる。   The DHCP server 62 assigns an IP address to a target device (such as the printer 60 or the terminal device 10) connected to the LAN 4. In response to a request from the target device, the DHCP server 62 transmits an IP address that is not set in another device connected to the LAN 4 to the target device. As a result, the target device newly sets the IP address transmitted from the DHCP server 62 as its own IP address. As can be understood from the fact that a plurality of types of IP address assignment servers are registered in the table 23, a plurality of types of DHCP servers are known. The range of IP addresses that can be assigned by each type of DHCP server is determined in advance by, for example, the manufacturer of the DHCP server. For example, when the DHCP server 62 corresponds to “S1” of the table 23, the DHCP server 62 is within the range of “192.168.1.100” to “192.168.1.150”. One IP address is assigned to the target device.

BOOTPサーバ64は、DHCPサーバ62と同様の処理を実行する。即ち、BOOTPサーバ64は、LAN4に接続されている対象デバイスからの要求に応じて、対象デバイス(例えばプリンタ60)にIPアドレスを割り当てる。複数種類のBOOTPサーバが知られている。各種類のBOOTPサーバが割り当て可能なIPアドレスの範囲は、予め決められている。   The BOOTP server 64 performs the same processing as the DHCP server 62. That is, the BOOTP server 64 assigns an IP address to the target device (for example, the printer 60) in response to a request from the target device connected to the LAN 4. Multiple types of BOOTP servers are known. The range of IP addresses that can be assigned to each type of BOOTP server is determined in advance.

RARP(Reverse Address Resolution Protocol)サーバ66は、LAN4に接続されている対象デバイスに設定されるべきIPアドレスと、対象デバイスのMACアドレスと、を対応づけて記憶する。例えば、ユーザは、RARPサーバ66の操作部(図示省略)を操作することによって、対象デバイスに設定されるべきIPアドレスと、対象デバイスのMACアドレスと、をRARPサーバ66に入力してもよい。この場合、RARPサーバ66は、ユーザによって自身に入力されたIPアドレスとMACアドレスとを対応づけて記憶する。また、例えば、ユーザは、端末装置10の操作部12を操作することによって、対象デバイスに設定されるべきIPアドレスと、対象デバイスのMACアドレスと、を端末装置10に入力してもよい。この場合、端末装置10は、当該IPアドレスと当該MACアドレスとをRARPサーバ66に送信する。この結果、RARPサーバ66は、ユーザによって端末装置10に入力されたIPアドレスとMACアドレスとを対応づけて記憶する。対象デバイスは、例えば、自身の電源がONされた際に、自己のMACアドレスを含むコマンドをRARPサーバ66に送信する。RARPサーバ66は、上記のコマンドに含まれるMACアドレスに対応づけられているIPアドレスを含む応答を送信する。この結果、対象デバイスは、RARPサーバ66から送信される応答に含まれるIPアドレスを、自己のIPアドレスとして、新たに設定する。   An RARP (Reverse Address Resolution Protocol) server 66 stores an IP address to be set for the target device connected to the LAN 4 and the MAC address of the target device in association with each other. For example, the user may input an IP address to be set for the target device and the MAC address of the target device to the RARP server 66 by operating an operation unit (not shown) of the RARP server 66. In this case, the RARP server 66 stores the IP address input to the RARP server 66 and the MAC address in association with each other. Further, for example, the user may input the IP address to be set to the target device and the MAC address of the target device to the terminal device 10 by operating the operation unit 12 of the terminal device 10. In this case, the terminal device 10 transmits the IP address and the MAC address to the RARP server 66. As a result, the RARP server 66 stores the IP address input to the terminal device 10 by the user and the MAC address in association with each other. For example, when the power of the target device is turned on, the target device transmits a command including its own MAC address to the RARP server 66. The RARP server 66 transmits a response including an IP address associated with the MAC address included in the command. As a result, the target device newly sets the IP address included in the response transmitted from the RARP server 66 as its own IP address.

DNS(Domain Name System)サーバ68は、DHCPサーバ62又はBOOTPサーバ64によってIPアドレスが割り当てられる各デバイス(例えばプリンタ60、端末装置10)について、当該デバイスに設定されているIPアドレスと、当該デバイスに設定されているノード名と、を対応づけて記憶する。例えば、DHCPサーバ62又はBOOTPサーバ64は、対象デバイスにIPアドレスを割り当てた際に、当該IPアドレスと対象デバイスのノード名とをDNSサーバ68に送信する。この結果、DNSサーバ68は、DHCPサーバ62又はBOOTPサーバ64から送信されるIPアドレスとノード名とを対応づけて記憶する。LAN4に接続されているデバイス(例えば端末装置10)は、当該デバイスが通信すべき他のデバイスのノード名をDNSサーバ68に送信することによって、当該ノード名に対応づけられているIPアドレスをDNSサーバ68から取得することができる。   A DNS (Domain Name System) server 68 has, for each device (for example, the printer 60 and the terminal device 10) to which an IP address is assigned by the DHCP server 62 or the BOOTP server 64, an IP address set for the device, The set node name is stored in association with each other. For example, when the DHCP server 62 or the BOOTP server 64 assigns an IP address to the target device, the DHCP server 62 or the BOOTP server 64 transmits the IP address and the node name of the target device to the DNS server 68. As a result, the DNS server 68 stores the IP address and node name transmitted from the DHCP server 62 or the BOOTP server 64 in association with each other. A device (for example, the terminal device 10) connected to the LAN 4 transmits the node name of the other device with which the device communicates to the DNS server 68, so that the IP address associated with the node name is DNS. It can be acquired from the server 68.

(プリンタ60にIPアドレスを設定するための手法)
本実施例では、プリンタ60にIPアドレスを設定するための手法として、「Static」と「DHCP」と「BOOTP」と「RARP」と「AUTO」とを含む複数種類の設定手法が存在する。本実施例では、ユーザは、プリンタ60の操作部(図示省略)を操作することによって、プリンタ60にIPアドレスを設定する。しかしながら、ユーザは、例えば、USBケーブル等を用いて、プリンタ60を端末装置10に接続し、端末装置10の操作部12を操作することによって、プリンタ60にIPアドレスを設定してもよい。ユーザは、プリンタ60の操作部を操作することによって、上記の複数種類の設定手法の中から1種類の設定手法を選択する。
(Method for setting an IP address in the printer 60)
In this embodiment, as a method for setting an IP address in the printer 60, there are a plurality of types of setting methods including “Static”, “DHCP”, “BOOTP”, “RARP”, and “AUTO”. In this embodiment, the user sets an IP address for the printer 60 by operating an operation unit (not shown) of the printer 60. However, the user may set an IP address for the printer 60 by connecting the printer 60 to the terminal device 10 and operating the operation unit 12 of the terminal device 10 using, for example, a USB cable. The user operates the operation unit of the printer 60 to select one type of setting method from the plurality of types of setting methods.

(Static)
設定手法「Static」が選択された場合には、ユーザは、プリンタ60の操作部を操作することによって、プリンタ60に設定されるべきIPアドレスをプリンタ60に入力する。プリンタ60は、入力されたIPアドレスを、自己のIPアドレスとして、新たに設定する。この場合、プリンタ60は、自己のIPアドレスの設定手法が「Static」であることを示す設定手法情報を記憶する。
(Static)
When the setting method “Static” is selected, the user inputs an IP address to be set in the printer 60 to the printer 60 by operating the operation unit of the printer 60. The printer 60 newly sets the input IP address as its own IP address. In this case, the printer 60 stores setting method information indicating that its own IP address setting method is “Static”.

(DHCP又はBOOTP)
設定手法「DHCP」又は「BOOTP」が選択された場合には、プリンタ60は、DHCPサーバ62又はBOOTPサーバ64にコマンドを送信することによって、LAN4に接続されている他のデバイスに設定されていないIPアドレスをDHCPサーバ62又はBOOTPサーバ64から取得する。プリンタ60は、取得されたIPアドレスを、自己のIPアドレスとして、新たに設定する。この場合、プリンタ60は、自己のIPアドレスの設定手法が「DHCP」又は「BOOTP」であることを示す設定手法情報を記憶する。なお、IPアドレス割り当てサーバ(DHCPサーバ62、BOOTPサーバ64)は、プリンタ60にIPアドレスを貸し出す機能を有するサーバであると表現することもできる。IPアドレス割り当てサーバによって貸し出されるIPアドレスは、プリンタ60において永続的に利用されるものではない。従って、設定手法「DHCP」又は「BOOTP」が選択された場合には、プリンタ60のIPアドレスが変更され得る。
(DHCP or BOOTP)
When the setting method “DHCP” or “BOOTP” is selected, the printer 60 is not set to another device connected to the LAN 4 by sending a command to the DHCP server 62 or the BOOTP server 64. An IP address is acquired from the DHCP server 62 or the BOOTP server 64. The printer 60 newly sets the acquired IP address as its own IP address. In this case, the printer 60 stores setting method information indicating that its own IP address setting method is “DHCP” or “BOOTP”. The IP address assignment server (DHCP server 62, BOOTP server 64) can also be expressed as a server having a function of lending an IP address to the printer 60. The IP address lent by the IP address assignment server is not permanently used in the printer 60. Therefore, when the setting method “DHCP” or “BOOTP” is selected, the IP address of the printer 60 can be changed.

(RARP)
設定手法「RARP」が選択された場合には、プリンタ60は、RARPサーバ66に自己のMACアドレスを含むコマンドを送信することによって、当該MACアドレスに対応づけられているIPアドレスをRARPサーバ66から取得する。なお、ユーザは、設定手法「RARP」を選択する場合には、プリンタ60に設定されるべきIPアドレスと、プリンタ60のMACアドレスと、をRARPサーバ66に予め入力(登録)しておく必要がある。プリンタ60は、取得したIPアドレスを、自己のIPアドレスとして、新たに設定する。この場合、プリンタ60は、自己のIPアドレスの設定手法が「RARP」であることを示す設定手法情報を記憶する。
(RARP)
When the setting method “RARP” is selected, the printer 60 transmits a command including its own MAC address to the RARP server 66, so that the IP address associated with the MAC address is received from the RARP server 66. get. When the user selects the setting method “RARP”, the user needs to input (register) the IP address to be set in the printer 60 and the MAC address of the printer 60 in the RARP server 66 in advance. is there. The printer 60 newly sets the acquired IP address as its own IP address. In this case, the printer 60 stores setting method information indicating that its own IP address setting method is “RARP”.

(AUTO)
設定手法「AUTO」が選択された場合には、プリンタ60は、DHCP、BOOTP、及び、RARPの3種類の設定手法の中から1種類の設定手法を選択し、選択された設定手法を用いて、IPアドレスを取得することを試行する第1の試行処理を実行する。第1の試行処理でIPアドレスを取得不可能である場合には、プリンタ60は、残りの2種類の設定手法の中から1種類の設定手法を選択し、選択された設定手法を用いて、IPアドレスを取得することを試行する第2の試行処理を実行する。第2の試行処理でIPアドレスを取得不可能である場合には、プリンタ60は、残りの1種類の設定手法を用いて、IPアドレスを取得することを試行する第3の試行処理を実行する。なお、上記の3種類の設定手法の選択順序は、予め決められている。プリンタ60は、第1〜第3の試行処理のいずれかで取得されたIPアドレスを、自己のIPアドレスとして、新たに設定する。この場合、プリンタ60は、IPアドレスを取得できた試行処理に対応する設定手法(「DHCP」、「BOOTP」、又は、「RARP」)を示す設定手法情報を記憶する。なお、これに代えて、プリンタ60は、自己のIPアドレスの設定手法が「AUTO」であることを示す設定手法情報を記憶してもよい。
(AUTO)
When the setting method “AUTO” is selected, the printer 60 selects one setting method from the three setting methods of DHCP, BOOTP, and RARP, and uses the selected setting method. The first trial process for trying to acquire the IP address is executed. When the IP address cannot be acquired in the first trial process, the printer 60 selects one setting method from the remaining two setting methods, and uses the selected setting method. A second trial process for trying to obtain an IP address is executed. If the IP address cannot be acquired in the second trial process, the printer 60 executes a third trial process that tries to acquire an IP address using the remaining one setting method. . Note that the selection order of the above three types of setting methods is determined in advance. The printer 60 newly sets the IP address acquired in any of the first to third trial processes as its own IP address. In this case, the printer 60 stores setting method information indicating a setting method (“DHCP”, “BOOTP”, or “RARP”) corresponding to the trial process for which the IP address has been acquired. Instead of this, the printer 60 may store setting method information indicating that its own IP address setting method is “AUTO”.

(APIPA(Automatic Private IP Addressing))
設定手法「DHCP」、「BOOTP」、又は、「RARP」が選択された場合に、プリンタ60がIPアドレスを取得することができない状況が発生し得る。例えば、選択された設定手法(例えば「DHCP」)に対応するサーバ(例えばDHCPサーバ62)が存在しない場合には、プリンタ60は、IPアドレスを取得することができない。また、例えば、プリンタ60に設定されるべきIPアドレスと、プリンタ60のMACアドレスと、がRARPサーバ66に予め登録されていない状態で、「RARP」が選択された場合には、プリンタ60は、IPアドレスを取得することができない。「DHCP」、「BOOTP」、又は、「RARP」が選択された場合であって、IPアドレスを取得不可能である場合には、プリンタ60は、APIPAに従って、自己に設定されるべきIPアドレスを生成する。また、「AUTO」が選択された場合であって、上記の第3の試行処理でもIPアドレスを取得不可能である場合にも、プリンタ60は、APIPAに従って、自己に設定されるべきIPアドレスを生成する。プリンタ60は、APIPAに従ってIPアドレスを生成するためのアルゴリズムを予め記憶している。プリンタ60は、APIPAに従って生成されたIPアドレスを、自己のIPアドレスとして、新たに設定する。APIPAに従ってIPアドレスが設定される場合、プリンタ60は、「AUTO」を示す設定手法情報を記憶する。なお、これに代えて、プリンタ60は、ユーザによって選択された設定手法(「DHCP」、「BOOTP」、「RARP」、又は、「AUTO」)を示す設定手法情報を記憶してもよい。
(APIPA (Automatic Private IP Addressing))
When the setting method “DHCP”, “BOOTP”, or “RARP” is selected, a situation in which the printer 60 cannot acquire an IP address may occur. For example, if there is no server (for example, DHCP server 62) corresponding to the selected setting method (for example, “DHCP”), the printer 60 cannot acquire an IP address. For example, when “RARP” is selected in a state where the IP address to be set in the printer 60 and the MAC address of the printer 60 are not registered in the RARP server 66 in advance, the printer 60 An IP address cannot be acquired. When “DHCP”, “BOOTP”, or “RARP” is selected and an IP address cannot be acquired, the printer 60 sets an IP address to be set in accordance with APIPA. Generate. Also, when “AUTO” is selected and the IP address cannot be acquired even in the third trial process, the printer 60 sets the IP address to be set in accordance with APIPA. Generate. The printer 60 stores in advance an algorithm for generating an IP address according to APIPA. The printer 60 newly sets an IP address generated according to APIPA as its own IP address. When the IP address is set according to APIPA, the printer 60 stores setting method information indicating “AUTO”. Alternatively, the printer 60 may store setting method information indicating a setting method (“DHCP”, “BOOTP”, “RARP”, or “AUTO”) selected by the user.

(端末装置10が実行する処理)
続いて、端末装置10が実行する処理について説明する。ユーザは、プリンタ60のためのプリンタドライバが端末装置10にインストールされることを望む場合に、記録媒体20を記録媒体読取部18内に格納し、操作部12において所定の操作を実行する。これにより、制御部30は、OSプログラム26に従って、記録媒体読取部18を起動する。この結果、記録媒体読取部18は、記録媒体20に格納されているプログラム22を読み取り、プログラム22を記憶部24内のワーク領域に格納する。これにより、制御部30は、ワーク領域に格納されたプログラム22に従って、図2及び図3の処理を実行することができる。
(Processing executed by the terminal device 10)
Then, the process which the terminal device 10 performs is demonstrated. When a user desires that a printer driver for the printer 60 be installed in the terminal device 10, the user stores the recording medium 20 in the recording medium reading unit 18 and executes a predetermined operation on the operation unit 12. Thereby, the control unit 30 activates the recording medium reading unit 18 according to the OS program 26. As a result, the recording medium reading unit 18 reads the program 22 stored in the recording medium 20 and stores the program 22 in the work area in the storage unit 24. Thereby, the control part 30 can perform the process of FIG.2 and FIG.3 according to the program 22 stored in the work area.

図2に示されるように、情報取得部42(図1参照)は、第1のコマンドをブロードキャストする(S10)。プログラム22は、プリンタ60のためのプログラムであるために、プリンタ60のモデル名(機種名)を含む。情報取得部42は、プログラム22に含まれるモデル名を含む第1の応答が受信されることを監視する(S12)。例えば、プリンタ60がLAN4に正常に接続されている状態では、プリンタ60は、第1のコマンドが受信された場合に、自己のモデル名、自己のIPアドレス、自己のノード名、自己のIPアドレスの設定手法を示す設定手法情報等を含む第1の応答を端末装置10に送信する。この結果、情報取得部42は、プログラム22に含まれるモデル名を含む第1の応答を取得し、S12でYESと判断する。一方において、例えば、プリンタ60がLAN4に正常に接続されていない状態では、プリンタ60は、第1のコマンドを受信することができず、第1の応答を送信しない。この場合、情報取得部42は、S12でNOと判断する。   As shown in FIG. 2, the information acquisition unit 42 (see FIG. 1) broadcasts the first command (S10). Since the program 22 is a program for the printer 60, the model 22 includes a model name (model name) of the printer 60. The information acquisition unit 42 monitors whether the first response including the model name included in the program 22 is received (S12). For example, in a state where the printer 60 is normally connected to the LAN 4, when the first command is received, the printer 60 has its own model name, its own IP address, its own node name, and its own IP address. A first response including setting method information indicating the setting method is transmitted to the terminal device 10. As a result, the information acquisition unit 42 acquires the first response including the model name included in the program 22, and determines YES in S12. On the other hand, for example, when the printer 60 is not normally connected to the LAN 4, the printer 60 cannot receive the first command and does not transmit the first response. In this case, the information acquisition unit 42 determines NO in S12.

S12でNOの場合、制御部30は、警告画面を表示部14に表示させ(S14)、処理を終了する。一方において、S12でYESの場合、情報取得部42は、第1の応答に含まれるIPアドレス、ノード名、及び、設定手法情報を読み込む(S16)。即ち、情報取得部42は、プリンタ60のIPアドレス、プリンタ60のノード名、及び、プリンタ60のIPアドレスの設定手法を示す設定手法情報を読み込む。次いで、制御部30は、S16で読み込まれたプリンタ60のIPアドレスがAPIPAに従って生成されたものであるのか否かを判断する。APIPAでは、IPアドレスの範囲(例えば「169.254.0.0」〜「169.254.255.254」)が予め決められており、その範囲に含まれるIPアドレスが生成される。制御部30は、S16で読み込まれたプリンタ60のIPアドレスが上記の範囲に含まれる場合に、S30でYESと判断する。   In the case of NO in S12, the control unit 30 displays a warning screen on the display unit 14 (S14) and ends the process. On the other hand, if YES in S12, the information acquisition unit 42 reads the IP address, node name, and setting method information included in the first response (S16). That is, the information acquisition unit 42 reads setting method information indicating the setting method of the IP address of the printer 60, the node name of the printer 60, and the IP address of the printer 60. Next, the control unit 30 determines whether the IP address of the printer 60 read in S16 is generated according to APIPA. In APIPA, an IP address range (for example, “169.254.0.0” to “169.254.255.254”) is determined in advance, and an IP address included in the range is generated. When the IP address of the printer 60 read in S16 is included in the above range, the control unit 30 determines YES in S30.

S30でYESの場合、決定部34(図1参照)は、対象IPアドレス決定処理を実行する(S32)。対象IPアドレス決定処理の詳細については、後で述べる。次いで、制御部30は、対象IPアドレス決定処理で決定された対象IPアドレスを表示部14に表示させる(S34)。この結果、ユーザは、プリンタ60に新たに設定されるべき対象IPアドレスを知ることができる。ユーザは、例えば、プリンタ60の操作部を操作することによって、設定手法「Static」を選択して、対象IPアドレスをプリンタ60に設定することができる。S34を終えると、図3のS50に進む。図2のS34を経て実行されるS50では、ポート生成部44(図1参照)は、図2のS32で決定された対象IPアドレスを用いて、プリンタポートを生成する。即ち、ポート生成部44は、対象IPアドレスが指定されたプリンタポートを生成する。この結果、プリンタ60に対応するプリンタポートが生成される。プリンタポートは、記憶部24に格納される。S50を終えると、インストール部46(図1参照)は、プログラム22に含まれるプリンタドライバを記憶部24内の所定の領域に格納することによって、プリンタドライバをインストールする(S52)。   In the case of YES in S30, the determination unit 34 (see FIG. 1) executes target IP address determination processing (S32). Details of the target IP address determination process will be described later. Next, the control unit 30 causes the display unit 14 to display the target IP address determined by the target IP address determination process (S34). As a result, the user can know the target IP address to be newly set in the printer 60. For example, the user can select the setting method “Static” by operating the operation unit of the printer 60 and set the target IP address in the printer 60. When S34 ends, the process proceeds to S50 in FIG. In S50 executed through S34 in FIG. 2, the port generation unit 44 (see FIG. 1) generates a printer port using the target IP address determined in S32 in FIG. That is, the port generation unit 44 generates a printer port in which the target IP address is designated. As a result, a printer port corresponding to the printer 60 is generated. The printer port is stored in the storage unit 24. When S50 ends, the installation unit 46 (see FIG. 1) installs the printer driver by storing the printer driver included in the program 22 in a predetermined area in the storage unit 24 (S52).

一方において、S30でNOの場合、制御部30は、S16で読み込まれた設定手法情報が「Static」を示すのか否かを判断する(S36)。ここでYESの場合、図3のS50に進む。図2のS36でYESの場合に実行されるS50では、ポート生成部44は、図2のS16で読み込まれたプリンタ60のIPアドレスを用いて、プリンタポートを生成する。S50の次のS52は、上記と同様に実行される。   On the other hand, in the case of NO in S30, the control unit 30 determines whether or not the setting method information read in S16 indicates “Static” (S36). In the case of YES here, the process proceeds to S50 of FIG. In S50 executed when YES in S36 of FIG. 2, the port generation unit 44 generates a printer port using the IP address of the printer 60 read in S16 of FIG. S52 subsequent to S50 is executed in the same manner as described above.

図2のS36でNOの場合、即ち、図2のS16で読み込まれた設定手法情報が「DHCP」、「BOOTP」、「RARP」、又は、「AUTO」を示す場合には、図3のS40に進む。S40では、制御部30は、名前解決によってプリンタ60のIPアドレスを取得可能であるのか否かを確認する(S40)。具体的には、制御部30は、図2のS16で読み込まれたプリンタ60のノード名を含む第2のコマンドをブロードキャストする。LAN4に接続されているプリンタ60は、第2のコマンドを受信する。第2のコマンドに含まれるノード名を有するプリンタ60は、自己のIPアドレスを含む第2の応答を端末装置10に送信する。LAN4に接続されている他のプリンタ(図示省略)も第2のコマンドを受信するが、そのプリンタは、第2のコマンドに含まれるノード名と異なるノード名を有するために、第2の応答を送信しない。なお、端末装置10のネットワークインターフェイス16によって第2の応答が受信されても、制御部30が第2の応答を取得できないことがあり得る。例えば、端末装置10にセキュリティソフトが格納されている場合には、そのセキュリティソフトが、第2の応答を破棄する可能性がある。この場合、制御部30は、第2の応答を取得することができない。   If NO in S36 of FIG. 2, that is, if the setting method information read in S16 of FIG. 2 indicates “DHCP”, “BOOTP”, “RARP”, or “AUTO”, S40 of FIG. Proceed to In S40, the control unit 30 checks whether or not the IP address of the printer 60 can be acquired by name resolution (S40). Specifically, the control unit 30 broadcasts the second command including the node name of the printer 60 read in S16 of FIG. The printer 60 connected to the LAN 4 receives the second command. The printer 60 having the node name included in the second command transmits a second response including its own IP address to the terminal device 10. Other printers (not shown) connected to the LAN 4 also receive the second command. However, since the printer has a node name different from the node name included in the second command, the second response is sent. Do not send. Even if the second response is received by the network interface 16 of the terminal device 10, the control unit 30 may not be able to acquire the second response. For example, when security software is stored in the terminal device 10, the security software may discard the second response. In this case, the control unit 30 cannot acquire the second response.

なお、上記の名前解決手法の代わりに、以下の名前解決手法を採用してもよい。即ち、制御部30は、図2のS16で読み込まれたプリンタ60のノード名を含む第3のコマンドをDNSサーバ68に送信する。プリンタ60のノード名とプリンタ60のIPアドレスとの組合せがDNSサーバ68に登録されている場合には、DNSサーバ68は、プリンタ60のIPアドレスを含む第3の応答を端末装置10に送信する。なお、上記の第2の応答の場合と同様に、ネットワークインターフェイス16によって第3の応答が受信されても、制御部30が第3の応答を取得できないことがあり得る。また、プリンタ60のノード名がDNSサーバ68に登録されていない場合、又は、DNSサーバ68がLAN4に接続されていない場合にも、制御部30は、第3の応答を取得することができない。   Note that the following name resolution technique may be adopted instead of the above name resolution technique. That is, the control unit 30 transmits the third command including the node name of the printer 60 read in S16 of FIG. When the combination of the node name of the printer 60 and the IP address of the printer 60 is registered in the DNS server 68, the DNS server 68 transmits a third response including the IP address of the printer 60 to the terminal device 10. . As in the case of the second response described above, even if the third response is received by the network interface 16, the control unit 30 may not be able to acquire the third response. Further, even when the node name of the printer 60 is not registered in the DNS server 68, or when the DNS server 68 is not connected to the LAN 4, the control unit 30 cannot acquire the third response.

上記した名前解決手法によって応答(第2の応答又は第3の応答)を取得可能である場合には、制御部30は、S40でYESと判断する。この場合、制御部30は、上記の応答に含まれるIPアドレスと、図2のS16で読み込まれたIPアドレスと、が一致するのか否かを判断する(S42)。S42でNOの場合は、名前解決が適切に機能していないことを意味する。例えば、DHCPサーバ62等によってプリンタ60のIPアドレスが変更されたにも関わらず、変更後のIPアドレスとプリンタ60のノード名との対応関係がDNSサーバ68に登録されていない場合(即ち変更前のIPアドレスとプリンタ60のノード名との対応関係がDNSサーバ68に依然として登録されている場合)には、名前解決が適切に機能しない。名前解決が適切に機能している場合(S42でYESの場合)には、ポート生成部44は、図2のS16で読み込まれたノード名を用いて、プリンタポートを生成する(S44)。即ち、ポート生成部44は、図2のS16で読み込まれたプリンタ60のノード名が指定されたプリンタポートを生成する。この結果、プリンタ60に対応するプリンタポートが生成される。S44の次のS52は、上記と同様に実行される。   If the response (second response or third response) can be acquired by the name resolution method described above, the control unit 30 determines YES in S40. In this case, the control unit 30 determines whether or not the IP address included in the response matches the IP address read in S16 of FIG. 2 (S42). If NO in S42, it means that name resolution is not functioning properly. For example, even though the IP address of the printer 60 is changed by the DHCP server 62 or the like, the correspondence between the changed IP address and the node name of the printer 60 is not registered in the DNS server 68 (that is, before the change). If the correspondence between the IP address of the printer and the node name of the printer 60 is still registered in the DNS server 68), name resolution does not function properly. If name resolution is functioning properly (YES in S42), the port generation unit 44 generates a printer port using the node name read in S16 of FIG. 2 (S44). That is, the port generation unit 44 generates a printer port in which the node name of the printer 60 read in S16 of FIG. 2 is designated. As a result, a printer port corresponding to the printer 60 is generated. S52 following S44 is executed in the same manner as described above.

S40でNOの場合、又は、S42でNOの場合、決定部34は、対象IPアドレス決定処理を実行する(S46)。S46の処理は、図2のS32の処理と同様である。次いで、供給部40(図1参照)は、図2のS16で読み込まれたプリンタ60のIPアドレスを送信先として、S46で決定された対象IPアドレスを送信する(S48)。なお、S48の処理は、例えば、SNMP(Simple Network Management Protocol)のSETコマンドを利用する。これにより、端末装置10からプリンタ60に対象IPアドレスが供給される。プリンタ60は、対象IPアドレスを、自己のIPアドレスとして、新たに設定する。なお、S48が実行された場合には、プリンタ60は、自己のIPアドレスの設定手法が「Static」であることを示す設定手法情報を新たに記憶する。S48を経て実行されるS50では、ポート生成部44は、S46で決定された対象IPアドレスを用いて、プリンタポートを生成する(S50)。S50の次のS52は、上記と同様に実行される。   In the case of NO in S40 or in the case of NO in S42, the determination unit 34 executes target IP address determination processing (S46). The process of S46 is the same as the process of S32 of FIG. Next, the supply unit 40 (see FIG. 1) transmits the target IP address determined in S46 using the IP address of the printer 60 read in S16 of FIG. 2 as the transmission destination (S48). Note that the processing of S48 uses, for example, a SNMP (Simple Network Management Protocol) SET command. As a result, the target IP address is supplied from the terminal device 10 to the printer 60. The printer 60 newly sets the target IP address as its own IP address. When S48 is executed, the printer 60 newly stores setting method information indicating that its own IP address setting method is “Static”. In S50 executed through S48, the port generation unit 44 generates a printer port using the target IP address determined in S46 (S50). S52 subsequent to S50 is executed in the same manner as described above.

なお、図2のS30でYESの場合、即ち、プリンタ60のIPアドレスがAPIPAによって決定されたものである場合には、プリンタ60は、APIPAによって予め決められたIPアドレス(例えば「169.254.・・・」等)を有する。この場合、APIPAによって決定されたプリンタ60のIPアドレスのネットワークアドレス部の値(例えば「169.254」)が、DHCPサーバ62によって割り当てられた端末装置10のIPアドレス27のネットワークアドレス部の値(例えば「192.168」)と異なる。従って、図2のS30でYESの場合には、端末装置10とプリンタ60との間でユニキャスト通信を実行することができない。即ち、端末装置10は、図2のS32で決定される対象IPアドレスを、ユニキャスト通信によって、プリンタ60に送信することができない。このために、図2のS30でYESの場合に実行されるS34では、端末装置10は、対象IPアドレスを表示させ、対象IPアドレスをプリンタ60に設定するようにユーザに促す。一方において、図2のS30でNOの場合、即ち、プリンタ60のIPアドレスがAPIPA以外の手法(例えば「DHCP」等)によって決定されたものである場合には、プリンタ60のIPアドレスのネットワークアドレス部の値が、端末装置10のIPアドレス27のネットワークアドレス部の値に一致し得る。従って、図2のS30でNOの場合には、端末装置10とプリンタ60との間でユニキャスト通信を実行し得る。このために、図2のS30でNOの場合に実行される図3のS48では、端末装置10は、ユニキャスト通信を用いて、対象IPアドレスをプリンタ60に送信する。   If YES in S30 of FIG. 2, that is, if the IP address of the printer 60 is determined by APIPA, the printer 60 uses the IP address predetermined by APIPA (for example, “169.254. ... In this case, the value of the network address part of the IP address of the printer 60 determined by APIPA (for example, “169.254”) is the value of the network address part of the IP address 27 of the terminal device 10 assigned by the DHCP server 62 ( For example, “192.168”). Therefore, if YES is obtained in S30 of FIG. 2, unicast communication cannot be performed between the terminal device 10 and the printer 60. That is, the terminal device 10 cannot transmit the target IP address determined in S32 of FIG. 2 to the printer 60 by unicast communication. Therefore, in S34 executed when YES in S30 of FIG. 2, the terminal apparatus 10 displays the target IP address and prompts the user to set the target IP address in the printer 60. On the other hand, if NO in S30 of FIG. 2, that is, if the IP address of the printer 60 is determined by a method other than APIPA (eg, “DHCP”), the network address of the IP address of the printer 60 The value of the part may match the value of the network address part of the IP address 27 of the terminal device 10. Therefore, in the case of NO in S <b> 30 of FIG. 2, unicast communication can be performed between the terminal device 10 and the printer 60. Therefore, in S48 of FIG. 3 executed when NO in S30 of FIG. 2, the terminal device 10 transmits the target IP address to the printer 60 using unicast communication.

(IPアドレス決定処理)
続いて、図4及び図5を参照して、図2のS32又は図3のS46で実行されるIPアドレス決定処理について説明する。図4のS70では、生成部36(図1参照)は、記憶部24に格納されている端末装置10自身のIPアドレス27及びサブネットマスク28を読み込む。次いで、生成部36は、IPアドレス27及びサブネットマスク28を用いて、IPアドレス27のネットワークアドレス部の値と、IPアドレス27のホストアドレス部の値と、を特定する。IPアドレス27及びサブネットマスク28は、それぞれ、32ビットの値(即ち2進数の32桁の値)によって構成されている。IPアドレス27及びサブネットマスク28は、8ビット毎の10進数又は16進数で表現することができる。なお、以下では、8ビット毎の10進数又は16進数のことを「10進数」又は「16進数」と簡単に呼ぶ。
(IP address determination process)
Next, with reference to FIGS. 4 and 5, the IP address determination process executed in S32 of FIG. 2 or S46 of FIG. 3 will be described. In S <b> 70 of FIG. 4, the generation unit 36 (see FIG. 1) reads the IP address 27 and subnet mask 28 of the terminal device 10 stored in the storage unit 24. Next, the generation unit 36 specifies the value of the network address part of the IP address 27 and the value of the host address part of the IP address 27 using the IP address 27 and the subnet mask 28. Each of the IP address 27 and the subnet mask 28 is configured by a 32-bit value (that is, a binary 32-digit value). The IP address 27 and the subnet mask 28 can be expressed by decimal numbers or hexadecimal numbers every 8 bits. Hereinafter, a decimal number or a hexadecimal number every 8 bits is simply referred to as “decimal number” or “hexadecimal number”.

図6の例では、IPアドレス27が10進数で「192.168.0.1」であり、サブネットマスク28が10進数で「255.255.255.0」である。このサブネットマスク28は、2進数では、先頭から24ビットが全て「1」であり、最後の8ビットが全て「0」である。即ち、図6のサブネットマスク28は、先頭から24ビットをマスクすることを示す。サブネットマスク28がマスクしている部分に対応するIPアドレス27の部分が、ネットワークアドレス部であり、サブネットマスク28がマスクしていない部分に対応するIPアドレス27の部分が、ホストアドレス部である。即ち、図6のIPアドレス27では、先頭から24ビットの値「192.168.0」が、ネットワークアドレス部の値であり、最後の8ビットの値「1(2進数で「00000001」)」が、ホストアドレス部の値である。   In the example of FIG. 6, the IP address 27 is “192.168.0.1” in decimal, and the subnet mask 28 is “255.255.255.0” in decimal. In the binary mask 28, all 24 bits from the beginning are “1” and all the last 8 bits are “0” in binary. That is, the subnet mask 28 in FIG. 6 indicates that 24 bits are masked from the beginning. The part of the IP address 27 corresponding to the part masked by the subnet mask 28 is the network address part, and the part of the IP address 27 corresponding to the part not masked by the subnet mask 28 is the host address part. That is, in the IP address 27 of FIG. 6, the value “192.168.8.0” of 24 bits from the head is the value of the network address part, and the value of the last 8 bits “1 (binary number“ 00000001 ”)”. Is the value of the host address part.

また、図7の例では、IPアドレス27は図6と同様であるが、サブネットマスク28が「255.255.255.224」である。なお、図7のIPアドレス27の右側に記載されている括弧内の8ビットの値「00000001」は、IPアドレス27の最後の8ビットが2進数で表現されたものである。同様に、図7のサブネットマスク28の右側に記載されている括弧内の8ビットの値「11100000」は、サブネットマスク28の最後の8ビットが2進数で表現されたものである。従って、図7のサブネットマスク28を2進数で表現すると、先頭から27ビットが全て「1」であり、最後の5ビットが全て「0」である。即ち、図7のサブネットマスク28は、先頭から27ビットをマスクすることを示す。従って、図7のIPアドレス27では、先頭から27ビットの値が、ネットワークアドレス部の値であり、最後の5ビットの値「00001」が、ホストアドレス部の値である。   In the example of FIG. 7, the IP address 27 is the same as that of FIG. 6, but the subnet mask 28 is “255.255.255.224”. Note that the 8-bit value “00000001” in parentheses described on the right side of the IP address 27 in FIG. 7 is the last 8 bits of the IP address 27 expressed in binary. Similarly, the 8-bit value “11100000” in parentheses described on the right side of the subnet mask 28 in FIG. 7 is the last 8 bits of the subnet mask 28 expressed in binary. Therefore, when the subnet mask 28 of FIG. 7 is expressed in binary, all the 27 bits from the top are “1” and all the last 5 bits are “0”. That is, the subnet mask 28 in FIG. 7 indicates that 27 bits are masked from the beginning. Therefore, in the IP address 27 of FIG. 7, the 27-bit value from the beginning is the value of the network address portion, and the last 5-bit value “00001” is the value of the host address portion.

図4のS70では、生成部36は、サブネットマスク28がマスクしている部分に対応するIPアドレス27の部分を抽出することによって、ネットワークアドレス部の値を特定する。例えば、図6のIPアドレス27の場合には、生成部36は、「192.168.0」を特定する。また、生成部36は、サブネットマスク28がマスクしていない部分に対応するIPアドレス27の部分を抽出することによって、ホストアドレス部の値を特定する。例えば、図6のIPアドレス27の場合には、生成部36は、「1」を特定する。S70を終えると、S72に進む。   In S70 of FIG. 4, the generation unit 36 specifies the value of the network address part by extracting the part of the IP address 27 corresponding to the part masked by the subnet mask 28. For example, in the case of the IP address 27 in FIG. 6, the generation unit 36 specifies “192.168.8.0”. Further, the generation unit 36 specifies the value of the host address part by extracting the part of the IP address 27 corresponding to the part that is not masked by the subnet mask 28. For example, in the case of the IP address 27 in FIG. 6, the generation unit 36 specifies “1”. When S70 ends, the process proceeds to S72.

S72では、生成部36は、サブネットマスク28の値が規定値より大きいのか否かを判断する。本実施例では、上記の規定値は、16進数で「FF.FF.FF.C0」である。即ち、上記の規定値は、2進数では、先頭から26ビットが全て「1」であり、最後の6ビットが全て「0」である。例えば、図6のサブネットマスク28(先頭から24ビットが全て「1」=16進数で「FF.FF.FF.0」)は、上記の規定値(先頭から26ビットが全て「1」=16進数で「FF.FF.FF.C0」)より小さい。従って、図6のサブネットマスク28については、生成部36は、S72でNOと判断し、S74に進む。また、例えば、図7のサブネットマスク28(先頭から27ビットが全て「1」=16進数で「FF.FF.FF.E0」)は、上記の規定値(先頭から26ビットが全て「1」=16進数で「FF.FF.FF.C0」)より大きい。従って、図7のサブネットマスク28については、生成部36は、S72でYESと判断し、S80に進む。   In S72, the generation unit 36 determines whether or not the value of the subnet mask 28 is larger than a specified value. In this embodiment, the specified value is “FF.FF.FF.C0” in hexadecimal. That is, in the binary value, the 26 bits from the beginning are all “1” and the last 6 bits are all “0” in the binary number. For example, the subnet mask 28 in FIG. 6 (all the 24 bits from the beginning are “1” = hexadecimal number “FF.FF.FF.0”) is the above specified value (all the 26 bits from the beginning are “1” = 16). The decimal number is smaller than “FF.FF.FF.C0”). Therefore, for the subnet mask 28 of FIG. 6, the generation unit 36 determines NO in S72, and proceeds to S74. For example, the subnet mask 28 in FIG. 7 (all the 27 bits from the top are “1” = hexadecimal number “FF.FF.FF.E0”) is the above specified value (all the 26 bits from the top are “1”). = Hexadecimal number larger than “FF.FF.FF.C0”). Therefore, for the subnet mask 28 of FIG. 7, the generation unit 36 determines YES in S72, and proceeds to S80.

S74では、生成部36は、32ビットの乱数を生成する(S74)。図6には、S74で生成される乱数の一例が、10進数で表わされている(「220.192.21.5」)。次いで、生成部36は、仮ホストアドレス部の値を生成する(S76)。生成部36は、まず、サブネットマスク28の論理否定(NOT)を計算する。例えば、図6のサブネットマスク28は、先頭から24ビットが全て「1」であり、最後の8ビットが全て「0」である。従って、図6のサブネットマスク28の論理否定は、先頭から24ビットが全て「0」であり、最後の8ビットが全て「1」である。即ち、図6のサブネットマスク28の論理否定は、図6の「NOTサブネットマスク」に示されるように、10進数で「0.0.0.255」である。次いで、生成部36は、生成済みの乱数とサブネットマスク28の論理否定との論理積(AND)を計算する。例えば、図6では、生成済みの乱数が「220.192.21.5」であり、サブネットマスク28の論理否定が「0.0.0.255」である。サブネットマスク28の論理否定の先頭から24ビットが全て「0」であるために、生成済みの乱数の先頭から24ビットの値に関わらず、上記の論理積では、先頭から24ビットが全て「0」になる。また、サブネットマスク28の論理否定の最後の8ビットが全て「1」であるために、上記の論理積の最後の8ビットは、生成済みの乱数の最後の8ビット「00000101(=10進数で「5」)」に一致する。従って、上記の論理積は、10進数で「0.0.0.5」である。即ち、図6に示されるように、仮ホストアドレス部の値は、10進数で「0.0.0.5」である。なお、実際には、最後の8ビットがホストアドレス部であるために、仮ホストアドレス部の値は、10進数で「5」である。S76を終えると、S78に進む。   In S74, the generation unit 36 generates a 32-bit random number (S74). In FIG. 6, an example of the random number generated in S74 is represented by a decimal number (“220.192.21.5”). Next, the generation unit 36 generates a value of the temporary host address part (S76). The generation unit 36 first calculates a logical negation (NOT) of the subnet mask 28. For example, in the subnet mask 28 of FIG. 6, the first 24 bits are all “1” and the last 8 bits are all “0”. Accordingly, the logical negation of the subnet mask 28 in FIG. 6 is that all 24 bits from the beginning are “0” and the last 8 bits are all “1”. That is, the logical negation of the subnet mask 28 in FIG. 6 is “0.0.0.255” in decimal as shown in “NOT subnet mask” in FIG. Next, the generation unit 36 calculates a logical product (AND) of the generated random number and the logical negation of the subnet mask 28. For example, in FIG. 6, the generated random number is “220.192.21.5”, and the logical negation of the subnet mask 28 is “0.0.0.255”. Since all 24 bits from the beginning of the logical negation of the subnet mask 28 are “0”, in the above logical product, all 24 bits from the beginning are all “0” regardless of the value of the 24 bits from the beginning of the generated random number. "become. Further, since the last 8 bits of the logical negation of the subnet mask 28 are all “1”, the last 8 bits of the logical product are the last 8 bits “00000101” (= decimal number) of the generated random number. “5”) ”. Therefore, the logical product is “0.0.0.5” in decimal. That is, as shown in FIG. 6, the value of the temporary host address portion is “0.0.0.5” in decimal. Actually, since the last 8 bits are the host address part, the value of the temporary host address part is “5” in decimal. When S76 ends, the process proceeds to S78.

S78では、生成部36は、まず、S76で生成された仮ホストアドレス部の全てのビットが「0」であるのか否かを判断する第1の判断処理を実行する。図6の仮ホストアドレス部の値は、2進数で「00000101」であるために、全てのビットが「0」ではない。この場合、生成部36は、第1の判断処理でNOと判断する。さらに、生成部36は、S76で生成された仮ホストアドレス部の全てのビットが「1」であるのか否かを判断する第2の判断処理を実行する。図6の仮ホストアドレス部の値は、2進数で「00000101」であるために、全てのビットが「1」ではない。この場合、生成部36は、第2の判断処理でNOと判断する。さらに、生成部36は、S76で生成された仮ホストアドレス部の値が、S70で特定されたホストアドレス部の値(即ち端末装置10のIPアドレス27のホストアドレス部の値)に一致するのか否かを判断する第3の判断処理を実行する。図6のIPアドレス27のホストアドレス部の値は、2進数で「00000001(=10進数で「1」)」であり、図6の仮ホストアドレス部の値は、2進数で「00000101(=10進数で「5」)」である。この場合、生成部36は、第3の判断処理でNOと判断する。上記の第1〜第3の判断処理のいずれでもNOと判断される場合には、生成部36は、S78でNOと判断する。この場合、図5のS100に進む。一方において、上記の第1〜第3の判断処理のいずれかでYESと判断される場合には、生成部36は、S78でYESと判断する。この場合、生成部36は、S74及びS76の処理によって、仮ホストアドレス部の値を再び生成する。   In S78, the generation unit 36 first executes a first determination process for determining whether or not all bits of the temporary host address part generated in S76 are “0”. Since the value of the temporary host address part in FIG. 6 is “00000101” in binary, not all bits are “0”. In this case, the generation unit 36 determines NO in the first determination process. Further, the generation unit 36 executes a second determination process for determining whether or not all the bits of the temporary host address part generated in S76 are “1”. Since the value of the temporary host address portion in FIG. 6 is “00000101” in binary, not all bits are “1”. In this case, the generation unit 36 determines NO in the second determination process. Further, the generation unit 36 determines whether the value of the temporary host address part generated in S76 matches the value of the host address part specified in S70 (that is, the value of the host address part of the IP address 27 of the terminal device 10). A third determination process is performed to determine whether or not. The value of the host address part of the IP address 27 in FIG. 6 is “00000001 (=“ 1 ”in decimal number)” in binary, and the value of the temporary host address part in FIG. 6 is “00000101 (= It is “5”) ”in decimal. In this case, the generation unit 36 determines NO in the third determination process. If any of the first to third determination processes is determined as NO, the generation unit 36 determines NO in S78. In this case, the process proceeds to S100 in FIG. On the other hand, if YES is determined in any of the first to third determination processes, the generation unit 36 determines YES in S78. In this case, the generation unit 36 generates the value of the temporary host address part again by the processes of S74 and S76.

上述したように、図7のサブネットマスク28の場合には、S72でYESと判断され、S80に進む。S80では、生成部36は、S70で特定されたホストアドレス部の値(即ち端末装置10のIPアドレス27のホストアドレス部の値)が、所定値よりも大きいのか否かを判断する。上記の所定値は、以下のようにして決定される。生成部36は、まず、S70で特定されたホストアドレス部のビット数(以下では「ビット数」と簡単に呼ぶ)を特定する。図7の例では、IPアドレス27のホストアドレス部は、IPアドレス27の最後の5ビット「00001」である。従って、生成部36は、ビット数として「5」を特定する。次いで、生成部36は、特定されたビット数で表現し得る数値範囲を特定する。例えば、5ビットで表現し得る数値範囲は、「00000」〜「11111」である。即ち、5ビットで表現し得る数値範囲は、10進数で「0」〜「31」である。次いで、生成部36は、特定された数値範囲の中間値を特定する。例えば、「0」〜「31」の中間値は、「16」である。生成部36は、この中間値「16」を特定することによって、上記の所定値を決定する。上述したように、図7のIPアドレス27のホストアドレス部の値「00001」は、10進数で「1」であり、上記の中間値「16」より小さい。この場合、生成部36は、S80でNOと判断し、S86に進む。一方において、例えば、S80でYESの場合には、S82に進む。   As described above, in the case of the subnet mask 28 of FIG. 7, “YES” is determined in S72, and the process proceeds to S80. In S80, the generation unit 36 determines whether or not the value of the host address part specified in S70 (that is, the value of the host address part of the IP address 27 of the terminal device 10) is greater than a predetermined value. The predetermined value is determined as follows. The generation unit 36 first specifies the number of bits of the host address part specified in S70 (hereinafter simply referred to as “the number of bits”). In the example of FIG. 7, the host address part of the IP address 27 is the last 5 bits “00001” of the IP address 27. Therefore, the generation unit 36 specifies “5” as the number of bits. Next, the generation unit 36 specifies a numerical range that can be expressed by the specified number of bits. For example, a numerical value range that can be expressed by 5 bits is “00000” to “11111”. That is, the numerical range that can be expressed by 5 bits is “0” to “31” in decimal. Next, the generation unit 36 specifies an intermediate value in the specified numerical range. For example, the intermediate value of “0” to “31” is “16”. The generation unit 36 determines the predetermined value by specifying the intermediate value “16”. As described above, the value “00001” of the host address part of the IP address 27 in FIG. 7 is “1” in decimal notation, and is smaller than the intermediate value “16”. In this case, the generation unit 36 determines NO in S80, and proceeds to S86. On the other hand, for example, if YES in S80, the process proceeds to S82.

図4の処理が開始されてから1回目のS82では、生成部36は、まず、仮ホストアドレス部の初期値を決定する。ここでは、生成部36は、S80で特定されたビット数の全てのビットを「0」に設定することによって、仮ホストアドレス部の初期値を決定する。例えば、S80で特定されたビット数が「5」である場合には、生成部36は、仮ホストアドレス部の初期値として「00000」を決定する。次いで、生成部36は、決定された初期値(例えば「00000」)に「1」を加算することによって、仮ホストアドレス部の値(例えば「00001」)を決定する。なお、2回目以降のS82では、生成部36は、前回のS82で決定された仮ホストアドレス部の値に「1」を加算することによって、新たな仮ホストアドレス部の値を決定する。例えば、ビット数が「5」である場合には、2回目のS82では、生成部36は、仮ホストアドレス部の値として「00010」を決定する。   In S82 for the first time after the processing of FIG. 4 is started, the generation unit 36 first determines the initial value of the temporary host address portion. Here, the generation unit 36 determines the initial value of the temporary host address part by setting all bits of the number of bits specified in S80 to “0”. For example, when the number of bits specified in S80 is “5”, the generation unit 36 determines “00000” as the initial value of the temporary host address portion. Next, the generation unit 36 determines the value (for example, “00001”) of the temporary host address part by adding “1” to the determined initial value (for example, “00000”). In the second and subsequent S82, the generation unit 36 determines a new value of the temporary host address part by adding “1” to the value of the temporary host address part determined in the previous S82. For example, when the number of bits is “5”, in the second S82, the generation unit 36 determines “00010” as the value of the temporary host address portion.

次いで、生成部36は、S82で決定された仮ホストアドレス部の値を用いて、S78で説明した第2の判断処理を実行する(S84)。ここでNOの場合、S85に進む。ここでYESの場合、IPアドレス決定処理が終了する(エラーEND)。S85では、生成部36は、S78で説明した第3の判断処理を実行する(S85)。ここでNOの場合、図5のS100に進み、ここでYESの場合、生成部36は、S72以降の処理を再び実行し、新たな仮ホストアドレス部の値を生成する。   Next, the generation unit 36 executes the second determination process described in S78 using the value of the temporary host address part determined in S82 (S84). If NO here, the process proceeds to S85. If YES here, the IP address determination process ends (error END). In S85, the generation unit 36 executes the third determination process described in S78 (S85). If “NO” here, the process proceeds to S100 in FIG. 5. If “YES” here, the generation unit 36 executes the processing subsequent to S72 again to generate a new value of the temporary host address part.

図4の処理が開始されてから1回目のS86では、生成部36は、まず、仮ホストアドレス部の初期値を決定する。ここで決定される初期値は、S82で決定される初期値と異なる。即ち、生成部36は、S80で特定されたビット数の全てのビットを「1」に設定することによって、仮ホストアドレス部の初期値を決定する。例えば、S80で特定されたビット数が「5」である場合には、生成部36は、仮ホストアドレス部の初期値として「11111」を決定する。次いで、生成部36は、決定された初期値(例えば「11111」)から「1」を減算することによって、仮ホストアドレス部の値(例えば「11110」)を決定する。図7には、ここで決定される仮ホストアドレス部の値「11110」が例示されている。なお、2回目以降のS86では、生成部36は、前回のS86で決定された仮ホストアドレス部の値から「1」を減算することによって、新たな仮ホストアドレス部の値を決定する。例えば、2回目のS86では、生成部36は、仮ホストアドレス部の値として「11101」を決定する。   In S86 for the first time after the processing of FIG. 4 is started, the generation unit 36 first determines the initial value of the temporary host address portion. The initial value determined here is different from the initial value determined in S82. That is, the generation unit 36 sets the initial value of the temporary host address part by setting all the bits of the number of bits specified in S80 to “1”. For example, when the number of bits specified in S80 is “5”, the generation unit 36 determines “11111” as the initial value of the temporary host address portion. Next, the generation unit 36 determines the value (for example, “11110”) of the temporary host address part by subtracting “1” from the determined initial value (for example, “11111”). FIG. 7 illustrates the value “11110” of the temporary host address portion determined here. In the second and subsequent S86, the generation unit 36 determines a new value of the temporary host address part by subtracting “1” from the value of the temporary host address part determined in the previous S86. For example, in the second S86, the generation unit 36 determines “11101” as the value of the temporary host address portion.

次いで、生成部36は、S86で決定された仮ホストアドレス部の値を用いて、S78で説明した第1の判断処理を実行する(S88)。ここでNOの場合、S85に進み、ここでYESの場合、IPアドレス決定処理が終了する(エラーEND)。なお、エラーENDの場合には、制御部30は、図2及び図3の続きの処理を実行してもよいし、実行しなくてもよい。後者の場合、例えば、制御部30は、図2のS34又は図3のS48をスキップし、S50において適当なIPアドレス(例えば図2のS16で読み込まれたプリンタ60のIPアドレス)を用いて、プリンタポートを生成してもよい。これに代えて、例えば、制御部30は、図2のS16で読み込まれたプリンタ60のノード名を用いて、プリンタポートを生成してもよい。   Next, the generation unit 36 executes the first determination process described in S78 using the value of the temporary host address part determined in S86 (S88). If “NO” here, the process proceeds to S85, and if “YES” here, the IP address determination process ends (error END). In the case of an error END, the control unit 30 may or may not execute the processing subsequent to FIGS. 2 and 3. In the latter case, for example, the control unit 30 skips S34 in FIG. 2 or S48 in FIG. 3, and uses an appropriate IP address in S50 (for example, the IP address of the printer 60 read in S16 in FIG. 2), A printer port may be generated. Instead of this, for example, the control unit 30 may generate a printer port using the node name of the printer 60 read in S16 of FIG.

上述したように、S78又はS85でNOの場合は、端末装置10のIPアドレス27のホストアドレス部の値と異なる仮ホストアドレス部の値が決定されたことを意味する。S78又はS85でNOの場合には、図5のS100に進む。S100では、生成部36は、仮の候補IPアドレスを決定する。具体的には、生成部36は、図4のS70で特定されたネットワークアドレス部の値(即ち端末装置10のIPアドレス27のネットワークアドレス部の値)と、図4の処理(S76、S82、又は、S86)で決定された仮ホストアドレス部の値と、を組み合わせることによって、仮の候補IPアドレスを決定する。さらに具体的には、生成部36は、ネットワークアドレス部の値と仮ホストアドレス部の値との論理和(OR)を計算することによって、仮の候補IPアドレスを決定する。例えば、図6では、ネットワークアドレス部の値が、10進数で「192.168.0」(先頭から24ビット)であり、仮ホストアドレス部の値が、10進数で「5」(最後の8ビット)である。上記のネットワークアドレス部の値の後に、全て「0」である8ビットの値を追加するすると、32ビットのネットワークアドレス部を表現することができ、この場合、ネットワークアドレス部の値は、10進数で「192.168.0.0」になる。また、上記の仮ホストアドレス部の値の前に、全て「0」である24ビットの値を追加するすると、32ビットの仮ホストアドレス部を表現することができ、この場合、仮ホストアドレス部の値は、10進数で「0.0.0.5」になる。32ビットの仮ホストアドレス部の先頭から24ビットが全て「0」であるために、上記の論理和の先頭から24ビットの値は、32ビットのネットワークアドレス部の先頭から24ビットの値(即ち10進数で「192.168.0」)に一致する。また、32ビットのネットワークアドレス部の最後の8ビットが全て「0」であるために、上記の論理和の最後の8ビットの値は、32ビットの仮ホストアドレス部の最後の8ビットの値(即ち10進数で「5」)に一致する。この結果、10進数で「192.168.0.5」が、仮の候補IPアドレスとして決定される。また、図7の例では、IPアドレス27の先頭から27ビットの値が、ネットワークアドレス部の値であり、仮ホストアドレス部の値が、2進数で「11110」(最後の5ビット)である。従って、上記の論理和では、先頭から27ビットの値が、IPアドレス27の先頭から27ビットの値に一致し、最後の5ビットの値が、2進数で「11110」に一致する。この例では、上記の論理和の最後の8ビットは、「00011110」になるために、10進数で「30」になる。この結果、10進数で「192.168.0.30」が、仮の候補IPアドレスとして決定される。   As described above, if NO in S78 or S85, it means that a value of the temporary host address part different from the value of the host address part of the IP address 27 of the terminal device 10 has been determined. If NO in S78 or S85, the process proceeds to S100 in FIG. In S100, the generation unit 36 determines a temporary candidate IP address. Specifically, the generation unit 36 determines the value of the network address part identified in S70 of FIG. 4 (that is, the value of the network address part of the IP address 27 of the terminal device 10) and the process of FIG. Alternatively, a temporary candidate IP address is determined by combining the value of the temporary host address part determined in S86). More specifically, the generation unit 36 determines a temporary candidate IP address by calculating a logical sum (OR) of the value of the network address portion and the value of the temporary host address portion. For example, in FIG. 6, the value of the network address part is “192.168.8.0” (24 bits from the beginning) in decimal number, and the value of the temporary host address part is “5” (last 8) in decimal number. Bit). If an 8-bit value that is all “0” is added after the value of the network address part, a 32-bit network address part can be expressed. In this case, the value of the network address part is a decimal number. Becomes “192.168.0.0”. Further, by adding a 24-bit value that is all “0” before the value of the temporary host address part, a 32-bit temporary host address part can be expressed. In this case, the temporary host address part The value of is a decimal number “0.0.0.5”. Since all the 24 bits from the beginning of the 32-bit temporary host address part are “0”, the 24-bit value from the beginning of the logical sum is a 24-bit value from the beginning of the 32-bit network address part (ie The decimal number matches "192.168.8.0"). Also, since the last 8 bits of the 32-bit network address part are all “0”, the last 8-bit value of the above logical sum is the last 8-bit value of the 32-bit temporary host address part. (Ie, “5” in decimal). As a result, “192.168.0.5” in decimal is determined as the temporary candidate IP address. In the example of FIG. 7, the 27-bit value from the beginning of the IP address 27 is the value of the network address part, and the value of the temporary host address part is “11110” (last 5 bits) in binary number. . Therefore, in the above logical sum, the 27-bit value from the beginning matches the 27-bit value from the beginning of the IP address 27, and the last 5-bit value matches “11110” in binary. In this example, since the last 8 bits of the above logical sum are “00011110”, the decimal number is “30”. As a result, “192.168.0.30” in decimal is determined as a temporary candidate IP address.

次いで、特定部32(図1参照)は、記録媒体20に含まれるテーブル23から、全ての種類情報に対応するIPアドレスの範囲を読み込む(S102)。続いて、生成部36は、S100で決定された仮の候補IPアドレスが、S102で読み込まれたいずれかの範囲に含まれるのか否かを判断する(S104)。仮の候補IPアドレスが1個の範囲にでも含まれる場合には、生成部36は、S104でYESと判断する。この場合、生成部36は、図4のS72以降の処理を再び実行し、新たな仮ホストアドレス部の値を生成する。仮の候補IPアドレスがいずれの範囲にも含まれない場合には、生成部36は、S104でNOと判断する。これにより、生成部36は、仮の候補IPアドレスを候補IPアドレスとして決定する。   Next, the specifying unit 32 (see FIG. 1) reads the IP address ranges corresponding to all types of information from the table 23 included in the recording medium 20 (S102). Subsequently, the generation unit 36 determines whether or not the temporary candidate IP address determined in S100 is included in any of the ranges read in S102 (S104). If the temporary candidate IP address is included in one range, the generation unit 36 determines YES in S104. In this case, the generation unit 36 executes again the processing from S72 onward in FIG. 4 to generate a new temporary host address part value. If the temporary candidate IP address is not included in any range, the generation unit 36 determines NO in S104. Thereby, the generation unit 36 determines the temporary candidate IP address as the candidate IP address.

S104でNOの場合、確認部38(図1参照)は、S104で決定された候補IPアドレスを送信先として、所定の信号を送信する(S106)。次いで、確認部38は、上記の所定の信号に対する応答信号を受信することを監視する(S108)。例えば、LAN4に接続されているデバイス(例えばプリンタ60以外のプリンタ)に上記の候補IPアドレスが現在設定されている場合には、当該デバイスは、上記の所定の信号を受信し、上記の所定の信号に対する応答信号を送信する。この場合、確認部38は、応答信号を受信するために、S108でYESと判断する。S108でYESの場合、生成部36は、図4のS72以降の処理を再び実行し、新たな仮ホストアドレス部の値を生成する。一方において、例えば、LAN4に接続されているいずれのデバイスにも上記の候補IPアドレスが現在設定されていない場合には、確認部38は、上記の所定の信号に対する応答信号を受信しない。確認部38は、上記の所定の信号を送信してから所定時間が経過しても応答信号を受信しない場合には、S108でNOと判断する。この場合、決定部34は、上記の候補IPアドレスを対象IPアドレスとして決定し、対象IPアドレス決定処理を終了する(正常END)。   In the case of NO in S104, the confirmation unit 38 (see FIG. 1) transmits a predetermined signal with the candidate IP address determined in S104 as the transmission destination (S106). Next, the confirmation unit 38 monitors reception of a response signal for the predetermined signal (S108). For example, when the candidate IP address is currently set in a device connected to the LAN 4 (for example, a printer other than the printer 60), the device receives the predetermined signal and receives the predetermined signal. A response signal to the signal is transmitted. In this case, the confirmation unit 38 determines YES in S108 in order to receive the response signal. In the case where S108 is YES, the generation unit 36 executes again the processing from S72 onward in FIG. 4 to generate a new temporary host address part value. On the other hand, for example, when the candidate IP address is not currently set in any device connected to the LAN 4, the confirmation unit 38 does not receive a response signal to the predetermined signal. When the confirmation unit 38 does not receive a response signal even after a predetermined time has elapsed since the transmission of the predetermined signal, the confirmation unit 38 determines NO in S108. In this case, the determination unit 34 determines the candidate IP address as a target IP address, and ends the target IP address determination process (normal END).

図2〜図5の処理について詳しく説明した。次いで、図3のS44又はS50で生成されるプリンタポートと、S52でインストールされるプリンタドライバと、を用いて、印刷が実行される様子を簡単に説明しておく。ユーザは、プリンタ60に印刷を実行させることを望む場合に、端末装置10の操作部12を操作することによって、印刷されるべき対象データを選択する。この場合、制御部30は、記憶部24に格納されているプリンタドライバを起動する。プリンタドライバは、対象データを、プリンタ60が解釈可能なPDL(Page Description Language)データに変換する。上述したように、S50で生成されるプリンタポートでは、プリンタ60のIPアドレスが指定されている。S50で生成されるプリンタポートが記憶部24に格納されている場合には、制御部30は、プリンタポートにおいて指定されているIPアドレスを送信先として、PDLデータを送信する。この結果、プリンタ60は、PDLデータに従って、印刷を実行する。また、S44で生成されるプリンタポートでは、プリンタ60のノード名が指定されている。S44で生成されるプリンタポートが記憶部24に格納されている場合には、制御部30は、プリンタポートにおいて指定されているノード名を用いて名前解決(図3のS40の処理)を実行することによって、プリンタ60のIPアドレスを取得する。制御部30は、取得されたIPアドレスを送信先として、PDLデータを送信する。この結果、プリンタ60は、PDLデータに従って、印刷を実行する。   The processing in FIGS. 2 to 5 has been described in detail. Next, how printing is executed will be briefly described using the printer port generated in S44 or S50 of FIG. 3 and the printer driver installed in S52. When the user desires the printer 60 to execute printing, the user selects target data to be printed by operating the operation unit 12 of the terminal device 10. In this case, the control unit 30 activates the printer driver stored in the storage unit 24. The printer driver converts the target data into PDL (Page Description Language) data that can be interpreted by the printer 60. As described above, the IP address of the printer 60 is specified in the printer port generated in S50. When the printer port generated in S50 is stored in the storage unit 24, the control unit 30 transmits the PDL data with the IP address specified in the printer port as the transmission destination. As a result, the printer 60 executes printing according to the PDL data. Further, the node name of the printer 60 is specified in the printer port generated in S44. When the printer port generated in S44 is stored in the storage unit 24, the control unit 30 executes name resolution (the process of S40 in FIG. 3) using the node name specified in the printer port. As a result, the IP address of the printer 60 is acquired. The control unit 30 transmits PDL data using the acquired IP address as a transmission destination. As a result, the printer 60 executes printing according to the PDL data.

本実施例のネットワークシステム2の構成について詳しく説明した。端末装置10は、DHCPサーバ等のIPアドレス割り当てサーバと区別されるデバイスである。即ち、IPアドレス割り当てサーバは、他のデバイスからの要求を受けて、当該他のデバイスのためのIPアドレスを決定する(割り当てる)が、端末装置10は、他のデバイス(例えばプリンタ60)からの要求を受けずに、当該他のデバイスのための対象IPアドレスを決定する。   The configuration of the network system 2 of the present embodiment has been described in detail. The terminal device 10 is a device that is distinguished from an IP address assignment server such as a DHCP server. That is, the IP address assignment server receives a request from another device and determines (assigns) an IP address for the other device, but the terminal device 10 receives a request from another device (for example, the printer 60). The target IP address for the other device is determined without receiving the request.

端末装置10は、自身と別体に構成されているプリンタ60のための対象IPアドレスを決定することができる。具体的には、端末装置10は、自身と別体に構成されている外部のIPアドレス割り当てサーバが割り当て可能なIPアドレスの範囲を特定する(図5のS102)。しかも、端末装置10は、複数種類の外部のIPアドレス割り当てサーバのそれぞれが割り当て可能なIPアドレスの範囲を特定する。端末装置10は、上記のIPアドレスの範囲を用いて、対象IPアドレスを決定する。即ち、端末装置10は、上記のIPアドレスの範囲に含まれないIPアドレスを、候補IPアドレスとして決定する(図4のS104でNO)。この結果、外部のIPアドレス割り当てサーバ(例えばDHCPサーバ62、BOOTPサーバ64等)によってLAN4内の他のデバイスに割り当てられている可能性があるIPアドレスが、候補IPアドレスとして決定されない。このために、図5のS106及びS108の確認処理において、候補IPアドレスが他のデバイスに設定されているという確認結果(即ちS108でYES)が得られる可能性が低い。即ち、仮の候補IPアドレスを決定するための処理(図4の処理及び図5のS100の処理)を再び実行しなければならない可能性が低い。この結果、端末装置10は、プリンタ60のための対象IPアドレスを迅速に決定することができる。   The terminal device 10 can determine a target IP address for the printer 60 configured separately from itself. Specifically, the terminal device 10 specifies a range of IP addresses that can be assigned by an external IP address assignment server configured separately from itself (S102 in FIG. 5). Moreover, the terminal device 10 specifies a range of IP addresses that can be assigned by each of a plurality of types of external IP address assignment servers. The terminal device 10 determines the target IP address using the above IP address range. That is, the terminal apparatus 10 determines an IP address that is not included in the above IP address range as a candidate IP address (NO in S104 in FIG. 4). As a result, an IP address that may be assigned to another device in the LAN 4 by an external IP address assignment server (for example, the DHCP server 62, the BOOTP server 64, etc.) is not determined as a candidate IP address. Therefore, in the confirmation processing in S106 and S108 in FIG. 5, there is a low possibility that a confirmation result that the candidate IP address is set to another device (that is, YES in S108) will be obtained. That is, it is unlikely that the process for determining the temporary candidate IP address (the process of FIG. 4 and the process of S100 of FIG. 5) has to be executed again. As a result, the terminal device 10 can quickly determine the target IP address for the printer 60.

さらに、端末装置10は、自己のIPアドレス27と、自己のサブネットマスク28と、に基づいて、対象IPアドレスを決定する。具体的には、端末装置10は、まず、図4のS70において、IPアドレス27及びサブネットマスク28に基づいて、自己のネットワークアドレス部の値及び自己のホストアドレス部の値を特定する。さらに、端末装置10は、図4のS78及びS85を実行することにより、自己のホストアドレス部の値と異なる仮ホストアドレス部の値を決定することができる。この結果、端末装置10のIPアドレスに一致する仮の候補IPアドレスが生成されない。即ち、仮の候補IPアドレスから決定される対象IPアドレスも、端末装置10のIPアドレス27に一致しない。また、端末装置10は、自己のネットワークアドレス部の値と、仮ホストアドレス部の値と、を組み合わせることによって、仮の候補IPアドレスを決定する(図5のS100)。この結果、自己のネットワークアドレス部の値と異なるネットワークアドレス部の値を含むIPアドレス(以下では「特定のIPアドレス」と呼ぶ)が、仮の候補IPアドレスとして決定されない。即ち、上記の特定のIPアドレスが、対象IPアドレスとして決定されない。上述したように、本実施例では、端末装置10のIPアドレス27に一致するIPアドレス、又は、上記の特定のIPアドレスが、対象IPアドレスとして決定されない。端末装置10は、LAN4内で適切に通信を実行し得るIPアドレス(即ち端末装置10と適切に通信を実行し得るIPアドレス)を、対象IPアドレスとして決定することができる。   Further, the terminal device 10 determines a target IP address based on its own IP address 27 and its own subnet mask 28. Specifically, the terminal device 10 first specifies the value of its own network address part and the value of its own host address part based on the IP address 27 and the subnet mask 28 in S70 of FIG. Furthermore, the terminal device 10 can determine the value of the temporary host address part different from the value of its own host address part by executing S78 and S85 of FIG. As a result, a temporary candidate IP address that matches the IP address of the terminal device 10 is not generated. That is, the target IP address determined from the temporary candidate IP address does not match the IP address 27 of the terminal device 10. Further, the terminal device 10 determines a temporary candidate IP address by combining the value of its own network address part and the value of the temporary host address part (S100 in FIG. 5). As a result, an IP address (hereinafter referred to as a “specific IP address”) that includes a value of the network address portion that is different from the value of its own network address portion is not determined as a temporary candidate IP address. That is, the specific IP address is not determined as the target IP address. As described above, in this embodiment, the IP address that matches the IP address 27 of the terminal device 10 or the specific IP address is not determined as the target IP address. The terminal device 10 can determine, as the target IP address, an IP address that can appropriately perform communication within the LAN 4 (that is, an IP address that can appropriately perform communication with the terminal device 10).

また、図4のS72でNOの場合は、仮ホストアドレス部の値として採り得る値の範囲が大きい(即ち選択肢が多い)ことを意味し、S72でYESの場合は、仮ホストアドレス部の値として採り得る値の範囲が小さい(即ち選択肢が少ない)ことを意味する。端末装置10は、選択肢が多い場合には、乱数を用いて、仮ホストアドレス部の値をランダムに決定する(図4のS74〜S78)。選択肢が多いということは、それらの選択肢の中に、図1のテーブル23に登録されているIPアドレスの範囲に含まれない多くの値が存在し得る。従って、端末装置10は、仮ホストアドレス部の値をランダムに決定することによって、上記のIPアドレスの範囲に含まれない仮の候補IPアドレスを高い確率で生成することができる。一方において、端末装置10は、選択肢が少ない場合には、乱数を用いずに、仮ホストアドレス部の値を決定する(図4のS80〜S88)。   Further, if NO in S72 of FIG. 4, it means that the range of values that can be taken as the value of the temporary host address part is large (that is, there are many options), and if YES in S72, the value of the temporary host address part This means that the range of values that can be taken is small (that is, there are few options). When there are many choices, the terminal device 10 randomly determines the value of the temporary host address portion using a random number (S74 to S78 in FIG. 4). The fact that there are many choices may include many values that are not included in the range of IP addresses registered in the table 23 of FIG. Therefore, the terminal device 10 can generate a temporary candidate IP address that is not included in the above IP address range with a high probability by randomly determining the value of the temporary host address portion. On the other hand, when there are few choices, the terminal device 10 determines the value of the temporary host address part without using a random number (S80 to S88 in FIG. 4).

即ち、端末装置10は、DHCPサーバ62によって割り当てられる自己のIPアドレス27のホストアドレス部の値が、上記の所定値(即ち図7の中間値)より大きい場合(図4のS80でYESの場合)には、上記の所定値よりも小さい値を、仮ホストアドレス部の値として決定する。より具体的には、仮ホストアドレス部の値として採り得る値の範囲の最小値(例えば「00001」)から順に選択される値を、仮ホストアドレス部の値として決定する。一方において、端末装置10は、S80でNOの場合には、上記の所定値よりも大きい値を、仮ホストアドレス部の値として決定する。より具体的には、仮ホストアドレス部の値として採り得る値の範囲の最大値(例えば「11110」)から順に選択される値を、仮ホストアドレス部の値として決定する。IPアドレス27のホストアドレス部の値が上記の所定値より大きい(又は小さい)場合には、DHCPサーバ62は、自己が割り当て可能なIPアドレスの範囲のうち、大きい値(又は小さい値)から順に割り当てるタイプのサーバである可能性が高い。従って、仮に、DHCPサーバ62によってLAN4内の他のデバイスにIPアドレスが割り当てられている場合には、そのIPアドレスのホストアドレス部の値が上記の所定値より大きい(又は小さい)可能性が高い。本実施例では、S80の判断結果に応じて、上記の所定値よりも小さい値又は大きい値が、仮ホストアドレス部の値として決定されるために、DHCPサーバ62によって他のデバイスに割り当てられている可能性が低い値が、仮ホストアドレス部の値として決定される。このために、図5のS108でYESと判断される可能性が低く、この結果、仮の候補IPアドレスを決定するための処理を再び実行しなければならない可能性が低い。   That is, the terminal device 10 determines that the value of the host address part of its own IP address 27 assigned by the DHCP server 62 is larger than the above predetermined value (that is, the intermediate value of FIG. 7) (YES in S80 of FIG. 4). ), A value smaller than the predetermined value is determined as the value of the temporary host address portion. More specifically, a value sequentially selected from the minimum value (for example, “00001”) of the range of values that can be taken as the value of the temporary host address portion is determined as the value of the temporary host address portion. On the other hand, if NO in S80, the terminal device 10 determines a value larger than the predetermined value as the value of the temporary host address portion. More specifically, a value sequentially selected from the maximum value range (for example, “11110”) that can be taken as the value of the temporary host address portion is determined as the value of the temporary host address portion. When the value of the host address part of the IP address 27 is larger (or smaller) than the above predetermined value, the DHCP server 62 starts from the larger value (or smaller value) in the range of IP addresses that can be allocated by itself. It is likely that the type of server to be assigned. Therefore, if an IP address is assigned to another device in the LAN 4 by the DHCP server 62, the value of the host address portion of the IP address is likely to be larger (or smaller) than the predetermined value. . In the present embodiment, a value smaller than or greater than the predetermined value is determined as the value of the temporary host address portion in accordance with the determination result in S80, so that it is assigned to another device by the DHCP server 62. A value that is unlikely to be present is determined as the value of the temporary host address portion. For this reason, there is a low possibility of being determined as YES in S108 of FIG. 5, and as a result, there is a low possibility that the process for determining the temporary candidate IP address must be executed again.

なお、上記の最小値は「00001」に設定されるが、最小値が「00000」に設定されてもよい。即ち、図4の1回目のS82では、「00000」が仮ホストアドレス部の値として決定されてもよい。また、上記の最大値が「11111」でないのは、ブロードキャスト通信では、送信先のIPアドレスのホストアドレス部の全てのビットが「1」に設定されることから、全てのビットが「1」である値は、通常、デバイスのホストアドレス部の値として利用されないからである。   The minimum value is set to “00001”, but the minimum value may be set to “00000”. That is, in the first S82 in FIG. 4, “00000” may be determined as the value of the temporary host address portion. The maximum value is not “11111” because in broadcast communication, all bits in the host address part of the destination IP address are set to “1”, so all bits are “1”. This is because a certain value is not normally used as the value of the host address part of the device.

また、端末装置10は、図3のS46で対象IPアドレスが決定された場合に、当該対象IPアドレスをプリンタ60に供給(設定)する(S48)。この構成によると、対象IPアドレスをプリンタ60に入力する作業をユーザが実行せずに済む。ユーザの作業負担を軽減することができる。なお、図3のS46で対象IPアドレスが決定された場合に、端末装置10は、図3のS48に代えて、図2のS34と同様の手法を用いて、当該対象IPアドレスをユーザに提示してもよい。   Further, when the target IP address is determined in S46 of FIG. 3, the terminal device 10 supplies (sets) the target IP address to the printer 60 (S48). According to this configuration, the user does not have to perform an operation of inputting the target IP address to the printer 60. The work burden on the user can be reduced. When the target IP address is determined in S46 of FIG. 3, the terminal device 10 presents the target IP address to the user by using the same method as S34 of FIG. 2 instead of S48 of FIG. May be.

また、本実施例では、プリンタ60の設定手法情報が「Static」を示す場合に、端末装置10は、プリンタ60に現在設定されているIPアドレスを用いて、プリンタポートを生成する(図3のS50)。「Static」の場合には、プリンタ60のIPアドレスは、通常、変更されない。ユーザ自身によって入力されたIPアドレスがプリンタ60に設定されるからである。このために、IPアドレスを用いてポートが生成されても、プリンタ60のIPアドレスが変更されることに起因して、新たなプリンタポートが生成されるのを抑制することができる。一方において、「Static」以外の設定手法は、「DHCP」と「BOOTP」とを含む。これらの設定手法では、プリンタ60のIPアドレスが変更される可能性が高い。例えば、プリンタ60の電源がONされる毎に、プリンタ60に新たなIPアドレスが設定される。このために、仮に、IPアドレスを用いてプリンタポートが生成されると、IPアドレスの変更に伴って新たなプリンタポートを生成する必要がある。従って、本実施例では、プリンタ60のIPアドレスの設定手法が「Static」以外の設定手法である場合には、端末装置10は、プリンタ60に現在設定されているノード名を用いて、プリンタポートを生成する(図3のS44)。プリンタ60のノード名は、通常、変更されない。このために、ノード名を用いてプリンタポートを生成すれば、新たなプリンタポートが生成されるのを抑制することができる。ただし、ノード名を用いて名前解決を試行してもIPアドレスを取得不可能である場合(図3のS40でNOの場合)、又は、名前解決が適切に機能しない場合(S42でNOの場合)には、端末装置10は、プリンタ60に設定されるべき対象IPアドレスを決定し(S46)、当該対象IPアドレスを用いて、プリンタポートを生成する(S50)。名前解決によって適切なIPアドレスが得られないノード名を用いて、プリンタポートが生成されるのを抑制することができる。   Further, in this embodiment, when the setting method information of the printer 60 indicates “Static”, the terminal device 10 generates a printer port using the IP address currently set in the printer 60 (FIG. 3). S50). In the case of “Static”, the IP address of the printer 60 is normally not changed. This is because the IP address input by the user is set in the printer 60. For this reason, even if a port is generated using an IP address, it is possible to prevent a new printer port from being generated due to a change in the IP address of the printer 60. On the other hand, setting methods other than “Static” include “DHCP” and “BOOTP”. In these setting methods, there is a high possibility that the IP address of the printer 60 is changed. For example, a new IP address is set for the printer 60 every time the printer 60 is powered on. For this reason, if a printer port is generated using an IP address, it is necessary to generate a new printer port along with the change of the IP address. Therefore, in this embodiment, when the IP address setting method of the printer 60 is a setting method other than “Static”, the terminal device 10 uses the node name currently set in the printer 60 to print the printer port. Is generated (S44 in FIG. 3). The node name of the printer 60 is not normally changed. For this reason, if a printer port is generated using a node name, generation of a new printer port can be suppressed. However, if the IP address cannot be obtained even if name resolution is attempted using the node name (NO in S40 of FIG. 3), or if name resolution does not function properly (NO in S42) ) Determines the target IP address to be set in the printer 60 (S46), and generates a printer port using the target IP address (S50). It is possible to suppress the generation of a printer port using a node name for which an appropriate IP address cannot be obtained by name resolution.

上記の実施例の構成と本発明の構成との対応関係を記載しておく。プリンタ60が「対象デバイス」の一例であり、端末装置10が「IPアドレス決定装置」及び「端末装置」の一例である。IPアドレス27、サブネットマスク28が、それぞれ、「特定のIPアドレス」、「特定のサブネットマスク」の一例である。また、図6及び図7の仮ホストアドレス部の値が「特定の値」の一例であり、図4のS72で利用される「FF.FF.FF.C0」、図4のS80で利用される所定値(即ち図7の中間値)が、それぞれ、「第1の所定値」、「第2の所定値」の一例である。なお、本実施例では、サブネットマスク28の値が「FF.FF.FF.C0」(即ち「第1の所定値」)に等しい場合に、図4のS72でNOと判断されるが、S72でYESと判断されてもよい。また、図4のS70で特定されたホストアドレス部の値が上記の所定値(即ち「第2の所定値」)に等しい場合には、図4のS80でNOと判断されるが、S80でYESと判断されてもよい。   The correspondence between the configuration of the above embodiment and the configuration of the present invention will be described. The printer 60 is an example of “target device”, and the terminal device 10 is an example of “IP address determination device” and “terminal device”. The IP address 27 and the subnet mask 28 are examples of “specific IP address” and “specific subnet mask”, respectively. 6 and FIG. 7 is an example of “specific value”, “FF.FF.FF.C0” used in S72 of FIG. 4 and used in S80 of FIG. The predetermined values (ie, intermediate values in FIG. 7) are examples of “first predetermined value” and “second predetermined value”, respectively. In this embodiment, when the value of the subnet mask 28 is equal to “FF.FF.FF.C0” (that is, “first predetermined value”), it is determined NO in S72 of FIG. May be determined as YES. Further, when the value of the host address part specified in S70 of FIG. 4 is equal to the predetermined value (that is, “second predetermined value”), it is determined NO in S80 of FIG. It may be determined as YES.

また、図4のS82の仮ホストアドレス部の初期値+1と、図4のS86の仮ホストアドレス部の初期値−1と、の間の範囲(例えば「00001」〜「11110」)が、「仮の候補IPアドレスのホストアドレス部の値として採り得る値の範囲」の一例である。従って、図4のS82の仮ホストアドレス部の初期値+1(例えば「00001」)が「最小値」の一例であり、図4のS86の仮ホストアドレス部の初期値−1(例えば「11110」)が「最大値」の一例である。なお、上述したように、変形例では、全てのビットが「0」である値(例えば「00000」)を最小値として採用してもよい。この場合、図4のS82の仮ホストアドレス部の初期値と、図4のS86の仮ホストアドレス部の初期値−1と、の間の範囲(例えば「00000」〜「11110」)が、「仮の候補IPアドレスのホストアドレス部の値として採り得る値の範囲」の一例である。   Also, the range (for example, “00001” to “11110”) between the initial value +1 of the temporary host address part of S82 in FIG. 4 and the initial value −1 of the temporary host address part of S86 in FIG. This is an example of “a range of values that can be taken as the value of the host address part of the temporary candidate IP address”. Therefore, the initial value +1 (for example, “00001”) of the temporary host address portion in S82 in FIG. 4 is an example of the “minimum value”, and the initial value −1 (for example, “11110” in the temporary host address portion in S86 in FIG. ) Is an example of “maximum value”. As described above, in the modification, a value (for example, “00000”) in which all bits are “0” may be adopted as the minimum value. In this case, a range (for example, “00000” to “11110”) between the initial value of the temporary host address part in S82 in FIG. 4 and the initial value −1 in the temporary host address part in S86 in FIG. This is an example of “a range of values that can be taken as the value of the host address part of the temporary candidate IP address”.

また、図2のS36でNOと判断される設定手法、即ち、「DHCP」、「BOOTP」、「RARP」、及び、「AUTO」が、「特定の設定手法」の一例である。なお、本実施例では、図2のS36において、設定手法「Static」であるのか否かを判断するが、これに代えて、設定手法「Static」又は「RARP」であるのか否かを判断してもよい。本変形例では、図2のS16で読み込まれた設定手法情報が、設定手法「RARP」を示す場合にも、S36でYESと判断される。この場合、図3のS50において、図2のS16で読み込まれたプリンタ60のIPアドレスを用いて、プリンタポートが生成される。本変形例の場合には、「DHCP」、「BOOTP」、及び、「AUTO」が、「特定の設定手法」の一例である。   Further, the setting method determined as NO in S36 of FIG. 2, that is, “DHCP”, “BOOTP”, “RARP”, and “AUTO” are examples of the “specific setting method”. In this embodiment, in S36 of FIG. 2, it is determined whether or not the setting method is “Static”. Instead, it is determined whether or not the setting method is “Static” or “RARP”. May be. In the present modification, YES is determined in S36 even when the setting method information read in S16 of FIG. 2 indicates the setting method “RARP”. In this case, in S50 of FIG. 3, a printer port is generated using the IP address of the printer 60 read in S16 of FIG. In the case of this modification, “DHCP”, “BOOTP”, and “AUTO” are examples of the “specific setting method”.

上記の実施例の変形例を以下に列挙する。
(1)上記の実施例の技術は、IPv6(Internet Protocol version6)又は他のバージョンのIPアドレスについても適用可能である。
The modifications of the above embodiment are listed below.
(1) The technology of the above embodiment can be applied to IPv6 (Internet Protocol version 6) or other version IP addresses.

(2)特定部32は、外部のIPアドレス割り当てサーバが割り当て可能なIPアドレスの範囲をテーブル23から特定しなくてもよい。例えば、特定部32は、LAN4に接続されているIPアドレス割り当てサーバ(DHCPサーバ62、BOOTPサーバ64等(DHCPサーバ機能を有するアクセスポイントを含む))から、当該IPアドレス割り当てサーバが割り当て可能なIPアドレスの範囲を取得することによって、IPアドレスの範囲を特定してもよい。また、例えば、複数種類のIPアドレス割り当てサーバのそれぞれが割り当て可能なIPアドレスの範囲を公開しているサーバが、LAN4又は他のネットワーク(例えばインターネット)に存在する場合には、特定部32は、当該サーバからIPアドレスの範囲を取得することによって、IPアドレスの範囲を特定してもよい。 (2) The specifying unit 32 may not specify the range of IP addresses that can be assigned by the external IP address assignment server from the table 23. For example, the specifying unit 32 can assign an IP address that can be assigned by an IP address assignment server (including a DHCP server 62, a BOOTP server 64, etc. (including an access point having a DHCP server function)) connected to the LAN 4. The IP address range may be specified by acquiring the address range. In addition, for example, when a server that publishes a range of IP addresses that can be assigned by each of a plurality of types of IP address assignment servers exists in the LAN 4 or another network (for example, the Internet), the specifying unit 32 The IP address range may be specified by acquiring the IP address range from the server.

(3)図4のS78の第3の判断処理(S76で生成された仮ホストアドレス部の値が、S70で特定されたホストアドレス部の値に一致するのか否かを判断する処理)、及び、図4のS85の第3の判断処理を省略してもよい。この場合、仮に、図5のS104で決定される候補IPアドレスが端末装置10のIPアドレス27に一致すると、図5のS106では、端末装置10は、上記の所定の信号を、自身に向けて送信する。この場合、端末装置10は、上記の所定の信号に対する応答信号を、自身に向けて送信する。これにより、端末装置10は、応答信号を受信するためにS108でYESと判断し、図4のS72以降の処理を再び実行する。即ち、端末装置10は、対象IPアドレスを決定する過程において、自身のIPアドレス27のホストアドレス部の値と異なる仮ホストアドレス部の値を少なくとも1回生成する。従って、本変形例の構成(図4のS78及びS85の第3の判断処理を省略する構成)も、本発明の「前記特定のIPアドレスのネットワークアドレス部の値と、前記特定のIPアドレスのホストアドレス部の値とは異なる特定の値と、を組み合わせることによって、仮の候補IPアドレスを生成し」という構成に含まれる。 (3) Third determination process in S78 of FIG. 4 (process for determining whether or not the value of the temporary host address part generated in S76 matches the value of the host address part specified in S70), and The third determination process in S85 of FIG. 4 may be omitted. In this case, if the candidate IP address determined in S104 of FIG. 5 matches the IP address 27 of the terminal device 10, the terminal device 10 directs the predetermined signal to itself in S106 of FIG. Send. In this case, the terminal device 10 transmits a response signal for the predetermined signal toward itself. As a result, the terminal device 10 determines YES in S108 to receive the response signal, and again executes the processing from S72 onward in FIG. That is, in the process of determining the target IP address, the terminal device 10 generates a temporary host address part value different from the host address part value of its own IP address 27 at least once. Therefore, the configuration of this modification (the configuration in which the third determination process of S78 and S85 in FIG. 4 is omitted) is also the “value of the network address portion of the specific IP address and the specific IP address of the present invention. A temporary candidate IP address is generated by combining a specific value different from the value of the host address portion.

(4)図4のS72〜S78の処理を省略してもよい。即ち、生成部36は、サブネットマスク28の値の大きさに関わらず、S80〜S88の処理を実行してもよい。逆に、図4のS72、S80〜S88を省略してもよい。即ち、生成部36は、サブネットマスク28の値の大きさに関わらず、S74〜S78の処理を実行してもよい。 (4) You may abbreviate | omit the process of S72-S78 of FIG. That is, the generation unit 36 may execute the processes of S80 to S88 regardless of the value of the subnet mask 28. Conversely, S72 and S80 to S88 in FIG. 4 may be omitted. That is, the generation unit 36 may execute the processes of S74 to S78 regardless of the value of the subnet mask 28.

(5)デバイスドライバは、記録媒体20からインストールされなくてもよい。例えば、端末装置10のOSプログラム26は、プリンタ60のためのデバイスドライバを含んでいてもよい。この場合、インストール部46は、OSプログラム26に含まれるデバイスドライバを記憶部24内の所定の領域に格納することによって、デバイスドライバをインストールしてもよい。 (5) The device driver may not be installed from the recording medium 20. For example, the OS program 26 of the terminal device 10 may include a device driver for the printer 60. In this case, the installation unit 46 may install the device driver by storing the device driver included in the OS program 26 in a predetermined area in the storage unit 24.

(6)上記の各実施例の技術は、プリンタドライバとは異なる他のデバイスドライバが端末装置10にインストールされる場合にも適用することできる。他のデバイスドライバの例として、例えば、スキャナドライバを挙げることができる。 (6) The technique of each of the above embodiments can be applied to a case where another device driver different from the printer driver is installed in the terminal device 10. Examples of other device drivers include a scanner driver.

以上、本発明の具体例を詳細に説明したが、これらは例示にすぎず、特許請求の範囲を限定するものではない。特許請求の範囲に記載の技術には、以上に例示した具体例を様々に変形、変更したものが含まれる。   Specific examples of the present invention have been described in detail above, but these are merely examples and do not limit the scope of the claims. The technology described in the claims includes various modifications and changes of the specific examples illustrated above.

また、本明細書または図面に説明した技術要素は、単独であるいは各種の組合せによって技術的有用性を発揮するものであり、出願時請求項記載の組合せに限定されるものではない。また、本明細書または図面に例示した技術は複数目的を同時に達成するものであり、そのうちの一つの目的を達成すること自体で技術的有用性を持つものである。   The technical elements described in this specification or the drawings exhibit technical usefulness alone or in various combinations, and are not limited to the combinations described in the claims at the time of filing. In addition, the technology illustrated in the present specification or the drawings achieves a plurality of objects at the same time, and has technical utility by achieving one of the objects.

2:ネットワークシステム、10:端末装置、18:記録媒体読取部、20:記録媒体、22:プログラム、23:テーブル、30:制御部、60:プリンタ   2: network system, 10: terminal device, 18: recording medium reading unit, 20: recording medium, 22: program, 23: table, 30: control unit, 60: printer

Claims (11)

ネットワーク内で利用されるべき対象デバイスのための対象IPアドレスを決定するIPアドレス決定装置であって、
外部のIPアドレス割り当てサーバが割り当て可能なIPアドレスの範囲を特定する特定部と、
前記IPアドレス決定装置自身に設定されている特定のIPアドレスと、前記IPアドレス決定装置自身に設定されている特定のサブネットマスクと、に基づいて、前記IPアドレスの範囲に含まれない前記対象IPアドレスを決定する決定部と、
を備えるIPアドレス決定装置。
An IP address determination device for determining a target IP address for a target device to be used in a network,
A specifying unit for specifying a range of IP addresses that can be assigned by an external IP address assignment server;
The target IP not included in the range of the IP address based on a specific IP address set in the IP address determination device itself and a specific subnet mask set in the IP address determination device itself A determination unit for determining an address;
An IP address determination device comprising:
前記決定部は、
前記特定のIPアドレスと、前記特定のサブネットマスクと、に基づいて、前記IPアドレスの範囲に含まれない候補IPアドレスを生成する生成部と、
前記ネットワーク内の他のデバイスに前記候補IPアドレスが設定されているのか否かを確認する確認部と、備え、
前記決定部は、前記他のデバイスに前記候補IPアドレスが設定されていないことが確認される場合に、前記候補IPアドレスを前記対象IPアドレスとして決定する、請求項1に記載のIPアドレス決定装置。
The determination unit
A generating unit that generates candidate IP addresses not included in the range of the IP address based on the specific IP address and the specific subnet mask;
A confirmation unit for confirming whether the candidate IP address is set in another device in the network;
The IP address determination apparatus according to claim 1, wherein the determination unit determines the candidate IP address as the target IP address when it is confirmed that the candidate IP address is not set in the other device. .
前記生成部は、
前記特定のIPアドレスのネットワークアドレス部の値と、前記特定のIPアドレスのホストアドレス部の値とは異なる特定の値と、を組み合わせることによって、仮の候補IPアドレスを生成し、
前記仮の候補IPアドレスが前記IPアドレスの範囲に含まれない場合に、前記仮の候補IPアドレスを前記候補IPアドレスとして決定する、請求項2に記載のIPアドレス決定装置。
The generator is
A temporary candidate IP address is generated by combining the value of the network address part of the specific IP address and a specific value different from the value of the host address part of the specific IP address;
The IP address determination apparatus according to claim 2, wherein when the temporary candidate IP address is not included in the range of the IP address, the temporary candidate IP address is determined as the candidate IP address.
前記生成部は、乱数を用いて、前記特定の値を決定する、請求項3に記載のIPアドレス決定装置。   The IP address determination device according to claim 3, wherein the generation unit determines the specific value using a random number. 前記生成部は、
前記特定のサブネットマスクの値が第1の所定値よりも小さい第1の場合に、前記乱数を用いて、前記特定の値を決定し、
前記特定のサブネットマスクの値が前記第1の所定値よりも大きい第2の場合に、前記乱数を用いずに、前記特定の値を決定する、請求項4に記載のIPアドレス決定装置。
The generator is
In the first case where the value of the specific subnet mask is smaller than a first predetermined value, the specific value is determined using the random number;
The IP address determination device according to claim 4, wherein the specific value is determined without using the random number in a second case where the value of the specific subnet mask is larger than the first predetermined value.
前記生成部は、
前記第2の場合において、前記特定のIPアドレスの前記ホストアドレス部の値が第2の所定値よりも大きい場合に、前記第2の所定値よりも小さい値を、前記特定の値として決定し、
前記第2の場合において、前記特定のIPアドレスの前記ホストアドレス部の値が前記第2の所定値よりも小さい場合に、前記第2の所定値よりも大きい値を、前記特定の値として決定する、請求項5に記載のIPアドレス決定装置。
The generator is
In the second case, when the value of the host address part of the specific IP address is larger than a second predetermined value, a value smaller than the second predetermined value is determined as the specific value. ,
In the second case, when the value of the host address part of the specific IP address is smaller than the second predetermined value, a value larger than the second predetermined value is determined as the specific value. The IP address determination device according to claim 5.
前記第2の所定値よりも小さい前記値は、前記仮の候補IPアドレスのホストアドレス部の値として採り得る値の範囲のうち、最小値から順に選択される値であり、
前記第2の所定値よりも大きい前記値は、前記仮の候補IPアドレスのホストアドレス部の値として採り得る値の範囲のうち、最大値から順に選択される値である、請求項6に記載のIPアドレス決定装置。
The value smaller than the second predetermined value is a value selected in order from the smallest value among a range of values that can be taken as the value of the host address part of the temporary candidate IP address,
The value larger than the second predetermined value is a value selected in order from a maximum value among a range of values that can be taken as a value of a host address part of the temporary candidate IP address. IP address determination device.
前記決定部によって決定される前記対象IPアドレスを前記対象デバイスに供給する供給部をさらに備える、請求項1から7のいずれか一項に記載のIPアドレス決定装置。   The IP address determination device according to claim 1, further comprising a supply unit that supplies the target device with the target IP address determined by the determination unit. 前記特定部は、前記IPアドレスの範囲が予め登録されているテーブルから、前記IPアドレスの範囲を読み込むことによって、前記IPアドレスの範囲を特定する、請求項1から8のいずれか一項に記載のIPアドレス決定装置。   The said specific | specification part specifies the range of the said IP address by reading the range of the said IP address from the table in which the range of the said IP address is registered previously, The range of any one of Claim 1 to 8 IP address determination device. ネットワーク内で利用されるべき対象デバイスのためのデバイスドライバがインストールされる端末装置であって、
前記対象デバイスから、前記対象デバイスに現在設定されているIPアドレスの設定手法を示す設定手法情報を取得する情報取得部と、
前記設定手法情報が、前記対象デバイスのIPアドレスが変更される可能性が高い特定の設定手法を示す場合であり、かつ、前記対象デバイスのデバイス名に対応する対応IPアドレスを名前解決によって取得することができない場合に、前記対象デバイスのための前記対象IPアドレスを決定する請求項1から9のいずれか一項に記載のIPアドレス決定装置と、
前記対象IPアドレスに対応するポートを生成するポート生成部と、
前記デバイスドライバをインストールするインストール部と、を備える端末装置。
A terminal device in which a device driver for a target device to be used in a network is installed,
An information acquisition unit that acquires setting method information indicating a setting method of an IP address currently set in the target device from the target device;
The setting method information indicates a specific setting method in which the IP address of the target device is likely to be changed, and a corresponding IP address corresponding to the device name of the target device is acquired by name resolution. The IP address determination apparatus according to any one of claims 1 to 9, wherein the target IP address for the target device is determined when the target device cannot be used.
A port generation unit for generating a port corresponding to the target IP address;
An installation unit that installs the device driver;
ネットワーク内で利用されるべき対象デバイスのための対象IPアドレスを決定するIPアドレス決定装置を実現するためのコンピュータプログラムであって、
外部のIPアドレス割り当てサーバが割り当て可能なIPアドレスの範囲を特定する特定処理と、
前記IPアドレス決定装置自身に設定されている特定のIPアドレスと、前記IPアドレス決定装置自身に設定されている特定のサブネットマスクと、に基づいて、前記IPアドレスの範囲に含まれない前記対象IPアドレスを決定する決定処理と、
をコンピュータに実行させるコンピュータプログラム。
A computer program for realizing an IP address determination device for determining a target IP address for a target device to be used in a network,
A specific process for specifying a range of IP addresses that can be allocated by an external IP address allocation server;
The target IP not included in the range of the IP address based on a specific IP address set in the IP address determination device itself and a specific subnet mask set in the IP address determination device itself A decision process to determine an address;
A computer program that causes a computer to execute.
JP2009224003A 2009-09-29 2009-09-29 IP address determination device, terminal device, and computer program Active JP5338597B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009224003A JP5338597B2 (en) 2009-09-29 2009-09-29 IP address determination device, terminal device, and computer program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009224003A JP5338597B2 (en) 2009-09-29 2009-09-29 IP address determination device, terminal device, and computer program

Publications (2)

Publication Number Publication Date
JP2011077596A true JP2011077596A (en) 2011-04-14
JP5338597B2 JP5338597B2 (en) 2013-11-13

Family

ID=44021161

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009224003A Active JP5338597B2 (en) 2009-09-29 2009-09-29 IP address determination device, terminal device, and computer program

Country Status (1)

Country Link
JP (1) JP5338597B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013157942A (en) * 2012-01-31 2013-08-15 Brother Ind Ltd Communication apparatus
JP2015029237A (en) * 2013-07-31 2015-02-12 カシオ計算機株式会社 Mobile terminal, server, and program
KR101773687B1 (en) * 2015-12-30 2017-09-12 이화여자대학교 산학협력단 Anonymization method for ip address in ip based network and packet routing method using anonymized ip address in ip based network

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20230031714A (en) * 2021-08-27 2023-03-07 삼성전자주식회사 A display apparatus, an electronic apparatus and a method of the same

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003333055A (en) * 2002-05-16 2003-11-21 Canon Inc Setting device and setting method of fixed ip address in dhcp environment
JP2006018468A (en) * 2004-06-30 2006-01-19 Canon Inc Information processing device and installation control method
JP2007166069A (en) * 2005-12-12 2007-06-28 Matsushita Electric Ind Co Ltd Ip communication device, ip communication system equipped therewith, and ip address setting method therefor
JP2008047987A (en) * 2006-08-11 2008-02-28 Hitachi Information Systems Ltd Fixed ip address acquisition method and ip segment extension method in dhcp environment, and their device and program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003333055A (en) * 2002-05-16 2003-11-21 Canon Inc Setting device and setting method of fixed ip address in dhcp environment
JP2006018468A (en) * 2004-06-30 2006-01-19 Canon Inc Information processing device and installation control method
JP2007166069A (en) * 2005-12-12 2007-06-28 Matsushita Electric Ind Co Ltd Ip communication device, ip communication system equipped therewith, and ip address setting method therefor
JP2008047987A (en) * 2006-08-11 2008-02-28 Hitachi Information Systems Ltd Fixed ip address acquisition method and ip segment extension method in dhcp environment, and their device and program

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
CSND200800650013; 井上 孝司: '用途に合わせて最適なサーバを作る! 標準サービス総復習' Windows Server World 第13巻、第9号, 20080901, pp.92-110 *
JPN6013017547; 井上 孝司: '用途に合わせて最適なサーバを作る! 標準サービス総復習' Windows Server World 第13巻、第9号, 20080901, pp.92-110 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013157942A (en) * 2012-01-31 2013-08-15 Brother Ind Ltd Communication apparatus
US9794108B2 (en) 2012-01-31 2017-10-17 Brother Kogyo Kabushiki Kaisha Communication apparatus, methods, and non-transitory computer-readable media for determining IP addresses for use in different networks
US10110414B2 (en) 2012-01-31 2018-10-23 Brother Kogyo Kabushiki Kaisha Communication apparatus, methods, and non-transitory computer-readable media for determining IP addresses for use in different networks
US10659282B2 (en) 2012-01-31 2020-05-19 Brother Kogyo Kabushiki Kaisha Communication apparatus, methods, and non-transitory computer-readable media for determining IP addresses for use in different networks
US11012286B2 (en) 2012-01-31 2021-05-18 Brother Kogyo Kabushiki Kaisha Communication apparatus, methods, and non-transitory computer-readable media for determining IP addresses for use in different networks
US11595344B2 (en) 2012-01-31 2023-02-28 Brother Kogyo Kabushiki Kaisha Communication apparatus, methods, and non-transitory computer-readable media for determining IP addresses for use in different networks
JP2015029237A (en) * 2013-07-31 2015-02-12 カシオ計算機株式会社 Mobile terminal, server, and program
KR101773687B1 (en) * 2015-12-30 2017-09-12 이화여자대학교 산학협력단 Anonymization method for ip address in ip based network and packet routing method using anonymized ip address in ip based network

Also Published As

Publication number Publication date
JP5338597B2 (en) 2013-11-13

Similar Documents

Publication Publication Date Title
JP5093277B2 (en) Communication apparatus and computer program
JP5300562B2 (en) Information processing apparatus, information processing method, and program
JP5263106B2 (en) Terminal device and computer program
US7860980B2 (en) Information processing device, server, communication system, address decision method, address modification method, and program
EP1835702A2 (en) Image processing device
US10884682B2 (en) Storage medium, method, and apparatus for indicating whether communication with a device connected to a network is possible or not
US9853858B2 (en) Communication device
JP5338597B2 (en) IP address determination device, terminal device, and computer program
JP2005094252A (en) Image processing apparatus, image processing system, name registration method, name registration program, and recording medium
JP2006246356A (en) Data receiving system and data output method, receiving unit and control program
JP4775437B2 (en) Computer program for installing software
US10250668B2 (en) Communication apparatus, control method thereof, and storage medium
US8255498B2 (en) Router and method for avoiding IP address conflicts
JP4684283B2 (en) DHCP client / server device and method for providing DHCP server service over a network
JP5527233B2 (en) Communication device
US20060215658A1 (en) Electronic device, IP address determining method, and recording medium having IP address determining program stored therein
JP5983314B2 (en) Information processing apparatus and program
US10574837B2 (en) Information processing apparatus for data communication with external apparatus and control method for the same, and storage medium
JP4368776B2 (en) Network device, network device control method, program, and recording medium
JP5626268B2 (en) Information processing terminal
JP5021533B2 (en) Information processing terminal
JP2015195533A (en) communication device
US20240020069A1 (en) Information processing system, information processing apparatus, and control method for information processing system
JP6939154B2 (en) Device setting device, device setting system, device setting method, and program
JP2011076278A (en) Terminal device and computer program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120319

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130131

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130416

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130617

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20130709

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130722

R150 Certificate of patent or registration of utility model

Ref document number: 5338597

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150