ipsec.rst 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. .. SPDX-License-Identifier: GPL-2.0
  2. =====
  3. IPsec
  4. =====
  5. Here documents known IPsec corner cases which need to be keep in mind when
  6. deploy various IPsec configuration in real world production environment.
  7. 1. IPcomp:
  8. Small IP packet won't get compressed at sender, and failed on
  9. policy check on receiver.
  10. Quote from RFC3173::
  11. 2.2. Non-Expansion Policy
  12. If the total size of a compressed payload and the IPComp header, as
  13. defined in section 3, is not smaller than the size of the original
  14. payload, the IP datagram MUST be sent in the original non-compressed
  15. form. To clarify: If an IP datagram is sent non-compressed, no
  16. IPComp header is added to the datagram. This policy ensures saving
  17. the decompression processing cycles and avoiding incurring IP
  18. datagram fragmentation when the expanded datagram is larger than the
  19. MTU.
  20. Small IP datagrams are likely to expand as a result of compression.
  21. Therefore, a numeric threshold should be applied before compression,
  22. where IP datagrams of size smaller than the threshold are sent in the
  23. original form without attempting compression. The numeric threshold
  24. is implementation dependent.
  25. Current IPComp implementation is indeed by the book, while as in practice
  26. when sending non-compressed packet to the peer (whether or not packet len
  27. is smaller than the threshold or the compressed len is larger than original
  28. packet len), the packet is dropped when checking the policy as this packet
  29. matches the selector but not coming from any XFRM layer, i.e., with no
  30. security path. Such naked packet will not eventually make it to upper layer.
  31. The result is much more wired to the user when ping peer with different
  32. payload length.
  33. One workaround is try to set "level use" for each policy if user observed
  34. above scenario. The consequence of doing so is small packet(uncompressed)
  35. will skip policy checking on receiver side.