SlideShare a Scribd company logo
Herat University
                   Computer Science Faculty
                       Scientific Writing
                   Scientific Research Article




  TCP And UDP
  What is difference between them?
  Where are they used?
  Why?




By: Ahmad Khalid
Lecturers:
Mrs. Nabizada
Mr. Fahim Ahmady
                                                 Nov 2011
Contents
 Introduction
 Advantages of TCP
 Disadvantages of TCP
 Advantages of UDP
 Disadvantages of UDP
 Where are they used? Why?
 Conclusion
Introduction
 TCP and UDP works in Transport Layer of OSI
  Model as well as TCP/IP Model
 TCP (Transmission Control Protocol) enables two
  hosts to establish a connection and exchange
  streams of data. TCP guarantees delivery of data
  and also guarantees that packets will be delivered
  in the same order in which they were sent.
 UDP (User Datagram Protocol) a connectionless
  protocol that, like TCP, runs on top of IP networks.
  Provides very few error recovery services, offering
  instead a direct way to send and receive
  datagrams over an IP network.
Advantages of TCP
   TCP guarantees three things: that your data gets there,
    that it gets there in order, and that it gets there without
    duplication. (the truth, the whole truth, and nothing but
    the truth...)
   TCP does Flow Control and Congestion Control
   For a programmer: The operating system does all the
    work. you just sit back and watch the show. no need to
    have the same bugs in your code that everyone else did
    on their first try; it's all been figured out for you.
   Since it's in the OS, handling incoming packets has
    fewer context switches from kernel to user space and
    back; all the reassembly, acking, flow control, etc is
    done by the kernel.
   Routers may notice TCP packets and treat them
    specially. they can buffer and retransmit them
   TCP has good relative throughput on a modem or a
    LAN.
Disadvantages of TCP
 TCP cannot conclude a transmission without all data in
  motion being explicitly acked.
 TCP cannot be used for broadcast or multicast
  transmission.
 TCP has no block boundaries; you must create your
  own.
 For a programmer:
    ◦ OS might be buggy –as well TCP
    ◦ TCP may have lots of features you don't need. it may waste
      bandwidth, time, or effort on ensuring things that are irrelevant to
      the task at hand.
   Routers on the internet today are out of memory. they
    can't pay much attention to TCP flying by, and try to
    help it. design assumptions of TCP break down in this
    environment.
Advantages of UDP
 Broadcast and multicast transmission are
  available with UDP
 It doesn't restrict you to a connection based
  communication model, so startup latency in
  distributed applications is much lower, as is
  operating system overhead FAST.
 All flow control, acking, transaction logging,
  etc is up to user programs; a broken OS
  implementation is not going to get in your way.
  additionally, you only need to implement and
  use the features you need.
 The recipient of UDP packets gets them
  unmangled, including block boundaries.
Disadvantages of UDP
 There are no guarantees with UDP. a packet
  may not be delivered, or delivered twice, or
  delivered out of order; you get no indication
  of this unless the listening program at the
  other end decides to say something.
 UDP has no flow control, Congestion Control.
  implementation is the duty of user programs.
 Routers are quite careless with UDP. they
  never retransmit it if it collides, and it seems
  to be the first thing dropped when a router is
  short on memory.
 UDP suffers from worse packet loss than
  TCP
Where are they used? Why?
 TCP is used in HTTP, HTTPs, FTP,
  SMTP Telnet etc...
 UDP is used in DNS, DHCP, TFTP,
  SNMP, RIP, VOIP, Multi media, Online
  games etc…
 Consider Multi media, if we use TCP
  instead of UDP when ever pocket loss
  occurred we get long delay to continue
  watching/listening because TCP is
  retransmitting lost packets and it takes
TCP vs. UDP Conclusion
 TCP and UDP each have their place. In fact, some
  applications use a combination of the two. For example,
  a lot of online multiplayer games use TCP for data
  transfer and UDP for things like a client heartbeat or to
  send opponent position updates.
 TCP is generally a good choice, though, even with its
  associated overhead. Most of the overhead is in the
  connection. Therefore, if your application stays
  connected for any length of time, then the cost is
  mitigated. In addition, if you’re sending any quantity of
  data, then it’s cheaper to use TCP’s built-in reliability,
  ordering, and flow control instead of building your own.
 UDP is a good choice for multi Media like VoIP to
  provide small jitter
Thank You

More Related Content

What's hot

TCP-IP Reference Model
TCP-IP Reference ModelTCP-IP Reference Model
TCP-IP Reference Model
Mukesh Tekwani
 
Computer network switching
Computer network switchingComputer network switching
Computer network switching
Shivani Godha
 
Tcp Udp Icmp And The Transport Layer
Tcp Udp Icmp And The Transport LayerTcp Udp Icmp And The Transport Layer
Tcp Udp Icmp And The Transport Layer
tmavroidis
 
Application layer protocols
Application layer protocolsApplication layer protocols
Application layer protocols
JUW Jinnah University for Women
 
User datagram protocol
User datagram protocolUser datagram protocol
User datagram protocolMohd Arif
 
Point To Point Protocol
Point To Point ProtocolPoint To Point Protocol
Point To Point ProtocolPhan Vuong
 
IP Multicasting
IP MulticastingIP Multicasting
IP Multicasting
Tharindu Kumara
 
Difference between OSI Layer & TCP/IP Layer
Difference between OSI Layer & TCP/IP LayerDifference between OSI Layer & TCP/IP Layer
Difference between OSI Layer & TCP/IP Layer
Netwax Lab
 
Point to-point protocol (ppp)
Point to-point protocol (ppp)Point to-point protocol (ppp)
Point to-point protocol (ppp)
Kongu Engineering College, Perundurai, Erode
 
User datagram protocol (udp)
User datagram protocol (udp)User datagram protocol (udp)
User datagram protocol (udp)
Ramola Dhande
 
Routing Protocols
Routing ProtocolsRouting Protocols
Routing Protocols
NetProtocol Xpert
 
Transport layer
Transport layer Transport layer
Transport layer
Mukesh Chinta
 
TCP/IP and UDP protocols
TCP/IP and UDP protocolsTCP/IP and UDP protocols
TCP/IP and UDP protocols
Dawood Faheem Abbasi
 
TCP vs UDP / Sumiet23
TCP vs UDP / Sumiet23TCP vs UDP / Sumiet23
TCP vs UDP / Sumiet23
Sumiet Talekar
 
IPv4
IPv4IPv4
Tcp IP Model
Tcp IP ModelTcp IP Model
Tcp IP Model
Ankur Kumar
 
Computer Network - Network Layer
Computer Network - Network LayerComputer Network - Network Layer
Computer Network - Network Layer
Manoj Kumar
 
TCP- Transmission Control Protocol
TCP-  Transmission Control Protocol TCP-  Transmission Control Protocol
TCP- Transmission Control Protocol
Akhil .B
 
Multiplexing
MultiplexingMultiplexing
Multiplexingstooty s
 
TCP over wireless slides
TCP over wireless slidesTCP over wireless slides
TCP over wireless slidesMahesh Rajawat
 

What's hot (20)

TCP-IP Reference Model
TCP-IP Reference ModelTCP-IP Reference Model
TCP-IP Reference Model
 
Computer network switching
Computer network switchingComputer network switching
Computer network switching
 
Tcp Udp Icmp And The Transport Layer
Tcp Udp Icmp And The Transport LayerTcp Udp Icmp And The Transport Layer
Tcp Udp Icmp And The Transport Layer
 
Application layer protocols
Application layer protocolsApplication layer protocols
Application layer protocols
 
User datagram protocol
User datagram protocolUser datagram protocol
User datagram protocol
 
Point To Point Protocol
Point To Point ProtocolPoint To Point Protocol
Point To Point Protocol
 
IP Multicasting
IP MulticastingIP Multicasting
IP Multicasting
 
Difference between OSI Layer & TCP/IP Layer
Difference between OSI Layer & TCP/IP LayerDifference between OSI Layer & TCP/IP Layer
Difference between OSI Layer & TCP/IP Layer
 
Point to-point protocol (ppp)
Point to-point protocol (ppp)Point to-point protocol (ppp)
Point to-point protocol (ppp)
 
User datagram protocol (udp)
User datagram protocol (udp)User datagram protocol (udp)
User datagram protocol (udp)
 
Routing Protocols
Routing ProtocolsRouting Protocols
Routing Protocols
 
Transport layer
Transport layer Transport layer
Transport layer
 
TCP/IP and UDP protocols
TCP/IP and UDP protocolsTCP/IP and UDP protocols
TCP/IP and UDP protocols
 
TCP vs UDP / Sumiet23
TCP vs UDP / Sumiet23TCP vs UDP / Sumiet23
TCP vs UDP / Sumiet23
 
IPv4
IPv4IPv4
IPv4
 
Tcp IP Model
Tcp IP ModelTcp IP Model
Tcp IP Model
 
Computer Network - Network Layer
Computer Network - Network LayerComputer Network - Network Layer
Computer Network - Network Layer
 
TCP- Transmission Control Protocol
TCP-  Transmission Control Protocol TCP-  Transmission Control Protocol
TCP- Transmission Control Protocol
 
Multiplexing
MultiplexingMultiplexing
Multiplexing
 
TCP over wireless slides
TCP over wireless slidesTCP over wireless slides
TCP over wireless slides
 

Similar to Tcp and udp

TCP AND UDP
TCP AND UDP TCP AND UDP
Tcp and udp.transmission control protocol.user datagram protocol
Tcp and udp.transmission control protocol.user datagram protocolTcp and udp.transmission control protocol.user datagram protocol
Tcp and udp.transmission control protocol.user datagram protocol
Mushtaque Khan Noonari
 
Tcp vs udp difference and comparison diffen
Tcp vs udp   difference and comparison   diffenTcp vs udp   difference and comparison   diffen
Tcp vs udp difference and comparison diffen
Harikiran Raju
 
What is the difference between udp and tcp internet protocols
What is the difference between udp and tcp internet protocols What is the difference between udp and tcp internet protocols
What is the difference between udp and tcp internet protocols krupalipandya29
 
Xtc Pdiscussionv2
Xtc Pdiscussionv2Xtc Pdiscussionv2
Xtc Pdiscussionv2
Tarik KUCUK
 
UDP and TCP header.ppt
UDP and TCP header.pptUDP and TCP header.ppt
UDP and TCP header.ppt
nehayarrapothu
 
CN Activity 3.pptx
CN Activity 3.pptxCN Activity 3.pptx
CN Activity 3.pptx
sample57
 
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 FinalExploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Finalmasoodnt10
 
User Datagram protocol For Msc CS
User Datagram protocol For Msc CSUser Datagram protocol For Msc CS
User Datagram protocol For Msc CSThanveen
 
Internet of Things Unit - 01 Part 3A.pptx
Internet of Things Unit - 01 Part 3A.pptxInternet of Things Unit - 01 Part 3A.pptx
Internet of Things Unit - 01 Part 3A.pptx
SunilNirmal9
 
ETE405-lec7.pptx
ETE405-lec7.pptxETE405-lec7.pptx
ETE405-lec7.pptxmashiur
 
Networking-basics
Networking-basicsNetworking-basics
Networking-basics
Raj Alam
 
TCP/IP Modal
TCP/IP ModalTCP/IP Modal
TCP/IP Modal
ParikshitTaksande1
 
UDP and TCP Protocol & Encrytion and its algorithm
UDP and TCP Protocol & Encrytion and its algorithmUDP and TCP Protocol & Encrytion and its algorithm
UDP and TCP Protocol & Encrytion and its algorithm
Ayesha Tahir
 
ETE405-lec7.ppt
ETE405-lec7.pptETE405-lec7.ppt
ETE405-lec7.pptmashiur
 
Module 1 slides
Module 1 slidesModule 1 slides
Module 1 slides
AnaniaKapala
 
Ch4 Protocols.pptx
Ch4 Protocols.pptxCh4 Protocols.pptx
Ch4 Protocols.pptx
azmerawAnna1
 
CSS (KNC-301) 2. TCP IP By Vivek Tripathi.pptx
CSS (KNC-301)  2. TCP IP By Vivek Tripathi.pptxCSS (KNC-301)  2. TCP IP By Vivek Tripathi.pptx
CSS (KNC-301) 2. TCP IP By Vivek Tripathi.pptx
VivekTripathi684438
 

Similar to Tcp and udp (20)

TCP AND UDP
TCP AND UDP TCP AND UDP
TCP AND UDP
 
Tcp and udp.transmission control protocol.user datagram protocol
Tcp and udp.transmission control protocol.user datagram protocolTcp and udp.transmission control protocol.user datagram protocol
Tcp and udp.transmission control protocol.user datagram protocol
 
Tcp vs udp difference and comparison diffen
Tcp vs udp   difference and comparison   diffenTcp vs udp   difference and comparison   diffen
Tcp vs udp difference and comparison diffen
 
What is the difference between udp and tcp internet protocols
What is the difference between udp and tcp internet protocols What is the difference between udp and tcp internet protocols
What is the difference between udp and tcp internet protocols
 
Xtc Pdiscussionv2
Xtc Pdiscussionv2Xtc Pdiscussionv2
Xtc Pdiscussionv2
 
TCP Section5
TCP Section5TCP Section5
TCP Section5
 
UDP and TCP header.ppt
UDP and TCP header.pptUDP and TCP header.ppt
UDP and TCP header.ppt
 
CN Activity 3.pptx
CN Activity 3.pptxCN Activity 3.pptx
CN Activity 3.pptx
 
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 FinalExploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
 
53426980 tcp-ip
53426980 tcp-ip53426980 tcp-ip
53426980 tcp-ip
 
User Datagram protocol For Msc CS
User Datagram protocol For Msc CSUser Datagram protocol For Msc CS
User Datagram protocol For Msc CS
 
Internet of Things Unit - 01 Part 3A.pptx
Internet of Things Unit - 01 Part 3A.pptxInternet of Things Unit - 01 Part 3A.pptx
Internet of Things Unit - 01 Part 3A.pptx
 
ETE405-lec7.pptx
ETE405-lec7.pptxETE405-lec7.pptx
ETE405-lec7.pptx
 
Networking-basics
Networking-basicsNetworking-basics
Networking-basics
 
TCP/IP Modal
TCP/IP ModalTCP/IP Modal
TCP/IP Modal
 
UDP and TCP Protocol & Encrytion and its algorithm
UDP and TCP Protocol & Encrytion and its algorithmUDP and TCP Protocol & Encrytion and its algorithm
UDP and TCP Protocol & Encrytion and its algorithm
 
ETE405-lec7.ppt
ETE405-lec7.pptETE405-lec7.ppt
ETE405-lec7.ppt
 
Module 1 slides
Module 1 slidesModule 1 slides
Module 1 slides
 
Ch4 Protocols.pptx
Ch4 Protocols.pptxCh4 Protocols.pptx
Ch4 Protocols.pptx
 
CSS (KNC-301) 2. TCP IP By Vivek Tripathi.pptx
CSS (KNC-301)  2. TCP IP By Vivek Tripathi.pptxCSS (KNC-301)  2. TCP IP By Vivek Tripathi.pptx
CSS (KNC-301) 2. TCP IP By Vivek Tripathi.pptx
 

Recently uploaded

UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 

