echo "### Welcome to the experiment of traffic generation and trace file analysis I !!" echo "### Step 1: Configure a sample network " echo "### Would you like to see tcl statements configuring the sample network(y/n)? " read var_k1 if [ $var_k1 == "y" ]; then grep duplex-link chap5.tcl|grep DropTail fi echo "" echo "### Would you like to see the topology of the sample network(y/n)? " read var_k1 if [ $var_k1 == "y" ]; then ns chap5.tcl exp fi echo "" echo "### Did you see the topology ? Then, press any key. " read var echo "### Step 2: Generate a general traffic flow under ns-2 " echo "" echo "### Select the type of flow you want to generate and type the name among 'exp' 'pareto' 'cbr' 'ftp' 'all' and 'stop' Then click the button of play forward on the nam window " read var_name while [ "$var_name" != stop ];do ns chap5.tcl $var_name echo "### Please do it once more." read var_name done echo "" echo "### Would you like to see how packets drop under heavy load (y/n)?. If y, click the button of play forward on the nam window " read var_k1 if [ $var_k1 == "y" ]; then ns chap5.tcl drop fi echo "" echo "### Did you see how packets drop ? Then, press any key. " read var echo "### Step 3: Analysis a trace file for the test case of drop in step 2" echo "" echo "### Would you like to see the dynamic data rate on the line 5-6 (y/n)?." read var_k1 if [ $var_k1 == "y" ]; then sh sample_rate fi echo "" echo "### Would you like to see an awk program to calculate the packet drop ratio (y/n)?." read var_k1 if [ $var_k1 == "y" ]; then cat drop.awk;cat link.drop.awk fi echo "" echo "### Would you like to see the packet drop ratio on the line 5-6 (y/n)?." read var_k1 if [ $var_k1 == "y" ]; then sh drop.awk fi echo "" echo "### Would you like to see an awk program to calculate the ftp rate from node 3 to 6 (y/n)?." read var_k1 if [ $var_k1 == "y" ]; then cat sample_ftp;cat ftp.s.awk fi echo "" echo "### Would you like to calcualte the ftp rate (y/n)?." read var_k1 if [ $var_k1 == "y" ]; then sh sample_ftp fi echo "" echo "### The end. ### "