network programming and sockets address families some of the socket functions require the specification of an address family the family specifies the network protocol being used the following constants are defined for this purposeconstant description af_bluetooth af_inet af_inet bluetooth protocol ipv protocols (tcpudpipv protocols (tcpudpnetlink interprocess communication link-level packets transparent inter-process communication protocol unix domain protocols af_netlink af_packet af_tipc af_unix of theseaf_inet and af_inet are the most commonly used because they represent standard internet connections af_bluetooth is only available on systems that support it (typically embedded systemsaf_netlinkaf_packetand af_tipc are only supported on linux af_netlink is used for fast interprocess communication between user applications and the linux kernel af_packet is used for working directly at the datalink layer ( raw ethernet packetsaf_tipc is protocol used for high-performance ipc on linux clusters (socket types some socket functions also require the specification of socket type the socket type specifies the type of communications (streams or packetsto be used within given protocol family the following constants are used for this purposeconstant description sock_stream sock_dgram sock_raw sock_rdm sock_seqpacket reliable connection-oriented byte stream (tcpdatagrams (udpraw socket reliable datagrams sequenced connection-mode transfer of records the most common socket types are sock_stream and sock_dgram because they correspond to tcp and udp in the internet protocol suite sock_rdm is reliable form of udp that guarantees the delivery of datagram but doesn' preserve ordering (datagrams might be received in different order than sentsock_seqpacket is used to send packets through stream-oriented connection in manner that preserves their order and packet boundaries neither sock_rdm or sock_seqpacket are widely supportedso it' best not to use them if you care about portability sock_raw is used to provide low-level access to the raw protocol and is used if you want to carry out special-purpose operations such as sending control messages ( icmp messagesuse of sock_raw is usually restricted to programs running with superuser or administrator access lib fl ff