A communication device comprising: a receiver that receives a packet from one of a plurality of networks, the plurality of networks including a first private network and a second private network; a communication processing unit that identifies a first application to be used to process the data included in the received packet based on a physical interface used for receiving the packet and a logical port number and that outputs the received packet to a data processing unit that realizes processing with the first application; the data processing unit that identifies a location of a first device that has transmitted the packet received from the first private network by processing data included in the received packet, that identifies a second device to which data obtained by use of the received packet is to be relayed, on the basis of the location of the first device, and that identifies a certain application used for processing the packets received or transmitted in a network including the second device; a routing table that associates, for each of the plurality of networks, a transfer route that is used in the network with identification information of an application used for processing the packets received or transmitted in each of the plurality of networks, the first private network and the second private network having an identical network address; and a transmitter that generates a transmitting packet including the data obtained by use of the received packet and transmits the transmitting packet using a transfer route for the second private network when identification information of the certain application is associated with the transfer route for the second private network by the routing table. a receiver that receives a packet from one of a plurality of networks, the plurality of networks including a first private network and a second private network; a communication processing unit that identifies a first application to be used to process the data included in the received packet based on a physical interface used for receiving the packet and a logical port number and that outputs the received packet to a data processing unit that realizes processing with the first application; the data processing unit that identifies a location of a first device that has transmitted the packet received from the first private network by processing data included in the received packet, that identifies a second device to which data obtained by use of the received packet is to be relayed, on the basis of the location of the first device, and that identifies a certain application used for processing the packets received or transmitted in a network including the second device; a routing table that associates, for each of the plurality of networks, a transfer route that is used in the network with identification information of an application used for processing the packets received or transmitted in each of the plurality of networks, the first private network and the second private network having an identical network address; and a transmitter that generates a transmitting packet including the data obtained by use of the received packet and transmits the transmitting packet using a transfer route for the second private network when identification information of the certain application is associated with the transfer route for the second private network by the routing table.