Simple raw socket server in C/C++ on Linux

24,908

There are various tutorials on the net which are relatively easy to find. A good place for you to start would be with one such tutorial: Sockets Tutorial. It includes a simple client/server example in C (though the example is using the TCP protocol).

More results:

Raw Sockets programming on Linux with C

LINUX SOCKET PART 17 Advanced TCP/IP - THE RAW SOCKET PROGRAM EXAMPLES

Here is a comprehensive list of google search results on raw socket programming in C

Share:
24,908
NerdPirate
Author by

NerdPirate

I'm a PhD student studying computer architecture. Got my BS in computer engineering. I have worked in CPU design, and have done a little software engineering as well.

Updated on May 01, 2020

Comments

  • NerdPirate
    NerdPirate almost 4 years

    I am trying to build an Ethernet network with raw sockets. I cannot use TCP/IP, UDP, or any other protocol.

    This is because it will be communicating with very simple hardware that won't have the resources to handle all the different protocol layers. My network will consist of 1 host computer communicating with several pieces of hardware through an Ethernet switch. At this point I basically just want to send simple packets to each piece of hardware and to establish a simple server I can expand on. My system is running Linux and the server needs to be written in C or C++.

    I have been trying to find information on how to use raw sockets, but everyone always says not to use them and provides no information. I have a pretty strong programming background but no networking experience. Can anyone provide any information on how to get started or where a relevant tutorial can be found?