We report ail-optical switching in a time and wavelength window based on cascaded sum- and difference-frequency generation in a periodically poled lithium-niobate waveguide, More than 50% switching of a 5-ps pulse is observed with a gate-pulse peak power of 6.6 W.