====== Driver test: large file transfer speed ====== ===== Rationale ===== Downloading a large file via HTTP provides an easy test of the complete transmit and receive datapath under a sustained high packet load. The ''[[:cmd:time]]'' command can be used to verify that the expected throughput was maintained during the download. To eliminate other potential sources of delay, the test should download the same file multiple times. On the second and subsequent downloads, the file is likely to be served direct from cache, which will eliminate any disk-related delays. Averaging the times from multiple downloads minimises noise from any transient network conditions. {{ :clipart:nic.jpeg?237x222|A network card}} ===== Preparation ====== Create a 512MB file containing pseudo-random data, using e.g.: dd if=/dev/urandom of=512mb bs=1M count=512 Copy your pseudo-random data file to a web server on your local network. Create an iPXE script which downloads this file multiple times, timing the download for each time other than the first. For example: #!ipxe imgfetch 512mb ; imgfree echo Starting test time imgfetch 512mb ; imgfree time imgfetch 512mb ; imgfree time imgfetch 512mb ; imgfree time imgfetch 512mb ; imgfree time imgfetch 512mb ; imgfree time imgfetch 512mb ; imgfree time imgfetch 512mb ; imgfree time imgfetch 512mb ; imgfree time imgfetch 512mb ; imgfree time imgfetch 512mb ; imgfree shell ===== Test sequence ===== - Before starting, ensure the network cable is connected to a network which provides a DHCP server and a web server which can serve your pseudo-random data file. - Boot into a version of iPXE with ''[[:buildcfg:time_cmd|TIME_CMD]]'' enabled. - Use ifstat to identify the name of your network interface (hereafter assumed to be ''net0''). - Open the interface and obtain an IP address using ''[[:cmd:dhcp]] net0''. - Boot the test script. - Observe the measured times. A good result will have all times approximately the same, with a speed commensurate with the speed of the network. For example, on a gigabit network, a 512MB file should download via HTTP in 4.6 seconds.((1000000000 bits/second equates to 119MB/s raw data rate. With a standard Ethernet MTU, each packet during the HTTP download has 66 bytes of Ethernet+IP+TCP header and 1448 bytes of data: this reduces the effective speed to 114MB/s. A 512MB file should therefore download in 4.5 seconds. iPXE's timer resolution is only 1/18s, so a result of 4.6 seconds would be fine.))