Structural theory of distributed systems