Skip to content

Curl HTTP/3 over SCION#1

Draft
koflin wants to merge 2 commits into
masterfrom
scion-curl
Draft

Curl HTTP/3 over SCION#1
koflin wants to merge 2 commits into
masterfrom
scion-curl

Conversation

@koflin
Copy link
Copy Markdown
Owner

@koflin koflin commented Jun 23, 2025

This PR adds support for sending HTTP/3 requests over SCION.

Make sure you have installed a release build of csnet (i.e., it has to be configured with -DCMAKE_BUILD_TYPE=Release)

To build CURL do the following:

cmake -DCMAKE_INSTALL_RPATH="$ORIGIN/../lib" -DBUILD_STATIC_CURL=ON -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DUSE_NGTCP2=ON -DUSE_SCION=ON -DSCION_INCLUDE_DIR=your_csnet_build_path/include -DSCION_LIBRARY_DIR=your_csnet_build_path/lib your_curl_build_dir
cmake --build your_curl_build_dir

After building CURL, start the example HTTP/3 server:

openssl req -x509 -newkey rsa -nodes -keyout server.key -out server.cert
sudo SCION_DAEMON_ADDRESS="127.0.0.133:30255" ./example-shttp3-server -cert server.cert -key server.key

To make a request to the example server you can either run the http3 SCION example

./your_curl_build_dir/docs/examples/http3-scion

or you can use the built CURL executable and run:

./your_curl_build_dir/src/curl --scion-dst-ia "2-ff00:0:221" --scion-topology-path "topology.json" --http3-only --insecure https://127.0.0.132/json

@koflin
Copy link
Copy Markdown
Owner Author

koflin commented Jun 23, 2025

@marcfrei This is my fork of Curl that uses SCION. I've added some instructions above on how to run the examples.

Copy link
Copy Markdown

@marcfrei marcfrei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment thread lib/cf-socket.c
rc = scion_connect(ctx->socket, &ctx->addr.curl_sa_addr,
(curl_socklen_t)ctx->addr.addrlen, data->set.ia);
if (rc != 0) {
printf("scion connect failed: %d\n", rc);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scion > SCION

Comment thread lib/cf-socket.c

DEBUGASSERT(addr->protocol == IPPROTO_UDP);
result = scion_topology_from_file(topology, data->set.topology_file_path);
if (result)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be if(result), right? Everywhere in this file.

Comment thread lib/vquic/vquic.c
(struct sockaddr *)&remote_addr,
&remote_addrlen, NULL, NULL);
if(nread < 0) {
if (nread == SCION_WOULD_BLOCK) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if(

Comment thread lib/cf-socket.c
if (ctx->transport == TRNSPRT_QUIC) {
socket_close_scion(data, cf->conn, !ctx->accepted, ctx->sock, ctx->socket);
scion_network_free(ctx->network);
scion_topology_free(ctx->topology);
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do network and topology cleanup in socket_close_scion

Comment thread lib/vquic/vquic.c

*psent = 0;

sent = scion_send(qctx->socket,
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use scion_sendmsg for this

Comment thread lib/vquic/vquic.c

DEBUGASSERT(max_pkts > 0);
for(pkts = 0, total_nread = 0; pkts < max_pkts;) {
nread = scion_recvfrom(qctx->socket, (char *)buf, bufsize, MSG_DONTWAIT,
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use scion_recvmsg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants