Results 1 to 7 of 7

Thread: a question with http ,udp and tcp

  1. #1
    Junior Member
    Join Date
    Oct 2001
    Posts
    6

    Thumbs up a question with http ,udp and tcp

    I was just told that http (www) use the tcp connection in the transport layer of osi,why? as we know the udp is much effective than tcp,why not use udp at layer 4.

  2. #2
    Senior Member
    Join Date
    Sep 2001
    Posts
    412
    Holy ****! why didn't i think of that? I mean, udp - also known as "the connectionless protocol" is much more effective than tcp. Somebody phone the internet engineering task force - quick!

    Appendage:
    I seem to be getting a lot of negative feedback to this post via the antipoints thing - maybe i should explain: I have a lot of respect for the pioneers of the internet, imho, they put a lot of time and effort into this and i would *never* question any of thier ideas - these guys know a lot more than (most of) you or i will ever know. Maybe i was a little curt but a little flame never hurt anyone now did it?

  3. #3
    Senior Member
    Join Date
    Oct 2001
    Posts
    175
    rainman

    You should probably be careful how you word some posts, its easy to get flamed that way..

    The reason TCP is used in these situations is because TCP is a connection oriented protocol which means that it establishes a connection with the host and guarantees that the packets are delivered without error. If it used UDP then there would be no gaurantee that the information reached its host without error or even reached its host at all.

    I hope this helps to shed a little light on the subject!
    Simon Templer

    \"Your work is to discover your world and then with all your heart give yourself to it. \"
    -The Buddha

  4. #4
    Junior Member
    Join Date
    Oct 2001
    Posts
    6
    but the guarantees that the packets are delivered without error can be done well by the browser and server.if a packet has error the browser can detect it and ask the server resend.when i study network protocol,i was told that the guarantees of udp packets can achieve by application layer(7 layer).

  5. #5
    Banned
    Join Date
    Aug 2001
    Location
    Yes
    Posts
    4,424
    Originally posted by Rainman
    but the guarantees that the packets are delivered without error can be done well by the browser and server.if a packet has error the browser can detect it and ask the server resend.when i study network protocol,i was told that the guarantees of udp packets can achieve by application layer(7 layer).
    As stated already, this is due to the difference between connection oriented and connection less protocols.

    The choice between UDP or TCP is the developer's choice: speed, or reliability? HTTP is a TCP protocol because it depends on the (lack of) reliability of the communicationlines between browser and webserver. It is true that a browser is capable of detecting errors in the packets, but if HTTP would be an UDP protocol, the net would be polluted by resends...

    It's not the Application Layer that is capable of errorchecking, i.e. your browser is not a layer 7 'application'. Layer 7 is the interface between the application (your browser) and the networking services. The error checking concerning TCP takes place in the Transport Layer (layer 4), while errors with UDP-packets are not detected until your application receives them...

  6. #6
    Junior Member
    Join Date
    Oct 2001
    Posts
    6

    Smile

    i understand it ,thank you!

  7. #7
    The most beautiful example for that is the TFTP protocol.

    TFTP (Trivial File Transfert Protocol) is a really simple protocol used to fetch file (generally boot code or config) from one server to a client.

    As those client are generally terminals or routers (or something else) and that in the antic ages, ROM/EPROM memory was quite expensive, the code must be short, that's wht they choose UDP.

    But ... as you are transfering binaries, you must ensure that the packet were not modified or no missing stuff or so on.

    So, they rewrite a "TCP emulation" with UDP packet!

    The application must ensure that packet are receipted in order, with no missing one and so on. Lots ot treatments to make and lots of case to predict ...

    But Negative is true, it's the author very own choice, based on the importance of data, and the scope of utilisation (only LAN, or WAN, or maybe a mixed possibility ...)

    Jean-Francois

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •