简体   繁体   中英

Need of raw socket in network

What is the need of a raw socket. Apart from TCP and UDP when I want to use raw socket. The main difference is headers. In raw socket we create our own header. What is the use of that. And why ping and traceroute use raw sockets. What is the problem arrives if it use TCP or UDP.

ping uses icmp which is specifically designed for network diagnosis, error reporting etc. which isn't for data transfer. That is one of the reason why ping uses icmp . It also doesn't require connection to be established between hosts. And doesn't require any server program to listen for any request.

Which packet traceroute uses is mostly implementation specific. But Linux version of traceroute does use packet other than ICMP like UDP or TCP SYNC packets.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM