Friday, 15 May 2015

How To Boost Your Home Wi-Fi Signal (Part 1)

Do you regularly lose connectivity to your Wi-Fi network at home? Are network speeds so low that it takes forever to even copy a simple picture or music file across your PCs – let alone stream video? In this two-part series, we are covering the most important lessons and tips for boosting wireless (WLAN) throughput across your home network. Ready? Let’s dive in!

Figure out the best possible router position

Have you wondered why your wireless signal is strong in some rooms and incredibly weak in others? It’s not only a matter of distance between your wireless router and your PCs or laptops. It’s also a matter of what objects (walls, doors, furniture, electrical equipment/outlets) interfere with a good signal.
In many scenarios, you will be able to boost wifi strength significantly by just repositioning either your router or the connected PCs slightly.
Now, the “Trial and error” method works eventually, but is a waste of time. To get the best possible location you need to create a visualization of network coverage across your home. Heatmapper, a free software for Windows, will do just that:

Click here to download Heatmapper (100 MByte). Note: A registration is required to download this free tool.
After installation, the program asks you if you’ve got a map of your map of your floor – no worries, if you don’t, you can create this heatmap based on a grid. Simply walk around your apartment or house with a laptop in your hand running Heatmapper. As you walk (slowly!), use the left-click button frequently as you walk. Walk through all the areas of your home left-clicking as much as you can.
When you’re done, right click and HeatMapper will create a map of your home, showing you where the Wi-Fi signal is stronger or weaker. Here’s how my map at home looks like:
The green area in the middle is also the center of my apartment – a good location for the router! However, in the bedroom (upper part of the screen) I only get „ok“ wireless strength because the router is blocked by three walls.
By looking at the heatmap, I quickly knew where to position the router in order to get a better Wi-Fi signal!
General advice: Make sure not to position the router directly on the floor or next to thick walls. Ideally, the best position is in the center (probably the corridor) of your apartment with no or minimal objects blocking the signal!

Use the latest drivers and firmware

It’s rare to find firmware for a router or driver for a network adapter that works perfectly right out of the gate. Most „V1“ drivers and firmwares of network equipment I have used were bad and came with all sorts of problems: slow connections, drop outs, missing features and other quirks. The first thing I always do when I get a new network device is: look for updates!

For example, when I bought my Linksys WUSB600N adapter it didn’t work (at all!) under the 64-bit-version of Windows 7. I actually bought the device and couldn’t use it for a couple of weeks until the manufacturer delivered an updated driver that worked under the x64 architecture.
Upgrading the firmware of your router has become somewhat easy over the past couple of years: Simply open up the firmware configuration page in your browser (see below) and find the „Firmware Upgrade“ page.
Here you will find direct links to drivers for some popular router manufacturers:
These links will you to the most recent Wi-Fi drivers available. Your wireless adaptor is not on the list? You haven’t found anything using popular search engines? Hit the comment section and provide us with the detailed specs of the Wi-Fi adaptor as shown in your device-manager.

Upgrade your Wi-Fi hardware

If you’re using the 802.11g (or even b/a) wireless standard, more bandwidth-related tasks such as video streaming, launching remote applications or file copy operations will be painfully slow. All three network standards provide a relatively low maximum bandwidth:
Theoretical speed
802.11 (1997)2 MBps
802.11a (1999)54 MBps (short range, high cost – mostly in business use)
802.11b (1999)11 MBps (slower, but higher range than a)
802.11g (2002)54 MBps (long signal range)
802.11n (2006)300 MBps (through multiple channels and frequencies)
802.11ac (2012)1 GBps (through multiple channels and frequencies)
As you can see, 802.11ac is the way to go these days. Over the next couple of months, it’ll replace the older 802.11a/b/g networks, and offers much improved speed, coverage and reliability. In general, 802.11ac is at least twice as fast than its predessor “n” while promising theoretical speeds of up to 1000 Mbp/s.
If you’re suffering from a low network bandwidth, be sure to pick a router and Wi-Fi adapters that supports at least the 802.11n specification. If you bought a PC or laptop within the last couple of years, it’ll (very likely) have a 802.11ac wireless adapter. To go check, simply fire up Device-Manager…
…or take a look at your hardware specification sheet, for example:
If your adapter does not support 802.11n or ac but your router does, it’ll obviously use the lower N, G, B or even A modes. So make sure that all parts of your wireless chain are “n” compatible!
When shopping for a new network adapter or a router that supports 802.11ac, you should take the following three tips into consideration.

