Evgeny
d0d4199273
etcp: unified send hook via etcp_udp_send, remove loss_rate, add dummynet_filter inline mode, rewrite BGP test
...
- Add etcp_udp_send_fn_t hook typedef, send_hook/send_hook_ctx fields to ETCP_LINK
- Implement etcp_udp_send() wrapper — all UDP sends go through one point
- Remove loss_rate from ETCP_SOCKET, CFG_SERVER, config parser, send path
- Add dummynet_filter: inline send-hook with loss/delay, no proxy socket needed
- Rewrite test_bgp_route_exchange: 3-node chain A(2 links)↔B↔C, 7 phases
with dummynet_filter-based link failure/recovery simulation
- Clean up tests: remove skeleton test_routing_mesh, 6 debug/stale test files
- Refactor test_etcp_simple_traffic and test_pkt_normalizer_etcp (remove debug spam)
- Fix test_etcp_two_instances: remove private field access, fix false PASS on timeout
5 months ago
Evgeny
61fee27478
congestion: burst-based BW measurement + adaptive inflight (slow start/cong avoidance/loss response)
...
New features:
- get_time_us() in lib/u_async.c/h for µs-precision timing
- Burst measurement (ETCP_SECTION_MEAS_TS 0x07, MEAS_RESP 0x08, FILLER 0x09)
- 12 MTU packets sent at line rate, receiver measures inter-packet gaps
- Burst triggered when link saturated + min 500ms interval
- Result: measured BW -> bandwidth for shaper, burst_target_bdp for window cap
- 3-phase adaptive inflight in link_stats_timer_cb:
- Slow start: windows doubles each RTT, exits on loss/RTT spike/threshold
- Congestion avoidance: additive increase, proportional RTT shrink, multiplicative loss shrink
- Burst target cap: inflight_lim <= burst_target_bdp * 1.1
- Dynamic optimal_inflight = sum(link->inflight_lim_bytes), recalculated on change
- Adaptive win_timebase = rtt/2 (was hardcoded 10ms)
Fixes:
- dummynet.c: shaper formula fixed (80000 -> 80)
- dummynet.c: queue_data_put call fixed (3 args -> 2)
- etcp.c: SIZE ERROR format string (missing log_name argument)
- etcp_request_pkt: FILLER leaves room for PAYLOAD overhead
Tests:
- test_etcp_congestion.c: single-threaded, 5-phase BW/delay/loss test
- sender + receiver + dummynet in one uasync
- CSV metrics output every 100ms
- All 29 existing tests pass
5 months ago
Evgeny
9c509d4c86
add connectivity probing + NAT type rename OPEN->EIM, RESTRICTED->STRICT
...
- Rename NAT types: OPEN->EIM, RESTRICTED->STRICT across all code
- Add flat addr list {type,ip,port,socket_id} to NODEINFO (NODEINFO_IPV4_ADDR)
- Add NODEINFO_IPV4_SOCKET_META for per-socket metadata
- Add NODE_CONNECTIVITY with per-type probe status and min_rtt
- New module: route_connectivity.c/h (probing engine with socket fallback)
- STRICT verified addresses excluded from NODEINFO broadcast
- Trigger probing on new/updated BGP node, cancel on remove/withdraw
- Update NAT type names in etcpmon GUI
5 months ago
Evgeny
2fadec947b
Fix: Split multi-var init and rename s_net/d_net to src_net/dst_net to avoid MSYS2 S_un macro conflict
5 months ago
Evgeny
595d2b177b
Refactor: Replace custom tc_hton*/tc_ntoh* with standard htobe16/be16toh/htobe32/be32toh, move htobe16/be16toh to platform_compat.h
5 months ago
Evgeny
aafa0cfcab
Fix: Add portable tc_htonl/tc_htons/tc_ntohl/tc_ntohs macros, replace winsock2-incompatible hton*/nto* in NAT test files
5 months ago
Evgeny
3dd8fa4085
Fix: Remove arpa/inet.h from test_nat_stress.c and test_nat_transport.c, use platform_compat.h for byte-order funcs
5 months ago
Evgeny
ba30f2adc6
Fix: Remove arpa/inet.h from test_nat_engine.c, use platform_compat.h for byte-order funcs
5 months ago
Evgeny
907ef244c6
NAT: Full Cone (EIM) NAT with ETCP_ID_NAT protocol, per-node routing, and comprehensive test suite
...
- New ETCP protocol ETCP_ID_NAT (0x02) for NAT traffic between nodes
- eim_nat.c/h: Pure NAT engine (table, port allocation, checksum updates, egress/ingress)
- nat_transport.c/h: Transport layer (NAT TUN, ETCP binding, client/provider roles)
- route_bgp_find_conn_for_node(): shared utility for optimal connection lookup
- tun_init_nat(): dedicated TUN creation for NAT
- Config: [nat] section with tun_ip, port_start/end, nat_via, forward rules
- Fix: csum_update_ip/transport use htonl() halves (correct on LE systems)
- Fix: IP_FRAG_MF_MASK changed to 0x2000 (after ntohs, MF is bit 13)
- Tests: 26 engine unit + 4 transport integration + 7 stress (29 total)
5 months ago
Evgeny
11d511797a
Fix compiler warnings: remove incorrect address-of operator and add getpid for Windows
...
- etcp_connections.c:1142: remove & before addr in sockaddr_storage_to_str call
- test_etcp_simple_traffic.c: add #include <process.h> and #define getpid _getpid for Windows
5 months ago
Evgeny
e39979bfac
Config: Added [allowed_keys] section for client public key authorization on server
...
- Added CFG_ALLOWED_KEY struct with binary key storage (64 bytes) for fast memcmp comparison
- Implemented parsing of [allowed_keys] section with allow_all flag and per-key entries
- Added key validation in etcp_connections.c server handler (errorcode=8 for rejected keys)
- Default behavior: deny all if [allowed_keys] section is missing or allow_all=0 with no keys
- Added proper memory cleanup and debug logging for allowed_keys configuration
- Updated all test configs to include [allowed_keys] allow_all=1 for backward compatibility
5 months ago
Evgeny
a3063ea47a
NODEINFO: Add nat_addr/nat_port fields, use interface_addr for addr/port
5 months ago
Evgeny
57dba26e7c
GUI: поле действия и кнопка Send для отправки команд в utun
...
- Добавлен ETCPMON_CMD_ACTION в протокол (32 байта текст)
- В GUI добавлено поле ввода и кнопка Send правее блока Sockets
- Добавлен etcpmon_client_send_action для отправки команд
- Обработка action 'nat' в control_server: запускает NAT check для всех линков
- Сделана route_bgp_start_link_nat_check не-static
- Добавлена route_bgp_request_nat_check_all
- Исправлен баг route_ping.c (request_id -> nonce)
- Исправлена линковка tests/Makefile.am
5 months ago
Evgeny
0984ea749a
Исправлен byte order для IP адресов в NAT detection flow
...
- etcp_connections.c: парсинг NAT IP через memcpy (сохраняет NBO)
- route_bgp.c: убраны ntohl() для IP в NAT detection и route_bgp_send_nat_info
- route_ping.c: убран htonl() для IP в ping request
- тесты: обновлены ожидания NBO для nat_ip
5 months ago
Evgeny
cbde38d52a
Remove accidentally committed binaries and temp files
5 months ago
Evgeny
c136db5666
Fix: round-robin link selection + byte order fixes + local_node update
5 months ago
Evgeny
77fd7c19de
WIP: debug byte order diagnostics
5 months ago
Evgeny
d74ab1c1c6
Add name parameter to uasync_set_timeout for timer identification in dumps
5 months ago
Evgeny
54982f2dfb
ping
6 months ago
Evgeny
7cdb84c7a2
Add NAT detection with burst ping, test timing, fix port conflicts
...
- route_ping.c: burst mode - send next ping immediately on response
- route_ping.h: add target_ipv4/target_port/pubkey to BGP_PING_REQUEST
- test_nat_detection.c: add test for ping without embedded pubkey
- test_etcp_simple_traffic.c: use dynamic ports + fix timebase units
- Makefile.am: show test execution time in ms
6 months ago
Evgeny
31eb4a5d26
Add NAT detection with STUN-like ping and integration test
6 months ago
Evgeny
b613e3a8e0
serializer
6 months ago
Evgeny
5dc8ad6784
1
6 months ago
Evgeny
2903b82941
Add test_serialize to Makefile and include serialize in libuasync.a
...
- tests/Makefile.am: add test_serialize to check_PROGRAMS
- lib/Makefile.am: add serialize.c/h to libuasync_a_SOURCES
6 months ago
Evgeny
dba092d88b
Add serialize library for binary serialization with dynamic allocation
...
- serialize.h/c: universal binary serialization for structures with
variable-length fields (ASCIIZ, ARRAY) using pointers
- Auto allocation via u_malloc during deserialization
- Support for header (arbitrary bytes at buffer start)
- serialize_encode(): serialize structure to buffer
- serialize_decode(): deserialize from buffer (without header)
- serialize_free(): free structure and all its pointers
- tests/test_serialize.c: unit tests
6 months ago
Evgeny
3b31821316
Add test_route_ping.c test file
6 months ago
Evgeny
ffbc0da86f
add ping
6 months ago
Evgeny
389124d327
Fix test_bgp_route_exchange: correct IP byte order constants and platform_compat.h endian include
6 months ago
Evgeny
05323ded60
WIP: backup before debugging test_bgp_route_exchange
6 months ago
Evgeny
07306e378b
backup: state before full initialization for ping test with real links
6 months ago
Evgeny
feb8024506
1
6 months ago
Evgeny
9f13cf5459
route redesign + tests
6 months ago
Evgeny
be6058c642
backup: before plan 1 fix for route_lib test (non-overlapping subnets)
6 months ago
Evgeny
27618217cc
fix: update tests for new NODEINFO routing API
...
- Added route_node.o to test linking
- Simplified test_route_lib to avoid old API calls
- Minor fixes to build system
Branch: feature/nodeinfo-routing
6 months ago
Evgeny
097e1acc6d
queue: add variable size hash
...
bgp: add to headers new node info
6 months ago
Evgeny
9517454ee6
firewall + random init pkt size
6 months ago
Evgeny
46b62e2e77
1
6 months ago
Evgeny
98f886b8a8
test fix, log update
6 months ago
Evgeny
12ba3b9719
backup: before adding inflight bytes limit to loadbalancer
6 months ago
Evgeny
7261e596eb
fix: improve test_routing_mesh and fix duplicate init_connections in test_etcp_two_instances
...
- Refactored test_routing_mesh to use proper ETCP + normalizer flow
- Removed duplicate init_connections() calls that caused 'Address already in use'
- Improved error reporting in etcp_link_new()
- Test now respects single mainloop architecture
6 months ago
Evgeny
0d9c18c653
conn fix
7 months ago
Evgeny
ef75d20d0f
1
7 months ago
jeka
e8b6153297
bugfix
7 months ago
jeka
aa5171bcd1
route improvements
7 months ago
jeka
167b3b36da
routing + bgp big update
7 months ago
jeka
79f027a3d3
1
7 months ago
jeka
473190281a
routing базово работает
7 months ago
Evgeny
f9bdb2733f
1
7 months ago
Evgeny
83a21fee1b
1
7 months ago
Evgeny
e876437c69
1
7 months ago