0% found this document useful (0 votes)
75 views10 pages

TCP vs. Udp: October 2015

This document discusses the differences between the TCP and UDP transport layer protocols. It begins by explaining how TCP and UDP relate to the OSI transport layer and how they segment and reassemble data. It then details the key differences between TCP and UDP, such as TCP's connection-oriented nature and reliability versus UDP's connectionless "best effort" delivery. Examples are provided of applications that commonly use each protocol. The document concludes that TCP is generally used for non-time critical applications that require reliable data transfer, while UDP is suited for applications like games and time-sensitive queries that can tolerate some data loss.

Uploaded by

Kashif Manzoor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views10 pages

TCP vs. Udp: October 2015

This document discusses the differences between the TCP and UDP transport layer protocols. It begins by explaining how TCP and UDP relate to the OSI transport layer and how they segment and reassemble data. It then details the key differences between TCP and UDP, such as TCP's connection-oriented nature and reliability versus UDP's connectionless "best effort" delivery. Examples are provided of applications that commonly use each protocol. The document concludes that TCP is generally used for non-time critical applications that require reliable data transfer, while UDP is suited for applications like games and time-sensitive queries that can tolerate some data loss.

Uploaded by

Kashif Manzoor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/283296910

TCP Vs. UDP

Research · October 2015


DOI: 10.13140/RG.2.1.4244.1688

CITATIONS READS
0 5,112

1 author:

Ahmed Elnaggar
Information Technology Institute
24 PUBLICATIONS   3 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

MSc Research View project

Network Fundamentals Labs View project

All content following this page was uploaded by Ahmed Elnaggar on 28 October 2015.

The user has requested enhancement of the downloaded file.


1st Assignment Web Technology
Department of Information Technology,
Institute of Graduate Studies and Research,
University of Alexandria,
Egypt.

Presented by:
Eng.Ahmed Atef Elnaggar
Supervisor:
Prof . Ahmed M. Elfatatry

0
Abstract
Data from applications is packaged, transported, and delivered to the appropriate
server daemon or application on the destination device. The processes described in
the OSI Transport layer accept data from the Application layer and prepare it for
addressing at the Network layer. The Transport layer is responsible for the overall
end-to-end transfer of application data.
Transaction control protocol (TCP) and User data gram protocol (UDP) are
transport layer protocols in OSI model and TCP/IP model.
Different applications have different requirements. Different protocols have been
developed to meet them.

Contents:
1- Introduction
2- Objectives
3-The relation between OSI model and TCP and UDP
3. A- Segmentation and Reassembly
4- TCP Vs UDP
4. A- TCP Connection Establishment and Termination
4. B- the difference between TCP and UDP header
4. C- the main features of TCP and UDP protocols
5- Identifying the Conversations
5. A- Port Addressing Types
6- Using both TCP and UDP protocols (Applications)
7-Conclusion
8-References

1
1- Introduction
In this report, we will cover the main points about the difference between TCP and
UDP, not the technical details.
Also we will try to answer the following questions:
1- What is the relation between OSI model and TCP and UDP protocols?
2- In which layer TCP and UDP protocols are operating?
3-What is the difference between TCP and UDP header?
4-What are the main features of TCP and UDP protocols?
5-Whose is specifying whether the segment is TCP or UDP?
6-Which applications are Using TCP and which are using UDP?
2- Objectives
Upon completion of this report, you will be able to:
Describe the role of two TCP/IP Transport layer protocols: TCP and UDP.
Explain how TCP and UDP each handle transported data.
Identify when it is appropriate to use TCP or UDP and provide examples of
applications that use each protocol.
3- The relation between OSI model and TCP and UDP
The transport Layer in OSI model data stream is a logical connection between the
endpoints of a network. It provides transport services from a host to a destination.
This service is sometimes referred to as an end-to-end service.

• Primary responsibilities of the Transport Layer:


• Tracking the individual communications between
applications on the source and destination hosts.
• Segmenting the data and managing each piece.
• Reassembling the segments into streams of
application data.
• Identifying the different applications.
• Performing flow control between end users.
• Enabling error recovery.
• Initiating a session.

Figure 1

2
3. A- Segmentation and Reassembly
An Ethernet frame has a maximum frame size or Maximum Transmission Unit
(MTU) of 1,518 bytes. When a larger message must be sent, the application data
must be segmented into sections that will not exceed the maximum size.
The segment size must also take into account the encapsulation process that must
take place before the frame can be transmitted.

Figure 2

4- TCP Vs UDP
They are two most common Transport Layer protocols but the key difference
between TCP and UDP is reliability.

4. A -TCP Connection Establishment and Termination


For a connection to be established, the two end stations must synchronize on each
other's initial sequence numbers (ISNs).The ISN is the starting sequence number
used when a TCP connection is established (fig 3).
Four step process using the Flag and sequence number fields to terminate session
(fig 4).

Figure 3 Figure 4
3
4. B- the difference between TCP and UDP header

Figure 5

4. C- the main features of TCP and UDP protocols


User Datagram Protocol (UDP) Transmission Control Protocol (TCP)

• Connectionless •Connection-oriented
• “Best Effort” delivery •Reliable delivery
• Low overhead •Error checking
• No error checking, No flow control •Flow control

Figure 6

4
5- Identifying the Conversations
At the TCP/IP Internet Layer: The IP Packet Header has a Protocol field that
specifies whether the segment is TCP or UDP.

Figure7

When a packet is encapsulated at the Network Layer, it is


coded to identify the source of the packet (TCP or UDP).
When a packet is decapsulated at the destination, the code
is used to send the packet to the proper protocol (TCP or
UDP).
Both TCP and UDP use port numbers to pass information to the upper layers.
These ports are actually termed sockets.
A socket is simply the combination of the device’s IP address and the
source/destination port for the data, separated by a colon.
• e.g. 207.134.65.2:80 reference an HTTP socket.
5. A- Port Addressing Types
Port numbers are managed and assigned by the Internet Assigned Number
Authority (IANA).

Table 1

5
6-Using both TCP and UDP protocols
Some applications may use both TCP and UDP.
For example, the low overhead of UDP enables DNS to serve many client requests
very quickly. Sometimes, however, sending the requested information may require
the reliability of TCP. In this case, the well known port number of 53 is used by
both protocols with this service.

Port Number Application Layer4 Protocol Description

20 FTP TCP File Transfer Protocol – Data

21 FTP TCP File Transfer Protocol – Control Commands

23 TELNET TCP Terminal connection

25 SMTP TCP Simple Mail Transfer Protocol - Email

53 DNS UDP Domain Name System

67,68 DHCP UDP Dynamic Host Configuration Protocol

69 TFTP UDP Trivial File Transfer Protocol

80 HTTP TCP Hypertext Transfer Protocol


Table 2

Applications of TCP and UDP


TCP UDP
File Transfer Protocol (FTP) Trivial File Transfer Protocol (TFTP)
Telnet Domain Name System (DNS)
Simple Mail Transfer Protocol (SMTP) Simple Network Management Protocol
(SNMP)
Post Office Protocol (POP3) Dynamic Host Configuration Protocol (DHCP)
Hypertext Transfer Protocol (HTTP)
Table 3

6
7-Conclusion
Characteristics TCP UDP
User Datagram Protocol or Universal Datagram
Acronym for: Transmission Control Protocol
Protocol
UDP is also a protocol used in message transport or
As a message makes its way across the transfer. This is not connection based which means
Function: internet from one computer to another. that one program can send a load of packets to
This is connection based. another and that would be the end of the
relationship.
UDP is used for games or applications that require
TCP is used in case of non-time critical fast transmission of data. UDP's stateless nature is
Usage:
applications. also useful for servers that answer small queries from
huge numbers of clients.
Examples: HTTP, HTTPs, FTP, SMTP Telnet etc... DNS, DHCP, TFTP, SNMP, RIP, VOIP etc...
UDP has no inherent order as all packets are
Ordering of TCP rearranges data packets in the
independent of each other. If ordering is required, it
data packets: order specified.
has to be managed by the application layer.
Speed of UDP is faster because there is no error-checking for
The speed for TCP is slower than UDP.
transfer: packets.
There is absolute guarantee that the
data transferred remains intact and There is no guarantee that the messages or packets
Reliability:
arrives in the same order in which it sent would reach at all.
was sent.
Header Size: TCP header size is 20 bytes UDP Header size is 8 bytes.
Packets are sent individually and are checked for
Data is read as a byte stream, no
integrity only if they arrive. Packets have definite
Streaming of distinguishing indications are
boundaries which are honored upon receipt, meaning
data: transmitted to signal message
a read operation at the receiver socket will yield an
(segment) boundaries.
entire message as it was originally sent.
TCP requires three packets to set up a
UDP is lightweight. There is no ordering of messages,
socket connection, before any user data
Weight: no tracking connections, etc. It is a small transport
can be sent. TCP handles reliability and
layer designed on top of IP.
congestion control.
TCP does Flow Control. TCP requires
three packets to set up a socket
Data Flow
connection, before any user data can be UDP does not have an option for flow control
Control:
sent. TCP handles reliability and
congestion control.
Error Checking: TCP does error checking UDP does error checking, but no recovery options.

7
8-References
1-Sybex (640 607) Cisco CCNA Study Guide 3Ed.
2- Cisco Press CCNA 3.0 Study Guide (Con Indice) 640-607
3- Presentations of collaboration among the instructors at St. Clair College in
Windsor, Ontario.(2007)
4- Online material of Cisco networking academy CCNA Exploration 4.0- Network
Fundamentals. http://www.cisco.com/web/learning/netacad/index.html

View publication stats

You might also like