google / gvisor

Application Kernel for Containers
https://gvisor.dev
Apache License 2.0
15.62k stars 1.28k forks source link

Support more advanced routing decisions #3938

Open ghananigans opened 4 years ago

ghananigans commented 4 years ago

The current routing table an array of tcpip.Route is basic and supports simple use cases.

// Route is a row in the routing table. It specifies through which NIC (and
// gateway) sets of packets should be routed. A row is considered viable if the
// masked target address matches the destination address in the row.
type Route struct {
    // Destination must contain the target address for this row to be viable.
    Destination Subnet

    // Gateway is the gateway to be used if this row is viable.
    Gateway Address

    // NIC is the id of the nic to be used if this row is viable.
    NIC NICID
}

More advanced use cases such as what ip route supports can not be done with our current implementation. E.g., marking routes with MTUs or marking routesas unreachable, blackholes, prohibited, broadcast, local, onlink etc. More examples can be found in documentation for ip route (https://linux.die.net/man/8/ip).

ghananigans commented 4 years ago

Related #508, #578, #595, #3911

ghananigans commented 4 years ago

cc: @tamird @hbhasker @brunowonka

brunowonka commented 4 years ago

Does this issue intend to cover ip rule (policy-based routing or RPDB) or should we create a new one? They're not exactly the same thing, but multiple tables and policy are also part of "more advanced routing decisions"

hbhasker commented 4 years ago

RPDB also doesn't exist in gVisor so we probably should file a separate bug for that.