Giter VIP home page Giter VIP logo

geconet's Introduction

gecostacklogo

Aimed for Online Games

GecoNet™ is an Open Source/Free Software cross-platform complete transport protocol stack similar to TCP and Reliable-UDP. It is implemented in the user space with raw sockets and/or udp sockets(setup by users). However, it is generic and may supersede TCP and Reliable-UDP in other applications as well. building upon RFC-4960 standards and currently supports Windows, Linux and Mac.

GecoNet is not a simple rebranding of RFC4960-SCTP-PROTOCOL, but rather incorporates already in its initial version several bug- and security fixes as well as new features to make it more suitable for games developments:

  • Packetization Layer Path MTU Discovery,
  • Reliable-Sequenced, Reliable-unordered, Unreliable-Sequenced and Unreliable-Unordered
  • Load sharing between multi-connections from a single client host
  • Non-renegable selective ack
  • Build-in secured transmission
  • Better congestion control windows for overgrowth during changeover
  • Quick Failover Algorithm

Core Features

  • Secured connection pharse and encryption of messages
    fast encrrption and compression of application messages.
    Secured connection based on key-exchange.
    key exchange methods (RAS & DH).
    encrption methods (DES_CBC, 3DES_CBC, ASE128,AES192).
    Hash methods (MD5, SHA-1).

  • (De)compression for game messages
    since game packets often have small repeated blocks of data (IP packets, game messages hdr etc...),
    LZF3.6 (http://oldhome.schmorp.de/marc/liblzf.html) will be used in client-server model(config by users)
    as (de)compression method(formular:Time=1/Ratio+ActualBandwidth*(1/DecompressVelocity+1/CompressVelocity).
    Therefore, LZF3.6 is best option to achieve highest network throughput when bandwidth < 133 Mbps
    (the bandwidth most game clients have).

  • Multiple levels of message reliability
    reliable and order, reliable and out-of-order, unreliable and order, unliable and out-of-order

  • Congestion avoidance
    simlar but enhanced functionality as in TCP to avoid congestion with quicker slow-start-pharse

  • Multiple Transfer Channels
    Support for more than one logical transfer channels of application messages.

  • Message-oriented
    Preservation of apllication message boundaries.

  • Multihoming for network redundancy
    use of multiple IP addresses per connection to allow transmission
    of data chunks through different network paths with highest pmtu

  • Fragmentation and PMTU
    Detection of path MTU impelmented based on RFC 4821 - Packetization
    Layer Path MTU Discovery (https://www.ietf.org/rfc/rfc4821.txt).
    Fragmentation of user data to fit best into the highest pmtu

  • Error correction
    Error-free, non-duplicated and non-corrupted data transfer

Why use geconet instead of TCP or Reliable UDP?

  • no head-of-line blocking
    TCP imposes a strictly reliable and ording data transmittions. However, if a user data message
    is lost during transit, all subsequent user data messages are delayed until the lost messag
    has been retransmitted (so-called head-of-line blocking). Some applications do not require a
    strict ordering of reliable messages. E.g. the complicated MMORPG or MOBA games usually exchange
    unrelated game messages out-of-order.

  • no stream-oriented data transfer
    TCP is stream-oriented. This means that TCP treats data chunks transmitted by an application as
    an ordered stream of bytes(=octets in network speak). While this concept supports a wide range of
    applications (mesage-oriented like email, character-oriented like TELNET, stream-oriented vides),
    it is unsuilted in most applications because these exchange application level messages with message
    boundaries. geconet preserves apllication level message boundaries, thus liberationg applications
    from implementing a framing protocol on the top of the transport protocol for delineating messages.
    geconet simply maps application messages to chunks on the transmit path and back to application
    messages on the receive path.

  • multihoming
    multihoming refers to the use of multiple IP addresses on either side of the connection to allow multiple
    transmission paths through the network thus increasing reliability and availability. TCP does not support
    multihoming since a TCP connection is defined by the quadruple source IP, destination IP, source port and
    destination port. geconet has built-in support for multihoming which offloads high-availability applications
    from implementing this feature.

  • againest denial of service attacks
    the connection setup of TCP allows denial of attacks, particularly SYN attacks. Each time the TCP layer
    receives a SYN packet for setting up a new connection, it allocates a data structure for storing connection
    parameters. Flodding with a high number of such SYN packets may lead to memory exhaustion. geconet
    implements a procedure to avoid or at least make it more diffcult for an attacker to lauch a connection denial
    of service attack (4-way connection setup with cookie).

  • againest blind attacks
    the connection setup of TCP allows blind attacks, particularly in applications that indentify users with their
    IP addreses. TCP receiver and sender initialize a SYN for setting up a new connection with use of tick-based
    random number generator. There is a high possibilty for an attacker to guess the right value of SYN so that he
    can proof an use connecting and running commands in peer's machine. geconet carefully choose a time-unrelated
    verification number for each established connection in order to avoid or at least make it more diffcult for an
    attacker to lauch blind or proofing attacks.

Architecture

waiting...

geconet's People

Contributors

kiddinglife avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

geconet's Issues

udp bundle

  1. mbu_new(bool use_udp)
  2. in msm_process_cookie_echo()
    update
    curr_channel->geco_packet_size =defaultbundle->geco_packet_size
    psoitions = defaultbundle.positions

use priority for sending msg

NOWAIT send at once without bundle if no congestion
high buffer in high queue with bundle
midum buffer in medium queue with bundle
low buffer in low queue with bundle

clear shutdown retx counter

every time when shutdon timer expires, we increament retx counter by one, but any time we receive packet from peer, we should reset it to zero and restart shutdoen timer so that our peer has enough time to send all queued data chunks.

do uts for transport modules first

the reson to do uts for mtra firstly is that we will rely on it to do oyher unit tests
I do not really use stub of transport module to test other modules' functions, which can save much time
to integrity tests with mtra later.

recycle of pooled packet when all chunks indise are used up or released by ulp

recycle algorithm:
when released by ulp, increase current_released_bytes by the chunk length,
if this is equla to packet_total_length, recycle it to pool.

when handling feagments chunks, when it is completed before deliver to ulp, we need release all
alternative to use value pass when it is dtor, we checked if released packet
struct locator
{
char* packet; // used to release
uint total_packet_bytes;//received length from mtra
uint released_bytes;//curr release bytes
};
struct data_parm
{
char* data;
bool can_free_at_once;//this is aseembled chunk we can delete for efficiency
uint chunklen;// chunk legth for this chunk
locator* parent_packet; // packet this data is on
};
void ulp_receive(smart_ptr<char** ulp_data> data, .....)
{
char* data = data;
......
//once used up data,data is auto dtor with
// pesudo code
// data_parm
mydataparm = (data_parm
)(*data) # * is for dereference to get the
// if(mydataparm->can_free_at_once)
// geco-fee_metod(mydataparm->parent_packet->packet)
// else
// mydataparm->parent_packet->released_bytes+=mydataparm->chunklen
// if mydataparm->parent_packet->released_bytes == mydataparm->parent_packet->total_packet_bytes
// // geco-fee_metod(mydataparm->parent_packet->packet)
}

[bug] smctrl_t's init_timer_id can only be inited timers::end() when using new

geco-net-dispatch.cc at line 3823

/////////////////////////////////////////////// State Machina Moudle (sm) Ends \\\\\\\\\\\\\\\\\\\/
smctrl_t* msm_new(void)
{
#ifdef _DEBUG
EVENTLOG(VERBOSE, "- - - - Enter msm_new()");
#endif

assert(curr_channel_ != NULL);
//smctrl_t* tmp;
//if ((tmp = (smctrl_t*)geco_malloc_ext(sizeof(smctrl_t), __FILE__, __LINE__)) == NULL)
//{
//	ERRLOG(FALTAL_ERROR_EXIT, "Malloc failed");
//	return 0;
//}
smctrl_t* tmp = new smctrl_t();
tmp->channel_state = ChannelState::Closed;
tmp->init_timer_id = mtra_read_timer().timers.end();

test plan

do unit tests for all possible functions
force normal/sick connection cases to test connection states properly
force echo big packet with fragment to test assemble works properly
force echo uu, uo, ou,oo data chunks to test reordering works properly
force congestions to test retx ans sack function correctly
force very small rwnd to test sws work properly
force path unreachable and reachable again to test path failover work properly
force normal/sick disconnection cases to test connection states properly
force kinds of attacks

p58 5.1.1 p57 last several lines

if suppoeted addr tpes field not presented, this means support both ip4 and ip6. go to read_peer_addrlist() enhanced it.

p57:
recv geco packet() send abort when received invalid init init ack cookie-echo need ficup

P58:
NOTIFY ULP IF REMOTE MIS < LOCAL MOS

P60:
M1 -> ABORT WITH UNRESOLED ADDR IF LOCAL SUPPOETED TYPES & REMOTE PEER SUPPORED TPES == 0
LINE 1365

Implementation Check Points

1138 3.2.2. Reporting of Unrecognized Parameters
1411 IMPLEMENTATION NOTE: If an INIT chunk is received with known...
1430 If the value of the Initiate Tag in a received INIT chunk is found
to be 0, the receiver MUST treat it as an error and close the
association by transmitting an ABORT.
1450 Note: A receiver of an INIT with the OS value set to 0 SHOULD
abort the association.
1471 Note: A receiver of an INIT with the MIS value of 0 SHOULD abort
the association.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.