Anonymous
9/13/2025, 7:30:30 AM
No.106571822
any networkphiles here? I'm trying to understand the full network stack & using raw sockets as I've only used stuff above layer 2 before. My main question at the moment is how linux fills out the sk_buff header when you are using a raw socket.
My understanding is that the header is filled in by whatever transmission protocol shit you're using like the IP stack, but in raw mode there is no stack to fill the header and you can't touch it from user space. you can set a flag such as no_hdr but I think that again is only filled in by the networking stack (and it's exclusive to TCP???). So you place all of your frame info, header+data into the data field directly and then what, how does linux know to extract the header from the data field and use it?
My understanding is that the header is filled in by whatever transmission protocol shit you're using like the IP stack, but in raw mode there is no stack to fill the header and you can't touch it from user space. you can set a flag such as no_hdr but I think that again is only filled in by the networking stack (and it's exclusive to TCP???). So you place all of your frame info, header+data into the data field directly and then what, how does linux know to extract the header from the data field and use it?