surfing the net by defining standard port numbers for servicesthe net naturally gives rise to clientserver architecture on one side of conversationmachines that support standard protocols perpetually run set of programs that listen for connection requests on the reserved ports on the other end of dialogother machines contact those programs to use the services they export we usually call the perpetually running listener program server and the connecting program client let' use the familiar web browsing model as an example as shown in table - the http protocol used by the web allows clients and servers to talk over sockets on port server machine that hosts websites usually runs web server program that constantly listens for incoming connection requestson socket bound to port oftenthe server itself does nothing but watch for requests on its port perpetuallyhandling requests is delegated to spawned processes or threads clients programs that wish to talk to this server specify the server machine' name and port to initiate connection for web serverstypical clients are web browsers like firefoxinternet exploreror chromebut any script can open client-side connection on port to fetch web pages from the server the server' machine name can also be simply "localhostif it' the same as the client' in generalmany clients may connect to server over socketswhether it implements standard protocol or something more specific to given application and in some applicationsthe notion of client and server is blurred--programs can also pass bytes between each other more as peers than as master and subordinate an agent in peerto-peer file transfer systemfor instancemay at various times be both client and server for parts of files transferred for the purposes of this bookthoughwe usually call programs that listen on sockets serversand those that connect clients we also sometimes call the machines that these programs run on server and client ( computer on which web server program runs may be called web server machinetoo)but this has more to do with the physical than the functional protocol structures functionallyprotocols may accomplish familiar tasklike reading email or posting usenet newsgroup messagebut they ultimately consist of message bytes sent over sockets the structure of those message bytes varies from protocol to protocolis hidden by the python libraryand is mostly beyond the scope of this bookbut few general words may help demystify the protocol layer network scripting