본문 바로가기
NETWORK

TCP & UDP Descriptions and Differences

by networker 2024. 3. 19.
728x90
반응형

In this session, we will learn about the concepts, operating principles, and differences of TCP & UDP among the protocols used in the network.

 

This part is also basic among the basics, so please understand it clearly.

 

 

1.   TCP (Transmission Control Protocol)

 

 

: Reliable protocols

 

It is called a reliable protocol because the connection is established through 3-way handling before communication, and the communication is also made through 4-way handling when terminating the connection.

 

 

★ 3-way handshaking

 

 

- Servers and Clients (Host A and Host B)

: When the client Host_A wants to communicate with Host_B, it does not just communicate, but connects through three steps.

 

1) Communicate with me (Send Syn): The client requests the server.

 

2) Yes! You should communicate with me (Syn / Send Ack): The server also responds, and asks the client to communicate.

 

3) OK (Send Ack): Client sends a good response to the server.

 

After these three steps, normal communication is achieved. This connected state is called a "session." In the state of the session, the data goes back and forth and communicates.

 

 

 

 

★ 4-Way Handshaking

 

 

- Servers and Clients (Host A and Host B)

: If the client Host_A wants to end the communication with

Host_B, follow four steps to make a communication connection.

 

 

1) Stop communicating with me (Send FIN): The client requests the server.

 

2) Yes! (Send Ark): Server sends response to client

 

3) You should stop communicating with me (send FIN): The server also asks the client to stop communicating.

 

4) Ok ok (send Akk): Client sends a good response to server

 

After these four steps, normal communication is lost. Since I'm doing it. TCP communications are reliable.

 

TCP is commonly used when enabling the Internet because it is as reliable as before, after, and after connections are complex.

 

 

 

2. UDP (User Datagram Protocol)

 

 

Unreliable Protocols

 

: As above, it does not go through 3 Way Handshaking / 4 Way Handshaking, so it cannot be checked even if the packet is lost or communication is not possible. Because of this, it is often used to send videos that do not require reliability.

 

 

 

 

3. Easy explanation of TCP & UDP differences

 

Let me give you an example.

 

Let's think there's a bunch of people in the office. Let me paraphrase the difference and explain TCP and UDP.

 

 

※ TCP

 

A postman brought a letter to the office, said to Jack in the office, and Mr. Jack received the letter and signed Jack that he had received it well. (Michael is the destination, letter is the packet).

 

Advantage - Jack always gets a letter - tells you he didn't get a letter without Jack (reliable)

 

Disadvantages - It takes a lot of time to get a letter and even sign it. (Slowly)

 

 

 

※ UDP

 

The mailman brought the letter, threw the letter in the office, and left it in the office (Michael is the destination, letter is the packet).

 

Advantage - I just throw a letter and leave right away.

(Speed Disadvantages - There is no way to check whether Jack received the letter well or not. (Untrusted)

 

If you understand by using metaphors like the above, you will easily understand the concept or difference of TCP & UDP.

 

Please make sure to fully understand 3 way-handshaking and 4 way-handshaking in TCP and move on to the next step.

 

 

 

 

 

저의 글을 읽어 주셔서 감사합니다. 오늘도 즐거운 하루 보내세요.

반응형