TCP Vs UDP
PROTOCOL:
Set Of Rules = Protocol’s
The Protocol Which is Used to Communicate the Devices
There Are 2 Communication Protocols Are
1. TCP (Transmissions Control Protocol)
2.UDP (User Datagram Protocol)
TCP (Transmission Control Protocol)
It Is a Communication Protocol Which Is Used to Transfer Data / Between Devices and Network
The TCP Will Make a Connection Process Between Two Devices Before Transferring Between Them
TCP 3-WAY HANDSHAKE
HOST A HOST B
| -> SYN PACKET |
| SYN+ACK PACKET<- | [ DATA TRANSFER BETWEEN 2 DEVICES]
| -> ACK PACKET | [ BIDIRECTIONAL]
[CONNECTED SUCESSFULLY]
TCP FLAGS
There Are 6 TCP Flags
1. SYN: SYNCHRONISE
2. ACK: ACKNOWLEDGMENT
3. FIN: FINISH
4. RST: RESET
5. URG: URGENT
6. PSH: PUSH
WHAT ARE THESE TCP FLAGS?
A TCP FLAG IS USED TO DETERMINE A TYPE OF DATA OR A TYPE OF REQUEST
SENT FROM SYSTEM TO SYSTEM USING TCP CONNECTION
SYN: The Flag Is Used for Request for a Connection
ACK: The Flag Is Used to Acknowledgment to Receive A-Data (Approving or Accepting)
FIN: This Flag Is Used to End a Connection After a Data Transfer
RST: This Flag Is Used to Abort a Connection
URG: This Flag Is Used to Process the Data Immediately
PSH: The Flag Is Used to Send Data from Buffer Immediately
TCP 3-WAY HANDSHAKE MAKES A CONNECTION
TCP 4 -WAY HANDSHAKE ENDS A CONNECTION
TCP 4 WAY HANDSHAKE
HOST A HOST B
| -> SYN PACKET |
| SYN+ACK PACKET<- | [ PARTIALLY DATA TRANSFERRED BETWEEN 2 DEVICES]
| <- FIN PACKET | [ SINGLE — DIRECTIONAL]
| -> ACK PACKET |
[CONNECTION ENDED, DISCONNECTED]
ADVANTAGES IN TCP
1. In TCP Communication 100% Of the Data Is Transferred
2. In TCP Communication Protocol Order of Data Is Maintained
Example: Uses in Text Message Sending Files, Uploading Files
UDP (User Datagram Protocol)
Only Receives from a Device
Not A Bidirectional for a Data Transfer
DATA TRANSFERRED ONLY IN 1 DEVICE
1.NO FLAGS IN UDP
2NO HANDSHAKE IN UDP
In UDP 100% Of Data Is Not Possible
Due To No Handshake and Order Is Not Proper
1.NO 100% Of Data Is Transferred
2.No Order Is Managed
3.No Flags
4.No Handshake
5. Single Direction Only
Example : Games, Video Calling, Audio Calling
Satellite Communication
GAMES — PUBG — TPP (Can’t See Full Image)
Video Calling — Exact Image Is Not Seen