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.
That's why I said "First off ..." ;)
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?
No.
Even with fixed details, you would normally need to allow broadcast packets to be received.
Read up on how ARP works.
View all questions in Keil forum