Spirent Avalanche 5.46 February 29, 2024

Testing CIFSNG/SMB

NOTE: Avalanche provides a prototype CIFS (Common Internet File System) implementation denoted by "CIFS" in the Action list. This prototype is currently undocumented, and provides only a small subset of CIFS capabilities. The CIFSNG (Common Internet File System Next Generation) implementation provides more complete coverage of the CIFS protocol. If you are currently using the prototype CIFS, you cannot port to the new CIFSNG implementation directly. You will need to start from scratch.

IMPORTANT:

  • When using a CIFSv1 emulated server, real I/O is not actually performed in all cases, because of performance reasons. In general, operations that physically alter data on the emulated server are not performed (e.g., OPEN_NEW, COPY, DELETE, etc.). For example, when a client issues a write command, the emulated server will discard the data, but it will respond that the operation was successful. However, when necessary, the emulated server will perform real I/O, as in the case of a read command, so that it can return the actual file data to the client.
  • When using an SMB emulated server, the WRITE operation is not supported if you select On the fly or From Dir/File as your Data Source. You must select Enable Disk Operation to perform WRITE operations.
  • SMB supports only a subset of CIFS operations, as follows:

    • OPEN_NEW
    • OPEN
    • READ
    • WRITE
    • WRITE_VALIDATE with FORCE_CLOSE_PER_CHUNK=FALSE
    • WRITE_VALIDATE with FORCE_CLOSE_PER_CHUNK=TRUE
    • WRITE_ENTIRE_FILE_THEN_VALIDATE

The following procedure tells you how to test the CIFSNG/SMB protocol. It is assumed that you

To complete CIFSNG/SMB-specific information and run the test:

  1. Learn about Avalanche CIFSNG/SMB testing.
  2. Define information for the client.
  3. Add an Actions list.
  4. Define the server profile. (Device test only)
  5. Run the test and review results.

About CIFSNG/SMB Testing

The Common Internet File System (CIFS) is a file sharing protocol. Clients use this protocol to request file access services from servers over a network. CIFS is based on the Server Message Block (SMB) protocol, widely used by personal computers and workstations on a variety of operating systems. It is a key file sharing protocol due to its widespread distribution and enhancements for Internet authoring and file sharing.

NOTE: For information about CIFS SMB, refer to CIFS SMB Support in Avalanche.

Avalanche emulates multiple clients accessing files on a CIFS server. The server can be a real CIFS server, a cluster of real servers, and/or an emulated server. Avalanche gains access to shared folders through authentication, downloads and uploads real files through Action list commands, and collects relevant statistics.

As an alternative to real files, you can specify for Avalanche to generate file data using the on-the-fly feature. (See the on-the-fly example in the Actions list section.) These generated files are filled with the "*" character.

NOTE: See the Microsoft documents at http://search.microsoft.com/results.aspx?mkt=en-US&setlang=en-US&q=CIFS for an overview of CIFS. The Storage Networking Industry Association (SNIA) technical reference document, http://www.snia.org/tech_activities/CIFS/CIFS-TR-1p00_FINAL.pdf, contains further details on the CIFS protocol.

Defining Client Information

Define the client SMB parameters that you want to use.

To configure the client:

  1. Click the Client tab, and then the Profiles tab.
  2. Select the client profile with which you want to work.
  3. Click SMB, and complete entries to define the randomization and authentication parameters. For more information, see Client Profiles SMB Fields.

Adding an Actions List

Action lists identify the actions that Avalanche takes for each simulated user during a test. Each list line represents a requested object from your test server. As Avalanche simulates new users, each one uses the list from top to bottom.

To add an Actions list for a CIFSNG/SMB test:

  1. Click the Client tab, and then the Actions tab.
  2. Click the New button to create a new list.
  3. Enter information that emulates clients accessing files on a CIFSNG/SMB server. Refer to the following syntax and examples.

Syntax

To specify the file structure for CIFSNG/SMB commands, you need to first upload the file directory using the Directories tab on the Client Actions tab. You then reference your named directory in the FSTREE action as follows:

FSTREE=directory_name

NOTES:

  • The maximum size of this directory depends on the memory and storage resources of your hardware platform. For example, for Avalanche appliances, no more than 1 gigabyte is recommended.
  • You should use the FSTREE keyword only once in your Actions list. If you use it multiple times, only the last one will apply to your test.

The following syntax establishes a TCP connection to a CIFS server:

cifsng://server_IP_address USER=user_name PASSWD=password AUTH_TYPE=NTLM AUTHDOMAIN=SERVER CONNECTION_TREE=\\server_IP_address\server_dir DIALECT=2.002

CIFS_SUB_CMD CIFS_READ_BLK_SIZE = integer_value

CIFS_SUB_CMD CIFS_WRITE_BLK_SIZE = integer_value

NOTE: If you omit the DIALECT parameter, CIFSv1 will be used to run the test.

NOTES:

  • You can use either cifsng:// or smb:// syntax at the beginning of the statement.
  • When using cifsng:// syntax, you can only use CIFS_SUB_CMD statements.
  • In general, when using smb:// syntax, you can use either CIFS_SUB_CMD or SMB_SUB_CMD statements. However, the following actions require that you use CIFS_SUB_CMD statements:
    • CIFS_THINK_TIME
    • CIFS_START_LOOP
    • CIFS_STOP_LOOP
  • CIFS_READ_BLK_SIZE and CIFS_WRITE_BLK_SIZE statements must immediately follow the cifsng:// or smb:// statement, and are applied globally across the CIFSNG/SMB session.
  • If you specify a CIFS_READ_BLK_SIZE or CIFS_WRITE_BLK_SIZE value that exceeds the maximum size of a READ/WRITE request supported by the CIFS server, then processing will proceed with the maximum size.
  • The block size actually used in the CIFSNG/SMB read/write request is capped by the maximum read/write block size advertised by the CIFS server.

Examples

FSTREE=cifs

cifsng://10.1.1.1 USER=cifs_server PASSWD=welcome AUTH_TYPE=NTLM AUTHDOMAIN=SERVER CONNECTION_TREE=\\10.1.1.1\shared_dir DIALECT=2.002

