raven icon indicating copy to clipboard operation
raven copied to clipboard

Where does raven0 link gets its parentIndex?

Open suyuee opened this issue 1 year ago • 5 comments

I noticed in our setup the wireguard fails to set up properly sometimes. due to

 error syncing event gw-lambdalabs: fail to ensure wireguar link: error getting default link to: 10.0.95.21, error get vxlan parent with index 0: invalid argument 

So the problems is the parent index is 0;

code pointer: https://github.com/openyurtio/raven/blob/3197c5ddcc483f5b448a315076d94498f649ada8/pkg/networkengine/routedriver/vxlan/utils.go#L261-L266

But it seems when creating the vxlan link, the code doesn't actually specify a parentIndex here: https://github.com/openyurtio/raven/blob/3197c5ddcc483f5b448a315076d94498f649ada8/pkg/networkengine/routedriver/vxlan/vxlan.go#L264-L274

When searching the netlink repo, I don't see the parentIndex field set for vxlan links (not sure if it's https://github.com/vishvananda/netlink/blob/77df5d35f725f10c8ca5f5552c95782fd639b46c/link_linux.go#L2098)

Any thoughts? Thanks in advance

suyuee avatar Oct 24 '23 22:10 suyuee

Also seems when there isn't such an error ("error get vxlan parent"...), seems the code path is not triggered and ParentIndex is 0 as well.

suyuee avatar Oct 24 '23 22:10 suyuee

Also seems when there isn't such an error ("error get vxlan parent"...), seems the code path is not triggered and ParentIndex is 0 as well.

Why your default route is point to a vxlan interface?usually it will point to eth0

njucjc avatar Oct 25 '23 02:10 njucjc

ah... I think it's due to our customization, on our edge side, nodes can't talk to each other with their private ip directly; we have to rely on vxlan; that should be why

I think I should just customize it further and do not check parent index of the vxlan? seems it's just never set. Not sure if doing this for raven also makes sense through; the other approach is to set parent index during vxlan creation

suyuee avatar Oct 25 '23 17:10 suyuee

ah... I think it's due to our customization, on our edge side, nodes can't talk to each other with their private ip directly; we have to rely on vxlan; that should be why

I think I should just customize it further and do not check parent index of the vxlan? seems it's just never set. Not sure if doing this for raven also makes sense through; the other approach is to set parent index during vxlan creation

@suyuee I'm not sure if vxlan(raven0) over vxlan (your own vxlan interface) can be supported in raven or not, but the following check can be remove exactly.

 if vxLink, ok := link.(*netlink.Vxlan); ok { 
 	link, err = netlinkutil.LinkByIndex(vxLink.ParentIndex) 
 	if err != nil { 
 		return nil, fmt.Errorf("error get vxlan parent: %v", err) 
 	} 
 } 

can you open a pr to fix it ?

njucjc avatar Oct 26 '23 02:10 njucjc

Thanks for the insights, will open a pr for it. (kinda busy recently, but will do once I get a chance)

Btw, we don't use vxlan over vxlan, but just using raven vxlan fwiw

suyuee avatar Oct 26 '23 04:10 suyuee