UDP are communication protocols, clarifying rules on how entities can communicate with each other. They are used over the
IP protocol which again defines the information a packet should have for its correct redirection to its destination
Check the structure of an IPv4 packet. Packet header information will be used by the midpoints for your packet to reach its destination. So on network layer there isn't the concept of
TCP and u cant really make a distinction out of them.
When you are using
UDP you will be encapsulating at the data section of the IP packet a
UPD packet with this structure and extra information, same goes for
TCP only this time the packet header carries a lot more information.
TCP header has a field with sequence number , this helps to enumerate packets that arrive out of order due to random delays each packet has been through or help for the retransmission of a lost packet
The extra information a
TCP header has ( 10 mandatory fields while UDP has 4) is utilized to create the concept of "connection" . In
TCP an established connection should provide reliable, ordered, and error-checked delivery of a stream of octets (bytes)