Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

218
Views
Get cwnd of my TCP connection from a program

I am creating a TCP connection from my linux program with boost.asio. I wonder how do I get the value of its congestion window (cwnd) from the program? The only way I know of is to parse /proc/net/tcp, but this does not feel right. I'd rather use a dedicated syscall to get this info.

A solution to a similar question (How to monitor cwnd and ssthresh values for a TCP connection?) suggests using TCP Probe, but it feels even less appealing.

So what is the best way to get the value of cwnd?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

I did this with netlink and INET_DIAG-sockets based on this helpful example: https://github.com/kristrev/inet-diag-example

over 4 years ago · Santiago Trujillo Report

0

It turned out getsockopt() is able to return the same tcp_info when called with TCP_INFO option:

  tcp_info tcpi = {};
  socklen_t len = sizeof(tcp_info);
  getsockopt(tcp_socket, SOL_TCP, TCP_INFO, &tcpi, &len);
  tcpi.tcpi_snd_cwnd;  // <-- CWND
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!