J
Jonathan
I am hoping that someone more experienced than myself can point me towards
what might be the fastest data lookup method to use for storing ip
addresses. My situation is that I will need to maintain a list of perhaps 50
ip addresses to be used in a packet sniffing application. For each packet
that goes through the application (which will be monitoring all traffic
through a switch), I need to see if an entry for the source ip of that
packet already exists in the list, and if not, add it.
My ip list is not going to be too large (perhaps 50-100 items at a time),
but I am going to be constantly searching the list every time a packet is
received, which could be an incredible burden if doing a simple linear
search on a linked list.
What would be the best possible implementation for my situation? A binary
search (slightly faster), a hash table which hashes the ip as a 32 bit
integer or a string, anything else?
Thanks in advance!
Jonathan Halterman
what might be the fastest data lookup method to use for storing ip
addresses. My situation is that I will need to maintain a list of perhaps 50
ip addresses to be used in a packet sniffing application. For each packet
that goes through the application (which will be monitoring all traffic
through a switch), I need to see if an entry for the source ip of that
packet already exists in the list, and if not, add it.
My ip list is not going to be too large (perhaps 50-100 items at a time),
but I am going to be constantly searching the list every time a packet is
received, which could be an incredible burden if doing a simple linear
search on a linked list.
What would be the best possible implementation for my situation? A binary
search (slightly faster), a hash table which hashes the ip as a 32 bit
integer or a string, anything else?
Thanks in advance!
Jonathan Halterman