6. If $a, b \in \mathbf{R}$, then
$$
\begin{aligned}
f(a, b)= & \sqrt{2 a^{2}-8 a+10}+\sqrt{b^{2}-6 b+10}+ \\
& \sqrt{2 a^{2}-2 a b+b^{2}}
\end{aligned}
$$

the minimum value is ( ).
(A) $2 \sqrt{10}$
(B) $1+\sqrt{2}+\sqrt{5}$
(C) $2 \sqrt{5}$
(D) 4