1. TCP(Transmission Control Protocol)

연결형 방식입니다. 확실한 전송 보장을 합니다. 따라서 보장성 전송 방식이라 볼 수 있겠습니다. 당연히 이를 위해 수속이나 처리 과정이 복잡하여 목적지 확인, 흐름 제어, 전송 순서 확인, 오류 제어 등의 기능이 있습니다. 그래서 UDP보다는 느리지만 전송의 확실성 때문에 많이 사용하고 있습니다

 

2. UDP(User Datagram Protocol)

비연결형 방식입니다. 데이터를 보낼 때 확실하게 전송이 되었는지에 대해서는 책임을 지지 않는다는 말입니다. 비 보장성 전송방식이란 의미도 되겠습니다. 이렇게 불안하게만 보이는 통신 방식을 사용하는 이유는 확실한 전송을 위한 수속이나 처리를 생략하여 부담을 줄이고 속도를 증가시킬 수 있기 때문입니다.

 

3. 비교

 

TCP

UDP

Stands for:

Transmission Control Protocol

User Datagram Protocol or Universal Datagram Protocol

Type of Connection:

It is a connection oriented protocol

It is a connection less protocol

Usage:

TCP is used in case of applications in which fast transmission of data is not required

UDP is preferred in case of the applications which have the priority of sending the data on time and on faster rates

Examples:

HTTP, FTP, SMTP Telnet etc

DNS, DHCP, TFTP, SNMP, RIP, VOIP etc

Ordering of data packets:

It rearranges data packets in the order specified

No inherent ordering, the data packets of same message may be ordered differently

Speed of transfer:

Comparatively slow

Comparatively fast

Reliability:

Reliable (defines that data will be definitely sent across)

Unreliable

Header Size:

TCP header size is 20 bytes

UDP Header size is 8 bytes

Fields:

1. Sequence Number, 2. AcK number, 3. Data offset, 4. Reserved, 5. Control bit, 6. Window, 7. Urgent Pointer, 8. Options, 9. Padding, 10. Check Sum, 11. Source port, 12. Destination port.

1. Length, 2. Source port, 3. Destination port, 4. Check Sum.

Streaming of data:

Data is read as a byte stream, thus no distinguishing indications are transmitted to the signal message

Packets are sent individually and after the arrival the packets are rearranged

Weight:

It is heavier as it requires three packets to set up a socket connection, before any user data can be sent. TCP handles reliability and congestion control.

UDP is lightweight due to no ordering of messages, no tracking connections, etc.

Data Flow Control:

TCP controls the flow of data

 

UDP does not have an option for flow control