# CIFS (Common Internet File System)

## What is CIFS?

**CIFS (Common Internet File System)** is a network protocol that allows clients to communicate with servers and access file sharing and print services as if they were stored locally. 

The CIFS protocol is a particular implementation -- or dialect-- of the file-sharing protocol **SMB (Server Message Block)**. The Server Message Block protocol was released by IBM in 1983 that has since undergone several modifications to its functionality by Microsoft. 

There is often confusion between the terms "CIFS" and "SMB" because the terms are often used interchangeably but there is a difference between CIFS and SMB. CIFS (sometimes called “CIFS/SMB”) actually refers to a specific dialect of SMB and not the SMB protocol generically. 

## How Does CIFS Work?

The CIFS protocol enables file shares (or CIFS shares) between computers on a network. CIFS operates through NetBIOS over the TCP/IP protocol, mostly on older Windows versions and a range of network-attached storage (NAS) systems. 

CIFS can also operate with other protocols, including File Transfer Protocol (FTP) and Hypertext Transfer Protocol (HTTP).

CIFS works through a client-server model, defined by three main entities: a Client, Server, and Application – through which the client can access CIFS services.

The CIFS client-server model works as follows: 

1. The client sends a request to the server.

2. The server completes the request.

3. The server responds to the client.

## CIFS Functionality

- **Transport independence**: CIFS has no requirements for the transport protocol passing messages between the client and server. The protocol is usually transported over a connection-orientated protocol and can also operate through connectionless protocols.

- **Flexible connectivity**: A single can make multiple connections across multiple servers. 
Feature negotiation: The CIFS dialect and supported set of features are negotiated on a per-connection basis.

- **Resource access**:  CIFS clients have concurrent access to shared resources like files, named pipes, and print cues on the target server.

- **Security contexts**: If necessary, clients can create more than one security context over their connection.

- **File access**: As the server manages file sharing, several clients can access the same file at the same time.

- **Extended subprotocols**: CIFS can be used alongside a set of protocols that enable enhanced server functionality. 

- **Named pipe interprocess communication**: Clients can access named pipes, which act as a line of communication between the client and server. 

- **File and record locking, and safe caching**: Clients can cache data through opportunistic locking, which enhances network performance. The protocol also supports file and record locking.

- **File, directory, and volume attributes**: The CIFS specification enables clients to query, and set - file, directory, and volume attributes. CIFS also has Access Control Lists (ACLs) compatibility. 

- **File and directory change notification**: Clients can request notification when file changes are made within a server directory or directory tree. 

- **Batched commands**: CIFS AndX messages can be chained together and executed in sequence on the server, avoiding multiple message round-trips.

- **Distributed File System (DFS) support**: DFS allows consistent object naming across different servers and shares.

- **Remote Procedure Call (RPC) transport**: CIFS provides transport authentication across RPC protocols, like RPC [MS-RPCE] and RAP [MS-RAP].

- **Message verification**: CFES uses message signing to prevent messages from being modified in transit.

- **Unicode file name support**: CIFS extends support to ASCII character sets and long Unicode file names.

## CIFS Uses

CIFS is an early version of the SMB protocol that facilitates file sharing between Microsoft Windows clients, for example, through Windows For Workgroups. SMB was originally designed to allow clients to remotely read and write files over a local area network (LAN).

Clients can also use Samba to configure CIFS on other operating systems, like Linux and Unix.

Samba enables file sharing and print services, authentication and authorization, name resolution (such as DNS), and service announcements between Linux/Unix servers and Windows clients. 

CIFS users can use Samba to communicate between Apple’s OS X and Windows file shares. 

CIFS is also compatible with Windows Server Domain, Active Directory, and Windows NT.