New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ACL]: Optimize DASH ACL by introducing cluster tag #336
Changes from all commits
9048551
e9a38b2
e62ac0a
ee67783
a245bf5
54556af
8a1ef51
b84c4ef
16457a5
f993969
f27ec5f
8cc3eb8
afa951d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -268,6 +268,34 @@ control dash_ingress( | |
} | ||
} | ||
|
||
action set_src_tag(tag_map_t tag_map) { | ||
meta.src_tag_map = tag_map; | ||
} | ||
|
||
@name("src_tag|dash_tag") | ||
table src_tag { | ||
key = { | ||
meta.src_ip_addr : lpm @name("meta.src_ip_addr:sip"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. match type: prefix_list There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think here shouldn't be a list. AFAIK, one prefix can belong to multiple clusters with different tags, So the prefix list will be separated into the tag table. Otherwise if it's prefix_list, it's hard to solve the following case: Because we have to dynamically create a new entry for prefix(C)=>tag1, tag2. And if the C was updated, we need also update all entries that include prefix(C). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you have a scenario where eg. 10.0.0.0/8 -> tag1, 10.1.0.0/16 -> tag2.. How do you expect lpm match here to resolve and assign tags? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Assumption of 1 prefix matching and 1 tag assignment. What if there are multiple prefixes matching to 1 tag (overlapping prefixes matching to 1 tag)? (A tag is simply a list of prefixes). |
||
} | ||
actions = { | ||
set_src_tag; | ||
} | ||
} | ||
|
||
action set_dst_tag(tag_map_t tag_map) { | ||
meta.dst_tag_map = tag_map; | ||
} | ||
|
||
@name("dst_tag|dash_tag") | ||
table dst_tag { | ||
key = { | ||
meta.dst_ip_addr : lpm @name("meta.dst_ip_addr:dip"); | ||
} | ||
actions = { | ||
set_dst_tag; | ||
} | ||
} | ||
|
||
apply { | ||
|
||
/* Send packet on same port it arrived (echo) by default */ | ||
|
@@ -348,6 +376,10 @@ control dash_ingress( | |
} | ||
acl_group.apply(); | ||
|
||
src_tag.apply(); | ||
dst_tag.apply(); | ||
|
||
|
||
if (meta.direction == direction_t.OUTBOUND) { | ||
outbound.apply(hdr, meta); | ||
} else if (meta.direction == direction_t.INBOUND) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
match type: optional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is here optional?
E.G. If the source IP of packet belong to tag 1 and 2, and this ACL rule is applied to tag 2 and 3, it should be matched. If another ACL rule is applied to tag 3 and 4, it should be mismatched.
I'm not sure whether the optional match_kind can meet above behaviors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A case is if a prefix belongs to tags, A, B, C, D (1111) and an ACL rule is applied to tags A, C(1010).
If my understanding is correct, to the match_kind, optional. the mask should be 1111, which implies
tag (1111) & mask(1111) != target_tag(1010)
.But to the match_kind, ternary, the mask will be 1010. So the rule will be matched due to
tag(1111) & mask(1010) = target_tag(1010)
.