Saturday, May 16, 2015

Network connectivity - the definitive guide.

Ever had network connectivity issues? I certainly have seen a good share.  I'd like to take a minute to go over, my definitive guide on navigating network connection problems.  I'm going to take a 'ground up' approach and assume nothing.  If you have some knowledge of your own environment and know certain things are working, then you can probably skip large sections of this post, and get to the 'good stuff' near the bottom - where I normally start, since it's most likely the be the problem.

From the top, from the perspective of one PC not being able to reach the internet:

First question: Do you have a network card?  This seems like a dumb question at first, don't all PC's have network cards?  Not always; in addition, the network interface can malfunction or be disabled.  While you may have a physical port for a network wire, it might go nowhere, so let's talk devices.

From your desktop as a starting point, if you go to start, and right click 'computer' you should be able to get to the computer's properties.  For those not using Windows 7, go to control panel, and select "system properties", and you should end up in the same place... this also works for 7, but the other way is easier.  Take a look at the left of the computer properties window, at the top you should have a link for "Device Manager" - go there.  When inside of device manager, you want to see if your network interface exists.  It may be listed as "NIC" or some brand-name of device under "network adapters", or if the device is lacking a driver, it may be under "other devices" as an "ethernet controller".  I'll tell you how to handle each of these potentially problematic situations.

If you can find a network interface, and you're convinced it's correct; if that device has no errors or warnings, you can bypass this entire section.  Go down to IP troubleshooting.

Device issues and troubleshooting.

Network interfaces is missing or doesn't contain a physical device.  Several "software" network interfaces can appear here, like virtual adapters if you have VPN software installed.  Ignore these, they are not relevant to this discussion, if the Network adapters section contains no items, doesn't exist, or only contains software adapters, then check device manager for "other devices" and determine if you have an unknown (yellow question mark) device listed as an "Ethernet controller".  If so, you need drivers.  You'll have to consult with your manufacturers website.  Briefly, there's a few places you can look.  If you know the make/model of adapter you have, you can easily look it up on google with the keywords: Driver download, and you should be able to find what you require to make the network interface work.  For external (usb) devices, the make and model should be printed on the device; for internal, things get a bit more tricky.  If the device is built-into the system, then you essentially have to look one of two places: if it is an OEM system (Eg. HP, Compaq, Toshiba, Asus, Acer, Dell, IBM/Lenovo, etc.) then you should visit that manufacturers website, and look up your model of PC and it should have the relevant drivers as part of a driver downloads section for that system (look for the system under 'support').  With Dell/HP this might be easier, since I know they use service codes to uniquely identify all PCs, you should be able to enter the service code in the support section of their site and get to the correct system.  For custom built systems, you'll need to know what the Ethernet controller is a part of, and look under that; most commonly, this will be your mainboard.  The mainboard should have the make/model clearly printed on it.

If the device is neither in "network interfaces" nor is it found under "other devices" is may be disconnected, malfunctioning or disabled on a hardware level.  Most commonly, this will be a USB device that isn't properly attached, or a device that is disabled in the BIOS.  Your mileage may vary, but at that point it is a hardware problem or malfunction that needs to be resolved.  Check your BIOS if you know how to do so, and ensure that all network interfaces are enabled, and in the case of USB, ensure that you're using a known-good port, and using known-good cables (if there are any additional cables connecting the device to the system).

When you have proper drivers, there should be the network device listed in "network interfaces" under device manager; then we have a whole other list of issues that could occur.  If the device is showing up with no warnings or errors, you can move onto the IP Troubleshooting section.

If the device has a small circle with a down arrow on it, it has been disabled.  Right-click and select enable, then reassess.

If there is a yellow triangle on the device, it has an error or warning, open properties and check the warning.  At this point, you may have to google the device name and the warning for a more in-depth understanding of what's happening, and what to do next.

At this point, either the device is working or you're googling for some answers on what error might be causing it to not work. So we move on.

