Why does NFS use UDP by default?

2020-05-24 20:45发布

I'm sure there's some ancient legacy reason for it, but what is it? It seems like a service that's geared towards reliable data delivery.

8条回答
别忘想泡老子
2楼-- · 2020-05-24 21:36

Performance. UDP has a much lower overhead than TCP. On the other hand NFS has to handle reliable transport on its own then (compared to TCP) but as this is a protocol for LANs where connection problems and package drops are (or better: should be) not a problem, it's optimized for performance.

查看更多
唯我独甜
3楼-- · 2020-05-24 21:42

My guess is that it's probably for legacy (historical) reasons. Originally NFS was probably used on low latency networks where there was very little possibility of error, so the overhead of initiating the 3-way handshake to set up the TCP connection (together with the bi-directional acknowledgement of all messages) outweighed the simplicity of using a connectionless protocol like UDP.

When UDP is used as a transport protocol, presumably it would be up to the NFS client to manage retransmissions if necessary.

查看更多
登录 后发表回答