Network Engineering
brian | Published: Feb. 19, 2024, 4:15 p.m. | Updated: May 25, 2025, 7:25 p.m.
MTU (Maximum Transmission Unit)
MTU: The largest frame (Layer 2) or packet (Layer 3) that can be transmitted or received on an interface(any network device) without fragmentation. When data is being sent over the network it may encounter devices that have a lower mtu capacity. When this occurs, the packets must be fragmented in order to accomodate the mtu capacity of that device, but at a cost because it decreases network performance. The default MTU in most cases is 1500bytes
MSS(Maximum Segment Size)
MSS refers to the largest amount of data that can be transmitted in a single TCP segment without fragmentation. MSS is a value set at the TCP level (layer 4). In the image below, when the two stations connect with eachother, they will negotiate the MSS value during the TCP handshake. The parameter specifies the maximum size of the payload portion of the TCP segmnet NOT inluding the TCP and IP headers
Path MTU Discovery
PMTUD: Is a technique that's used to determine the maximum size a packet can be transmitted without fragmentation. Lets say you're sending packets, and along the way there is a network segment with a smaller MTU capacity. In response to this, the device (maybe router) that's encountering this problem, will drop the packet and send out an ICMP back to the source. Upon receiving this ICMP, the source will initiate PMTUD, and it will continute to send out smaller packet sizes until it can determine the largest size the packet can be without it being fragmented.
Nagles Algorithm
Nagles Algorithm: is a congestion control algorithm used in computer networks, particularly in TCP/IP networks. The goal of Nagles algorithm is to lessen the amount of small packets that are being sent through the network. How is it done? Well the packets are bundled up, and there is a timer set known as (Nagles timer). During this timer, the packets are being bundled up, and once the timer goes off, or if the MSS is reached, then the data is sent in that single packet.
PROS: Can help reduce network congestion
Cons: Can increase latency in scenerios where the small data packets are required immidiately, for example messaging apps.
Below is an example of Nagles algorithm. The train is the TCP connection waiting for the people (packets). Then theres a timer that once it goes off, the train will depart, or if the train is filled with people (packets) it will also depart!