Skip to content

Layer 3 routing program & IN keyword should support longest-prefix match #42

@adferguson

Description

@adferguson

As Rodrigo pointed out, our Layer 3 routing program:

ON ip_packet(pkt):
  DO forward(new) WHERE
    subnets(addr, mask, ANY, new.dlSrc, pkt.locSw, new.locPt, ANY)
    and pkt.nwDst IN addr/mask;

does not currently do longest-prefix matching, as a real router would do.

@tnelson -- probably we should make the semantics of IN match the longest prefix in the table. so this would be a change in how FIn is transformed, correct? currently it is just transformed to in_ipv4_range.

note that this is a change from how we currently handle multiple values coming from the table. in this case, multiple values returned by in_ipv4_range would then be further refined so that only the longest prefix matches.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions