Automatic self-configuration of the logical network using distributed software agents