A central problem for structured peer-to-peer networks is topology maintenance, that is, how to properly update neighbor variables when nodes join and leave the network, possibly concurrently. In this paper, we first present a protocol that maintains a ring, the basis of several structured peer-to-peer networks. We then present a protocol that maintains Ranch, a topology consisting of multiple rings. The protocols handle both joins and leaves concurrently and actively (i.e., neighbor variables are updated once a join or a leave occurs). We use an assertional method to prove the correctness of the protocols, that is, we first come up with a global invariant for a protocol and then show that every action of the protocol preserves the invariant. The protocols are simple and the proofs are rigorous and explicit.