解读Raw Socket

什么是Raw Socket呢?下面是来自wikipedia的解释:
 
In computer networking, a raw socket is a socket that allows direct access to packet's headers. Due to the fact that raw sockets allow users to craft packets' headers, their power can be abused to perform attacks such as IP address spoofing in hand with denial-of-service.
 
Raw Socket的最大特点就是允许用户自己定义packet header,如果这一功能被滥用,就可以被用来实现IP地址欺骗,以及DoS攻击。
 
Raw sockets are not a programming language-level construct, they are part of the underlying operating system's networking API. Most socket interfaces, especially those based on the Berkeley sockets, support them.
 
Raw Socket不是编程语言级别的标准构造,由OS里面的低层API支持,大多数的网络接口都支持Raw Socket。
 
Usually raw sockets receive packets containing the header, as opposed to standard sockets, which receive just the payload with the headers stripped for programmer's convenience. For outgoing packets, whether or not a header is automatically prepended is usually a raw socket's configurable option.
 
通过Raw Socket接收到的数据包带有包头,通过标准Socket只能接收到净载,通过Raw Socket发出数据时,要不要自动生成pocket header是可配置的。
 
Raw sockets are usually used on the network's transport layer or network layer.
 
Raw Socket通常用在传输层和网络层。

本文出自 “西蒙[爱生活,爱学习]” 博客,谢绝转载!

你可能感兴趣的:(socket,职场,raw,休闲)