I have a device that collect data and implement a web server to show them. This should connect to a switch to be visible in the network. My problem is that it must be installed in different scenarios, I mean, sometimes the switch is configured for network autonegotiation (speed and duplex), in other cases the switch is configured in fixed mode (say 100M full duplex).
Is there a way/best practice to configure my device so that it can work in both cases? One idea could be to create a web page from where the user can select the connection mode, but, if a wrong setting is selected, I lost the connection to the device.
Related
I'm facing a challenging problem here that don't know how to resolve:
Context: I have a game launcher that connects to my server and if doesn't detect any cheating software on the player computer, launches the game and tells the server to allow that IP to connect to the game server.
This has many potential issues like if there are multiple players under the same IP but I make a queue in that case so all is fine until here.
Now the main problem is that I don't have control over what information sends the game, I can only modify the launcher. For this reason all is IP based as that's the only way I have to identify that a certain player is logging in and has been authorised by launcher. It goes:
Launcher connects to Server and tells him to Allow IP A.
Server replies: ok (save IP A)
Launcher starts game.
Player tries to login.
A connection is established to the server, server checks if origin IP (IP A) is allowed to log in, if yes, go ahead.
So, the system even though far from ideal, does the job, and considering game is compiled and we cannot modify it, I couldn't think of better way.
Anyway now we come to the problem:
Certain players, when they open the launcher, all goes fine, game launches but then when player tries to login server denies connection as it comes from a different origin IP!
That broke up my mind, how can two tcp connections made within a few seconds of difference from client A to server B have a different client source IP? obviously this ruins all my system. I even tried to periodically fetch IP from sites like whatismyip to see if it was changing overtime but it wasn't the case, it seems like maybe because it goes to another port, or I don't know the reason, sometimes changes it and sometimes it doesn't.
It seems to be related to players being using tethering internet connections,as I e never seen this before on a common internet connection.
So basically, I'm not sure what could I do to identify/relate those two connections and this is a big problem as many players are unable to join my game and I cannot let them join without the launcher for obvious reasons.
My random ideas to resolve it range from bad to terrible:
open multiple connections to server on different ports and see if that gives different source iOS
let player connect and then do some kind of validation based on netstat check on client: when player is connected to game server I should see it there and could send that info to server, server would kick any client connected if there's no validation from launch, however, I think I would still have the problem to link both connections.
maybe there's another way that I'm not aware of to identify this connections. Assume I have full control in server side and in launcher, but I cannot change the game server packet that does the "login" attempt.
Based on your assumptions (IP-based only, game/server unmodifiable), it looks like we are hitting a wall indeed..
For the moment the only thing that comes to mind is performing multiple requests to the server instead of one, and until the user finally logs in.
I mean:
Periodically: launcher connects to server and tells him to Allow current IP. Server saves this IP and hopefully at some point you will have discovered all IPs.
Do this in the backgound until the player is finalizing its login (or a fixed period of time)
With some luck, if you open multiple connections during the whole period of time needed to start the game and login, you will have discovered and allowed all IPs of the user. This will mitigate the issue but not eliminate it.
I'll edit this post if I think about something else.
I've created an electronjs app with pouchdb. The intent of this desktop app is to work within a wireless network of tablet application that share the same data that is pretty much blocked from the internet 95% of the time (hence the pouchdb implementation). In order for the tablet applications to sync with the desktop app, they need to be aware of how to connect to the desktop app within the network. My initial thought would be to broadcast the IP address of the electron js app in order to share data within pouchdb, but I'm not sure if it's possible. I am also thinking that I'll could install couchdb as a separate instance on the network, but would like to keep set up as simple as possible. Any ideas on how I can set this up with electron js and pouchdb?
You might be able to achieve the desired result using the Multicast DNS discovery service with Node. With mDNS, you can query the local network for other devices broadcasting on a specific namespace (e.g. 'myappid.local') which the application could query the network for.
multicast-dns is a module capable of querying the network for other devices broadcasting under a name and getting their local IP address.
After establishing a connection to other application instances on the same network, you could try replicating the database over that connection. A PouchDB plugin might be required for getting this data from Electron's main process to the renderer.
I'm searching for a solution to work on a Windows machine with multiple NICs/networks. While working within the network of a customer I tend to get a lot of problems. I need an internet connection for several things like git/sourcesafe/development system etc. but clients often can't offer internet access. So the solution is to use a mobilephone to connect to the internet and ethernet to access the client network/database.
Windows seems to be pretty random here. Sometimes everything works, some mintues later it trys to access the internet over the clients gataway or access the database via the internet. So I end up deactivting/activating NIC's all day long.
Is there some easy way to use the ethernet connection only to access the clients network and the mobile for everything else?
From what you described I think this might help: turn off DHCP for the interface that connects to your customers network and set a static address for that (without a gateway). Then configure your other interface to use DHCP. This should set ONE default gateway (your phone) and all traffic will run through it, except endpoints in your customer's net.
BTW: You can only have one default gateway at a time, of course, but in your case the gateway that was set the latest won, so to speak.
I work for a company and we have a device that we are installing in small shops for their payment transactions. This device uses internet connection as the primary connection and in case internet goes down, it fails to 3G connection. During this time there is a downtime for few minutes
But we are having issues, where customers are calling us and says that their site goes down repeatedly throughout the day. When we look into our logs we see that our device has indeed failed over and back a number of times from primary to 3G and back to primary. We advise them that they need to check with ISP and make sure there is no internet drops.
Often customer say that they have consulted with ISP and they seem to say there are no issues from their end.
The only other possible reason that I can think of as to why the device keeps falling is due to faulty cabling. Are there are other way that we can test out that the problem is to do with Internet and not our device?
Perhaps you ought to expand the test routines included in the device, assuming the device has the memory capacity and/or libraries and computing power available.
For example, does your device determine the Internet is down only if it cannot reach a certain IP destination? If so, you may want to expand this by 1) testing to ensure timeouts aren't too short due to upstream congestion, 2) testing another known location such as Google's DNS server 8.8.8.8 when the intended destination IP fails, and 3) testing the internal gateway to determine if the ISP modem/router has rebooted for some reason.
Consider the following situation:
You have an application you are tesing, but in order to test the networking functionality of said program, you are required to run multiple instances of it and have them communicate with one another.
Possible solutions are:
- Run software on individual machines connected by WAN or LAN.
- Run the software on virtual machines, all on the same computer.
I do not want to use either of these methods (the reasoning is irrelevant). I want to know if there is a way that I can reroute network transmissions from the test application (ideally in any programmming language) in a way such that I can run multiple instances of the same software on one computer, and have them behave as if they were the only instance running on that computer.
In other words, I want to be able to code the application so that each instance listens on the same "listening" port (since only one instance will be running on each computer when in production). Then, I want to know if I can reroute the network requests at a lower level then the application so that they do not interfere with eachother (clash over the same port number).
Essentially, I want to build a virtual environment which only redirects the network calls (whereas a virtual machine takes far more resources, and has way more involved). Is this possible, and how might I approach this problem?
Thank you!
UPDATE: This is a more accurate idea of what I want to accomplish:
Basically, I want to program another application which TRANSPARENTLY redirects bind requests to available ports, and manages which applications are bound where... So from the applications perspective, all the instances are bound to port 1000, but in reality, this other application is automatically managing which instance is bound where, and avoiding potential conflicts. I feel like this could be accomplished with Windows Hooks, but I'm not sure how you could implement this?
As far as I know, there is no sane way to multiplex the same port on the same network device. At the very minimum, you will need to choose on of the following:
Run each instance of your program on a different port
Create multiple virtual network interfaces
The first choice is easy and may be the one I would choose. The second one is more towards what you are looking for but it would be a true PITA to set up - you can look into VirtualBox and its host-only networks for inspiration. If you are writing things on linux you might look into pipes and chrooting but you'll be spending more time setting up this environment than writing your software.