A network approach to layered anisotropic waveguides