The periodic and open Toda lattice