Different TCP and UDP

download Different TCP and UDP

of 1

Transcript of Different TCP and UDP

  • 8/11/2019 Different TCP and UDP

    1/1

    Difference between TCP and UDP Protocol

    TCP(Transmission Control Protocol). TCP is aconnection-oriented protocol, a connectioncan be made from client to server, and from

    then on any data can be sent along thatconnection.

    UDP(User Datagram Protocol). A simplermessage-based connectionless protocol. WithUDP you send messages(packets) across the

    network in chunks .

    Reliable when you send a message along aTCP socket, you know it will get there unless theconnection fails completely. If it gets lost alongthe way, the server will re-request the lost part.This means complete integrity, things dont getcorrupted.

    Unreliable When you send a message, youdont know if itll get there, it could get lost onthe way.

    Ordered if you send two messages along aconnection, one after the other, you know thefirst message will get there first. You dont have

    to worry about data arriving in the wrong order.

    Not ordered If you send two messages out,you dont know what order theyll arrive in.

    Heavyweight when the low level parts of theTCP stream arrive in the wrong order, resendrequests have to be sent, and all the out ofsequence parts have to be put back together, sorequires a bit of work to piece together.

    Lightweight No ordering of messages, notracking connections, etc. Its just fire andforget! This means its a lot quicker, and thenetwork card / OS have to do very little work totranslate the data back from the packets.

    O v e r v i e w o f T CP a n d U D P

    TCP (Transmission Control Protocol) is the most commonly used protocol on the Internet.The reason for this is because TCP offers error correction. When the TCP protocol is used there

    is a guaranteed delivery. This is due largely in part to a method called flow control. Flowcontrol determines when data needs to be re-sent, and stops the flow of data until previous

    packets are successfully transferred. This works because if a packet of data is sent, a collisionmay occur. When this happens, the client re-requests the packet from the server until the whole

    packet is complete and is identical to its original.

    UDP (User Datagram Protocol) is anther commonly used protocol on the Internet. However,UDP is never used to send important data such as web pages, database information, etc; UDP iscommonly used for streaming audio and video. Streaming media such as Windows Media audiofiles (.WMA) , Real Player (.RM), and others use UDP because it offers speed! The reason UDP

    is faster than TCP is because there is no form of flow control or error correction. The data sentover the Internet is affected by collisions, and errors will be present. Remember that UDP is only concerned with speed. This is the main reason why streaming media is not high quality.