Optical frequency measurement for multichannel networks using sum-frequency generation in multilayer waveguides