in the abstract before jumping into programming details the socket layer in simple termssockets are programmable interface to connections between programspossibly running on different computers of network they allow data formatted as byte strings to be passed between processes and machines sockets also form the basis and low-level "plumbingof the internet itselfall of the familiar higher-level net protocolslike ftpweb pagesand emailultimately occur over sockets sockets are also sometimes called communications endpoints because they are the portals through which programs send and receive bytes during conversation although often used for network conversationssockets may also be used as communication mechanism between programs running on the same computertaking the form of general inter-process communication (ipcmechanism we saw this socket usage mode briefly in unlike some ipc devicessockets are bidirectional data streamsprograms may both send and receive data through them to programmerssockets take the form of handful of calls available in library these socket calls know how to send bytes between machinesusing lower-level operations such as the tcp network transmission control protocol at the bottomtcp knows how to transfer bytesbut it doesn' care what those bytes mean for the purposes of this textwe will generally ignore how bytes sent to sockets are physically transferred to understand sockets fullythoughwe need to know bit about how computers are named machine identifiers suppose for just moment that you wish to have telephone conversation with someone halfway across the world in the real worldyou would probably need either that person' telephone number or directory that you could use to look up the number from her name ( telephone bookthe same is true on the internetbefore script can have conversation with another computer somewhere in cyberspaceit must first know that other computer' number or name luckilythe internet defines standard ways to name both remote machine and service provided by that machine within scriptthe computer program to be contacted through socket is identified by supplying pair of values--the machine name and specific port number on that machinemachine names machine name may take the form of either string of numbers separated by dotscalled an ip address ( )or more legible form known as domain name ( starship python netdomain names are automatically mapped into their dotted numeric address equivalent when usedby something called plumbing the internet