Linux内核中UDP数据包的路径 [英] Path of UDP packet in linux kernel
问题描述
我想在Linux内核中找到UDP数据包的路径.为此,我想阅读一些文档(我有此为止(这是针对TCP的),然后在相关的内核函数中包含一些printk语句来确认这一点.我将通过重新编译内核代码来做到这一点.
I want to find the path of a UDP packet in the Linux kernel. For this, I want to read up on some documentation ( I have this so far, which is for TCP) and then have some printk statements in the relevant kernel functions to confirm that. I will do this by recompiling the kernel code.
这是解决方法吗?您有什么建议/参考吗?
Is this the way to go about it? Do you have any suggestions/references?
推荐答案
Linux网络堆栈是内核的重要组成部分,您需要花一些时间来研究它. 我认为这本书可能会有所帮助(针对较早的内核2.4和2.6,但是对于最新的内核3.x而言,逻辑保持不变):
The linux networking stack is a big piece of the kernel and you need to spend some time studying it. I think that this books may help (Focused on older kernels 2.4 and 2.6, but the logic remain the same for the latest kernels 3.x):
Linux网络体系结构-网络协议的设计和实现在Linux内核中
您也可以签出此链接:
http://www.linuxfoundation.org/collaborate/workgroups/networking/kernel_flow
http://wiki.openwrt.org/doc/networking/praxis
http://www.ibm.com/developerworks/linux/library/l-linux-networking-stack/?ca=dgr-lnxw01lnxNetStack
http://gicl.cs.drexel.edu/people /sevy/network/Linux_network_stack_walkthrough.html
您还需要浏览内核源代码:
You need also to browse the kernel source :
http://lxr.linux.no/#linux+v3.7.3/
使用此功能开始通往网络子系统:
ip_rcv ,当数据包被调用时收到.
然后调用其他功能(ip_rcv_finish
,ip_local_deliver
和ip_local_deliver_finish
=>此功能负责选择良好的传输层)
Begin your road to the network sub-system with this function :
ip_rcv which is called when a packet is received.
other functions are then called (ip_rcv_finish
, ip_local_deliver
and ip_local_deliver_finish
=> This function is responsible for choosing the good transport layer)
这篇关于Linux内核中UDP数据包的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!