From: "Aníbal Almeida Pinto" <anibal.pinto@efacec.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: <netdev@vger.kernel.org>
Subject: Re: Gianfar ethernet drop package
Date: Mon, 27 Aug 2012 14:01:27 +0100 [thread overview]
Message-ID: <503B6FA7.8070807@efacec.com> (raw)
In-Reply-To: <1346065738.2420.135.camel@edumazet-glaptop>
Em 27-08-2012 12:08, Eric Dumazet escreveu:
> On Mon, 2012-08-27 at 11:32 +0100, Aníbal Almeida Pinto wrote:
>
>> I generate the log on the board with tcpdump -i eth0 -w log_eth0.txt and
>> loaded the result on wireshark (on other pc).
>>
>> On the wireshark everything appears to be fine don't have nothing that
>> indicate the protocol isn't supported.
>>
>> On /etc/protocols is a list with protocols, it there is a place where
>> exist a place with protocols supported by kernel ?
>
> So all frames understood by wireshark are also automatically handled by
> your linux machine ? That sounds cool, so we no longer have to add stuff
> in the kernel ?
>
> Let me explain again :
>
> For example, if you dont have IPv6 loaded, IPv6 frames wont be handled,
> and they appear to be dropped. They really are.
>
> If you run tcpdump/wireshark, these frames are at least delivered once
> to a sniffer, so they are not "dropped", even if no protocol handler
> actually reacts to them.
I understand your explanation.
My problem now is to identify why the packages were dropped.
Wireshark report what listen and with ifconfig I only know how many have
been dropped.
I made a program, inline at the end, that tries to see the sockets that
I can create on a system, that will give me a idea of what protocol
handler that I have.
The program isn't complete and the options are a lot ...
Even with this I only can see the log of tcpdump and try to find frames
that belong to protocols not supported, don't know if there isn't
another reason, like Softnet backlog full or Bad / Unintended VLAN tags
Is there any way of put tcpdump or other tool to only log the packages
dropped ?
Thanks
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <netdb.h>
#include <errno.h>
struct socket_conf {
int socket_family; // domain
int socket_type;
int protocol;
};
struct socket_conf conf_list[] = {
{ PF_LOCAL, SOCK_STREAM, 0 }, // Local stream socket
{ PF_LOCAL, SOCK_DGRAM, 0 }, // Local datagram socket
{ PF_INET, SOCK_STREAM, IPPROTO_TCP }, // TCP/IP stream socket
{ PF_INET, SOCK_DGRAM, IPPROTO_UDP}, // UDP datagram socket
{ PF_UNSPEC, SOCK_DGRAM , 0 },
{ PF_LOCAL, SOCK_DGRAM , 0 },
{ PF_UNIX, SOCK_DGRAM , 0 },
{ PF_FILE, SOCK_DGRAM , 0 },
{ PF_INET, SOCK_DGRAM , 0 },
// { PF_AX, SOCK_DGRAM , 0 },
{ PF_IPX, SOCK_DGRAM , 0 },
{ PF_APPLETALK, SOCK_DGRAM , 0 },
{ PF_NETROM, SOCK_DGRAM , 0 },
{ PF_BRIDGE, SOCK_DGRAM , 0 },
{ PF_ATMPVC, SOCK_DGRAM , 0 },
// { PF_X, SOCK_DGRAM , 0 },
{ PF_INET, SOCK_DGRAM , 0 },
{ PF_ROSE, SOCK_DGRAM , 0 },
{ PF_DECnet, SOCK_DGRAM , 0 },
{ PF_NETBEUI, SOCK_DGRAM , 0 },
{ PF_SECURITY, SOCK_DGRAM , 0 },
{ PF_KEY, SOCK_DGRAM , 0 },
{ PF_NETLINK , SOCK_DGRAM , 0 },
{ PF_ROUTE , SOCK_DGRAM , 0 },
{ PF_PACKET, SOCK_DGRAM , 0 },
{ PF_ASH, SOCK_DGRAM , 0 },
{ PF_ECONET, SOCK_DGRAM , 0 },
{ PF_ATMSVC, SOCK_DGRAM , 0 },
{ PF_SNA, SOCK_DGRAM , 0 },
{ PF_IRDA, SOCK_DGRAM , 0 },
{ PF_MAX, SOCK_DGRAM , 0 },
{ AF_UNSPEC , SOCK_DGRAM , 0 },
{ AF_LOCAL , SOCK_DGRAM , 0 },
{ AF_UNIX , SOCK_DGRAM , 0 },
{ AF_FILE , SOCK_DGRAM , 0 },
{ AF_INET, SOCK_DGRAM , 0 },
{ AF_AX25, SOCK_DGRAM , 0 },
{ AF_IPX , SOCK_DGRAM , 0 },
{ AF_APPLETALK , SOCK_DGRAM , 0 },
{ AF_NETROM , SOCK_DGRAM , 0 },
{ AF_BRIDGE , SOCK_DGRAM , 0 },
{ AF_ATMPVC , SOCK_DGRAM , 0 },
{ AF_X25 , SOCK_DGRAM , 0 },
{ AF_INET6 , SOCK_DGRAM , 0 },
{ AF_ROSE , SOCK_DGRAM , 0 },
{ AF_DECnet , SOCK_DGRAM , 0 },
{ AF_NETBEUI , SOCK_DGRAM , 0 },
{ AF_SECURITY , SOCK_DGRAM , 0 },
// { pseudo_AF_KEY , SOCK_DGRAM , 0 },
{ AF_NETLINK , SOCK_DGRAM , 0 },
{ AF_ROUTE , SOCK_DGRAM , 0 },
{ AF_PACKET , SOCK_DGRAM , 0 },
{ AF_ASH , SOCK_DGRAM , 0 },
{ AF_ECONET , SOCK_DGRAM , 0 },
{ AF_ATMSVC , SOCK_DGRAM , 0 },
{ AF_SNA , SOCK_DGRAM , 0 },
{ AF_IRDA , SOCK_DGRAM , 0 },
{ AF_MAX , SOCK_DGRAM , 0 },
};
int main(int argc, char * argv[]){
int s, i;
struct protoent * p;
setprotoent(0);
for(i = 0 ; i < sizeof(conf_list) / sizeof(struct socket_conf) ; i++) {
p = getprotobynumber(conf_list[i].socket_family);
printf("Index %d", i);
if(p != NULL)
printf(" prot %s", p->p_name);
printf(" : ");
fflush(stdout);
s = socket(conf_list[i].socket_family,
conf_list[i].socket_type,
conf_list[i].protocol
);
if( s == -1)
perror("socket()");
else
printf("ok\n");
fflush(stdout);
}
endprotoent();
return 1;
}
next prev parent reply other threads:[~2012-08-27 13:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-24 16:14 Gianfar ethernet drop package Aníbal Almeida Pinto
2012-08-24 18:17 ` Eric Dumazet
2012-08-27 10:32 ` Aníbal Almeida Pinto
2012-08-27 11:08 ` Eric Dumazet
2012-08-27 13:01 ` Aníbal Almeida Pinto [this message]
2012-08-27 13:32 ` Eric Dumazet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=503B6FA7.8070807@efacec.com \
--to=anibal.pinto@efacec.com \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).