Pick a dedicated USB adapter:

Even if your laptop or desktop has a built-in 802.11ac adapter that is connected to a full-fledged 802.11n router, you might want to look into getting a dedicated (external) USB wireless adapter. Sounds ridiculous, but in my experience many external Wi-Fi adapters perform much better than built-in devices.
When I first got my Linksys WRT610N router, I got quite mixed results and only an average of 100-170 Mbps when the theoretical limit of this beast is around 300 Mbps. So I drank the cool-aid and ordered the adapter that, according to the manufacturer Linksys, “works best with” my router – the WUSB600N USB wireless adapter! And what a difference that made: Signal strength did not change, but the speed went up significantly. Here’s a screenshot of my laptop that’s using both the built-in Wi-fi chip as well as the external USB adapter to connect to the router:
The maximum speed meter went up from 130 Mbps to 300 Mbps. Of course, that is the peak value, but only with this little addition was I able to stream full-definition 1080p video across my apartment with no stuttering or delay whatsoever.

Stay in the family: Besides using external dedicated Wi-Fi devices, I’d also recommend to pick a router and the adapter from the same company. Now, that doesn’t mean that a Linksys router wouldn’t work with a Broadcom or D-Link network adapter, but it’s also my experience that you get the best-possible performance if you „stay in the family“. Now I know that this is what the manufacturer wants but in this case I’d go with it.
Use an external antenna for your router. You can significantly boost your Wi-Fi connection by replacing the antenna or add another external antenna. This guide as well as this one help you figure things out.

Change the Wi-Fi channel

All modern routers are capable of communicating to your PC or laptop on several different channels. However, if your neighbours Wi-Fi equipment is communicating on the same channel, your network speeds and reliability might suffer. Windows offers a built-in solution that lets you see on what channels all your surrounding Wi-Fi networks conmunicate. This is how it works:
Step 1 – Launch the command line. To do that, click on the Start orb, go to „All ProgramsAccessories“ and click on „Command Prompt“.
Step 2 – Type in the following command: netsh wlan show all.

Step 3 – You’ll see a large list of all wireless networks in your area.
Scroll through the list and watch out for the entry that says „Channel“. Out of those 7 networks, 4 are using channel 6 to send data, two use channel 5 and one is using channel 13.

This is why I should probably choose either a lower channel or a channel between 6 and 13.
Try changing the channel on the routers configuration page.
To open the page, you’ll usually enter it’s IP adress into your browser (check the manual to see which address you need to type in), for example http://192.168.1.1, and enter the user name and password you specified at setup – or the default credentials if you never specified it (which is potentially dangerous)!
Find your wireless channel settings. On my router, that’s under the “Wireless” tab right in the “Basic Wireless Settings” category:
Pick the channel that is not (or barely) used in your area. In my example, I choose channel 10. Reconnect all your devices and see if you’ve got better speed or if you’re reliability issues are fixed!
That was part 1 – look out for part 2 that’ll show you even more in-depth tricks to improve your wireless network speed!

Friday, 1 May 2015

Data Communication & Computer Network

Data communications refers to the transmission of this digital data between two or more computers and a computer network or data network is a telecommunications network that allows computers to exchange data. The physical connection between networked computing devices is established using either cable media or wireless media. The best-known computer network is the Internet.
This tutorial should teach you basics of Data Communication and Computer Network (DCN) and will also take you through various advance concepts related to Data Communication and Computer Network.

Audience

This tutorial has been prepared for the computer science graduates to help them understand the basic to advanced concepts related to Data Communication and Computer Networking. After completing this tutorial you will find yourself at a moderate level of expertise in Data Communication and Computer Networking from where you can take yourself to next levels.

DCN - Transport Layer Introduction

