<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Deepak Chourasiya</title>
    <description>The latest articles on DEV Community by Deepak Chourasiya (@yourownitsmedhc).</description>
    <link>https://dev.to/yourownitsmedhc</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F892996%2Fde6dea88-1205-4981-b966-c0c006a27c22.jpeg</url>
      <title>DEV Community: Deepak Chourasiya</title>
      <link>https://dev.to/yourownitsmedhc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yourownitsmedhc"/>
    <language>en</language>
    <item>
      <title>Confused About MSS and MTU ?</title>
      <dc:creator>Deepak Chourasiya</dc:creator>
      <pubDate>Sat, 16 Jul 2022 15:55:42 +0000</pubDate>
      <link>https://dev.to/yourownitsmedhc/confused-about-mss-and-mtu--kd2</link>
      <guid>https://dev.to/yourownitsmedhc/confused-about-mss-and-mtu--kd2</guid>
      <description>&lt;p&gt;&lt;strong&gt;Computer Network is a set or collection of linking devices.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In simple words , in networking there is transferring of data in the form of packets from one node to another node using protocols .&lt;/p&gt;

&lt;p&gt;Before coming to the point that what is meant by MTU ? , we need to know to know that what is meant by &lt;strong&gt;&lt;em&gt;Fragmentation&lt;/em&gt;&lt;/strong&gt; .&lt;/p&gt;

&lt;p&gt;So, there might be the case , where the packet is so big enough , because of which it is not able to get transferred to other network . To deal with these problem , it get break into parts , which is known as fragmentation .&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;MTU (Maximum Transmission Unit)&lt;/em&gt;&lt;/strong&gt; is concerned with the largest unit i.e. largest packet or frame size (in Octets) , which can be sent over the network such as Internet .&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example :&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Assume A and B as the networks , whose MTU is 500 Bytes and 200 Bytes , and the router only knows that how much packet size A can send and B can receive .&lt;/p&gt;

&lt;p&gt;To understand it easily , you should know the &lt;a href="https://www.geeksforgeeks.org/introduction-and-ipv4-datagram-header/"&gt;IPv4 Header Format&lt;/a&gt; .&lt;/p&gt;

&lt;p&gt;If DF (Do Not Fragment) = 1 , then router cannot fragment the packet , packet will go as it is or router will just discard it .&lt;/p&gt;

&lt;p&gt;If DF (Do Not Fragment) = 0, then router can do anything i.e. it can break it into any parts .&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--G4VmhTpZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mfooj3jvplbnjjt75cj1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--G4VmhTpZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mfooj3jvplbnjjt75cj1.png" alt="Transfer Of Packets" width="700" height="297"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                       Example of MTU
&lt;/code&gt;&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;Suppose here ,DF = 0, so router will divide the packet into fragments (Eg : 3 fragments).&lt;/p&gt;

&lt;p&gt;In every fragments , there will be Data and Header , here , size of header is 20 Bytes .&lt;/p&gt;

&lt;p&gt;So , here data of 480 Bytes (i.e. 500–20) , we divided it into 3 parts. Now fragment will get transmitted to B (as B’s MTU = 200 Bytes).&lt;/p&gt;

&lt;p&gt;Through the Identification Number , network B will come to know that the fragments are of the same packet only . In every fragment of same packet identification number will be the same .&lt;/p&gt;

&lt;p&gt;First fragment have MF (More Fragment) = 1 in its header , ,means it is saying that “Behind me more fragments are coming”.&lt;/p&gt;

&lt;p&gt;In third i.e. the last fragment , MF = 0 , means it is saying “ I am the last fragment”.&lt;/p&gt;

&lt;p&gt;It will use offset field to know that which fragment is first , which one is second , and so on.&lt;/p&gt;

&lt;p&gt;Fragmentation for MTU is done at Router and Reassembly is done at Destination.&lt;/p&gt;

&lt;p&gt;MSS stands for Maximum Segment Size , and Segment is the PDU (Protocol Data Unit) of Transport Layer. From these we come to the conclusion that MSS is the part of Transport Layer only.&lt;/p&gt;

&lt;p&gt;In TCP , connection get establish in 3 phases, that’s why it’s also called as Three-Way Hand Shaking . In request phase , sender and receiver communicates with each other i.e. “I have to send data , do you want to receive it or not , etc.”&lt;/p&gt;

&lt;p&gt;MSS is the largest TCP (Transport Control Protocol) segment size that a network connected device can receive .&lt;/p&gt;

&lt;p&gt;It defines the payload of TCP segment , and measured in Bytes , because TCP is Byte-Oriented Protocol.&lt;/p&gt;

&lt;p&gt;Application Layer pass data of any size on to the TCP Layer Protocol . But ,Transport Layer can forward or transfer data of 1460 Bytes to the next layer . Router will drop the segment if size of segment is larger than 1460 Bytes .&lt;/p&gt;

&lt;p&gt;And there are two headers one is IP Header of 20 Bytes , and other one is TCP Header o 20 Bytes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--86Zb8CEC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gs7peh4gv1ficwiex54i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--86Zb8CEC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gs7peh4gv1ficwiex54i.png" alt="Packet Format" width="700" height="284"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                    MSS (Maximum Segment Size)
&lt;/code&gt;&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;MSS = MTU — (TCP Header + IP Header)&lt;/p&gt;

&lt;p&gt;= 1500 — (20 + 20)&lt;/p&gt;

&lt;p&gt;= 1460 Bytes&lt;/p&gt;

&lt;p&gt;Similarly , MTU will be ,&lt;/p&gt;

&lt;p&gt;MTU = MSS + (TCP Header + IP Header)&lt;/p&gt;

&lt;p&gt;= 1460 + (20 + 20)&lt;/p&gt;

&lt;p&gt;1500 Bytes&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Congrats, Now you are a Champ in these MSS and MTU metrics.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>computerscience</category>
      <category>community</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
