Recent from talks
Contribute something
Nothing was collected or created yet.
Server Message Block
View on WikipediaServer Message Block (SMB) is a communication protocol[1] used to share files, printers, serial ports, and miscellaneous communications between nodes on a network. On Windows, the SMB implementation consists of two vaguely named Windows services: "Server" (ID: LanmanServer) and "Workstation" (ID: LanmanWorkstation).[2] It uses NTLM or Kerberos protocols for user authentication. It also provides an authenticated inter-process communication (IPC) mechanism.
SMB was originally developed in 1983 by Barry A. Feigenbaum at IBM[3] to share access to files and printers across a network of systems running IBM PC DOS. In 1987, Microsoft and 3Com implemented SMB in LAN Manager for OS/2, at which time SMB used the NetBIOS service atop the NetBIOS Frames protocol as its underlying transport. Later, Microsoft implemented SMB in Windows NT 3.1 and has been updating it ever since, adapting it to work with newer underlying transports: TCP/IP and NetBT. SMB over QUIC was introduced in Windows Server 2022.
In 1996, Microsoft published a version of SMB 1.0[4] with minor modifications under the Common Internet File System (CIFS /sɪfs/) moniker. CIFS was compatible with even the earliest incarnation of SMB, including LAN Manager's.[4] It supports symbolic links, hard links, and larger file size, but none of the features of SMB 2.0 and later.[4][5] Microsoft's proposal, however, remained an Internet Draft and never achieved standard status.[6] Microsoft has since discontinued the CIFS moniker but continues developing SMB and publishing subsequent specifications. Samba is a free software reimplementation of the SMB protocol and the Microsoft extensions to it.
Features
[edit]Server Message Block (SMB) enables file sharing, printer sharing, network browsing, and inter-process communication (through named pipes) over a computer network. SMB serves as the basis for Microsoft's Distributed File System implementation.
SMB relies on the TCP and IP protocols for transport. This combination allows file sharing over complex, interconnected networks, including the public Internet. The SMB server component uses TCP port 445. SMB originally operated on NetBIOS over IEEE 802.2 - NetBIOS Frames or NBF - and over IPX/SPX, and later on NetBIOS over TCP/IP (NetBT), but Microsoft has since deprecated these protocols. On NetBT, the server component uses three TCP or UDP ports: 137 (NETBIOS Name Service), 138 (NETBIOS Datagram Service), and 139 (NETBIOS Session Service).
In Microsoft Windows, two Windows services implement SMB. The "Server" service (ID: LanmanServer) is in charge of serving shared resources. The "Workstation" service (ID: LanmanWorkstation) maintains the computer name and helps access shared resources on other computers.[2] SMB uses the Kerberos protocol to authenticate users against Active Directory on Windows domain networks. On simpler, peer-to-peer networks, SMB uses the NTLM protocol.
Windows NT 4.0 SP3 and later can digitally sign SMB messages to prevent some man-in-the-middle attacks.[7][8][9] SMB signing may be configured individually for incoming SMB connections (by the "LanmanServer" service) and outgoing SMB connections (by the "LanmanWorkstation" service). The default setting for Windows domain controllers running Windows Server 2003 and later is to not allow unsigned incoming connections.[10] As such, earlier versions of Windows that do not support SMB signing from the get-go (including Windows 9x) cannot connect to a Windows Server 2003 domain controller.[8]
SMB supports opportunistic locking (see below) on files in order to improve performance. Opportunistic locking support has changed with each Windows Server release.
Opportunistic locking
[edit]In the SMB protocol, opportunistic locking is a mechanism designed to improve performance by controlling caching of network files by the client.[11] Unlike traditional locks, opportunistic lock (OpLocks) are not strictly file locking or used to provide mutual exclusion.
There are four types of opportunistic locks.
- Batch Locks
- Batch OpLocks were created originally to support a particular behavior of DOS batch file execution operation in which the file is opened and closed many times in a short period, which is a performance problem. To solve this, a client may ask for an OpLock of type "batch". In this case, the client delays sending the close request and if a subsequent open request is given, the two requests cancel each other.[12]
- Level-1 OpLocks / Exclusive Locks
- When an application opens in "shared mode" a file hosted on an SMB server which is not opened by any other process (or other clients) the client receives an exclusive OpLock from the server. This means that the client may now assume that it is the only process with access to this particular file, and the client may now cache all changes to the file before committing it to the server. This is a performance improvement, since fewer round-trips are required in order to read and write to the file. If another client/process tries to open the same file, the server sends a message to the client (called a break or revocation) which invalidates the exclusive lock previously given to the client. The client then flushes all changes to the file.
- Level-2 OpLocks
- If an exclusive OpLock is held by a client and a locked file is opened by a third party, the client has to relinquish its exclusive OpLock to allow the other client's write/read access. A client may then receive a "Level 2 OpLock" from the server. A Level 2 OpLock allows the caching of read requests but excludes write caching.
- Filter OpLocks
- Added in Windows NT 4.0, Filter Oplocks are similar to Level 2 OpLocks but prevent sharing-mode violations between file open and lock reception. Microsoft advises use of Filter OpLocks only where it is important to allow multiple readers and Level 2 OpLocks in other circumstances. Clients holding an OpLock do not really hold a lock on the file, instead they are notified via a break when another client wants to access the file in a way inconsistent with their lock. The other client's request is held up while the break is being processed.
- Breaks
- In contrast with the SMB protocol's "standard" behavior, a break request may be sent from server to client. It informs the client that an OpLock is no longer valid. This happens, for example, when another client wishes to open a file in a way that invalidates the OpLock. The first client is then sent an OpLock break and required to send all its local changes (in case of batch or exclusive OpLocks), if any, and acknowledge the OpLock break. Upon this acknowledgment the server can reply to the second client in a consistent manner.
Performance
[edit]The use of the SMB protocol has often correlated with a significant increase in broadcast traffic on a network. However the SMB itself does not use broadcasts—the broadcast problems commonly associated with SMB actually originate with the NetBIOS service location protocol.[clarification needed] By default, a Microsoft Windows NT 4.0 server used NetBIOS to advertise and locate services. NetBIOS functions by broadcasting services available on a particular host at regular intervals. While this usually makes for an acceptable default in a network with a smaller number of hosts, increased broadcast traffic can cause problems as the number of hosts on the network increases. The implementation of name resolution infrastructure in the form of Windows Internet Naming Service (WINS) or Domain Name System (DNS) resolves this problem. WINS was a proprietary implementation used with Windows NT 4.0 networks, but brought about its own issues and complexities in the design and maintenance of a Microsoft network.
Since the release of Windows 2000, the use of WINS for name resolution has been deprecated by Microsoft, with hierarchical Dynamic DNS now configured as the default name resolution protocol for all Windows operating systems. Resolution of (short) NetBIOS names by DNS requires that a DNS client expand short names, usually by appending a connection-specific DNS suffix to its DNS lookup queries. WINS can still be configured on clients as a secondary name resolution protocol for interoperability with legacy Windows environments and applications. Further, Microsoft DNS servers can forward name resolution requests to legacy WINS servers in order to support name resolution integration with legacy (pre-Windows 2000) environments that do not support DNS.
Network designers have found that latency has a significant impact on the performance of the SMB 1.0 protocol, that it performs more poorly than other protocols like FTP. Monitoring reveals a high degree of "chattiness" and a disregard of network latency between hosts.[13] For example, a VPN connection over the Internet will often introduce network latency. Microsoft has explained that performance issues come about primarily because SMB 1.0 is a block-level rather than a streaming protocol, that was originally designed for small LANs; it has a block size that is limited to 64K, SMB signing creates an additional overhead and the TCP window size is not optimized for WAN links.[14] Solutions to this problem include the updated SMB 2.0 protocol,[15] Offline Files, TCP window scaling and WAN optimization devices from various network vendors that cache and optimize SMB 1.0[16] and 2.0.[17]
History
[edit]SMB 1.0
[edit]Barry Feigenbaum originally designed SMB at IBM in early 1983 with the aim of turning DOS INT 21h local file access into a networked file system.[3] Microsoft made considerable modifications to the most commonly used version and included SMB support in the LAN Manager operating system it had started developing for OS/2 with 3Com around 1990.[18][19][20] Microsoft continued to add features to the protocol in Windows for Workgroups (c. 1992) and in later versions of Windows. LAN Manager authentication was implemented based on the original legacy SMB specification's requirement to use IBM "LAN Manager" passwords, but implemented DES in a flawed manner that allowed passwords to be cracked.[21] Later, Kerberos authentication was also added. The Windows domain logon protocols initially used 40-bit encryption outside of the United States, because of export restrictions on stronger 128-bit encryption[22] (subsequently lifted in 1996 when President Bill Clinton signed Executive Order 13026[23]).
SMB 1.0 (or SMB1) was originally designed to run on NetBIOS Frames (NetBIOS over IEEE 802.2). Since then, it has been adapted to NetBIOS over IPX/SPX (NBX), and NetBIOS over TCP/IP (NetBT). Also, since Windows 2000, SMB runs on TCP using TCP port 445, a feature known as "direct host SMB".[24] There is still a thin layer (similar to the Session Message packet of NetBT's Session Service) between SMB and TCP.[24] Windows Server 2003, and legacy NAS devices use SMB1 natively.
SMB1 is an extremely chatty protocol, which is not such an issue on a local area network (LAN) with low latency. It becomes very slow on wide area networks (WAN) as the back and forth handshake of the protocol magnifies the inherent high latency of such a network. Later versions of the protocol reduced the high number of handshake exchanges. One approach to mitigating the inefficiencies in the protocol is to use WAN optimization products such as those provided by Riverbed, Silver Peak, or Cisco. A better approach is to upgrade to a later version of SMB. This includes upgrading both NAS devices as well as Windows Server 2003. The most effective method to identify SMB1 traffic is with a network analyzer tool, such as Wireshark. Microsoft also provides an auditing tool in Windows Server 2016 to track down devices that use SMB1.[25]
Microsoft marked SMB1 as deprecated in June 2013.[26] Windows Server 2016 and Windows 10 version 1709 do not have SMB1 installed by default.[27]
CIFS
[edit]In 1996, when Sun Microsystems announced WebNFS,[28] Microsoft launched an initiative to rename SMB to Common Internet File System (CIFS)[3] and added more features, including support for symbolic links, hard links, larger file sizes, and an initial attempt at supporting direct connections over TCP port 445 without requiring NetBIOS as a transport (a largely experimental effort that required further refinement). Microsoft submitted some partial specifications as Internet Drafts to the IETF.[6] These submissions have since expired.
SMB 2.0
[edit]Microsoft introduced a new version of the protocol (SMB 2.0 or SMB2) in 2006 with Windows Vista and Windows Server 2008.[29] Although the protocol is proprietary, its specification has been published to allow other systems to interoperate with Microsoft operating systems that use the new protocol.[30]
SMB2 reduces the 'chattiness' of the SMB 1.0 protocol by reducing the number of commands and subcommands from over a hundred to just nineteen.[13] It has mechanisms for pipelining, that is, sending additional requests before the response to a previous request arrives, thereby improving performance over high-latency links. It adds the ability to compound multiple actions into a single request, which significantly reduces the number of round-trips the client needs to make to the server, improving performance as a result.[13] SMB1 also has a compounding mechanism—known as AndX—to compound multiple actions, but Microsoft clients rarely use AndX.[citation needed] It also introduces the notion of "durable file handles": these allow a connection to an SMB server to survive brief network outages, as are typical in a wireless network, without having to incur the overhead of re-negotiating a new session.
SMB2 includes support for symbolic links. Other improvements include caching of file properties, improved message signing with HMAC SHA-256 hashing algorithm and better scalability by increasing the number of users, shares and open files per server among others.[13] The SMB1 protocol uses 16-bit data sizes, which amongst other things, limits the maximum block size to 64K. SMB2 uses 32- or 64-bit wide storage fields, and 128 bits in the case of file-handles, thereby removing previous constraints on block sizes, which improves performance with large file transfers over fast networks.[13]
Windows Vista/Server 2008 and later operating systems use SMB2 when communicating with other machines also capable of using SMB2. SMB1 continues in use for connections with older versions of Windows, as well various vendors' NAS solutions. Samba 3.5 also includes experimental support for SMB2.[31] Samba 3.6 fully supports SMB2, except the modification of user quotas using the Windows quota management tools.[32]
When SMB2 was introduced it brought a number of benefits over SMB1 for third party implementers of SMB protocols. SMB1, originally designed by IBM, was reverse engineered, and later became part of a wide variety of non-Windows operating systems such as Xenix, OS/2 and VMS (Pathworks). X/Open standardized it partially; Microsoft had submitted Internet-Drafts describing SMB2 to the IETF, partly in response to formal IETF standardization of version 4 of the Network File System in December 2000 as IETF RFC 3010;[33] however, those SMB-related Internet-Drafts expired without achieving any IETF standards-track approval or any other IETF endorsement. (See http://ubiqx.org/cifs/Intro.html for historical detail.) SMB2 is also a relatively clean break with the past. Microsoft's SMB1 code has to work with a large variety of SMB clients and servers. SMB1 features many versions of information for commands (selecting what structure to return for a particular request) because features such as Unicode support were retro-fitted at a later date. SMB2 involves significantly reduced compatibility-testing for implementers of the protocol. SMB2 code has considerably less complexity since far less variability exists (for example, non-Unicode code paths become redundant as SMB2 requires Unicode support).
Apple migrated to SMB2 (from their own Apple Filing Protocol, now legacy) starting with OS X 10.9 "Mavericks".[34] This transition was fraught with compatibility problems though.[35][36] Non-default support for SMB2 appeared in fact in OS X 10.7, when Apple abandoned Samba in favor of its own SMB implementation called SMBX[34] after Samba adopted GPLv3.[37][38]
The Linux kernel's CIFS client file system has SMB2 support since version 3.7.[39]
SMB 2.1
[edit]SMB 2.1, introduced with Windows 7 and Server 2008 R2, introduced minor performance enhancements with a new opportunistic locking mechanism.[40]
SMB 3.0
[edit]SMB 3.0 (previously named SMB 2.2)[41] was introduced with Windows 8[41] and Windows Server 2012.[41] It brought several significant changes that are intended to add functionality and improve SMB2 performance,[42] notably in virtualized data centers:
- the SMB Direct Protocol (SMB over remote direct memory access [RDMA])
- SMB Multichannel (multiple connections per SMB session),[43][44]
- SMB Transparent Failover[45][46]
It also introduces several security enhancements, such as end-to-end encryption and a new AES based signing algorithm.[47][48]
SMB 3.0.2
[edit]SMB 3.0.2 (known as 3.02 at the time) was introduced with Windows 8.1 and Windows Server 2012 R2;[49][50] in those and later releases, the earlier SMB version 1 can be optionally disabled to increase security.[51][52]
SMB 3.1.1
[edit]SMB 3.1.1 was introduced with Windows 10 and Windows Server 2016.[53] This version supports AES-128 GCM encryption in addition to AES-128 CCM encryption added in SMB3, and implements pre-authentication integrity check using SHA-512 hash. SMB 3.1.1 also makes secure negotiation mandatory when connecting to clients using SMB versions that support it.[54]
Specifications
[edit]The specifications for the SMB are proprietary and were initially closed, thereby forcing other vendors and projects to reverse-engineer the protocol to interoperate with it. The SMB 1.0 protocol was eventually published some time after it was reverse engineered, whereas the SMB 2.0 protocol was made available from Microsoft's Open Specifications Developer Center from the outset.[55]
Third-party implementations
[edit]Samba
[edit]This section needs to be updated. (April 2016) |
In 1991, Andrew Tridgell started the development of Samba, a free-software re-implementation (using reverse engineering) of the SMB/CIFS networking protocol for Unix-like systems, initially to implement an SMB server to allow PC clients running the DEC Pathworks client to access files on SunOS machines.[3][56] Because of the importance of the SMB protocol in interacting with the widespread Microsoft Windows platform, Samba became a popular free software implementation of a compatible SMB client and server to allow non-Windows operating systems, such as Unix-like operating systems, to interoperate with Windows.
As of version 3 (2003), Samba provides file and print services for Microsoft Windows clients and can integrate with a Windows NT 4.0 server domain, either as a Primary Domain Controller (PDC) or as a domain member. Samba4 installations can act as an Active Directory domain controller or member server, at Windows 2008 domain and forest functional levels.[57]
Package managers in Linux distributions can search for the cifs-utils package. The package is from the Samba maintainers.
Netsmb
[edit]NSMB (Netsmb and SMBFS) is a family of in-kernel SMB client implementations in BSD operating systems. It was first contributed to FreeBSD 4.4 by Boris Popov, and is now found in a wide range of other BSD systems including NetBSD and macOS.[58] The implementations have diverged significantly ever since.[59]
The macOS version of NSMB is notable for its now-common scheme of representing symlinks. This "Minshall-French" format shows symlinks as textual files with a .symlink extension and a Xsym\n magic number, always 1067 bytes long. This format is also used for storing symlinks on native SMB servers or unsupported filesystems. Samba supports this format with an mfsymlink option.[60] Docker on Windows also seems to use it.[citation needed]
NQ
[edit]NQ is a family of portable SMB client and server implementations developed by Visuality Systems, an Israel-based company established in 1998 by Sam Widerman, formerly the CEO of Siemens Data Communications. The NQ family comprises an embedded SMB stack (written in C), a Pure Java SMB Client, and a storage SMB Server implementation. All solutions support the latest SMB 3.1.1 dialect. NQ for Linux, NQ for WinCE, iOS, Android, VxWorks and other real-time operating systems are all supported by the configurable NQ solution.
MoSMB
[edit]MoSMB is a user space SMB implementation for Linux. It supports SMB 2.x and SMB 3.x. Key features include Cloud-scale Active-Active Scale-out Clusters, SMB Direct (RDMA), SMB Multichannel, Transparent Failover and Continuous Availability. MoSMB also supports Amazon S3 object storage as storage backend in addition to POSIX file systems such as ext4, ZFS, Lustre, Ceph, etc.[61]
Fusion File Share by Tuxera
[edit]Fusion File Share by Tuxera is a proprietary SMB server implementation developed by Tuxera that can be run either in kernel or user space.[62] It supports SMB 3.1.1 and all previous versions, additionally advanced SMB features like continuous availability (persistent handles) scale-out, RDMA (SMB Direct), SMB multichannel, transparent compression, shadow copy.
Likewise
[edit]Likewise developed a CIFS/SMB implementation (versions 1.0, 2.0, 2.1 and SMB 3.0) in 2009 that provided a multiprotocol, identity-aware platform for network access to files used in OEM storage products built on Linux/Unix based devices. The platform could be used for traditional NAS, Cloud Gateway, and Cloud Caching devices for providing secure access to files across a network. Likewise was purchased by EMC Isilon in 2012.
KSMBD
[edit]KSMBD is an open source in-kernel CIFS/SMB server implementation for the Linux kernel. Compared to user-space implementations, it provides better performance and makes it easier to implement some features such as SMB Direct. It supports SMB 3.1.1 and previous versions.
Security
[edit]Over the years, there have been many security vulnerabilities in Microsoft's implementation of the protocol or components on which it directly relies.[63][64] Other vendors' security vulnerabilities lie primarily in a lack of support for newer authentication protocols like NTLMv2 and Kerberos in favor of protocols like NTLMv1, LanMan, or plaintext passwords. Real-time attack tracking[65] shows that SMB is one of the primary attack vectors for intrusion attempts,[66] for example the 2014 Sony Pictures attack,[67] and the WannaCry ransomware attack of 2017.[68] In 2020, two SMB high-severity vulnerabilities were disclosed and dubbed as SMBGhost (CVE-2020-0796) and SMBleed (CVE-2020-1206), which when chained together can provide RCE (Remote Code Execution) privilege to the attacker.[69]
See also
[edit]References
[edit]- ^ "Microsoft SMB Protocol and CIFS Protocol Overview". Microsoft. October 22, 2009. Archived from the original on August 2, 2016. Retrieved April 10, 2019.
- ^ a b "Lan Manager Networking Concepts". Support. Microsoft. Archived from the original on December 30, 2012. Retrieved September 18, 2014.
- ^ a b c d Tridgell, Andrew. "Myths About Samba". Archived from the original on October 20, 2017. Retrieved January 3, 2016.
- ^ a b c "Common Internet File System". Windows 2000 Web and Application Services Technical Overview. Microsoft. 18 July 2012. Archived from the original on 30 January 2022. Retrieved 30 January 2022 – via Microsoft Docs.
- ^ Coulter, David; Satran, Michael; Batchelor, Drew (8 January 2021). "Microsoft SMB Protocol and CIFS Protocol Overview". Windows App Development. Microsoft. Archived from the original on 28 January 2022. Retrieved 30 January 2022 – via Microsoft Docs.
- ^ a b See:
- Heizer, I.; Leach, P.; Perry, D. (June 13, 1996). "Common Internet File System Protocol (CIFS/1.0)". Archived from the original on August 8, 2019.
- Leach, Paul J.; Naik, Dilip C. (January 3, 1997). "CIFS Logon and Pass Through Authentication". Archived from the original on May 31, 2024. Retrieved December 10, 2017.
- Leach, Paul J.; Naik, Dilip C. (January 10, 1997). "CIFS/E Browser Protocol". Archived from the original on May 31, 2024. Retrieved December 10, 2017.
- Leach, Paul J.; Naik, Dilip C. (January 31, 1997). "CIFS Printing Specification". Archived from the original on May 31, 2024. Retrieved December 10, 2017.
- Leach, Paul J.; Naik, Dilip C. (February 26, 1997). "CIFS Remote Administration Protocol". Archived from the original on May 31, 2024. Retrieved December 10, 2017.
- Leach, Paul J.; Naik, Dilip C. (December 19, 1997). "A Common Internet File System (CIFS/1.0) Protocol". Archived from the original on May 31, 2024. Retrieved December 10, 2017.
- ^ "Overview of Server Message Block signing". Windows Server troubleshooting. Microsoft. 24 November 2021. Archived from the original on 29 January 2022. Retrieved 29 January 2022 – via Microsoft Docs.
- ^ a b Johansson, Jesper M. (20 May 2005). "How to Shoot Yourself in the Foot with Security, Part 1". Security Guidance. Microsoft. Archived from the original on 19 October 2018. Retrieved 19 October 2018 – via Microsoft Docs.
This article addresses [...] Server Message Block (SMB) message signing.
- ^ Barreto, Jose (1 December 2010). "The Basics of SMB Signing (covering both SMB1 and SMB2)". Jose Barreto's Blog Archive. Microsoft. Archived from the original on 2 December 2012 – via Microsoft Docs.
This security mechanism in the SMB protocol helps avoid issues like tampering of packets and "man in the middle" attacks. [...] SMB signing is available in all currently supported versions of Windows, but it's only enabled by default on Domain Controllers. This is recommended for Domain Controllers because SMB is the protocol used by clients to download Group Policy information. SMB signing provides a way to ensure that the client is receiving genuine Group Policy.
- ^ "MSKB887429: Overview of Server Message Block signing". Microsoft. November 30, 2007. Archived from the original on November 20, 2010. Retrieved October 24, 2012.
By default, SMB signing is required for incoming SMB sessions on Windows Server 2003-based domain controllers.
- ^ "Opportunistic Locks". Microsoft. May 31, 2018. Archived from the original on August 19, 2021. Retrieved August 19, 2021.
- ^ "All About Opportunistic Locking". Sphere IT. 2014. Archived from the original on August 19, 2021. Retrieved August 19, 2021.
- ^ a b c d e Jose Barreto (December 9, 2008). "SMB2, a Complete Redesign of the Main Remote File Protocol for Windows". Microsoft Server & Management Blogs. Archived from the original on January 12, 2013. Retrieved November 1, 2009.
- ^ Neil Carpenter (October 26, 2004). "SMB/CIFS Performance Over WAN Links". Microsoft. Archived from the original on February 13, 2020. Retrieved February 13, 2020.
- ^ "What's New in SMB in Windows Server". Microsoft. 31 August 2016. Archived from the original on February 11, 2017. Retrieved 6 February 2017.
- ^ Mark Rabinovich, Igor Gokhman. "CIFS Acceleration Techniques" (PDF). Storage Developer Conference, SNIA, Santa Clara 2009. Archived (PDF) from the original on September 30, 2020. Retrieved July 6, 2020.
- ^ Mark Rabinovich. "Accelerating SMB2" (PDF). Storage Developer Conference, SNIA, Santa Clara 2011. Archived (PDF) from the original on May 31, 2024. Retrieved July 6, 2020.
- ^ Speed, Richard. "Have to use SMB 1.0? Windows 10 April 2018 Update says NO". theregister.com. Archived from the original on 18 February 2023. Retrieved 18 February 2023.
- ^ guenni (15 June 2017). "Microsoft plans to deactivate SMBv1 in Windows 10 V1709". Born's Tech and Windows World. Archived from the original on 18 February 2023. Retrieved 18 February 2023.
- ^ Giret, Laurent (20 April 2022). "Microsoft Gets Ready to Disable SMB1 Protocol on Windows 11". Thurrott.com. Archived from the original on 31 May 2024. Retrieved 18 February 2023.
- ^ Christopher Hertel (1999). "SMB: The Server Message Block Protocol". Archived from the original on March 10, 2010. Retrieved November 1, 2009.
- ^ "Description of Microsoft Windows Encryption Pack 1". Microsoft. November 1, 2006. Archived from the original on October 2, 2009. Retrieved November 1, 2009.
- ^ "US Executive Order 13026" (PDF). United States Government. 1996. Archived (PDF) from the original on October 10, 2009. Retrieved November 1, 2009.
- ^ a b "Direct hosting of SMB over TCP/IP". Microsoft. October 11, 2007. Archived from the original on March 26, 2011. Retrieved November 1, 2009.
- ^ Kyttle, Ralph (13 May 2017). "SMB1 – Audit Active Usage using Message Analyzer". Microsoft TechNet. Microsoft. Archived from the original on March 28, 2019. Retrieved 28 March 2019.
- ^ "The Deprecation of SMB1 – You should be planning to get rid of this old SMB dialect – Jose Barreto's Blog". blogs.technet.microsoft.com. 21 April 2015. Archived from the original on May 21, 2017. Retrieved 2019-10-09.
- ^ "SMBv1 is not installed by default in Windows 10 Fall Creators Update and Windows Server, version 1709 and later versions". support.microsoft.com. Archived from the original on October 10, 2019. Retrieved 2019-10-09.
- ^ "WebNFS - Technical Overview". Archived from the original on 2007-05-18.
- ^ Navjot Virk and Prashanth Prahalad (March 10, 2006). "What's new in SMB in Windows Vista". Chk Your Dsks. Microsoft. Archived from the original on May 5, 2006. Retrieved May 1, 2006.
- ^ Server Message Block (SMB) Protocol Versions 2 and 3. Windows Protocols. Open Specifications (Technical report). Microsoft Docs. Microsoft. MS-SMB2. Retrieved 2020-11-29.
- ^ "Samba 3.5.0 Available for Download". Archived from the original on July 24, 2011. Retrieved July 8, 2011.
- ^ "Samba 3.6.0 Available for Download". Archived from the original on September 24, 2011. Retrieved August 10, 2011.
- ^ NFS version 4 Protocol. December 2000. doi:10.17487/RFC3010. RFC 3010.
- ^ a b Eran, Daniel (June 11, 2013). "Apple shifts from AFP file sharing to SMB2 in OS X 10.9 Mavericks". Appleinsider.com. Archived from the original on February 12, 2017. Retrieved January 12, 2014.
- ^ Vaughan, Steven J. (October 28, 2013). "Mavericks' SMB2 problem and fixes". ZDNet. Archived from the original on January 5, 2014. Retrieved January 12, 2014.
- ^ MacParc. "10.9: Switch the SMB stack to use SMB1 as default". Mac OS X Hints. macworld.com. Archived from the original on January 12, 2014. Retrieved January 12, 2014.
- ^ Topher Kessler (March 23, 2011). "Say adios to Samba in OS X". CNET. Archived from the original on January 15, 2014. Retrieved January 12, 2014.
- ^ Thom Holwerda (March 26, 2011). "Apple Ditches SAMBA in Favour of Homegrown Replacement". Archived from the original on November 2, 2013. Retrieved January 12, 2014.
- ^ "Linux 3.7 - Linux Kernel Newbies". Archived from the original on September 11, 2016. Retrieved September 4, 2016.
- ^ "Implementing an End-User Data Centralization Solution". Microsoft. October 21, 2009. pp. 10–11. Archived from the original on September 6, 2010. Retrieved November 2, 2009.
- ^ a b c Jeffrey Snover (April 19, 2012). "SMB 2.2 is now SMB 3.0". Windows Server Blog. Archived from the original on July 8, 2020. Retrieved July 6, 2020.
- ^ Chelsio Communications (2 April 2013). "40G SMB Direct". Archived from the original on September 7, 2013. Retrieved June 18, 2013.
- ^ Jose Barreto (October 19, 2012). "SNIA Tutorial on the SMB Protocol" (PDF). Storage Networking Industry Association. Archived (PDF) from the original on June 3, 2013. Retrieved November 28, 2012.
- ^ Thomas Pfenning. "The Future of File Protocols: SMB 2.2 in the Datacenter" (PDF). Archived from the original (PDF) on 2012-07-20.
- ^ Joergensen, Claus (2012-06-07). "SMB Transparent Failover – making file shares continuously available". Microsoft TechNet. Archived from the original on January 11, 2019. Retrieved February 1, 2017.
- ^ Savill, John (2012-08-21). "New Ways to Enable High Availability for File Shares". Windows IT Pro. Archived from the original on November 27, 2016. Retrieved February 1, 2017.
- ^ "SMB Security Enhancements". Microsoft Technet. January 15, 2014. Archived from the original on October 9, 2014. Retrieved June 18, 2014.
- ^ Jose Barreto (May 5, 2013). "Updated Links on Windows Server 2012 File Server and SMB 3.0". Microsoft TechNet Server & Management Blogs. Archived from the original on August 3, 2016. Retrieved August 14, 2016.
- ^ Jose Barreto (July 7, 2014). "Updated Links on Windows Server 2012 R2 File Server and SMB 3.02". Microsoft TechNet Server & Management Blogs. Archived from the original on August 26, 2016. Retrieved August 14, 2016.
- ^ Jose Barreto (December 12, 2013). "Storage Developer Conference – SDC 2013 slides now publicly available. Here are the links to Microsoft slides…". Microsoft TechNet Server & Management Blogs. Archived from the original on August 26, 2016. Retrieved August 14, 2016.
- ^ Eric Geier (December 5, 2013). "WindowsNetworking.com: Improvements in the SMB 3.0 and 3.02 Protocol Updates". WindowsNetworking.com. Archived from the original on April 9, 2015. Retrieved April 6, 2015.
- ^ Jose Barreto (April 30, 2015). "SMB3 Networking Links for Windows Server 2012 R2". Microsoft TechNet Server & Management Blogs. Archived from the original on August 26, 2016. Retrieved August 14, 2016.
- ^ Jose Barreto (May 5, 2015). "What's new in SMB 3.1.1 in the Windows Server 2016 Technical Preview 2". Microsoft TechNet Server & Management Blogs. Archived from the original on October 8, 2016. Retrieved August 14, 2016.
- ^ "SMB security enhancements". Microsoft Learn. Archived from the original on 2023-04-10. Retrieved 2023-04-10.
- ^ "Windows Protocols". Archived from the original on September 26, 2009. Retrieved October 13, 2009.
- ^ Tridgell, Andrew (June 27, 1997). "A bit of history and a bit of fun". Archived from the original on July 17, 2011. Retrieved July 26, 2011.
- ^ "Samba 4 functional levels". February 25, 2011. Archived from the original on July 29, 2014. Retrieved January 12, 2014.
- ^ "netsmb(4)". NetBSD 8.0 manual pages. Archived from the original on 17 November 2022. Retrieved 5 January 2020.
- ^ – FreeBSD File Formats Manual.
- ^ "UNIX Extensions". SambaWiki. Archived from the original on June 12, 2020. Retrieved March 15, 2020.
- ^ Sunu Engineer. "Building a Highly Scalable and Performant SMB Protocol Server" (PDF). Archived (PDF) from the original on September 27, 2016. Retrieved September 25, 2016.
- ^ "Microsoft and Tuxera strengthen partnership through Tuxera SMB Server". Microsoft. Microsoft News Center. 14 September 2016. Archived from the original on November 17, 2016. Retrieved 6 February 2017.
- ^ "MS02-070: Flaw in SMB Signing May Permit Group Policy to Be Modified". Microsoft. December 1, 2007. Archived from the original on October 8, 2009. Retrieved November 1, 2009.
- ^ "MS09-001: Vulnerabilities in SMB could allow remote code execution". Microsoft. January 13, 2009. Archived from the original on October 5, 2009. Retrieved November 1, 2009.,
- ^ "Sicherheitstacho.eu". Deutsche Telekom. March 7, 2013. Archived from the original on March 8, 2013. Retrieved March 7, 2013.
- ^ "Alert (TA14-353A) Targeted Destructive Malware". US-CERT. Archived from the original on December 20, 2014. Retrieved December 20, 2014.
- ^ "Sony Hackers Used Server Message Block (SMB) Worm Tool". 19 December 2014. Archived from the original on December 20, 2014. Retrieved December 20, 2014.
- ^ "WannaCry Ransomware Attack Hits Victims With Microsoft SMB Exploit". eWeek. Retrieved 13 May 2017.
- ^ "SMBleedingGhost Writeup: Chaining SMBleed (CVE-2020-1206) with SMBGhost". ZecOps Blog. 2020-06-09. Archived from the original on 2020-11-27. Retrieved 2020-11-19.
Further reading
[edit]SMB specifications
[edit]- "[MS-CIFS]: Common Internet File System (CIFS) Protocol". Open Specifications. Microsoft. 30 October 2020.
- Specifies the Common Internet File System (CIFS) Protocol, a cross-platform, transport-independent protocol that provides a mechanism for client systems to use file and print services made available by server systems over a network
- "[MS-SMB]: Server Message Block (SMB) Protocol". Open Specifications. Microsoft. 25 June 2021.
- Specifies the Server Message Block (SMB) Protocol, which defines extensions to the existing Common Internet File System (CIFS) specification that have been implemented by Microsoft since the publication of the CIFS specification.
- "[MS-SMB2]: Server Message Block (SMB) Protocol Versions 2 and 3". Open Specifications. Microsoft. 14 December 2021.
- Specifies the Server Message Block (SMB) Protocol Versions 2 and 3, which support the sharing of file and print resources between machines and extend the concepts from the Server Message Block Protocol.
- "[MS-SMBD]: SMB2 Remote Direct Memory Access (RDMA) Transport Protocol". Open Specifications. Microsoft. 25 June 2021.
- Specifies the SMB2 Remote Direct Memory Access (RDMA) Transport Protocol, a wrapper for the existing SMB2 protocol that allows SMB2 packets to be delivered over RDMA-capable transports such as iWARP or Infiniband while utilizing the direct data placement (DDP) capabilities of these transports. Benefits include reduced CPU overhead, lower latency, and improved throughput.
Miscellaneous
[edit]- Hertel, Christopher (2003). Implementing CIFS – The Common Internet FileSystem Archived 2004-02-02 at the Wayback Machine. Prentice Hall. ISBN 0-13-047116-X. (Text licensed under the Open Publication License, v1.0 or later, available from the link above.)
- Steven M. French, A New Network File System is Born: Comparison of SMB2, CIFS, and NFS Archived 2012-09-07 at the Wayback Machine, Linux Symposium 2007
- Steve French, The Future of File Protocols: SMB2 Meets Linux Archived 2018-08-17 at the Wayback Machine, Linux Collaboration Summit 2012
External links
[edit]Server Message Block
View on GrokipediaOverview
Definition and Purpose
The Server Message Block (SMB) is a client-server request-response protocol that enables shared access to files, directories, printers, serial ports, and other resources over networks. It primarily facilitates file system operations, printer access, and inter-process communication (IPC) via mechanisms such as named pipes, allowing clients to interact with remote servers as if accessing local resources. SMB typically operates over TCP/IP (using port 445 for direct hosting) or NetBIOS over TCP/IP (using ports 137-139), supporting both local area networks (LANs) and wide area networks (WANs).[2][10] Developed in the early 1980s by Barry A. Feigenbaum at IBM, SMB originated as a means to extend local DOS file and printer access across networked IBM PC systems. Microsoft adopted and refined the protocol for its LAN Manager and OS/2 products, establishing it as a standard for cross-platform resource sharing in enterprise environments.[11][12] The core purposes of SMB include enabling remote read/write file operations, directory creation and navigation, and device sharing without requiring dedicated hardware, thereby streamlining networked data access and management. This protocol supports authentication, session establishment, and transaction handling to ensure reliable resource utilization. In enterprise settings, SMB simplifies administration by centralizing resource access, reducing overhead for distributed teams, and promoting efficient collaboration across heterogeneous systems.[2] Over time, SMB has evolved into modern versions that enhance scalability for large-scale deployments.Basic Operation
The Server Message Block (SMB) protocol operates on a client-server model, where clients initiate requests to access shared resources on a server, such as opening a file or reading data, and the server responds with the requested data or a status indicating success or failure.[13][2] This request-response mechanism enables remote file and printer sharing over a network, with the client maintaining stateful connections to track ongoing operations.[13] Connection establishment begins with the client connecting to the server via TCP port 445 for direct SMB over TCP/IP, or through legacy NetBIOS over TCP ports 137 (UDP for name service), 138 (UDP for datagrams), and 139 (TCP for sessions).[14][15] Upon connection, the client and server perform dialect negotiation by exchanging supported protocol versions to select the highest compatible dialect, ensuring mutual agreement on the SMB version for subsequent communication.[2][13] Following connection, the session setup process authenticates the client using user credentials or share-level security to establish a secure context.[2] The client then issues a tree connect request to mount a specific share on the server, creating a virtual connection to the shared resource like a file system or printer.[2] Once connected, operations such as opening a file allocate a file identifier (FID) or handle, which the client uses in subsequent requests to reference the resource.[2] SMB messages are framed with a standard header containing fields for command codes, error codes, and flags, followed by a variable-length payload specific to the operation.[16] The header's command code identifies the action, such as 0x02 for SMB_COM_OPEN to open or create a file, or 0x0A for SMB_COM_READ to retrieve data from an open file.[17] Error codes in the response header indicate outcomes like success or access denied, while the payload carries parameters, data, or results for the requested operation.[16]Core Features
File and Resource Sharing
The Server Message Block (SMB) protocol enables servers to expose shared resources such as files, directories, printers, and serial ports to clients across a network using Universal Naming Convention (UNC) paths in the format \server\share. These shares represent logical mappings to physical resources on the server, allowing clients to access them transparently as if they were local. Clients can mount these shares as network drives, facilitating seamless integration into file explorers or applications for remote resource utilization.[2][10] SMB supports a range of file operations, including creation, deletion, renaming, reading, and writing to files within shares. These operations are performed through dedicated SMB commands, such as SMB_COM_CREATE_DIRECTORY for creating files or directories and SMB_COM_DELETE for removal. Read and write actions allow byte-range access, where clients specify offsets and lengths to handle portions of files efficiently. To prevent concurrent access conflicts, SMB implements byte-range locking, enabling clients to lock specific sections of a file exclusively or shared for reading, as managed by commands like SMB_COM_LOCKING_ANDX. This ensures data integrity during multi-client interactions without locking the entire file.[17][18][19] For printer sharing, SMB integrates with the server's print spooler service, allowing clients to submit print jobs to a shared printer queue via the UNC path. Upon receiving a job, the SMB server redirects the print data to the local spooler API using a stored print queue handle, where it is queued for processing. Clients can query job status, such as pending, printing, or completed, through SMB messaging, enabling remote monitoring and management of print tasks without direct spooler access. This mechanism supports diverse printing environments by treating printers as network resources akin to files.[20][21] Directory services in SMB facilitate enumeration and manipulation of directory contents within shares. Clients use commands like SMB2 QUERY_DIRECTORY to list entries in a directory, retrieving details such as names, sizes, and types. Search operations support wildcard patterns, such as asterisks (*) for multiple characters or question marks (?) for single characters, based on Windows file system conventions, allowing filtered enumeration without full scans. Attribute manipulation, including setting timestamps for creation, modification, or access times and adjusting permissions, is handled via SMB_COM_SET_INFORMATION requests, enabling clients to customize resource metadata as needed.[22][23][24]Opportunistic Locking
Opportunistic locking, commonly referred to as oplocks, is a caching mechanism in the Server Message Block (SMB) protocol that enables clients to store file data locally, thereby reducing network traffic and enhancing performance for file access operations. When a client opens a file on an SMB server, it requests an oplock, which the server grants if no conflicting opens exist from other clients; this permission allows the client to cache reads, writes, or both depending on the oplock level, minimizing repeated server round-trips for data retrieval or modification.[25][26] Oplocks are categorized into several levels to balance caching flexibility with sharing needs. A Level 1 (exclusive) oplock provides the client with full read and write caching rights, preventing any other client from accessing the file until the oplock is released. Level 2 oplocks, which are shareable, permit read-only caching and read-ahead operations among multiple clients but disallow local writes. Batch oplocks extend exclusive access by maintaining the file open on the server across multiple client open/close cycles, ideal for applications like text editors that repeatedly access the same file. Additional variants, such as read-only oplocks introduced in later Windows versions, further refine read caching for shareable scenarios.[27][28] The oplock mechanism operates through SMB command exchanges during file operations. Upon a client's file open request via SMB, the server evaluates access conflicts and includes the granted oplock level in its response; for instance, an exclusive oplock is signaled with a specific byte value in the response header. If a conflicting access occurs—such as another client requesting write access—the server initiates an oplock break by sending an oplock break notification to the original client, specifying the new oplock level (often none), which prompts the client to flush its local cache and acknowledge the break or close the file. This break process ensures data consistency while dynamically adjusting caching permissions.[29][30][31] By enabling local caching, oplocks deliver key benefits, particularly in read-intensive workloads where clients can satisfy subsequent data requests from memory without server communication, substantially lowering latency and bandwidth usage. In supported implementations, higher-level oplocks like exclusive or batch also facilitate offline editing, allowing clients to perform local modifications on cached files and defer synchronization until reconnection, which proves advantageous for mobile or intermittently connected users.[25][32][33] Despite these advantages, oplocks have inherent limitations that restrict their applicability. They are ill-suited for multi-writer environments requiring immediate consistency, as the caching model assumes single-client dominance and relies on timely break acknowledgments; failures in processing breaks—due to network interruptions, timeouts, or faulty implementations—can result in stale data on clients or server-side inconsistencies. Consequently, oplocks must be disabled or carefully managed in scenarios like collaborative databases to prevent corruption risks.[34][25]Performance Enhancements
Server Message Block (SMB) incorporates persistent handles and durable opens to ensure continuity of file access during transient network disruptions or server maintenance. Persistent handles allow the server to retain open file states briefly after client disconnection, enabling quick reconnection without re-establishing the session from scratch. Durable opens extend this resilience further, preserving handles across longer interruptions such as server reboots, thereby preventing data loss and minimizing recovery time for applications relying on shared resources.[35] To optimize data transfer efficiency, SMB supports large Maximum Transmission Unit (MTU) sizes, accommodating jumbo frames up to 1 MB (introduced in SMB 2.1). This capability reduces the number of packets required for large file operations by allowing bigger payloads per transmission, which lowers protocol overhead and improves throughput for sequential reads and writes. By minimizing fragmentation and packet processing, large MTU support enhances overall network scalability, particularly in high-bandwidth environments.[6][36] SMB employs server-side read-ahead and write-behind caching to buffer data proactively, overlapping I/O operations and reducing latency in file access patterns. Read-ahead anticipates sequential access by prefetching subsequent data blocks into the cache, while write-behind aggregates writes before committing them to storage, balancing performance with data integrity. These mechanisms, combined with opportunistic locking for client-side caching, enable efficient resource utilization across distributed systems.[37] These enhancements contribute to measurable gains in SMB performance, including up to 10x improvements in IOPS for random reads and better bandwidth utilization in wide area network (WAN) scenarios through reduced overhead and aggregated transfers. For instance, in virtualized environments, such optimizations can achieve higher throughput while maintaining low latency, supporting scalable file sharing for enterprise workloads.[38][6]Evolution
Early Versions (SMB 1.0 and CIFS)
The Server Message Block (SMB) 1.0 protocol emerged in the mid-1980s as a client-server communication mechanism for file, printer, and resource sharing on local area networks, initially developed by IBM for PC-DOS environments and later refined by Microsoft. It was formally introduced in Microsoft's LAN Manager 1.0 in 1987, where it operated as the primary protocol over NetBIOS for transport, relying on NetBIOS frames for session establishment, name resolution, and datagram services. This dependency on NetBIOS limited its direct use over TCP/IP until later adaptations.[39][14] The core dialect of SMB 1.0, designated as "PC NETWORK PROGRAM 1.0," comprised 19 fundamental commands to handle basic operations such as file creation (SMB_COM_CREATE_DIRECTORY), opening (SMB_COM_OPEN), reading (SMB_COM_READ), writing (SMB_COM_WRITE), and deletion (SMB_COM_DELETE). These commands formed the foundational set, with additional extensions like the TRANSACTION (SMB_COM_TRANSACTION) and TRANSACTION2 (SMB_COM_TRANSACTION2) subcommands enabling more complex interactions, including querying and manipulating extended file attributes such as timestamps, permissions, and security descriptors. The TRANS2 operations, in particular, supported subfunctions for file information retrieval and attribute modifications, addressing limitations in the original core set.[4][40] In 1996, Microsoft released an open specification for the SMB 1.0 dialect under the Common Internet File System (CIFS) moniker, primarily to promote interoperability and facilitate its use over internet-compatible transports like direct TCP/IP on port 445, reducing reliance on NetBIOS for broader adoption. Designed initially for Windows NT 4.0, CIFS maintained backward compatibility with existing SMB implementations but inherited the original protocol's legacy inefficiencies, notably its "chatty" design that necessitated frequent client-server round trips for acknowledgments and status checks during file operations.[41][42] SMB 1.0 and CIFS exhibited key limitations that hindered performance and security in evolving network environments. The protocol's request-response model generated high latency, particularly over wide-area or high-delay links, as it required multiple round-trip exchanges—even for sequential byte reads or writes—rather than efficient streaming, often resulting in throttled throughput below 10 MB/s on connections with 100 ms or more latency. Furthermore, it provided no native support for encryption or message signing, exposing sessions to interception, tampering, and hijacking by unauthorized parties through man-in-the-middle attacks.[43][44] SMB 1.0 dominated file-sharing implementations throughout the Windows NT (from version 3.1 in 1993) and Windows 2000 eras, serving as the standard for enterprise domain-based networking and peer-to-peer resource access in millions of deployments. However, accumulating security vulnerabilities—exploited in high-profile incidents like WannaCry—prompted Microsoft to deprecate it publicly in 2014, with full removal by default in Windows 10 and Windows Server 2016 releases thereafter to enforce modern protocol usage.[45][3]SMB 2.x Developments
The Server Message Block (SMB) 2.0 protocol, introduced in 2006 alongside Windows Vista and Windows Server 2008, represented a major redesign of the original SMB protocol to address its complexity and inefficiencies.[46] It reduced the number of commands and subcommands from over 100 in SMB 1.0 to 19 core operations, streamlining the protocol while maintaining essential functionality for file and print sharing.[5] A key innovation was the introduction of compound requests, which enable pipelining multiple operations—such as opening a file, reading data, and closing it—within a single network message, thereby reducing latency and round-trip overhead.[47] Additionally, SMB 2.0 improved message integrity through enhanced signing mechanisms, replacing the weaker MD5-based approach of SMB 1.0 with more robust protections against tampering.[48] The protocol also simplified the message header to a fixed 64-byte structure, compared to the variable-length header (starting at 32 bytes plus extensions) in SMB 1.0, which contributed to better parsing efficiency and reduced overhead.[49] Building on SMB 2.0, the SMB 2.1 dialect was released in 2010 with Windows 7 and Windows Server 2008 R2, focusing on further optimizations for modern network environments.[13] It introduced client oplock leasing, an enhancement to opportunistic locking that allows clients to maintain caching states across multiple file opens and network interruptions, improving resilience and reducing server load in distributed scenarios.[50] SMB 2.1 also supported larger maximum transmission units (MTUs) up to 64 KB for reads and writes, enabling more efficient data transfer over high-speed links compared to the stricter limits in prior versions.[5] For wide-area network (WAN) scenarios, it integrated BranchCache support, allowing content to be cached at branch offices to accelerate file access and minimize bandwidth usage across slow links.[51] These changes in SMB 2.x collectively enhanced scalability, particularly for large-scale clusters, by improving handle durability and reducing protocol chattiness, which minimized connection state management overhead.[5] In practical terms, the revisions yielded up to threefold performance improvements in file copy operations over SMB 1.0 in certain workloads, driven by fewer network round trips and optimized data handling.SMB 3.x Advancements
The Server Message Block (SMB) 3.x series, introduced starting with SMB 3.0 in 2012, represents a significant evolution tailored for enterprise environments, emphasizing scalability, reliability, and security in high-performance networks. SMB 3.0, debuting with Windows 8 and Windows Server 2012, introduced SMB Multichannel, which aggregates multiple TCP connections between client and server to enhance throughput and provide fault tolerance by automatically rerouting traffic if a network path fails. This feature is particularly beneficial in environments with multiple network interfaces, enabling bandwidth utilization up to 10 Gbps and beyond without requiring specialized hardware. Additionally, SMB Transparent Failover allows seamless maintenance of clustered file servers, where clients automatically reconnect to available nodes during node failures or updates, minimizing downtime for applications like databases and virtual machines. SMB 3.0 also added end-to-end encryption for data in transit, protecting shares from eavesdropping on untrusted networks, alongside support for encryption at rest when integrated with storage solutions. These capabilities extended to Hyper-V integration, allowing virtual machines to store files on SMB shares with low-latency access comparable to local storage.[52][6]) Building on SMB 3.0, the 3.0.2 dialect, released in 2013 with Windows 8.1 and Windows Server 2012 R2, enhanced security by introducing client-side encryption initiation, enabling clients to request encrypted sessions independently of server configuration. This update also improved signing mechanisms, adopting AES-CMAC for more robust integrity checks against tampering, while adding capabilities like asymmetric share detection to optimize performance in mixed environments. These refinements addressed deployment flexibility in heterogeneous networks, ensuring secure data transfer without mandating server-side enforcement.[13][7] SMB 3.1.1, launched in 2015 alongside Windows 10 and Windows Server 2016, further advanced the protocol with encryption using AES-128-CCM and AES-128-GCM modes, providing enhanced performance and security compared to the previous AES-128-CCM-only encryption. Directory leasing was introduced to reduce network chatter in virtualized setups, allowing clients to cache directory information for extended periods and lease it from servers, which improves scalability for large-scale file servers supporting thousands of clients. Lightweight directory operations complemented this by enabling efficient querying of directory attributes without full file opens, optimizing performance for applications like search indexes. Later updates in Windows Server 2022 added AES-256-GCM and AES-256-CCM support. As of 2025, SMB 3.1.1 remains the default dialect in modern Windows implementations, with no major protocol version succeeding it, though enhancements like mandatory signing and SMB over QUIC in Windows Server 2025 build upon its foundation for enterprise resilience.[7][53][6][9] These features collectively support high-speed networks exceeding 10 Gbps, including integration with Remote Direct Memory Access (RDMA) via SMB Direct for reduced CPU overhead in data center scenarios.Protocol Details
Command and Message Structure
The Server Message Block (SMB) protocol structures its messages as binary packets divided into three primary components: a fixed-length header, a variable-length parameter block, and a variable-length data block. This format enables efficient transmission of requests and responses over a network, with the header providing essential metadata for routing and execution.[54] The SMB header, typically 32 bytes in length for early versions, begins with a 4-byte protocol identifier set to 0xFF followed by the ASCII characters 'S', 'M', and 'B' to denote an SMB message. Following this, a 1-byte command field specifies the opcode for the operation, such as tree connect or file open, with defined values ranging from 0x00 to 0xFF for various commands. Additional key fields include flags (1 byte) that indicate attributes like the reply bit (set in responses to mark them as such), a 2-byte process ID (PID) for tracking client processes, a 2-byte tree ID (TID) for shared resource contexts, and a 4-byte user ID (UID, later termed session ID or SID) to associate messages with user sessions. These fields collectively ensure message integrity, sequencing, and context preservation across exchanges. In later protocol iterations, the header evolves to include fields like structure size (fixed at 64 bytes for SMB 2.x) and credit charge for flow control, while retaining core identifiers like command and message IDs.[55][56] Command types in SMB are identified by opcodes in the header's command field, categorizing operations into basic file and directory manipulations, such as tree connect (opcode 0x70) to establish access to a shared resource and tree disconnect (0x71) to release it, or file open (0x2D in extended forms) and close (0x2E) for handling individual files. More complex operations use transact commands like SMB_COM_TRANSACTION (0x25) or its NT variant (0xA0) to encapsulate sub-operations, including file creation or device I/O control, allowing flexibility for variable payloads without dedicated opcodes. These opcodes enable a request-response model where clients issue commands and servers reply with matching opcodes and status indicators.[17][57] Payload formats follow the header and parameters, consisting of variable-length data blocks that carry operation-specific content, such as file names, buffers, or security descriptors. Early versions use ASCII strings padded to even lengths, while subsequent dialects support Unicode (UTF-16) for broader character compatibility, often prefixed with length indicators to parse variable sizes accurately. Error responses embed status codes in the header's status field, transitioning from 2-byte class/code pairs (e.g., ERRDOS for DOS errors) to 32-bit NT_STATUS values (e.g., 0xC0000001 for STATUS_UNSUCCESSFUL) in extended implementations, providing detailed failure semantics without altering the core structure. Data blocks may include format codes to denote types like disk attributes or search patterns, ensuring interoperability in diverse operations.[58][59][60] Dialect negotiation occurs at connection initiation, where the client proposes supported protocol versions (dialects) via a negotiate protocol request, listing strings like "PC NETWORK PROGRAM 1.0" or "NT LM 0.12" in order of preference. The server responds by selecting the highest mutually compatible dialect, echoing it back in the response to establish the session's operational rules, including supported features like Unicode or extended security. This mechanism ensures backward compatibility while enabling advanced capabilities in modern environments.[54][61]Session and Transport Mechanisms
For SMB 2.0 and later, session management begins with the establishment of a session through the SMB2 SESSION_SETUP command, which authenticates the user using the Generic Security Service Application Program Interface (GSS-API) framework.[62] This process supports authentication via NTLM or Kerberos protocols, where the client sends security tokens in the request, and the server validates them against the provided credentials.[63] Upon successful authentication, the server generates a session key derived from the authentication context, typically the first 16 bytes of the cryptographic key, which is used to derive signing and encryption keys for subsequent communications.[64] These session keys enable message signing to ensure integrity and, in SMB 3.x dialects, optional encryption using algorithms like AES-128-CCM or AES-128-GCM to protect data confidentiality.[65] A single authenticated session can multiplex multiple tree connections, allowing the client to access different shares or resources over the same session without re-authenticating, thereby reducing overhead and improving efficiency.[66] The SMB protocol primarily operates over transport layers that prioritize reliability and security. Modern implementations, starting from SMB 2.0, prefer direct hosting over TCP/IP on port 445, which eliminates the need for intermediate layers and enables efficient, NetBIOS-less communication. As of Windows Server 2025, SMB also supports transport over QUIC (Quick UDP Internet Connections) on UDP port 443, providing secure, encrypted file sharing over untrusted networks such as the internet without requiring a VPN.[9] For legacy compatibility with SMB 1.0 and earlier CIFS implementations, the protocol falls back to NetBIOS over TCP/IP (ports 137-139 UDP/TCP), where NetBIOS provides name resolution and session services atop the TCP or UDP transport.[67] This dual-transport approach ensures backward compatibility while encouraging migration to the more streamlined TCP 445 or QUIC methods, as NetBIOS-based transports add latency and complexity unnecessary for contemporary networks.[14] Connection resilience features, introduced and enhanced in SMB 3.x, allow for seamless handling of network disruptions and server failovers without interrupting client operations. When a connection is lost, the client can initiate reconnection logic using persistent or resilient handles, which maintain open files and directories across interruptions, enabling transparent failover in clustered environments.[68] Servers implementing SMB 3.x monitor connection health through mechanisms like TCP keep-alives and periodic session checks, effectively acting as heartbeats to detect failures promptly.[23] Upon detecting a failure, the protocol supports re-establishing the connection and replaying pending requests, ensuring data integrity and minimal downtime during events such as node failover in Windows Server Failover Clustering.[69] Flow control in SMB 2.0 and later versions employs a credit-based windowing system to manage request throughput and prevent server overload. Each SMB2 message includes CreditCharge and CreditRequest fields in the header; the server grants credits to the client upon processing requests, limiting the number of outstanding operations based on its capacity using a vendor-specific algorithm.[70] Initially, the server provides a small credit window (e.g., at least one credit on negotiation), which can expand dynamically as the server handles load, allowing the client to issue up to the granted credits concurrently while avoiding congestion.[71] This mechanism replaces the less efficient request pipelining of SMB 1.0, providing better scalability and performance under high-load scenarios.[37]Implementations
Microsoft Implementations
Microsoft's implementation of the Server Message Block (SMB) protocol has been integral to file and printer sharing in Windows operating systems since the early versions. In Windows NT, Windows 2000, and Windows XP, SMB 1.0 served as the primary dialect for both client and server roles, enabling network access to shared resources over NetBIOS or TCP/IP transports.[2] With the release of Windows Vista and Windows Server 2008, Microsoft introduced SMB 2.0, which became the default, reducing protocol overhead and improving performance for client-server interactions.[2] Subsequent versions, such as SMB 2.1 in Windows 7 and Windows Server 2008 R2, added large MTU support and client-side caching. By Windows 8 and Windows Server 2012, SMB 3.0 was implemented, adding features like SMB Multichannel for better bandwidth utilization. Windows Server 2016 and later default to SMB 3.1.1 as the standard for enhanced security and efficiency in enterprise environments.[2] Key components of Microsoft's SMB implementation include the SMB redirector on the client side, which handles requests to remote servers and maps them to local file system operations, and the server service, known as LanmanServer, which manages shared resources and responds to incoming SMB connections.[72][73] Configuration of these components is often performed via Group Policy, allowing administrators to disable legacy versions like SMB 1.0 to mitigate security risks; for instance, policies under Computer Configuration > Administrative Templates > Network > Lanman Workstation can enforce the use of only SMB 2.0 and later.[5] Exclusive to Microsoft's ecosystem, SMB Direct leverages Remote Direct Memory Access (RDMA) over Ethernet adapters to offload data transfer from the CPU, enabling low-latency, high-throughput file sharing in scenarios like Hyper-V storage or SQL Server deployments.[74] Additionally, SMB integrates seamlessly with Active Directory for access control, using Kerberos authentication in domain-joined environments to validate user credentials and enforce NTFS permissions on shares.[6] As of 2025, Windows 11 version 24H2 and Windows Server 2025 mandate SMB 3.x dialects by default, with SMB 1.0 and insecure protocols disabled out-of-the-box to prioritize security. These releases also support port customization for SMB traffic—beyond the traditional TCP 445—via PowerShell cmdlets like New-SmbServerAlternativePort, allowing administrators to configure alternative ports for SMB over QUIC to enhance network segmentation and threat isolation.[75][76]Open-Source and Third-Party Implementations
Samba is the most prominent open-source implementation of the SMB protocol, providing both client and server functionality for Unix-like systems such as Linux and FreeBSD since the 1990s.[77] It supports SMB versions from 1.0 through 3.1.1, enabling file and print sharing, as well as Active Directory domain controller emulation for cross-platform interoperability.[78] Widely deployed in network-attached storage (NAS) devices and enterprise environments, Samba facilitates seamless integration of non-Windows systems into Microsoft-dominated networks. Another notable open-source server implementation is KSMBD, a Linux kernel module introduced in kernel version 5.15 in 2021 and declared stable in Linux 6.6.[79] Designed for enhanced performance by processing SMB requests directly in kernel space, KSMBD supports SMB 2.x and 3.x dialects, including multichannel and encryption features, making it suitable for high-throughput file serving in Linux-based systems.[80] For cross-platform needs, third-party solutions like Tuxera Fusion provide a high-performance SMB stack optimized for Linux, macOS, and Windows environments.[81] It offers superior scalability, supporting up to 32 nodes and advanced features such as SMB Direct over RDMA, positioning it as an alternative to Samba for demanding workloads like media production and enterprise storage.[82] In niche areas, historical tools like Likewise—rebranded as BeyondTrust PowerBroker Identity Services—focus on identity integration for SMB access, allowing Unix and Linux systems to join Active Directory domains using Kerberos authentication. For embedded systems, Visuality Systems' NQ provides a compact C-based SMB client and server stack compliant with SMB 3.x, enabling resource-constrained devices to interoperate with Windows networks.[83] Similarly, Ryussi's MoSMB delivers a user-mode SMB 3.x server for Linux-based embedded and NAS appliances, emphasizing enterprise-grade compliance and security for workloads like Hyper-V and SQL Server.[84] Open-source and third-party implementations face ongoing challenges in achieving full compliance with SMB 3.1.1 features, particularly encryption and signing algorithms. As of 2025, Samba versions 4.20 and later provide robust support for SMB 3.1.1 encryption, though rigorous testing against Microsoft baselines remains essential for interoperability.[85]Security Aspects
Authentication and Encryption
Server Message Block (SMB) employs multiple authentication mechanisms to verify client identities and establish secure sessions. The NTLM protocol, available in versions 1 and 2, operates via challenge-response exchanges where the client demonstrates knowledge of the user's password without sending it in plaintext, enabling secure access to SMB shares. In Active Directory domain environments, Kerberos serves as the preferred method, facilitating mutual authentication through time-limited tickets issued by a trusted key distribution center, which reduces reliance on password-based challenges. Guest access, allowing anonymous connections without credentials, has been deprecated in contemporary Windows implementations starting from Windows Vista and Server 2008, as it poses significant risks for unauthorized entry.[86][87][88] Session security in SMB prevents message tampering through digital signing, ensuring integrity during transmission. From SMB 2.02 onward, signing utilizes the HMAC-SHA256 algorithm to compute a hash-based authentication code for each message, replacing the vulnerable MD5 approach used in SMB 1.0. The signing key is derived from the session key generated during authentication; for NTLM, this involves hashing the user's password, while Kerberos derives it from the ticket's shared secret, allowing both client and server to independently verify signatures without additional round trips.[48][7] SMB 3.0 and subsequent versions provide encryption to protect data confidentiality over untrusted networks, using the AES-CCM mode with 128-bit or 256-bit keys for both encryption and authentication of payloads. Administrators can enable encryption at the share level on servers or enforce it globally via client-side policies, with support for AES-GCM in SMB 3.1.1 for improved performance on compatible hardware. In scenarios involving older SMB dialects or non-supporting peers, connections fall back to unencrypted mode if not explicitly required, though this is discouraged in secure deployments.[7][6] In Windows Server 2025 and Windows 11 version 24H2, the SMB client provides a Group Policy to require encryption for all outbound SMB 3.x connections, which can be enabled in hardened configurations to safeguard sensitive data in transit. This capability supports organizational compliance with regulatory frameworks by mitigating interception risks on shared networks.[89][75]Known Vulnerabilities and Mitigations
Server Message Block (SMB) version 1.0 has been plagued by significant security flaws, most notably the EternalBlue vulnerability (CVE-2017-0144), which allows remote code execution through specially crafted packets targeting the SMBv1 server component in various Windows systems.[90] This exploit was widely used in the 2017 WannaCry ransomware attack, which propagated across networks by leveraging the vulnerability to encrypt files and demand ransoms, affecting hundreds of thousands of systems globally.[91] Additionally, SMB 1.0 supports null sessions, enabling anonymous access without credentials, which permits attackers to enumerate shares, users, and other network resources, facilitating reconnaissance for further exploits. In SMB 2.x and 3.x, risks persist despite improvements, including NTLM relay attacks where attackers intercept and relay authentication credentials to gain unauthorized access to SMB shares, often exploiting the lack of channel binding in NTLM over SMB.[92] Denial-of-service (DoS) conditions can also arise from malformed packets, such as those triggering buffer overflows or infinite loops in SMB transaction handling, potentially crashing affected servers.[93] A prominent example is SMBGhost (CVE-2020-0796), a remote code execution flaw in SMB 3.1.1 that mishandles compression requests, allowing unauthenticated attackers to execute arbitrary code on unpatched Windows 10 versions 1903 and 1909.[94] To mitigate these vulnerabilities, organizations should disable SMB 1.0 entirely, which can be achieved using PowerShell commands likeSet-SmbServerConfiguration -EnableSMB1Protocol $false and Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" SMB1 -Type DWORD -Value 0 -Force to remove its features from both client and server configurations.[5] For SMB 2.x and 3.x, enforce the use of SMB 3.1.1 with mandatory encryption (via Set-SmbServerConfiguration -EncryptData $true) to protect against relay and interception attacks, while configuring firewalls to block inbound TCP port 445 traffic from external sources, limiting exposure to internal networks only.[75] [95]
As of 2025, Microsoft released September security updates (e.g., KB5065426) that intentionally disrupt compatibility with SMBv1 shares over NetBIOS, addressing lingering risks by breaking legacy connections and compelling upgrades to secure versions, though this may require reconfiguration for affected environments. Subsequent November 2025 security updates have introduced additional changes to SMB behaviors, which may affect network sharing and require verification of compatibility in updated environments.[96][97] Ongoing security guidance emphasizes integrating SMB into zero-trust models, where access to shares is continuously verified regardless of network location, reducing reliance on perimeter defenses alone.[98]