What are server racks and how do they work.? - webserver

I see pictures of server racks with small little devices on them.
My question is that how are server racks connected onto each other and also target a single connection? How do they work interms of connectivity.

Related

Solution to remote power cycle embedded devices

I am looking for a solution to remotely power cycle embedded devices that are connected via a USB hub to a server. I have a software solution (usbreset.c) that was posted in several responses in stack overflow - rebooting the usb port. This works if the device is still alive, can be detected by the server, but, it just fails to communicate with the server. I have had to use it a few times. however, sometimes the device could hang or freeze on a gui page and there is no serial communication. This requires physically power cycling the device using it's on-off switch. Someone suggested raspberry-pi solution. But as per that solution, I would need one raspberry-pi per device. It's as if using a raspberry-pi to serve as a relay. This is expensive and cannot scale. Could relays work in this situation i.e. the power pins of each device connect to a relay. So, one relay per device. There are remote IP power cycle solutions. so via a web interface it is possible to check which device is offline and power cycle just that one. Such solutions are common in IT. However, is such a solution viable to remote power cycle embedded devices connected at the other end?

Is it possible to connect two ios devices using sockets by getting their IP addressess?

I want to connect multiple devices through socket without any server implementation.I will use that only for getting the IP addresses of the devices that will register.
There are two major problems to peer-to-peer communications: discovery, and reachability.
First, you need to know the IP address of the other peers to connect to them. Once you're connected to a mesh of peers, they can all keep each other updated on the state of the network, suggesting better peers to each other, passing around notifications of new peers who've joined and left, etc. But you have to design and implement a mechanism for trading that information. More importantly, you need to jumpstart things in some way, because when a new peer starts up, it's in a mesh of just itself, and it has no information to give itself.
One possibility is to have a handful of well-known "superpeers" (that you run) that are always connected, and bake their addresses into the app. Or you can have "introduction servers" instead of peers, serving much the same function. Or you can have some external way of trading addresses (the simplest is that users trade them on a web forum or an IRC channel or in person and type them in manually), which can be automated to various degrees. There are also shortcuts that can help—Bonjour can get other peers onto the mesh as long as one peer on the LAN is already there; GameCenter/GameKit can be used as an automated external trading network; etc.
Once you've solved the discovery problem, you still have the reachability problem. Most iOS devices usually don't have publicly-accessible IP addresses; instead, they're behind routers that do Network Address Translation, whether they be a home WiFi router or a cell carrier's 3G network. This means you need some way to do NAT Hole Punching to get two iPhones talking to each other. Somebody who knows both the public address and the internal address of each device can arrange for them to set up a connection to each other. You can have either normal peers do this (although that makes the jumpstart problem even bigger) or have your superpeers/introduction servers/etc. do it.
If you want to build all of this yourself, you probably want to look at other implementations. BitTorrent (including trackers and DHT) is well-understood and documented at a continuum of levels ranging from "lies-to-children" for curious end users to detailed protocol specs and open source implementations. And then look at some other P2P networks, because BitTorrent is not perfect, and doesn't try to do everything that everyone's come up with.
You can use GameKit. It has the matchmaking api that can help you.
It can be used for non game apps.
I've been working on something similar and it's a giant pain in the ass. There are 3 considerations: 1) Reachability 2) Discovery 3) The connection itself.
1) Don't even consider using 3g/4g, it just won't work well for keeping an open socket connection.
2) I'd use some sort of broker service between the two on the internet to connect the two. For discovery, you can just list what devices are available on the service.
3) For the connection, I find the IOS socket libraries to be rather painful to use, but if you go down to the BSD socket level it's not as bad. I think it'd be very interesting to use zmq sockets; that might simplify writing the broker service.
You can't. If the device is all online with wifi, it maybe possible and rely on the router setting just like pc connect. If some device is connected with 3g or gprs protocal , they may have no ip address at all.

iPhone: connecting to multiple networks

I'm currently working on a project that requires the iPhone to connect to another device using an Ad-Hoc network (WiFi). Simultaneously, I require a connection to the internet in order to upload data to a server also using WiFi.
My question is: is the iPhone capable of connecting to multiple networks?
If not, is it possible (and viable) to switch between networks assuming the data rate is low? For example, iPhone receives data via Ad-Hoc, disconnects, connects to other WiFi network, established connection with server, sends data, disconnects from network, reconnects to Ad-Hoc network etc?
If the data rate is low and you are talking to another iOS device, check out GameKit.
This is Bluetooth, though.
I have not seen a way to connect to multiple wi-fi networks simultaneously.

iPhone chat application

I have try to make chat application with socket programing and I am using Chatty source code and its working perfect on same network. But not work for different network.
Is chatty work for different network iPhone?
I have tried chatty for different network in iPhone but no success.
Any idea about chatty for different network for iPhone?
From looking at the source code for Chatty, it seems that it just uses an IP and port number to connect to a different device, and that's the reason why you can't connect when users are in a different network. Being able to connect or not will depend a lot on the network configuration you both of your devices have.
For example: it works if you're in the same wifi, because there's no firewall between the devices, and the IP is reachable (192.168.x.x, for example). If you take one of the phones to a 3G network, it won't be able to reach the other one in the wifi, but the one in the wifi might still be able to reach the one on the 3G, depending on your career and port number, and if the network stack is on in the phone. So, conclusion is: this will be highly unreliable.
Usually, for this kind of communication, apps rely on a third party, so both of your phones connect first to a webserver, that is always available on the internet, and the web server sends the messages to each of the apps. This also solves the problem of one app going off the network (when you take an elevator, for example).

connecting to multiple peers over wi-fi

I have to implement wifi connection with more than one device at a time. In the current example, if i am connecting any two peers, data can be exchanged between them but those devices are no more available in other devices.
I want to implement something like server-client over wifi. In which server can communicate with all and client can communicate with server. All simultaneously.
It is something like this post
I want to know is it possible to connect with more than 1 device simultaneously over wifi? If yes, then what is the maximum number of devices that can be connected in same pattern?