NetBIOS-NS (Name Service) uses Port 137 to discover and register the availability of SMB hosts and workgroups.
NetBIOS-DGM (Datagram) Port 138 is used to send and receive datagrams, for example when sending data among members of a workgroup.
NetBIOS-SSN (Session) Port 139 is used to send and receive data during SMB file sharing sessions.
For more information, see technical document 106439, "
'Well Known' TCP and UDP Ports Used by Apple Software Products".