Next Layer in OSI Model is recognized as Transport Layer (Layer-4). All modules and procedures pertaining to transportation of data or data stream are categorized into this layer. As all other layers, this layer communicates with its peer Transport layer of the remote host.
Transport layer offers peer-to-peer and end-to-end connection between two processes on remote hosts. Transport layer takes data from upper layer (i.e. Application layer) and then breaks it into smaller size segments, numbers each byte, and hands over to lower layer (Network Layer) for delivery.

Functions

  • This Layer is the first one which breaks the information data, supplied by Application layer in to smaller units called segments. It numbers every byte in the segment and maintains their accounting.
  • This layer ensures that data must be received in the same sequence in which it was sent.
  • This layer provides end-to-end delivery of data between hosts which may or may not belong to the same subnet.
  • All server processes intend to communicate over the network are equipped with well-known Transport Service Access Points (TSAPs) also known as port numbers.

End-to-End Communication

A process on one host identifies its peer host on remote network by means of TSAPs, also known as Port numbers. TSAPs are very well defined and a process which is trying to communicate with its peer knows this in advance.
TSAP
For example, when a DHCP client wants to communicate with remote DHCP server, it always requests on port number 67. When a DNS client wants to communicate with remote DNS server, it always requests on port number 53 (UDP).
The two main Transport layer protocols are:
  • Transmission Control Protocol
    It provides reliable communication between two hosts.
  • User Datagram Protocol
    It provides unreliable communication between two hosts.

DCN - Network Layer Protocols

Every computer in a network has an IP address by which it can be uniquely identified and addressed. An IP address is Layer-3 (Network Layer) logical address. This address may change every time a computer restarts. A computer can have one IP at one instance of time and another IP at some different time.

Address Resolution Protocol(ARP)

While communicating, a host needs Layer-2 (MAC) address of the destination machine which belongs to the same broadcast domain or network. A MAC address is physically burnt into the Network Interface Card (NIC) of a machine and it never changes.
On the other hand, IP address on the public domain is rarely changed. If the NIC is changed in case of some fault, the MAC address also changes. This way, for Layer-2 communication to take place, a mapping between the two is required.
ARP Mechanism
To know the MAC address of remote host on a broadcast domain, a computer wishing to initiate communication sends out an ARP broadcast message asking, “Who has this IP address?” Because it is a broadcast, all hosts on the network segment (broadcast domain) receive this packet and process it. ARP packet contains the IP address of destination host, the sending host wishes to talk to. When a host receives an ARP packet destined to it, it replies back with its own MAC address.
Once the host gets destination MAC address, it can communicate with remote host using Layer-2 link protocol. This MAC to IP mapping is saved into ARP cache of both sending and receiving hosts. Next time, if they require to communicate, they can directly refer to their respective ARP cache.
Reverse ARP is a mechanism where host knows the MAC address of remote host but requires to know IP address to communicate.

Internet Control Message Protocol (ICMP)

ICMP is network diagnostic and error reporting protocol. ICMP belongs to IP protocol suite and uses IP as carrier protocol. After constructing ICMP packet, it is encapsulated in IP packet. Because IP itself is a best-effort non-reliable protocol, so is ICMP.
Any feedback about network is sent back to the originating host. If some error in the network occurs, it is reported by means of ICMP. ICMP contains dozens of diagnostic and error reporting messages.
ICMP-echo and ICMP-echo-reply are the most commonly used ICMP messages to check the reachability of end-to-end hosts. When a host receives an ICMP-echo request, it is bound to send back an ICMP-echo-reply. If there is any problem in the transit network, the ICMP will report that problem.

Internet Protocol Version 4 (IPv4)

IPv4 is 32-bit addressing scheme used as TCP/IP host addressing mechanism. IP addressing enables every host on the TCP/IP network to be uniquely identifiable.
IPv4 provides hierarchical addressing scheme which enables it to divide the network into sub-networks, each with well-defined number of hosts. IP addresses are divided into many categories:
  • Class A  - it uses first octet for network addresses and last three octets for host addressing
  • Class B  - it uses first two octets for network addresses and last two for host addressing
  • Class C  - it uses first three octets for network addresses and last one for host addressing
  • Class D  - it provides flat IP addressing scheme in contrast to hierarchical structure for above three.
  • Class E  - It is used as experimental.
