Common classes shared by client and server.