Sol → gel → glass: I. Gelation and gel structure