Detecting 3G/wifi connection using only IP - parsing

I've got an old connection log to a website which contains the IP addresses, the user agent string and the timestamp.
I want to know how many of them used 3G to access a website as I suspect there is a latency issue.
Now I know that I can use some code to have this info directly from the user.
But I still want to process this old log using only IP addresses even if it is only for one ISP.
I thought I could do that by finding a list of the subnets used for 3g.
Do you think it can be done?
Otherwise, what do you suggest?
Hope you can help.
Cheers,

One approach could be to lookup every IP using "whois" services, if the ISP listed is a phone carrier only, you can be certain the connection was made by a mobile connection.
This is not a total solution, but it might give you enough information.
Now, to find a service which will allow you to make all the requests required, might be another matter.

Related

Rails find wifi network of user

I would like to add a feature to my rails (5.0.1) application and have it only available on a certain wifi network.
Is there a way of finding out what wifi network the user is on?
Thank you!
Your question doesn't provide quite enough context. The short answer is "probably not how you want to." The long answer is:
If you're concerned about what network a user of your application is on, you can use request.remote_ip to get the remote IP,
If you're concerned about where your application is deployed, you can run a system command to get the current Wifi SSID (or equivalent) and run a check against that
Edit: Per your comment you want the ability to ensure that the user is only using it on your private network.
One way you can do this is to make the application not accessible from the outside world. This is a better question for something like serverfault.com
It's simply not possible to detect what Wifi network name they're connected to from Rails, or from Javascript (exceptions apply). But, you can, with a little sysadmin work, detect that they're connected to an IP within your private network.

Gatling test with multiple unique IP addresses

I have a Gatling load test that does a huge call to a webservice, and I can get response time information nicely, the problem is that all calls are done as a single user, thus cannot see the amount of concurrent users from Jennifer5 monitoring tool. I've searched but couldn't find a way to make multiple unique IP users to call this webservice, thus showing me the amount of concurrent users in the monitoring tool, however approximate that value would be.
I've found this page but this does not work at all, what should I do? I do not wish to switch to JMeter now, even though I think it does have this capability
As per the forum you are referring to
Note that, of course, you won't be able to do IP spoofing, but only use valid IP aliases.
So given your Scala code is correct you must have all the simulated IP addresses present in your operating system. Theres is a possibility to have more than one IP address on a physical network interface via IP aliasing, refer to your operating system documentation in order to learn how set additional addresses up. You may also find Using IP Spoofing to Simulate Requests from Different IP Addresses with JMeter guide interesting

How do I get a company name from an IP address?

I've searched around a while and all of the IP --> Hostname things actually only end up giving an ISP. Is there something that goes beyond that? I'm only finding pay services that go further and not something that I can just tap a nice API and programmatically do it.
http://ipinfo.io/ just ends up showing ISP for many of what I've sampled. I saw that guy posts here fairly often.
whoisvisiting.com runs about $99/mnth for what my company site does but in that range I'd rather code something. I'm using the free trial right now and have the IP's logging to analytics so I'm looking at what it returns, what IIS returns as the hostname and what a couple sources like ipinfo.io show and whoisvisiting somehow actually shows what I'm looking for.
There's no way to do so. There's no central registry for which company has which address ranges. In fact, most companies will just be identifiable via their ISP.
Your paid services might be scams, by the way, or just work on very few select companies and universities that actually act as autonomous entities in the IP sense.
It is unlikely to differentiate between ISP or company IP address. Some geolocation providers will use range size or level of allocation to name ISP or business. However, this approach is not always accurate.

How can I check that a computer can access a certain URL and send and receive e-mail?

With Delphi XE2, what is the most reliable method to detect if the computer is able to do the following things?
reach a specific website with HTTP which does not have a fixed IP address
send and receive e-mail with any local or remote e-mail client
There are too many factors involved (type of Internet connection, firewall/router rules, proxies, etc). The most reliable approach is to simply not try to determine the current state and just attempt the desired operation (perform the actual HTTP request, or the SMTP/POP3/IMAP operation, etc), and just be prepared to react to any errors. You can detect connection-related errors and prompt the user to check their Internet connection before retrying.
Use TIdHTTP.Get and try to download http://google.com.
Of course it depends on the definition of being connected to the internet. Sometimes web traffic (port 80) is blocked while other ports are open. Fortunately, nowadays most people are actually allowed to browse the web, since it also provides help with their daily activities. Google is probably one of the least firewalled websites with one of the highest uptimes.
But still, it's a lucky guess. Depending on what you need it for, you might as well just try your thing and see if it works. If not, apparently the computer was not properly connected, even if it could reach Google. :)
[edit]
Because of the discussion. InternetCheckConnection is a good alternative too, but it also checks the connection by pinging an actual server.
MSDN says
Use the InternetCheckConnection function to check the connection to
the Internet. It attempts to ping the server designated by the URL
that is passed to the function. If the FLAG_ICC_FORCE_CONNECTION flag
is set and the URL is NULL, the function checks to see if there is an
entry in the server database for the nearest server. If one exists,
the function pings that server
But since this function uses ping, it may be a bit faster than actually retrieving content. On the other hand, many firewalls actively refuse pings.

Send text messages between two computers through internet with delphi?

I want to write a app which will run on different computers and need all of then to communicate with each other like "utorrent" (peer to peer). This app only will send text messages.
How can I do this? I mean sending one message to remote computer on the internet?
I have a website and every app at start can send some information to it and find information of other apps on other computers (with PHP) but I do not know how address one computer through internet and send the data directly to that. I can find the ip address with PHP but it is the ip address of router (ISP).
How a message reaches a computer? I'm wondering about addressing every computer?
My brain really stuck here, I really appreciate any help. Thanks.
In a peer-to-peer network there's no centralized server for transmitting the data from one client to another, in this case the clients must be able to act as both the server and client. This means that either you'll have to be using UPnP like most modern torrent clients, which handles port forwarding in the router, or you'll have to manually forward a port to the computer in the router.
A centralized server (like a torrent tracker) is usually used to make the clients aware of each other's existence and tell them where to connect. This is where your PHP script comes in, though PHP might not offer the most effective way of doing this, assuming you're using it in combination with a webserver to serve the data though the http protocol.
As for actual text communication, you could use the Indy socket library for that. I found this example, basically which shows how to do it: http://www.ciuly.com/delphi/indy/indy-10-client-server-basic-demo/

Resources