I need to send a UDP packet over ethernet from 169.254.xx.xx to 192.168.xx.xx. The second address is the address of the FPGA and its MAC address is known. I am using wireshark to monitor the packets, but when i have an unbound socket, and I call sock.sendto()
it sends over WLAN. When I bind the socket to the WLAN interface, it sends, but when I bind the socket to the ethernet interface, I get this error when I try to send:
OSError: [WinError 10051] A socket operation was attempted to an unreachable network
When bound to the ethernet interface, and i send to an unused address in the 169.254.xx.xx subnet, it sends an ARP, but nothing is sent when the destination is in the 192.168.xx.xx subnet.
Here is the code:
import socket
import time
address = '192.168.1.239'
port = 1235
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind(('169.254.190.73', 0))
sock.sendto('100'.encode('utf-8'), (bytes(address, 'UTF-8'), port))
time.sleep(0.005)
sock.close()
'''
'''
'169.254.190.73' != '192.168.1.239'
Adapter sayNo active connection!
– dsgdfgmetrics
bind to socket"0.0.0.0"
address ! – dsgdfgIP
like on the processor(IP requiredIPv4
orIPv6
connection). Low level(hardware level) things requiredRAW
connection, so need using onlyMAC
. Other things (ipv4,ipv6) got a lot security bugs. You waste processor clock fornever used data
and never reached to1us or 2us
delay ! – dsgdfg