What is the difference of UDP & TCP

TCP နဲ့ UDP ဘာ ကွာသလဲ?
OSI model မှာ ဘယ် layer သုံးကြသလဲ?
အသုံးများတဲ့ TCP, UDP ဆားဗစ် protocol ကို (port number နဲ့ တကွ) ပြော ပြပါ။

Comments

  • TCP
    TCP guarantees the recipient will receive the packets in order by numbering them. The recipient sends messages back to the sender saying it received the messages. If the sender does not get a correct response, it will resend the packets to ensure the recipient received them. Packets are also checked for errors. TCP is all about this reliability — packets sent with TCP are tracked so no data is lost or corrupted in transit. This is why file downloads do not become corrupted even if there are network hiccups. Of course, if the recipient is completely offline, your computer will give up and you will see an error message saying it can not communicate with the remote host.

    UDP

    UDP stands for User Datagram Protocol — a datagram is the same thing as a packet of information. The UDP protocol works similarly to TCP, but it throws all the error-checking stuff out. All the back-and-forth communication and deliverability guarantees slow things down.

    When using UDP, packets are just sent to the recipient. The sender will not wait to make sure the recipient received the packet — it will just continue sending the next packets. If you are the recipient and you miss some UDP packets, too bad — you can not ask for those packets again. There is no guarantee you are getting all the packets and there is no way to ask for a packet again if you miss it, but losing all this overhead means the computers can communicate more quickly.

    UDP is used when speed is desirable and error correction is not necessary. For example, UDP is frequently used for live broadcasts and online games.

    TCP and UDP use transport layer.

    Port # Portocol Description
    23 TCP, UDP Telnet protocol - unencrypted text communications
    25 TCP, UDP SMTP (Simple Mail Transport Protocol) - used for e-mail routing between mailservers
    26 TCP, UDP RSFTP - A simple FTP-like protocol
    35 TCP, UDP QMS Magicolor 2 printer
  • Key Differences Between TCP and UDP

    1.TCP is Connection-oriented whereas, UDP is Connectionless protocol.
    2. TCP is highly reliable for transferring useful data as it takes the acknowledgment of information sent. And resends the lost packets if any. Whereas in the case of UDP if the packet is lost it won’t request for retransmission and a corrupt data is received by the destination computer. So, UDP is an unreliable protocol.
    3. TCP is slower as compared to UDP since TCP establishes the connection before transmitting data, and ensures the proper delivery of packets. On the other hand, UDP does not acknowledge whether the data transmitted is received or not.
    4. Header size of UDP is 8 bytes, and that of TCP is more than double. TCP header size is 20 bytes since, and TCP header contains options, padding, checksum, flags, data offset, acknowledgment number, sequence number, source and destination ports, etc.
    5. Both TCP and UDP can check for errors, but only TCP can correct the error since it has both congestion and flow control.

    TCP and UDP use transport layer.


    Port # Portocol Description
    23 TCP, UDP Telnet protocol - unencrypted text communications
    25 TCP, UDP SMTP (Simple Mail Transport Protocol) - used for e-mail routing between mailservers
    26 TCP, UDP RSFTP - A simple FTP-like protocol
    35 TCP, UDP QMS Magicolor 2 printer.
  • edited June 11

    TCP နဲ့ UDP တွေဟာ bits of data (Packet) တွေကို Internet ပေါ်မှာ ပို့တဲ့အခါမှာ သုံးတဲ့ Protocol တွေဖြစ်တယ်
    ပြောရရင် packet တစ်ခုကို UDPor TCP သုံးပြီး ​ပို့လိုက်တဲ့အခါ အဲ့ packet က IP address ဆီကို
    ရောက်သွားတယ် ပြီတော့ပြန်ရောက်လာတယ် ကြားမှာ router သုံးပြီးဖြစ်ဖြစ်ပေါ့

    TCP (Transmission Control Protocol)
    Tcp က Connection oriented protocol ဖြစ်ပြီး error recovery နဲ့ retransmission build in ပါတယ်။Segement ကိုသုံးတယ်။TCP connection က Telephone connection နဲ့တူတယ်ပြောလို့ရတယ်။Guaranteed message delivery လိုတဲ့ application protocolတွေမှာ TCP ကိုသုံးတယ်။
    HTTP,FTP, SMTP, POP3, IMAP4 နဲ့အခြား Internet application protocols တွေမှာ TCP ကိုသုံးတယ်။

    UDP (User Datagram Protocol )
    UDP က Connection less protocolဖြစ်တယ်။
    Datagram ကိုသုံးတယ်။သူက email ပို့တာနဲ့တူတယ်။ Message/Email ကတော့ပို့လိုက်တာပဲ၊ ရောက်မရောက်ကတော့မသိနိုင်ဘူး။ UDP က message ကို recover မလုပ်ပေးဘူး၊ correct မလုပ်ပေးဘူး။ erroe detection and recovery လုပ်ဖို့က လက်ခံလိုက်တဲ့ applicationရဲ့ တာဝန်ဖြစ်တယ်ပေါ့။
    UDP က TCP ထက်မြန်တယ်၊ metwork traffic လဲနည်းတယ်။ receiving machine ရဲ့ resources တွေကိုလဲမသုံးဘူး‌။
    UDP ကို အသုံးများတဲ့ application တွေက DNS, DHCP, RIP တွေပါ။

    TCP and UDP Headers
    The UDP header (8 bytes) က the TCP header (20 bytes) ထက်‌တော်တော် ငယ်တယ်။. UDP နဲ့ TCP header နှစါခုလုံးက 16 bit source နဲ့ destination Port fields တွေပါဝင်တယ်ပေါ့။
    The source port field ကိုreply message တဲ့အခါသုံးတယ်။ .
    There is a good diagram of both headers here(https://nmap.org/book/tcpip-ref.html)

    TCP and UDP ports
    TCP and UDP protocols နှစ်ခုလုံးports ကိုသုံးတယ် ။သင့် Computer/Mobile တွေပေါ်မှာလည်း TCP port 80 ကိုသုံးနေတဲ့ application တွေရှိသလို UDP port 80 ကိုသုံးနေတဲ့ application တွေလဲ ရှိနေပါတယ်။
    ref http://www.steves-internet-guide.com/tcp-vs-udp/
    ///////////////////////////////////////////////////////////

    OSI model မှာ
    Host Layer(Application ,Presentation ,Session , Transport) နဲ့
    Media Layer(Network ,Data ,Physical)
    တွေသုံးကြတယ်။
    ///////////////////////////////////////////////////////////

    There are many wellknown TCP/UDP ports like HTTP,SSH,FTP,DNS,POP3S,POP3,HTTPS,TELNET,SNMP etc..
    You can check list of TCP/UDP port number list here..
    https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers

  • TCPက connection orientedျဖစ်တယ်
    သူ့ရဲ့speedက နွေးတယ်
    highly reliableျဖစ်တယ်
    Segment sequencing
    Acknowledge sequencing
    TCP header က20bytesျဖစ်ပြီး
    UDP headerက 8bytesျဖစ်တယ်
    UDPက connection less
    သူ့ရဲ့speedကျမန်တယ်
    unreliableျဖစ်တယ်
    No sequencing
    No acknowledgement
    TCP & UDPက transport layerမွာသုံးတယ်
  • The difference between TCP and UDP:
    TCP
    -connection oriented.
    -require acknowledgement.
    -reliable data
    -sequencing
    UDP
    -connectionless.
    -does not use acknowledgement .
    -a few loss datagram.
    -very lightweight.
    In OSI model, TCP and UDP are used in transport layer.
    Message send protocol is used port 18 in TCP and UDP.
    FTP(data port ) is used port 20 and FTP (control port) is used port 21.
    SSH is used port 22.
    DNS is used port 53 in TCP and UDP.
  • Differences between TCP and DUP

    TCP
    -reliable
    -connection oriented
    -segment retransmission and flow control through windowing
    -segment sequence
    -required acknowledge

    UDP
    -unreliable
    -connection_less
    -no windowing or retransmission
    -no sequence
    -no acknowledge

    TCP and UDP use in transport layer of OSI model.

    The most use TCP and UDP protocol

    Protocol port description
    TCP/UDP 18 message
    send protocol
    TCP 20 FTP (data port)
    TCP 21 FTP(Control port)
    TCP/UDP 22 SSH(login),file
    transfer (scp,sftp)
    TCP/UDP 23 Telnet
    TCP/UDP 25 SMTP
    TCP/UDP 53 DNS
    TCP 57 MTP
    TCP 80 HTTP
    TCP 102 ISO
    TCP 109 POP 2
    TCP 110 POP 3(Post
    office protocol)
    TCP 115 SFTP
    TCP 465 SMTP
    over SSL
  • Two type of internet protocol (IP) traffic
    -TCP(transmission control protocol)
    -UDP(user datagram protocol)

    TCP
    -is oriented
    -once a connection is established
    -data can be sent bidirection
    -protocol used by device to comnunicatie over internet and local network
    -apps a way to deliver an ordered and error-checked stream of information

    UDP
    -is simpler,cinnectionless interner protocol
    -multiple message are sent as packețss
    -apps to deliver a faster stream by doing with error-checking
  • edited June 11
    TCP
    -secure
    -connection-oriented
    -slow
    -guaranteed transmittion
    -use bye critical applications
    -Packet reorder mechanism
    -flow control
    -error checking
    -20 bits header
    -acknowledgement mechanism
    -three-way handshake

    UDP
    -unsecure
    -connectionless
    -fast
    -no guaranteed
    -use bye real-time applications
    -no reorder mechanism
    -no flow control
    -no error checking
    -8 bits header
    -ni acknowledgement
    -no handshake
    *******
    FTP use TCP 20,21
    SSH use TCp 22
    Telnet use tcp 23
    SMTP use tcp 25
    DNS use tcp/udp
    DHCP use udp 67,67
    HTTP use tcp 80
    PPO3 use tcp 110


    TCP and UDP are use in transport layer
  • Key Differences Between TCP and UDP

    1. TCP is Connection-oriented

    UDP is Connectionless protocol.

    2. TCP is highly reliable for transferring useful data as it takes the acknowledgment of information sent. And resends the lost packets if any.

    UDP if the packet is lost it won’t request for retransmission and a corrupt data is received by the destination computer. So, UDP is an unreliable protocol.

    3. TCP is slower as compared to UDP since TCP establishes the connection before transmitting data, and ensures the proper delivery of packets.

    UDP does not acknowledge whether the data transmitted is received or not.

    4. Header size of UDP is 8 bytes, and that of TCP is more than double.

    TCP header size is 20 bytes since, and TCP header contains options, padding, checksum, flags, data offset, acknowledgment number, sequence number, source and destination ports, etc.

    5. Both TCP and UDP can check for errors, but only TCP can correct the error since it has both congestion and flow control.

    Port #
    Portocol Description
    23 TCP, UDP Telnet protocol - unencrypted text communications

    25 TCP, UDP SMTP (Simple Mail Transport Protocol) - used for e-mail routing between mailservers

    26 TCP, UDP RSFTP - A simple FTP-like protocol

    35 TCP, UDP QMS Magicolor 2 printer

    TCP and UDP use transport layer.

  • TCP
    -lost ျဖစ္သြားတဲ့ packets ေတကို သိမ္းထားပီးေတာ့ resent ျပန္လုပ္ေပးပါတယ္
    -packets ေတကို sequence number ေတတပ္ေပးပါတယ္
    မွားပီးေရာက္သြားတဲ့ packets ေတကိုလည္း reorder လုပ္ေပးပါတယ္
    -အဲ့ဒီလို function ေတလုပ္ေပးတဲ့အတြက္
    အခ်ိန္ေတေတာ့ေႏွးပါတယ္
    -computer resources ေတအမ်ားႀကီးလိုအပ္ပါတယ္
    ဘာလို႔လဲဆိုေတာ့
    OS က ongoing commucation sessions ေတကို
    keep tracks လုပ္ဖို႔လည္းလိုအပ္သလို deeper level မွာ ongoing communication sessions ေတကို manageလုပ္ဖို႔အတြက္လည္းျဖစ္ပါတယ္
    -HTTP,HTTPS,FTP and many computer games ေတမွာ အသုးံျပဳပါတယ္

    UDP

    -lost ျဖစ္သြားတဲ့ packets ေတကို သိမ္းထားေပးျခင္းမရွိပါဘူး
    -arrival packets ရဲ႕ order ေတကို ထည့္မစဥ္းစားေပးပါဘူး
    -additional functionality ေတမရွိတဲ့အတြက္ သူရဲ႕ speed ကျမန္ပါတယ္
    -computer resource နည္းနည္းပဲလိုအပ္ပါတယ္
    -DNS,IP telephony,DHCP and many computer game ေတမွာ အသုးံျပဳပါတယ္


    TCP and UDP are use in transport layer
    Port# Protocol Description
    23 TCP,UDP Telnet protocol-unencrypted text communication
    25 TCP,UDP SMTP(Simple Mail Transfer Protocol)-used for e-mail routing between mailservers.
    26 TCP,UDP RSFTP -A Simple FTP-like protocol
    35 TCP,UDP QMS Magicolor 2 printer
  • tcp က connection-oriented protocol ပါ။
    udp က​တော့ connection-oriented protocol မဟုတ်​ပါဘူး။
    connection-oriented ဆိုတာက​တော့ host တစ်​ခု နဲ့ တစ်​ခု data ​တွေ​ပေးပို့ကြတဲ့ အချိန်​မှှာ reliable connection ကို provide လုပ်​တဲသ​ဘောပါ။
    tcp ကိုသုံးပြီး host တစ်​ခုနဲ့တစ်​ခု data ​တွေ​ပေးပို့ကြတဲ့ အခါ data ​တွေကို ဆုံးရှုံးမှုမဖြစ်​​အောင်​ tcp က ထိန်​းသိမ်​း​ပေးတယ်​။ HostA က​နေ HostB ကို packet တစ်​ခုပို့လိုက်​တယ်​ ဆိုပါစို့... HostB က အဲ့ဒီပို့လိုက်​တဲ့ Packet လက်​ခံရရှိ​ကြောင်​းကို confirm လုပ်​တဲ့ packet တစ်​ခုကို HostA ဆီကိုပြန်​ပို့ရပါတယ်​။ အဲ့ဒီ Packet ကို​တော့ acknowledgement packet လို့​ခေါ်ပါတယ်​။ ဆို​တော့ကာ Reliable ဖြစ်​တဲ့သ​ဘော​ပေါ့။ တစ်​​ခုခု ပို့​လိုက်​ပြီဆို Data ဆုံးရှုံးမှု နည်​းတာ​ပေါ့။

    ​နောက်​တစ်​ခု UDP ကကြ​တော့ connectionless protocol ပါ။ ပို့လိုက်​တဲ့ data ​တွေ ​ရောက်​​ရောက်​ မ​ရောက်​​ရောက်​ သူနဲ့ မဆိုင်​ဘူး၊ တာဝန်​မယူဘူး။ Ack packet လည်​း မလာဘူး။ Ack packet မလာ​တော့ bandwidth လည်​းသက်​သာတယ်​ မြန်​တယ်​။ ဒါ​ပေမဲ့ စိတ်​ချရမှု​တော့မရှိဘူး။

    tcp မှာကြ​တော့ စိတ်​ချရတယ်​ ဒါ​ပေမဲ့ တစ်​ဖက်​ကပြန်​လာမယ်​့ ack packet ကို ​စောင်​့​နေရလို့ အချိန်​ကြာမယ်​။ bandwidth များလို့ network က udp ထက်​​တော့​နှေးမယ်​။ ဒါ​ပေမ့ဲ Data ​တွေက စိတ်​ချရတယ်​။

    ဆို​တော့ TCP မှာလည်​း သူ့အားသာချက်​နဲ့သူ UDP မှာလည်​းသူ့အားသာချက်​နဲ့သူ ဆို​တော့ ဘယ်​ဟာက ပု​ို​ကောင်​းတယ်​ဆိုတာ​တော့ ​တရား​သေ ​ပြောလု့ိမရပါဘူး။

    အသုံးများတဲ့ Protocol နဲ့ port ​တွေက​တော့...

    telnet က tcp port 23
    ssh ----> tcp port 22
    ftp ----> tcp port 20,21
    smtp ----> tcp port 25
    http ----> tcp port 80
    https ----> tcp port 443

    tftp ----> udp 69
    dns ----> udp and tcp 53
    dhcp ----> udp 67 and 68

    လိုတာ​လေး​တွေလည်​း ဖြည်​့ကြပါအုံး။
Sign In or Register to comment.