from scapy.all import *

Ether().show()

IP().display()
l3 = IP(dst="www.google.com", tos=72) / ICMP(id=1, length=256, seq=57)
print("Layer 3 = ", l3)
l3.show()
sr(l3)

def write(pkt):
    wrpcap('HW2.pcap', pkt, append=True)  # appends packet to output file

for pkt in l3:
        write(pkt)  # sends the packet
        print('pkt == ', pkt)