Creating ICMP fragmentation needed packet in Scapy

1.7k views Asked by At

I want to create ICMP fragmentation needed packet using Scapy. When I give type = 3 and code =4 and display the message again, it shows me type =destination unreachable and code = fragmentation needed. But I also want to see one more field associated with this ICMP "next-hop MTU". DO I need to create custom field or is there any other way I can create it. Here is what I'm doing.

i=ICMP()
i.display()
type = 3
code = 4
checksum = 0
unused = 0

Display it again

i.display ()
type= destination unreachable
code = fragmentation needed
checksum =0 
unused = 0
1

There are 1 answers

0
Dragonborn On

from other references it seems you can use:

i.unused = mtu