In this paper we consider duplexes, which are sets with two associative binary operations. Dimonoids in the sense of Loday are examples of duplexes. The set of all permutations carries a structure of a duplex. Our main result asserts that it is a free duplex with an explicitly described set of generators. The proof uses a construction of the free duplex with one generator by planary trees.