0
votes

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()
''' 
   '''
1
'169.254.190.73' != '192.168.1.239' Adapter say No active connection!dsgdfg
And if haven't any idea about metrics bind to socket "0.0.0.0" address !dsgdfg
@dsgdfg binding to "0.0.0.0" doesn't seem to workhsifeulbhsifder
169.x.x.x and 192.y.y.y are different network, need routing. Also, 169.x.x.x is an automatic IP for unconfigured network cards (no DHCP, no manual config), you should have a look at your pc´s network config.C. Gonzalez
Dear friend, low level communication never used an IP like on the processor(IP required IPv4 or IPv6 connection). Low level(hardware level) things required RAW connection, so need using only MAC. Other things (ipv4,ipv6) got a lot security bugs. You waste processor clock for never used data and never reached to 1us or 2us delay !dsgdfg

1 Answers

1
votes

Since 169.254.xx.xx and 192.168.xx.xx represent different networks, traffic in between needs to be routed. However, 169.254.0.0/16 (autoconf) isn't usually routed.

If both nodes actually reside in the same layer 2 segment, just (manually) change the autoconf client's IP address.