Use Network Framework to read ECN bits from IP header.

Does the Network Framework offer the possibility to read ECN bits from the IP header when receiving data?

I know I can mark the ecn bits


let ipMetaData = NWProtocolIP.Metadata()
ipMetaData.ecn = .nonECT
NWConnection.ContentContext(identifier: "ECN", metadata: [ipMetaData])

But can I read it back if it's available on received packets?

Network Framework will give you TCP or UDP packets. You can define what the header and format of these packets looks like if you use a custom network framing protocol with similar APIs that you are mentioning in your post. Take a look at the sample for Building a Custom Peer-to-Peer Protocol for more on how to build a framing protocol for TCP with Network Framework.

Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com
Use Network Framework to read ECN bits from IP header.
 
 
Q