Enterprise Network Systems
  NTttcp and DOS networking utilities 
Assessment Value 5%


Method
Questions
Help using NTttcp (see the included documentation)
Writeup of the lab


Introduction

The object of today's laboratory work is to examine the ntttcp utility and use various DOS utilities to analyse network connections.

You will need to work in pairs to complete today's laboratory.

Follow the instructions below and use a pen and paper to keep a record of your responses to the questions.

This work will be assessed during the lab period and next week's lecture.


Method

1.  Look in your PC menu for NTttcp.
    This is a DOS utility to test a TCP or UDP connection.

    

2.  Read all of the help notes provided in the documentation.     You will now need to work in pairs to complete today's work.

3.  Answer the questions given below in your own words using a pen and paper IN YOUR LOGBOOKS. You will be able to refer to these notes when you write up this lab prior to submission at the end of this course.

This means NO CUT & PASTE of text

4.  You may need to use other websites to answer all of these questions but do not use the work of others without referencing.



Questions

1  What is the IP address of the PC you are currently working on? You can discover this by typing ipconfig/all at the command prompt.

2  What is the IP address of the PC that your partner is currently working on?

3  Use the netstat DOS utility to check which ports are currently in use on your PC.
    Type netstat -? to give you the options for netstat.

    Which option do you need to use to display just TCP connections numerically?

4  Type the command you discovered in part 3 of this question to discover the ports in use by TCP on your machine.
    Write the used port numbers down.

5  The ports for this labwork have been set automatically for this labwork. View and save the output from netstat -a to work out which ports are being used for NTttcp server (receiver) to listen to the network.

Now run the NTttcpr utility. This should bind the application to a port. View and save the output from netstat -a to find out which port has been used. Discover what "Well known ports" are. You may need to use a search engine to answer this question.

7  Decide between yourself and your partner who will take the role of the client and who will become the server.
    Which will you become, client or server? Write this down.

8  Use notepad to create a file called yourname.txt.
What size is this file?
    Type your name and a greeting into this file.
    Save this file in the directory that NTttcp is running in C:\INSTITUTIONS\Gre\Apps\NTTestingTCPTool\x86>.
   


NTttcps
 
This is the sender (server) in your network. Run the dos utility NT TCP Testing tool and run NTttcp without any switches.

Make a note of the output with the command summary.

C:\INSTITUTIONS\Gre\Apps\NTTestingTCPTool\x86>ntttcps

Version 3.0

ntttcps: [-l|-n|-p|-a|-x|-rb|-sb|-i|-f|-u|-w|-d|-t|-v|-6|-fr|-mb] -m <mapping> [
mapping]

        -l   <Length of buffer>     [default:  64K]
        -n   <Number of buffers>    [default:  20K]
        -p   <Port base>            [default: 5001]
        -a   [outstanding I/O]      [default:    2]
        -x   [PacketArray size]     [default:    1]
        -rb  <Receive buffer size>  [default:  64K]
        -sb  <Send buffer size>     [default:    0]
        -i   Infinite Loop          [Only UDP mode]

        -f   <File Name>            [default: output.txt]
        -u   UDP send/recv
        -w   WSARecv/WSASend
        -d   Verify Flag
        -t   <Runtime> in seconds
        -v   enable verbose mode
        -6   enable IPv6 mode
        -fr  Full buffers posted on reads
        -mb  Multiple buffer post mode
        -m   <mapping> [mapping]

        where a mapping is a session(s),processor,receiver IP set
        e.g. -m 4,0,1.2.3.4 sets up:
        4 sessions on processor 0 to test a network on 1.2.3.4




9  What is the "claimed" data rate of the network between your PC and your partner's PC?

10  Use the help notes to create the client (or server) command on your PC to send (or receive) on the port you specified in part 5.
       Use port 80 to receive as the server. 
      Only the client needs to specify the IP address of the server.
      You and your partner will need to create separate commands to create both client and server.
      Note that you will need to execute the server command before the client command.
      Write this command down.

11  What output was displayed on your screen? Take a screendump.

12  What is the data rate between client and server?
    
13  Give a reason if there is any difference between the answers to questions 9 and 12

14  Now change role between yourself and your partner so that if you were the client, you now become the server (or vice-versa).
      Send the other text.txt to the server.
      What is the data rate in the opposite direction?

15  Use netstat to find a free port above 1024.
      Write this port number down.

16  Repeat steps 10 to 14 but this time use the port in part 15 above.
      Write down the data rates reported by wsttcp.
      Are they similar to your first experiment?
      Explain any significant discrepancy.
      It is possible that the PCs you are working on will not allow steps 15 and 16 due to security reasons. If that is the case, try to use a port that is already open. You might use d3tr.exe to find the open ports - see my useful applications for a copy.

