A minimalist representation of protein structures using a Go-like potential for interactions is implemented to investigate the mechanisms of the domain swapping of p13suc1, a protein that exists in two native conformations: a monomer and a domain-swapped dimer formed by the exchange of a beta-strand. Inspired by experimental studies which showed a similarity of the transition states for folding of the monomer and the dimer, in this study we justify this similarity in molecular descriptions. When intermediates are populated in the simulations, formation of a domain-swapped dimer initiates from the ensemble of unfolded monomers, given by the fact that the dimer formation occurs at the folding/unfolding temperature of the monomer (T(f)). It is also shown that transitions, leading to a dimer, involve the presence of two intermediates, one of them has a dimeric form and the other is monomeric; the latter is much more populated than the former. However, at temperatures lower than T(f), the population of intermediates decreases. It is argued that the two folded forms may coexist in absence of intermediates at a temperature much lower than T(f). Computational simulations enable us to find a mechanism, "lock-and-dock", for domain swapping of p13suc1. To explore the route toward dimer formation, the folding of unstructured monomers must be retarded by first locking one of the free ends of each chain. Then, the other free termini could follow and dock at particular regions, where most intrachain contacts are formed, and thus define the transition states of the dimer. The simulations also showed that a decrease in the maximum distance between monomers increased their stability, which is explained based on confinement arguments. Although the simulations are based on models extracted from the native structure of the monomer and the dimer of p13suc1, the mechanism of the domain-swapping process could be general, not only for p13suc1.