Subject: [iccrg] ECN statistics for Mac OS X

From: Stuart Cheshire <[email-masked]>
Date: Mon, 23 Mar 2015 15:53:11 -0500

As requested today, here is some information about ECN on Mac OS X:

1. To enable ECN, type:

sysctl -w net.inet.tcp.ecn_negotiate_in=1
sysctl -w net.inet.tcp.ecn_initiate_out=1

2. To make this change persistent, put following lines in /etc/sysctl.conf:

net.inet.tcp.ecn_initiate_out=1
net.inet.tcp.ecn_negotiate_in=1

3. To see the results, use netstat:

% netstat -sp tcp
tcp:
...
  12558 connections negotiated ECN
    0 times congestion notification was sent using ECE
    1983 times CWR was sent in response to ECE

This implies that 1983 times my laptop has received acks with ECE set, which suggests that some of its outbound packets experienced congestion and were marked “CE”. I have not yet identified which device or devices are marking these packets (if any — it’s possible it could just be a bug in the statistics reporting).

Stuart Cheshire

---

From: "Scheffenegger, Richard" <[email-masked]>
Date: Mon, 23 Mar 2015 22:56:12 +0000

Hi Stuart,

if the ECN code is BSD derived, i believe you'll get CWR also for loss-based congestion window reductions, not only for ECE-triggered reductions; the only prerequisite is that the TCP session is ECN-enabled. So that counter probably doesn't indicate that you ever received a CE marked packet, only that out of these 12558 sessions, only 1983 times the CWND was actually reduced for some reason (and never for most sessions...)

(Remind me to check if the old BSD ECN bug is fixed in your stack, but I think it was done by the maintainer of FreeBSD HEAD there too... https://lists.freebsd.org/pipermail/freebsd-bugs/2010-April/039451.html

Best regards,
  Richard

> -----Original Message-----
> From: iccrg [mailto:[email-masked]] On Behalf Of Stuart Cheshire
> Sent: Montag, 23. März 2015 15:53
> To: [email-masked]
> Subject: [iccrg] ECN statistics for Mac OS X
> 
> sysctl -w net.inet.tcp.ecn_negotiate_in=1 sysctl -w
> This implies that 1983 times my laptop has received acks with ECE set,
> which suggests that some of its outbound packets experienced congestion
> and were marked “CE”. I have not yet identified which device or devices
> are marking these packets (if any — it’s possible it could just be a bug
> in the statistics reporting).
> 
> Stuart Cheshire
> 
> _______________________________________________
> iccrg mailing list
> [email-masked]
> https://www.irtf.org/mailman/listinfo/iccrg

---

From: "Eggert, Lars" <[email-masked]>
Date: Mon, 30 Mar 2015 10:47:13 +0000

> sysctl -w net.inet.tcp.ecn_initiate_out=1

FWIW, I see some issues when I do this when using my network at home against some popular CDN-based sites (github.com, fitbit.com). The symptoms are empty HTTP responses for some small subset of objects some of the time.

Anyone interested in debugging this, contact me off-list.

Lars

---

From: Mikael Abrahamsson <[email-masked]>
Date: Mon, 30 Mar 2015 13:32:20 +0200 (CEST)

> in the statistics reporting).

I have had ECN enabled on all my Linux machines and my Mac:s. From the 
mac:

 	27112 connections negotiated ECN
 		0 times congestion notification was sent using ECE
 		28190 times CWR was sent in response to ECE

I am at this time uploading data to the Internet over DOCSIS 3.0 network, 
congesting my 50 megabit/s uplink. My counter for CWR updates is updating 
with 5-20 per second or so.

I do not know what thing is marking my packets with ECN, the speed 
limiting factor is the docsis network, so unless my Apple Airport router 
(the 802.11ac one with time capsule) is marking my packets because it has 
figured out magically that I have 50 megabit/s uplink, then it should be 
the DOCSIS network doing the marking.

-- 
Mikael Abrahamsson    email: [email-masked]