NOTES:

  • Every OPEN command must have a corresponding CLOSE command.
  • If you specify a filename or path/directory that contains a space, the entire string must be enclosed in double quotes (").

CIFS_SUB_CMD OPEN_NEW FILENAME=simple_copy.txt

CIFS_SUB_CMD WRITE FILENAME=simple_copy.txt OFFSET=100 BYTE_SIZE=129000 INPUT_SOURCE=/cifs/simple.txt INPUT_OFFSET=200

CIFS_SUB_CMD WRITE FILENAME=simple_copy.txt INPUT_SOURCE=/cifs/simple.txt

CIFS_SUB_CMD CLOSE FILENAME=simple_copy.txt

  1. NOTES:

    • This example assumes that the emulated server is configured with the smalldir named file hierarchy.
    • Since both the OFFSET and BYTE_SIZE parameters are omitted, the OFFSET defaults to zero, and the BYTE_SIZE defaults to the size of the file specified by FILENAME.

CIFSNG://172.30.3.51 USER=user_name PASSWD=user_password AUTH_TYPE=NTLMv2 AUTHDOMAIN=your_domain CONNECTION_TREE=Shared DIALECT=2.002

CIFS_SUB_CMD CIFS_READ_BLK_SIZE = 16384

CIFS_SUB_CMD OPEN FILENAME=/smalldir/smallfile.txt

CIFS_SUB_CMD READ FILENAME=/smalldir/smallfile.txt

CIFS_SUB_CMD CLOSE FILENAME=/smalldir/smallfile.txt

The SMB protocol supports the directory browsing operations, FIND_FIRST and FIND_NEXT, as in the following example.

CIFS_SUB_CMD FIND_FIRST FILENAME=\newfolder\f1\<wildcard_name> INFO_LEVEL=FIND_FILE_BOTH_DIRECTORY_INFO FILE_ONLY=YES

CIFS_SUB_CMD FIND_NEXT RESCAN=YES

The FIND_FIRST command automatically OPENs the \newfolder\f1 directory, and then sends an SMB QUERY_DIRECTORY request to store a list of files that match the wildcard name (or a single filename) in memory. It then saves the first filename in the list in the FOUND_FILE parameter.

  1. NOTES:

    • FIND_FIRST allows wildcard names using ‘?’ for single characters, and ‘*’ for multiple characters, as in the following examples:
      • *
      • *.txt
      • read*
      • ab??.txt
    • You can subsequently use the FOUND_FILE parameter within OPEN, CLOSE, READ, and WRITE commands, as in the following example:

    CIFS_SUB_CMD OPEN FILENAME=FOUND_FILE

    If the FOUND_FILE parameter is a string of zero length (no file found), the command is skipped.

If the FIND_FIRST command contains the optional parameter, FILE_ONLY=YES, the search excludes directory names from the list. (If you omit this parameter, the default is FILE_ONLY=NO.)

The FIND_NEXT command searches for the next file in the list after the latest FOUND_FILE, and then sets a new value for the FOUND_FILE parameter.

If the FIND_NEXT command contains RESCAN=YES, an additional SMB QUERY_DIRECTORY request is sent to the same \newfolder\f1 directory. If RESCAN=NO, the search for the next file proceeds without requesting server data.

  1. NOTES:

    • If the FIND_FIRST or FIND_NEXT command fails to find a file as specified by FILENAME, the FOUND_FILE parameter is set to a string of zero length.
    • If a FOUND_FILE parameter of zero length is encountered within a loop, the Action list command after the CIFS_STOP_LOOP is executed next.

The SMB protocol supports oplock break notifications and all types of oplocks, as in the following example.

NOTE: For more information about opportunistic locks, refer to http://ubiqx.org/cifs/rfc-draft/draft-leach-cifs-v1-spec-02.html.

CIFS_SUB_CMD OPLOCK_LEVEL=<oplock_level> CANCEL_CREATE=NO OPLOCK_BREAK_TIMEOUT=15 CANCEL_PENDING=YES

The optional OPLOCK_LEVEL command allows you to set one of the following oplock levels for any subsequent SMB CREATE (OPEN) commands:

    • OPLOCK_LEVEL_BATCH

    • OPLOCK_LEVEL_EXCLUSIVE

    • OPLOCK_LEVEL_II

    • OPLOCK_LEVEL_NONE

A CANCEL_CREATE=YES parameter dictates sending SMB CANCEL, if STATUS_PENDING is received for any subsequent CREATE (OPEN) request.

The optional CANCEL_PENDING=YES parameter dictates sending SMB CANCEL, if STATUS_PENDING is received for any subsequent SMB request except CREATE (OPEN).

The optional OPLOCK_BREAK_TIMEOUT parameter sets a timeout (in seconds) in which to send an OPLOCK_BREAK Acknowledgment, after receiving OPLOCK_BREAK from a server.

  1. NOTES:

    • The OPLOCK_BREAK Acknowledgment will be sent with a significant delay, if you use Transaction Control.
    • If you specify the CANCEL_PENDING parameter, you must also specify the OPLOCK_BREAK_TIMEOUT parameter.
    • You can specify an OPLOCK_LEVEL command several times within a session. The latest parameter values are applied to subsequent commands. If you do not specify the OPLOCK_BREAK_TIMEOUT parameter or the CANCEL_PENDING parameter, its corresponding value remains as previously set.
    • Initial parameter values, prior to specifying any OPLOCK_LEVEL command, are as follows:
      • OPLOCK_LEVEL=OPLOCK_LEVEL_NONE

      • CANCEL_CREATE=NO

      • OPLOCK_BREAK_TIMEOUT=15

      • CANCEL_PENDING=YES

Performing Data Validation

NOTE: Data validation is supported only when running against a real CIFS server, since the emulated server does not perform any real I/O when a client issues a write command.

For validating data when writing to a file, the following commands/options are available:

For Actions list syntax and examples for the above commands/options, see CIFSNG Data Validation.

Using Kerberos Authentication

Use AUTH_TYPE=KERBEROS in the Actions list to specify Kerberos V5 security authentication. This requires parameters for client and server principals (CLIENT_PRINCIPAL and SERVER_PRINCIPAL), as in the following example:

KERBEROSCONNECT CLIENT_PRINCIPAL=cifs/client.local.network@LOCAL.NETWORK

CIFSNG://server_IP_address AUTH_TYPE=KERBEROS SERVER_PRINCIPAL=cifs/server.local.network@LOCAL.NETWORK CONNECTION_TREE=Shared DIALECT=2.002

Use the Kerberos area on the Client Profiles tab to configure other Kerberos parameters (key table, KDC host IP address/port, and TGS).

NOTES:

  • A Kerberos principal is a unique identity to which Kerberos can assign tickets. Principals can have an arbitrary number of components. Each component is separated by a component separator (generally, "/"). The last component is the realm, separated from the rest of the principal by the realm separator (generally, "@").
  • In the CIFSNG/SMB or HTTP Actions list, only one KERBEROSCONNECT command is allowed, and it should precede any protocol using Kerberos.
  • The following are limitations of the KERBEROSCONNECT command:
    • Does not support pre-authentication
    • Does not support SSLVPN
    • Cannot be included within a pipe-lining area

    • Cannot be included within a loop

Example

The Actions list supports Kerberos authentication with one client principal and multiple server principals, as in the following example:

KERBEROSCONNECT CLIENT_PRINCIPAL=celia.spirent.com@SPIRENT.COM

1 GET http://192.168.42.30

1 GET http://192.168.42.11/ <AUTH: Kerberos SERVER_PRINCIPAL=http/av-nfs-01.spirent.com@SPIRENT.COM>

CIFSNG://192.168.42.21 AUTH_TYPE=KERBEROS SERVER_PRINCIPAL=cifs/av-nfs-01.spirent.com@SPIRENT.COM CONNECTION_TREE=Shared DIALECT=2.002

CIFSNG://192.168.42.21 AUTH_TYPE=KERBEROS SERVER_PRINCIPAL=cifs/av-nfs-01.spirent.com@SPIRENT.COM CONNECTION_TREE=Shared

1 GET http://192.168.42.30

CIFSNG://192.168.42.22 AUTH_TYPE=KERBEROS SERVER_PRINCIPAL=cifs/av-nfs-02.spirent.com@SPIRENT.COM CONNECTION_TREE=Shared DIALECT=2.002

1 GET http://192.168.42.12/ <AUTH: Kerberos SERVER_PRINCIPAL=http/av-nfs-02.spirent.com@SPIRENT.COM>

1 GET http://192.168.42.13/ <AUTH: Kerberos SERVER_PRINCIPAL=http/av-nfs-03.spirent.com@SPIRENT.COM>

Using Loops and Timers

The CIFS loop action allows you to execute a set of CIFS actions multiple times. You can also introduce a delay between CIFS actions using the CIFS think time action.

NOTES:

  • Nested loops are not permitted, and will result in an error.
  • Every OPEN command must have a corresponding CLOSE command within the loop.

Loop Syntax

CIFS_SUB_CMD CIFS_START_LOOP = number_of_loops

list of CIFS_SUB_CMD actions

CIFS_SUB_CMD CIFS_STOP_LOOP

Timer Syntax

CIFS_SUB_CMD CIFS_THINK_TIME = number_of_seconds

Example

Execute a loop 10 times, which requests file system information and pauses 1 second after each request.

CIFS_SUB_CMD CIFS_START_LOOP = 10

CIFS_SUB_CMD QUERY_FS_INFO INFO_LEVEL=FS_VOLUME_INFO

CIFS_SUB_CMD CIFS_THINK_TIME = 1

CIFS_SUB_CMD CIFS_STOP_LOOP

Using a Forms Database for Server Connection

The following example shows how to define CIFS server connection parameters, using variables from a forms database.

NOTES:

  • The variable assignments (theUrl, theUser, thePasswd, theAuth, theDomain, and myTree) must precede the CIFSNG/SMB actions.
  • All parameters, except the server IP address/URL, must be either all fixed, or all forms database values.
  • For the server IP address/URL, you can specify either a fixed or forms database value. However, if you use a forms database value, all the other parameters must also use forms database values.

ASSIGN VARIABLE <theUrl Form_1.$1>

ASSIGN VARIABLE <theUser Form_1.$2>

ASSIGN VARIABLE <thePasswd Form_1.$3>

ASSIGN VARIABLE <theAuth Form_1.$4>

ASSIGN VARIABLE <theDomain Form_1.$5>

ASSIGN VARIABLE <myTree Form_1.$6>

 

CIFSNG://<APPLY theUrl> USER=<APPLY theUser> PASSWD=<APPLY thePasswd> AUTH_TYPE=<APPLY theAuth> AUTHDOMAIN=<APPLY theDomain> CONNECTION_TREE=<APPLY myTree>

Using a Forms Database for Filename Randomization

The following example uses a forms database with CIFSNG/SMB actions to obtain filename randomization. The example shows how to iterate through a list of files, such that each simulated user accesses a different filename.

NOTE: The variable assignments (theFilename, theSrc, theDest, and thedirname) must precede the CIFSNG/SMB actions.

ASSIGN VARIABLE <theFilename Form_1.$1>
ASSIGN VARIABLE <theSrc Form_2.$1>
ASSIGN VARIABLE <theDest Form_2.$2>
ASSIGN VARIABLE <thedirname Form_1.$2>

CIFSNG://10.1.1.1 USER=cifs_server PASSWD=welcome AUTH_TYPE=NTLM AUTHDOMAIN=SERVER CONNECTION_TREE=\\10.1.1.1\shared_dir DIALECT=2.002

NOTE: The following shows how to use thedirname variable to create a directory and check/verify that a path exists and is a directory.

CIFS_SUB_CMD CREATE_DIR DIR_PATH_VAR=<APPLY thedirname>
CIFS_SUB_CMD CHECK_DIR DIR_PATH_VAR=<APPLY thedirname>

NOTES:

  • The following shows file and directory information being obtained for theFilename variable, as well as basic and extended attribute information. The file is opened, read, and closed.
  • Write and rename commands are used with theSrc and theDest variables.

CIFS_SUB_CMD FIND_FIRST FILENAME_VAR=<APPLY theFilename> INFO_LEVEL=FIND_FILE_BOTH_DIRECTORY_INFO

CIFS_SUB_CMD TRANS2_QUERY_PATH_INFO FILENAME_VAR=<APPLY theFilename> INFO_LEVEL=QUERY_FILE_BASIC_INFO

CIFS_SUB_CMD OPEN FILENAME_VAR=<APPLY theFilename>
CIFS_SUB_CMD TRANS2_QUERY_FILE_INFO FILENAME_VAR=<APPLY theFilename> INFO_LEVEL=QUERY_FILE_EA_INFO
CIFS_SUB_CMD CLOSE FILENAME_VAR=<APPLY theFilename>

CIFS_SUB_CMD OPEN FILENAME_VAR=<APPLY theFilename>
CIFS_SUB_CMD READ FILENAME_VAR=<APPLY theFilename>
CIFS_SUB_CMD READ FILENAME_VAR=<APPLY theFilename> OFFSET=4 BYTE_SIZE=1000
CIFS_SUB_CMD WRITE FILENAME_VAR=<APPLY theSrc> INPUT_SOURCE_VAR=<APPLY theDest>
CIFS_SUB_CMD CLOSE FILENAME_VAR=<APPLY theFilename>

CIFS_SUB_CMD RENAME_FILE FILENAME_VAR=<APPLY theSrc> NEW_FILENAME_VAR=<APPLY theDest>

NOTE: The following shows how to delete theDest file and thedirname directory.

CIFS_SUB_CMD DELETE_FILE FILENAME_VAR=<APPLY theDest>
CIFS_SUB_CMD DELETE_DIR DIR_PATH_VAR=<APPLY thedirname>

Using a Forms Database for Kerberos Authentication

NOTES:

  • The following shows how to define Kerberos authentication parameters, using variables from a forms database.
  • When using a forms database for Kerberos authentication, ensure that you disable the URL Encode Form field in the Forms tab on the Client Actions tab.
  • The variable assignments (myUrl, myAuth, myPrincipal, and myTree) must precede the CIFSNG/SMB actions.

KERBEROSCONNECT CLIENT_PRINCIPAL=Form_0001.$1

ASSIGN VARIABLE <myUrl Form_0001.$2>

ASSIGN VARIABLE <myAuth Form_0001.$3>

ASSIGN VARIABLE <myPrincipal Form_0001.$4>

ASSIGN VARIABLE <myTree Form_0001.$5>

CIFSNG://<APPLY myUrl> AUTH_TYPE=<APPLY myAuth> SERVER_PRINCIPAL=<APPLY myPrincipal> CONNECTION_TREE=<APPLY myTree> DIALECT=2.002

An example forms database (Form_0001) supporting the previous Actions list is as follows:

user@ADDOM.AVALANCHE.COM, 10.61.46.43, KERBEROS, cifs1/ubuntu-server.addom.avalanche.com@ADDOM.AVALANCHE.COM, \\UBUNTU-SERVER.ADDOM.AVALANCHE.COM\USER1
user1@ADDOM.AVALANCHE.COM, 10.61.46.44, KERBEROS, cifs2/ubuntu-server.addom.avalanche.com@ADDOM.AVALANCHE.COM, \\UBUNTU-SERVER.ADDOM.AVALANCHE.COM\USER2

NOTES:

  • The following shows Kerberos authentication used in conjunction with NTLM authentication, using variables from a forms database.
  • The variable assignments (myUrl, myUser, myPasswd, myAuth, myDomain, myTree, and myPrincipal) must precede the CIFSNG/SMB actions.

KERBEROSCONNECT CLIENT_PRINCIPAL=Form_0001.$1

ASSIGN VARIABLE <myUrl Form_0001.$2>

ASSIGN VARIABLE <myUser Form_1.$3>

ASSIGN VARIABLE <myPasswd Form_1.$4>

ASSIGN VARIABLE <myAuth Form_1.$5>

ASSIGN VARIABLE <myDomain Form_1.$6>

ASSIGN VARIABLE <myTree Form_0001.$7>

ASSIGN VARIABLE <myPrincipal Form_0001.$8>

CIFSNG://<APPLY myUrl> USER=<APPLY myUser > PASSWD=<APPLY myPasswd > AUTH_TYPE=<APPLY myAuth > AUTHDOMAIN=<APPLY myDomain > CONNECTION_TREE=<APPLY myTree>

CIFSNG://<APPLY myUrl> AUTH_TYPE=<APPLY myAuth> SERVER_PRINCIPAL=<APPLY myPrincipal> CONNECTION_TREE=<APPLY myTree> DIALECT=2.002

An example forms database (Form_0001) supporting the previous Actions list is as follows:

, 10.61.46.43, usr1, pwd1, NTLM, SERVER, \\UBUNTU-SERVER\User1,
user2@ADDOM.AVALANCHE.COM, 10.61.46.43, , ,KERBEROS,, \\UBUNTU-SERVER.ADDOM.AVALANCHE.COM\USER1, cifs1/ubuntu-server.addom.avalanche.com@ADDOM.AVALANCHE.COM

Defining the Server Profile

NOTE: Complete this section only if you are defining a Device test.

Use the Server Profiles tab to configure information for an emulated CIFS server, which can respond to CIFS requests generated by Avalanche.

To define a CIFS server profile:

  1. Click the Server tab, and then the Profiles tab.
  2. Click the New button to create a new profile.
  3. Enter a description for the profile, and then select CIFS_NG or SMB as the server type.
  4. Enter the port where the server resides. The default port is 445.
  5. In the Data Source pane, select to generate file data by creating data on-the-fly, or by using real files from a named file hierarchy.
  6. In the Authentication and Data Randomization pane, you can select an authentication profile to use and configure randomization parameters for read operations.

NOTE: For more information about CIFS_NG and SMB server fields, see the following topics:

Running the Test and Reviewing Results

After completing all set-up steps, run the test.

To run the test:

Click the Run Test icon. The Monitor tab appears. From this tab you can monitor test statistics as Avalanche reports them. For example, click the Client Run-Time Stats or Server Run-Time Stats buttons to view run-time statistics and graphical representations.

To view results:

Click the Results tab.


Creating and Running an Advanced Test

Client Profiles SMB Fields

Client Profiles Kerberos Fields

Client Statistics CIFSNG/SMB Window

CIFSNG/SMB Results Summaries

Client CIFSNG/CIFSSMB2 Statistics

Client CIFSNG/SMB Statistics Incremental

Server Profiles Tab CIFS_NG

Server Profiles Tab SMB

Server Statistics CIFSNG/SMB Window

Server CIFSNG/SMB Statistics

Server CIFSNG/SMB Statistics Incremental

CIFSNG Data Validation

CIFS SMB Support in Avalanche

© 2024 Spirent Communications, Inc. All Rights Reserved.