IPv4 also has well-defined address spaces to be used as private addresses (not routable on internet), and public addresses (provided by ISPs and are routable on internet).
Though IP is not reliable one; it provides ‘Best-Effort-Delivery’ mechanism.

Internet Protocol Version 6 (IPv6)

Exhaustion of IPv4 addresses gave birth to a next generation Internet Protocol version 6. IPv6 addresses its nodes with 128-bit wide address providing plenty of address space for future to be used on entire planet or beyond.
IPv6 has introduced Anycast addressing but has removed the concept of broadcasting. IPv6 enables devices to self-acquire an IPv6 address and communicate within that subnet. This auto-configuration removes the dependability of Dynamic Host Configuration Protocol (DHCP) servers. This way, even if the DHCP server on that subnet is down, the hosts can communicate with each other.
IPv6 provides new feature of IPv6 mobility. Mobile IPv6 equipped machines can roam around without the need of changing their IP addresses.
IPv6 is still in transition phase and is expected to replace IPv4 completely in coming years. At present, there are few networks which are running on IPv6. There are some transition mechanisms available for IPv6 enabled networks to speak and roam around different networks easily on IPv4. These are:
  • Dual stack implementation
  • Tunneling
  • NAT-PT

DCN - Internetworking

n real world scenario, networks under same administration are generally scattered geographically. There may exist requirement of connecting two different networks of same kind as well as of different kinds. Routing between two networks is called internetworking.
Networks can be considered different based on various parameters such as, Protocol, topology, Layer-2 network and addressing scheme.
In internetworking, routers have knowledge of each other’s address and addresses beyond them. They can be statically configured go on different network or they can learn by using internetworking routing protocol.
Routing
Routing protocols which are used within an organization or administration are called Interior Gateway Protocols or IGP. RIP, OSPF are examples of IGP. Routing between different organizations or administrations may have Exterior Gateway Protocol, and there is only one EGP i.e. Border Gateway Protocol.

Tunneling

If they are two geographically separate networks, which want to communicate with each other, they may deploy a dedicated line between or they have to pass their data through intermediate networks.
Tunneling is a mechanism by which two or more same networks communicate with each other, by passing intermediate networking complexities. Tunneling is configured at both ends.
Tunneling
When the data enters from one end of Tunnel, it is tagged. This tagged data is then routed inside the intermediate or transit network to reach the other end of Tunnel. When data exists the Tunnel its tag is removed and delivered to the other part of the network.
Both ends seem as if they are directly connected and tagging makes data travel through transit network without any modifications.

Packet Fragmentation

Most Ethernet segments have their maximum transmission unit (MTU) fixed to 1500 bytes. A data packet can have more or less packet length depending upon the application. Devices in the transit path also have their hardware and software capabilities which tell what amount of data that device can handle and what size of packet it can process.
If the data packet size is less than or equal to the size of packet the transit network can handle, it is processed neutrally. If the packet is larger, it is broken into smaller pieces and then forwarded. This is called packet fragmentation. Each fragment contains the same destination and source address and routed through transit path easily. At the receiving end it is assembled again.
If a packet with DF (don’t fragment) bit set to 1 comes to a router which can not handle the packet because of its length, the packet is dropped.
When a packet is received by a router has its MF (more fragments) bit set to 1, the router then knows that it is a fragmented packet and parts of the original packet is on the way.
If packet is fragmented too small, the overhead is increases. If the packet is fragmented too large, intermediate router may not be able to process it and it might get dropped

DCN - Network Layer Routing

When a device has multiple paths to reach a destination, it always selects one path by preferring it over others. This selection process is termed as Routing. Routing is done by special network devices called routers or it can be done by means of software processes.The software based routers have limited functionality and limited scope.
A router is always configured with some default route. A default route tells the router where to forward a packet if there is no route found for specific destination. In case there are multiple path existing to reach the same destination, router can make decision based on the following information:
  • Hop Count
  • Bandwidth
  • Metric
  • Prefix-length
  • Delay
