client and server implemented with basic functions