Server Message Block (SMB)

The Server Message Block (SMB) is a network protocol that allows the host to share data within the same network. It is share directories, files, printers, and serial ports as easily as if they were on the local computer. It is a request-response protocol and it used TCP port 445 for communication. All the messages of the Server Message Block protocol have a common format, which uses a fixed-sized header, with a parameter of variable size and a data component.

The Server Message Block protocol suite is comparatively easy and simple. It includes commands for resource operation that you might do on a local disk or printer, such as:

  • Creating new files and directories
  • Deleting files and directories
  • Opening and closing files
  • Searching for files and directories
  • Reading and writing and editing files
  • Queuing and de-queuing files in a print spool

The Server Message Block servers make the file systems and resources available to the clients in the network. The clients make SMB requests for the available resources on the server using the commands and the servers create Server Message Block response messages. The following are the SMB messages types:-

·         Initiate, authenticate, and terminate the sessions

·         Control access to file and printer

·         Allow to send and receive messages using application

The files sharing and printer sharing both are the main services of Microsoft networking. With releasing of Windows 2000, Microsoft changed the original structure for using SMB. Before Windows 2000, the Server Message Block services used a non-TCP/IP protocol to execute name resolution but after windows 2000; all Microsoft products use DNS naming, which allows TCP/IP protocols to support SMB resource sharing. The figure below illustrates the SMB protocols connection establishment.


Using the Server Message Block, once the connection is established, the user of the client can reach the resources on the remote end as if the resource is local to the client host.

although Server Message Block protocol was initially created for Windows; now it can also be used by Linux Unix and Mac OSX, using software called Samba. Using Samba, Linux, Mac, Windows, and Unix computers can share the same files, folders, and printers.