Sunday, February 17, 2013

uPnP

Universal Plug And Play

Uses TCP/IP, HTTP, XML, and SOAP to have devices automatically discover/control/configure each other over the network. The most common uses are DLNA uPnp Media Servers, and Automatic Port Forwarding Configuration (NAT Traversal).

How it works

My favorite description of how uPnP works is here - http://www.upnp-hacks.org/upnp.html. ssdp:discover (Simple Service Discovery Protocol) M-SEARCH Messages are sent over UDP multicast 239.255.255.250 port 1900. Using uPNP Develeoper Tools we can use the device sniffer to see the SSDP messages running around our network. We can also see lots of ssdp:alive NOTIFY messages with the LOCATION specifying the URL to get the soap wsdl xml for each device. Within the XML there are service nodes for each service supported by the device. Within each service node the SCPDURL is a relative URL to an xml description of the methods supported by the service. Using Device Spy we can browse all uPnp Devices on our network, determine their services, and even issue commands to them.

Windows Media Player Sharing

Every windows 7 PC on my LAN has a uPnP AV media server running as Windows Media Player Sharing device. Even though I can discover these devices I can't seem to access any of the media on them. To control the windows media server go to Control Panel, Network and Sharing Center, Advanced sharing settings. From here we can see windows 7 and window 8 by default have network discovery (SSDP) on. It seems however Microsoft did bolt some security on to uPnP. To control who can access your media files Media Streaming click on Choose Media Streaming Options, Turn On Media Streaming and then select which computers on your LAN can access your media files.

If we open windows media player, click on stream, and check allow remote control of my player - we can use Play To to Play Videos on other windows 7/8 boxes. Funny thing is I think windows 8 might have removed play to command functionality. It seems while windows 8 can be controlled, it can't be the controller. In order to work windows media player does need to be open on the target machine, WMP will not auto start.

uPnP Media Server has three uPnP services that show up under Computer Name\User Name
  1. ConnectionManager
    GetProtocolInfo(), GetCurrentConnectionIDs(), GetCurrentConnectionInfo(),
  2. ContentDirectory
    GetSearchCapabilities(), GetSortCapabilities(), GetSystemUpdateID(), Browse(), Search(), UpdateObject(), X_GetRemoteSharingStatus()
  3. X_MS_MediaReceiverRegistrar
    IsAuthorized(), IsValidated(), RegisterDevice()
If windows media player is running we see a Windows Media Player Device with more services
  1. ConnectionManager
    GetProtocolInfo(), GetCurrentConnectionIDs(), GetCurrentConnectionInfo(),
  2. AVTransport
    SetAVTransportURI(), GetMediaInfo(), GetTransportInfo(), GetPositionInfo(), GetDeviceCapabilities(), GetTransportSettings(), Stop(), Play(), Pause(), Seek(), Next(), Previous(), GetCurrentTransportActions()
  3. RenderingControl
    ListPresets(), SelectPreset(), GetMute(), SetMute(), GetVolume(), SetVolume()

Security

Many say the uPnP is insecure and should be turned off on the router. The biggest security flaw is that some routers have exposed uPnP commands to the wan (the internet) and keep them exposed even with uPnP turned off in the web interface. Go to shields up to see if your router has this major problem. Another problem with uPnP is the fact that there is no security in the protocol. If you get malware within your lan it can always connect to your router and possibly reconfigure it to expose your lan to the wan. For example you need a password to log in to the router UI, but there is no password required to send control commands through uPnP. Next I go on figuring out what can be controlled/configured through uPnp on my RT-N66U Router here.

Tuesday, February 12, 2013

Does my Laptop Support 5GHZ?

Dell Wireless-N 1520

Using Inssider I noticed my laptop (Dell Wireless-N 1520) shows a 5GHZ band, but my netbook (wireless G) did not. Investigating a bit more in device manager my Dell wireless Card seems to have an option to prefer a band networks. So my laptop card does support wireless a 5GHZ Band. I ran a speed test and got some surprising results:

Connected to 2.4GHZ Band. 
Link Speed 117 MBPS
Network Utilization during File Xfr 60%
File Transfer on LAN 7.10 MBPS

Connected to 5.0GHZ Band
Link Speed 300 MBPS
Network Utilization During Xfr 12%
File Transfer on LAN 2.10 MBPS

The 5.0 GHZ Router is in same room and in line of site. No walls. Very surprised how sucky it is. Wasn't sure if it was router or the Dell Wireless-N 1520. So I ordered TP-LINK TL-WDN4800 Dual Band Wireless N900 PCI Express Adapter, 2.4GHz 450Mbps/5GHz 450Mbps, IEEE 802.1a/b/g/n, WEP/WPA/WPA2.

TP-LINK TL-WDN4800

