This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

lpc1857 ethernet filter settings

Hello,
I'm developing an application using the LPC1857 Starter Kit.
I need to filter the broadcast incoming packet.

I tried to set the MAC_FRAME_FILTER as in the follow:

LPC_ETHERNET->MAC_FRAME_FILTER = MFFR_DBF;           /* Disable Broadcase Frames */

but in this way I can't receive any packet.

Could someone explain me how to set the Ethernet address to block broadcast packet?

Thanks in advance.

Giovanni

  • I need to filter the broadcast incoming packet.

    Do you understand the ramifications of disabling detection of incoming broadcast packets?

    Lots of normal network operations are likely to fail. First off, don't use DHCP to acquire a network address. It relies on broadcasts.

  • Not just DHCP likes broadcasts.

    How fun when a computer/switch sends out an ARP request: Who has IP number x.y.z.w, and the unit with that IP number doesn't hear the broadcast, so will not respond back and inform about the MAC address to use.

  • Not just DHCP likes broadcasts.

    That's why I said "First off ..." ;)

    I need to filter the broadcast incoming packet.

    It is fun seeing how these budding developers seem to believe that they need to do these crazy things.

  • Thank you for reply.

    I'm sorry,
    may be I was not so clear.

    I'm developing an application on LPC1857 to acquire data from a device and send those acquired data to a PC.
    The communication between LPC1857 and PC is based on UDP protocol.
    I think I don't need DHCP because the IP address of LPC1857 is fixed and also the IP of my PC is fixed.

    I'd like to receive packets addressed to me, so I want to discard broadcast packets and packets not addressed to me.

    The problem is that I don't understand how to set LPC18 registers to accomplish ethernet filtering.

  • I think I don't need DHCP because the IP address of LPC1857 is fixed and also the IP of my PC is fixed.

    You need to read (and understand) Per Westermarks response. Even with fixed IP addresses, broadcasts are normally first used to establish MAC addresses. There are ways around this, but I suspect you are not aware of them

  • You are right, but:
    - my LPC1857 has the own MAC address (always the same).
    - the PC is dedicated for this application so the MAC address is always the same.
    - about the IP address of LPC1857 and the IP address of the PC, they are always the same.

    What is important for my application is do not overload the LPC1857 with unnecessary packets.

    I think that the way to do this is to set the Frame Filter to discard unnecessary packets.

    It is right?

  • It is right?

    No.

    Even with fixed details, you would normally need to allow broadcast packets to be received.

    Read up on how ARP works.

  • For general-purpose it's irrelevant that your PC and your board has a fixed MAC address. That's what "all" network interfaces normally has.

    But you don't normally communicate using MAC addresses.

    You normally communicate using hostnames.

    And the hostnames gets translated to IP numbers.

    And the IP numbers of the neighbor equipment gets translated to MAC addresses - unless you have pre-populated the ARP table of the sending machine, this is done by sending out an ARP broadcast trying to locate any device that responds to the destination IP and have that device report back the hardware address.

    If you have a switch between the PC and the board, then the switch wants to listen to this ARP traffic so it will be able to know exactly which switch port to send the data to. It's the ability to keep lists of spotted hardware addresses for the individual ports that is the reason a switch is so much more efficient than a hub.

    If your board is connected to a dedicated port of a switch, then it will only receive packets that are broadcast or that are specifically addressed to your board. And you really shouldn't have such broadcast storms that your board can't handle the broadcasts that happens - else it's time to "repair" your network and kick out the naughty equipment that sends out such huge amounts of broadcasts.

  • I'm sorry,
    I understand, but I have a peer-to-peer connection between LP18 and PC.

  • Why do you bother to ask questions if you refuse to listen to the answers you receive? Why not just continue to hit your head into the wall if that makes you happy?