The present invention relates to network devices and a method of controlling the network devices, and more particularly to network devices and a method of controlling them which are suitable for building a control system in which network devices connected to an identical network, and network devices connected to different networks through gateways coexist.