17  Now choose a much larger file (several MB) to send between client and server.
     (You may need to create or copy a file into the wsttcp directory to achieve this)
     What is the name and size of this file?

18  Repeat the experiment above using an open port .
      Write down the data rates reported by wsttcp for each direction.
      Are the results similar to the answer to question 12?
      Explain any significant discrepancy.

19  Now change the options for wsttcp so that you measure the transfer rate using UDP instead of TCP
      Try sending one of the files that you sent before and compare the data rate achieved using UDP instead of TCP.
      What is the thoroughput achieved using UDP?

20  Now explore the -l option with TCP to see whether changing buffer length has any effect on the throughput between client and server.
      Write down your commands and the throughput achieved when you
       a) double the size of the buffer
       b) halve the size of the buffer


Optional Work - you do not need to submit this part of the lab at the end of the course

1  See whether you can use wsttcp to create an ad-hoc chatroom. (Hint: don't specify a file to send)

2  Check what the throughput is between distant PCs. The PCs in the lab will probably be connected through the same switch.

3  Explore the -v option

4  Discover the effect of the -D option

5  See what happens if you specify a port that is currently in use by another process on your PC.
   


Working Alone
There is a standalone application for you to use at home for this work download the ttcp utility.
This link gives you access to wsttcp.exe.
Read the notes concerning wsttcp.
Create a directory on your PC called wsttcp and copy wsttcp.exe into this directory.
Read the original lab setup for the wsttcp lab.

Writeup of the lab

You are expected to write an account of the work that you carried out in the lab. Show CLEARLY the work that you have done and include printouts to show this.

Make sure that it is easy to find the answers to the questions above.

Printouts of
output are allowed in your work and you should wordprocess this lab, but you WILL LOSE ALL MARKS if you are found to have used 'cut & paste' of text to complete this work i.e. do not plagiarise other websites etc.

This laboratory is worth 5% of the marks for this half of the course.

Keep a record of this work in your log book. Show it to your lab demonstrator before you leave. You will need to submit this work for marking.


© MM Clements  Last updated : 02/11/2009 19:43


WSTTCP 1.0

What is WSTTCP?

This client-server program is a benchmarking tool for measuring TCP and UDP performance between two systems.
It is based on the ttcp utility. The source ttcp.c is available from many online sources and can be compiled locally, however
the options may be different from the wsttcp binary that you are given here.

It gives you the ability to test the tcp connection between 2 PCs by setting one of the PCs up as a server to LISTEN
to a given port and the other PC to become a client to TRANSMIT to the same given port.
Once you have established a connection and sent some data, statistics are given to help you quantify your connection's data rate.


How to use wsttcp.exe

Client (transmitting) node

wsttcp -t [-options] host [ <file_to_send.txt ]

Server (receiving) node
wsttcp -r [-options >output_filename.txt]


Common options:
-l## length of bufs read from or written to network (default 8192)
-u use UDP instead of TCP
-p## port number to send to or listen at (default 5001)
-A align the start of buffers to this modulus (default 16384)
-O start buffers at this offset from the modulus (default 0)
-v verbose: print more statistics
-d set SO_DEBUG socket option

Server options (specific to -r:)
-s don't sink (discard), print data on stdout

Client options (specific to -t:)
-n## number of source bufs written to network (default 2048)
-D don't buffer TCP writes (sets TCP_NODELAY socket option)
-s don't source a pattern to network, get data from stdin




Examples of Usage:

Client Side

This command will transmit the file yourfile.txt to brian using port 1111


wsttcp -t -s -p1111 brian <yourfile.txt

Note that IP addresses eg 192.168.1.123 can be used instead of names such as brian



Server Side

This command sets up the server to listen to the socket 1111 for incoming client requests to send files to it.

The file is printed on the screen as it arrives.


wsttcp -r -s -p1111


Sample output
(client side)

G:\wsttcp>wsttcp -t -s -l1024 -p1111 brian <readme.txt

wsttcp-t: buflen=1024, nbuf=2048, align=16384/+0, port=1111 tcp -> brian
wsttcp-t: socket
wsttcp-t: connect
wsttcp-t: 1115 bytes in 0.00 real sec = 1.#J KB/sec (1.35 bps)
wsttcp-t: 2 I/O calls, msec/call = 0.00, calls/sec = 1.35
1115 1100574274.14 1100574274.14 0.00 1.35

(server side)

D:\wsttcp>wsttcp -r -s -v -l10000 -p1111

wsttcp-r: buflen=10000, nbuf=2048, align=16384/+0, port=1111 tcp
wsttcp-r: socket
wsttcp-r: bind
wsttcp-r: accept
wsttcp-r: accept from 192.168.1.186