Networking Forums

Networking Forums > Computer Networking > Linux Networking > Timeout For ARP Requests To Invalid IP Takes Too Long

Reply
Thread Tools Display Modes

Timeout For ARP Requests To Invalid IP Takes Too Long

 
 
Aaron Manning
Guest
Posts: n/a

 
      09-11-2003, 07:16 PM
Greetings all,

I'm using kernel 2.4.19-uc1 and having difficulty with the
gethostbyname() function to resolve a hostname. What I'm seeing
(through a packet sniffer) is that when calling the function
gethostbyname(<hostname>) I'm seeing ARP REQUESTS to an invalid DNS
server ip (I programmed it this way) and it's taking in excess of 1
minute for the ARP REQUESTS to finally finish (give up on ARP), at
which point the gethostbyname() function will finally return (with the
proper error code). This seems to me an extremely long time to try to
validate the IP. I have a 30 second software task watchdog which will
always timeout, and my system will reset because of this long delay.

Is this the proper functionality for retrying ARP REQUESTS and if
not, has there been a fix or does anyone have any ideas of how else to
proceed?

Thank you in advance,
Aaron Manning
 
Reply With Quote
 
 
 
 
Bill Unruh
Guest
Posts: n/a

 
      09-11-2003, 11:08 PM
(E-Mail Removed) (Aaron Manning) writes:

]Greetings all,

] I'm using kernel 2.4.19-uc1 and having difficulty with the
]gethostbyname() function to resolve a hostname. What I'm seeing
](through a packet sniffer) is that when calling the function
]gethostbyname(<hostname>) I'm seeing ARP REQUESTS to an invalid DNS
]server ip (I programmed it this way) and it's taking in excess of 1

Well, perhaps the solution is not to program it in this way. Why are yousending
your dns requests off on a wild goose chase?

]minute for the ARP REQUESTS to finally finish (give up on ARP), at
]which point the gethostbyname() function will finally return (with the

gethostbyname will look in /etc/hosts first so if this is an often used address,
put it into /etc/hosts.

]proper error code). This seems to me an extremely long time to try to
]validate the IP. I have a 30 second software task watchdog which will
]always timeout, and my system will reset because of this long delay.

] Is this the proper functionality for retrying ARP REQUESTS and if
]not, has there been a fix or does anyone have any ideas of how else to
]proceed?

]Thank you in advance,
]Aaron Manning
 
Reply With Quote
 
Aaron Manning
Guest
Posts: n/a

 
      09-12-2003, 12:52 PM
(E-Mail Removed) (Bill Unruh) wrote in message news:<bjqv8n$s0a$(E-Mail Removed)>...
> (E-Mail Removed) (Aaron Manning) writes:
>
> ]Greetings all,
>
> ] I'm using kernel 2.4.19-uc1 and having difficulty with the
> ]gethostbyname() function to resolve a hostname. What I'm seeing
> ](through a packet sniffer) is that when calling the function
> ]gethostbyname(<hostname>) I'm seeing ARP REQUESTS to an invalid DNS
> ]server ip (I programmed it this way) and it's taking in excess of 1
>
> Well, perhaps the solution is not to program it in this way. Why are yousending
> your dns requests off on a wild goose chase?


The user has the ability to program an eeprom option which is the ip
of the dns server. Generally they should program the correct ip address
of the server, but in the case that they make a mistake or the dns
server is not working, the "wild goose chase" hangs the system.


>
> ]minute for the ARP REQUESTS to finally finish (give up on ARP), at
> ]which point the gethostbyname() function will finally return (with the
>
> gethostbyname will look in /etc/hosts first so if this is an often used address,
> put it into /etc/hosts.
>
> ]proper error code). This seems to me an extremely long time to try to
> ]validate the IP. I have a 30 second software task watchdog which will
> ]always timeout, and my system will reset because of this long delay.
>
> ] Is this the proper functionality for retrying ARP REQUESTS and if
> ]not, has there been a fix or does anyone have any ideas of how else to
> ]proceed?
>
> ]Thank you in advance,
> ]Aaron Manning

 
Reply With Quote
 
Creideiki
Guest
Posts: n/a

 
      09-12-2003, 01:58 PM
On 12 Sep 2003 05:52:24 -0700, Aaron Manning <(E-Mail Removed)> wrote:
> (E-Mail Removed) (Bill Unruh) wrote in message news:<bjqv8n$s0a$(E-Mail Removed)>...
>> (E-Mail Removed) (Aaron Manning) writes:
>>
>> ]Greetings all,
>>
>> ] I'm using kernel 2.4.19-uc1 and having difficulty with the
>> ]gethostbyname() function to resolve a hostname. What I'm seeing
>> ](through a packet sniffer) is that when calling the function
>> ]gethostbyname(<hostname>) I'm seeing ARP REQUESTS to an invalid DNS
>> ]server ip (I programmed it this way) and it's taking in excess of 1
>>
>> Well, perhaps the solution is not to program it in this way. Why are yousending
>> your dns requests off on a wild goose chase?

>
> The user has the ability to program an eeprom option which is the ip
> of the dns server. Generally they should program the correct ip address
> of the server, but in the case that they make a mistake or the dns
> server is not working, the "wild goose chase" hangs the system.
>

[...]

So you are writing the program making the gethostbyname, and you
are testing what happens when there is no valid nameserver, right?

Sounds like what you are looking for is a shorter timeout over the
gethostbyname call. You could write a wrapper function that forks
off a new process, sets up a short timeout via alarm(2), then tries the
real gethostbyname(). If SIGALRM is caught, return a null host
name.

You'd probably want some mechanism to avoid retrying the real
gethostbyname() again too soon, just to avoid burdening the system
with aborted attempts to resolve names. perhaps by checking
/proc/net/arp to see if the name server IP has a good arp entry.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Could you tell why BGP convergence takes so long? SeungWeon Park Network Routers 0 02-26-2007 01:41 PM
Windows client takes too long to get in. sukhan Windows Networking 3 06-27-2006 09:38 PM
anybody know how long it takes BT to remove a DACS? Alex Boosbeck Broadband 6 02-24-2005 10:59 AM
Xp pro log in takes to long =?Utf-8?B?Um9iZXJ0IEs=?= Windows Networking 2 12-13-2003 10:10 PM
Ping with name takes long time Peter Gunreben Linux Networking 0 11-15-2003 06:19 AM



1 2 3 4 5 6 7 8 9 10 11