Author Topic: Any micros with ETH and hardware incoming packet filtering by IP?  (Read 4384 times)

0 Members and 1 Guest are viewing this topic.

Offline wek

  • Frequent Contributor
  • **
  • Posts: 495
  • Country: sk
Re: Any micros with ETH and hardware incoming packet filtering by IP?
« Reply #25 on: August 10, 2022, 08:21:04 am »
is is becoming a pointless discussion without having more details on the original problem
It's always a pointless discussion without precise problem formulation in the mcu realm. But it's fun to discuss vaguely defined problems. Well, that's a point, after all, I guess.... :-)

Receiving broadcasts is important.
Maybe not. Microcontrollers are not small computers (same as children are not small people). In quite typical mcu TCP/IP usage, you need to listen to broadcasts only while somebody "tries to find you" (ARP); once connection is established, you can filter broadcasts reception off if possible, for benefit of the unicast communication.

Broadcast density on a properly operating LAN should be low.
Tell the manufacturers of common office equipment (yes, Canon, I see you).

JW
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13748
  • Country: gb
    • Mike's Electric Stuff
Re: Any micros with ETH and hardware incoming packet filtering by IP?
« Reply #26 on: August 10, 2022, 09:11:05 am »
Receiving broadcasts is important.
Maybe not. Microcontrollers are not small computers (same as children are not small people). In quite typical mcu TCP/IP usage, you need to listen to broadcasts only while somebody "tries to find you" (ARP); once connection is established, you can filter broadcasts reception off if possible, for benefit of the unicast communication.
..except you never know when a remote host may get reset and need to do another ARP request
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline wek

  • Frequent Contributor
  • **
  • Posts: 495
  • Country: sk
Re: Any micros with ETH and hardware incoming packet filtering by IP?
« Reply #27 on: August 10, 2022, 10:19:06 am »
Receiving broadcasts is important.
Maybe not. Microcontrollers are not small computers (same as children are not small people). In quite typical mcu TCP/IP usage, you need to listen to broadcasts only while somebody "tries to find you" (ARP); once connection is established, you can filter broadcasts reception off if possible, for benefit of the unicast communication.
..except you never know when a remote host may get reset and need to do another ARP request
While talking to me?

JW
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13748
  • Country: gb
    • Mike's Electric Stuff
Re: Any micros with ETH and hardware incoming packet filtering by IP?
« Reply #28 on: August 10, 2022, 10:23:41 am »
Receiving broadcasts is important.
Maybe not. Microcontrollers are not small computers (same as children are not small people). In quite typical mcu TCP/IP usage, you need to listen to broadcasts only while somebody "tries to find you" (ARP); once connection is established, you can filter broadcasts reception off if possible, for benefit of the unicast communication.
..except you never know when a remote host may get reset and need to do another ARP request
While talking to me?

JW
No, but trying to decide when to listen for broadcast, and do the right thing in all situations is tricky.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline wek

  • Frequent Contributor
  • **
  • Posts: 495
  • Country: sk
Re: Any micros with ETH and hardware incoming packet filtering by IP?
« Reply #29 on: August 10, 2022, 10:50:06 am »
No, but trying to decide when to listen for broadcast, and do the right thing in all situations is tricky.
EnableBroadcastRx();
while(1) {
  if (SomebodyWantsToTalkToMe()) {
    DisableBroadcastRx();
    do {
      Talk();
    } while (IsThereStillAnythingToTalkAbout());
    Disconnect();
    EnableBroadcastRx();
  }
}

?

JW
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
Re: Any micros with ETH and hardware incoming packet filtering by IP?
« Reply #30 on: August 10, 2022, 11:06:15 am »
You might want to handle ARP requests from other hosts. Some DHCP implementations use ARP to verify IP addresses are available. So ARP might not be the best example. IMHO you should make sure your device doesn't discard basic network management messages (ARP, Ping) on purpose. There is still a huge amount of other broadcast traffic that can be filtered though.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13748
  • Country: gb
    • Mike's Electric Stuff
Re: Any micros with ETH and hardware incoming packet filtering by IP?
« Reply #31 on: August 10, 2022, 11:20:01 am »
No, but trying to decide when to listen for broadcast, and do the right thing in all situations is tricky.
EnableBroadcastRx();
while(1) {
  if (SomebodyWantsToTalkToMe()) {
    DisableBroadcastRx();
    do {
      Talk();
    } while (IsThereStillAnythingToTalkAbout());
    Disconnect();
    EnableBroadcastRx();
  }
}

?

JW
The devil is in the detail - things like "IsThereStillAnythingToTalkAbout()" inevitably involve timeouts and other decisions which could come back to bite you down the line. 
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 
The following users thanked this post: nctnico

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 3697
  • Country: gb
  • Doing electronics since the 1960s...
Re: Any micros with ETH and hardware incoming packet filtering by IP?
« Reply #32 on: August 10, 2022, 01:04:10 pm »
The danger isn't in getting hit with broadcasts at 1Hz or even 10Hz, 24/7, because nobody will notice that. It is whether you are happy to have your product more or less hang if some other bit of kit on the LAN has a bug and starts emitting broadcasts at 10kHz.

The average customer will probably not have the on site capability to discover what is going on.

The solution, as already mentioned, is to either poll the ETH RX, or use interrupts for ETH RX and have a scheme for backing off the IRQ enable according to some rule (which is a bit of work, especially as you need to actually test it ;) ).

In the embedded world, actually very few products need 100mbps data rates. We are not building routers (which are mostly linux boxes nowadays, with fairly decent CPUs). I bet you most embedded (IOT) stuff would be just fine with 1mbps. I am polling at 100Hz and getting 2.5mbps.

If you put your IOT on an open port, you will be getting login attempts (dictionary attacks) at 1Hz-5Hz  :-DD
« Last Edit: August 10, 2022, 01:05:50 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline wek

  • Frequent Contributor
  • **
  • Posts: 495
  • Country: sk
Re: Any micros with ETH and hardware incoming packet filtering by IP?
« Reply #33 on: August 10, 2022, 01:59:32 pm »
Quote
The devil is in the detail - things like "IsThereStillAnythingToTalkAbout()" inevitably involve timeouts and other decisions which could come back to bite you down the line. 

You've just described the gist of mcu programming, regardless of IP/ETH/filtering/whatever... ;-)

JW
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf