Anda di halaman 1dari 10

RMIT University

School of Engineering

Lab 3 Guidelines
COURSE: EEET2439/2597 Network
Fundamentals and Applications

Semester 1, 2019
Learning Outcomes:
1. The art of experimentation
2. Experimental and analytical skills
3. Conceptual learning
4. Understanding the basis of Networking Engineering
5. Developing collaborative learning skills

Authors: Dr. Karina Gomez Chavez


Dr. Akram Hourani
Lecturer: Anna Felipe

Page | 1 Network Fundamental and Applications -Labs


Contents
Lab 3 (Group Lab): Layer 4 UDP and TCP Protocols.................................................................... 3
1. Objectives .............................................................................................................................. 3
2. Theory: Layer 4 basic concepts ............................................................................................. 3
3. Methodology .......................................................................................................................... 5
4. Exercises ................................................................................................................................ 5
5. Questions.............................................................................................................................. 10
6. References ............................................................................................................................ 10

Page | 2 Network Fundamental and Applications -Labs


Lab 3 (Group Lab): Layer 4 UDP and TCP Protocols
1. Objectives
The objective of the lab 3 is to:
  
Understand the main principles of layer 4 protocols.
  
Explore the fields of segments (Layer 4 data unit).

  understand the goal and working principles of TCP and UDP
Explore and
protocol.
 
Understand how traffic generator works.

2. Theory: Layer 4 basic concepts


The transport layer is a conceptual division of methods in the layered architecture of protocols in the
network stack in the Internet Protocol Suite and the Open Systems Interconnection (OSI). The protocols
of the layer provide host-to-host communication services for applications. It provides services such as
connection-oriented data stream support, reliability, flow control, and multiplexing. There are two types
of Layer 4 traffic, Transmission Control Protocol (TCP) and User Datagram Protocol (UDP).
  TCP is connection oriented – once a connection is established, data can be sent bidirectional.
 UDP is a simpler, connectionless protocol.
Examples of TCP and UDP client and server application are below:

There are several differences between TCP and TCP protocols explained below:

TCP UDP

Connection TCP is a connection-oriented UDP is a connectionless protocol.


protocol.

Page | 3 Network Fundamental and Applications -Labs


TCP UDP

Function As a message makes its way across UDP is also a protocol used in message transport or
the internet from one computer to transfer. This is not connection based which means
another. This is connection based. that one program can send a load of packets to
another and that would be the end of the
relationship.

Usage TCP is suited for applications that UDP is suitable for applications that need fast,
require high reliability, and efficient transmission, such as games. UDP's
transmission time is relatively less stateless nature is also useful for servers that answer
critical. small queries from huge numbers of clients.

Use by HTTP, HTTPs, FTP, SMTP, Telnet DNS, DHCP, TFTP, SNMP, RIP, VOIP.

Ordering of data TCP rearranges data packets in the UDP has no inherent order as all packets are
packets order specified. independent of each other. If ordering is required, it
has to be managed by the application layer.

Speed of transfer The speed for TCP is slower than UDP is faster because error recovery is not
UDP. attempted. It is a "best effort" protocol.

Reliability There is absolute guarantee that the There is no guarantee that the messages or packets
data transferred remains intact and sent would reach at all.
arrives in the same order in which it
was sent.

Header Size TCP header size is 20 bytes UDP Header size is 8 bytes.

Streaming of Data is read as a byte stream, no Packets are sent individually and are checked for
data distinguishing indications are integrity only if they arrive. Packets have definite
transmitted to signal message boundaries which are honored upon receipt,
(segment) boundaries. meaning a read operation at the receiver socket will
yield an entire message as it was originally sent.

Weight TCP is heavy-weight. TCP requires UDP is lightweight. There is no ordering of


three packets to set up a socket messages, no tracking connections, etc. It is a small
connection, before any user data can transport layer designed on top of IP.
be sent. TCP handles reliability and
congestion control.

Data Flow TCP does Flow Control. TCP requires UDP does not have an option for flow control
Control three packets to set up a socket
connection, before any user data can
be sent. TCP handles reliability and
congestion control.

Error Checking TCP does error checking and error UDP does error checking but simply discards
recovery. Erroneous packets are erroneous packets. Error recovery is not attempted.
retransmitted from the source to the
destination.

Ack. Acknowledgement segments No Acknowledgment

Handshake SYN, SYN-ACK, ACK No handshake (connectionless protocol)

Page | 4 Network Fundamental and Applications -Labs


3. Methodology
This lab is building based on the methodology of lab 1, Wireshark for capturing segment and analyse
layer 4. Additional a traffic generator will be used for analysing layer 4 (Download it from Blackboard).
 IPERF: iPerf is a tool for active measurements of the maximum achievable bandwidth on IP
networks. It supports tuning of various parameters related to timing, buffers and protocols (TCP,
UDP, SCTP with IPv4 and IPv6). For each test it reports the bandwidth, loss, and other
 parameters.
iPerf main features:
 Create TCP and UDP
 Measure bandwidth
 Report MSS/MTU size and observed read sizes.
 Support for TCP window size via socket buffers.
 Client can create UDP streams of specified bandwidth.
