Commit Graph

162 Commits

Author SHA1 Message Date
Marcel Märtens
97a58f0e14 clean up socket2 networkwork code to do more on the socket2 before convertig it. 2022-02-05 13:08:46 +01:00
Marcel Märtens
2528afafdd deactivate tests in CI, as they have often no IPv6 configured and would fail in that case 2022-02-05 13:04:16 +01:00
Marcel Märtens
dcfde616d0 In case of IPv6 and NON Windows make sure to not listen on dualstack,
for that we need to create a socket2 socket and set_only_v6 to true.
We need to privude set_nonblocking for tokio to work and we need to set reuseaddr for it to work on linux systems
2022-02-05 13:04:16 +01:00
Marcel Märtens
e9bee485ae Add a test for the new gameserver IPv6 IPv4 behavior 2022-02-05 13:04:16 +01:00
Avi Weinstock
5f8957d8ef Globally allow the clippy lints {new_without_default, many_single_char_names, identity_op, type_complexity, too_many_arguments}. 2022-01-30 20:16:20 +01:00
infrandomness
1a1acfae2c
Fix RUSTSEC-2022-0006 2022-01-26 22:08:38 +01:00
juliancoffee
fba89517de Move Veloren to 2021 edition 2022-01-26 16:46:40 +02:00
Jonathan Berglin
596307c9b7 Remove unused clippy suppressions 2021-12-05 17:59:02 +00:00
João Capucho
8b89903d57
Bump tracing-subscriber to 0.3.2
We were pulling two versions of it. Causing some compilation errors
2021-11-26 17:41:51 +00:00
Marcel Märtens
aa93b4b53c update other binaries 2021-11-20 20:19:48 +01:00
Marcel Märtens
e29ede7c97 updating dependencies,
cannot update the following dependencies:
 - vek: Sharps SIMD isnt upstream
 - tracing-subscriber: MakeWriter was adjusted and i was to lazy to fiddle with lifetimes,
 - refinery, rustsql: we have a custom refinery version which is incompatible with newer rustsql
 - equi + egui_winit + egui_wgpu_backend: i tried it in this commit but it turned out that they dependo n wgpu which we cant update
 - wgpu: cant update due new version doesnt support DX11

Got quinn updated which now require some dependencies to be explicit.
2021-11-20 20:17:49 +01:00
Marcel Märtens
258da1bedf those sleeps cannot be easily included in the code, as they simulate 2 participants on 2 different computers.
Increase the timeouts from 1000 -> 3000 ms if there are some internal messages send (e.g. network_a closed, send on stream_a)
Increase the timeouts from 1000 -> 5000 ms if there is actuall networking involed (e.g. stream_a send, stream_b recv)
2021-11-19 09:36:39 +01:00
Marcel Märtens
2a82405df2 update toolchain to nightly-2021-09-24 2021-09-24 23:18:07 +02:00
Marcel Märtens
88685cc016 update crates 2021-09-20 14:39:01 +02:00
Dr. Dystopia
72058ef32e Resolve unused '#[allow(clippy::eval_order_dependence)]' error supressions 2021-07-24 20:24:57 +02:00
Marcel Märtens
db8aedd363 fmt after applying clippy fixes after toolchain update 2021-07-12 12:09:27 +02:00
Marcel Märtens
9b3b21f368 fix clippy warnings 2021-07-12 12:09:09 +02:00
Marcel
010f9c250c Merge branch 'aweinstock/nodelay' into 'master'
Enable TCP_NODELAY.

See merge request veloren/veloren!2520
2021-06-27 23:49:01 +00:00
Avi Weinstock
8c5d52b70a Enable TCP_NODELAY. 2021-06-27 17:45:33 -04:00
Marcel Märtens
dd5c9d04b0 fix logging cnt didnt reset 2021-06-27 22:51:23 +02:00
Marcel
f988584337 Merge branch 'revert-c6e200a3' into 'master'
Add a configuration Option to opt-in Quic backend

See merge request veloren/veloren!2318
2021-06-02 14:27:13 +00:00
Imbris
48ebb10d50 Update toolchain 2021-05-31 20:44:57 -04:00
Sam
9db8406e4c Fixed torvus 2021-05-27 19:56:16 -05:00
Marcel Märtens
cf3188b412 remove Protocol from Quic, cleanup code, fix some log spam 2021-05-21 10:41:19 +02:00
Joshua Yanovski
e7587c4d9d Added non-admin moderators and timed bans.
The security model has been updated to reflect this change (for example,
moderators cannot revert a ban by an administrator).  Ban history is
also now recorded in the ban file, and much more information about the
ban is stored (whitelists and administrators also have extra
information).

To support the new information without losing important information,
this commit also introduces a new migration path for editable settings
(both from legacy to the new format, and between versions).  Examples
of how to do this correctly, and migrate to new versions of a settings
file, are in the settings/ subdirectory.

As part of this effort, editable settings have been revamped to
guarantee atomic saves (due to the increased amount of information in
each file), some latent bugs in networking were fixed, and server-cli
has been updated to go through StructOpt for both calls through TUI
and argv, greatly simplifying parsing logic.
2021-05-09 21:19:16 -07:00
Marcel Märtens
68d326c817 revert Client drop to be correct again and also stop network properly, reduce timeout to 10s 2021-05-04 22:34:19 +02:00
Marcel Märtens
df7b65289d fix error handling in networking and switch to hashbrown, fixing #1118 2021-05-04 15:29:42 +02:00
Marcel Märtens
1ead240ad2 switch network/protocol to hashbrown (5% perf increase) 2021-04-29 19:12:57 +02:00
Marcel Märtens
653fb065e0 extract protocol specific listen code from scheduler and move it to channel.rs 2021-04-29 17:51:52 +02:00
Marcel Märtens
4afadf57dc move connect code to channel and get rid of unwraps 2021-04-29 15:58:43 +02:00
Marcel Märtens
95b186e29a QuicSink and QuicDrain do work now.
When local SendProtocol is opening a Stream, it will send a empty message to QuicDrain which will then know that its time to open a quic stream.
It will open a QuicStream and send its SID over to remote.
The RecvStream will be send to local QuicSink
RemoteRecv will notice a new BiStream was opened and read its Sid. It will now start listening on it. while remote main will get the information that a stream was opened and will notice the frontend.
in participant remote Recv is synced with remote send (without triggering a empty message!).
RemoteRecv Sink will send the sendstream to RemoteSend Drain and it will be used when a first message is send on this stream.
2021-04-29 15:58:39 +02:00
Marcel Märtens
760c382ed9 protocoladdr change for listen and connect
(remove a loop in quic protocol which wasnt a actual loop)
2021-04-29 15:58:34 +02:00
Marcel Märtens
9f0aceba4c work on getting quic in the network 2021-04-29 15:58:26 +02:00
Marcel Märtens
383482a36e Quic: We had the followuing problem:
- locally we open a stream, our local Drain is sending OpenStream
 - remote Sink will know this and notify remote Drain
 - remote side sends a message
 - local sink does not know about the Stream. as there is (and CANT) be a wat to notify local Sink from local Drain (it could introduce race conditions).

One of the possible solutions was, that the remote drain will copy the OpenStream Msg ON the Quic::stream before first data is send. This would work but is complicated.

Instead we now just mark such streams as "potentially open" and we listen for the first DataHeader to get it's SID.

add support for unreliable messages in quic protocol, benchmarks
2021-04-29 15:58:23 +02:00
Ben Wallis
2e08c2f76f Added client/server version mismatch message when a network error is encountered during client init.
Added warning banner on character select when successfully connected to a server with a mismatched version.
2021-04-24 09:08:30 +01:00
Marcel Märtens
8ee83df600 fixed #1067 2021-04-13 20:39:56 +02:00
Marcel Märtens
9638581d09 ITFrame::read_frame now throws an error when the frame_no is invalid.
This will be catched by the respective protocols, e.g. tcp and cause a violation
2021-04-13 00:13:08 +02:00
Marcel Märtens
4fed9dab83 Have a clear error for when the I/O closes and when some protocol is violated. this should help find the rootcause of a bug.
If its Closed it looks like the TCP connection got dropped/cut off (e.g. OS, Wifi).
If its Violated we for sure know the cause is the messages send/recv in a wrong way
2021-04-13 00:12:20 +02:00
Marcel Märtens
ea5a02d7cd change some Ordering::Relaxed to Ordering::SeqCst when we do not want to have it moved/or taken effects from other threads.
some id increases are kept Relaxed, SeqCst shouldn't be necessary there.
Not sure about the bool checks in api.rs
2021-04-07 23:17:09 +02:00
Marcel Märtens
7ca2f3b9d6 make a panic a error! and improve logging 2021-04-03 19:58:36 +02:00
Marcel Märtens
c77446a014 fix some tracy only and no default features 2021-03-27 18:24:10 +01:00
Marcel Märtens
6a95fb6b74 extend network of incomming TCP metrics and failed handshake metric 2021-03-27 18:24:10 +01:00
Marcel Märtens
aea52d8b54 implement Upload Bandwidth prediction.
Its available to `api` and `metrics` and can be used to slow down msg send in veloren.
It uses a tokio::watch for now, as i plan to have a watch job in the scheduler that recalculates prio on change.
Also cleaning up participant metrics after a disconnect
2021-03-26 08:58:03 +01:00
Marcel Märtens
034d0f0c5d fix a bug that some closes could get lost 2021-03-26 08:57:56 +01:00
Marcel Märtens
8dccc21125 preparation for multiple-channel participants.
When a stream is opened we are searching for the best (currently) available channel.
The stream will then be keept on that channel.
Adjusted the rest of the algorithms that they now respect this rule.
improved a HashMap for Pids to be based on a Vec. Also using this for Sid -> Cid relation which is more performance critical
WARN: our current send()? error handling allows it for some close_stream messages to get lost.
2021-03-26 08:57:50 +01:00
Marcel Märtens
01c82b70ab network scheduler and rawmsg cleanup 2021-03-26 08:57:42 +01:00
Marcel Märtens
6b23101fac update toolchain to nightly-2021-03-22 2021-03-22 16:41:04 +01:00
Marcel Märtens
9084ac48f1 defer some trace, so that we wont spam the log. 2021-03-22 09:16:07 +01:00
Marcel Märtens
18aefa8dbf remove prometheus dos via protocol.
Clean up unused labely to keep prometheus values down
2021-03-20 23:50:38 +01:00
Marcel Märtens
d7df741671 update dependencies, including removal of some tracy deps as they are get through common/tracy 2021-03-09 20:17:29 +01:00