This occurs only if the dielectric index of the middle layer is larger than that of the surrounding layers. In practice slab waveguides are not infinite in the direction parallel to the interface, but if the typical size of the interfaces is much much larger than the depth of the layer, the slab waveguide model will be an excellent approximation. Guided modes of a slab waveguide cannot be excited by light incident from the top or bottom interfaces.