wireshark在哪里抓包

where does the wireshark capture the packets

wireshark在linux内核的什么地方抓包?如果一个输出包被wireshark抓到,这个包一定会从相应的接口发出去吗? 换句话说,wireshark捕获的输出数据包是否可以在发送之前被丢弃?

where does the wireshark capture the packets in the linux kernel?

在 UN*Xes 上,它使用 libpcap, which, on Linux, uses AF_PACKET sockets。 (在Windows上,它使用WinPcap,它是一个驱动程序加上一个libpcap的端口来使用驱动程序。)

If an output packet is captured by wireshark , will the packet be sent out definitely through corresponding interface?

没有。网络堆栈将数据包交给适当的 AF_PACKET 套接字和驱动程序;驱动程序可能会丢弃数据包(例如,如果在以太网上发生多次冲突并放弃),即使数据包已传送到 AF_PACKET 套接字。

In other words, could an output packet that captured by wireshark be dropped before it is sent out?

是的。见上文。