AF_PACKET socket is a way of capturing raw packets at link layer and then applications can handle the packets in user space. Applications like packet sniffering and soft packet processing could use it to receive and send the raw packets from and to the link layer directly.
AF_PACKET had evolved a few versions of improvement in Linux kernel since it’s introduced. In this artcile, we will discuss what options could be used to improve the efficiency for capturing and sending the packet via the AF_PACKET socket.