The Raw socket code can be viewed at this location. It is seen that the Raw socket does not bind or connect to the destination location. We use “sendto” API to send data to the destination IP address and use “recvfrom” API to receive data on the destination IP address. The socket is opened with […]
Raw Socket code with IPPROTO_TCP Protocol
The following code opens a raw socket with the IPPROTO_TCP L4 protocol. By opening such a socket connection, The TCP header now needs to be filled in by the application. The IPv4 header will still be filled by the Kernel on the packet send if IP_HDRINCL flag is not set via setsockopt API. The code […]
Analyzing TCP/UDP/IP headers for Raw Sockets
In this article, we look at certain aspects of TCP/UDP/IP headers which we would most likely be used in the coming example implementations for Raw socket for TCP/UDP protocols in this website. Kindly note that this article does not try to explain the TCP/UDP/IP headers in detail, but only tries to provide context to the […]
Raw Sockets – an Introduction (continued)
In the Previous article (Link here), we looked at how Raw sockets are invoked and how Raw sockets allow an application to directly access lower layer protocols or create it’s own L4 protocol on top of the IP layer. What does the above statement mean? We look at a diagram below (taken from the book […]
Raw sockets – an Introduction
Normally the TCP/UDP sockets provide an abstraction wherein the user of those sockets does not need to concern himself/herself with the TCP/IP or layer 2 headers. The data is provided to the socket with all the lower layer headers removed. But what if some one wished to tweak the IP headers themselves. If a developer […]