creating tcp client creating tcp server |||networking networking allows computer programs to communicate with each othereven if they are running on different machines for programs such as web browsersthis is the essence of what they dowhereas for others networking adds additional dimensions to their functionalityfor exampleremote operation or loggingor the ability to retrieve or supply data to other machines most networking programs work on either peer-to-peer basis (the same program runs on different machines)or more commonlya client/server basis (client programs send requests to serverin this we will create basic client/server application such applications are normally implemented as two separate programsa server that waits for and responds to requestsand one or more clients that send requests to the server and read back the server' response for this to workthe clients must know where to connect to the serverthat isthe server' ip (internet protocoladdress and port number alsoboth clients and server must send and receive data using an agreed-upon protocol using data formats that they both understand python' low-level socket module (on which all of python' higher-level networking modules are basedsupports both ipv and ipv addresses it also supports the most commonly used networking protocolsincluding udp (user datagram protocol), lightweight but unreliable connectionless protocol where data is sent as discrete packets (datagramsbut with no guarantee that they will arriveand tcp (transmission control protocol) reliable connectionand stream-oriented protocol with tcpany amount of data can be sent and received--the socket is responsible for breaking the data into chunks that are small enough to sendand for reconstructing the data at the other end machines can also connect using service discoveryfor exampleusing the bonjour apisuitable modules are available from the python package indexpypi python org/pypi