UDPSocket
I need to query my server (self-built) not locally but through an external IP, I set Port Forwarding but now I wonder how the client can point to a non-local IP but (example) > IP 151.66.30.122
@ErelSe il tuo server non ha un indirizzo IP statico assegnato dall'ISP, puoi utilizzare un servizio ddns dinamico come https://www.noip.com/
@Erel I already use noip and the phone reaches the local pc very well but vice versa notIf your server doesn't have a static ip address assigned by the ISP then you can use a dynamic ddns service such as https://www.noip.com/
@Star-Dust in reality this is not the case, because the ports do their job, locally in fact I have no problems everything goes smoothly, unlike remotely from phone to pc it arrives and from pc to phone it doesn'tNote that both must have a public IP.
If you communicate between PC and mobile it is possible that the mobile device does not have a public IP.
Or if one (or both) devices are inside a LAN/wifi you have to enter routing policies in the router to get the packet to the right device inside the network
unlike remotely from phone to pc it arrives and from pc to phone it doesn't
Note that both must have a public IP.
If you communicate between PC and mobile it is possible that the mobile device does not have a public IP.
This means that the mobile device reaches the PC that has a public IP and not vice versa, and indeed you can't cast from pc to mobile,
Perché sei nella rete locale 192.168.1.143
Comunque era solo un consiglio, continua il tuo lavoro sicuramente troverai risposte alle tue domande
Because you are in local network 192.168.1.143
However it was just a piece of advice, continue your work surely you will find answers to your questions
I don't think I'll find an answer in UDP, I have no experience and no head in this period and I don't even notice as you mentioned that I'm local.
I feel quite an asshole to disturb the network, lose credibility and look like an asshole.
I'm trying to study MQTT hoping to understand it also because in the erel examples I find errors that I don't know where to start from and I don't have a support that can help me
you have an exampleYour phone's IP address of 172.20.10.3 falls within the private IP range of 172.16.0.0 through 172.31.255.255. Your phone provider is using private IPs instead of public IPs, just like your devices are at home that are connected to your home network. Your routers sees this private IP when your PC is trying to communicate with your phone and drops the packet, since your network has no device with IP 172.20.10.3. In your case MQTT would be one of the solutions to use for your problem. For a more "real time" feel, you may also want to investigate WebSockets, where your phone would do a WebSocket connection to an application on your PC.
UDPSocket
I need to query my server (self-built) not locally but through an external IP, I set Port Forwarding but now I wonder how the client can point to a non-local IP but (example) > IP 151.66.30.122
Thank 1000I'm afraid there isn't a simple short answer. Let me first summarize the specific network behavior for the private network address space, which is a network address in the following three network addresses:
10.0.0.0 - 10.255.255.255 (10/8 prefix)
172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
192.168.0.0 - 192.168.255.255 (192.168/16 prefix)
A private address space is a network address which can’t connect to the public internet because a router doesn’t route those private addresses. However you can take additional measures in the router like port forwarding to overcome this restriction for a specific address or add an additional rotation rule in the routing table of a router.
The difference between the “light” session less UDP protocol and TCP is that UDP doesn’t give a guarantee for a successful delivery of a UDP packet and there is nothing to indicate a failure or succesfull delivery of a UDP packet! If a successful delivery is needed your must add additional programming to overcome this protocol behavior. If a device use the TCP protocol to connect to a device on an other network segment, the router add the sending network address in a session table for the return traffic.
Special network addresses:
The highest network address of a network segment is used for the so-called multi cast address. All devices on a network segment will respond when this address is used.
Poi c'è un cosiddetto indirizzo di loopback 127.0.0.1, ma potresti vederlo sotto il nome "localhost". Puoi usarlo per verificare se lo stack di rete funziona correttamente e il sistema operativo Windows (OS) consente il loopback di qualsiasi protocollo per questo indirizzo di rete. Questo è il motivo per cui l'utilizzo di questo indirizzo non richiede una voce nell'elenco dei filtri del firewall per il traffico in entrata e in uscita.
Nella tabella di routing l'indirizzo 0.0.0.0 viene utilizzato come destinazione per tutti gli indirizzi di rete sconosciuti.
Due dispositivi di rete possono comunicare liberamente tra loro purché si trovino sullo stesso segmento di rete senza l'ausilio di un dispositivo di rete di routing. L'intervallo di indirizzi inclusi di un segmento di rete dipende dalla maschera di rete utilizzata o dal prefisso per un segmento di rete. È possibile limitare un segmento all'utilizzo di 255 indirizzi mediante una maschera di rete di 255.255.255.0.
Specialmente l'uso corretto della maschera di sottorete è sempre la cosa più difficile in ogni percorso di rete, perché è facile fare una configurazione errata che si traduce in una comunicazione impossibile tra due o più dispositivi nel segmento di rete.
I dispositivi di rete possono comunicare senza conflitti solo se tutti i dispositivi hanno indirizzi di rete univoci. Lo scopo di DHCP (Dynamic Host Configuration Protocol) è fornire una gestione rapida, automatica e centralizzata per la distribuzione di indirizzi IP univoci per un segmento di rete per superare la necessità di correggere manualmente gli indirizzi di rete.
Ogni dispositivo di rete ha un indirizzo MAC (Media Access Control) hardware univoco a 48 bit. È possibile utilizzare l'indirizzo MAC univoco della scheda di rete (noto come scheda di interfaccia di rete) nel server DHCP (nel router) per assegnare a quell'indirizzo MAC univoco un numero di rete DHCP fisso. Oppure, come ha detto Erel, utilizzare il servizio ddns dinamico come https://www.noip.com/ per superare la necessità di correggere manualmente gli indirizzi di rete.
Un router connesso alla rete internet pubblica ha sul sito internet un'interfaccia accessibile da tutti gli indirizzi su internet. Dietro il router ci sono gli indirizzi di rete privata non instradabili. Il port forwarding è una tecnica che aggiunge un indirizzo di porta specifico sull'interfaccia Internet pubblica che instrada il traffico verso una porta specifica e un indirizzo di rete privata specifico locale.
Quando guardiamo a questa conoscenza della rete alla domanda originale di Ivano Angelo Monti
Sembra che venga utilizzato il protocollo UDP senza sessione, o semplicemente detto "attraverso di esso oltre il muro e si spera che il server lo raccolga, attraverso il nulla oltre il muro".
Se Ivano Angelo Monti vuole ricevere qualcosa dal server ci sono due problemi con l'uso del protocollo UDP. Innanzitutto il server conosce solo l'interfaccia pubblica del router Internet di Ivano Angelo Monti, ma non l'indirizzo di rete privata specifica locale di un dispositivo sulla sua rete privata. E con l'uso predefinito di DHCP sulla sua rete privata, il dispositivo sulla sua rete può avere qualsiasi indirizzo di rete, quindi questo complica l'uso del port forwarding dopo che un dispositivo riceve un nuovo e altro indirizzo del dispositivo sulla rete privata Ivano Angelo Monti.
In questo caso l'uso del port forwarding che può essere semplice “attraverso qualcosa attraverso il buco nel muro e arriverà al dispositivo giusto” non funziona quando non si usano indirizzi fissi. O semplicemente “funziona fino al prossimo riavvio del dispositivo e/o del router”.
Quindi, considerando quanto sopra, la risposta è che UDP può essere utilizzato come un modo semplice per inviare qualcosa a un server centrale senza riferire al dispositivo di invio. Se qualcosa deve essere rispedito, è più conveniente utilizzare una sessione TCP per superare una complessa configurazione del router di rete.
Check if your ISP Provider is blocking portsUDPSocket
I need to query my server (self-built) not locally but through an external IP, I set Port Forwarding but now I wonder how the client can point to a non-local IP but (example) > IP 151.66.30.122
If you allow me, the problem is that you don't read the answers carefully, sometimes you ignore them completely or you even criticize them with observations that aren't always relevant to the problem. If you ask questions, you must be willing to accept the suggestions or at least consider them carefully.Non credo che troverò una risposta in UDP, non ho esperienza e non ho testa in questo periodo e non mi accorgo nemmeno come hai detto che sono locale.
Mi sento proprio uno stronzo a disturbare la rete, perdere credibilità e sembrare uno stronzo.
Sto cercando di studiare MQTT sperando di capirlo anche perchè negli esempi erel trovo errori da cui non so da dove partire e non ho un supporto che mi possa aiutare
I don't think I'll find an answer in UDP, I have no experience and no head in this period and I don't even notice as you mentioned that I'm local.
I feel quite an asshole to disturb the network, lose credibility and look like an asshole.
I'm trying to study MQTT hoping to understand it also because in the erel examples I find errors that I don't know where to start from and I don't have a support that can help me
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?