A server comprising: relay processing means for relaying a message addressed to a mobile node within a wireless ad-hoc network; and a communication interface capable of communicating with a plurality of gateways through a network infrastructure, wherein each of the plurality of gateways is configured to provide, to at least one of a plurality of wireless ad-hoc networks, connectivity with the network infrastructure, and the relay processing means is configured to: receive a first message indicating that a final destination is a first mobile node, determine, from among the plurality of gateways, a first gateway to which the first message is to be transferred, based on a movement history of the first mobile node, attempt to transmit the first message to the first mobile node through the first gateway, and in response to a failure of transmission of the first message through the first gateway, determine, from among the plurality of gateways, a second gateway to which the first message is to be transferred, and wherein the server is characterized in that the relay processing means is further configured to adjust, based on the movement history, a ratio between the number of transmission attempts of the first message through the first gateway and the number of transmission attempts of the first message through the second gateway. relay processing means for relaying a message addressed to a mobile node within a wireless ad-hoc network; and a communication interface capable of communicating with a plurality of gateways through a network infrastructure, wherein each of the plurality of gateways is configured to provide, to at least one of a plurality of wireless ad-hoc networks, connectivity with the network infrastructure, and the relay processing means is configured to: receive a first message indicating that a final destination is a first mobile node, determine, from among the plurality of gateways, a first gateway to which the first message is to be transferred, based on a movement history of the first mobile node, attempt to transmit the first message to the first mobile node through the first gateway, and in response to a failure of transmission of the first message through the first gateway, determine, from among the plurality of gateways, a second gateway to which the first message is to be transferred, and receive a first message indicating that a final destination is a first mobile node, determine, from among the plurality of gateways, a first gateway to which the first message is to be transferred, based on a movement history of the first mobile node, attempt to transmit the first message to the first mobile node through the first gateway, and in response to a failure of transmission of the first message through the first gateway, determine, from among the plurality of gateways, a second gateway to which the first message is to be transferred, and wherein the server is characterized in that the relay processing means is further configured to adjust, based on the movement history, a ratio between the number of transmission attempts of the first message through the first gateway and the number of transmission attempts of the first message through the second gateway.