Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite extsctp on native sctp lib #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

platinumthinker
Copy link

I find that extsctp not available when SCTP enabled in kernel. I rewrited extsctp transport using native sctp lib

@platinumthinker
Copy link
Author

I added support for SCTP multihoming and it could be configure in channel args.
Examples:
Server binding to 172.17.0.1 and 172.17.1.1

<define entity="channel"
	name="channel-1"
	protocol="diameter-v1"
	transport="trans-1"
	open-args="mode=server;source=172.17.0.1:3868;source=172.17.1.1:3868">
</define>

Client binding to 172.17.0.1 and 172.17.1.1 and connect to 172.17.0.2 and 172.17.1.2

<define entity="channel"
	name="channel-1"
	protocol="diameter-v1"
	transport="trans-1"
	open-args="mode=client;dest=172.17.0.2:3868;dest=172.17.1.2:3868;source=172.17.0.1;source=172.17.1.1">
</define>

You can connect without multihoming: just setup one ip per dest or source

@platinumthinker platinumthinker force-pushed the native_sctp branch 4 times, most recently from 832ae69 to 77fdcc4 Compare December 15, 2018 09:00
Parse multiple IPs from channels args like this:
  open-args="mode=client;dest=172.17.0.1:3868;dest=172.17.0.2:3868"
Support server and client binding to multiple source ip like this:
  open-args="mode=server;source=172.17.1.1:3868;source=172.17.1.2"
@stenh0use
Copy link

stenh0use commented Jun 10, 2020

Nice work @platinumthinker, I have implemented this and looking to use the multihoming feature :)

@stenh0use
Copy link

@platinumthinker great work on this, managed to get multihoming working from within a docker container.

@chewi
Copy link

chewi commented Dec 1, 2022

Please don't merge this as is. The native lib commit is fine, at least to get it to build, but the multihoming commit causes a crash on Ubuntu 20.04, even if you're not using SCTP. I couldn't figure out why.

C_TransIP::analyze_open_string() d [172.22.141.98:3868]
dst a[172.22.141.98:3868]
add dst to m_addrs_dst

Program received signal SIGSEGV, Segmentation fault.

#0  0x00007ffff7a38fcb in __gnu_cxx::new_allocator<addrinfo*>::construct<addrinfo*, addrinfo* const&> (this=0x555555853388, __p=0x41) at /usr/include/c++/9/ext/new_allocator.h:146
#1  0x00007ffff7a373e9 in std::allocator_traits<std::allocator<addrinfo*> >::construct<addrinfo*, addrinfo* const&> (__a=..., __p=0x41) at /usr/include/c++/9/bits/alloc_traits.h:483
#2  0x00007ffff7a35f7c in std::vector<addrinfo*, std::allocator<addrinfo*> >::push_back (this=0x555555853388, __x=@0x7fffffffcea8: 0x555555948600) at /usr/include/c++/9/bits/stl_vector.h:1189
#3  0x00007ffff7a31d9b in C_TransIP::analyze_open_string (this=0x5555557e5500, P_buf=0x5555557aa110 "mode=client;dest=172.22.141.98:3868", P_addr=0x555555853220) at library-trans-ip/C_TransIP.cpp:860
#4  0x00007ffff7a2ee65 in C_TransIP::open (this=0x5555557e5500, P_channel_id=0, P_buf=0x5555557aa110 "mode=client;dest=172.22.141.98:3868", P_status=0x7fffffffd784, P_protocol=0x5555557e7660)
    at library-trans-ip/C_TransIP.cpp:174
#5  0x0000555555628722 in C_ChannelControl::open_global_channel (this=0x5555557a1060) at generator-model/C_ChannelControl.cpp:439
#6  0x00005555556ddb58 in C_ReadControl::transport_table (this=0x5555557a1580) at generator-traffic/C_ReadControl.cpp:530
#7  0x00005555556dc3db in C_ReadControl::InitProcedure (this=0x5555557a1580) at generator-traffic/C_ReadControl.cpp:132
#8  0x000055555561d673 in C_TaskControl::init (this=0x5555557a1580) at generator-core/C_TaskControl.cpp:42
#9  0x0000555555622ce1 in C_Generator::InitProcedure (this=0x5555557a0d30) at generator-core/C_Generator.cpp:781
#10 0x000055555561d673 in C_TaskControl::init (this=0x5555557a0d30) at generator-core/C_TaskControl.cpp:42
#11 0x000055555561f971 in main_tool (P_argc=11, P_argv=0x7fffffffdec8) at generator-core/main.cpp:199
#12 0x000055555561fa7d in main (P_argc=11, P_argv=0x7fffffffdec8) at generator-core/main.cpp:221

@platinumthinker
Copy link
Author

Please don't merge this as is. The native lib commit is fine, at least to get it to build, but the multihoming commit causes a crash on Ubuntu 20.04, even if you're not using SCTP. I couldn't figure out why.

C_TransIP::analyze_open_string() d [172.22.141.98:3868]
dst a[172.22.141.98:3868]
add dst to m_addrs_dst

Program received signal SIGSEGV, Segmentation fault.

#0  0x00007ffff7a38fcb in __gnu_cxx::new_allocator<addrinfo*>::construct<addrinfo*, addrinfo* const&> (this=0x555555853388, __p=0x41) at /usr/include/c++/9/ext/new_allocator.h:146
#1  0x00007ffff7a373e9 in std::allocator_traits<std::allocator<addrinfo*> >::construct<addrinfo*, addrinfo* const&> (__a=..., __p=0x41) at /usr/include/c++/9/bits/alloc_traits.h:483
#2  0x00007ffff7a35f7c in std::vector<addrinfo*, std::allocator<addrinfo*> >::push_back (this=0x555555853388, __x=@0x7fffffffcea8: 0x555555948600) at /usr/include/c++/9/bits/stl_vector.h:1189
#3  0x00007ffff7a31d9b in C_TransIP::analyze_open_string (this=0x5555557e5500, P_buf=0x5555557aa110 "mode=client;dest=172.22.141.98:3868", P_addr=0x555555853220) at library-trans-ip/C_TransIP.cpp:860
#4  0x00007ffff7a2ee65 in C_TransIP::open (this=0x5555557e5500, P_channel_id=0, P_buf=0x5555557aa110 "mode=client;dest=172.22.141.98:3868", P_status=0x7fffffffd784, P_protocol=0x5555557e7660)
    at library-trans-ip/C_TransIP.cpp:174
#5  0x0000555555628722 in C_ChannelControl::open_global_channel (this=0x5555557a1060) at generator-model/C_ChannelControl.cpp:439
#6  0x00005555556ddb58 in C_ReadControl::transport_table (this=0x5555557a1580) at generator-traffic/C_ReadControl.cpp:530
#7  0x00005555556dc3db in C_ReadControl::InitProcedure (this=0x5555557a1580) at generator-traffic/C_ReadControl.cpp:132
#8  0x000055555561d673 in C_TaskControl::init (this=0x5555557a1580) at generator-core/C_TaskControl.cpp:42
#9  0x0000555555622ce1 in C_Generator::InitProcedure (this=0x5555557a0d30) at generator-core/C_Generator.cpp:781
#10 0x000055555561d673 in C_TaskControl::init (this=0x5555557a0d30) at generator-core/C_TaskControl.cpp:42
#11 0x000055555561f971 in main_tool (P_argc=11, P_argv=0x7fffffffdec8) at generator-core/main.cpp:199
#12 0x000055555561fa7d in main (P_argc=11, P_argv=0x7fffffffdec8) at generator-core/main.cpp:221

hehe (: wait another 5 year to change something else.
This project looks abandoned and i think this MR wasnt merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants