Default protocol for AF_UNIX sockets Default protocol for AF_UNIX sockets linux linux

Default protocol for AF_UNIX sockets


Since an AF_UNIX unix socket is a local thing, there's no such thing as added protocol overhead in this case. You can use it in SOCK_STREAM or SOCK_DGRAM mode to make it connection-oriented or connectionless, respectively, but that's all: no protocol headers are added and it traverses none of the network or transport protocol implementations in the network stack.


AF stands for A ddress F amily whereas PF stands for P rotocol F amily.

The AF_UNIX family does not have a protocol IPPROTO_TCP that is supported by that address family. AF_UNIX is for interprocess communications between processes on the same system in the UNIX® domain. The AF_UNIX and AF_UNIX_CCSID address family supports a protocol of 0 for both SOCK_STREAM and SOCK_DGRAM.

Read more here: Sockets


The only valid "protocol" when using AF_UNIX is zero.

Look at socket(2) and unix(7)