Skip to content

netem experiments don't support ipv6 #773

@lernett

Description

@lernett

netem experiments (such as pod latency) don't actually support ipv6

tc requires "protocol ipv6" to work with ipv6 addresses (https://man7.org/linux/man-pages/man8/tc-u32.8.html), but current implementation always sets "protocol ip"

tc := fmt.Sprintf("sudo nsenter --net=%s tc filter add dev %v protocol ip parent 1:0 prio 3 u32 %s flowid 1:3", target.NetworkNsPath, netInterface, filter)

while ipv6 matching is used in the filter

if isIPV6 {
	filter = fmt.Sprintf("match ip6 dst %v", ip)
}

So instead of something like

nsenter -t 205408 -n tc filter add dev eth0 protocol ipv6 parent 1:0 prio 3 \
  u32 match ip6 dst 2001:db8:1:1::a:1/128 flowid 1:3

we get

nsenter -t 205408 -n tc filter add dev eth0 protocol ip parent 1:0 prio 3 \
  u32 match ip6 dst 2001:db8:1:1::a:1/128 flowid 1:3

and it doesn't work

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