0

I need to build a bridge between two networks. The layer 2 data in the network 1 must be copy in the network 2 (sending it via a UDP radio link). I will try to:

  • Read layer 2 using a boost raw socket.
  • Send it using a UDP connection.
  • Receive it using a UDP connection.
  • Write the "layer 2 data" using a boost raw socket.

It's possible to do it using boost raw sockets? Anyone have some example code? I'm a bit lost.

  • 1
    What have you written so far? What is giving you problems? – cmh Aug 16 '12 at 13:31
  • There are various tools and applications available that can tunnel layer 2 traffic over UDP. Would these not be more suitable? – Rook Aug 16 '12 at 13:44
  • I create a raw socket and then put it into promiscuous mode; see http://stackoverflow.com/questions/114804/reading-from-a-promiscuous-network-device. I use it to read the received data of a ethernet interface. The client send me layer 2 data using this interface. I send it using UDP over a radio data link. I receive it, unpacket and send the data using other raw socket. The client receive the layer 2 data he send via the first socket. It is correct? Can I transpor layer 2 data in this way? Thanks a lot. – Blazquez Aug 17 '12 at 12:27
  • raw_socket = socket (PF_PACKET, SOCK_RAW, htons (ETH_P_ALL)) – Blazquez Aug 17 '12 at 12:34

0 Answers0