Re: [etherlab-users] ethercat filtering
Hi Mike, You are right. But that does not explain, Why the interface gets packets eventhough the lan cable is removed. So, i am trying to figure out if the program is wrong or is there something going on which i am missing. You could try this on a laptop as well. Not sure whats going on.. Regards, Sriram On Tue, Feb 14, 2017 at 4:51 PM, Mike O'Connorwrote: > On 14/02/2017 9:48 PM, Mike O'Connor wrote: >> On 14/02/2017 9:41 PM, Sriram V wrote: >>> Hi mike, >>> >>> I understand that. This is a totallyu different question and pertains >>> to ethernet. >>> >>> I am just trying to find out on a normal ethernet network with 2 >>> interfaces whether a IP routing takes place. >>> I am using a raw socket and seem to packets even though ifconfig does >>> not show any increase in Rx Packets. >>> >> A raw socket is an IP packet with out any upper level protocol data, but >> it does had ip addresses so depending on your computers configuration ip >> packets can be routed between the two interfaces. >> >> But this mailing list is not the place for such a conversation, you need >> to have a read of ip routing fundamentals. >> >> >> Mike >> > Actually I'm wrong that example program uses raw Ethernet frames not raw > ip packets so there no route-able. > > > Mike > ___ etherlab-users mailing list etherlab-users@etherlab.org http://lists.etherlab.org/mailman/listinfo/etherlab-users
Re: [etherlab-users] ethercat filtering
On 14/02/2017 9:48 PM, Mike O'Connor wrote: > On 14/02/2017 9:41 PM, Sriram V wrote: >> Hi mike, >> >> I understand that. This is a totallyu different question and pertains >> to ethernet. >> >> I am just trying to find out on a normal ethernet network with 2 >> interfaces whether a IP routing takes place. >> I am using a raw socket and seem to packets even though ifconfig does >> not show any increase in Rx Packets. >> > A raw socket is an IP packet with out any upper level protocol data, but > it does had ip addresses so depending on your computers configuration ip > packets can be routed between the two interfaces. > > But this mailing list is not the place for such a conversation, you need > to have a read of ip routing fundamentals. > > > Mike > Actually I'm wrong that example program uses raw Ethernet frames not raw ip packets so there no route-able. Mike ___ etherlab-users mailing list etherlab-users@etherlab.org http://lists.etherlab.org/mailman/listinfo/etherlab-users
Re: [etherlab-users] ethercat filtering
On 14/02/2017 9:18 PM, Sriram V wrote: > Hello Mike, > > I tried running a simple packet sniffer on a Laptop with 2 ethernet > interfaces. Still i am seeing the same behaviour. > > On my laptop, I have 2 network interfaces eth0 and eth1. eth0 is the > lan and eth1 is the wlan. The Ethercat link must be on its own with a direct cable between the PC's Ethernet and the EtherCAT device, which if needed is then daisy chain to the next EtherCAT device. Mike ___ etherlab-users mailing list etherlab-users@etherlab.org http://lists.etherlab.org/mailman/listinfo/etherlab-users
Re: [etherlab-users] ethercat filtering
Hello Mike, I tried running a simple packet sniffer on a Laptop with 2 ethernet interfaces. Still i am seeing the same behaviour. On my laptop, I have 2 network interfaces eth0 and eth1. eth0 is the lan and eth1 is the wlan. I have created a raw socket and bound to eth0 using the below call. setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE, ifName, strlen(ifName) + 1 I am listening for raw ethernet packets on the eth0. I am getting packets even if i have removed the lan cable. I am not sure how the packets from eth1 and sent to eth0? My program is https://gist.github.com/austinmarton/2862515 I am not sure if there is any IP forwarding causing the issue. There is a procfs regarding ip forwarding turning it off or on. does not make any different. Thanks for your help. Regards, Sriram On Sat, Feb 11, 2017 at 3:54 PM, Mike O'Connorwrote: > Hi Sriram > > So it sounds like you have the cabling wrong, Ethercat networks must be > separated on a layer 2 network. Wired correctly you should never see the > Ethercat frames on both networks. > > Mike > > On 10/02/2017 10:59 PM, Sriram V wrote: >> Hi Mike, >> >> I have 2 ethernet ports. I am broadcasting ethercat packets on the >> network. This is received by both the ports. >> I want to allow ethercat packets ONLY to received by my raw socket >> which is bound to one port. >> On the other port - I want to allow ethernet packets with IP header >> only (non ethercat packets). >> >> Is this possible. >> >> Thanks, >> Sriram >> >> On Fri, Feb 10, 2017 at 12:31 PM, Mike O'Connor wrote: >>> On 10/02/2017 4:59 PM, Sriram V wrote: Hello, I wanted to check if i can allow only ethercat packets to be passed to app layer? Basically, I want to process only ethercat packets. Therefore, i want to kernel to filter out basic IP packets. Regards, Sriram ___ etherlab-users mailing list etherlab-users@etherlab.org http://lists.etherlab.org/mailman/listinfo/etherlab-users >>> The Ethercat packets are actually raw Ethernet frames, so I think you >>> need to explain what your issue is and from there the list might be able >>> to help. >>> >>> Mike >>> > ___ etherlab-users mailing list etherlab-users@etherlab.org http://lists.etherlab.org/mailman/listinfo/etherlab-users
Re: [etherlab-users] ethercat filtering
Hi Sriram So it sounds like you have the cabling wrong, Ethercat networks must be separated on a layer 2 network. Wired correctly you should never see the Ethercat frames on both networks. Mike On 10/02/2017 10:59 PM, Sriram V wrote: > Hi Mike, > > I have 2 ethernet ports. I am broadcasting ethercat packets on the > network. This is received by both the ports. > I want to allow ethercat packets ONLY to received by my raw socket > which is bound to one port. > On the other port - I want to allow ethernet packets with IP header > only (non ethercat packets). > > Is this possible. > > Thanks, > Sriram > > On Fri, Feb 10, 2017 at 12:31 PM, Mike O'Connorwrote: >> On 10/02/2017 4:59 PM, Sriram V wrote: >>> Hello, >>> >>> I wanted to check if i can allow only ethercat packets to be passed to >>> app layer? >>> >>> Basically, I want to process only ethercat packets. Therefore, i want >>> to kernel to filter out basic IP packets. >>> >>> Regards, >>> Sriram >>> ___ >>> etherlab-users mailing list >>> etherlab-users@etherlab.org >>> http://lists.etherlab.org/mailman/listinfo/etherlab-users >> The Ethercat packets are actually raw Ethernet frames, so I think you >> need to explain what your issue is and from there the list might be able >> to help. >> >> Mike >> ___ etherlab-users mailing list etherlab-users@etherlab.org http://lists.etherlab.org/mailman/listinfo/etherlab-users
Re: [etherlab-users] ethercat filtering
Hi Sriram, Are you trying to write an EtherCAT slave for a device with a dual ethernet controller ? Regards, --- Sebastien On 02/10/2017 01:29 PM, Sriram V wrote: Hi Mike, I have 2 ethernet ports. I am broadcasting ethercat packets on the network. This is received by both the ports. I want to allow ethercat packets ONLY to received by my raw socket which is bound to one port. On the other port - I want to allow ethernet packets with IP header only (non ethercat packets). Is this possible. Thanks, Sriram On Fri, Feb 10, 2017 at 12:31 PM, Mike O'Connorwrote: On 10/02/2017 4:59 PM, Sriram V wrote: Hello, I wanted to check if i can allow only ethercat packets to be passed to app layer? Basically, I want to process only ethercat packets. Therefore, i want to kernel to filter out basic IP packets. Regards, Sriram ___ etherlab-users mailing list etherlab-users@etherlab.org http://lists.etherlab.org/mailman/listinfo/etherlab-users The Ethercat packets are actually raw Ethernet frames, so I think you need to explain what your issue is and from there the list might be able to help. Mike ___ etherlab-users mailing list etherlab-users@etherlab.org http://lists.etherlab.org/mailman/listinfo/etherlab-users
Re: [etherlab-users] ethercat filtering
On 10/02/2017 4:59 PM, Sriram V wrote: > Hello, > > I wanted to check if i can allow only ethercat packets to be passed to > app layer? > > Basically, I want to process only ethercat packets. Therefore, i want > to kernel to filter out basic IP packets. > > Regards, > Sriram > ___ > etherlab-users mailing list > etherlab-users@etherlab.org > http://lists.etherlab.org/mailman/listinfo/etherlab-users The Ethercat packets are actually raw Ethernet frames, so I think you need to explain what your issue is and from there the list might be able to help. Mike ___ etherlab-users mailing list etherlab-users@etherlab.org http://lists.etherlab.org/mailman/listinfo/etherlab-users