IP_PMTUDISC_PROBE = 3
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(('10.0.0.1', 8000))
s.send('Hello World!')
s.setsockopt(socket.SOL_IP, IP_MTU_DISCOVER, IP_PMTUDISC_DONT)
s.send('Hello World!')
Setting the flags field of the IP header