Lab - TCP Traffic Generator

Similar documents
ECE 4110 Internetwork Programming Lab 2: TCP Traffic Generator. Lab Goals. Prelab

ECE 4110 Internetwork Programming Lab 3: UDP Traffic Generator. Lab Goals. Section I: Coding udp_gen & udp_sink

Lab - Installation of the Linux Operating System

ECE 4110 Internetwork Programming Lab 1: Installation of the Linux Operating System. Lab Goals. Section I: Before we begin

Lab 1: Introduction to Linux Networking

Lab 4 - Network Traffic Analyzers and Other Tools

ECE 4110 Internetwork Programming Lab 4: Network Traffic Analyzers and Other Tools. Lab Goals. Section I: Ping vs. Ethereal

Lab I: Using tcpdump and Wireshark

Introduction. An introduction to the equipment and organization of the Internet Lab.

TCP/IP Transport Layer Protocols, TCP and UDP

Lab - Using Wireshark to Examine TCP and UDP Captures

destination a (eth1)

5. Write a capture filter for question 4.

UNI CS 3470 Networking Project 5: Using Wireshark to Analyze Packet Traces 12

CSCI4211: Introduction to Computer Networks Fall 2017 Homework Assignment 1

CS Fundamentals of Programming II Fall Very Basic UNIX

First Exam for ECE671 Spring /22/18

King Fahd University of Petroleum & Minerals. Data Traffic Capture and Protocols Analysis using Sniffer Tool

ECE 4110 Internetwork Programming Lab 7: Configuring a Network Using RIP Routing Protocol. Prelab Questions

ECE 697J Advanced Topics in Computer Networks

Getting Wireshark. Detailed installing steps can be found on the Internet, so this tutorial won t cover this part.

CCNA Semester 1 labs. Part 2 of 2 Labs for chapters 8 11

Assignment 2 TCP/IP Vulnerabilities

Transport Over IP. CSCI 690 Michael Hutt New York Institute of Technology

CCNA 1 Chapter 7 v5.0 Exam Answers 2013

Lab Assignment 3 for ECE374

Linux Survival Guide

Practical Session 0 Introduction to Linux

Lab Assignment for Chapter 1

CSC 112 Lab 1: Introduction to Unix and C++ Fall 2009

BSc Year 2 Data Communications Lab - Using Wireshark to View Network Traffic. Topology. Objectives. Background / Scenario

1 Getting Started with Linux.

Southern Polytechnic State University Spring Semester 2009

NT1210 Introduction to Networking. Unit 10

Open Network Laboratory

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

Project 2 Reliable Transport

Introduction to Computation and Problem Solving

Interconnecting Networks with TCP/IP. 2000, Cisco Systems, Inc. 8-1

To see how ARP (Address Resolution Protocol) works. ARP is an essential glue protocol that is used to join Ethernet and IP.

Dropping Packets in Ubuntu Linux using tc and iptables

ROS-Industrial Basic Developer s Training Class: Linux Basics. Southwest Research Institute Last Updated 2017

ICSI 516 Fall 2018 Project 1 Due October 26th at 11:59PM via Blackboard

Principles of Bioinformatics. BIO540/STA569/CSI660 Fall 2010

cs144 Midterm Review Fall 2010

CS 5520/ECE 5590NA: Network Architecture I Spring Lecture 13: UDP and TCP

Lab 1 - Reliable Data Transport Protocol

Spring 2017 Gabriel Kuri

CS457 Transport Protocols. CS 457 Fall 2014

PLEASE READ CAREFULLY BEFORE YOU START

PLEASE READ CAREFULLY BEFORE YOU START

ITEC451 Network Design & Analysis Laboratory Guide: Appendix

Connectionless and Connection-Oriented Protocols OSI Layer 4 Common feature: Multiplexing Using. The Transmission Control Protocol (TCP)

CS 421: COMPUTER NETWORKS SPRING FINAL May 16, minutes

ECE 333: Introduction to Communication Networks Fall 2001

SE 4C03 Winter Sample Midterm Test. Instructor: Kartik Krishnan

Computer Networks A Simple Network Analyzer PART A undergraduates and graduates PART B graduate students only

Presenter. Xiaolong Li, Assistant Professor Department of Industrial and Engineering Technology Morehead State University

EEC-682/782 Computer Networks I

SE 4C03 Winter Midterm Test Answer Key. Instructor: Kartik Krishnan

PLEASE READ CAREFULLY BEFORE YOU START