Routes can be statically configured or dynamically learnt. One route can be configured to be preferred over others.

Unicast routing

Most of the traffic on the internet and intranets known as unicast data or unicast traffic is sent with specified destination. Routing unicast data over the internet is called unicast routing. It is the simplest form of routing because the destination is already known. Hence the router just has to look up the routing table and forward the packet to next hop.
Unicast routing

Broadcast routing

By default, the broadcast packets are not routed and forwarded by the routers on any network. Routers create broadcast domains. But it can be configured to forward broadcasts in some special cases. A broadcast message is destined to all network devices.
Broadcast routing can be done in two ways (algorithm):
  • A router creates a data packet and then sends it to each host one by one. In this case, the router creates multiple copies of single data packet with different destination addresses. All packets are sent as unicast but because they are sent to all, it simulates as if router is broadcasting.
    This method consumes lots of bandwidth and router must destination address of each node.
  • Secondly, when router receives a packet that is to be broadcasted, it simply floods those packets out of all interfaces. All routers are configured in the same way.
    Broadcast routing
    This method is easy on router's CPU but may cause the problem of duplicate packets received from peer routers.
    Reverse path forwarding is a technique, in which router knows in advance about its predecessor from where it should receive broadcast. This technique is used to detect and discard duplicates.

Multicast Routing

Multicast routing is special case of broadcast routing with significance difference and challenges. In broadcast routing, packets are sent to all nodes even if they do not want it. But in Multicast routing, the data is sent to only nodes which wants to receive the packets.
Multicast routing
The router must know that there are nodes, which wish to receive multicast packets (or stream) then only it should forward. Multicast routing works spanning tree protocol to avoid looping.
Multicast routing also uses reverse path Forwarding technique, to detect and discard duplicates and loops.

Anycast Routing

Anycast packet forwarding is a mechanism where multiple hosts can have same logical address. When a packet destined to this logical address is received, it is sent to the host which is nearest in routing topology.
Anycast routing
Anycast routing is done with help of DNS server. Whenever an Anycast packet is received it is enquired with DNS to where to send it. DNS provides the IP address which is the nearest IP configured on it.

Unicast Routing Protocols

There are two kinds of routing protocols available to route unicast packets:
  • Distance Vector Routing Protocol

    Distance Vector is simple routing protocol which takes routing decision on the number of hops between source and destination. A route with less number of hops is considered as the best route. Every router advertises its set best routes to other routers. Ultimately, all routers build up their network topology based on the advertisements of their peer routers,
    For example Routing Information Protocol (RIP).
  • Link State Routing Protocol

    Link State protocol is slightly complicated protocol than Distance Vector. It takes into account the states of links of all the routers in a network. This technique helps routes build a common graph of the entire network. All routers then calculate their best path for routing purposes.for example, Open Shortest Path First (OSPF) and Intermediate System to Intermediate System (ISIS).

Multicast Routing Protocols

Unicast routing protocols use graphs while Multicast routing protocols use trees, i.e. spanning tree to avoid loops. The optimal tree is called shortest path spanning tree.
  • DVMRP  - Distance Vector Multicast Routing Protocol
  • MOSPF  - Multicast Open Shortest Path First
  • CBT  - Core Based Tree
  • PIM  - Protocol independent Multicast
Protocol Independent Multicast is commonly used now. It has two flavors:
  • PIM Dense Mode
    This mode uses source-based trees. It is used in dense environment such as LAN.
  • PIM Sparse Mode
    This mode uses shared trees. It is used in sparse environment such as WAN.

Routing Algorithms

The routing algorithms are as follows:

Flooding

Flooding is simplest method packet forwarding. When a packet is received, the routers send it to all the interfaces except the one on which it was received. This creates too much burden on the network and lots of duplicate packets wandering in the network.
Time to Live (TTL) can be used to avoid infinite looping of packets. There exists another approach for flooding, which is called Selective Flooding to reduce the overhead on the network. In this method, the router does not flood out on all the interfaces, but selective ones.

Shortest Path

