Hi, I've created a socket which is bound to virtual interface, and receive all outgoing traffic due to default routing table rule setting.
Once outgoing packet arrive, it will be encapsulated with some VPN header and sent to the remote tunnel gateway through the physical interface.
I was wondering if I can implement any sort of path mtu discovery algorithm to the tunnel gateway, in order to avoid packet fragmentation and improve the performance.
one solution I was thinking of is to set the DF bit in the IP header for some random outgoing packets, and catch any icmp response with the following header :
I was wondering if there are better ways to do it.. maybe using some built-in mechanism ?
Perhaps the following setting make this automatically (net.inet.tcp.path_mtu_discovery) ? if not, is there a way to read it somehow from the routing table cache ?
Thanks !
Once outgoing packet arrive, it will be encapsulated with some VPN header and sent to the remote tunnel gateway through the physical interface.
I was wondering if I can implement any sort of path mtu discovery algorithm to the tunnel gateway, in order to avoid packet fragmentation and improve the performance.
one solution I was thinking of is to set the DF bit in the IP header for some random outgoing packets, and catch any icmp response with the following header :
- Type: 3 (Destination Unreachable)
- Code: 4 (Fragmentation Needed and Don't Fragment was Set)
I was wondering if there are better ways to do it.. maybe using some built-in mechanism ?
Perhaps the following setting make this automatically (net.inet.tcp.path_mtu_discovery) ? if not, is there a way to read it somehow from the routing table cache ?
Thanks !