So now, you have a network controller that has drivers and is working (not disabled).  Excellent.  Let's talk cables.  You should have a known-good network wire connecting you to your upstream device - the upstream device, depending on configuration, could be a switch, a router, a modem or some other Ethernet connectivity device, or media changer/extender.  On your PC, usually near the Ethernet controller port, you should have a green light.  Sometimes the light is a different color, most commonly green.  This indicates you have "Link"  it might blink to show activity, or it may have an amber companion light that blinks to show activity.  Not all Ethernet ports have lights, but most do.  If yours does not, plug the cable in anyways, and go look at the light indicating connection on your upstream device.  Some devices have one light to indicate multiple Ethernet connections - I can't help you here, but for almost every switch, router or modem I've encountered, with few exceptions, there are numbered lights.  Ensure that the numbered port you've connected yourself to, is showing that the associated port's light is illuminated to indicate connection.  The light may blink to show activity.

In the case of Wireless, you can "connect a wire" by selecting a wireless network to connect to.  Typically this is done within windows, and you only need to select a small icon made of multiple "signal" bars, in the bottom right corner near the clock.  left-clicking this icon should show a list of nearby available networks to connect to.  Remember, wireless has an OPTIMAL range of about 100m (without the use of specialty equipment), so ensure you're close enough to your router or access point to be able to receive the signal with sufficient strength to connect.  Wireless connectivity and reception issues are beyond the scope of this discussion.  Ensure you have the correct passphrase or network password to connect and that it shows that you are connected to that wireless network.  This is the wireless equivalent of "plugging in a cable".

At this point I assume you have a working device with the correct drivers and a reliable connection to your network, whether wireless or wired.

IP Troubleshooting.

Now we get into the nitty-gritty.  This is where things most commonly go wrong.  If someone calls me to get some assistance with their networking trouble, I start here, since typically, nobody touches their underlying networking configuration.

A great thing to do first, if you haven't already is to power-cycle the primary connectivity devices for your network.  What do I mean by that? easy.  Router, modem, switch if applicable.  Whatever is between you and the internet, reboot it. try again.  This is networking 101.  in consumer environments, generally, the equipment has a fairly high failure rate due to glitches, bad programming, lack of updates, or poor quality hardware or worksmanship.  This is the reality of low-cost equipment (by low-cost I mean less than ~ $500 for a router - which is what business/corporate grade stuff basically starts at).  By restarting it, generally you can "fix" any minor issues in the equipment, and continue on your merry way with little to no further work.  Enjoy.

For the rest of us, let's power on.  Start with a command prompt (windowskey+R, then type "cmd" will bring this up, or find "command prompt" in your start menu): type "ipconfig /all"  - we need the /all so we get gateway and DNS information too.  Don't type the quotes :) .

Breaking down ipconfig:

IP Address: this is NORMALLY, something starting with 192.168.x.x.  Depending on configuration.  For most consumer grade equipment, you're going to be dealing with the Class C private range (which is 192.168.x.x) as defined by RFC 1918.  All that blah blah being said, the IP address you have doesn't really matter, as long as it DOES NOT start with 169.254.x.x - these are what we refer to as "APIPA" addresses; Automatic Private IP Addressing.  the keyword there is "private": meaning, you can't go onto the internet with those addresses.  An IP address starting with 169.254 usually indicates that the DHCP server is not working; this is what gives you your IP address.  The DHCP service is usually provided by your router or modem.  You'll need to start investigating if those devices are working correctly, if you have a 169.254.x.x IP address.  They might be able to power on, but they might not be working, a replacement is easiest, but most costly, if possible try with another system, another cable, and try to narrow down if it might be a malfunction in the network device in your PC, a bad cable, a bad modem or router, or if it's something with your PC.  If you have a good cable, modem, router, and another system that gets DHCP, it may also be a firewall.  Check for any firewalling applications (Norton, McAfee, ZoneAlarm, to name a few), and try uninstalling them (BE CAREFUL, if you're uninstalling an application you PAID FOR, ensure you have the product key from the application before uninstalling it, so you can reinstall and re-activate the software without having to pay for it again).  If there's no firewall, there may be a faulty service on your PC, or the device may not be working correctly; services require a reinstall, faulty device can be bypassed by using (or borrowing?) another network interface (eg, a USB wireless device).

