HTTP2 client with a custom TCP read buffer

doctorburp

I would like to have a HTTP2 client with a very small TCP socket read buffer. Other sockets in the system should remain with the default settings (adjusting the global tcp setting via /proc/sys/net/ipv4/tcp_rmem is not an option)

Is there a utility (such as curl) that allows adjusting the read buffer of a client?

(Big Picture: I'm testing a server and my main objecting is to fill up that server's tcp write buffer. My first approach is trying to create a client with a very small read buffer so that the server's buffer will fill up quickly. Any other approach is also welcome...)

Thanks

sbordet

You don't need to tweak the low-level TCP socket read buffer of the client, in order to fill the TCP server write buffer.

What you need is to A) have the client send to the server (at connection setup) a very large HTTP/2 receive window, so that TCP flow control kicks in before HTTP/2 flow control; and B) have the server send a large content to the client and have the client not reading the content (or read very slowly 1 byte at a time every N milliseconds).

Step A) is fundamental, otherwise the default HTTP/2 flow control window (only 65535 byte) will stall the server download well before the server TCP write buffers are filled up (even with the client not reading any content).

The steps above can be performed with any sufficiently configurable HTTP/2 client.

Disclaimer, I'm the implementer of HTTP/2 in Jetty, and if you use Java you can use the Jetty HTTP/2 client and follow the steps above. An example usage of Jetty's HTTP/2 client can be seen here.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Golang TCP server: how to write HTTP2 data

How Does HTTP Response get sent back to correct Client in TCP?

HTTP2 over AWS ELB under TCP Mode

TCP/IP Client : best way to read multiple inputstreams from server

Akka Http Client :Custom headers

When does a http2 TCP connection close?

Does http2 allow custom pseudo-header fields?

Using SwiftNIO and SwiftNIOHTTP2 as an HTTP2 client

http2 client failed to parse HTTP Upgrade response header

How to 'read' from a (binary==true) boost::beast::websocket::stream<tcp::socket> into a buffer (boost::beast::flat_buffer?) so it is not escaped?

C# .NET socket tcp begin/endreceive client : endreceive reads all bytes, but in beginreceive, the buffer size changes on its own

TCP connection and a different buffer size for a client and a server

How to set TCP Keepalive in Reactor Netty HTTP client?

WebView with custom HTTP client

Buffer for TCP connection

Flush the TCP receive data buffer?

TCP concurrent echo server unable to read string from first client

Ruby How to send image over tcp (http) server to client

TCP socket buffer for every flow

Sending a buffer to the client to download

TCP client read and write socket in android service

HTTP request from client to server. The TCP/IP stack journey

Why tcp server receives one buffer if Client sends multiple buffer without sleep?

Can lightweight client implementation of HTTP2 ignore Stream Priority?

TCP Server/Client : client recv() returns blank buffer

PHP read data from raw tcp socket and send them through WebSocket Client using 2 React Connector

Javascript Kubernetes Client: List and Read Custom Resource Definition

tcp ip client read received data c#

Why GRPC uses HTTP2 instead of pure TCP?