"When IP is using UDP/TCP to send packet, how about ICMP ? (ICMP's not using port)"

IP does not use UDP or TCP, but UDP and TCP use IP. In this sense, ICMP is just another TCP or UDP. This is about right, in the sense of their dependency on IP, but ICMP can also be think as a part of IP, and almost all IP implementation implements ICMP. Port is nothing but an identifier. IP address is the identifier used by IP, and UDP and TCP both added one level of addressing - the ports. ICMP uses the identifier that IP provides - the IP address.

"Where's the position of ICMP in TCP/IP layer?"

I assume that we are talking about the OSI layers. There is no TCP/IP layer, and they simply do not belong to the same layer. The IP is at the network layer, and TCP at the transport layer. Where is ICMP? Network layer, but not really at the same level as IP, actually as part of IP.


In reply to Re: Questions about socket raw, stream and socket programming by pg
in thread Questions about socket raw, stream and socket programming by doctor_moron

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.