Lab - Using Wireshark to Examine a UDP DNS Capture

Parallel Programming Pre-Assignment. Setting up the Software Environment

A Simple Network Analyzer Decoding TCP, UDP, DNS and DHCP headers

GSS Administration and Troubleshooting

Lab - Using Wireshark to Examine a UDP DNS Capture

Using the Zoo Workstations

Lab Exercise Protocol Layers

Lecture (11) OSI layer 4 protocols TCP/UDP protocols

FortiTester Handbook VERSION 2.4.1

IT INFRASTRUCTURE PROJECT PHASE I INSTRUCTIONS

Lab 4: Network Packet Capture and Analysis using Wireshark

Objectives: (1) To learn to capture and analyze packets using wireshark. (2) To learn how protocols and layering are represented in packets.

521262S Computer Networks 2 (fall 2007) Laboratory exercise #4: Multimedia, QoS and testing

Packet Capturing with TCPDUMP command in Linux

4. What is the sequence number of the SYNACK segment sent by spinlab.wpi.edu to the client computer in reply to the SYN? Also Seq=0 (relative

Basic Reliable Transport Protocols

Tiny Instruction Manual for the Undergraduate Mathematics Unix Laboratory

CSc 450/550: Computer Communications and Networks (Summer 2007)

Sirindhorn International Institute of Technology Thammasat University

WA2592 Applied Data Science and Big Data Analytics. Classroom Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc.

ECE 650 Systems Programming & Engineering. Spring 2018

Chapter 2 - Part 1. The TCP/IP Protocol: The Language of the Internet

CS 716: Introduction to communication networks th class; 7 th Oct Instructor: Sridhar Iyer IIT Bombay

Ethereal Lab: Getting Started

Getting Started With UNIX Lab Exercises

Utilities. Introduction. Working with SCE Platform Files. Working with Directories CHAPTER

CSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80

Lab: Supplying Inputs to Programs

Network Reference Models

Introduction to OSI model and Network Analyzer :- Introduction to Wireshark

Unix Tutorial Haverford Astronomy 2014/2015

Part I. Introduction to Linux

EEC-484/584 Computer Networks. Lecture 16. Wenbing Zhao

485/585 Lecture 1.

Transport Gateway Installation / Registration / Configuration

WA2393 Data Science for Solution Architects. Classroom Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc. 1

COMS Introduction to Computers. Networking

BSc. (Hons) Web Technologies. Examinations for 2017 / Semester 1

Duke University CompSci 356 Midterm Spring 2016

Transcription:

ECE4110 Fall Semester, 2010 Lab - TCP Traffic Generator Assigned: Sep 10, 2010 Due: Sep 20, 2010 Group Number: Member Names: Lab Goals 1. Finish a TCP sockets programs to transmit and receive TCP data. 2. Analyze TCP network traffic using tcpdump and ethereal Linux network utilities 1 Prelab These questions pertain to the tcp gen.c and tcp sink.c code. They are designed to help you understand the presented code as well as the differences between our code and Stevens example code from the lecture slides. The code for these files can be obtained from the NAS as described in Section I. P1. In both our and Stevens tcp client programs, the IP address of the sink is read in from the command line when the program is started. However, in Stevens example the IP address is always the first argument passed to the program, and so is always in the same place within argv[]. In our code, however, we have a variable number of command line arguments, so we cannot guarantee that the IP address and port number will always be in the same place. How is this handled in our code (i.e. how and where are the IP address and port number of the sink stored for future access?) 2 Coding tcp gen and tcp sink Before you start this lab, make sure that you can access NAS (refer to Lab 1). After you are sure that NAS is mounted and ready for access, perform the following steps to copy and extract the source code that you will need to understand, comment, and modify. 1

cd /mnt/nas/lab2 cp lab2.tar /stevens book/unpv12e/lab2.tar cd /stevens book/unpv12e tar xvf lab2.tar cd lab2 ls Now, you will see a list of files. You will make modifications to a traffic generator program named tcp gen.c and to a receiver program named tcp sink.c. Then, your job is to understand, comment, and complete these two pieces of software. To compile and link them, you will use the command make. As a starting point, look in the source code of the provided tcp gen.c and tcp sink.c for specifications of exactly how the programs should perform (on the first lines of these files, there is a description on how to execute them from the command line). You may find that some declared variables are not needed, so make sure that you fully understand the data flow within the programs. 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 <Ctrl-C> key sequence is used to stop the program. 3 Getting data from tcp gen and tcp sink At this point you programs should finished and ready to perform data transmission. The scenario to execute these programs should be as follows. To run under X Windows: 1. startx (If you have already started X Windows, do not type startx) 2. Open 2 terminals (right click the mouse; choose the New Terminal menu option) (a) In one terminal, type./tcp sink -D -p 5000 (b) In the other terminal after the first terminal is started, type./tcp gen -D -P 5000 -a 57.35.6.(your own IP address last byte) 3. To stop do type <Ctrl-C> in the tcp gen terminal. You should see some summary results in both terminals. 4. You will need to do a <Ctrl-C> in the tcp sink terminal 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 (use man to learn more about ps and kill Linux commands). Note that you may have to use ps ef to see your traffic gen/sink processes. 2

Using a packet size of 1,000 bytes per packet and a packet size variance of zero bytes, determine what the inter-arrival time value you should use to approximately generate 2, 4, and 6 Mbits/second of traffic. Also determine what the maximum number of Mbits/sec you can receive with your traffic generator by experimenting with the inter-arrival times. Fill in the following table and turn it in with your printout. Input inter arrival time (seconds) Put IA measured on sender in this box Put IA measured on sender in this box Question: : Show the math equation and answer to how many Mbits/sec you expect if you were to input a packet size of 500 bytes, zero variance and an inter-arrival time of 0.01 seconds Mega-Bits / sec received 2 Mega-Bits / sec (with Debug OFF) 4 Mega-Bits / sec (with Debug OFF) 6 Mega-Bits / sec (with Debug OFF) Debog ON only at the sink. Enter the maximum Mbps for the sink and generator: Sink : Gen : Debog OFF at both sink and gen. Enter the maximum Mbps for the sink and generator: Sink : Gen: When you have completed Sections I and II, demonstrate to the TA the maximum number of Mbits/sec you can generate with a packet size of 1,000 bytes, and a packet size variance of zero. Make sure the TA records the maximum number of Mbits/sec that you demonstrated. Look in the Turn-in list for any deliverables at this point in the lab. Check Off Point: TCP Generator TA Signature Date 4 Network Traffic Analysis using tcpdump and ethereal For this part of the lab, you will need to run tcp sink on gatechftp, which is a machine that will be used as the receiver side. To make sure your results dont get mixed up with those 3

of other students, you will need to use a unique port. Your port number should be 5000 + your group number (e.g. for group 1, thats port 5001). On your machine, open a terminal and type telnet 57.35.6.245 (this will establish a telnet session between your machine and gatechftp). Use linux class as the user and linux class as the password. Once the telnet session is opened, type the following commands. cd lab2./tcp sink -p <your port number> The tcp sink executable is already there for you. DO NOT PUT YOUR OWN UDP SINK CODE ONTO GATECHFTP, USE ONLY THE PROGRAM ALREADY THERE. IF YOU GET A CORE DUMP MAKE SURE NO OLD UDP SINK PROCESSES ARE RUNNING, IF SO KILL THEM. as follows: Use ps -ef egrep tcp sink (tcp sink between quotes) to check for running processes. (Do not run the sink in debug mode, -D argument) On your machine, you will have to run ethereal, tcpdump, and your tcp gen program to generate and capture TCP traffic, so just follow the instructions below. Later in the semester you will be asked to hand in printouts of Ethereal output. What this means is that you take a SCREENSHOT of the Ethereal window and print it out. DO NOT PRINT USING ETHEREALS PRINT COM- MAND. Printing the actual packet information for all of the captured packets results in pages and pages of print out, most of which is useless anyway. To take a screenshot, press the Print Screen key on your keyboard (upper right), and when prompted save the file as desired. Next, type lpr filename in a console window, where filename is the name of the screenshot file (for printer setup instructions, see the Appendix). In one terminal, start network analyzer (ethereal) by typing ethereal &, or by clicking the Redhat icon in the lower left corner of your screen and selecting System Tools Network Analyzer View Time Display Format Seconds since previous packet Under capture Options Turn on capture packets in promiscuous mode Turn on update list of packets in real time Turn on automatic scrolling in live capture Turn off Enable MAC Name resolution Turn off Enable network name resolution Turn off Enable transport name resolution Click OK button In a second terminal, type tcpdump S nli eth0 to start tcpdump. Make this window as wide as possible so it will be easier to read. You can see how to use tcpdump, by typing man tcpdump. In a third terminal, type./tcp gen -D -i 0.2 -p your port number a 57.35.6.245 to start your TCP traffic generator. 4

Type <Ctrl-C> in the traffic generator window after 10 to 20 packets have been transmitted. Stop ethereal from collecting any more data by clicking the Stop button. Type <Ctrl-C> in the tcpdump window to stop it from collecting any more data. On gatechftp, stop your sink from running by pressing <Ctrl-C>. Then, type ps -ef egrep tcp sink and find the process corresponding to the tcp sink you were running by looking at the port numbers. Once you find that process, the process ID number for that process is located in the second column from the left. Kill the process using that number. Make sure you dont kill some other students tcp sink! Q4.1 How do you think the type of data from tcpdump compares to the type of data from ethereal? Q4.2 Which do you like better? Explain Look at the protocol detail available in ethereal. With the mouse, select one of your TCP datagrams. In the lower window, expand Ethernet II by clicking on the plus sign. Answer the following questions: Q4.3 What is the value of your Ethernet MAC address of the machine you are using? Q4.4 What is the value in the Differentiated Services Field (correctly called Type of Service field) in the IP header of this TCP datagram? Q4.5 What does the value mean? (Dont ask TA for the answer) Q4.6 What was the source port number? Q4.7 Where does the source port number come from? (e.g., ports up to 1024 are called reserved ports) (Dont ask TA for the answer) (To see the source port number, expand the field named Transport Control Protocol) 5

Fill in the following table (for at least 5 of the TCP packets from your tcp gen run) with the information obtained from your tcp gen (with debug mode ON) and the ethereal: As seen on your PC by tcp gen As deduced by you As observed by ethereal Packet size (bytes) Inter arrival time (seconds) TCP Segment Size (header plus data) (bytes) Inter arrivat time (seconds) of TCP Segments Q4.8 What seems to match and what does not match? Why? Q4.9 In Ethereal, identify the TCP three-way handshake and connection termination frame sequences. Copy them in the space below. (Include the Source, Destination, Protocol and Info columns) a) TCP three-way handshake Source Destination Protocol Info b) Connection Termination Source Destination Protocol Info Q4.10 In Ethereal, look at the first 200 frames and describe what is going on. Refer to 6

your lecture notes and class books (you can also use the internet). Keywords: three-way handshake, ACK, sequence numbers, SYN, etc. Q4.11 Looking at ethereal, there is one line of additional data between each of your TCP datagrams you sent out. What is this? Explain. Turn In List 1. Turn into the TA (at the end of Section II) a hardcopy printout of your code. Make sure that you highlight the changes that you made. (note: highlight is different than underline, enclose in a box, etc) We now have a printer in the lab. Directions for setting up the printer and printing are given in the appendix and on the printer itself. Please try not to waste paper, i.e., do not print another whole copy of a file for a few small changes, just mark them in pen. 2. The GTA check-off sheet along with the completed table in Section 2 3. Questions and Answers in Section 4. 4. The completed tables in Section 4 Grading Notes 1. How well documented and well commented your programs are. Neatness and style does count. You should improve on this even in the parts that we provided to you. 2. Group number and group member names in the very first comments of both of your programs as well as the date when the file was modified should be included. 3. You will want to put your programs on a floppy occasionally, so if you loose data on your Hard Drive in a crash, you will not lose your programs. The appendix contains some guidelines on how to do that. 7

Appendix: Useful tips To write to a floppy: cd / Now, you should insert the floppy mount /dev/floppy If you are in the directory where the file you want to copy is located: cp filename /media/floppy To check to see if the file is now on your floppy cd /media/floppy ls Before you remove the floppy you should type cd / umount /dev/floppy Now, you should remove the floppy To read from a floppy cd / Now, you should insert the floppy mount /dev/floppy cp media/floppy/filename destination-path This puts the files in destination-path. Before removing floppy, type cd / umount /dev/floppy Now, you should remove the floppy To set up the printer Go to the Red Hat icon System Settings Printing On the GUI, click New Name: printer 4112 (typed in) Queue Type: select JetDirect Printer (radio button) Forward Printer: 57.35.6.9 (typed in) Port: 9100 (typed in, but should be default) Forward (to Drive select) Select HP LaserJet4000T/TN Apply To print from a root prompt, just type: lpr filename. You can also print from Gedit, but the default paper is A4, even though the printer is set up for US letter, so it needs to be changed before printing. 8