Proof of concept scripts added
Proof of concept scripts added

--- a/client-side/config
+++ b/client-side/config
@@ -3,6 +3,13 @@
 #
 #
 
-REMOTE_HOST=''
-HTTP_HOSTNAME=''
+REMOTE_FILE='http://www.example.com/largefile'
+HTTP_HOSTNAME='www.example.co.uk'
 
+
+MAX_CHUNK_SIZE=6553600 # Maximum chunk size to request (bytes, default is 6553600bytes/50MB)
+MAX_REQUESTS=100 # Maximum number of requests to make per session
+RANDOMIZE_CHUNKSIZE="y" # Set this to n if you want to use the same size chunk-size throughout a session
+
+SEED_INTERVAL=15 # After how many requests should RANDOM be reseeded?
+

--- /dev/null
+++ b/client-side/request_generator.sh
@@ -1,1 +1,66 @@
+#!/bin/bash
+#
+# Client side traffic generator
+#
 
+mydir=`dirname $0`
+
+# Load the config
+
+source "$mydir/config"
+
+
+# Function to place the request - may do more later
+placeRequest(){
+	URL=$1
+	HOST=$2
+	START=$3
+	END=$4
+
+
+	# Place the request
+	wget -O /dev/null --header="Host: $HOST" --header="Range: bytes $START-$END" "$URL" 2> /dev/null
+}
+
+
+
+
+# Start
+
+# We're going to be using RANDOM quite a lot
+RANDOM=$$ # Start by seeding with the pid
+
+REQUESTS=$((RANDOM%$MAX_REQUESTS)) # How many requests to make
+
+if [[ "$RANDOMIZE_CHUNKSIZE" == "n" ]]
+then
+	CHUNKS=$((RANDOM%$MAX_CHUNK_SIZE)) # Chunk size
+fi
+
+
+echo "Will place $REQUESTS Request(s)"
+
+for i in `seq 1 $REQUESTS`
+do
+	if [[ ! "$RANDOMIZE_CHUNKSIZE" == "n" ]]
+	then
+		CHUNKS=$((RANDOM%$MAX_CHUNK_SIZE)) # Chunk size
+	fi
+
+	START=$((RANDOM%134217727)) # (1Gib-1byte) - if the end range falls outside 1Gib we'll just be served the remaining 1 byte
+	END=$(( $START + $CHUNKS)) # Calculate the end of the range
+
+	echo "Requesting range $START-$END (Chunk size $CHUNKS bytes) from $REMOTE_FILE"
+	placeRequest "$REMOTE_FILE" "$HTTP_HOSTNAME" "$START" "$END"
+
+	DELAY=$((RANDOM%5)) # Work out how long to delay the next request by
+	echo "Waiting $DELAY seconds until next request"
+	sleep $DELAY
+
+done
+
+
+
+
+
+

--- a/server-side/config
+++ b/server-side/config
@@ -3,6 +3,7 @@
 #
 #
 
-MIN_SIZE='1' # MB
-MAX_SIZE='300' # MB
+OUTPUT_FILE='/path/to/some/file' # The file to write the data into
+DATA_SOURCE='/dev/urandom' # Where to get the data from
 
+

--- /dev/null
+++ b/server-side/gen_haystack_file.sh
@@ -1,1 +1,15 @@
+#!/bin/bash
+#
+#
+#
 
+mydir=`dirname $0`
+
+# Load the config
+
+source "$mydir/config"
+
+
+
+dd if=$DATA_SOURCE of=$OUTPUT_FILE bs=1M count=1024
+