Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - io-pkt and route cache?: (6 Items)
   
io-pkt and route cache?  
Hi,

We implemented some API's to Add/delete and flush routes. The code is based along the same lines as route application. 
But Im seeing a strange behavior. When our system comes up, it programmatically configures an ethernet interface using 
ioctl calls followed by adding a default route. The routing table reflects the right setting. So far so good. However if
 I try to ping the gateway, it doesnt work.

If I then delete the route using route delete command and then add the same route back, things start working.

Is there some sort of a route cache that needs to be flushed before we begin adding/removing entries from the routing 
table?

Help please!

Thanks,
Santosh
Re: io-pkt and route cache?  
> Hi,
> 
> We implemented some API's to Add/delete and flush routes. The code is based 
> along the same lines as route application. But Im seeing a strange behavior. 
> When our system comes up, it programmatically configures an ethernet interface
>  using ioctl calls followed by adding a default route. The routing table 
> reflects the right setting. So far so good. However if I try to ping the 
> gateway, it doesnt work.
> 
> If I then delete the route using route delete command and then add the same 
> route back, things start working.
> 
> Is there some sort of a route cache that needs to be flushed before we begin 
> adding/removing entries from the routing table?
> 
> Help please!
> 
> Thanks,
> Santosh

Santosh,

As a shot into the dark from my side:
Try flushig ARP cache 

arp -d -a

Hope this helps.
Jeevan



Re: io-pkt and route cache?  
I will first agree with Jeevan.
Could you show your routing table and your arp table first when you can not reach your gateway?
And please show your routing table and arp table when you can reach your gateway.

take a look at what nestat shows will help too, for example: icmp layer, ip layer. 

In all stacks they all have routing cache, in your case you are sending out so in its inpcb it will keep a route cache 
too then it doesn't need to lookup routing table everytime but hard to tell where is wrong.
In Linux you can show routing cache too but for bsd I didn't find it yet.

If I were you I will use a hub and tcpdump to monitor whether the icmp packets is out or not and whether the dest mac is
 right too, then we can know whether stack is wrong.
Re: io-pkt and route cache?  
Hi Jeevan,

This doesnt work.

-Santosh
> > Hi,
> > 
> > We implemented some API's to Add/delete and flush routes. The code is based 
> 
> > along the same lines as route application. But Im seeing a strange behavior.
>  
> > When our system comes up, it programmatically configures an ethernet 
> interface
> >  using ioctl calls followed by adding a default route. The routing table 
> > reflects the right setting. So far so good. However if I try to ping the 
> > gateway, it doesnt work.
> > 
> > If I then delete the route using route delete command and then add the same 
> 
> > route back, things start working.
> > 
> > Is there some sort of a route cache that needs to be flushed before we begin
>  
> > adding/removing entries from the routing table?
> > 
> > Help please!
> > 
> > Thanks,
> > Santosh
> 
> Santosh,
> 
> As a shot into the dark from my side:
> Try flushig ARP cache 
> 
> arp -d -a
> 
> Hope this helps.
> Jeevan
> 
> 
> 


Re: io-pkt and route cache?  
Hi Santosh,

As said it was just shot in the into the dark.

I have no Idea but for me tables are tables however they are decorated.
As Yao said You might want to show the relevant route tables and once it works once it doesn't work.

Maybe the others can help once You provide the parts of Your source  where You decorate Your table . Maybe this is just 
a decoration problem.  Another thought : Is this happening with all test hw setup or just with one special test-env.  
again and again?

-Dono-Jeevan


> Hi Jeevan,
> 
> This doesnt work.
> 
> -Santosh
Re: io-pkt and route cache?  
I can't really think off hand what might be happening.
Does it matter which driver is running?  The only
thing I can think of is to post your app and I could
give it a quick whirl here.

-seanb