This application claims the benefit of Korean Patent Application No. 10-2004-0086544, filed on Oct. 28, 2004, in the Korean Intellectual Property Office, the disclosure of which is incorporated herein in its entirety by reference.
1. Field of the Invention
The present invention relates to a method, apparatus, and medium for configuring a network address, and more particularly, to a method, apparatus, and medium for automatically configuring a network address.
2. Description of the Related Art
Referring to
Nodes on a network have a network address to identify themselves on the network. The network address is typically an IP (Internet protocol) address. An IP address is composed of a subnet ID and a node ID. In general, a subnet is a grouping of nodes connected to the external network through a single gateway 1, and nodes on the same subnet, for example, the node A 11, node B 12, node C 13, and node D 14, have an identical subnet ID.
Once an IP address is configured, fixed computers such as the node A 11, node B 12, and node C 13 can continuously use the IP address. However, in a mobile computer such as the node D 14, since a subnet is changed each time the mobile computer moves, the IP address has to be newly reconfigured.
There are generally three methods of configuring an IP address. First, a computer user can inquire of a network manager about an IP address, and manually configure the IP address provided by the network manager. However, this method is complicated because every time the IP address is reconfigured, the computer user should make an inquiry to the network manager and manually configure the IP address.
Secondly, a network address can be automatically configured through a DHCP (Dynamic Host Configuration Protocol) server. However, this method cannot be used in an environment in which the DHCP server does not exist.
The third method is to automatically configure a network address without the assistance of a network manager or a DHCP server. In particular, Korean Patent Publication No. 2003-0048931, which is a typical conventional art relating to this method, uses a statistical method. That is, according to this prior art, an IP address is automatically configured by obtaining a subnet ID based on a statistically more frequent ARP (Address Resolution Protocol) packet among the ARP packets which are obtained by packet sniffing. However, since this method is based on a statistical result, the IP address can be mistakenly configured. In particular, this method uses a ping packet to obtain an available IP address. However, in the current network environment, the number of nodes that do not use a ping response service to avoid hacking is increasing and it is difficult to perform packet sniffing. Thus, the method is not suitable to the current network environment.
The present invention provides a method, an apparatus, and a medium by which an IP address of a node can be automatically and unmistakably (correctly) configured without the assistance of a network manager and a DHCP server in the current network environment in which performing packet sniffing is difficult.
The present invention also provides a computer readable recording medium having embodied thereon a computer program for executing the method.
According to an aspect of the present invention, there is provided a method of configuring an address of one of a plurality of nodes on a subnet, the method comprising the operations of: obtaining an ID of the subnet from a packet transmitted from a router on the subnet; and configuring an address that none of the nodes on the subnet use as an address of the node among addresses including the obtained subnet ID.
According to another aspect of the present invention, there is provided an apparatus for configuring an address of a node on a subnet, the apparatus comprising: a subnet ID obtaining portion obtaining an ID of the subnet from a packet transmitted from a router on the subnet; and an address configuring portion configuring an address that none of nodes on the subnet use as an address of the node among addresses including the obtained subnet ID.
According to still another aspect of the present invention, there is provided a computer readable recording medium having embodied thereon a computer program for executing the method of configuring an address of one of a plurality of a node on a subnet.
According to an aspect of the present invention, there is provided a method of configuring an address of one of a plurality of nodes on a subnet, comprising obtaining a subnet ID of the subnet from a packet on the subnet; and configuring an address that none of the nodes on the subnet use, as the address of the one node among addresses including the obtained subnet ID.
According to an aspect of the present invention, there is provided at least one computer readable medium storing instructions that control at least one processor to perform a method of configuring an address of a plurality of nodes on a subnet, the method comprising obtaining an ID of the subnet from a packet on the subnet; and configuring an address that none of the nodes on the subnet use, as the address of the one node among addresses including the obtained subnet ID.
These and/or other aspects, features, and advantages of the invention will become apparent and more readily appreciated from the following description of exemplary embodiments, taken in conjunction with the accompanying drawings of which:
Reference will now be made in detail to exemplary embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the like elements throughout. Exemplary embodiments are described below to explain the present invention by referring to the figures.
Referring to
The router 2 uses a distinct routing protocol, which is typically a Routing Information Protocol (RIP) or an Open Shortest Path First (OSPF), to provide an efficient routing service. A router using the RIP transmits an entire routing table to hosts around the router every 30 seconds, and the hosts re-transmit the table to the peripheral hosts. Such transmission is continued until all hosts in a network have the same routing table. The RIP has no problems in a small network, but in a large network, transmitting the entire routing table every 30 seconds greatly burdens the network. The OSPF was developed to solve the problem of the RIP, and a router using the OSPF transmits a changed part of a routing table when the change occurs.
The routing protocols cyclically check changes in a network and update the routing table, accordingly. To this end, the routing protocols cyclically transmit a routing protocol packet such as a RIPv2 packet or an OSPF hello packet, as shown in
The nodes connected to the external network through the router 2, that is, the node A 31, node B 32, node C 33, node D 41, node E 42, and node F 43 form a single subnet and have the same subnet ID.
When the conventional network environment shown in
However, as shown in
Referring to
The subnet ID obtaining portion 431 obtains an ID of the subnet from a routing protocol packet transmitted from the router 2. As described above, the routing protocol packet is a packet which the router 2 broadcasts to all nodes connected to the router 2 in order to cyclically check changes in the subnet according to the routing protocol such as the RIP and the OSPF.
The subnet ID obtaining portion 431 includes a router address obtaining portion 4311 and a subnet ID extracting portion 4312.
The router address obtaining portion 4311 obtains an IP address of the router 2 by monitoring the routing protocol packet input to the node F 43 using packet sniffing. The packet sniffing in exemplary embodiments is different from the conventional art in that the conventional packet sniffing can sniff packets transmitted to other nodes but the packet sniffing in exemplary embodiments of the present invention can sniff only a packet transmitted to a designated node. Since the routing protocol packet is broadcasted to all nodes connected to the router 2, the node F 43 can sniff it.
The subnet ID extracting portion 4312 extracts the ID of the subnet from the IP address of the router 2, which has been obtained by the router address obtaining portion 4311. How the subnet ID obtaining portion 431 obtains the subnet ID will now be described in detail using the currently used routing protocol packets as an example.
Referring to
In the present exemplary embodiment, the IP address field 401 and the subnet mask field 402 are used to obtain the subnet ID. The IP address of the router is recorded in the IP address field 401, and a subnet mask for extracting the subnet ID from the IP address is recorded in the subnet mask field 402.
That is, the router address obtaining portion 4311 reads the value of the IP address field 401 of the RIPv2 packet 400 to obtain the IP address of the router 2, and the subnet ID extracting portion 4312 extracts the subnet ID from the obtained IP address of the router 2 referring to the value of the subnet mask field 402 of the RIPv2 packet 400.
For example, if 168.219.202.65 is recorded in the IP address field 401 of the RIPv2 packet and 255.255.255.192 is recorded in the IP subnet mask field 402, the router address obtaining portion 4311 reads 168.219.202.65, the value of the IP address field 401 of the RIPv2 packet 400, to obtain the IP address of 168.219.202.65 of the router 2, and the subnet ID extracting portion 4312 extracts the subnet ID of 168.219.202, which corresponds to a subnet mask of 255.255.255, from the obtained IP address of 168.219.202.65 of the router 2 referring to 255.255.255.192, which is the value of the IP address field 401 of the RIPv2 packet 400.
Referring to
In the present exemplary embodiment, the network mask field 501 and the designated router IP address field 502 are referred to obtain the subnet ID. An IP address of a router is recorded in the designated router IP address field 502, and a subnet mask for extracting a subnet ID from the IP address is recorded in the network mask field 501.
That is, the router address obtaining portion 4311 reads the value of the designated router IP address field 502 of the OSPF hello packet 500 to obtain the IP address of the router 2, and the subnet ID extracting portion 4312 extracts the subnet ID from the obtained IP address of the router 2 referring to the value of the network mask field 501 of the OSPF hello packet 500.
For example, if 168.219.202.65 is recorded in the designated router IP address field 502 of the OSPF hello packet 500 and 255.255.255.192 is recorded in the network mask field 501, the router address obtaining portion 4311 reads 168.219.202.65, which is the value of the designated router IP address field 502 of the OSPF hello packet 500, to obtain the IP address of 168.219.202.65 of the router 2 and the subnet ID extracting portion 4312 extracts the subnet ID of 168.219.202, which corresponds to a subnet mask of 255.255.255, from the obtained IP address of 168.219.202.65 of the router 2 referring to 255.255.255.192, which is the value of the network mask field 501 of the OSPF hello packet 500.
The address configuring portion 432 configures an IP address not used by any of the nodes i.e., the node A 31, node B 32, node C 33, node D 41 and node E 42, on the subnet, among the IP addresses including the subnet ID obtained by the subnet ID obtaining portion 431 as an IP address of the node F 43. To avoid IP address conflict which may occur due to simultaneous use of a single IP address by several nodes, the address configuring portion 432 configures the IP address that the other nodes do not use as the IP address of the node F 43.
The address configuring portion 432 includes an address use inquiring portion 4321 and an address selecting portion 4322.
The address use inquiring portion 4321 inquires of all nodes whether all of the IP addresses including the subnet ID obtained by the subnet ID obtaining portion 431 are used. More specifically, the address use inquiring portion 4321 inquires of all nodes whether the nodes use the IP addresses by broadcasting Address Resolution Protocol (ARP) request packets which include the respective IP addresses including the subnet ID obtained by the subnet ID obtaining portion 431.
For example, if the IP address of the router 2 obtained by the router address obtaining portion 4311 is 168.219.202.65 and the subnet ID extracted by the subnet ID extracting portion 4312 is 168.219.202, the address use inquiring portion 4321 broadcasts 254 ARP request packets which include respective IP addresses (168.219.202.1 through 168.219.1.255) except 168.219.202.65 that is the IP address of the router. All the IP addresses include the subnet ID of 168.219.202.
The address selecting portion 4322 selects an address that none of the nodes use from all IP addresses based on the inquiry result of the address use inquiring portion 4321. More specifically, the address selecting portion 4322 selects the IP address that none of the nodes use by selecting an IP address included in an ARP request packet which does not respond to the inquiry.
For instance, if there is not an ARP response packet for the ARP request packet including 168.219.1.255 among the 254 ARP request packets broadcasted by the address use inquiring portion 4321, the address selecting portion 4322 selects 168.219.1.255 as the IP address of the node F 43.
An IP address and a physical network address of a destination node should be known to communicate via Internet. The ARP is a protocol used to obtain a physical network corresponding to the IP address when only the IP address, not the physical network address, of the destination node is known. The physical network address is generally a 48-bit address of an Ethernet card.
For example, when the node F 43 transmits an ARP request packet including a certain IP address to the node E 42, the node E 42 transmits an ARP response packet including a physical network address corresponding to the IP address. Thus, the IP address included in an ARP request packet which does not respond can be an IP address that none of the nodes use. In general, most ARP request packets do not respond. In this event, any IP addresses included in the ARP request packets that have not responded can be selected.
The IP address configured as the IP address of the node F 43 by the address configuring portion 432 is stored in the network information database 433 in order to be used as the IP address of the node F 43 in following communication procedures. When the node F 43 intends to communicate with other nodes, the node F 43 uses the IP address stored in the network information database 433.
The address monitor 434 monitors whether a node using an IP address identical to the IP address configured by the address configuring portion 432 as the IP address of the node F 43 connects to the subnet. When a node newly connected to the subnet has an IP address configured according to the present exemplary embodiment, the IP address conflict cannot occur, but when a user configures the IP address manually as in the first conventional method or automatically configures the IP address through a DHCP server as in the second conventional method, an IP address conflict can occur.
The address configuring portion 432 obtains an IP address other than the configured IP address based on the monitoring result of the address monitor 434 in the same fashion as described above.
Referring to
In operation 61, the node F 43 sniffs a packet which is input thereto.
In operation 62, when the packet sniffed in operation 61 is a routing protocol packet, the node F 43 goes to operation 63, and, otherwise, goes back to operation 61.
In operation 63, the node F 43 reads the IP address of the router 2 included in the routing protocol packet to obtain the IP address of the router 2.
In operation 64, the node F 43 extracts the subnet ID from the IP address of the router 2 obtained in operation 63 referring to the subnet mask included in the routing protocol packet.
In operation 65, the node F 43 inquires of all nodes whether the IP addresses are used by broadcasting one of ARP request packets including respective IP addresses which include the subnet ID obtained in operation 64.
In operation 66, the node F 43 checks whether the ARP request packet broadcasted in operation 65 responds. When the ARP request packet responds, the node F 43 goes back to operation 65.
When the ARP request packet does not respond, in operation 67, the node F 43 selects an IP address that none of the nodes use by selecting the IP address included in the ARP request packet and configures the IP address as an IP address of the node F 43.
In operation 68, the node F 43 stores the IP address which is configured as the IP address of the node F 43 in operation 67 in the network information database 433 to be used as the IP address of the node F 43 in following communication procedures.
In operation 69, the node F 43 monitors whether a node using the same IP address as the IP address which was configured as the IP address of the node F 43 in operation 67 connects to the subnet. That is, the node F 43 monitors IP address conflicts.
In operation 70, when it is found that a node using the same IP address connects to the subnet in operation 69, that is, the IP address conflicts, the node F 43 goes back to operation 65 and obtains an IP address other than the configured IP address.
In addition to the above described exemplary embodiments, exemplary embodiments of the present invention can also be implemented by executing computer readable code/instructions in/on a medium, e.g., a computer readable medium. The medium can correspond to any medium/media permitting the storing and/or transmission of the computer readable code. The code/instructions may form a computer program.
The computer readable code/instructions can be recorded/transferred on a medium in a variety of ways, with examples of the medium including magnetic storage media (e.g., ROM, floppy disks, hard disks, etc.), optical recording media (e.g., CD-ROMs, or DVDs), and storage/transmission media such as carrier waves, as well as through the Internet, for example. The medium may also be a distributed network, so that the computer readable code/instructions is stored/transferred and executed in a distributed fashion. The computer readable code/instructions may be executed by one or more processors.
According to the present invention, an IP address is automatically configured without the assistance of a network manager and a DHCP server, and therefore, the conventional problem to manually configure the IP address can be resolved. In particular, since a subnet ID is obtained from a routing protocol packet such as a RIPv2 packet or an OSPF hello packet without using a statistical method, an IP address of a node can be automatically configured in a network environment in which it is difficult to perform packet sniffing.
Furthermore, according to the present invention, an IP address that other nodes do not use is selected using ARP packets, and thus, even in a network environment in which the number of nodes not providing a ping response service is increasing, to avoid hacking an IP address of the node can be automatically and unmistakably (correctly) configured.
Although a few exemplary embodiments of the present invention have been shown and described, it would be appreciated by those skilled in the art that changes may be made in these exemplary embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
10-2004-0086544 | Oct 2004 | KR | national |