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

Send live network messages over TCP #1962

Merged
merged 79 commits into from May 22, 2019

Conversation

@SergiySW
Copy link
Collaborator

commented May 7, 2019

  • channel modified to include transport_type, last_packet_sent (#1971)
  • merge_peer function modified to try TCP connection before UDP
  • TCP channels ongoing_keepalive function used to wake up long not sending channels to prevent TCP disconnection from server
  • Live TCP connection starts with node ID handshake
  • After handshake node sends preferred peering ports for response channels (keepalive self)
  • Received TCP live message is responded to sender with response channels
  • Using #1938 multi-writer for TCP channel
  • Multiple nodes system () tests using TCP connections by default
  • Some tests modified to check 2 live network options: TCP connections & UDP connections
  • Contains rpc.history & rpc.account_history tests fixes (#1966)
  • RPC peers modified to return channel type with option "peer_details" (#1971)
  • tcp_incoming_connections_max added, max established incoming TCP connections (#1976)
  • bootstrap_server modified to accept live network messages
  • confirm_req/confirm_ack headers improved to include hashes count in extensions for proper using of payload_length_bytes () (#1972)

cryptocode and others added some commits Apr 26, 2019

@SergiySW SergiySW added this to the V19.0 milestone May 7, 2019

@SergiySW SergiySW self-assigned this May 7, 2019

@SergiySW SergiySW added this to During RC in V19 May 7, 2019

@zhyatt zhyatt requested review from cryptocode and clemahieu May 7, 2019

Show resolved Hide resolved nano/core_test/testutil.hpp Outdated
Show resolved Hide resolved nano/core_test/testutil.hpp Outdated
Show resolved Hide resolved nano/lib/utility.hpp Outdated
Show resolved Hide resolved nano/node/common.cpp Outdated
Show resolved Hide resolved nano/node/common.cpp Outdated
@@ -298,14 +317,26 @@ bool nano::transport::udp_channels::reserved_address (nano::endpoint const & end
return result;
}

nano::endpoint nano::transport::udp_channels::find_node_id (nano::account const & node_id_a)

This comment has been minimized.

Copy link
@clemahieu

clemahieu May 9, 2019

Collaborator

I think this should return the channel instead of the endpoint, the caller can always query for the endpoint if that's what they want.

This comment has been minimized.

Copy link
@SergiySW

SergiySW May 15, 2019

Author Collaborator

Updated

// clang-format on

// Close all TCP sockets
for (auto i (channels.begin ()), j (channels.end ()); i != j; ++i)

This comment has been minimized.

Copy link
@clemahieu

clemahieu May 9, 2019

Collaborator

This is more tcp-induced cleanup complexity. This should be inside a tcp_channels class that's dedicated to managing tcp-related things.

This comment has been minimized.

Copy link
@SergiySW

SergiySW May 15, 2019

Author Collaborator

Updated

@@ -213,7 +269,7 @@ namespace transport
attempts;
std::unordered_map<nano::endpoint, syn_cookie_info> syn_cookies;
std::unordered_map<boost::asio::ip::address, unsigned> syn_cookies_per_ip;
nano::node & node;
std::unordered_map<nano::tcp_endpoint, std::vector<nano::endpoint>> response_channels;

This comment has been minimized.

Copy link
@clemahieu

clemahieu May 9, 2019

Collaborator

I think nano::network is responsible for managing response channels. Right now it's only udp_channels though we could create a new class tcp_channels which would also be inside nano::network and nano::network is responsible for live messages across all channel types.

nano::network should be able to handle the traffic in a transport-agnostic way.

Show resolved Hide resolved nano/rpc_test/rpc.cpp Outdated
Show resolved Hide resolved nano/node/transport/udp.hpp Outdated
Move common upd/tcp channels functions to transport
- common tcp/udp channels functions moved to transport.hpp
- added last_packet_sent time_point
- RPC peers modified to return channel type with option "peer_details"

SergiySW added some commits May 9, 2019

Framing support for realtime network messages
- Sizes addes for each message types & subtypes
- New count field added to message header extensions (4 bit, max size 15) for confirm_req/confirm_ack by hash
- Node ID handshake header flags functions moved to nano::message_header instead from nano::node_id_handshake
- Tests expanded to check count extensions field

SergiySW added some commits May 20, 2019

@SergiySW SergiySW force-pushed the SergiySW:tcp/live_messages branch from 0b5cfd2 to 4c2d80f May 21, 2019

@SergiySW SergiySW force-pushed the SergiySW:tcp/live_messages branch from e6af6c8 to f0ddbcb May 22, 2019

@SergiySW SergiySW merged commit b3352ee into nanocurrency:master May 22, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

argakiig added a commit to argakiig/raiblocks that referenced this pull request May 22, 2019

Send live network messages over TCP (nanocurrency#1962)
- merge_peer function modified to try TCP connection before UDP
- TCP channels ongoing_keepalive function used to wake up long not sending channels to prevent TCP disconnection from server
- Live TCP connection starts with node ID handshake
- After handshake node sends preferred peering ports for response channels (keepalive self)
- Received TCP live message is responded to sender with response channels
- Using nanocurrency#1938 multi-writer for TCP channel
- Multiple nodes system () tests using TCP connections by default
- Some tests modified to check 2 live network options: TCP connections & UDP connections
- tcp_incoming_connections_max added, max established incoming TCP connections
- bootstrap_server modified to accept live network messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.