Asymmetric Mach-Zehnder interferometer (MZI) configurations are proposed to build all-optical space switches with gain and principally ideal extinction ratios. Actually, three asymmetries in MZI configurations with semiconductor optical amplifiers (SOA's) on their arms are discussed. The asymmetries in the all-optical switches are necessary to overcome the extinction ratio limitations that are due to the disturbing gain changes that arise when control signals are introduced into the SOA's to induce the necessary refractive index change for switching. Starting from a generic MZI configuration with SOA's on the arms, a description in terms of transmission matrices is used and applied to identify 122 and 222 all-optical switch configurations with high on-state transmissions and close to ideally large extinction ratios. The theoretical predictions are verified and found to be in excellent agreement with experiments for a switch with symmetric MZI splitters in a monolithically integrated InP waveguide version that allows operation with equally or unequally biased SOA's.