Assuming your IP is o.k.:

Gateway: the gateway is exactly that, your gateway to the internet.  Ensure that you have one.  It should have an IP that's similar, but not the exact same, as your system's IP address.  Eg. if your PC is at 192.168.0.100, then your gateway might be 192.168.0.1.  This is a common configuration but by no means the only configuration.  Ensure that you have one and that most of the numbers are the same.  Usually only the number after the last dot changes, but your mileage may vary, depending on the configuration of your network.  If you have no gateway, but you have an IP.  check if someone has set a static IP on your system.  Go to Network and Sharing center, select manage adapters on the left, right click your network interface and find "IPv4", select it, and press "properties" - all the items on the next page should be set to automatic.  If not, make note of what the settings are, then set them to automatic and retry your internet.  If this is already automatic, and "gateway" is blank on ipconfig, then the problem is likely going to be that you did not receive a gateway IP from your DHCP server. in the ipconfig output, it should show which DHCP server it got a response from, go contact whomever is responsible for that server, and complain to them.  Normally this will either be you (if it is a router) or your ISP (if the DHCP server is outside of your local network) - again, this will depend on configuration.

Next, ensure that you can reach your gateway, and that it is responding to requests by running a "ping" at the command prompt, followed by a space, then the IP of the "gateway" as reported by ipconfig.  If this does not respond, then the gateway may not be working, consult with your ISP if your router/gateway belongs to them, and if not, consider getting a new router or gateway for your network, or resetting the one you have to defaults and setting it up from scratch.

Assuming you have a gateway that you can reach, check if you are on the internet at all.  To do this, simply run a ping (from the command line) against any known-good IP address.  Most ISP's allow you to ping google, but "google.com" is a name, not an IP.  Google has DNS servers at 8.8.8.8 and 8.8.4.4, that are known to respond to pings; so if you don't know of a known-good IP address on the internet try to "ping 8.8.8.8" and see if you get replies.  The replies should say they're from 8.8.8.8, and should give the amount of time we spent waiting for the reply (usually in ms. usually less than 200. more and it could be a problem, contact your ISP for performance troubleshooting).  IF THERE IS NO REPLY or replies come from another source with a message like "destination network is unreachable" then you may not be connected to the internet.  Ensure all the appropriate lights on your modem are on, and try to communicate with your ISP for troubleshooting internet connectivity issues further.  There may be an outage or other issue that is beyond your control if this fails.

Assuming you can connect to the internet by IP address, the issue could also be your DNS servers.  You should have two listed in your "ipconfig /all" output, ping them, see if you get a response.  Additionally, try the command "nslookup" to try to resolve a known network name (any website is fine) - eg: "nslookup www.google.com" - it should reply with an IP address.  If not, and you get 3x (or more) "request timed out", then your DNS server isn't working.  You may be able to change to something known-good, like google's... Google maintains two Anycast DNS servers.  All that technical talk only really boils down to: Primary Google DNS: 8.8.8.8, Secondary Google DNS: 8.8.4.4. This can be changed under IPv4 properties, under "control panel", "network and sharing center", "Change adapter settings" (on the left), then selecting the network interface, and going to properties.  you should find IPv4 and you should be able to get into it's properties from there.  Just change the DNS settings on that page (at the bottom) to reflect google's DNS servers listed above, and re-test with nslookup.  If this still doesn't work, your ISP may be blocking DNS requests to external servers, talk to them if that's the case, they may have DNS servers they want you to use.

If your DNS resolution works but internet pages still don't load in your favorite browser, you may need to adjust your "connection" tab settings in internet options.  "Internet Options" can be found on the Control Panel.  Select the "connections" tab, and check to see if there are any dialing rules - there shouldn't be, unless you are using dial-up, or certain types of DSL... you should know if you are.  If you're using cable internet, or have a DSL modem that handles the PPPoE connection (again, if you use this, you should at least recognize the terms), then check "LAN settings".  under most normal circumstances in consumer environments, the next dialog should have everything unchecked.  "Automatically detect settings" is default, but I only find that it slows down my first connection to the internet, so I generally disable it.  Unless you specifically have a proxy set up, or you've been told by your ISP or network administrator to use a proxy, there shouldn't be one set; if there is, it may be the problem.

