Client establishes a TCP connection with server. Sends a sample query and parses response. Server listens to client, handles the query and sends back response.