Re: Why Ping Requires RAW Sockets?
Roy Smith <roy@panix.com> writes:
> There's nothing fundamental about the ICMP protocol which requires raw
> sockets. The fact that we use raw sockets is just an artifact of the
> commonly used Berkeley Socket API.
>
> A different API (for example, WinSock) could easily implement other ways to
> send ICMP packets which doesn't involve hand-crafting packets and sending
> them out a raw socket.
For fun, I implemented an ICMP ping API under the Berkeley socket
implementation supported by the NetWare TCP/IP stack way back when.
It was fun, but it's really pretty pointless to implement a general
API for something that's only going to be used by one, or maybe two
programs, ever... and the second program will probably be copied from
the first, anyway. Might as well put all the effort into the program
instead of the API.
-don provan
|