PF_PACKET Socket

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Hi,
I am emanshu "munish nayyar" a linux enthusiastic. I need your
help. I am using PF_PACKET socket ( kernel-2.4.25 configured with mmap
packet capture support) to receive video stream coming at particular
port.
But the problem when the stream is coming at high rate, kernel starts
dropping packet it seems that udp_queue buffer is full. So then I
changed my approach of socket creation I update my software socket to
PF_PACKET socket like that!!
Fd=socket(PF_PACKET, SOCK_DGRAM, ETH_P_IP) // since I need only IP
based udp packet so filtering at Ethernet level.

And I am receiving the packet using,
Bytes_recv=recvfrom() call still I am unable to receive the packet if
stream is coming more than 5mbps.
Some linux gurus advice me to use mmap based PF_PACKET, they told me
that this will surely improve your performance upto large extent,  then
I build my kernel with mmap packet capture support and run me apps on
that kernel still problem continue .

Please tell me where I am wrong!! does there any extra step other than
socket creation and recvfrom() call is required to use mmap() packet
capture!!

I will really appreciate any help to me!

Thanks,
Munish Nayyar


Site Timeline