Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@electricjesus
Copy link

@electricjesus electricjesus commented Nov 12, 2025

Introduces DSCPMagicMark constant (0x17) and adds iptables rule to redirect TCP packets with matching DSCP mark to ztunnel inbound port (15008).

Please provide a description of this PR:

Introduces DSCPMagicMark constant (0x17) and adds iptables rule to redirect
TCP packets with matching DSCP mark to ztunnel inbound port (15008).
@istio-testing istio-testing added the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label Nov 12, 2025
@istio-policy-bot
Copy link

😊 Welcome @electricjesus! This is either your first contribution to the Istio istio repo, or it's been
a while since you've been here.

You can learn more about the Istio working groups, Code of Conduct, and contribution guidelines
by referring to Contributing to Istio.

Thanks for contributing!

Courtesy of your friendly welcome wagon.

@linux-foundation-easycla
Copy link

CLA Not Signed

@istio-testing istio-testing added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. needs-ok-to-test labels Nov 12, 2025
@istio-testing
Copy link
Collaborator

Hi @electricjesus. Thanks for your PR.

I'm waiting for a istio member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@electricjesus
Copy link
Author

Hi all! this is still a draft. We're still working on a few things related to this here over at ProjectCalico.


iptablesBuilder.AppendRule(ChainInpodPrerouting, "nat",
"-p", "tcp",
"-m", "dscp", "--dscp", fmt.Sprintf("%#x", config.DSCPMagicMark),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be the best way to do this since this modifies the ip header and doesn't have the same issues a mark on the skb would have.

This comment was marked as outdated.


iptablesBuilder.AppendRule(ChainInpodPrerouting, "nat",
"-p", "tcp",
"-m", "dscp", "--dscp", fmt.Sprintf("%#x", config.DSCPMagicMark),

This comment was marked as outdated.

ZtunnelInboundPort = 15008
ZtunnelOutboundPort = 15001
ZtunnelInboundPlaintextPort = 15006
DSCPMagicMark = 0x17 // FIXME: needs to be configurable

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keithmattix with strict mode can't we just redirect all ingressing traffic to port 15008? This is more relevant for the permissive mode? Or Do I just not fully understand strict vs permissive mode?

@sridhargaddam
Copy link
Contributor

Introduces DSCPMagicMark constant (0x17) and adds iptables rule to redirect TCP packets with matching DSCP mark to ztunnel inbound port (15008).

What’s the exact use case here? If there’s a design doc or any background info on why we are planning to add a DSCP mark to the traffic, could someone share it?

@MikeZappa87
Copy link

MikeZappa87 commented Nov 15, 2025

Introduces DSCPMagicMark constant (0x17) and adds iptables rule to redirect TCP packets with matching DSCP mark to ztunnel inbound port (15008).

What’s the exact use case here? If there’s a design doc or any background info on why we are planning to add a DSCP mark to the traffic, could someone share it?

The use case is most likely the fact that ztunnel using dst port 15008 and not the original dst port and this interfers with other network plugins network policy especially in the case of L4 enforcement (L5 is a different story). Since the dst port is no longer 15008, nothing will receive on the ztunnel inbound listener socket, so the change is using iptables Redirect action to do this and use the get original dst sock opt to get the original 5 tuple. istio isn't a full network plugin and relies on the calico, ciliums, or whoever to provide the pod networking. That at least is use case/background that I have (we have already POC'd this a couple months ago). This isn't enabled by default as well which means the user would need to enable this. However the design document to iron out the design decisions would be helpful :-) I am also curious if that document has any throughput/latency metrics.

ZtunnelInboundPort = 15008
ZtunnelOutboundPort = 15001
ZtunnelInboundPlaintextPort = 15006
DSCPMagicMark = 0x17 // FIXME: needs to be configurable

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to making this configurable. Depending on the design decision here, we should possibly make sure we use a relevant value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. needs-ok-to-test size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants