SlideShare une entreprise Scribd logo
1  sur  7
Télécharger pour lire hors ligne
6
TCP/IP & UDP
Computer Networks (CSI-504)
Prepared By: Ghayour Abbas
Outline:
• TCP/IP
• UDP
TCP
Transmission Control Protocol (TCP) widely known as Internet Protocol (IP) is a
set of communications protocols used over the internet for delivery of services or
packets within or across the network. It is commonly known as internet protocol
suite.
The TCP/IP protocol consists of four layers such as link layer, network layer,
transport layer, and application layer.
Each layer adds addresses to the protocol stack as a physical address, logical
address, port address, and application-specific address.
TCP is a connection-oriented point-to-point transport communication
protocol that sends data packets as an unstructured stream of bytes in an ordered
sequence. TCP provides information from sending node about the delivery of
packets transmitted to a destination node by using sequence numbers and
acknowledgment messages. TCP ensures reliability, end-to-end delivery,
resequencing and retransmitting of data until a timeout condition is reached or
acknowledgment of data packets is received.
TCP offers flow control mechanism to sustain high transmission of packets
over a speeding network as well as TCP protocols offer error detection and lost
data features by trigging retransmission of data packets until an error-free
acknowledgment is received. The TCP/IP protocol maintains communication with
application layer protocols such as (FTP) file transfer protocol, (SMTP) simple
mail transfer protocol, and (HTTP) hypertext transfer protocol.
UDP
User Datagram Protocol (UDP) is a connectionless transport layer
communication protocol used to establish low tolerating and loss latency
connections for delivery of services or packets within or across the network.
It is coupled with an internet protocol suite as an alternative to TCP/IP
protocol. UDP constructs a datagram packet and addresses it with a port number
of IP appended with data packets and optional checksum capability to verify
receipt of intact data arrival. Since UDP protocol is simple protocol, the
retransmissions of packets can be decided at sender’s end whether to trade low
latency for high reliability over data transmission. UDP reduces overall network
traffic owing to network broadcasts feature which broadcasts packets to some
computers on the same network and eliminates the need for duplication across
the network. As UDP is connectionless protocol, the delivery or order of the data
content packets varies.
UDP conjunctions with higher level protocols such as trivial file transfer
protocol, real-time streaming protocol, simple network protocol, and domain
name system lookups to manage data transmission services across the network.
TCP Vs. UDP
Data Transfer Features
TCP enables the establishment of a strong connection between two hosts to
exchange data in streams. TCP guarantees to deliver data in the same ordered
manner as sent from server to user and vice versa. Thus, TCP is a connection-
oriented protocol. However, UDP is connectionless and non-dedicated protocol
does not check the readiness of the receiver host.
Reliability
Reliability of TCP is comparatively higher as it ensures message acknowledgment
and retransmissions of data in case of loss of data parts in transit. Hence, the
hosts do not lose any missing data. On the other hand, UDP does not offer
concepts of message acknowledgments, time-out or retransmission feature.
Therefore, there is no communication of whether the packets have reached
receiver or lost in transit.
Sequence
TCP transmits data packets in the same sequence as received. In case data
packets are arriving in the wrong order, TCP reorders them and delivers in the
correct order. In case of UDP, messages sent in a particular sequence may or may
not be maintained while delivering the host. Therefore, the sequence or order in
which packets will be transmitted is unpredictable.
Connection
A TCP connection is heavyweight, and it requires almost three packets for an
appropriate socket connection and handles the congestion control and reliable
delivery. UDP connection, on the other hand, is lightweight and transports layers
designed over a particular IP. No connections are tracking or ordering of
messages.
Data Streaming
Transmission Control Protocol reads data as streams of bytes, and the message is
transmitted to segment boundaries. UDP messages contain packets that were
sent one by one and are checked for integrity at the time of arrival.
Transfer Speed
The speed of TCP is slower as compared to UDP as it checks for errors and
retransmits the packets.
Header Size
TCP’s size of the header is 20 bytes, whereas, UDP is 8 bytes. However, they have
common header fields that are, source point, destination point, and checksum.
8 bits equal 1 byte.
TCP headers appear in the following sequence, beginning with the source
and destination communication endpoints:
• Source TCP port number (2 bytes or 16 bits): The source TCP port
number represents the sending device.
• Destination TCP port number (2 bytes or 16 bits): The destination
TCP port number is the communication endpoint for the receiving
device.
• Sequence number (4 bytes or 32 bits): Message senders use
sequence numbers to mark the ordering of a group of messages.
• Acknowledgment number (4 bytes or 32 bits): Both senders and
receivers use the acknowledgment numbers field to communicate
the sequence numbers of messages that are either recently received
or expected to be sent.
• TCP data offset (4 bits): The data offset field stores the total size of a
TCP header in multiples of four bytes. A header not using the
optional TCP field has a data offset of 5 (representing 20 bytes), while
a header using the maximum-sized optional field has a data offset of
15 (representing 60 bytes).
• Reserved data (3 bits): Reserved data in TCP headers always has a
value of zero. This field aligns the total header size as a multiple of
four bytes, which is important for the efficiency of computer data
processing.
• Control flags (up to 9 bits): TCP uses a set of six standard and three
extended control flags—each an individual bit representing On or
Off—to manage data flow in specific situations.
• Window size (2 bytes or 16 bits): TCP senders use a number,
called window size, to regulate how much data they send to a
receiver before requiring an acknowledgment in return. If the
window size is too small, network data transfer is unnecessarily slow.
If the window size is too large, the network link may become
saturated, or the receiver may not be able to process incoming data
quickly enough, resulting in slow performance. Windowing
algorithms built into the protocol dynamically calculate size values
and use this field of TCP headers to coordinate changes between
senders and receivers.
• TCP checksum (2 bytes or 16 bits): The checksum value inside a TCP
header is generated by the protocol sender as a mathematical
technique to help the receiver detect messages that are corrupted or
tampered with.
• Urgent pointer (2 bytes or 16 bits): The urgent pointer field is often
set to zero and ignored, but in conjunction with one of the control
flags, it can be used as a data offset to mark a subset of a message as
requiring priority processing.
• TCP optional data (0 to 40 bytes): Usages of optional TCP data
include support for special acknowledgment and window scaling
algorithms.
UDP Header Format
Because UDP is limited in capability compared to TCP, its headers are
smaller. A UDP header contains 8 bytes, divided into the following four
required fields:
• Source UDP port number (2 bytes): The source UDP port number
represents the sending device.
• Destination UDP port number (2 bytes): The destination UDP port
number is the communication endpoint for the receiving device.
• Length of data (2 bytes): The length field in UDP represents the total
size of each datagram, including both header and data. This field
ranges in value from a minimum of 8 bytes—the required header
size—to sizes above 65,000 bytes.
• UDP checksum (2 bytes): Similar to TCP, a UDP checksum allows
receivers to cross-check incoming data for any corrupted bits of the
message.
Usage by Other Protocols
Use by other protocols FTP, SMTP, HTTP, HTTPs, Telnet use TCP Protocols, and
UDP protocols are used by TFTP, SNMP, DNS, DHCP, RIP, VOIP.
Detection of Errors
Transmission Control Protocol detects errors via checksum and performs error
recovery. If any of the packets are erroneous, they do not get acknowledged by
the receiver, which in turn triggers re-transmission by host/sender.
This mechanism is known as PAR (Positive Acknowledgement with
Retransmission). Since TCP is slower than UDP, TCP is appropriate for applications
that do not require high speed or longer period took for transmission is not a
constraint.
Regarding error detection and error recovery, UDP works on a best effort basis.
This protocol also supports error detection. However, the erroneous packets
detected by checksum are discarded. UDP does not attempt to retransmit
packets.
The reason UDP does not attempt retransmission of packets is that this protocol is
commonly used for time-sensitive applications such as voice transmission,
gaming, etc. Hence, recovery attempt would be of no point as by the time
retransmission takes place, and the packets are received, they will be of no use.

