Optical frequency control for DWDM networks using sum-frequency generation in multilayer waveguides