Quantcast
Channel: Active questions tagged linux-kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 12244

How to esteblish NOT static L2TPv3 socket connection over IP between two machines

$
0
0

I did not found any examples how to implement L2TPv3 over IP

I found only a couple of open source implementations of L2TP which are:

L2TPv3 rfc says nothing how it is implemented in linux which is obvious

kernel documentation: https://github.com/torvalds/linux/blob/master/Documentation/networking/l2tp.txt says we must use netlink + standard sockets which tells us something. But I do not understand why we must use netlink along with standard sockets?

kernel header file: https://github.com/torvalds/linux/blob/master/include/uapi/linux/l2tp.h it has tons of enums and commands for netlink + l2tpip structure for . I am confused of how to use them properly.

And final part of L2TPv3 control exchange establishment (SCCRQ, SCCRP, SCCCN). Having read kernel documentation I have only own understanding which might not be right but here it is.

server side:

  1. Prepare tunnel 0 socket
  2. Create genl socket for l2tp
  3. Create standard socket filling l2tpip structure (socket create + bind) where tunnel_id is 0
  4. Using genl socket create tunnel 0
  5. Wait for SCCRQ (As I understand header will have controll connection id equls zero)

  6. On received SCCRQ on tunnel 0 socket

  7. From received SCCRQ grab AVL's Assigned Conntrol Connection ID which is received_tunnel_id on other side
  8. Generate local_tunnel_id for oure side
  9. Create standard socket filling l2tpip structure (socket create + bind) where tunnel_id is local_tunnel_id
  10. Using genl socket create tunnel with local_tunnel_id
  11. Send SCCRP wich has header's Controll Connaction ID equal to received_tunnel_id and AVL Assigned Conntrol Connection ID equal to local_tunnel_id
  12. Wait for SCCN on that socket

client side

  1. I do not know how it is done on that side

As I understand further communication will be over second standard socket and tunnel id zero is receiving ONLY SCCRQ

It would be great to get clarification on these details


Viewing all articles
Browse latest Browse all 12244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>