Dear Viewers - Now you can share your technical posts through this channel. Kindly write me for more details !!

Path MTU Discovery

This technique tests path with large packet and once it is found, the network MTU’s size is dependent on in each packet transmission. 

Let's take an example to understand - 
Image result for path mtu discovery
PC 1 sends the first packet to test  path in order to see what size is the largest for MTU. Once the packet crosses Network 2, the router immediately sends its feedback telling the host that 1500 KB is the MTU, then the packet proceeds with transmission to reach Network 3 in which the router provides feedback informing the host (PC1) that MTU is 1200 KB, after that the packet will continue its way to Network 4 wherein the router will let the host (PC1) know that the largest size is 800 KB. Finally, the host ( PC1) will set its MTU to 800, and all transmitting packets will be 800 KB until the last packet sent.

The default MTU is 1500 bytes in size, not including the Ethernet header or trailer. This means a host needing to send a TCP data stream would typically use the first 20 of these 1500 bytes for the IP header, the next 20 for the TCP header, and as much of the remaining 1460 bytes as necessary for the data payload. Encapsulating data in maximum-size packets like this allows for the least possible consumption of bandwidth by protocol overhead.

To find the proper MTU size, you'll have to do a special ping. This could be a local machine (a router, gateway) or a distant server on the internet (eg. google.com)

In case of a Windows machine the ping command should be formatted like:
ping [-f] [-l <packet size>] [host]
An example test-run would be:
ping -f -l 1472 google.com
(result = "Packet needs to be fragmented but DF set.")
ping -f -l 1462 google.com
(result = "Request timed out.")
ping -f -l 1452 google.com
(result = reply)
The options used are:

-f: set "Don't Fragment" flag in packet
-l size: send buffer size
In case of Linux, the command line should be:

ping [-M do] [-s <packet size>] [host]

An example test-run would be:

ping -M do -s 1472 google.com
(result = "Frag needed and DF set")
ping -M do -s 1462 google.com
(result = "Frag needed and DF set")
ping -M do -s 1452 google.com
(result = reply)

The options used are:

-M <hint>: Select Path MTU Discovery strategy. <hint> may be either "do" (prohibit fragmentation, even local one), "want" (do PMTU discovery, fragment locally when packet size is large), or "dont" (do not set DF flag).

-s packetsize: Specifies the number of data bytes to be sent. The default is 56, which translates into 64 ICMP data bytes when combined with the 8 bytes of ICMP header data.


 
HackersGear © 2010| Designed by Patch