ioctl(socketFd_, SIOCOUTQ, &outstandingBytes);
getsockopt(socketFd_, SOL_SOCKET, SO_SNDBUF, &sendBuffSize, &buffLen);
I am using these two api to debug the packet drop in my program.
observation:
sendto
will always return the packet size so call tosendto
is always successful.- when oustandingBytes reaches 2040, packet will be dropped by linux kernel means i am not able to see the packet it in the wireshark. i am capturing the packet on my local eth interface.
- my sendBuffSize is 124928 as returned by
getsockopt
. - the packet size which i am sending will be around 300 to 350 bytes. and i have two socket one raw socket for sending GRE packet and another udp socket and i am seeing the packet drop for both type of protocol, both of the socket are in non blocking mode.
issendto
is not able to detect the error because packet are being dropped before reaching the sendBuffSize limit?
How can i increase the limit of 2040 in my system. this value should be 124928 as returned bygetsockopt()
api.
I have similar thread for this issue as given below however i am not able to get answer so decided to start a new thread.
rawsocket sendto() some of the packet are dropped and not seen in the network