I know Firefox has it's own set of this same type of dialog, but I am unfamiliar with it.  I would ask Firefox users to test using another browser to ensure it's not JUST Firefox that's having the problem.  If it's just Firefox, you will have to investigate that independently.

Lastly, I want to touch on Firewalls.  The windows firewall generally only restricts unsolicited inbound traffic - meaning, when someone connects to your PC from across the network.  It can be opened to allow the inbound traffic, but generally doesn't block 'outgoing' traffic, eg. from a browser.  So the windows firewall should not ever stop you from connecting to the internet using your browser.  Other firewalls (as I mentioned above, McAfee has one, Norton has one, and there are others, such as ZoneAlarm), will vary on their implementation, but understand that it is very possible for one of these firewalls to stop outgoing connections, eg, from your browser, and prevent applications from reaching the internet.  If you have one of these installed, and you STILL cannot get connected to the internet, I would encourage you to either: disable it completely, OR, uninstall the application (be careful of any subscriptions you've paid for), OR, consult with the manufacturer on how to block/unblock programs from reaching the internet.  Each program is different and managing your firewall is beyond the scope of this discussion.

At this point, you should be back online.  If not, there may be something more major going on.  If you have a firewall-based gateway, it may be filtering web traffic.  Try another website, as your homepage might be down... There's a few items on this list I won't touch on, but they're very rare situations.  For the vast majority, this should be a (probably far too) complete guide on how to get everything working again.

Enjoy.

Monday, April 6, 2015

VoIP.ms

It's been a while.  Since the last time I posted, I've been experimenting with a Cisco CME deployment.

It's been.... interesting.  While CME is doing things very predictably, and as expected by the documentation, what I had to kind of figure out on my own is how to interact with a VoIP provider.

I chose VoIP.ms.  They're great actually.  Very well put together service, no significant bells or whistles, and the service is geared towards the skilled technician.  This means, not a lot is done FOR YOU; and the appropriate level of technical detail is included with the system - this means, SIP gateways on their end are well documented and redundant, they have the codecs and connection types and information all fairly well laid out, so if you know what you're doing, you can fairly easily acquire the information you need to get up and running.

No running around like a crazy person trying to hijack the communication to the upstream provider to try to determine codec information to try to emulate it with a PBX so you can finally use the system the way you want - which is how I would imagine buying a line from some of the 'all in one' VoIP solutions would be (MagicJack comes to mind).

All of that aside, some of the behavior isn't documented, and it can be EXTREMELY useful to know.  I'm tired of hearing "That number, has not yet been assigned" - which I get CONSTANTLY from voip.ms servers.

I'm still working out my dialing rules, but from experimentation, the outgoing SIP connection needs to have a PRIMARY number (in CME) of the 6-digit login ID for the line; otherwise the connection to the outbound voice SP will fail (resulting in the message "that number, has not yet been assigned" - possibly one of the most infuriatingly unspecific error I've heard).  However, when an inbound call comes, the DID phone number for the inbound call is used (10 digit number), if there's no such number (no match) in the destination PBX, then, the caller gets "that number has not yet been assigned".  joy. this again.

The "best" solution to put all my eggs in one basket, so far, has been to create an extension with the SIP login ID for the primary, and the 10-digit DID number as secondary.  That way, inbound, and outbound calls, all come from/go to the same extension.  Obviously, this doesn't work if you need multiple outbound, but for a simple deployment, it would work.

Now I get to dive into the wonderful world of trunks, and dial-plans to try to sort through this mess to make it work the way I ACTUALLY want.  I just wanted to document the difference between the incoming, destination number, and the outgoing numbers for VoIP.ms  something I hadn't come across.

Enjoy your tubes.