Tcp and udp

  • 1. Herat University Computer Science Faculty Scientific Writing Scientific Research Article TCP And UDP What is difference between them? Where are they used? Why? By: Ahmad Khalid Lecturers: Mrs. Nabizada Mr. Fahim Ahmady Nov 2011
  • 2. Contents  Introduction  Advantages of TCP  Disadvantages of TCP  Advantages of UDP  Disadvantages of UDP  Where are they used? Why?  Conclusion
  • 3. Introduction  TCP and UDP works in Transport Layer of OSI Model as well as TCP/IP Model  TCP (Transmission Control Protocol) enables two hosts to establish a connection and exchange streams of data. TCP guarantees delivery of data and also guarantees that packets will be delivered in the same order in which they were sent.  UDP (User Datagram Protocol) a connectionless protocol that, like TCP, runs on top of IP networks. Provides very few error recovery services, offering instead a direct way to send and receive datagrams over an IP network.
  • 4. Advantages of TCP  TCP guarantees three things: that your data gets there, that it gets there in order, and that it gets there without duplication. (the truth, the whole truth, and nothing but the truth...)  TCP does Flow Control and Congestion Control  For a programmer: The operating system does all the work. you just sit back and watch the show. no need to have the same bugs in your code that everyone else did on their first try; it's all been figured out for you.  Since it's in the OS, handling incoming packets has fewer context switches from kernel to user space and back; all the reassembly, acking, flow control, etc is done by the kernel.  Routers may notice TCP packets and treat them specially. they can buffer and retransmit them  TCP has good relative throughput on a modem or a LAN.
  • 5. Disadvantages of TCP  TCP cannot conclude a transmission without all data in motion being explicitly acked.  TCP cannot be used for broadcast or multicast transmission.  TCP has no block boundaries; you must create your own.  For a programmer: ◦ OS might be buggy –as well TCP ◦ TCP may have lots of features you don't need. it may waste bandwidth, time, or effort on ensuring things that are irrelevant to the task at hand.  Routers on the internet today are out of memory. they can't pay much attention to TCP flying by, and try to help it. design assumptions of TCP break down in this environment.
  • 6. Advantages of UDP  Broadcast and multicast transmission are available with UDP  It doesn't restrict you to a connection based communication model, so startup latency in distributed applications is much lower, as is operating system overhead FAST.  All flow control, acking, transaction logging, etc is up to user programs; a broken OS implementation is not going to get in your way. additionally, you only need to implement and use the features you need.  The recipient of UDP packets gets them unmangled, including block boundaries.
  • 7. Disadvantages of UDP  There are no guarantees with UDP. a packet may not be delivered, or delivered twice, or delivered out of order; you get no indication of this unless the listening program at the other end decides to say something.  UDP has no flow control, Congestion Control. implementation is the duty of user programs.  Routers are quite careless with UDP. they never retransmit it if it collides, and it seems to be the first thing dropped when a router is short on memory.  UDP suffers from worse packet loss than TCP
  • 8.
  • 9.
  • 10. Where are they used? Why?  TCP is used in HTTP, HTTPs, FTP, SMTP Telnet etc...  UDP is used in DNS, DHCP, TFTP, SNMP, RIP, VOIP, Multi media, Online games etc…  Consider Multi media, if we use TCP instead of UDP when ever pocket loss occurred we get long delay to continue watching/listening because TCP is retransmitting lost packets and it takes
  • 11. TCP vs. UDP Conclusion  TCP and UDP each have their place. In fact, some applications use a combination of the two. For example, a lot of online multiplayer games use TCP for data transfer and UDP for things like a client heartbeat or to send opponent position updates.  TCP is generally a good choice, though, even with its associated overhead. Most of the overhead is in the connection. Therefore, if your application stays connected for any length of time, then the cost is mitigated. In addition, if you’re sending any quantity of data, then it’s cheaper to use TCP’s built-in reliability, ordering, and flow control instead of building your own.  UDP is a good choice for multi Media like VoIP to provide small jitter