Relay device, communication system, and relay method
The relay device simplifies communication between LAN and WAN devices by rewriting ARP requests and responses, eliminating the need for complex router configurations and enabling direct network communication.
Patent Information
- Application Number
- JP2023107526
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-06-29
- Publication Date
- 2025-01-17
AI Technical Summary
Existing communication systems require complex configurations involving multiple routers and hubs to relay VoIP phones between different networks, especially when there are restrictions on physical lines or global IP addresses, making the setup cumbersome.
A relay device that includes a WAN communication unit, a LAN communication unit, and an ARP control unit to simplify the configuration by rewriting ARP requests and responses, allowing direct communication between devices on different networks using a single gateway device.
Enables simplified communication between LAN and WAN devices by directly associating MAC and IP addresses, reducing the need for multiple routers and simplifying the network configuration.
Smart Images

Figure 2025006620000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to a relay device, a communication system, and a relay method. [Background technology]
[0002] In order for communication devices connected to different networks such as a LAN (Local Area Network) and a WAN (Wide Area Network) to communicate with each other, a gateway device is provided between the different networks. Patent Document 1 discloses an example of a communication device that communicates with other communication devices connected to different networks via a gateway device.
[0003] A VoIP (Voice Over Internet Protocol) telephone, which is a communication device disclosed in Patent Document 1, communicates with other communication devices connected to the Internet via a hub and a router, and communicates with other communication devices connected to a public line via a hub and a VoIP gateway. [Prior art documents] [Patent documents]
[0004] [Patent Document 1] JP 2003-169163 A Summary of the Invention [Problem to be solved by the invention]
[0005] When the VoIP phone disclosed in Patent Document 1 communicates using a private IP address, it needs to be connected to the Internet via multiple routers and hubs, and to a public line via a router, hub, and VoIP gateway. In other words, a relay device that connects a VoIP phone to a WAN needs to include multiple routers, which makes the configuration complicated. If there are limitations on the physical lines for connecting to the WAN or the available global IP addresses, it is necessary to relay communication via different subnetworks, which makes the configuration of the relay device even more complicated.
[0006] The present invention has been made in consideration of the above-mentioned circumstances, and has an object to provide a relay device, a communication system, and a relay method that are capable of relaying communications between communication devices connected to different networks with a simple configuration. [Means for solving the problem]
[0007] In order to achieve the above object, a relay device according to a first aspect of the present invention comprises: A relay device connected to a gateway device of a wide area network and a local area network, a WAN communication unit that communicates with the gateway device; A LAN communication unit connected to the local area network; an ARP control unit which, when the WAN communication unit receives an ARP (Address Resolution Protocol) request from the gateway device with an IP (Internet Protocol) address on the wide area network side assigned to the WAN communication unit set in a Target IP Address field, causes the WAN communication unit to transmit an ARP response with a MAC (Media Access Control) address of the LAN communication unit set in a Sender MAC Address field to the gateway device, and, when the LAN communication unit outputs an ARP request with an IP address on the local area network side assigned to the WAN communication unit set in a Target IP Address field, supplies the LAN communication unit with an ARP response with the MAC address of the gateway device set in a Sender MAC Address field; Equipped with.
[0008] Preferably, when the WAN communication unit receives from the gateway device an ARP request in which the wide area network side IP address of the WAN communication unit is set in the Target IP Address field, the ARP control unit rewrites the Target IP Address field of the ARP request to the IP address assigned to the LAN communication unit and sends the ARP request with the rewritten Target IP Address field to the LAN communication unit, and when the ARP control unit obtains from the LAN communication unit an ARP response in which the MAC address of the LAN communication unit is set in the Sender MAC Address field, the ARP control unit rewrites the Sender IP Address field of the ARP response to the wide area network side IP address of the WAN communication unit and transmits the ARP response with the rewritten Sender IP Address field from the WAN communication unit to the gateway device.
[0009] Preferably, when the WAN communication unit receives from the gateway device an ARP request in which the wide area network side IP address of the WAN communication unit is set in a Target IP Address field, the ARP control unit rewrites the Target IP Address field and the Sender IP Address field of the ARP request to the IP address assigned to the LAN communication unit and the IP address of the local area network side assigned to the WAN communication unit, respectively, and sends the ARP request in which the Target IP Address field and the Sender IP Address field have been rewritten to the LAN communication unit, and when the ARP control unit obtains from the LAN communication unit an ARP response in which the MAC address of the LAN communication unit is set in a Sender MAC Address field, the ARP control unit rewrites the Sender IP Address field and the Target IP Address field of the ARP response to the wide area network side IP address of the WAN communication unit and the IP address of the gateway device, respectively, and causes the ARP response in which the Sender IP Address field and the Target IP Address field have been rewritten to be transmitted from the WAN communication unit to the gateway device.
[0010] Preferably, the ARP control unit holds information indicating a MAC address of the LAN communication unit, and when the WAN communication unit receives the ARP request from the gateway device, generates an ARP response in which the MAC address of the LAN communication unit is set in the Sender MAC Address field and the wide area network side IP address of the WAN communication unit is set in the Sender IP Address field, and transmits the ARP response from the WAN communication unit to the gateway device.
[0011] Preferably, when the LAN communication unit outputs an ARP request in which the IP address of the WAN communication unit on the local area network side is set in the Target IP Address field, the ARP control unit rewrites the Target IP Address field of the ARP request to an IP address assigned to the gateway device and causes the ARP request with the Target IP Address field rewritten to be transmitted from the WAN communication unit to the gateway device, and when the WAN communication unit obtains an ARP response from the gateway device in which the MAC address of the gateway device is set in the Sender MAC Address field, the ARP control unit rewrites the Sender IP Address field of the ARP response to the IP address of the WAN communication unit on the local area network side and supplies the ARP response with the Sender IP Address field rewritten to the LAN communication unit.
[0012] Preferably, when the LAN communication unit outputs the ARP request in which the IP address of the WAN communication unit on the local area network side is set in the Target IP Address field, the ARP control unit rewrites the Target IP Address field and the Sender IP Address field of the ARP request to the IP address assigned to the gateway device and the IP address of the wide area network side assigned to the WAN communication unit, respectively, and causes the ARP request in which the Target IP Address field and the Sender IP Address field have been rewritten to be transmitted from the WAN communication unit to the gateway device, and when the WAN communication unit obtains an ARP response from the gateway device in which the MAC address of the gateway device is set in the Sender MAC Address field, the ARP control unit rewrites the Sender IP Address field and the Target IP Address field of the ARP response to the IP address of the WAN communication unit on the local area network side and the IP address assigned to the LAN communication unit, respectively, and supplies the ARP response in which the Sender IP Address field and the Target IP Address have been rewritten to the LAN communication unit.
[0013] Preferably, the ARP control unit holds information indicating a MAC address of the gateway device, and when the LAN communication unit outputs the ARP request in which the IP address of the WAN communication unit on the local area network side is set in the Target IP Address field, an ARP response is generated in which the MAC address of the gateway device is set in the Sender MAC Address field and the IP address of the WAN communication unit on the local area network side is set in the Sender IP Address field, and the ARP response is supplied to the LAN communication unit.
[0014] Preferably, the LAN communication unit has a built-in server that communicates with a WAN side communication device connected to the wide area network, and communicates with a first communication device connected to the local area network; a packet rewriting unit which, when the WAN communication unit receives from the gateway device an IP packet whose destination is an IP address assigned to the built-in server, rewrites the destination IP address of the IP packet to the IP address assigned to the LAN communication unit, and sends the IP packet with the rewritten destination IP address to the LAN communication unit, and when an IP packet output from the built-in server is obtained from the LAN communication unit, rewrites the source IP address of the IP packet to the IP address assigned to the built-in server, and sends the IP packet with the rewritten source IP address to the WAN communication unit; When the LAN communication unit acquires the IP packet whose destination has been rewritten to the own device by the packet rewriting unit, the LAN communication unit processes the IP packet in the built-in server.
[0015] A relay device according to a second aspect of the present invention comprises: A relay device connected to a gateway device of a wide area network and a local area network, a WAN communication unit that communicates with the gateway device; a LAN communication unit having an internal server that communicates with a WAN side communication device connected to the wide area network and that communicates with a first communication device connected to the local area network; a packet rewriting unit which, when the WAN communication unit receives from the gateway device an IP packet whose destination is an IP address assigned to the built-in server, rewrites the destination IP address of the IP packet to the IP address assigned to the LAN communication unit, and sends the IP packet with the rewritten destination IP address to the LAN communication unit, and, when an IP packet output from the built-in server is obtained from the LAN communication unit, rewrites the source IP address of the IP packet to the IP address assigned to the built-in server, and sends the IP packet with the rewritten source IP address to the WAN communication unit, When the LAN communication unit acquires the IP packet whose destination has been rewritten to the own device by the packet rewriting unit, the LAN communication unit processes the IP packet in the built-in server.
[0016] Preferably, the network further comprises a packet management unit that adds a mark to the IP packet output from the built-in server.
[0017] Preferably, when the WAN communication unit receives the IP packet having the IP address of the built-in server set as a destination from the gateway device, the packet management unit attaches a mark to the IP packet; The packet rewriting unit rewrites the destination IP address of the IP packet, which the WAN communication unit receives from the gateway device and which has been marked by the packet management unit, to an IP address assigned to the LAN communication unit, and rewrites the source IP address of the IP packet, which has been output from the built-in server and which has been marked by the packet management unit, to an IP address assigned to the built-in server.
[0018] Preferably, the built-in server communicates with the WAN side communication device and a second communication device connected to the local area network different from the first communication device; The LAN communication unit relays data communication of the first communication device, and relays voice communication of the second communication device via the built-in server.
[0019] A communication system according to a third aspect of the present invention comprises: A WAN side communication device connected to a wide area network; a gateway device that communicates with the WAN side communication device via the wide area network; the relay device connected to the gateway device and a local area network; A LAN side communication device connected to the local area network; Equipped with.
[0020] A relay method according to a fourth aspect of the present invention comprises: A relay method performed by a relay device including a WAN communication unit connected to a gateway device of a wide area network and a local area network and communicating with the gateway device, and a LAN communication unit connected to the local area network, comprising: When an ARP request is received from the gateway device with the wide area network side IP address assigned to the WAN communication unit set in the Target IP Address field, an ARP response with the MAC address of the LAN communication unit set in the Sender MAC Address field is sent to the gateway device, and when an ARP request with the local area network side IP address assigned to the WAN communication unit set in the Target IP Address field is output from the LAN communication unit, an ARP response with the MAC address of the gateway device set in the Sender MAC Address field is supplied to the LAN communication unit.
[0021] A relay method according to a fifth aspect of the present invention comprises: A relay method performed by a relay device including: a WAN communication unit connected to a gateway device of a wide area network and a local area network and communicating with the gateway device; and a LAN communication unit connected to the local area network, having a built-in server that communicates with a WAN side communication device connected to the wide area network, and communicating with a first communication device connected to the local area network, the relay method comprising: When an IP packet with the IP address assigned to the built-in server set as its destination is received from the gateway device, the destination IP address of the IP packet is rewritten to the IP address assigned to the LAN communication unit, When an IP packet generated by the built-in server is acquired, the source IP address of the IP packet is rewritten to an IP address assigned to the built-in server, and the IP packet with the rewritten source IP address is transmitted to the gateway device. Effect of the Invention
[0022] The ARP control unit provided in the relay device according to the present invention outputs an ARP response including the MAC address of the LAN communication unit in response to an ARP request in which the WAN side IP address of the WAN communication unit is set in the Target IP Address field, and outputs an ARP response including the MAC address of the gateway device in response to an ARP request in which the LAN side IP address of the WAN communication unit is set in the Target IP Address field. As a result, the gateway device and the LAN communication unit can communicate directly based on the MAC addresses, and it is possible to provide a relay device, communication system, and relay method that can relay communications between communication terminals connected to different networks with a simple configuration. [Brief description of the drawings]
[0023] [Figure 1] FIG. 1 is a block diagram showing a configuration of a communication system according to a first embodiment. [Diagram 2] FIG. 1 is a sequence diagram showing an example of an address resolution process performed by a relay device according to a first embodiment; [Diagram 3] FIG. 1 is a diagram showing an example of a routing table included in a gateway device according to a first embodiment; [Figure 4] FIG. 1 is a diagram showing an example of an ARP request used in an address resolution process performed by a relay device according to a first embodiment; [Diagram 5] FIG. 1 is a diagram showing an example of an ARP request used in an address resolution process performed by a relay device according to a first embodiment; [Figure 6] FIG. 13 is a diagram showing an example of an ARP response used in the address resolution process performed by the relay device according to the first embodiment; [Figure 7] FIG. 13 is a diagram showing an example of an ARP response used in the address resolution process performed by the relay device according to the first embodiment; [Figure 8] FIG. 1 shows an example of an IP packet transmitted and received in a relay device according to the first embodiment. [Figure 9] FIG. 11 is a sequence diagram showing another example of the address resolution process performed by the relay device according to the first embodiment; [Figure 10] FIG. 1 is a block diagram showing a configuration of a modified example of a communication system according to the first embodiment. [Figure 11] FIG. 11 is a sequence diagram showing another example of the address resolution process performed by the relay device according to the first embodiment; [Figure 12] FIG. 11 is a sequence diagram showing another example of the address resolution process performed by the relay device according to the first embodiment; [Figure 13] FIG. 11 is a block diagram showing a configuration of a communication system according to a second embodiment. [Figure 14] FIG. 11 is a diagram showing an example of a routing table included in a gateway device according to a second embodiment; [Figure 15] FIG. 11 is a sequence diagram showing an example of a packet rewriting process performed by a relay device according to a second embodiment. [Figure 16] FIG. 11 is a block diagram showing a configuration of a communication system according to a third embodiment. [Figure 17] FIG. 11 is a sequence diagram showing an example of address resolution and packet rewriting processing performed by a relay device according to a third embodiment. [Figure 18]FIG. 11 is a sequence diagram showing another example of the address resolution and packet rewriting process performed by the relay device according to the third embodiment. [Figure 19] FIG. 11 is a block diagram showing a modified example of the configuration of a communication system according to the third embodiment. [Figure 20] 1 is a block diagram showing a hardware configuration of a relay device according to an embodiment; [Figure 21] FIG. 1 is a block diagram showing a modification of the hardware configuration of a relay device according to an embodiment; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0024] Hereinafter, a relay device, a communication system, and a relay method according to an embodiment of the present invention will be described in detail with reference to the drawings, in which the same or equivalent parts are given the same reference numerals.
[0025] (Embodiment 1) 1 enables communication between LAN side communication devices 22a, 22b, and 22c connected to a LAN (Local Area Network) 21 and a WAN side communication device 52 connected to a WAN (Wide Area Network) 31 via the Internet 51. In the first embodiment, the LAN side communication devices 22a-22c and the WAN side communication device 52 perform data communication.
[0026] The communication system 101 performs communication according to TCP (Transmission Control Protocol) / IP (Internet Protocol). The LAN 21 is configured, for example, by Ethernet (registered trademark). The communication system 101 includes a gateway device 41 and a relay device 1 to enable communication between LAN side communication devices 22a-22c connected to the LAN 21 and a WAN side communication device 52 connected to the WAN 31 via the Internet 51.
[0027] The gateway device 41 transfers IP packets between different networks, specifically, between WAN 31 and LAN 21, thereby enabling communication between WAN side communication device 52 connected to WAN 31 and LAN side communication devices 22a-22c connected to LAN 21.
[0028] The relay device 1 is connected to the LAN 21 and a gateway device 41 of the WAN 31. The relay device 1 includes a WAN communication unit 11, a LAN communication unit 12, and an ARP control unit 13.
[0029] The WAN communication unit 11 communicates with the gateway device 41. In the first embodiment, the WAN communication unit 11 is connected to the gateway device 41 by a single communication line. The WAN communication unit 11 transmits packets acquired from the gateway device 41 to the ARP control unit 13. The packets acquired from the gateway device 41 include ARP packets, specifically, ARP requests and ARP responses, IP packets, etc. The WAN communication unit 11 transmits the ARP packets acquired from the ARP control unit 13 to the gateway device 41.
[0030] The LAN communication unit 12 performs address conversion based on NAPT (Network Address Port Translation) to enable the LAN side communication devices 22a-22c connected to the LAN 21 to communicate with the WAN side communication device 52.
[0031] The ARP control unit 13 allows the WAN communication unit 11 to transmit an ARP response in response to the ARP request sent from the gateway device 41 to the relay device 1, and supplies an ARP response in response to the ARP request output from the LAN communication unit 12 to the LAN communication unit 12, thereby enabling transmission and reception of IP packets between the gateway device 41 and the LAN communication unit 12. The ARP control unit 13 processes only ARP packets. In other words, the ARP control unit 13 does not process packets other than ARP packets, but transfers them to the WAN communication unit 11 or the LAN communication unit 12.
[0032] The gateway device 41 connected to the WAN 31 and the relay device 1 connected to the WAN 31 via the gateway device 41 are assigned IP addresses by the telecommunications carrier that provides the WAN 31. For example, the IP address of the gateway device 41 is 198.51.100.2. The IP address of the WAN communication unit 11 on the WAN 31 side is 198.51.100.1. The gateway device 41 and the WAN communication unit 11 are connected to the same sub-network. The IP address of the WAN communication unit 11 on the LAN 21 side is 192.0.2.2. The IP address of the LAN communication unit 12 on the relay device 1 is 192.0.2.1. The WAN communication unit 11 and the LAN communication unit 12 are connected to the same sub-network.
[0033] When the WAN side communication device 52 requests communication with the LAN side communication devices 22a-22c, the WAN side communication device 52 generates an IP packet including the IP address 203.0.113.10 assigned to the device itself as a source IP address and the IP address 192.0.2.1 assigned to the LAN communication unit 12 to which the LAN side communication devices 22a-22c are connected as a destination IP address. The WAN side communication device 52 holds information on the IP address of the LAN communication unit 12, which is the destination, in advance. The WAN side communication device 52 refers to a routing table and searches for a transfer destination corresponding to the destination IP address, that is, the IP address of the next hop. The routing table is a table in which a destination network, which is a network to which the destination communication device belongs, and an IP address of the next hop are stored in association with each other. The WAN side communication device 52 transmits the IP packet to a device having the IP address of the transfer destination that has been searched for, for example, a default gateway. Thereafter, the IP packet transmitted by the WAN side communication equipment 52 to the destination IP address is transmitted to the gateway device 41 via the Internet 51 and the WAN 31 .
[0034] In the communication system 101, address resolution based on ARP (Address Resolution Protocol) is performed to forward the IP packet. The relay device 1 rewrites the ARP packet during address resolution. In detail, when the gateway device 41 receives a forwarding request from the WAN side communication device 52 as shown in FIG. 2, specifically, an IP packet whose destination is set to another device (sequence Sq1), the gateway device 41 refers to the routing table shown in FIG. 3 and searches for the IP address of the next hop corresponding to the destination IP address of the forwarding request. The gateway device 41 obtains the IP address of the next hop 198.51.100.1 corresponding to the destination IP address 192.0.2.1 of the forwarding request by referring to the routing table shown in FIG. 3.
[0035] The gateway device 41 refers to the ARP table and searches for a MAC (Media Access Control) address corresponding to the IP address of the next hop. The ARP table is a table in which IP addresses and MAC addresses are stored in association with each other. If the MAC address is not found, the gateway device 41 generates an ARP request (sequence Sq2). The IP address set in the Target IP Address field of the ARP request is the IP address of the next hop.
[0036] Since the IP address of the LAN communication unit 12, which is the destination of the IP packet, is 192.0.2.1, 198.51.100.1, which is the next hop associated with 192.0.2.1 in the routing table shown in Fig. 3, is set in the Target IP Address field of the ARP request generated in sequence Sq2 of Fig. 2. The IP address set in the Target IP Address field is the IP address 198.51.100.1 on the WAN 31 side of the WAN communication unit 11, as shown in Fig. 1. The main parts of the ARP request generated in sequence Sq2 of Fig. 2 are shown in Fig. 4.
[0037] 4, the ARP request contains the IP address 198.51.100.2 of the gateway device 41 in the Sender IP Address field, and the MAC address 00:00:5e:00:53:01 of the gateway device 41 in the Sender MAC Address field. The ARP request contains the IP address 198.51.100.1 of the WAN 31 side of the WAN communication unit 11 in the Target IP Address field. Since the ARP request is used to inquire about a MAC address, no value is set in the Target MAC Address field.
[0038] As shown in FIG. 2, the gateway device 41 transmits the ARP request generated in sequence Sq2 to the WAN communication unit 11 (sequence Sq3). The WAN communication unit 11 transmits the ARP request acquired from the gateway device 41 to the ARP control unit 13 (sequence Sq4). The ARP control unit 13 rewrites the Target IP Address field and the Sender IP Address field of the ARP request to the IP address 192.0.2.1 assigned to the LAN communication unit 12 and the IP address 192.0.2.2 on the LAN 21 side assigned to the WAN communication unit 11, respectively (sequence Sq5). The main part of the ARP request rewritten as described above is shown in FIG. 5. As shown in FIG. 2, the ARP control unit 13 transmits the ARP request rewritten as described above to the LAN communication unit 12 (sequence Sq6).
[0039] When the LAN communication unit 12 receives the ARP request, it generates an ARP response including its own MAC address 00:00:5e:00:53:78 (sequence Sq7). The main part of the ARP response generated in sequence Sq7 is shown in FIG. 6. The IP address 192.0.2.1 and MAC address 00:00:5e:00:53:78 of the LAN communication unit 12 are set in the Sender IP Address field and the Sender MAC Address field of the ARP response, respectively. The values of the Target IP Address field and the Target MAC Address field of the ARP response match the values of the Sender IP Address field and the Sender MAC Address field of the ARP request, respectively. As shown in FIG. 2, the LAN communication unit 12 sends the ARP response generated in sequence Sq7 to the ARP control unit 13 (sequence Sq8).
[0040] When the ARP control unit 13 receives an ARP response from the LAN communication unit 12 in which the MAC address of the LAN communication unit 12 is set in the Sender MAC Address field, the ARP control unit 13 rewrites the Sender IP Address field and the Target IP Address field of the ARP response to the IP address 198.51.100.1 of the WAN communication unit 11 on the WAN 31 side and the IP address 198.51.100.2 assigned to the gateway device 41, respectively (sequence Sq9). The main part of the ARP response rewritten as described above is shown in Fig. 7. As shown in Fig. 2, the ARP control unit 13 sends the ARP response rewritten as described above to the WAN communication unit 11 (sequence Sq10).
[0041] The WAN communication unit 11 sends the ARP response acquired from the ARP control unit 13 to the gateway device 41 (sequence Sq11). When the gateway device 41 acquires the ARP response shown in Fig. 7, it stores the IP address 198.51.100.1 and the MAC address 00:00:5e:00:53:78 in the ARP table in association with each other. As a result, the IP address of the WAN communication unit 11 on the WAN 31 side and the MAC address of the LAN communication unit 12 are stored in the ARP table in association with each other.
[0042] The gateway device 41 adds an Ethernet header to the IP packet acquired from the WAN side communication equipment 52 in sequence Sq1, the Ethernet header including the MAC address of the LAN communication unit 12 indicated by the ARP response acquired in sequence Sq11 as the destination MAC address and the MAC address of the gateway device 41 as the source MAC address (sequence Sq12). The Ethernet header is a header conforming to the communication standard of the LAN 21. The IP packet with the Ethernet header added is shown in FIG. 8.
[0043] 2, the gateway device 41 sends the IP packet with the Ethernet header added to the LAN communication unit 12 included in the relay device 1 (sequence Sq13). Since the MAC address of the LAN communication unit 12 is specified in the IP packet with the Ethernet header added, there is no need for the WAN communication unit 11 to reset the Ethernet header. For this reason, the WAN communication unit 11 transfers the acquired IP packet to the ARP control unit 13 without performing any processing. The ARP control unit 13 transfers packets other than the ARP request and ARP response acquired from the WAN communication unit 11 to the LAN communication unit 12 without performing the above-mentioned rewriting processing. As a result, the IP packet with the Ethernet header added in sequence Sq12 can be considered to be directly transmitted from the gateway device 41 to the LAN communication unit 12.
[0044] When the LAN side communication devices 22a-22c request communication with the WAN side communication device 52, the IP addresses of the ARP request and ARP response are similarly rewritten by the ARP control unit 13. In detail, as shown in Fig. 9, when the LAN communication unit 12 receives a transfer request from any of the LAN side communication devices 22a-22c (sequence Sq21), it refers to the routing table and searches for the next hop IP address corresponding to the destination IP address of the transfer request. The LAN communication unit 12 refers to the ARP table and searches for the MAC address corresponding to the next hop IP address. If the MAC address is not found, the LAN communication unit 12 generates an ARP request (sequence Sq22).
[0045] The ARP request includes the IP address 192.0.2.1 of the LAN communication unit 12 in the Sender IP Address field, and the MAC address 00:00:5e:00:53:78 of the LAN communication unit 12 in the Sender MAC Address field. The ARP request includes the IP address 192.0.2.2 of the WAN communication unit 11 on the LAN 21 side in the Target IP Address field.
[0046] The LAN communication unit 12 transmits the ARP request generated in sequence Sq22 to the ARP control unit 13 (sequence Sq23). The ARP control unit 13 rewrites the Target IP Address field and the Sender IP Address field of the ARP request to the IP address 198.51.100.2 assigned to the gateway device 41 and the IP address 198.51.100.1 on the WAN 31 side assigned to the WAN communication unit 11, respectively (sequence Sq24). The ARP control unit 13 sends the ARP request rewritten as described above to the WAN communication unit 11 (sequence Sq25). The WAN communication unit 11 transmits the ARP request acquired from the ARP control unit 13 to the gateway device 41 (sequence Sq26).
[0047] When the gateway device 41 receives the ARP request, it generates an ARP response including its own MAC address 00:00:5e:00:53:01 (sequence Sq27). The IP address 198.51.100.2 and MAC address 00:00:5e:00:53:01 of the gateway device 41 are set in the Sender IP Address field and the Sender MAC Address field of the ARP response, respectively. The Target IP Address field and the Target MAC Address field of the ARP response match the contents of the Sender IP Address field and the Sender MAC Address field of the ARP request, respectively. The gateway device 41 transmits the ARP response generated in sequence Sq27 to the WAN communication unit 11 (sequence Sq28).
[0048] When the WAN communication unit 11 receives the ARP response, it transmits the received ARP response to the ARP control unit 13 (sequence Sq29). When the ARP control unit 13 receives an ARP response from the WAN communication unit 11 with the MAC address of the gateway device 41 set in the Sender MAC Address field, it rewrites the Sender IP Address field and the Target IP Address field of the ARP response to the IP address 192.0.2.2 on the LAN 21 side of the WAN communication unit 11 and the IP address 192.0.2.1 assigned to the LAN communication unit 12, respectively (sequence Sq30). The ARP control unit 13 transmits the ARP response rewritten as described above to the LAN communication unit 12 (sequence Sq31).
[0049] When the LAN communication unit 12 receives the ARP response, the LAN communication unit 12 stores the IP address 192.0.2.2 and the MAC address 00:00:5e:00:53:01 in association with each other in the ARP table. As a result, the IP address of the WAN communication unit 11 on the LAN 21 side and the MAC address of the gateway device 41 are stored in association with each other in the ARP table.
[0050] The LAN communication unit 12 adds an Ethernet header to the IP packet acquired from one of the LAN side communication devices 22a-22c in sequence Sq21, the Ethernet header including the MAC address of the gateway device 41 indicated in the ARP response acquired in sequence Sq31 as the destination MAC address and the MAC address of the LAN communication unit 12 as the source MAC address (sequence Sq32).
[0051] The LAN communication unit 12 sends the IP packet with the Ethernet header added to the gateway device 41 (sequence Sq33). The ARP control unit 13 transfers packets other than the ARP request and ARP response acquired from the LAN communication unit 12 to the WAN communication unit 11 without performing the above-mentioned rewriting process. Since the MAC address of the gateway device 41 is specified in the IP packet with the Ethernet header added, it is not necessary for the WAN communication unit 11 to reset the Ethernet header. Therefore, the WAN communication unit 11 transfers the acquired IP packet to the gateway device 41 without performing any process. As a result, the IP packet with the Ethernet header added in sequence Sq32 can be regarded as being sent directly from the LAN communication unit 12 to the gateway device 41.
[0052] As described above, according to the relay device 1 of the first embodiment, the ARP control unit 13 rewrites the fields of the ARP request and ARP response, so that it is possible to relay communication between the LAN side communication devices 22a-22c and the WAN side communication device 52, which are connected to different networks, without having to provide multiple routers. In other words, it is possible to obtain a relay device 1 that is capable of relaying communication between the LAN side communication devices 22a-22c and the WAN side communication device 52 with a simple configuration.
[0053] The relay device 1 according to the first embodiment can be modified in various ways in addition to those described above. First, the configuration of the relay device 1 is not limited to the above example. As an example, as shown in Fig. 10, the relay device 1 relays communication between the first communication devices 24a, 24b, and 24c, which are an example of the LAN side communication devices connected to the LAN 21, and the WAN side communication device 52. The relay device 1 relays communication between the second communication devices 25a and 25b, which are another example of the LAN side communication devices and are connected to the LAN 23 different from the first communication devices 24a, 24b, and 24c, and the WAN side communication device 54.
[0054] The LAN communication unit 12 includes a built-in server 15 that communicates with the WAN side communication device 54, and a routing unit 14 that performs routing processing and transmits / receives data to / from the first communication devices 24a-24c.
[0055] For example, the first communication devices 24a-24c and the WAN side communication device 52 perform data communication, and the second communication devices 25a, 25b, which are IP telephones, and the WAN side communication device 54 perform voice communication.
[0056] The built-in server 15 is, for example, a Session Initiation Protocol (SIP) server, and relays voice communication of the second communication devices 25a and 25b. The second communication devices 25a and 25b communicate with a WAN side communication device 54 connected to the WAN 31 via a SIP server 53, via a relay device 1 equipped with the built-in server 15 and a gateway device 41. The SIP server 53 is an example of a WAN side communication device connected to the WAN 31, and is for realizing voice communication.
[0057] The address resolution process in the communication system 101 shown in Fig. 10 is the same as that in the above example. After address resolution, the routing unit 14 sends the voice communication packets acquired from the WAN communication unit 11 via the ARP control unit 13 to the built-in server 15. The built-in server 15 generates packets for performing voice communication via the LAN 23 from the voice communication packets acquired from the routing unit 14, and sends the packets to the second communication devices 25a and 25b. After address resolution, the routing unit 14 sends the data communication packets acquired from the WAN communication unit 11 via the ARP control unit 13 to the first communication devices 24a-24c.
[0058] In detail, if the destination IP address of the packet acquired from the WAN communication unit 11 is the IP address of the own device, that is, the LAN communication unit 12, the routing unit 14 refers to information in the data area of the IP packet, for example, the destination port number in the TCP header or UDP (User Datagram Protocol) header included in the data area, and transfers the IP packet to one of the first communication devices 24a-24c and the built-in server 15. As an example, the routing unit 14 determines whether the IP packet is related to NAPT communication from the destination port number in the TCP header or UDP header. The routing unit 14 transfers the IP packet related to NAPT communication to one of the first communication devices 24a-24c. The routing unit 14 transmits the IP packet not related to NAPT communication to the built-in server 15.
[0059] The routing unit 14 may transmit to the first communication devices 24a, 24b, and 24c an IP packet that does not include a SIP header in the data area, and transmit to the built-in server 15 an IP packet that includes a SIP header in the data area.
[0060] The built-in server 15 and the SIP server 53 are not limited to processing data based on SIP, and may be servers that process data based on SIP and data based on RTP (Real-time Transport Protocol).
[0061] Secondly, the rewriting by the ARP control unit 13 may be performed based on a pre-stored MAC address. In detail, as shown in Fig. 11, in response to an ARP request from the gateway device 41, the ARP control unit 13 generates an ARP response based on the stored MAC address and transmits the ARP response to the gateway device 41. In Fig. 11, the processing of sequences Sq1-Sq4 and sequences Sq10-Sq13 is similar to the processing of sequences Sq1-Sq4 and sequences Sq10-Sq13 shown in Fig. 2.
[0062] When the ARP control unit 13 receives the ARP request transmitted in sequence Sq4, it generates an ARP response in which the MAC address and IP address associated with the value of the Target IP Address field of the ARP request are set in the Sender MAC Address field and the Sender IP Address field, respectively (sequence Sq14). Specifically, the ARP control unit 13 associates the MAC address 00:00:5e:00:53:78 of the LAN communication unit 12 with the IP address 198.51.100.1 and stores them in advance.
[0063] When the ARP control unit 13 receives an ARP request with a Target IP Address field value of 198.51.100.1, it generates an ARP response including a MAC address 00:00:5e:00:53:78 corresponding to the IP address 198.51.100.1. The IP address 198.51.100.1 on the WAN 31 side of the WAN communication unit 11, which is the value of the Target IP Address field of the ARP request, and the MAC address 00:00:5e:00:53:78 corresponding to the value of the Target IP Address field of the ARP request, are set in the Sender IP Address field and the Sender MAC Address field of the ARP response, respectively. The ARP control unit 13 sends the ARP response generated in sequence Sq14 to the WAN communication unit 11 (sequence Sq10). Subsequent processing is the same as that in FIG. 2.
[0064] 12, in response to an ARP request from the LAN communication unit 12, the ARP control unit 13 generates an ARP response based on the stored MAC address and transmits the ARP response to the LAN communication unit 12. In Fig. 12, the processing of sequences Sq21-23 and sequences Sq31-Sq33 is similar to the processing of sequences Sq21-23 and sequences Sq31-Sq33 shown in Fig. 9.
[0065] When the ARP control unit 13 receives the ARP request transmitted in sequence Sq23, it generates an ARP response in which the MAC address and IP address associated with the value of the Target IP Address field of the ARP request are set in the Sender MAC Address field and the Sender IP Address field, respectively (sequence Sq34). Specifically, the ARP control unit 13 associates the MAC address 00:00:5e:00:53:01 of the gateway device 41 with the IP address 192.0.2.2 and stores them in advance.
[0066] When the ARP control unit 13 receives an ARP request with a Target IP Address field value of 192.0.2.2, it generates an ARP response including a MAC address 00:00:5e:00:53:01 corresponding to the IP address 192.0.2.2. The IP address 192.0.2.2 on the LAN 21 side of the WAN communication unit 11, which is the value of the Target IP Address field of the ARP request, and the MAC address 00:00:5e:00:53:01 of the gateway device 41, which is the value of the Target IP Address field of the ARP request, are set in the Sender IP Address field and the Sender MAC Address field of the ARP response, respectively. The ARP control unit 13 sends the ARP response generated in sequence Sq34 to the LAN communication unit 12 (sequence Sq31). Subsequent processing is the same as that in FIG. 9.
[0067] Thirdly, the communication system 101 may perform communication in accordance with Internet Protocol Version 6 (IPv6) instead of IPv4 (Internet Protocol Version 4).
[0068] (Embodiment 2) The method of relaying communication between communication devices connected to different networks is not limited to the above example. Fig. 13 shows a communication system 102 that relays data communication between first communication devices 24a, 24b, 24c, which are examples of LAN side communication devices, and a WAN side communication device 52, and enables voice communication between second communication devices 25a, 25b, which are examples of LAN side communication devices, and a WAN side communication device 54.
[0069] The relay device 2 included in the communication system 102 includes a packet rewriting unit 16 that rewrites the IP address of an IP packet and a packet management unit 17 that adds a mark to an IP packet, instead of the ARP control unit 13 included in the relay device 1 according to the first embodiment shown in Fig. 1. The LAN communication unit 12 includes a built-in server 15 that transmits and receives data to and from the second communication devices 25a and 25b, and a routing unit 14 that performs routing processing and communicates with the first communication devices 24a-24c, just like the relay device 1 shown in Fig. 10. Unlike the example of Fig. 10, an IP address is assigned to the built-in server 15. For example, the IP address 192.0.2.1 is assigned to the LAN communication unit 12, and the IP address 192.0.2.33 is assigned to the built-in server 15.
[0070] When the WAN communication unit 11 receives an IP packet from the gateway device 41, the packet rewriting unit 16 rewrites the destination IP address of the IP packet to the IP address assigned to the LAN communication unit 12, and sends it to the LAN communication unit 12.
[0071] When the packet rewriting unit 16 obtains an IP packet output from the built-in server 15 via the LAN communication unit 12 , it rewrites the source IP address of the IP packet to the IP address assigned to the built-in server 15 and sends the packet to the WAN communication unit 11 .
[0072] The packet management unit 17 puts a mark on the IP packet output from the built-in server 15. The packet management unit 17 puts a mark on the pointer of the memory where the packet is stored. It is preferable that the packet management unit 17 puts a mark on the IP packet that the WAN communication unit 11 receives from the gateway device 41 and whose destination is set to an IP address assigned to the built-in server 15. At this time, the packet rewriting unit 16 may rewrite the destination IP address or the source IP address of the IP packet that has been put with the mark by the packet management unit 17.
[0073] For each device in the communication system 102, an IP address is assigned as shown in FIG. 13. In the communication system 102, address resolution is performed based on ARP. For example, when the gateway device 41 receives a transfer request from the SIP server 53, it refers to the routing table shown in FIG. 14 and searches for the next hop IP address corresponding to the destination IP address of the transfer request. When the destination IP address of the transfer request is the IP address 192.0.2.33 assigned to the built-in server 15, the gateway device 41 obtains the next hop IP address 198.51.100.1. The gateway device 41 refers to the ARP table and searches for the MAC address corresponding to the next hop IP address. If the MAC address is not found, the gateway device 41 generates and transmits an ARP request.
[0074] When the WAN communication unit 11 receives an ARP request from the gateway device 41, the WAN communication unit 11 generates an ARP response in which the IP address and MAC address of the WAN communication unit 11 are set in the Sender IP Address field and the Sender MAC Address field, and transmits the ARP response to the gateway device 41. The WAN communication unit 11 is assigned an IP address and a MAC address on the WAN 31 side and an IP address and a MAC address on the LAN 21 side. For example, the WAN communication unit 11 generates and transmits an ARP response in which the WAN 31 side IP address 198.51.100.1 of the WAN communication unit 11 and the WAN 31 side MAC address 00:00:5e:00:53:34 of the WAN communication unit 11 are set in the Sender IP Address field and the Sender MAC Address field, respectively.
[0075] 15, when the gateway device 41 receives the ARP response, it adds an Ethernet header including the MAC address indicated in the ARP response to the transfer request, and transmits the IP packet with the Ethernet header added to the WAN communication unit 11 (sequence Sq41). In the example of FIG. 15, the gateway device 41 sets an Ethernet header for the transfer request of the IP packet addressed to the built-in server 15 from the SIP server 53.
[0076] The WAN communication unit 11, which has received the above IP packet, refers to a routing table based on the destination IP address of the IP packet to search for the IP address of the next hop corresponding to the destination IP address. The WAN communication unit 11 refers to an ARP table to search for a MAC address corresponding to the IP address of the next hop. If the MAC address is not found, the WAN communication unit 11 generates and transmits an ARP request. For example, it is assumed that 192.0.2.1 is stored as the next hop corresponding to the destination network 192.0.2.32 / 30 in the routing table referred to by the WAN communication unit 11. The WAN communication unit 11 sends an ARP request to the routing unit 14 provided in the LAN communication unit 12, in which the IP address 192.0.2.2 on the LAN 21 side of the WAN communication unit 11, the MAC address 00:00:5e:00:53:56 on the LAN 21 side of the WAN communication unit 11, and the IP address 192.0.2.1 are set in the Sender IP Address field, the Sender MAC Address field, and the Target IP Address field, respectively.
[0077] When the routing unit 14 receives the above-mentioned ARP request, it generates an ARP response in which the IP address and MAC address of the LAN communication unit 12 are set in the Sender IP Address field and the Sender MAC Address field, respectively, and sends the ARP response to the WAN communication unit 11. When the WAN communication unit 11 receives the ARP response, it sets an Ethernet header including the MAC address indicated in the ARP response in the IP packet obtained from the gateway device 41, and sends the IP packet to the packet rewriting unit 16 (sequence Sq42).
[0078] The packet management unit 17 monitors packets output by the WAN communication unit 11, and assigns a mark to packets whose destination IP address includes an IP address assigned to the built-in server 15. In detail, the packet management unit 17 assigns a mark to IP packets whose destination IP address is 192.0.2.33.
[0079] The packet rewriting unit 16 rewrites the destination IP address of the IP packet addressed to the built-in server 15, specifically, the IP packet marked by the packet management unit 17 (sequence Sq43). In detail, the packet rewriting unit 16 rewrites the destination IP address from 192.0.2.33 to the IP address 192.0.2.1 assigned to the LAN communication unit 12.
[0080] The packet rewriting unit 16 sends the rewritten IP address to the LAN communication unit 12 (sequence Sq44). If the IP packet sent in sequence Sq44 has been marked by the packet management unit 17, the routing unit 14 included in the LAN communication unit 12 transfers the IP packet to the built-in server 15 (sequence Sq45).
[0081] The built-in server 15 processes the IP packet, for example, generates an IP packet to be sent to the second communication device 25a or the second communication device 25b, sends the IP packet, and receives the IP packet from the second communication device 25a or the second communication device 25b (sequence Sq46). Upon receiving the IP packet from the second communication device 25a or the second communication device 25b, the built-in server 15 generates an IP packet to be sent to the WAN 31, and transfers the IP packet to the routing unit 14 (sequence Sq47).
[0082] The routing unit 14 transmits the IP packet output by the built-in server 15 to the packet rewriting unit 16 (sequence Sq48). At this time, the source IP address of the IP packet transmitted to the packet rewriting unit 16 is set to the IP address 192.0.2.1 assigned to the LAN communication unit 12.
[0083] The packet management unit 17 assigns a mark to the IP packet output from the built-in server 15 .
[0084] The packet rewriting unit 16 rewrites the source IP address of an IP packet output from the built-in server 15 and having the IP address assigned to the LAN communication unit 12 set as the source IP address, specifically, an IP packet marked by the packet management unit 17 (sequence Sq49). In detail, the packet rewriting unit 16 rewrites the source IP address from 192.0.2.1 to the IP address 192.0.2.33 assigned to the built-in server 15.
[0085] The packet rewriting unit 16 transmits the IP packet with the rewritten IP address to the WAN communication unit 11 (sequence Sq50). The WAN communication unit 11 transmits the IP packet transmitted in sequence Sq50 to the gateway device 41 (sequence Sq51). The gateway device 41 transmits the IP packet acquired in sequence Sq51 to the SIP server 53 via the WAN 31. Since the IP address of 192.0.2.33 assigned to the built-in server 15 is set as the source IP address, the SIP server 53 can perform voice communication with the IP address of 192.0.2.33 assigned to the built-in server 15 as the destination.
[0086] As described above, according to the relay device 2 of the second embodiment, even if the relay device 2 has only one IP address on the WAN 31 side assigned by the telecommunications carrier, by rewriting the IP address, it is possible to relay communications between communication devices connected to different LANs 21, 23, specifically, data communications of first communication devices 24a-24c connected to LAN 21 and voice communications of second communication devices 25a, 25b connected to LAN 23. The configuration of the relay device 2 is simpler than the configuration of a relay device that has a communication line for data communications and a communication line for voice communications, each of which is assigned an IP address.
[0087] The relay device 2 according to the second embodiment can be modified in various ways in addition to those described above. First, the built-in server 15 is not limited to a SIP server. If the built-in server 15 is not a SIP server, the process of sequence Sq46 in FIG. 15 does not have to be executed.
[0088] Secondly, the method of marking by the packet management unit 17 is not limited to the above example. As an example, the packet management unit 17 may mark only IP packets output from the built-in server 15, and may not mark IP packets acquired from the WAN communication unit 11. In this case, the packet rewriting unit 16 may rewrite the destination IP address of IP packets acquired from the WAN communication unit 11, the destination IP address of which is set to the IP address assigned to the built-in server 15, and rewrite the source IP address of IP packets to which a mark has been added. As another example, the packet management unit 17 monitors IP packets output by the LAN communication unit 12, and adds a mark to IP packets in which a SIP header is set in the data area.
[0089] The modifications described in the first embodiment can also be applied to the second embodiment. Specifically, the built-in server 15 and the SIP server 53 are not limited to processing data based on SIP, and may be servers that process data based on SIP and data based on RTP. Also, the communication system 102 is not limited to processing data based on IPv4, and may perform communication according to IPv6.
[0090] (Embodiment 3) The relay device 1 according to the first embodiment and the relay device 2 according to the second embodiment can be combined. The relay device 3 included in the communication system 103 according to the third embodiment shown in Fig. 16 includes a packet rewriting unit 16 and a packet management unit 17 included in the relay device 2, in addition to the configuration of the relay device 1. The LAN communication unit 12 included in the relay device 3 has the same configuration as the LAN communication unit 12 included in the relay device 2. For each device in the communication system 103, an IP address is set as shown in Fig. 16, for example.
[0091] The relay device 3 rewrites the ARP request and ARP response performed by the relay device 1 according to the first embodiment, and rewrites the IP packet performed by the relay device 2 according to the second embodiment.
[0092] Address resolution and IP packet transfer in the communication system 103 will be described taking as an example a case where the WAN side communication device 54 requests communication with the second communication device 25a or 25b connected to the built-in server 15.
[0093] As shown in Fig. 17, when the gateway device 41 receives a forwarding request (sequence Sq61), it refers to the routing table shown in Fig. 14 and searches for the IP address of the next hop corresponding to the destination IP address of the forwarding request. The gateway device 41 refers to the ARP table and searches for the MAC address corresponding to the IP address of the next hop. If the MAC address is not found, the gateway device 41 generates an ARP request (sequence Sq62).
[0094] The ARP request includes the IP address 198.51.100.2 of the gateway device 41 in the Sender IP Address field, and the MAC address 00:00:5e:00:53:01 of the gateway device 41 in the Sender MAC Address field. The ARP request includes the IP address 198.51.100.1 of the WAN side of the WAN communication unit 11 in the Target IP Address field.
[0095] The gateway device 41 transmits the ARP request generated in sequence Sq62 to the WAN communication unit 11 (sequence Sq63). The WAN communication unit 11 transmits the ARP request acquired from the gateway device 41 to the ARP control unit 13 (sequence Sq64). The ARP control unit 13 rewrites the Target IP Address field and the Sender IP Address field of the ARP request to the IP address 192.0.2.1 assigned to the LAN communication unit 12 and the IP address 192.0.2.2 on the LAN 21 side assigned to the WAN communication unit 11, respectively (sequence Sq65). The ARP control unit 13 transmits the ARP request rewritten as described above to the routing unit 14 included in the LAN communication unit 12 (sequence Sq66). In detail, in sequence Sq66, the ARP control unit 13 outputs the ARP request to the packet rewriting unit 16. Since the packet rewriting unit 16 performs rewriting processing only on the target IP packet, it does not process the ARP request output by the ARP control unit 13 and transfers the ARP request to the routing unit 14.
[0096] When the routing unit 14 included in the LAN communication unit 12 receives the ARP request, it generates an ARP response including the MAC address 00:00:5e:00:53:78 of its own device, i.e., the LAN communication unit 12 (sequence Sq67). The IP address 192.0.2.1 and the MAC address 00:00:5e:00:53:78 of the LAN communication unit 12 are set in the Sender IP Address field and the Sender MAC Address field of the ARP response, respectively. The values of the Target IP Address field and the Target MAC Address field of the ARP response match the values of the Sender IP Address field and the Sender MAC Address field of the ARP request, respectively. The routing unit 14 sends the ARP response generated in sequence Sq67 to the ARP control unit 13 (sequence Sq68). In detail, in sequence Sq68, the routing unit 14 outputs the ARP response to the packet rewriting unit 16. Since the packet rewriting unit 16 performs rewriting processing only on the target IP packet, it does not process the ARP response output by the routing unit 14 and transfers the ARP response to the ARP control unit 13 .
[0097] When the ARP control unit 13 receives an ARP response with the MAC address of the LAN communication unit 12 set in the Sender MAC Address field from the routing unit 14 in sequence Sq68, it rewrites the Sender IP Address field and the Target IP Address field of the ARP response to the IP address 198.51.100.1 on the WAN 31 side of the WAN communication unit 11 and the IP address 198.51.100.2 assigned to the gateway device 41, respectively (sequence Sq69). The ARP control unit 13 sends the ARP response rewritten as described above to the WAN communication unit 11 (sequence Sq70).
[0098] The WAN communication unit 11 sends the ARP response acquired from the ARP control unit 13 to the gateway device 41 (sequence Sq71). When the gateway device 41 acquires the ARP response, it stores the IP address 198.51.100.1 and the MAC address 00:00:5e:00:53:78 in the ARP table in association with each other. As a result, the IP address of the WAN communication unit 11 on the WAN 31 side and the MAC address of the LAN communication unit 12 are stored in the ARP table in association with each other.
[0099] The gateway device 41 adds an Ethernet header to the IP packet acquired from the SIP server 53 in sequence Sq61, the Ethernet header including the MAC address of the LAN communication unit 12 indicated in the ARP response acquired in sequence Sq71 as the destination MAC address and the MAC address of the gateway device 41 as the source MAC address (sequence Sq72).
[0100] The gateway device 41 transmits the IP packet to the packet rewriting unit 16 included in the relay device 3 (sequence Sq73). Since the MAC address of the LAN communication unit 12 is specified in the IP packet transmitted in sequence Sq73, there is no need for the WAN communication unit 11 to reset the Ethernet header. Therefore, the WAN communication unit 11 transfers the acquired IP packet to the ARP control unit 13 without performing any processing. The ARP control unit 13 transfers packets other than the ARP request and ARP response acquired from the WAN communication unit 11 to the packet rewriting unit 16 without performing the above-mentioned rewriting processing.
[0101] The packet management unit 17 monitors packets output by the WAN communication unit 11, and attaches a mark to packets whose destination IP address includes the IP address assigned to the built-in server 15.
[0102] The packet rewriting unit 16 rewrites the destination IP address of the IP packet addressed to the built-in server 15 obtained from the WAN communication unit 11, specifically, the IP packet output from the WAN communication unit 11 and marked by the packet management unit 17 (sequence Sq74). In detail, the packet rewriting unit 16 rewrites the destination IP address from 192.0.2.33 to the IP address 192.0.2.1 assigned to the LAN communication unit 12.
[0103] The packet rewriting unit 16 sends the rewritten IP address to the LAN communication unit 12 (sequence Sq75). When the packet management unit 17 has added a mark to the IP packet sent in sequence Sq75, the routing unit 14 included in the LAN communication unit 12 transfers the IP packet to the built-in server 15 (sequence Sq76). After this, the built-in server 15 processes the IP packet, for example, generates an IP packet to be sent to the second communication device 25a or the second communication device 25b, sends the IP packet, and receives the IP packet from the second communication device 25a or the second communication device 25b, as in the second embodiment. When the built-in server 15 receives the IP packet from the second communication device 25a or the second communication device 25b, it generates an IP packet to be sent to the WAN 31 and transfers the IP packet to the routing unit 14. This enables communication between the second communication device 25a or the second communication device 25b and the WAN side communication device 54.
[0104] When the second communication device 25a or 25b requests communication with the WAN side communication device 52, the ARP request and ARP response are rewritten and the IP packet is rewritten in a similar manner. In detail, as shown in Fig. 18, when a transfer request is acquired from the second communication device 25a or 25b, the built-in server 15 transmits the transfer request to the routing unit 14 (sequence Sq81). The destination IP address of the transfer request is the IP address 203.0.113.11 assigned to the SIP server 53.
[0105] When the routing unit 14 receives the forwarding request transmitted in sequence Sq81, it refers to the routing table and searches for the IP address of the next hop corresponding to the destination IP address of the forwarding request. The routing unit 14 refers to the ARP table and searches for the MAC address corresponding to the IP address of the next hop. If the MAC address is not found, the routing unit 14 generates an ARP request (sequence Sq82).
[0106] The ARP request includes, in the Sender IP Address field, 192.0.2.1 which is the IP address of the LAN communication unit 12, and in the Sender MAC Address field, 00:00:5e:00:53:78 which is the MAC address of the LAN communication unit 12. The ARP request includes, in the Target IP Address field, 192.0.2.2 which is the LAN side IP address of the WAN communication unit 11.
[0107] The LAN communication unit 12 transmits the ARP request generated in sequence Sq82 to the ARP control unit 13 (sequence Sq83). The ARP control unit 13 rewrites the Target IP Address field and the Sender IP Address field of the ARP request to the IP address 198.51.100.2 assigned to the gateway device 41 and the IP address 198.51.100.1 on the WAN 31 side assigned to the WAN communication unit 11, respectively (sequence Sq84). The ARP control unit 13 sends the ARP request rewritten as described above to the WAN communication unit 11 (sequence Sq85). The WAN communication unit 11 transmits the ARP request acquired from the ARP control unit 13 to the gateway device 41 (sequence Sq86).
[0108] When the gateway device 41 receives the ARP request, it generates an ARP response including its own MAC address 00:00:5e:00:53:01 (sequence Sq87). The MAC address 00:00:5e:00:53:01 of the gateway device 41 and the IP address 198.51.100.2 of the gateway device 41 are set in the Sender MAC Address field and the Sender IP Address field of the ARP response, respectively. The Target IP Address field and the Target MAC Address field of the ARP response match the contents of the Sender IP Address field and the Sender MAC Address field of the ARP request, respectively. The gateway device 41 transmits the ARP response generated in sequence Sq87 to the WAN communication unit 11 (sequence Sq88).
[0109] When the WAN communication unit 11 receives the ARP response, it transmits the received ARP response to the ARP control unit 13 (sequence Sq89). When the ARP control unit 13 receives an ARP response from the WAN communication unit 11 with the MAC address of the gateway device 41 set in the Sender MAC Address field, it rewrites the Sender IP Address field and the Target IP Address field of the ARP response to the IP address 192.0.2.2 on the LAN 21 side of the WAN communication unit 11 and the IP address 192.0.2.1 assigned to the LAN communication unit 12, respectively (sequence Sq90). The ARP control unit 13 transmits the ARP response rewritten as described above to the LAN communication unit 12 (sequence Sq91).
[0110] When the routing unit 14 included in the LAN communication unit 12 receives the ARP response, the routing unit 14 associates the IP address 192.0.2.2 with the MAC address 00:00:5e:00:53:01 and stores them in the ARP table. As a result, the IP address of the WAN communication unit 11 on the LAN 21 side and the MAC address of the gateway device 41 are stored in the ARP table in association with each other.
[0111] The routing unit 14 adds an Ethernet header to the IP packet generated by the built-in server 15 and output from the built-in server 15 in sequence Sq81, the Ethernet header including, as the destination MAC address, the MAC address of the gateway device 41 indicated in the ARP response obtained in sequence Sq91, and the MAC address of the LAN communication unit 12 as the source MAC address (sequence Sq92).
[0112] The routing unit 14 transmits the IP packet output from the built-in server 15 and with an Ethernet header added as shown in sequence Sq92 to the packet rewriting unit 16 (sequence Sq93). At this time, the IP address 192.0.2.1 assigned to the routing unit 14 is set as the source IP address of the IP packet transmitted to the packet rewriting unit 16.
[0113] The packet management unit 17 assigns a mark to the IP packet output from the built-in server 15 .
[0114] The packet rewriting unit 16 rewrites the source IP address of an IP packet output from the built-in server 15 and having an IP address assigned to the LAN communication unit 12 set as the source IP address, specifically, an IP packet acquired from the LAN communication unit 12 and marked by the packet management unit 17 (sequence Sq94). In detail, the packet rewriting unit 16 rewrites the source IP address from 192.0.2.1 to the IP address 192.0.2.33 assigned to the built-in server 15.
[0115] The packet rewriting unit 16 transmits the IP packet with the rewritten IP address to the gateway device 41 (sequence Sq95). The ARP control unit 13 transfers packets other than the ARP request and ARP response packets acquired from the packet rewriting unit 16 to the WAN communication unit 11 without performing the above-mentioned rewriting process.
[0116] Since the MAC address of gateway device 41 is specified in the IP packet transmitted in sequence Sq95, there is no need for WAN communication unit 11 to reset the Ethernet header. Therefore, WAN communication unit 11 transfers the acquired IP packet to gateway device 41 without performing any processing. Thereafter, gateway device 41 transmits the IP packet to SIP server 53, thereby enabling communication between second communication device 25a or second communication device 25b and WAN side communication device 54.
[0117] As described above, according to the relay device 3 of the third embodiment, the ARP control unit 13 rewrites the ARP packet and the packet rewriting unit 16 rewrites the IP packet, thereby achieving the same function as when a router is provided on the WAN 31 side of the LAN communication unit 12. The relay device 3 does not need to include multiple routers and can be achieved with a simple configuration.
[0118] The relay device 3 according to the third embodiment can be modified in various ways in addition to those described above. 19, the WAN communication unit 11 included in the relay device 3 may transmit only ARP packets, specifically, ARP requests and ARP responses, to the ARP control unit 13, and transmit packets other than ARP packets to the packet rewriting unit 16. In this case, the routing unit 14 may transmit only ARP packets to the ARP control unit 13, and transmit packets other than ARP packets to the packet rewriting unit 16. The packet management unit 17 may monitor IP packets transmitted from the WAN communication unit 11 or the routing unit 14 to the packet rewriting unit 16.
[0119] The modifications described in the first and second embodiments can also be applied to the third embodiment. Specifically, the rewriting by the ARP control unit 13 may be performed based on a pre-stored MAC address. Furthermore, the built-in server 15 and the SIP server 53 are not limited to processing data based on SIP, and may be servers that process data based on SIP and data based on RTP. Furthermore, the communication system 103 is not limited to processing IPv4, and may perform communication according to IPv6. Furthermore, the packet management unit 17 may attach a mark only to IP packets output from the built-in server 15.
[0120] 20, each of the relay devices 1-3 includes a processor 61, a memory 62, and an interface 63 as a hardware configuration for controlling each unit. The processor 61, the memory 62, and the interface 63 are connected to each other via a bus 60.
[0121] For example, each function of the relay device 1-3 is realized by the processor 61 executing a program stored in the memory 62.
[0122] For example, the interface 63 connects the relay device 1-3 to the gateway device 41, and connects the relay device 1-3 to the LAN side communication devices 22a-22c, the first communication devices 24a, 24b, 24c, and the second communication devices 25a, 25b to establish communication. In detail, the WAN communication unit 11 included in the relay device 1-3 is connected to the gateway device 41 via the interface 63. The LAN communication unit 12 included in the relay device 1-3 is connected to at least one of the LAN side communication devices 22a-22c, the first communication devices 24a, 24b, 24c, and the second communication devices 25a, 25b via the interface 63. The interface 63 has multiple types of interface modules as necessary.
[0123] 20, each of the relay devices 1-3 has one processor 61 and one memory 62, but each of the relay devices 1-3 may have multiple processors 61 and multiple memories 62. In this case, the multiple processors 61 and the multiple memories 62 may cooperate with each other to execute each function of each of the relay devices 1-3.
[0124] 21, the relay device 1-3 may be realized by a processing circuit 71. The processing circuit 71 is connected to other devices via an interface circuit 72. In detail, the WAN communication unit 11 included in the relay device 1-3 is connected to the gateway device 41 via the interface circuit 72. The LAN communication unit 12 included in the relay device 1-3 is connected to at least one of the LAN side communication devices 22a-22c, the first communication devices 24a, 24b, and 24c, and the second communication devices 25a and 25b via an interface 63.
[0125] When the processing circuit 71 is a dedicated hardware, the processing circuit 71 has, for example, a single circuit, a composite circuit, a processor, an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or a combination thereof. Each unit of the relay device 1-3 may be realized by an individual processing circuit 71, or each unit of the relay device 1-3 may be realized by a common processing circuit 71.
[0126] Some of the functions of the relay device 1-3 may be realized by dedicated hardware, and the other parts may be realized by software or firmware. For example, in the relay device 1, the ARP control unit 13 may be realized by a processor 61 shown in FIG. 20 reading and executing a program stored in a memory 62, and the WAN communication unit 11 and the LAN communication unit 12 may be realized by a processing circuit 71 shown in FIG. 21.
[0127] Furthermore, the above-mentioned hardware configuration and flowchart are merely examples and can be changed or modified as desired. [Explanation of symbols]
[0128] 1,2,3 Repeater 11 WAN Communications Department 12 LAN communication section 13 ARP control section 14 Routing section 15 Built-in Server 16 Packet Rewrite Unit 17 Packet Management Unit 21,23 LAN 22a,22b,22c LAN side communication equipment 24a,24b,24c 1st communication equipment 25a,25b 2nd communication device 31 WAN 41 Gateway device 51 Internet 52,54 WAN side communication equipment 53 SIP Server 60 Bus 61 processors 62 Memory 63 Interface 71 Processing circuit 72 Interface Circuit 101,102,103 Communication Systems
Claims
1. A relay device connected to a gateway device of a wide area network and a local area network, A WAN communication unit that communicates with the gateway device; a LAN communication unit connected to the local area network; an ARP control unit which, when the WAN communication unit receives an ARP (Address Resolution Protocol) request from the gateway device with an IP (Internet Protocol) address on the wide area network side assigned to the WAN communication unit set in a Target IP Address field, causes the WAN communication unit to transmit an ARP response with a MAC (Media Access Control) address of the LAN communication unit set in a Sender MAC Address field to the gateway device, and, when the LAN communication unit outputs an ARP request with an IP address on the local area network side assigned to the WAN communication unit set in a Target IP Address field, supplies the LAN communication unit with an ARP response with the MAC address of the gateway device set in a Sender MAC Address field; A relay device comprising:
2. When the WAN communication unit receives from the gateway device the ARP request in which the wide area network side IP address of the WAN communication unit is set in a Target IP Address field, the ARP control unit rewrites the Target IP Address field of the ARP request to an IP address assigned to the LAN communication unit, and sends the ARP request in which the Target IP Address field has been rewritten to the LAN communication unit, and when the ARP control unit obtains from the LAN communication unit an ARP response in which the MAC address of the LAN communication unit is set in a Sender MAC Address field, the ARP control unit rewrites the Sender IP Address field of the ARP response to the wide area network side IP address of the WAN communication unit, and causes the ARP response in which the Sender IP Address field has been rewritten to be transmitted from the WAN communication unit to the gateway device. The relay device according to claim 1 .
3. When the WAN communication unit receives the ARP request from the gateway device, in which the wide area network side IP address of the WAN communication unit is set in a Target IP Address field, the ARP control unit rewrites the Target IP Address field and the Sender IP Address field of the ARP request to the IP address assigned to the LAN communication unit and the IP address of the local area network side assigned to the WAN communication unit, respectively, and sends the ARP request in which the Target IP Address field and the Sender IP Address field have been rewritten to the LAN communication unit, and when the ARP control unit obtains an ARP response from the LAN communication unit, in which the MAC address of the LAN communication unit is set in a Sender MAC Address field, the ARP control unit rewrites the Sender IP Address field and the Target IP Address field of the ARP response to the wide area network side IP address of the WAN communication unit and the IP address of the gateway device, respectively, and causes the ARP response in which the Sender IP Address field and the Target IP Address field have been rewritten to be transmitted from the WAN communication unit to the gateway device. The relay device according to claim 2 .
4. the ARP control unit holds information indicating a MAC address of the LAN communication unit, and when the WAN communication unit receives the ARP request from the gateway device, generates an ARP response in which the MAC address of the LAN communication unit is set in the Sender MAC Address field and an IP address of the WAN communication unit on the wide area network side is set in a Sender IP Address field, and causes the ARP response to be transmitted from the WAN communication unit to the gateway device. The relay device according to claim 1 .
5. When the LAN communication unit outputs the ARP request in which the IP address of the WAN communication unit on the local area network side is set in the Target IP Address field, the ARP control unit rewrites the Target IP Address field of the ARP request to an IP address assigned to the gateway device and transmits the ARP request in which the Target IP Address field has been rewritten from the WAN communication unit to the gateway device, and when the WAN communication unit obtains an ARP response from the gateway device in which the MAC address of the gateway device is set in the Sender MAC Address field, the ARP control unit rewrites the Sender IP Address field of the ARP response to the IP address of the WAN communication unit on the local area network side and supplies the ARP response in which the Sender IP Address field has been rewritten to the LAN communication unit. The relay device according to claim 1 .
6. When the LAN communication unit outputs the ARP request in which the IP address of the WAN communication unit on the local area network side is set in the Target IP Address field, the ARP control unit rewrites the Target IP Address field and the Sender IP Address field of the ARP request to the IP address assigned to the gateway device and the IP address of the wide area network side assigned to the WAN communication unit, respectively, and transmits the ARP request in which the Target IP Address field and the Sender IP Address field have been rewritten from the WAN communication unit to the gateway device, and when the WAN communication unit obtains an ARP response from the gateway device in which the MAC address of the gateway device is set in the Sender MAC Address field, the ARP control unit rewrites the Sender IP Address field and the Target IP Address field of the ARP response to the IP address of the WAN communication unit on the local area network side and the IP address assigned to the LAN communication unit, respectively, and supplies the ARP response in which the Sender IP Address field and the Target IP Address have been rewritten to the LAN communication unit. The relay device according to claim 5 .
7. the ARP control unit holds information indicating a MAC address of the gateway device, and when the LAN communication unit outputs the ARP request in which an IP address of the WAN communication unit on the local area network side is set in the Target IP Address field, the ARP control unit generates an ARP response in which the MAC address of the gateway device is set in the Sender MAC Address field and the IP address of the WAN communication unit on the local area network side is set in the Sender IP Address field, and supplies the ARP response to the LAN communication unit. The relay device according to claim 1 or 4.
8. the LAN communication unit has a built-in server that communicates with a WAN side communication device connected to the wide area network, and communicates with a first communication device connected to the local area network; a packet rewriting unit which, when the WAN communication unit receives from the gateway device an IP packet whose destination is an IP address assigned to the built-in server, rewrites the destination IP address of the IP packet to an IP address assigned to the LAN communication unit, and sends the IP packet with the rewritten destination IP address to the LAN communication unit, and when an IP packet output from the built-in server is obtained from the LAN communication unit, rewrites the source IP address of the IP packet to the IP address assigned to the built-in server, and sends the IP packet with the rewritten source IP address to the WAN communication unit; When the LAN communication unit acquires the IP packet whose destination has been rewritten to the device by the packet rewriting unit, the LAN communication unit processes the IP packet in the built-in server. The relay device according to claim 1 .
9. A relay device connected to a gateway device of a wide area network and a local area network, A WAN communication unit that communicates with the gateway device; a LAN communication unit having an internal server for communicating with a WAN side communication device connected to the wide area network and for communicating with a first communication device connected to the local area network; a packet rewriting unit which, when the WAN communication unit receives from the gateway device an IP packet whose destination is an IP address assigned to the built-in server, rewrites the destination IP address of the IP packet to an IP address assigned to the LAN communication unit, and sends the IP packet with the rewritten destination IP address to the LAN communication unit, and, when an IP packet output from the built-in server is obtained from the LAN communication unit, rewrites the source IP address of the IP packet to the IP address assigned to the built-in server, and sends the IP packet with the rewritten source IP address to the WAN communication unit, When the LAN communication unit acquires the IP packet whose destination has been rewritten to the device by the packet rewriting unit, the LAN communication unit processes the IP packet in the built-in server. Relay device.
10. a packet management unit that adds a mark to the IP packet output from the built-in server; 10. The relay device according to claim 8 or 9.
11. the packet management unit, when the WAN communication unit receives the IP packet having the IP address of the built-in server set as a destination from the gateway device, attaches a mark to the IP packet; the packet rewriting unit rewrites the destination IP address of the IP packet, which is received by the WAN communication unit from the gateway device and has been marked by the packet management unit, to an IP address assigned to the LAN communication unit, and rewrites the source IP address of the IP packet, which is output from the built-in server and has been marked by the packet management unit, to an IP address assigned to the built-in server. The relay device according to claim 10.
12. the built-in server communicates with the WAN side communication device and a second communication device connected to the local area network different from the first communication device; the LAN communication unit relays data communication of the first communication device, and relays voice communication of the second communication device by the built-in server; 10. The relay device according to claim 8 or 9.
13. A WAN side communication device connected to a wide area network; a gateway device that communicates with the WAN side communication device via the wide area network; A relay device according to any one of claims 1 to 3, 8 and 9, which is connected to the gateway device and a local area network; A LAN side communication device connected to the local area network; A communication system comprising:
14. A relay method performed by a relay device including a WAN communication unit connected to a gateway device of a wide area network and a local area network and communicating with the gateway device, and a LAN communication unit connected to the local area network, the relay method comprising: When an ARP request in which an IP address on the wide area network side assigned to the WAN communication unit is set in a Target IP Address field is received from the gateway device, an ARP response in which a MAC address of the LAN communication unit is set in a Sender MAC Address field is transmitted to the gateway device, and when an ARP request in which an IP address on the local area network side assigned to the WAN communication unit is set in a Target IP Address field is output from the LAN communication unit, an ARP response in which a MAC address of the gateway device is set in a Sender MAC Address field is supplied to the LAN communication unit. Relay method.
15. A relay method performed by a relay device including: a WAN communication unit connected to a gateway device of a wide area network and a local area network and communicating with the gateway device; and a LAN communication unit connected to the local area network, having a built-in server that communicates with a WAN side communication device connected to the wide area network, and communicating with a first communication device connected to the local area network, the relay method comprising: When an IP packet having an IP address assigned to the built-in server set as its destination is received from the gateway device, the destination IP address of the IP packet is rewritten to the IP address assigned to the LAN communication unit, When an IP packet generated by the built-in server is acquired, a source IP address of the IP packet is rewritten to an IP address assigned to the built-in server, and the IP packet with the rewritten source IP address is transmitted to the gateway device. Relay method.
Citation Information
Patent Citations
Communication device
JP2003169163A