Like I said, the userland applications (ping, tracert, etc.) were ports from BSD, probably nearly 1:1 copies.
The TCP & IP stacks were written by Microsoft in NT 3.5.
What Spider Software used (again, used by Microsoft in NT 3.1 due to time pressures) may have originated from BSD, but we don't know.
You can browse the NT4 source code TCP/IP stack. Just search GitHub.