I have trouble with my sniffer. I'll be short and i'll try to explain this in best possible way. Here is my code (mostly copy-paste from python doc but it's not clear to me):
- Code: Select all
# the public network interface
HOST = socket.gethostbyname(socket.gethostname())
# create a raw socket and bind it to the public interface
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP)
# receive all packages
# receive a package
data = s.recvfrom(65565)
data = ''
print 'An error happened'
# exit program
The problem is, on my computer (Windows 10), i can see only UDP packets whereas on my friends PC (Windows 7/8) we can see UDP and TCP too. I tested program on one more PC which runs Windows 10 and that one got only UDP too.
Why am i not seeing TCP packets at all?
Also, can somebody explain me how comes that entire Ethernet frame is 1518 Bytes where as IP packet (which is inside Ethernet frame) is 65565 Bytes? I'm 100% i do not understand this and it's probably noobish question but i just can't find an answer on Google.