codeghar / Seagull

Seagull is a free, Open Source (GPL) multi-protocol traffic generator test tool. Forked from upstream on Sourceforge. Patched to build on recent versions of Ubuntu, CentOS, and openSUSE.
GNU General Public License v2.0
50 stars 48 forks source link

Rewrite extsctp on native sctp lib #25

Open platinumthinker opened 5 years ago

platinumthinker commented 5 years ago

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

platinumthinker commented 5 years ago

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

stenh0use commented 4 years ago

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

stenh0use commented 4 years ago

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

chewi commented 1 year ago

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 commented 1 year ago

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.