Distributed communication and coordination for smart cyber-physical devices