— This paper investigates the topology formation mechanisms provided by IEEE 802.15.4 to create tree-based topologies, in the context of a multi-sink wireless sensor network. The topology formation protocol is simulated starting from a random deployment of a given number of nodes, to obtain statistics of the position of those nodes belonging to given tree levels. It is shown that under some circumstances the nodes belonging to any level can be assumed to be uniformly distributed over the plane. Under such assumption, a mathematical formulation is used to optimize the average number of children per parent and the number of levels in the tree (that is, the tree height), through maximization of the network association probability.