创建 RAW 套接字教程/解释?
因此,我试图进一步加深对套接字的理解,但我想首先从最低级别开始(最好是 C 语言,而不是汇编,哈哈)
但是我处理的大多数站点都使用 SOCK_STREAM 或 SOCK_DGRAM。不过我已经阅读了 Beejs 指南......但我不知道这是否真的涉及 RAW 套接字。
显然,我需要在调用套接字时调用 SOCK_RAW,但它们并没有真正提供有关它的大量信息。这只是出于学习目的,我总是试图理解抽象中发生的事情的根源。
谢谢
So Im trying to further my understanding of sockets, but I want to start out at the lowest level first (well in C, not assembly lol)
However most sites that I deal with use the SOCK_STREAM or SOCK_DGRAM. However I have read around on Beejs guide....but I don't know if that actually deals with RAW sockets or not.
I'll obviously need to call SOCK_RAW in my call to sockets, but theirs not really a WHOLE lot of information about it. And this is just for learning purposes, i always try to understand the root of whats going on in abstraction.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您使用的是 Linux,我会查看 socket 和 packet 作为开始。从这里开始,阅读其他一些手册页,了解如何实际发送数据包电线,我会安装 Wireshark 并尝试发送手工制作的数据包并使用 Wireshark 捕获和分析它们。通过这种方式,您可以了解很多有关不同网络层的信息,以及如何调整各种标头中的不同值。
Assuming you're using Linux, I would look at the man pages for socket and packet as a start. From here and after reading a few other man pages to figure out how to actually send packets on the wire, I'd install Wireshark and experiment with sending hand-crafted packets and using Wireshark to capture and analyze them. You can learn a lot about the different network layers this way and how you can tweak different values in various headers.