KLAIM (Kernel Language for Agents Interaction and Mobility) is an experimental kernel language to model and program distributed concurrent applications with mobile code. The language consists of Linda-like primitives acting on multiple tuple spaces distributed over the nodes of a net, and of a set of operators for building processes that communicate via tuple spaces. However, the underlying model is flat, namely nodes cannot enclose other nodes. This is not realistic if one aims at modeling the Internet architecture; e.g. intranets and firewalls have definitely hierarchical structures. In this paper we enrich the KLAIM model by introducing a routing function and a partial ordering relation over nodes thus obtaining a hierarchical model. We ...