Routing decision in networks, are mostly taken on the basis of cost between source and destination. Hop count plays major role here. Shortest path is a technique which uses various algorithms to decide a path with minimum number of hops.
Common shortest path algorithms are:
  • Dijkstra's algorithm
  • Bellman Ford algorithm
  • Floyd Warshall algorithm

Network Devices

Routers, brouters, and gateways are inter-networking devices used for connecting different networks.

Repeaters

A repeater connects two segments of your network cable. It re times and regenerates the signals to proper amplitudes and sends them to the other segments. When talking about, ethernet topology, you are probably talking about using a hub as a repeater. Repeaters require a small amount of time to regenerate the signal. This can cause a propagation delay which can affect network communication when there are several repeaters in a row. Many network architectures limit the number of repeaters that can be used in a row. Repeaters work only at the physical layer of the OSI network model.

Bridges

A bridge reads the outermost section of data on the data packet, to tell where the message is going. It reduces the traffic on other network segments, since it does not send all packets. Bridges can be programmed to reject packets from particular networks. Bridging occurs at the data link layer of the OSI model, which means the bridge cannot read IP addresses, but only the outermost hardware address of the packet. In our case the bridge can read the ethernet data which gives the hardware address of the destination address, not the IP address. Bridges forward all broadcast messages. Only a special bridge called a translation bridge will allow two networks of different architectures to be connected. Bridges do not normally allow connection of networks with different architectures. The hardware address is also called the MAC (media access control) address. To determine the network segment a MAC address belongs to, bridges use one of:
  • Transparent Bridging - They build a table of addresses (bridging table) as they receive packets. If the address is not in the bridging table, the packet is forwarded to all segments other than the one it came from. This type of bridge is used on ethernet networks.
  • Source route bridging - The source computer provides path information inside the packet. This is used on Token Ring networks.

Routers

A router is used to route data packets between two networks. It reads the information in each packet to tell where it is going. If it is destined for an immediate network it has access to, it will strip the outer packet (IP packet for example), readdress the packet to the proper ethernet address, and transmit it on that network. If it is destined for another network and must be sent to another router, it will re-package the outer packet to be received by the next router and send it to the next router. Routing occurs at the network layer of the OSI model. They can connect networks with different architectures such as Token Ring and Ethernet. Although they can transform information at the data link level, routers cannot transform information from one data format such as TCP/IP to another such as IPX/SPX. Routers do not send broadcast packets or corrupted packets. If the routing table does not indicate the proper address of a packet, the packet is discarded. There are two types of routers:
  1. Static routers - Are configured manually and route data packets based on information in a router table.
  2. Dynamic routers - Use dynamic routing algorithms. There are two types of algorithms:
    • Distance vector - Based on hop count, and periodically broadcasts the routing table to other routers which takes more network bandwidth especially with more routers. RIP uses distance vectoring. Does not work on WANs as well as it does on LANs.
    • Link state - Routing tables are broadcast at startup and then only when they change. The open shortest path first (OSPF) protocol uses the link state routing method to configure routes or distance vector algorithm (DVA).
Common routing protocols include:
  • IS-IS -Intermediate system to intermediate system which is a routing protocol for the OSI suite of protocols.
  • IPX - Internet Packet Exchange. Used on Netware systems.
  • NLSP - Netware Link Services protocol - Uses OSPF algorithm and is replacing IPX to provide internet capability.
  • RIP - Routing information protocol uses a distance vector algorithm.
There is a device called a brouter which will function similar to a bridge for network transport protocols that are not routable, and will function as a router for routable protocols. It functions at the network and data link layers of the OSI network model.

Gateways

A gateway can translate information between different network data formats or network architectures. It can translate TCP/IP to AppleTalk so computers supporting TCP/IP can communicate with Apple brand computers. Most gateways operate at the application layer, but can operate at the network or session layer of the OSI model. Gateways will start at the lower level and strip information until it gets to the required level and repackage the information and work its way back toward the hardware layer of the OSI model. To confuse issues, when talking about a router that is used to interface to another network, the word gateway is often used. This does not mean the routing machine is a gateway as defined here, although it could be.