Oh man, you're digging a deeper hole for yourself.

There's the OSI model, and there's the Internet Protocol Suite (IPS). The former has 7 layers, all kinds of protocols for those layers, isn't currently used by any major OS, and neither used IP nor TCP (although both protocols are sometimes retrofitted in the OSI model). IPS has four layers: link layer, internet layer, transport layer and application layer. On each of those layers, there are many protocols. TCP is a protocol on the transport layer. IP is a different protocol on a different layer.

Think about it. If TCP/IP would be a layer, surely UDP/IP would be a different layer. Which layer would it be? Above or below the TCP/IP layer?

Transport means move bits from point A to B
Wrong. Both in the OSI and in the IPS models. Moving bits around in the OSI model is the task of the Physical Layer, while in the IPS model, it is the task of the Link Layer (with protocols like Ethernet and ISDN, and many more). But note that some of the tasks of the IPS Link Layer are found in the Data Link Layer of the OSI model.

TCP belongs in the Transport Layer (layer 3), which provides end-to-end communication. In the OSI model, this would correspond to the similary named Transport Layer (layer 4), but TCP also does some of the tasks found in the Session Layer (layer 5) of OSI (but not all of it - part of the tasks of the Session Layer are not found in the IPS model). IP on the other hand is found in the layer that does routing, and end-to-end delivery of datagrams. For the IPS model, this is the Internet Layer (layer 2), which corresponds to the Network Layer (layer 3) in the OSI model.

Please, stop confusing protocols and layers.


In reply to Re^6: How to build a tcp session with a remote server? by JavaFan
in thread How to build a tcp session with a remote server? by wildnature

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.