Tech tips

TCP Header (Flags – ECN & CWR) # 2.7

Welcome to tcpipworld.com Blog Post  # 8

Life is like riding a bicycle. To keep your balance, you must keep moving.-Albert Einstein

In this, we will discuss the last TCP Flags “ECN & CWR”

Key Takeaway :

  • TCP ECN Flag
  • TCP CWR Flag

1.CWR (Congestion Window Reduce)

Set by the sender to indicate that, it received a TCP segment with ECN flag set.

2. ECN (Explicit Congestion Notification)

This indicates that TCP peer is ECN capable and it helps the host to avoid congestion by sending an explicit signal to the host.

Its works associated with network layer information. 

Basically, ECN & CWR are related to bandwidth congestion, but when you will see ECN | CWR in a SYN or SYN/ACK of TCP Segment. It just a parameter to tell the other receiver about the mechanism.

3. How ECN & CWR Works?

  • Routers monitor the queue size, they do the estimate of the queue time and that should be null zero.

  • If that begins to go up. It means a persistent queue is beginning to build. And it might be congestion.
  • When this happens router, knows the point of congestion and then marks the packets going through it, these are the packets that experience congestion.
  • Marking simply turn the bit on in the IP here, particularly ECN bits.
  • Congestion notification is done at the IP layer because it has to be done at the network layer.
  • Now when the host receives the packet, the host realizes that it been marked with ECN and gets to know the packet experienced congestion and signal back to the sender with ECN bit set in a TCP segment.
  • When the sender receives the TCP segment with ECN bit, it treats that as a loss and acts upon it by half the congestion window or do a slow start.
  • Inform receiver with CWR flag set in TCP segment by reducing the window size.

Comment here