Skip to content

QUICNetVConnection and UnixNetVConnection #2558

Closed

Description

@masaori335

Currently QUICNetVConnection inherits UnixNetVConnection for using NetHandler and InactivityCop. But ideally QUICNetVConnection should inherits NetVConnection directly.

/cc @oknet

Activity

  1. oknet commented on Sep 22, 2017

    @oknet
    Member

    According to the QUIC source code,

    • The QUICNetVConnection has multi phases that just like SSLNetVConnection
      • Start phase
      • Handshake phase
      • Data Transfer phase
      • Shutdown phase
      • Close phase

    In my opinion, to inherit from UnixNetVConnection, it is a reasonable design.

    It still needs some works if you want put QUICNetVConnection into NetHandler. Because the net_read_io and load_buffer_and_write still not working.

    520 void
    521 QUICNetVConnection::net_read_io(NetHandler *nh, EThread *lthread)
    522 {
    523   ink_assert(false);
    524 
    525   return;
    526 }
    527 
    528 int64_t
    529 QUICNetVConnection::load_buffer_and_write(int64_t towrite, MIOBufferAccessor &buf, int64_t &total_written, int &needs)
    530 {
    531   ink_assert(false);
    532 
    533   return 0;
    534 }
    

    But the InactivityCop is ready for QUICNetVConnection.

  2. oknet commented on Sep 22, 2017

    @oknet
    Member

    I think you should create a QUICNetHandler if you make it inherits NetVConnection directly.

    The QUICNetHandler just like the Linux kernel to implement:

    • Tcp 3-ways handshake before accept() is called
    • Tcp 4-ways handshake after close() is called
    • etcs.

    The QUICNetHandler is very similar to NetHandler.

  3. masaori335 commented on Sep 25, 2017

    @masaori335
    ContributorAuthor

    @oknet Thanks for comments.

    It still needs some works if you want put QUICNetVConnection into NetHandler. Because the net_read_io and load_buffer_and_write still not working.

    This is one of motivations of removing the inheritance of UnixNetVConnection.
    The Network I/O of QUICNetVConnection is very different from UnixNetVConnection.

    But the InactivityCop is ready for QUICNetVConnection.

    Absolutely. It's already working for inactivity timeout.

    QUICNetHandler sounds good idea :)

  4. oknet commented on Sep 25, 2017

    @oknet
    Member

    The QUICPacketHandler could do something just like a Linux Kernel TCP Stack that include read data then attach QUICPacket to QUICNetVC, get data from attached QUICPacket and write out.

    The QUICNetHandler is very similar to NetHandler, it read data from QUICPacket rather than call read().

    In my opinion,

    • you can consider the QUICPacket as sk_buff of tcp stack.
    • and the QUIC is a user space TCP stack over UDP.
  5. oknet commented on Oct 9, 2017

    @oknet
    Member

    @masaori335

    By reading the data flow of quic [https://cwiki.apache.org/confluence/display/TS/QUIC?preview=/70257417/70257424/quic_data_flow.png], in my opinion,

    1. create QUICNetHandler inside the ET_NET thread group and push QUICNetVConnection object into its queue.
    2. Call QUICVConnection::handleEvent() inside the QUICNetHandler::mainNetEvent()
    3. With InactivityCop to achieve QUIC Connection-level timeout control.
    4. QUICNetVConnection is a reference count object. The counter increase once whenever QUICStream created and/or bind to it.
    5. create a QUICSteamHandler inside the ET_NET thread group and push QUICStream object into its queue.
    6. extended the enum ip_protocol_t defined inside the NetVCOptions for QUICStream (USE_QUIC)
    7. Mark the ip_proto to USE_QUIC for QUICStream. (consider the QUIC is another advanced TCP implement over UDP.)
  6. masaori335 commented on Jan 19, 2018

    @masaori335
    ContributorAuthor
  7. moved this to Done in QUICon Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions