

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


EE4110 Lab 2 TCP Traffic Generator Due Tuesday September 12, 2000 Version 9/6/ Finish a TCP sockets program to transmit TCP datagrams to a receiver. Finish another program to receivethese datagrams. The traffic source program is named tcp_gen, The receiver is named tcp_sink. In the directory /stevens/unpv12e place the file lab2.tar in this directory and use tar xvf lab2.tar. This lab2.tar fileis provided to you by ftp from linux1. Use the linux_class login and the linux_class password. You will find lab2.tar in the home directory of linux_class. Complete the programs tcp_gen.c and tcp_sink.c. Usemake to compile and link these programs. Look at the shells of the provided tcp_gen.c and tcp_sink.c for specifications of exactly how the programs should perform. You may find that some declared variables arenot needed. Also add some code to print out the number of MBITS PER SECOND that were sent as well as received. This statistic should be written to the screen after the control C is used to stop the program. The scenario to run these programs should be a follows:to run under xwindows:
startx open 2 windows in one window./tcp_sink -D - p 5000 &
in the second window after the first window is started ./tcp_gen -D -P 5000 -s 5001 -a 192.168.1.your own IP address last byte you will see the info on each packet in the windows because we used the -D option which prints this out tothe screen
To stop do a cntrl c in the ./tcp_gen window you will see some summary results in both windows. You will need to do a cntrl c in the ./tcp_sink window to stop that process also. Note that you will need to do a ps and kill all of your traffic generator processes before you can run this again.
When you have completed this assignment, show the working result to the T.A. Turn in to the TA (at the time of the demo) a hardcopy printout of your code. YOU WILL BE GRADED ON HOW WELL DOCUMENTED AND WELL COMMENTED YOURPROGRAM IS. NEATNESS AND STYLE DOES COUNT. PLEASE MAKE SURE THAT YOU UNDERSTAND THAT THIS IS VERY VERY VERY IMPORTANT. You should improve on this even in the parts that we provided to you. Check over all of the code and comments to make sure you think the program is commentedthe very first comments of the program. very very well. Be sure to put your group number and group member names in
You will want to put your programs on a floppy occasionally so if you loose info on your Hard Drive in a crash, you will not loose your programs. First, you will need to alter the file /etc/fstab so you can easily mountDOS/windows formatted floppies. The /etc/fstab file should have a line like:
/dev/fd0 /mnt/floppy ext2 noauto,owner 0 0 Change the type from ext2 to umsdos. The line should now look like: /dev/fd0 /mnt/floppy umsdos noauto,owner 0 0 Now, to use a floppy just: cd /now you should insert the floppy mount /mnt/floppy if you are in the directory where the file you want to copy is located:cp
To put a file from floppy onto the Linux machine: cd /now you should insert the floppy mount /mnt/floppy cp mnt/floppy/filename
Before you remove the floppy You should type cd /umount /mnt/floppy