Reputation: 21
This Question is about RAW SOCKETS. In the book it is given that received UDP and TCP packets are never passed to a raw socket and we cannot read the UDP and TCP headers in RAW SOCKETS and to read UDP and TCP header we should read it at "DATA LINK LAYER" .
I created a raw socket using "sfd=socket(AF_INET,SOCK_RAW,IPPROTO_UDP)" to test whether it will receive UDP packets are not and tried to print source port and destination port which are members of udp header. Program printing out the both ports i.e it's receiving UDP Packets and can read udp header.
I didn't understand what book really say's and what program is printing out . plzz help me where i am wrong.
I am working on ubuntu os.
Upvotes: 1
Views: 271