Candela Technologies Logo
Network Testing and Emulation Solutions

LANforge File-IO with CIFS and NFS

Goal: Create a series of MAC-VLAN based clients to emulate CIFS and NFS traffic.

This cookbook connects a LANforge system to a file server with CIFS and NFS shares available. The file server in this example will be 10.26.1.3. It will be sharing smb://10.26.1.3/fileio and 10.26.1.3:/home/fileio. We will create ten readers and ten writers for each file sharing protocol. This demonstrates using the Batch Create tool in the FileIO tab.
 
  1. Create initial MAC VLANS for our emulated endpoints. In the Port Mgr tab, highlight a a non-management port on your LANforge FIRE system and click Create. screenshot
    1. Create 40 MAC VLANS with IPs starting at 10.26.1.10. screenshot
      1. Select MAC-VLAN
      2. Choose either *:*:*:*:*:* (random) or select a starting MAC address, like 00:26:*:*:*:*
      3. Enter 10.26.1.10 and 255.255.255.0for the IP and netmask.
      4. Set Quantity to 40.
      5. Click Apply to create the MAC VLANs.
      6. Click Cancel to close the Create window.
    2. See the 40 MAC VLANs in the Ports tab. screenshot

    For more information see GUI Users Guide

  2. Create your first FileIO NFS Endpoint. In the FileIO tab, click Create. screenshot
    1. Use the following settings to create a NFS reader writer endpoint. screenshot
      1. Enter nfs-writer for the name.
      2. Select NFS for FS-Type
      3. Use the first MAC-VLAN p1p1#0 for Port
      4. Select 2KB for the Min-RW Size
      5. Choose 1MB for the Max-RW Size
      6. For Min File Size choose 10KB
      7. Then for Max File Size choose 25MB
      8. The Min Write Rate is the minimum inbound line rate, start at 100Mbps
      9. Then set the Max Write Rate at 1Gbps
      10. Set the number of files written per connection: set File # to 2
      11. Now we specify the NFS server: set Server to 10.26.1.3:/home/fileio
      12. You can leave Directory, and Mount-Dir at AUTO
      13. Click OK to commit the settings.
  3. In the File-IO tab, select the endpoint you just created and click Modify screenshot
    1. The File-IO Details dialog appears. Click the Batch Create button at the bottom of the screen. screenshot
    2. Enter these values into the Batch Create dialog:
      1. Quantity should be 9
      2. Number of Digits should be 2
      3. Click Apply
    3. Close the Batch Create window. You will see the new endpoints. screenshot
  4. Create initial endpoint for CIFS writer. screenshot
    1. Name the endoint cifs-writer
    2. Set FS-Type to CIFS
    3. Then set the Port to the next open MAC VLAN: p1p1#10
    4. Set the Min-RW Size and Max-RW Size to 2k and 1M
    5. For the Min File Size and Max File Size enter 10KB and 100MB
    6. The Min Write Rate and the Max Write Rate should be 10 Mbps and 100 Mbps
    7. Enter //10.26.1.3/fileio for Server
    8. Supply the credentials for the CIFS mount point in Options. For this example, our username and password are 'lanforge' and 'lanforge'. Write them as options to the mount command: user=lanforge,passwd=lanforge
    9. Click Apply
  5. Use Batch Create to create nine more CIFS endpoints. You do not actually need to close the Create/Modify window. Click on Batch Create directly.
    1. In the Batch Create window, Enter: screenshot
      1. Quantity is 9
      2. Number of Digits is 2
      3. Then click Apply
    2. In Create/Modify click Cancel
    3. In the File-IO tab, you will see ten more endpoints. screenshot
  6. We will proceed to creating the same number of NFS reader endpoints by using a writer as a template for a reader:
  7. Open the Modify window of the endpoint nfs-writer screenshot
    1. Change the Name to nfs-reader
    2. Set the Port to the next unused MAC VLAN, p1p1#20
    3. Change Read/Write to Read
    4. Set the Min Read Rate and Max Read Rate to 10 Mbps and 100 Mbps
    5. To match this reader to a writer, set the Prefix field to nfs-writer
    6. Click Apply
  8. Before closing the Modify windows we can use Batch Create to create nine more NFS endpoints:
  9. Click on the Batch Create window of the endpoint nfs-reader screenshot
    1. Change the Quantity to 9
    2. Set the Number of Digits to 2
    3. Click Apply
    4. Click Close
    5. In the Modify window, click Cancel
  10. And we now create the same number of CIFS reader endpoints. Start by using cifs-writer as a template: screenshot
    1. Open the Modify window of the endpoint cifs-writer screenshot
      1. Change the Name to cifs-reader
      2. Set the Port to the next unused MAC VLAN, p1p1#30
      3. Change Read/Write to Read
      4. Set the Min Read Rate and Max Read Rate to 10 Mbps and 100 Mbps
      5. To match this reader to a writer, set the Prefix field to cifs-writer
      6. Supply the credentials for the CIFS mount point in Options. For this example, our username and password are 'lanforge' and 'lanforge'. Write them as options to the mount command: user=lanforge,passwd=lanforge
      7. Click Apply
    2. Before closing the Modify windows we can use Batch Create to create nine more CIFS reader endpoints:
    3. Click on the Batch Create window of the endpoint cifs-reader screenshot
      1. Change the Quantity to 9
      2. Set the Number of Digits to 2
      3. Click Apply
      4. Click Close
      5. In the Modify window, click Cancel
  11. In the File-IO tab, we see our newly created reader endpoints. screenshot
  12. Start the reader/writer testing.
    1. In the File-IO tab, begin by starting the NFS writers screenshot
      1. Click on the Name column header to sort the rows of readers and writers
      2. You can use control-left-click and drag to select the group of writers
      3. Click the Start button at the top.
    2. Next, start the CIFS writers screenshot
    3. Then the NFS readers screenshot
    4. Finally, start the CIFS readers screenshot
  13. We can inspect the traffic in the Dynamic Report window and the File-IO tab:
    1. Select a group of endpoints and right click on them, select Dynamic Report screenshot
    2. In the Dynamic Report window, select the checkbox Rx-Bps screenshot
    3. In the File-IO window, we can watch for Files Written and IO Errors: screenshot
  14. Advanced File-IO Tunings

    System tuning is desirable when determining machine performance. The following topics can apply to NFS or CIFS clients:

  15. Tuning network card ring-buffers
    1. Network cards often have tunable memory buffers that can be modified using ethtool
    2. Read the available capacities using ethtool -g eth1
    3. Adjust the tx and rx parameters using ethtool -G eth1 tx 4096 rx 4096
    4. This feature depends on the card driver and system state. Not all cards are tunable.
    5. The efficacy of this technique is difficult to measure, but is some manufacturer's websites show this step being done in their white papers.

  16. Matching buffer sizes to negotiated transfer size
    1. NFS mount parameters can be inspected using either of two commands:
    2. mount | grep nfs or grep nfs /proc/mounts
    3. Notice the rsize and wsize parameters might not match your request values in the Modify Properties box for the mount point.
    4. Setting your Min/Max Read and Min/Max Write sizes to these negotiated values will maximize efficiency by reducing memcpy activity in the kernel.
  17. Tuning TCP window sizes
    1. While you can modify Layer 3 TCP window size and buffers, you cannot directly change those settings using the LANforge GUI for the system. This Discussion on NFS4 performance is worth a read.
    2. The commands below are suggested to increase your buffer sizes to 8-16 megabytes:
      sysctl net.core.rmem_default=8388608
      sysctl net.core.rmem_max=16777216
      sysctl net.core.wmem_default=8388608
      sysctl net.core.wmem_max=16777216

Candela  Technologies, 2417 Main Street, Suite 201, Ferndale, WA 98248, USA
www.candelatech.com | sales@candelatech.com | +1.360.380.1618
Facebook | LinkedIn | Blog