Skip to content
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

Fix unable to send big UDP packets when SNAT rules are configured for nat46 #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

snrainw
Copy link

@snrainw snrainw commented Dec 12, 2023

In the IPv4->IPv6 direction, if SNAT rules are configured for nat46 (i.e. "iptables -A POSTROUTING -t nat -o clatd -j SNAT --to-source 182.0.0.111"), when the host sends a big udp packet (8000 bytes), the IP layer will fragment the packet. However, the fragments must be reassembled before doing NAT. The length of reassembled packet is less than nat46's mtu 16384, so it is not fragmented after NAT. Then nat46 converts it into an IPv6 packet, which causes the packet to be dropped by the network protocol stack and send an icmpv6 with "Fragmentation needed" to the source since the length of the packet is greater than the mtu of next hop and it is not sent locally. In order to send this packet, we should tell the network protocol stack that this is a locally sent IPv6 packet and fragment it if necessary.

… nat46

In the IPv4->IPv6 direction, if SNAT rules are configured for nat46
(i.e. "iptables -A POSTROUTING -t nat -o clatd -j SNAT --to-source
 182.0.0.111"), when the host sends a big udp packet (8000 bytes), the IP
layer will fragment the packet. However, the fragments must be
reassembled before doing NAT. The length of reassembled packet is
less than nat46's mtu 16384, so it is not fragmented after NAT. Then
nat46 converts it into an IPv6 packet, which causes the packet to be
dropped by the network protocol stack and send an icmpv6 with
"Fragmentation needed" to the source since the length of the packet
is greater than the mtu of next hop and it is not sent locally. In
order to send this packet, we should tell the network protocol stack
that this is a locally sent IPv6 packet and fragment it if
necessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant