locked
How will I choose a transport among tcp and HTTP? RRS feed

  • Question

  • Can someone teach me this since I really can not find a resource from the net to clarify it.

    As far as I know, the TCP stays on the transport layer while the HTTP stays on the application layer, which, to my understanding, a higher layer than TCP. So will the HTTP need the TCP provide a service to it in order to transfer its message to other computers? Or, is it true that while you are using a HTTP and there will be no TCP needed and the HTTP will work perfectly with IP?


    Tony Zeng qzcbs@163.com
    Thursday, July 28, 2011 8:42 AM

Answers

  • Http uses tcp (it actually uses TCP/IP) to transport the message. The thing that makes HTTP an application protocol is the use of textual headers and the way they are parsed on the server side.

    HTTP is used mostly in internet and intranet environment and is very interoperable, whereas when you work with TCP you need to create your own "protocol" to talk between applications - that is why tcp endpoints are less interoperable.


    Please mark posts as answers/helpful if it answers your question. Senior Consultant on WCF, ASP.NET, Siverlight, and Entity Framework. Author of Microsoft's Official WCF 4 Course. Co-author of the Microsoft HPC/Azure burst whitepaper. Visit my blog: http://blogs.microsoft.co.il/blogs/idof
    • Marked as answer by Tony Zeng Friday, July 29, 2011 7:23 AM
    Thursday, July 28, 2011 8:37 PM
  • HTTP has more overhead than TCP, correct.

    And wsHttpBinding has more overhead too over basicHttpBinding because it uses more ws-* soap headers.


    Please mark posts as answers/helpful if it answers your question. Senior Consultant on WCF, ASP.NET, Siverlight, and Entity Framework. Author of Microsoft's Official WCF 4 Course. Co-author of the Microsoft HPC/Azure burst whitepaper. Visit my blog: http://blogs.microsoft.co.il/blogs/idof
    • Marked as answer by Tony Zeng Saturday, July 30, 2011 5:51 AM
    Friday, July 29, 2011 7:31 AM

All replies

  • Http uses tcp (it actually uses TCP/IP) to transport the message. The thing that makes HTTP an application protocol is the use of textual headers and the way they are parsed on the server side.

    HTTP is used mostly in internet and intranet environment and is very interoperable, whereas when you work with TCP you need to create your own "protocol" to talk between applications - that is why tcp endpoints are less interoperable.


    Please mark posts as answers/helpful if it answers your question. Senior Consultant on WCF, ASP.NET, Siverlight, and Entity Framework. Author of Microsoft's Official WCF 4 Course. Co-author of the Microsoft HPC/Azure burst whitepaper. Visit my blog: http://blogs.microsoft.co.il/blogs/idof
    • Marked as answer by Tony Zeng Friday, July 29, 2011 7:23 AM
    Thursday, July 28, 2011 8:37 PM
  • Thank you very much. You answered exactly what I'm searching for.

    So the overhead to the HTTP endpoint will be bigger than TCP, especially WsHTTPBinding, right?


    Tony Zeng qzcbs@163.com
    Friday, July 29, 2011 7:22 AM
  • HTTP has more overhead than TCP, correct.

    And wsHttpBinding has more overhead too over basicHttpBinding because it uses more ws-* soap headers.


    Please mark posts as answers/helpful if it answers your question. Senior Consultant on WCF, ASP.NET, Siverlight, and Entity Framework. Author of Microsoft's Official WCF 4 Course. Co-author of the Microsoft HPC/Azure burst whitepaper. Visit my blog: http://blogs.microsoft.co.il/blogs/idof
    • Marked as answer by Tony Zeng Saturday, July 30, 2011 5:51 AM
    Friday, July 29, 2011 7:31 AM