Distributed systems are fast becoming the norm in computer science. Formal mathematical models and theories of distributed behaviour are needed in order to understand them. This book proposes a distributed pi-calculus called Dpi, for describing the behaviour of mobile agents in a distributed world. It is based on an existing formal language, the pi-calculus, to which it adds a network layer and a primitive migration construct. A mathematical theory of the behaviour of these distributed systems is developed, in which the presence of types plays a major role. It is also shown how in principle this theory can be used to develop verification techniques for guaranteeing the behavior of distributed agents. The text is accessible to computer scientists with a minimal background in discrete mathematics. It contains an elementary account of the pi-calculus, and the associated theory of bisimulations. It also develops the type theory required by Dpi from first principles.