It is my first time on sub TCP level and I have to perform some SYN/ACK exchanges "by hand" so with raw sockets and I am having some trouble understanding some fundamentals. I have 2 questions considering raw sockets SOCK_RAW and recvfrom() set like:
int s_raw = socket(AF_INET, SOCK_RAW , IPPROTO_TCP);
- Might sound obvious, but I'm going to be able to receive a specific packet, by calling
recvfrom()as long as the time-to-live value in the IP header is >0? Or better said once the ttl is zero I won't be able to get the packet anymore viarecvfrom(), right? - If I call
recvfrom()on different raw sockets ,initialized like above, I will get the packet from allrecvfrom()calls as long as the ttl is >0? Further applications (for which the packet was designated for) in the background of which I have no direct control of will still receive that package? So the packet is not lost or something else, just because I observe and ignore it on one specific socket instance?
EDIT: Thanks to @AnttiHaapala for reminding me that the result of these two questions might be operating system/kernel specific. I'm using Ubuntu Server ever since (always kept up to date - newest kernel). So I would be primarily interested in linux, but I would appreciate also some few lines about other operating systems.