Using default driver in W8 (Qualcomm Atheros AR938X Wireless Network Adapter) I confirmed connection on 5GHZ band using Inssider.
Connected to 5.0GHZ Band
Link Speed 450 MBPS
Network Utilization During Xfr 60%
File Transfer on LAN 15.47 MBPS
Definitely not my router. I'd like to compare N speeds on this triple stream card but I see no option in the default driver to prefer the 2.4GHZ band so the only way to test 2.4GHZ would be to use different SSID names for my bands. Maybe later....

Saturday, February 9, 2013

ESS (Extended Service Set)

Should I use the same SSID on my 2nd WAP and setup an ESS (Extended Service Set)? Apparently if I configure the same SSID, the same WPA2 Authentication, same Key, etc. on different WAP's. Clients should then be able to roam between them. ESS is often used in company's to increase coverage to wireless area. See here. Another good link. I suppose it also increases fault tolerance. If one router goes down for maintenance the other continues working.

Beside the fact that config settings need to be identical, the main disadvantage is loss of control. From the client we can specify preferred SSID's but that's it. There is no way I can find to pick the WAP with this MAC ID over another with the same SSID. After booting both windows and android clients, each would link to the WAP with the strongest signal. As I roamed I stayed linked to the WAP that I was closest to on boot even when I moved it next room with the other WAP. The signal was still pretty strong so I am not sure what threshold might cause it to re-evaluate. I am guessing it only reconnects when signal is lost? It does not seem to re-evaluate signal strength over time (Unless I didn't wait long enough). With different SSID's when I move my client to another room I could manually reconnect to the closer WAP. With the same SSID I seem to have to reboot. On the flip side, even though I like the idea of control, I really don't picture myself manually doing anything to maximize throughput. Perhaps the same SSID is the best?

Another questions is whether to use the same SSID for the 5GHZ band and 2.4GHZ band on my RT-N66U dual band router. Currently I have them configured as seperate SSID's. Here is an interesting link with a good argument for keeping them the same. inssider does make it possible to detect not only what channel but also which WAP you are connecting to (IT is listed in BOLD Lettering). Also checking the System Log in the router web page we can get a list of connected MAC's.

The more I look the more I see people who like it or hate it. For testing, separate SSID's is definitely the way to go because it gives control. For every day use I am leaning towards the same SSID being simpler. Just google

5ghz ssid and 2.4ghz ssid

Friday, February 8, 2013

Authentication Methods

  1. Open System (No Authentication)
  2. Shared Key
  3. WPA-Personal
  4. WPA2-Personal
  5. WPA-Auto-Personal
  6. WPA-Enterprise (For Company's)
  7. WPA2-Enterprise (For Company's)
  8. WPA-Auto-Enterprise (For Company's)
  9. Radius with 802.1x (For Company's)

As of 2012 WPA2-Personal is the best. All home routers should be set to this. A Shared Pass Phrase must be set on the router and supplied by each client. Encryption uses AES CCMP (Not TKIP as in WPA).

If and ONLY if you have some old device that won't connect then you should use WPA-Auto-Personal. WPA can only use wireless G Speeds. Some recommend setting up a separate WAP to support older clients.

Tuesday, February 5, 2013

Wireless Router N Speeds

Wireless Routers have the following N speeds in their advertising: N300, N450, N600, N750, N900. Great Link I got this info from. My RT-N15 is an N300 Router. My RT-N66U is an N900 Router.

We also have this concept of mimo streams. single-stream (max 150 per Band), dual-stream (max 300 Per Band), and three-stream (max 450 per band). I think each antenna can broadcast a different stream at a different angle to bounce off a different wall while using the same 20MHZ channel bandwidth. So this triple streaming has nothing to do with Channel Bonding.

So I think my RT-N15 is a dual-stream 2.4GHZ N300 Radio WAP and can do max 130 (20MHZ Single Channel) / 300 (40MHZ Channel Bonding). There is no separate radio for a 5 GHZ band. In single channel Mode inssider reports max rate of 144, not 130? In 40MHZ Channel Bonding Mode I still see Max Rate of 144.

My RT-N66U is a triple stream 2.4GHZ/5GHZ N900 (dual) Radio and can do max 217 (20MHZ Single Channel) / 450 (40MHZ Channel Bonding). There is a separate radio for the 5 GHZ band. While this radio can be active while the 2.4GHZ radio is active I do not think a single client can combine data from both spectrums at the same time. Hence the max 450 and not max 900. In inssider is see max rate of 216.

Most laptops, wireless phones, video game systems, etc. only connect through the 2.4 GHZ band. To take advantage of three streams, and/or 5ghz band you need to buy newer nics. For example this one is 30 bucks at amazon now http://www.amazon.com/Rosewill-Wireless-Adapter-802-11a-RNWD-N9003PCe/dp/B009VKON0S/ref=sr_1_2?ie=UTF8&qid=1360206397&sr=8-2&keywords=n900+pci+express. Here a mini pci express card for a laptop that is dual band three stream. http://www.amazon.com/Intel-Ultimate-633ANHMW-802-11n-Adapter/dp/B0038A9HSK/ref=sr_1_2?s=electronics&ie=UTF8&qid=1360210110&sr=1-2&keywords=mini+pci+express+wireless+card+5ghz

Monday, February 4, 2013

Wireless Channel Bonding

802.11a/n supports Wireless Channel Bonding. Not to be confused with Dual band which indicates support for both 5GHZ spectrum (wireless a) and 2.4GHZ spectrum (wireless b/g/n). As the last post points out channels sets in 1, 6, and 11 in the 2.4GHZ n space each use about 20MHZ of spectrum each. My older RT-N15 WAP supports channel bonding using two adjacent channel sets (40MHZ). This is why in inssider we see a 5+9 and for our neighbors a 10+6. My newer RT-N66U dual band WAP also supports channel bonding but it seems to only use one channel set from the 2.4GHZ spectrum (at least according to inssider). From what I've read channel bonding works best when there is no interference and the 5GHZ address space is less crowded. This requires a nic with an a radio, dual band client wireless nics. None of my wireless nics on my laptops seem to connect in the 5GHZ space. In the Router Home Page we can see a channel bandwidth setting of 20MHZ or 20/40MHZ. The 20/40MHZ setting in the router web page enables channel bonding. In some cases Channel Bonding can even hurt performance, see here. Another thing to keep in mind is that connectivity in the 5GHZ address space has a much shorter range than the 2.4 GHZ address space, however it can transmit much more data when it works. It seems wireless channel bonding (40MHZ) can only be used with adjacent channels. We cannot for example combine one 20MHZ channel from 2.4 GHZ spectrum and one channel from 5 GHZ spectrum.

Saturday, February 2, 2013

WLAN Channels

Most like me leave the wifi channel at auto. From what I am reading we can get better performance by selecting a channel. The following page has some info on channels. http://en.wikipedia.org/wiki/List_of_WLAN_channels The thing that confuses me is it best to pick from 1, 6, or 11 OR 1, 5, 9 or 13? I mean who uses wireless B anymore? The following link has a post half way down the page that explains it. http://forums.smallnetbuilder.com/showthread.php?t=7415. We don't realty know if our neighbors are using B. If they are then only 1, 6, 11 are safe. If we all stopped supporting B then 1, 5, 9 or 13 would be best.

There are a few ways we can detect what channels are being used (ours and our neighbors). From cmd prompt on windows 7 we can see channels using the following command

netsh wlan show all
The WLAN Autoconfig service needs to be running to make this work and we need to have a wireless card. So run it from a laptop with wireless. On my Dell Laptop the Dell Wireless LAN Card Utility has a Site Monitor Tab that Lists Channels and Signals. Yet another option is to download inSSIDer. The funny thing to me is none of the tools seem to agree on what is the next strongest wifi signal strength. From my readings I and all my neighbors seem to like 1 most. 11 Next. No one is using 6. The thing is the most important factor is not signal strength it is use. If someone is streaming video on channel 1 we want to switch to channel 6 or 11. The problem is we can't detect use directly. We can only detect signal strength. Still with this information if we find no one on channel 6 then we should use it.

I have tested more and noticed that neither of my WAP routers stick to a set channel on auto, so all of this information on the internet must assume really old equipment. My RT-N66U moved it self to channel 6. My RT-N15 has also adjusted itself on the fly to an area with less channel activity. They both must have the same capability inssider has to detect what channels are in use.

Tuesday, January 29, 2013

Adding LAN Ports

I have an old Asus RT-N15 Router sitting around doing nothing and was thinking of setting it up in the living room to add more LAN ports and to improve wifi reception as a 2nd AP (Access Point) SmallNetBuilder is a Good site and has good links for subnetting a 2nd router. http://www.smallnetbuilder.com/lanwan/lanwan-basics/30740-how-to-use-a-router-to-add-network-ports?start=1 It turns out in my Administration Tab I can change it from Home Gateway to Access Point. In Access Point mode, four LAN ports in the RT-N15 and other wireless devices are set up in the same local area network. The WAN related functions are not supported in this mode. In this mode, NAT is disabled and four LAN ports in the RT-N15 and other wireless devices are bridged together. In the Manual it mentions that even the WAN port will be modified to work like a LAN port. This should prevent the need for another subnet. I think all I will need is a static IP so I can always remote into this device.

Friday, June 22, 2012

MAC ADDRESS

MAC (Media Access Control) aka Hardware Address is burned into every ethernet NIC.
48 bits (6 bytes in Hex).


MAC Fields

Bit Range Field Name Decimal Hex Info
47 (1 Bit) Individual/Group (Broadcast) 0 1 Indicates this MAC Address is a Broadcast or Multicast Address
0 Means this is a Device Address.
46 (1 Bit) Global/Local OUI 0 1 Indicates this is a locally governed OUI Address
0 Globally Administered IEEE OUI Address.
45-24 (22 Bits) OUI (Organizationlly Unique Identifier) 0 0 Company ID. Assigned by IEEE.
23-0 (24 Bits) Vendor/Maufacturer Assigned ID 0 0 Usually NIC SN.

Link to lookup OUI at IEEE
http://standards.ieee.org/develop/regauth/oui/public.html

Sunday, June 17, 2012

Ethernet Cable

Unshielded Twisted Pair (UTP). The more twists the less cross talk.
In 56A Pins 1 and 2 have green in them.
In 56B Pins 1 and 2 have Orange in them.
If the colors on one side of the cable are in different order than other side, then we have a crossover cable as apposed to straight thru cable. My home routers all have Smart Sense technology so a crossover cable is not necessary to connect WAN ports. Crossover cables are usually used to connect switches/routers or workstations directly without the use of a router.

Monday, May 14, 2012

OSI Layers

Open Systems Interconnection.
Links
http://en.wikipedia.org/wiki/OSI_model

Please Do Not Throw Sausage Pizza Away.
  1. Physical
  2. Data
  3. Network
  4. Transport
  5. Session
  6. Presentation
  7. Application
  1. Physical - Bits
  2. Data Link - Frames
  3. Network - Packets
  4. Transport - Segments

Physical

Physical Topology. Moves Bits between devices. NIC Card. Hub. Repeaters. Wires.

Data Link

Logical Topology. Framing. Error Detection, Notification (NOT Correction). Flow Control. Delivery on LAN using MAC, Physical Addresses. Switches and Bridges. Switches Break up Collision Domains. Data Frames have source and destination MAC Address in header. LLC (Logical Link Control) Header. MAC (Media Access Control) Header.

Network

Routed Protocols IP (Header) and IPV6 transport Data Packets through an internetwork (devices that aren't locally attached). Logical Addressing. Routing Protocols update neighboring routers with Route Update Packets. Examples are RIP Routing Information Protocol, EIGRP Enhanced Interior Gateway Routing Protocol, and OSPF Open Shortest Path First. Routers break up Broadcast Domains, will not forward broadcast or Multicast packets. Routing Table Holds Network Address, Interface, Metric

Transport

TCP, UDP (header). Reliable or Unreliable Delivery. Error Correction before re-transmit. Connection Oriented Communication. Virtual Circuit. SYN, SYN/ACK, ACK. Three way handshake. Flow Control. Receiver governs amt of data sent by sender by sending ack for each segment. Segments are ordered - delivered in the order they are transmitted. Window is the # of segments that can be sent without waiting for a Flow Control ack. Positive acknowledgement with retransmission.

Session

simplex, half duplex,full duplex.

Presentation

Translation. Compression. Encryption. EBCDIC to ASCII

Application

FTP, HTTP, SMTP, SNMP, Telnet, DNS, DHCP.

Wednesday, April 11, 2012

IP Addresses

The Host ID of 0 is always reserved to represent the network itself. The Host ID of 255 is reserved for broadcasts to all hosts on network. The iana Has a list of all Class A Blocks by company. 127.0.0.0-127.255.255.255 is reserved for Loopback (localhost).

Classful network

Class 1st 4
Bits
Network ID Range
xyz for Host Octets
Network
Bit
Length
# of
Networks
# of
Hosts
Host ID Range
wxy for Network Octets
A 0------- 001-126.x.y.z 8 126 16,777,214 w.1-254.1-254.1-254
B 10------ 128-191.1-254.y.z 16 16,384 65,534 w.x.1-254.1-254
C 110----- 192-223.1-254.1-254.z 24 2,097,152 254 w.x.y.1-254
D 1110---- 224-239.x.y.z wiki
E 1111---- 240-254.x.y.z

Subnetting

Supply the Subnet Mask OR CIDR (Classless InterDomain Routing) # and IP Address.
Network ID
Host ID
Hosts Allowed
IP Block Range Min
IP Block Range Max
Class
Default Subnet

Private Address Ranges

Use the following Private Address Ranges for use behined a Firewall, not on the public internet. They cannot be used on the public internet.
CIDR Subnet Mask Network ID Range
xyz for Host Octets
Host ID Range
y for Network Octets
IP Range
10.0.0.0/8 255.0.0.0 10.x.y.z 10.1-254.1-254.1-254 10.1.1.1
10.255.255.255
172.16.0.0/12 255.255.240.0 172.16.y.z 172.16.1-254.1-254 172.16.1.1
172.31.255.255
192.168.0.0/16 255.255.0.0 192.168.1-254.z 192.168.y.1-254 192.168.1.1
192.168.255.255