“socket"系统调用中的“SOCK_RAW"选项 [英] 'SOCK_RAW' option in 'socket' system call

查看:92
本文介绍了“socket"系统调用中的“SOCK_RAW"选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是套接字编程的新手,并在 Linux 机器 (ubuntu) 上尝试使用它我无法理解选项SOCK_RAW"并想了解它.'socket' 系统调用中的 'SOCK_RAW' 选项有何意义?

I am new to socket programming and trying my hand on it on Linux machine (ubuntu) I am unable to understand the option 'SOCK_RAW' and want to learn about it. What is the significance of the 'SOCK_RAW' option in 'socket' system call ?

推荐答案

Raw 模式基本上允许您绕过计算机处理 TCP/IP 的某些方式.您只需将数据包传递给需要它的应用程序,而不是通过内核上的 TCP/IP 堆栈执行的常规封装/解封装层.没有 TCP/IP 处理——所以它不是一个处理过的数据包,它是一个原始数据包.使用数据包的应用程序现在负责剥离报头、分析数据包以及内核中的 TCP/IP 堆栈通常为您做的所有事情

Raw mode is basically there to allow you to bypass some of the way that your computer handles TCP/IP. Rather than going through the normal layers of encapsulation/decapsulation that the TCP/IP stack on the kernel does, you just pass the packet to the application that needs it. No TCP/IP processing -- so it's not a processed packet, it's a raw packet. The application that's using the packet is now responsible for stripping off the headers, analyzing the packet, all the stuff that the TCP/IP stack in the kernel normally does for you

了解更多信息

点击这里原始套接字手册页

你可以做一个很好的例子点击这里

you can fine a good example Click here

和教程点击这里

这篇关于“socket"系统调用中的“SOCK_RAW"选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