Contenu connexe

Similaire à TCP/IP & UDP

Similaire à TCP/IP & UDP (20)

計概
計概計概
計概
 
TRANSPORT LAYER ppt.pptx
TRANSPORT LAYER ppt.pptxTRANSPORT LAYER ppt.pptx
TRANSPORT LAYER ppt.pptx
 
Transport layer services
Transport layer servicesTransport layer services
Transport layer services
 
Transport protocols
Transport protocolsTransport protocols
Transport protocols
 
Chapter03 sg
Chapter03 sgChapter03 sg
Chapter03 sg
 
tcp-ippresentation-150614172243-lva1-app6892.pptx
tcp-ippresentation-150614172243-lva1-app6892.pptxtcp-ippresentation-150614172243-lva1-app6892.pptx
tcp-ippresentation-150614172243-lva1-app6892.pptx
 
TCP_NISCHAYBAHL.pptx
TCP_NISCHAYBAHL.pptxTCP_NISCHAYBAHL.pptx
TCP_NISCHAYBAHL.pptx
 
TCP /IP
TCP /IPTCP /IP
TCP /IP
 
Transport layer protocol
Transport layer protocolTransport layer protocol
Transport layer protocol
 
TCP - IP Presentation
TCP - IP PresentationTCP - IP Presentation
TCP - IP Presentation
 
Tcp ip presentation
Tcp ip presentationTcp ip presentation
Tcp ip presentation
 
TCP/IP Introduction
TCP/IP IntroductionTCP/IP Introduction
TCP/IP Introduction
 
Mcseminar
McseminarMcseminar
Mcseminar
 
Transport_Layer_Protocols.pptx
Transport_Layer_Protocols.pptxTransport_Layer_Protocols.pptx
Transport_Layer_Protocols.pptx
 
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
 
Networking essentials lect3
Networking essentials lect3Networking essentials lect3
Networking essentials lect3
 
Tcp header/IP Header/Authentication header
Tcp header/IP Header/Authentication headerTcp header/IP Header/Authentication header
Tcp header/IP Header/Authentication header
 
tcpheader-151221111244.pdf
tcpheader-151221111244.pdftcpheader-151221111244.pdf
tcpheader-151221111244.pdf
 
Mod4
Mod4Mod4
Mod4
 
TCPIP SLIDES.ppt
TCPIP SLIDES.pptTCPIP SLIDES.ppt
TCPIP SLIDES.ppt
 

Plus de ghayour abbas

Plus de ghayour abbas (20)

Web Development 5
Web Development 5 Web Development 5
Web Development 5
 
Web Development 4
Web Development 4Web Development 4
Web Development 4
 
Web Development 4 (HTML & CSS)
Web Development 4 (HTML & CSS)Web Development 4 (HTML & CSS)
Web Development 4 (HTML & CSS)
 
Web Development 3 (HTML & CSS)
Web Development 3  (HTML & CSS)Web Development 3  (HTML & CSS)
Web Development 3 (HTML & CSS)
 
Lab Manual CSI-321
Lab Manual CSI-321Lab Manual CSI-321
Lab Manual CSI-321
 
Web Development 2 (HTML & CSS)
Web Development 2 (HTML & CSS)Web Development 2 (HTML & CSS)
Web Development 2 (HTML & CSS)
 
Web Development 1 (HTML & CSS)
Web Development 1 (HTML & CSS)Web Development 1 (HTML & CSS)
Web Development 1 (HTML & CSS)
 
CSI-503 - 13. Scheduler and Dispatcher
CSI-503 - 13. Scheduler and Dispatcher CSI-503 - 13. Scheduler and Dispatcher
CSI-503 - 13. Scheduler and Dispatcher
 
CSI-503 - 11.Distributed Operating System
CSI-503 - 11.Distributed Operating SystemCSI-503 - 11.Distributed Operating System
CSI-503 - 11.Distributed Operating System
 
SWE-401 - 10. Software Testing Overview
SWE-401 - 10. Software Testing OverviewSWE-401 - 10. Software Testing Overview
SWE-401 - 10. Software Testing Overview
 
SWE-401 - 9. Software Implementation
SWE-401 - 9. Software ImplementationSWE-401 - 9. Software Implementation
SWE-401 - 9. Software Implementation
 
SWE-401 - 8. Software User Interface Design
SWE-401 - 8. Software User Interface DesignSWE-401 - 8. Software User Interface Design
SWE-401 - 8. Software User Interface Design
 
SWE-401 - 7. Software Design Strategies
SWE-401 - 7. Software Design StrategiesSWE-401 - 7. Software Design Strategies
SWE-401 - 7. Software Design Strategies
 
SWE-401 - 5. Software Design Basics
SWE-401 - 5. Software Design BasicsSWE-401 - 5. Software Design Basics
SWE-401 - 5. Software Design Basics
 
SWE-401 - 6. Software Analysis and Design Tools
SWE-401 - 6. Software Analysis and Design ToolsSWE-401 - 6. Software Analysis and Design Tools
SWE-401 - 6. Software Analysis and Design Tools
 
SWE-401 - 4. Software Requirement Specifications
SWE-401 - 4. Software Requirement Specifications SWE-401 - 4. Software Requirement Specifications
SWE-401 - 4. Software Requirement Specifications
 
SWE-401 - 3. Software Project Management
SWE-401 - 3. Software Project ManagementSWE-401 - 3. Software Project Management
SWE-401 - 3. Software Project Management
 
CSI-503 - 6. Memory Management
CSI-503 - 6. Memory Management CSI-503 - 6. Memory Management
CSI-503 - 6. Memory Management
 
CSI-503 - 4. Process synchronization
CSI-503 - 4. Process synchronizationCSI-503 - 4. Process synchronization
CSI-503 - 4. Process synchronization
 
CSI-503 - 3. Process Scheduling
CSI-503 - 3. Process SchedulingCSI-503 - 3. Process Scheduling
CSI-503 - 3. Process Scheduling
 

Dernier

Dernier (20)

How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 

TCP/IP & UDP

  • 1. 6 TCP/IP & UDP Computer Networks (CSI-504) Prepared By: Ghayour Abbas Outline: • TCP/IP • UDP TCP Transmission Control Protocol (TCP) widely known as Internet Protocol (IP) is a set of communications protocols used over the internet for delivery of services or packets within or across the network. It is commonly known as internet protocol suite. The TCP/IP protocol consists of four layers such as link layer, network layer, transport layer, and application layer. Each layer adds addresses to the protocol stack as a physical address, logical address, port address, and application-specific address.
  • 2. TCP is a connection-oriented point-to-point transport communication protocol that sends data packets as an unstructured stream of bytes in an ordered sequence. TCP provides information from sending node about the delivery of packets transmitted to a destination node by using sequence numbers and acknowledgment messages. TCP ensures reliability, end-to-end delivery, resequencing and retransmitting of data until a timeout condition is reached or acknowledgment of data packets is received. TCP offers flow control mechanism to sustain high transmission of packets over a speeding network as well as TCP protocols offer error detection and lost data features by trigging retransmission of data packets until an error-free acknowledgment is received. The TCP/IP protocol maintains communication with application layer protocols such as (FTP) file transfer protocol, (SMTP) simple mail transfer protocol, and (HTTP) hypertext transfer protocol. UDP User Datagram Protocol (UDP) is a connectionless transport layer communication protocol used to establish low tolerating and loss latency connections for delivery of services or packets within or across the network. It is coupled with an internet protocol suite as an alternative to TCP/IP protocol. UDP constructs a datagram packet and addresses it with a port number of IP appended with data packets and optional checksum capability to verify receipt of intact data arrival. Since UDP protocol is simple protocol, the retransmissions of packets can be decided at sender’s end whether to trade low latency for high reliability over data transmission. UDP reduces overall network traffic owing to network broadcasts feature which broadcasts packets to some computers on the same network and eliminates the need for duplication across the network. As UDP is connectionless protocol, the delivery or order of the data content packets varies. UDP conjunctions with higher level protocols such as trivial file transfer protocol, real-time streaming protocol, simple network protocol, and domain name system lookups to manage data transmission services across the network.
  • 3. TCP Vs. UDP Data Transfer Features TCP enables the establishment of a strong connection between two hosts to exchange data in streams. TCP guarantees to deliver data in the same ordered manner as sent from server to user and vice versa. Thus, TCP is a connection- oriented protocol. However, UDP is connectionless and non-dedicated protocol does not check the readiness of the receiver host. Reliability Reliability of TCP is comparatively higher as it ensures message acknowledgment and retransmissions of data in case of loss of data parts in transit. Hence, the hosts do not lose any missing data. On the other hand, UDP does not offer concepts of message acknowledgments, time-out or retransmission feature. Therefore, there is no communication of whether the packets have reached receiver or lost in transit. Sequence TCP transmits data packets in the same sequence as received. In case data packets are arriving in the wrong order, TCP reorders them and delivers in the correct order. In case of UDP, messages sent in a particular sequence may or may not be maintained while delivering the host. Therefore, the sequence or order in which packets will be transmitted is unpredictable. Connection A TCP connection is heavyweight, and it requires almost three packets for an appropriate socket connection and handles the congestion control and reliable delivery. UDP connection, on the other hand, is lightweight and transports layers designed over a particular IP. No connections are tracking or ordering of messages. Data Streaming Transmission Control Protocol reads data as streams of bytes, and the message is transmitted to segment boundaries. UDP messages contain packets that were sent one by one and are checked for integrity at the time of arrival.
  • 4. Transfer Speed The speed of TCP is slower as compared to UDP as it checks for errors and retransmits the packets. Header Size TCP’s size of the header is 20 bytes, whereas, UDP is 8 bytes. However, they have common header fields that are, source point, destination point, and checksum.
  • 5. 8 bits equal 1 byte. TCP headers appear in the following sequence, beginning with the source and destination communication endpoints: • Source TCP port number (2 bytes or 16 bits): The source TCP port number represents the sending device. • Destination TCP port number (2 bytes or 16 bits): The destination TCP port number is the communication endpoint for the receiving device. • Sequence number (4 bytes or 32 bits): Message senders use sequence numbers to mark the ordering of a group of messages. • Acknowledgment number (4 bytes or 32 bits): Both senders and receivers use the acknowledgment numbers field to communicate the sequence numbers of messages that are either recently received or expected to be sent. • TCP data offset (4 bits): The data offset field stores the total size of a TCP header in multiples of four bytes. A header not using the optional TCP field has a data offset of 5 (representing 20 bytes), while a header using the maximum-sized optional field has a data offset of 15 (representing 60 bytes).
  • 6. • Reserved data (3 bits): Reserved data in TCP headers always has a value of zero. This field aligns the total header size as a multiple of four bytes, which is important for the efficiency of computer data processing. • Control flags (up to 9 bits): TCP uses a set of six standard and three extended control flags—each an individual bit representing On or Off—to manage data flow in specific situations. • Window size (2 bytes or 16 bits): TCP senders use a number, called window size, to regulate how much data they send to a receiver before requiring an acknowledgment in return. If the window size is too small, network data transfer is unnecessarily slow. If the window size is too large, the network link may become saturated, or the receiver may not be able to process incoming data quickly enough, resulting in slow performance. Windowing algorithms built into the protocol dynamically calculate size values and use this field of TCP headers to coordinate changes between senders and receivers. • TCP checksum (2 bytes or 16 bits): The checksum value inside a TCP header is generated by the protocol sender as a mathematical technique to help the receiver detect messages that are corrupted or tampered with. • Urgent pointer (2 bytes or 16 bits): The urgent pointer field is often set to zero and ignored, but in conjunction with one of the control flags, it can be used as a data offset to mark a subset of a message as requiring priority processing. • TCP optional data (0 to 40 bytes): Usages of optional TCP data include support for special acknowledgment and window scaling algorithms. UDP Header Format Because UDP is limited in capability compared to TCP, its headers are smaller. A UDP header contains 8 bytes, divided into the following four required fields:
  • 7. • Source UDP port number (2 bytes): The source UDP port number represents the sending device. • Destination UDP port number (2 bytes): The destination UDP port number is the communication endpoint for the receiving device. • Length of data (2 bytes): The length field in UDP represents the total size of each datagram, including both header and data. This field ranges in value from a minimum of 8 bytes—the required header size—to sizes above 65,000 bytes. • UDP checksum (2 bytes): Similar to TCP, a UDP checksum allows receivers to cross-check incoming data for any corrupted bits of the message. Usage by Other Protocols Use by other protocols FTP, SMTP, HTTP, HTTPs, Telnet use TCP Protocols, and UDP protocols are used by TFTP, SNMP, DNS, DHCP, RIP, VOIP. Detection of Errors Transmission Control Protocol detects errors via checksum and performs error recovery. If any of the packets are erroneous, they do not get acknowledged by the receiver, which in turn triggers re-transmission by host/sender. This mechanism is known as PAR (Positive Acknowledgement with Retransmission). Since TCP is slower than UDP, TCP is appropriate for applications that do not require high speed or longer period took for transmission is not a constraint. Regarding error detection and error recovery, UDP works on a best effort basis. This protocol also supports error detection. However, the erroneous packets detected by checksum are discarded. UDP does not attempt to retransmit packets. The reason UDP does not attempt retransmission of packets is that this protocol is commonly used for time-sensitive applications such as voice transmission, gaming, etc. Hence, recovery attempt would be of no point as by the time retransmission takes place, and the packets are received, they will be of no use.