{"id":1336,"date":"2025-09-14T07:35:50","date_gmt":"2025-09-14T07:35:50","guid":{"rendered":"https:\/\/www.zframez.com\/articles\/?p=1336"},"modified":"2025-09-14T07:35:54","modified_gmt":"2025-09-14T07:35:54","slug":"understanding-tcp-flags-and-header-options","status":"publish","type":"post","link":"https:\/\/www.zframez.com\/articles\/networking-fundamentals\/understanding-tcp-flags-and-header-options","title":{"rendered":"Understanding TCP Flags and Header Options"},"content":{"rendered":"<body>\n<h1 class=\"wp-block-heading has-x-large-font-size\"><strong>TCP Flag Bits<\/strong><\/h1>\n\n\n\n<p>TCP uses several control flag bits in its header to manage how a connection is established, how data is transferred, and how a connection is closed. Let\u2019s go through each flag one by one.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>SYN (Synchronize)<\/strong><\/h2>\n\n\n\n<p>TCP uses the SYN flag bit to establish a connection. When an application asks TCP to open a connection, TCP will send a segment with the SYN bit set to check if the other side is willing to communicate. When the other side receives this SYN, it will respond with <strong>SYN+ACK<\/strong> if it is ready. Finally, the sender sends back an <strong>ACK<\/strong> to complete the three-way handshake.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>ACK (Acknowledgment)<\/strong><\/h2>\n\n\n\n<p>Whenever a device receives a segment with data, or special control flags like SYN or FIN, it must acknowledge it by sending a segment with the ACK flag set to 1. A pure acknowledgment segment (which only carries an ACK) does not itself trigger another ACK in response.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>FIN (Finish)<\/strong><\/h2>\n\n\n\n<p>The FIN flag bit is used to close the connection. When the user or application ends the session, TCP will send a segment with FIN=1. The other side usually responds with an ACK first, and then later sends its own FIN when it is ready to close. The original side then replies with a final ACK. This process is known as a <strong>four-way termination<\/strong>.<br>In some cases, if the other side has no more data, it can send <strong>FIN+ACK<\/strong> together and the closing looks similar to the three-step process of connection establishment.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>PSH (Push)<\/strong><\/h2>\n\n\n\n<p>The PSH flag bit tells the receiver to immediately deliver the received data to the upper layer, instead of waiting for the buffer to fill. This is useful in interactive applications such as Telnet, SSH, or FTP control connections, where data needs to reach the application right away without delay.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>URG (Urgent)<\/strong><\/h2>\n\n\n\n<p>The URG flag bit marks certain data in the TCP stream as urgent. Unlike PSH, which pushes all buffered data to the application, URG highlights a specific part of the data that should be given priority. The number of urgent bytes is indicated by the <strong>Urgent Pointer<\/strong> field in the TCP header. This allows the receiver to know which part of the stream must be delivered to the application immediately.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>RST (Reset)<\/strong><\/h2>\n\n\n\n<p>The RST flag is used when TCP wants to immediately close a connection or reject a request.<\/p>\n\n\n\n<p>For example, if a device receives a segment for a port that is not open, it will reply with an RST. In the same way, if there is a problem in an active connection and one side wants to forcefully end it without waiting for the normal FIN process, it can send an RST to reset the connection right away.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>CWR (Congestion Window Reduced)<\/strong><\/h2>\n\n\n\n<p>The CWR flag bit is used in Explicit Congestion Notification (ECN). When the sender receives an ECE signal from the receiver, it reduces its congestion window. To confirm that it has reacted, the sender sets the CWR flag in the next segment. This informs the peer that congestion control measures have been applied.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>ECE (ECN Echo)<\/strong><\/h2>\n\n\n\n<p>The ECE flag bit is also part of ECN. When a router along the path marks an IP packet with <strong>CE = 11<\/strong> (Congestion Experienced), the receiving device will set the ECE flag in its ACKs to inform the sender. Once the sender gets this signal, it reduces its sending rate and then sets the CWR flag to acknowledge that it has done so.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h1 class=\"wp-block-heading has-x-large-font-size\"><strong>TCP Header Options Field<\/strong><\/h1>\n\n\n\n<p>TCP header can be minimum 20 bytes and maximum 60 bytes. That means there is up to 40 bytes available to carry some extra information. Let\u2019s look at some of the common options used in TCP header.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>MSS (Maximum Segment Size)<\/strong><\/h2>\n\n\n\n<p>MSS defines the maximum data that TCP can carry in one segment. This depends on the MTU of the Layer 2 technology used.<\/p>\n\n\n\n<p>For example, if we use Ethernet with default MTU of 1500, the MSS will be 1460. This is by considering 20 bytes for IP header and 20 bytes for TCP header. MSS value is exchanged during the 3-way handshake.<\/p>\n\n\n\n<p>Also note that if extra TCP options are added (like timestamp), they also take space in the TCP header. In that case the MSS value will be a bit less than 1460.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>Selective Acknowledgment (SACK)<\/strong><\/h2>\n\n\n\n<p>TCP normally gives acknowledgment in a cumulative way. It doesn\u2019t have to send ACK for every segment separately.<\/p>\n\n\n\n<p>For example, if 10 segments of 1000 bytes each are sent, with sequence numbers 1, 1001, 2001 and so on, if all are received properly the receiver will send an ACK number 10001. That means it has received up to 10000.<\/p>\n\n\n\n<p>Now if one segment is lost, say segment 2 (seq number 1001), then the receiver will keep sending ACK 1001. The sender will understand that segment 2 is missing and will retransmit it.<\/p>\n\n\n\n<p>The problem comes when more than one segment is lost. With normal cumulative ACK, the receiver can only point to the first missing segment. The sender has to figure out the rest slowly, which delays retransmission. With SACK, if both sides support it, the receiver can use the TCP options field to carry multiple acknowledgment numbers. These numbers show the ranges of data it is still expecting from the other side. This way, the sender knows exactly which segments were lost and can retransmit only those, instead of guessing or waiting for repeated ACKs.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"1024\" height=\"588\" src=\"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/09\/TCP-Selective-Acknowledgment.png?resize=1024%2C588&#038;ssl=1\" alt=\"Illustration of TCP Selective Acknowledgment. PC1 sends five segments with sequence numbers 1, 1001, 2001, 3001, and 4001 to PC2. Segments 2 (1001) and 4 (3001) are lost. PC2 responds with a TCP header where the options field lists acknowledgment numbers 1001 and 3001, indicating the missing segments that need retransmission\" class=\"wp-image-1339\" loading=\"lazy\" srcset=\"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/09\/TCP-Selective-Acknowledgment.png?resize=1024%2C588&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/09\/TCP-Selective-Acknowledgment.png?resize=300%2C172&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/09\/TCP-Selective-Acknowledgment.png?resize=768%2C441&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/09\/TCP-Selective-Acknowledgment.png?w=1422&amp;ssl=1 1422w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><figcaption class=\"wp-element-caption\">Selective Acknowledgment example \u2013 PC2 informs PC1 about missing segments (1001 and 3001) using the TCP options field<\/figcaption><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>Window Scaling<\/strong><\/h2>\n\n\n\n<p>The TCP window size field is 16 bits, so the maximum value is 65,535 bytes. This was enough in the early days, but with today\u2019s high-speed links it is very small.<\/p>\n\n\n\n<p>To fix this, TCP uses window scaling. Here the value in the window size field is not the actual buffer size. Instead it has to be multiplied by a scaling factor. This factor is exchanged during the connection establishment and it will be a power of 2.<\/p>\n\n\n\n<p>For example, if the scale factor is 256 and the window size field shows 10,000, the actual buffer size is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>10,000 \u00d7 256 = 2,560,000 bytes.<\/code><\/pre>\n\n\n\n<p>This way TCP can handle much larger window sizes than what can be represented in the 16-bit field.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<p><\/p>\n<\/body>","protected":false},"excerpt":{"rendered":"<p>TCP Flag Bits TCP uses several control flag bits in its header to manage how a connection is established, how data is transferred, and how a connection is closed. Let\u2019s go through each flag one by one. SYN (Synchronize) TCP uses the SYN flag bit to establish a connection. When an application asks TCP to [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"wp-custom-template-post-with-sidebar2","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[330],"tags":[419,423,418,416,422,421,414,425,415,405,413,417,404,420,424],"class_list":["post-1336","post","type-post","status-publish","format-standard","hentry","category-networking-fundamentals","tag-ack-flag","tag-cwr-flag","tag-ece-flag","tag-fin-flag","tag-mss","tag-psh-flag","tag-rst-flag","tag-sack","tag-syn-flag","tag-tcp","tag-tcp-flags","tag-tcp-header","tag-tcp-tutorial","tag-urg-flag","tag-window-scaling"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Understanding TCP Flags and Header Options - Tutorials<\/title>\n<meta name=\"description\" content=\"Learn about TCP flag bits like SYN, ACK, FIN, RST, PSH, URG, CWR, ECE and important TCP header options such as MSS, Selective Acknowledgment, and Window Scaling. Explained in a clear and beginner-friendly way.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.zframez.com\/articles\/networking-fundamentals\/understanding-tcp-flags-and-header-options\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"TCP Flags and Options Explained \u2013 A Beginner\u2019s Guide\" \/>\n<meta property=\"og:description\" content=\"This guide explains the TCP flag bits (SYN, ACK, FIN, RST, PSH, URG, CWR, ECE) and header options like MSS, SACK, and Window Scaling with simple examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.zframez.com\/articles\/networking-fundamentals\/understanding-tcp-flags-and-header-options\" \/>\n<meta property=\"og:site_name\" content=\"Tutorials\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/zframez\/\" \/>\n<meta property=\"article:published_time\" content=\"2025-09-14T07:35:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-14T07:35:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/09\/TCP-Selective-Acknowledgment.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1422\" \/>\n\t<meta property=\"og:image:height\" content=\"816\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"sajith achipra\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@zframez\" \/>\n<meta name=\"twitter:site\" content=\"@zframez\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"sajith achipra\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/networking-fundamentals\\\/understanding-tcp-flags-and-header-options#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/networking-fundamentals\\\/understanding-tcp-flags-and-header-options\"},\"author\":{\"name\":\"sajith achipra\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#\\\/schema\\\/person\\\/8b3b88007644501771d2452d3cc80f41\"},\"headline\":\"Understanding TCP Flags and Header Options\",\"datePublished\":\"2025-09-14T07:35:50+00:00\",\"dateModified\":\"2025-09-14T07:35:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/networking-fundamentals\\\/understanding-tcp-flags-and-header-options\"},\"wordCount\":1023,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/networking-fundamentals\\\/understanding-tcp-flags-and-header-options#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/TCP-Selective-Acknowledgment-1024x588.png\",\"keywords\":[\"ACK flag\",\"CWR flag\",\"ECE flag\",\"FIN flag\",\"MSS\",\"PSH flag\",\"RST flag\",\"SACK\",\"SYN flag\",\"tcp\",\"TCP flags\",\"TCP header\",\"tcp tutorial\",\"URG flag\",\"Window Scaling\"],\"articleSection\":[\"Networking Fundamentals\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.zframez.com\\\/articles\\\/networking-fundamentals\\\/understanding-tcp-flags-and-header-options#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/networking-fundamentals\\\/understanding-tcp-flags-and-header-options\",\"url\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/networking-fundamentals\\\/understanding-tcp-flags-and-header-options\",\"name\":\"Understanding TCP Flags and Header Options - Tutorials\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/networking-fundamentals\\\/understanding-tcp-flags-and-header-options#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/networking-fundamentals\\\/understanding-tcp-flags-and-header-options#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/TCP-Selective-Acknowledgment-1024x588.png\",\"datePublished\":\"2025-09-14T07:35:50+00:00\",\"dateModified\":\"2025-09-14T07:35:54+00:00\",\"description\":\"Learn about TCP flag bits like SYN, ACK, FIN, RST, PSH, URG, CWR, ECE and important TCP header options such as MSS, Selective Acknowledgment, and Window Scaling. Explained in a clear and beginner-friendly way.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/networking-fundamentals\\\/understanding-tcp-flags-and-header-options#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.zframez.com\\\/articles\\\/networking-fundamentals\\\/understanding-tcp-flags-and-header-options\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/networking-fundamentals\\\/understanding-tcp-flags-and-header-options#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.zframez.com\\\/articles\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/TCP-Selective-Acknowledgment.png?fit=1422%2C816&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/www.zframez.com\\\/articles\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/TCP-Selective-Acknowledgment.png?fit=1422%2C816&ssl=1\",\"width\":1422,\"height\":816,\"caption\":\"Illustration of TCP Selective Acknowledgment. PC1 sends five segments with sequence numbers 1, 1001, 2001, 3001, and 4001 to PC2. Segments 2 (1001) and 4 (3001) are lost. PC2 responds with a TCP header where the options field lists acknowledgment numbers 1001 and 3001, indicating the missing segments that need retransmission.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/networking-fundamentals\\\/understanding-tcp-flags-and-header-options#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Tutorials\",\"item\":\"https:\\\/\\\/www.zframez.com\\\/articles\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Understanding TCP Flags and Header Options\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#website\",\"url\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/\",\"name\":\"zframez tutorials\",\"description\":\"Learn networking bit by bit\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#organization\",\"name\":\"zframez technologies\",\"url\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.zframez.com\\\/articles\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/zframez-logo.jpg?fit=864%2C864&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/www.zframez.com\\\/articles\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/zframez-logo.jpg?fit=864%2C864&ssl=1\",\"width\":864,\"height\":864,\"caption\":\"zframez technologies\"},\"image\":{\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/zframez\\\/\",\"https:\\\/\\\/x.com\\\/zframez\",\"https:\\\/\\\/www.instagram.com\\\/zframez_technologies\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.zframez.com\\\/articles\\\/#\\\/schema\\\/person\\\/8b3b88007644501771d2452d3cc80f41\",\"name\":\"sajith achipra\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3d9f27c5311500982b6f19d03d0506f1c328f30f51d8d5f73f46577687fd81f8?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3d9f27c5311500982b6f19d03d0506f1c328f30f51d8d5f73f46577687fd81f8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3d9f27c5311500982b6f19d03d0506f1c328f30f51d8d5f73f46577687fd81f8?s=96&d=mm&r=g\",\"caption\":\"sajith achipra\"},\"sameAs\":[\"http:\\\/\\\/www.zframez.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Understanding TCP Flags and Header Options - Tutorials","description":"Learn about TCP flag bits like SYN, ACK, FIN, RST, PSH, URG, CWR, ECE and important TCP header options such as MSS, Selective Acknowledgment, and Window Scaling. Explained in a clear and beginner-friendly way.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.zframez.com\/articles\/networking-fundamentals\/understanding-tcp-flags-and-header-options","og_locale":"en_US","og_type":"article","og_title":"TCP Flags and Options Explained \u2013 A Beginner\u2019s Guide","og_description":"This guide explains the TCP flag bits (SYN, ACK, FIN, RST, PSH, URG, CWR, ECE) and header options like MSS, SACK, and Window Scaling with simple examples.","og_url":"https:\/\/www.zframez.com\/articles\/networking-fundamentals\/understanding-tcp-flags-and-header-options","og_site_name":"Tutorials","article_publisher":"https:\/\/www.facebook.com\/zframez\/","article_published_time":"2025-09-14T07:35:50+00:00","article_modified_time":"2025-09-14T07:35:54+00:00","og_image":[{"width":1422,"height":816,"url":"https:\/\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/09\/TCP-Selective-Acknowledgment.png","type":"image\/png"}],"author":"sajith achipra","twitter_card":"summary_large_image","twitter_creator":"@zframez","twitter_site":"@zframez","twitter_misc":{"Written by":"sajith achipra","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.zframez.com\/articles\/networking-fundamentals\/understanding-tcp-flags-and-header-options#article","isPartOf":{"@id":"https:\/\/www.zframez.com\/articles\/networking-fundamentals\/understanding-tcp-flags-and-header-options"},"author":{"name":"sajith achipra","@id":"https:\/\/www.zframez.com\/articles\/#\/schema\/person\/8b3b88007644501771d2452d3cc80f41"},"headline":"Understanding TCP Flags and Header Options","datePublished":"2025-09-14T07:35:50+00:00","dateModified":"2025-09-14T07:35:54+00:00","mainEntityOfPage":{"@id":"https:\/\/www.zframez.com\/articles\/networking-fundamentals\/understanding-tcp-flags-and-header-options"},"wordCount":1023,"commentCount":0,"publisher":{"@id":"https:\/\/www.zframez.com\/articles\/#organization"},"image":{"@id":"https:\/\/www.zframez.com\/articles\/networking-fundamentals\/understanding-tcp-flags-and-header-options#primaryimage"},"thumbnailUrl":"https:\/\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/09\/TCP-Selective-Acknowledgment-1024x588.png","keywords":["ACK flag","CWR flag","ECE flag","FIN flag","MSS","PSH flag","RST flag","SACK","SYN flag","tcp","TCP flags","TCP header","tcp tutorial","URG flag","Window Scaling"],"articleSection":["Networking Fundamentals"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.zframez.com\/articles\/networking-fundamentals\/understanding-tcp-flags-and-header-options#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.zframez.com\/articles\/networking-fundamentals\/understanding-tcp-flags-and-header-options","url":"https:\/\/www.zframez.com\/articles\/networking-fundamentals\/understanding-tcp-flags-and-header-options","name":"Understanding TCP Flags and Header Options - Tutorials","isPartOf":{"@id":"https:\/\/www.zframez.com\/articles\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.zframez.com\/articles\/networking-fundamentals\/understanding-tcp-flags-and-header-options#primaryimage"},"image":{"@id":"https:\/\/www.zframez.com\/articles\/networking-fundamentals\/understanding-tcp-flags-and-header-options#primaryimage"},"thumbnailUrl":"https:\/\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/09\/TCP-Selective-Acknowledgment-1024x588.png","datePublished":"2025-09-14T07:35:50+00:00","dateModified":"2025-09-14T07:35:54+00:00","description":"Learn about TCP flag bits like SYN, ACK, FIN, RST, PSH, URG, CWR, ECE and important TCP header options such as MSS, Selective Acknowledgment, and Window Scaling. Explained in a clear and beginner-friendly way.","breadcrumb":{"@id":"https:\/\/www.zframez.com\/articles\/networking-fundamentals\/understanding-tcp-flags-and-header-options#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.zframez.com\/articles\/networking-fundamentals\/understanding-tcp-flags-and-header-options"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.zframez.com\/articles\/networking-fundamentals\/understanding-tcp-flags-and-header-options#primaryimage","url":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/09\/TCP-Selective-Acknowledgment.png?fit=1422%2C816&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/09\/TCP-Selective-Acknowledgment.png?fit=1422%2C816&ssl=1","width":1422,"height":816,"caption":"Illustration of TCP Selective Acknowledgment. PC1 sends five segments with sequence numbers 1, 1001, 2001, 3001, and 4001 to PC2. Segments 2 (1001) and 4 (3001) are lost. PC2 responds with a TCP header where the options field lists acknowledgment numbers 1001 and 3001, indicating the missing segments that need retransmission."},{"@type":"BreadcrumbList","@id":"https:\/\/www.zframez.com\/articles\/networking-fundamentals\/understanding-tcp-flags-and-header-options#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Tutorials","item":"https:\/\/www.zframez.com\/articles"},{"@type":"ListItem","position":2,"name":"Understanding TCP Flags and Header Options"}]},{"@type":"WebSite","@id":"https:\/\/www.zframez.com\/articles\/#website","url":"https:\/\/www.zframez.com\/articles\/","name":"zframez tutorials","description":"Learn networking bit by bit","publisher":{"@id":"https:\/\/www.zframez.com\/articles\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.zframez.com\/articles\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.zframez.com\/articles\/#organization","name":"zframez technologies","url":"https:\/\/www.zframez.com\/articles\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.zframez.com\/articles\/#\/schema\/logo\/image\/","url":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/zframez-logo.jpg?fit=864%2C864&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/zframez-logo.jpg?fit=864%2C864&ssl=1","width":864,"height":864,"caption":"zframez technologies"},"image":{"@id":"https:\/\/www.zframez.com\/articles\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/zframez\/","https:\/\/x.com\/zframez","https:\/\/www.instagram.com\/zframez_technologies\/"]},{"@type":"Person","@id":"https:\/\/www.zframez.com\/articles\/#\/schema\/person\/8b3b88007644501771d2452d3cc80f41","name":"sajith achipra","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3d9f27c5311500982b6f19d03d0506f1c328f30f51d8d5f73f46577687fd81f8?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3d9f27c5311500982b6f19d03d0506f1c328f30f51d8d5f73f46577687fd81f8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3d9f27c5311500982b6f19d03d0506f1c328f30f51d8d5f73f46577687fd81f8?s=96&d=mm&r=g","caption":"sajith achipra"},"sameAs":["http:\/\/www.zframez.com"]}]}},"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":1307,"url":"https:\/\/www.zframez.com\/articles\/networking-fundamentals\/introduction-to-tcp","url_meta":{"origin":1336,"position":0},"title":"Introduction to TCP","author":"sajith achipra","date":"September 12, 2025","format":false,"excerpt":"Introduction to TCP TCP and UDP are two transport layer protocols used to carry port numbers. We use these protocols to connect one process on a system to another process on the other side. Normally when a device sends a packet to a destination, it is meant to be collected\u2026","rel":"","context":"In &quot;Networking Fundamentals&quot;","block_context":{"text":"Networking Fundamentals","link":"https:\/\/www.zframez.com\/articles\/category\/networking-fundamentals"},"img":{"alt_text":"A diagram of the TCP three-way handshake showing the sequence of segments with SYN, SYN-ACK, and ACK flag bits.","src":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/09\/TCP-three-way-connection-establishment.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/09\/TCP-three-way-connection-establishment.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/09\/TCP-three-way-connection-establishment.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/09\/TCP-three-way-connection-establishment.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/09\/TCP-three-way-connection-establishment.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/09\/TCP-three-way-connection-establishment.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":1299,"url":"https:\/\/www.zframez.com\/articles\/testing-tools\/introduction-to-hping3","url_meta":{"origin":1336,"position":1},"title":"Introduction to Hping3","author":"sajith achipra","date":"September 3, 2025","format":false,"excerpt":"Hping3 Tutorial: Packet Crafting and Port Scanning When we use the basic ping command, it generates only ICMP Echo Request packets to test reachability. But sometimes we need more flexibility, for example, to test TCP or UDP responses, or even to check if a particular port is open. This is\u2026","rel":"","context":"In &quot;testing tools&quot;","block_context":{"text":"testing tools","link":"https:\/\/www.zframez.com\/articles\/category\/testing-tools"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/09\/Screenshot-2025-09-03-122046.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/09\/Screenshot-2025-09-03-122046.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/09\/Screenshot-2025-09-03-122046.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/09\/Screenshot-2025-09-03-122046.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/09\/Screenshot-2025-09-03-122046.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":240,"url":"https:\/\/www.zframez.com\/articles\/routing\/bgp-protocol-peering-and-states","url_meta":{"origin":1336,"position":2},"title":"BGP Peering Process Explained \u2013 States from Idle to Established","author":"sajith achipra","date":"July 18, 2024","format":false,"excerpt":"Understanding the BGP Peering Process When routers run BGP , they don't start exchanging route information right away. Before they can share anything, they need to form a stable connection, called a BGP peering session. This process involves multiple states, each indicating what\u2019s happening behind the scenes as the routers\u2026","rel":"","context":"In &quot;bgp&quot;","block_context":{"text":"bgp","link":"https:\/\/www.zframez.com\/articles\/category\/routing\/bgp"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/bgp-states.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/bgp-states.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/bgp-states.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/bgp-states.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/bgp-states.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/bgp-states.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":219,"url":"https:\/\/www.zframez.com\/articles\/routing\/bgp-protocol","url_meta":{"origin":1336,"position":3},"title":"Introduction to BGP Protocol","author":"sajith achipra","date":"July 17, 2024","format":false,"excerpt":"Introduction to BGP \u2013 The Backbone of Internet Routing In this tutorial, we\u2019ll go over the basics of BGP (Border Gateway Protocol) and what makes it different from other routing protocols. If you're just getting started with routing or trying to understand how large networks communicate over the internet, this\u2026","rel":"","context":"In &quot;bgp&quot;","block_context":{"text":"bgp","link":"https:\/\/www.zframez.com\/articles\/category\/routing\/bgp"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/BGP-packet.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/BGP-packet.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/BGP-packet.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/BGP-packet.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/BGP-packet.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2024\/07\/BGP-packet.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":1221,"url":"https:\/\/www.zframez.com\/articles\/networking-fundamentals\/networking-terminologies-a-beginners-guide-part-1","url_meta":{"origin":1336,"position":4},"title":"Networking Terminologies \u2013 A Beginner\u2019s Guide Part 1","author":"sajith achipra","date":"July 29, 2025","format":false,"excerpt":"Understanding how computer networks work starts with learning a few essential terms. This post introduces some of the core networking concepts in a simple and practical way. If you're just getting started with networking or brushing up on the basics, this will give you a solid foundation to build on.\u2026","rel":"","context":"In &quot;Networking Fundamentals&quot;","block_context":{"text":"Networking Fundamentals","link":"https:\/\/www.zframez.com\/articles\/category\/networking-fundamentals"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/07\/OSI-vs-TCP-IP-1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/07\/OSI-vs-TCP-IP-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/07\/OSI-vs-TCP-IP-1.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.zframez.com\/articles\/wp-content\/uploads\/2025\/07\/OSI-vs-TCP-IP-1.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1231,"url":"https:\/\/www.zframez.com\/articles\/networking-fundamentals\/networking-terminologies-a-beginners-guide-part-2","url_meta":{"origin":1336,"position":5},"title":"Networking Terminologies \u2013 A Beginner\u2019s Guide Part 2","author":"sajith achipra","date":"July 29, 2025","format":false,"excerpt":"This post continues from Part 1 and covers a few more important networking concepts. These terms often come up when learning how data moves through a network, especially when understanding how devices identify each other, how applications communicate, and how data is structured at each layer. 1. MAC Address \u2013\u2026","rel":"","context":"In &quot;Networking Fundamentals&quot;","block_context":{"text":"Networking Fundamentals","link":"https:\/\/www.zframez.com\/articles\/category\/networking-fundamentals"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/posts\/1336","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/comments?post=1336"}],"version-history":[{"count":2,"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/posts\/1336\/revisions"}],"predecessor-version":[{"id":1340,"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/posts\/1336\/revisions\/1340"}],"wp:attachment":[{"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/media?parent=1336"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/categories?post=1336"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zframez.com\/articles\/wp-json\/wp\/v2\/tags?post=1336"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}