Best software product to simulate connectivity issues for mobile testing - iphone

I need a product to simulate network latency for testing mobile applications (in particular iphone and android). I plan to set up a wifi router connected to a linux box, and write a number of scripts to approximate different types of connectivity issues.
So far, I've taken a cursory look at Netem and ns-2 (or its offspring ns-3). Netem looks very easy to deploy and configure, but they both look like they'll require some in-depth investigation.
Does anyone have positive/negative experiences with either of those solutions that they could share? Or maybe used a different solution for this problem?

If anyone comes here looking for tips, I've found a solution that seems to work well.
Ubuntu comes with Netem installed, so I went ahead and just made use of that. Basically, I got a computer with two ethernet ports, forwarded one to the other and applied Netem latency settings to the connection. Then I attached a wireless router to one, and LAN to the other. Netem lets me play with all kinds of latency and packet loss settings.
Btw, I also tried to use a few different laptops and set the internal wireless card up as an ad-hoc wireless router. I got it working for the most part, but finding a laptop with an internal wireless card that plays nice with ad-hoc in Linux is tricky at best... can't recommend it.

Related

There is no STM32 chip through the USB driver WIFI module program?

I want to make a network camera, stm32 through the camera to collect images, and then sent to the server through the WIFI module. As 1 second need to transfer a lot of data, so I would like to use the USB interface wifi module program to achieve. Or what better solution to achieve.
Thank you!
I think that you have no idea how the USB works.
You have a couple solutions.
Use a wifi module with SPI interface.
Use a SOC like CC3200.L
Use ESPxxxx module or similar (RTL8710)
You can of course try to use STM with host usb interface, but you will have to implement the USB host stack + driver for USB wifi module + network stack (eg TCP/IP stack). But it is quite complicated as the STM ones are not very good, there are some better paid ones - but expensive. USB host is not easy to implement.
If you want to go along the "networking over USB" path on STM32 (and I'm assuming you're not planning to buy any commercial drivers) it's going to be rough for you.
When it comes to USB, vast majority of the WiFi dongle drivers are proprietary and unless you're on an operating system such as Windows or Linux you're out of luck, unless you want to for the reverse engineering or porting at least parts of the drivers from Linux. With the USB you can think of using the USB-ECM (ethernet over USB) class, but two things here. One - ST doesn't provide any free implementations of this class so you're down do searching for it or implementing it yourself. After a bit of googling I've found one instance of this on githbu, although I havent tested it myself. Second thing - this is no longer wireless as you'll need to be connected to some kind of host providing internet connection, at which point it's probably better to not use USB-ECM and networking at all and just send data using a class that can be implemented easily (USB-CDC or USB-HID). I'm a bit worried about the throughput here.
You can also try to find WiFi modules that are connected over other interface. Generally those modules are connected over UART, some over SPI. This way, integrating it with the TCP/IP stack will also be up to you, at least when it comes to implementing the WiFi module protocol (most likely AT-commands) and implementing network interface so that the stack can "talk" to it. In this approach, I'm almost sure that you'll lack the throughput required for your application.
Personally I'd strongly suggest trying Ethernet if that's an option for you. It's going to be highest bandwidth (which you're going to need), plus it's most "out of the box". There's multiple projects implementing various applications using a free LWIP stack over this interface, including examples generated by ST's CubeMX.

Extending Wifi/WLAN Range with one NIC on a Laptop

I plan to extend the range of my Wifi with my Notebook. - My question to this, is it possible to build a wireless repeater with only one NIC? or do I really need at least two NICs, one for being logged in and receiving the packets and the other for extending the WiFi/Signal. - Actually, what I wanna do is, using my laptop as a WiFi-Repeater, but only with the built-in NIC, no second one.
I've searched the net already but found nothing about the functionality of a WiFi-Repeater and if they have two NICs integrated.
Hope you guys can enlight me ;)
EDIT(added schemes):
Possibility A
Possibility B
What can be achieved with an AP capable Chip/Firmware, for instance, the Ath9k.
You can't turn laptop's WiFi into range extender, since I believe it requires a special WiFi chip firmware and a special configuration of antenna(s).
However, you might try to look on the internet if WiFi chip you have supports AP mode in firmware (not all manufacturers provides that), and if yes, you can set up the access point with the same SSID. In this case your WiFi clients will roam from one AP to another. Of course, this kind of setup requires Ethernet cable attached to your laptop.

A project whereby to choose between wi-fi and bluetooth

Im doing a research about connectivity.
But Im still wondering what the costs are for implementing a bluetooth chip or wifi module in a device that will allow me to connect to the iPhone. Does somebody here know something about these costs?
A website with these modules is also sufficient.
Thanks in advance
They're both relatively cheap. However, bluetooth is very limited when it comes to connectivity due to the half-ass job Apple did in implementing the required protocols to do something constructive with it. Wifi is limited because you have to establish some sort of AdHoc network (unless you have a wireless router in between), but after that you are basically limitless (though you have to do a lot of manual labor when it comes to implementing something useful.)

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.

WOL iOS Project

There are free projects/examples of wol (wake on LAN) for iOS?
I've found this one [openwol][1] but it's old and has no signs of recents updates.
Also I've been digging on it and it's not working as expected, the main purpose of it is wake a computer but it's not working. I've spent some time on it and still no work.
Maybe there are other examples or someone else may join on me and solve/update this code to work?
Wake-on-LAN generally doesn't work for machines on wireless networks, as the wireless hardware is typically powered down when the machine is off or asleep -- it's usually only supported for wired Ethernet. As such, wake-on-LAN is unlikely to give acceptable results on an iOS device, as it'll only work for some specific network configurations (i.e, networks where the wireless segment is bridged to a wired segment that the target system is connected to).