I am trying to use pyshark to put all of the ip src or dst into a list, which I later want to graph with matplotlib, to see which IP addresses sent or received the most traffic(not trying to do both at once). However, when I iterate through the packets of my capture, I print the list after each packet until I hit an IPV6 packet(I think) with a destination address of 'ff02::fb', and I get an error that says "KeyError: 'layer does not exist in packet'" I am trying to find a way around this so I can graph the results.
cap = pyshark.FileCapture('p-02.pcap')
ipList = []
for packet in cap:
if ("IP" in str(packet.layers)):
thisip = packet['ip'].dst
ipList.append(thisip)
print(ipList)
Here are the results: