Skip to content

Bug in the load balancing exercise #669

@adityanathan

Description

@adityanathan

In the load balancing exercise (exercises/load_balance), the ecmp_group table should drop any packets that do not match any of the destination IP addresses contained in the table (which only contains 10.0.0.1 in the exercise). This is achieved through mark_to_drop(), which modifies the standard_metadata.egress_spec field to a special value (-1 in BMv2). However, the solution applies the ecmp_nhop table immediately after the ecmp_group table. Even if the ecmp_group table does not populate the meta.ecmp_select field, the field will contain the default value of 0, which results in a hit in the ecmp_nhop table. This results in the ecmp_nhop table altering the egress_spec field and other fields to valid values. Instead of dropping the packet, the packet is forwarded to the host corresponding to meta.ecmp_select = 0.

This could be fixed by setting meta.ecmp_select to be -1 or greater than ecmp_count in the apply body of the ingress pipeline before either table of the ingress pipeline is applied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions