-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Application Layer API Meeting on August 17, 2016
Martine Lenders edited this page Aug 18, 2016
·
3 revisions
- Agenda Bashing
- Goals and Priorities
- Naming of the API
- Detailed API-discussion:
- IP-based transport layer with datagram-based communication (IP raw / UDP)
- IP-based transport layer with sequence-based communication (TCP)
- Future extension
- Asynchronous event handling: External vs. native support
- Options
- Per packet configuration
- Alexander Aring [eintopf]
- Cenk Gündoghan
- Kaspar Schleiser
- Martine Lenders (Chair)
- Peter Kietzmann
- Simon Brummer
- Peter
- Simon
- No need for dynamic memory allocation
- User friendliness
- Simplicity
- Efficiency (at both front- and backend)
- Easy to implement for network stacks / portability
- Pro `conn:
- Name was picked to differ from the old sockets because it isn't socket
- Con
conn:-
connbasically behaves like sockets (just look at the function-calls) - New-comers might search for "something like sockets" anyway
- Name change would show API change better and ultimately would be less
confusing for users of
conn
-
- Result:
sockas name for the new API - Side discussion: Documenting API changes
- Wiki does not work, because it is forgotten after creation
- Documentation via a dedicated README file is better
- Reference API
-
sock_udp_create/sock_udp_closegood as is - Getter (
sock_udp_get_local/sock_udp_get_remote) stay because they don't hurt and are needed for socket wrapper implementation - Setter: easier and more convenient to create new
sockinstead -
sock_udp_recvandsock_udp_recvfrom:- Order of parameters of
sock_udp_recvfromconfusing with that name - Static inline in API definition not nice
- Result:
- original
sock_udp_recvshould be removed -
sock_udp_recvfromrenamed tosock_udp_recv
- original
- Order of parameters of
-
sock_udp_sendandsock_udp_sendto:- There are three sensible use-cases for
sock_udp_sendto-
sock != NULL,sockis connected, andremote == NULL -
sock != NULL,sockis connected, andremote != NULL -
sock == NULLandremote != NULL
-
- Currently only convenient function for 1., why not for 3.?
- Also again: static inline in API definition
- Result:
- original
sock_udp_sendshould be removed -
sock_udp_sendtorenamed tosock_udp_send
- original
- There are three sensible use-cases for
- Reference API
- Simon wants a
sock_tcp_listenfunction - Kaspar: two object types required
- One representing a connection,
- One representing a listening socket
- split
sock_tcp_createandsock_tcp_close:
/* Connections:
* (Only port required for local; and even that only in special cases) */
sock_tcp_connect(sock_tcp_t *sock, sock_tcp_ep_t *remote, uint16_t local_port);
sock_tcp_disconnect(sock_tcp_t *sock);
/* Listening Socket / Queue */
sock_tcp_listen(sock_tcp_queue_t *queue, sock_tcp_ep_t *local,
sock_tcp_t[] queue_array, unsigned queue_len);
sock_tcp_stop_listen(sock_tcp_queue_t *queue);
- later additions: something like
tcp_listen_dynamic, as as passing the whole queue as parameter is not suitable for servers with lots of RAM (portability) -
sock_tcp_acceptneeds adaptation to new object types:sock_tcp_accept(sock_tcp_queue_t *queue, sock_tcp_t **sock) - rename
sock_tcp_send/_recvtosock_tcp_write/_read; better suitable to semantics of streams
5.1 Asynchronous event handling: External vs. native support
- Callbacks due to questionable context not suitable
- Additional functions for external async event handling are moved to later discussion.
- getter/setter functions added later
- options before bind might need additional parameters for create function
- only option thinkable at the moment is something like
SO_REUSEADDR - solvable by flag field in create function
- only option thinkable at the moment is something like
- datagram-based stuff needs per packet configuration option (checksum, etc because 6Lo-NHC)
- for now, no decision
- possible solutions:
- could be solved with options setting before sending
- message based send as proposed in RFC 3542