Measure packet loss, delay jitter
 Client and server can have multiple simultaneous connections (-P option).
  Server handles multiple connections, rather than quitting after a single test.
 Can run for specified time (-t option), rather than a set amount of data to transfer (-n or -k
option).
 Print periodic, intermediate bandwidth, jitter, and loss reports at specified intervals (-i option).
  Run the server as a daemon (-D option)
 Use representative streams to test out how link layer compression affects your achievable
bandwidth (-F option).


4. Exercises
Section 4.1: Using traffic Generators
 Step 1: Open a Windows Command Prompt (CLI), and execute the command line iperf --help.
For doing this just put Iperf executable to the CLI terminal. Take some time for understanding the
different options.








 Step 2: Initiate TCP Traffic, for doing it each student need to check their own IPv4 Address and
then:
 o Student 1: Configure CLI terminal as server (iperf -s).
o Student 2: Configure CLI terminal as client (iperf –c IPv4_student1) o
Which are the statistics are provided at the end of transmission?

o Is there any packet lost?

Page | 5 Network Fundamental and Applications -Labs


o Analyze the TCP options and try different configurations with Iperf.

 Step 3: Initiate UDP Traffic, for doing that configure pc-student 1 as client and pc-student 2 as
server for exchanging UDP traffic,
o Which are the command lines?

o Which are the statistics are provided at the end of transmission?

o What is different from the statistics provided in the previous exercise?

 Step 4: Configure pc-student 1 and pc-student 2 for exchanging UDP traffic, with:
o Packet length = 1000bytes
o Time = 20 seconds
o Bandwidth = 1Mbps
o Port = 9900
Which are the command lines?

Analyze the UDP options and try different configurations with Iperf.

Section 4.2: TCP protocol


Now, we will investigate the behavior of the celebrated TCP protocol in detail. We will do so by
analyzing a trace of the TCP segments sent and received using traffic generator from two computers. We
will study TCP’s use of data transfer and acknowledgement.
 STEP 1: Now start up Wireshark and begin packet capture (Capture->Start) and then press OK
 on the Wireshark Packet Capture Options screen.
 STEP 2: Exchange TCP data using Iperf as done in previous section.

Page | 6 Network Fundamental and Applications -Labs


 STEP 3: Wait until TCP connection finish and stop Wireshark packet capture. You will
visualize similar window as bellow:

 STEP 4: First, filter the packets displayed in the Wireshark window by entering “tcp” into the
display filter specification window towards the top of the Wireshark window. Keep in mind
the field of TCP header and match the field with the captured packets.

 STEP 5: Pick-up an TCP segment exchanged between pc-student 1 and pc-student 2: Answer the
 following questions:
1. What is the IP address and TCP port number used by the client computer (source) and
serve computer (destination)?

Page | 7 Network Fundamental and Applications -Labs


2. What is the length of the TCP segment that client sent to the server? and what is inside
data?

3. What is the length of the TCP segmenting that server sent to the client? What is that
segment?

4. Which is the widow value for those packets? Is the same value?

5. What is the role of sequence number?

6. What is inside flags?

Section 4.3: UDP Protocol


Now, we will take a quick look at the UDP transport protocol. Because UDP is simple, we will
be able to cover it pretty quickly in this lab.
 STEP 1: Now start up Wireshark and begin packet capture (Capture->Start) and then press OK
 on the Wireshark Packet Capture Options screen.
  STEP 2: Exchange UDP data using Iperf as done in previous section.
 STEP 3: Wait until UDP connection finish and stop Wireshark packet capture. You will
visualize similar window as bellow:

Page | 8 Network Fundamental and Applications -Labs


 STEP 4: First, filter the packets displayed in the Wireshark window by entering “udp” into the
display filter specification window towards the top of the Wireshark window. Keep in mind
the field of UDP header and match the field with the captured packets.






 STEP 5: Pick-up an UDP segment exchanged between pc-student 1 and pc-student 2: Answer the
 following questions:
1. What is the IP address and UDP port number used by the client computer (source)
and serve computer (destination)?

2. What is the length of the UDP segment that client sent to the server?

3. Is there any UDP ACK?

Page | 9 Network Fundamental and Applications -Labs


4. Which is the widow value for those packets?

5. What is the role of sequence number?

Congratulations! You have now completed the Lab 3.


5. Questions
The goal of lab 3 was primarily to introduce the Layer 4 protocols. The following questions will
demonstrate that you have been able to do that. Answer the following questions:
 It is possible to manually control the bandwidth of TCP with Iperf?
 How many additional filed have TCP in comparison to UDP?
 How many types of UDP segments you visualize?

6. References
[1] Supplement to Computer Networking: A Top-Down Approach, 7th ed., J.F. Kurose and K.W.
Ross, 2005-2016, All Rights Reserved
[2] William Stallings. 1996. Data and Computer Communications (5th Ed.). Prentice-Hall, Inc., Upper
Saddle River, NJ, USA.
[3] Andrew Tanenbaum. 2002. Computer Networks (4th ed.). Prentice Hall Professional
Technical Reference.

Page | 10 Network Fundamental and Applications -Labs

Anda mungkin juga menyukai