The domain specifies where the communication is to be done. Most often, this is either the UNIX or the Internet domain. Sockets in the UNIX domain are used for inter-process communication. Sockets in the Internet domain are used for communication between hosts on the Internet. The type of a socket is the type of transport service that the socket will provide.
Raw service provides no special handling of the data read from or written to a socket.
In the current implementation, datagram service is provided via the User Datagram Protocol. UDP does not provide reliable transport, so messages may be lost, duplicated, delivered in a different order from which they were sent, or modified in transport. The third type of service, stream service, provides a stream of data to and from the socket, similar to the UNIX file paradigm as a stream of bytes. Stream service is provided via the Transmission Control Protocol, TCP, which, unlike UDP, provides reliable data transmission. However, unlike UDP, there are no message boundaries, but rather a continuous stream of data.