This application claims the benefit of Korean Patent Application No. 2003-49310, filed on Jul. 18, 2003, in the Korean Intellectual Property Office, the disclosure of which is incorporated herein by reference.
1. Field of the Invention
The present invention relates to a gateway and a control method thereof, and, more particularly, to a gateway that is operated by being linked to an IP address of a target node connected to a network and intercepts and processes a data stream between the network and the target node, thereby transmitting the data stream to the destination, and a control method thereof.
2. Description of the Related Art
To intercept data sent/received to/from a target node connected to a network, an intermediary, or a repeater, physically cutting a connection between the network and the target node should be provided to draw a data stream of a specific port sent/received to/from the target node. Then, the drawn data stream is processed and inserted in the specific port and transmitted to the destination.
The intermediary should comprise at least two connecting ports, each having a different address from one another, to physically cut the connection between the network and the target node and intermediate the data stream again. Further, the addresses of the connecting ports connected to the network should be set up as the IP address of the target node, so as to be recognized as the target node.
Here, if the IP addresses of the connecting ports connected to the network and the IP address of the target node are the same, the data stream is not transmitted to the outside, and comes back to the inside of the intermediate by a local loop back, because a destination address of the data stream is the same as an IP address of the intermediary itself. Therefore, a new IP address of the target node should be set up again, so that the IP addresses of the connecting ports connected to the network and the IP address of the target node are not the same. Further, the IP address of the target node should return to the original IP address when the intermediary is eliminated, thereby causing a loss of time and manpower.
Accordingly, it is an aspect of the present invention to provide a gateway that is linked to an IP address of a target address connected to a network, and intercepts and processes a data stream between the network and the target node, thereby transmitting the data stream to the destination, and a control method thereof.
Additional aspects and/or advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
The foregoing and/or other aspects of the present invention are achieved by providing a gateway comprising a first port connected to a network and a second port connected to a target node and being employed for a data stream between the network and applications of the target node, the gateway further comprising: a storage unit to store an IP address of the target node; an MAC address converter to set an MAC address of the target node as an MAC address of the first port; a controller to set an IP address of the second port based on an IP address of the target node, and to read the MAC address of the target node through the second port and set the IP address of the target node as an IP address of the first port; and a router to set a transmission route and transmit data to the IP address of the target node without a local loop back process, in response to the IP address of the target node and the IP address of the first port being the same.
According to an aspect of the invention, the gateway may further comprise: a data processor to intercept the data stream, and then process the data stream or make and transmit a new data stream; a filter information table to store information about process port numbers used by the data stream required to be processed in the data processor; and a filter transmitting only the data stream required to be processed to the data processor, based on the information stored in the filter information table.
The foregoing and/or other aspects of the present invention may also be achieved by providing a method of a control of a gateway comprising a first port connected to a network and a second port connected to a target node and being employed for a data stream between the network and applications of the target node, the control method comprising: storing an IP address of the target node; setting an IP address of the second port based on the IP address of the target node; and setting the IP address of the target node as an IP address of the first port.
According to an aspect of the invention, the control method may further comprise: storing information about process port numbers used by the data stream required to be processed; intercepting the data stream transmitted based on the information; processing the data; and transmitting the processed data to a destination to which the data should be transmitted.
According to an aspect of the invention, the control method may further comprise: making a new data stream; and transmitting the newly made data stream to a destination to which the data should be transmitted.
These and/or other aspects and advantages of the present invention will become apparent and more readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
Reference will now be made in detail to the embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to like elements throughout. The embodiments are described below to explain the present invention by referring to the figures.
As shown in
The gateway 3 is installed between the TCP/IP network 1 and the target node 5 desired to be used.
As shown in
In the storage 33, an IP(internet protocol) address of the target node 5 is previously recorded, and a flash memory, used as a nonvolatile memory, is generally used therefore.
The controller 31 reads the IP address of the target node 5, stored in the storage 33, when a system of the gateway 3 is initialized, and then sets up an IP address of the second port 39, based on the IP address of the target node 5. For example, the IP address of the second port 39 may be set up as a number of the IP address of the target node 5 plus 1, i.e., if the IP address of the target node is 192.168.3.12, the IP address of the second port 39 is set up as 192.168.3.13.
Then, the controller 31 reads an MAC address of the target node 5 through the second port 39. An ARP(address resolution protocol) is used for this. The ARP is a protocol to match a physical address to a network address, and used to search for a physical address of a specific host, if a network address thereof is known. A subnet to which the specific host belongs can be found through the IP address, but the host itself cannot be found therethrough, so that an MAC address is required to search for the host itself on the subnet. Here, the ARP is used to search for the MAC address, if the IP address of the specific host in known.
In the MAC address converter 37, an MAC address of the target node 5 read (by requesting the ARP to the target node 5) through the second port 39 is set up as an MAC address of the first port 35.
The router 41 sets up a transmission route and transmits the data through the route. Here, the router 41 serves to transmit the data to the IP address of the target node 5 without a local loop back process, if the IP address of the target node 5, to which the data is transmitted, is the same as the IP address of the first port 35. The local loop back is used when the same processes communicate with each other within a system. That is, if the local loop back is used, a communication packet is not transmitted to an external system, and comes back into the system, when the system communicates with the external system having the same IP address as that of the first port 35, through the second port 39. In the gateway 3 according to an embodiment of the present invention, the local loop back is not used.
The data processor 47 intercepts a data stream between the network 1 and applications of the target node 5, thereby processing the data stream or making and transmitting a new data stream.
For example, if a third node needs to use data between a specific node of the network 1 and the target node 5, the data processor 47 intercepts and processes the data, without touching each setting-up of the specific node of the network 1 and the target node 5. If a communication between the specific node of the network 1 and the target node 5 is changed into a communication between the specific node of the network 1 and the third node, a communication mode of the target node 5 is different from a communication mode of the third node, so that the data processor 47 intercepts data transmitted corresponding to the target node 5 and processes the intercepted data to correspond to the third node. Further, if the third node, as a substitute for the specific node of the network 1, needs to transmit a command to the target node 5, the data processor 47 makes new data and transmits the new data to the target node 5.
Information about port numbers used by a data stream required to be processed in the data processor 47 is stored in the filter information table 45.
The filter 43 transmits only the data stream required to be processed to the data processor 47, based on the information stored in the filter information table 45.
As shown in
If the data stream is not required to be processed in the data processor 47, the data stream is not transmitted to the data processor 47, due to the filter 43, but is transmitted to the second port 30 through the router 41.
As shown in
If the data stream is not required to be processed in the data processor 47, the data stream is not transmitted to the data processor 47, due to the filter 43, but is transmitted to the first port 30 through the router 41.
As shown in
Hereinbelow, a control flow of the gateway 3 according to an embodiment of the present invention is described, referring to
If a user stores an IP address of the target node 5 in the flash memory of the gateway 3 at operation S11 and boots the system, the second port 39 is initialized at operation S13.
The controller 31 reads the IP address of the target node 5 stored in the flash memory and sets up an IP address of the second port 39 at operation S15, based on the IP address of the target node 5. For example, the IP address of the second port 39 may be set up as a number of the IP address of the target node 5 plus 1. Then, the controller 31 requests ARP to the target node 5 through the second port 39 at operation S17 and reads the MAC address of the target node 5, thereby setting up the MAC address of the target node 5 as the MAC address of the first port 35, in the MAC address converter 37, at operation S23.
The controller 31 makes the second port 39 down (deactivates) at operation S25, and then makes the first port 35 up (activates) at operation S27. The controller 31 sets up the IP address of the target node 5 as the IP address of the first port 35 at operation S29, then makes the second port 39 up again at operation S31.
If the controller 31 makes the first port 35 up and sets up the IP address of the target node 5 as the IP address of the first port 35 without making the second port 30 down, the router at first refers to the IP address of the second port 39 when the router 41 sets up a route. Therefore, the controller 31 should make the second port 39 down first, and then make the first port 35 up. Only thereafter, the controller sets up the IP address.
Then, as the IP address of the gateway 3 is in common use of the IP address of the target node 5, an additional IP address needs not to be assigned, thereby saving IP resources. Further, because the IP address of the gateway 3 and the IP address of the target node 5 are the same, an addition or an elimination of the gateway 3 between the network 1 and the target node 5 brings no change of the IP address and the MAC address on the network 1, so that a process to reset an address is not required.
Hereinbelow, it is to described how the gateway 3 processes the data stream between the network 1 and the target node 5, referring to
Information about process port numbers used by the data stream required to be processed in the data processor 47, at operation S41, is stored in the filter information table 45. If the data stream transmitted from the target node 5 or the network 1 is required to be processed in the data processor 47 at operation S43, the data stream is transmitted to the data processor 47 through the filter 43 at operation S45.
The data processor 47 intercepts and processes the data without touching each setting-up of the specific node of the network 1 and the target node 5, for example, if a third node needs to use the data between the specific node of the network 1 and the target node 5 at operation S47. Otherwise, if the communication between the specific node of the network 1 and the target node 5 is changed into a communication between the specific node of the network 1 and the third node, the communication way of the target node 5 is different from the communication way of the third node, so that the data processor 47 intercepts data transmitted corresponding to the target node 5 and processes the data to correspond to the third node at operation S47. The processed data is transmitted to the network 1 or the target node 5 through the router 41 at operation S49.
Further, if the third node, as a substitute for the specific node, needs to transmit a command to the target node 5 at operation S51, the data processor 47 makes new data and transmits the new data to the target node 5 or the network 1 at operation S55.
As described above, the present invention provides a gateway that is operated by being linked to the IP address of the target address connected to the network, and intercepts and processes a data stream between the network and the target node, thereby transmitting the data stream to the destination, and a control method of the gateway.
Although a few 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 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 |
---|---|---|---|
2003-49310 | Jul 2003 | KR | national |