OnSong Console enables you to use any modern web browser to connect to a web application for the purpose of viewing, managing, and editing your songs in your OnSong library. This works by setting your iPad or iPhone running OnSong as a web server on your local computer network. This has the advantage of allowing any computer on the local network to securely access your library without requiring an Internet connection. However, it also means that Console uses an IP address assigned to your device.
What is an IP address?
An IP or Internet Protocol Address is like a phone number for identifying a device on a network. When you connect to a home or business network, your computer is automatically assigned an IP address so that information can be routed to and from your computer and the router. The router, as its name suggests, routes packets of information from the wide-area network (WAN) to the local area network (LAN) and makes sure the right computer gets the right information. Think of it like receiving mail at a large business. The business has one mailing address and the envelopes are delivered to the mailroom. From there, workers check the name and other information to route the message to the proper mail slot or room. Your computer network works in the same way.
So why does my IP address change?
Most people are not computer network engineers and that's a good thing. You don't need to work on things like subnets. But suffice to say, most home networks have a maximum of 255 devices. While this is good for home networks, it's not great for businesses. On any given day, a user with a phone and laptop may come to use the network for an hour or two and then leave. If each user acquired an IP address, the business would quickly run out of connections available. For that reason, just like a restaurant, your IP address is assigned when you connect using something called DHCP or Dynamic Host Configuration Protocol.
DHCP works just like a restaurant. When you arrive, you stop at the host station and they check and give you an open and (hopefully) clean table. That table changes each time you come, but they may seat you at the same table each time if it remains available. That’s exactly how DHCP works except instead of tables, it's an IP address. DHCP is managed by your router which can be configured to always give a specific device the same IP address. It would be like the mob boss coming into the restaurant and going to his table adjacent to the kitchen that no one else can have. If you set a static IP address on your iPad it would sort of be like self-seating. You pick a table and hopefully, you don’t pick one someone else was already using. Most routers have a DHCP “range” that is used for a dynamic assignment which allows for a different subset of other available IP addresses for static assignment. Think of this as having some bar seating where you can just walk up to and sit down (pre-COVID), but a hostess seats the rest of the restaurant. And now I’m hungry...
So this can mean I keep the same IP address?
Well yes and no. First, it does take some configuration. For instance, you could determine a free IP address on your network that is not used by DHCP and statically assign your IP address on that network. You would do this in the Settings app on your device and tap on the information button to the right of the connected network. At the bottom, you can manually configure the IP address and DNS server. You would need to find out what IP address to use for each from your router configuration.
If you know how to configure your router, you can also create an IP reservation in the DHCP settings of your router. That way everything can automatically connect to your network and the network will always assign the same IP address to your device no matter what. Even if the network is full of other devices, it may even kick someone else off the network and give it to you. Of course, that is outside of the scope of this article. Please consult your router manufacturer and documentation for how to do this, or hire a 13-year-old.
Neither of these is really a fool-proof solution because if you change networks, well there goes your IP address. Both of these solutions are specific to a specific network. Because you have to do some configuration, it's a slightly "fragile" solution too. If you get a new router, you'll have to do all of this all over again, for instance.
Bonjour (Hello in French)
Apple computers have a neat protocol called "Bonjour". Basically, it takes some of the foundations of what makes the Internet great and brings them to your local network. When your computer joins a local network, its name is broadcast to everyone and everyone then knows that the device called "Bob's iPad" is actually found at a specific IP address. Just like when you type "onsongapp.com" in a web browser takes you to the right place. The difference is that because you're on a local network and things come and go, it has to use broadcast messages to make sure all the computers keep an up-to-date record of who is where. The more generic term for Bonjour is called mDNS or Multicast Domain Name Service. Incidentally, this is also how your computer knows what printers, scanners, and pizza ovens* are on your local network.
OnSong uses Bonjour to register devices running OnSong on the local network. You can tap on the web address in the Console screen to view the “hostname” of your iPad or iPhone. This should look something like http://bobs-ipad.local or something similar. This hostname remains the same independent of which network you connect to and use. As long as your network and computer support it, this will resolve to whatever IP address the iPad is assigned on the network. The only issue here is Bonjour/mDNS doesn’t work on all platforms or networks, but generally, if you are using a Mac computer it will work properly. Just type that domain name into your browser location bar instead of the IP address. You can even set that as a bookmark and it should continue to work.
* We are not actually aware of any network-enabled pizza ovens on the market, but that would be cool wouldn't it? I mean, you could get an Internet-capable refrigerator so I'm sure they aren't too far into the future.