Enterprise Network Systems
ttcp and DOS networking utilities
Assessment Value 5%
Method
Questions
Help using wsttcp
Writeup of the lab
Introduction
The object of today's laboratory work is to examine
the ttcp 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. Follow the hyperlink provided to download
the ttcp utility.
This link gives you access to wsttcp.exe.
This is a DOS utility to test a TCP or UDP
connection.
Read the notes concerning wsttcp.
Create a directory on your PC called wsttcp and copy
wsttcp.exe into this directory.
At a DOS command prompt, change the current
directory to wsttcp (the directory you just created).
2. Read all of the help notes provided on this page.
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 Port 80 is used for webpages and you should use this number for the rest of this labwork.
6 You may need to use a search engine to answer this
question. Discover what "Well known ports" are.
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.
Type your name
and a greeting into this file.
Save this file in the wsttcp directory.
What size is this file?
9 What is the 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.
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