大网数据广告活动
服务器运维问答

Why IKEv2 uses UDP and not TCP?

· 52CE 我爱测

As per the IKEv2 RFC 7296 , it is a reliable protocol. Since UDP is a datagram (unreliable) protocol, IKE includes in its definition recovery from transmission errors, including packet loss, packet replay, and packet forgery. Fur…

问题原文

原帖链接 · Siddharth Kamaria · CC BY-SA 4.0

As per the IKEv2 RFC 7296, it is a reliable protocol.

Since UDP is a datagram (unreliable) protocol, IKE includes in its definition recovery from transmission errors, including packet loss, packet replay, and packet forgery.

Furthermore, it also has retransmission timers (Section 2.1), sequence numbers in the form of message id (Section 2.2) and window size (Section 2.3). Although, the RFC clearly mentions that the purpose of window size is not to achieve congestion control.

The window size is normally a (possibly configurable) property of a particular implementation, and is not related to congestion control (unlike the window size in TCP, for example).

The question that I have is that why does IKEv2 uses UDP, and not leverage TCP instead?

已采纳解答

原帖链接 · ecdsa · CC BY-SA 4.0

One reason is backward compatibility with IKEv1. Another is compatibility with NAT traversal (UDP encapsulation, RFC 3948) as that leverages the existing NAT mappings created by the IKE connection to transport ESP over NATs (doing this via TCP may impact performance severaly, see below).

However, it is now possible to use TCP encapsulation for IKEv2 and ESP (even tunneling in TLS is possible). This extension is defined in RFC 8229 and is intended as a fallback if a connection can't be established via UDP (e.g. because of firewalls).

As described in section 12 of that RFC, there could be several negative performance impacts when using it (e.g. TCP-in-TCP), so using UDP is generally preferable. Since it's a relatively new extension, support for it is not very widespread yet (the Linux kernel supports it since 5.6, which was released in March/April 2020).

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-06-23)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。