Chapter 2 Section 7: Socket Programming
Socket
"door" in between application process and end-end-transport protocol
Transport socket services
TCP UDP
Socket Programming with TCP
Client must contact server server process must be running first server must have created socket that welcomes client's contact client contacts server by : creating TCP socket, specifying IP address, port number of server process. when client creates a socket:client TCP establishes connection to server TCP when contacted by client,server TCP creates new socket for server process to communicate with that particular client: allows server to talk with multiple clients.source ports numbers used to distinguish clients. TCP provides reliable ,in-order byte stream transfer ("pipe") between client and server.
TCP
Reliable,byte stream-oriented
UDP
Unreliable Datagram
Socket Programming with UDP
no "connection" between client and server no handshaking before sending data sender attaches IP destination address and port # to each packet receiver extracts sender IP address and port # from received packet. transmitted data may be lost or received out of order provides unreliable transfer of groups of bytes between client and server