Thursday, August 20, 2009

Internet Address: IPV4

The Internet is a global network which connects several hundreds and thousands of local networks. In this tutorial I will discuss about internet addressing in IPV4. There are two address methods IPV4 and IPV6. IPV4 is 32 bits (4 bytes) long and IPV6 is 128 bits long. So by using IPV4 you can have at most 2^32 or four billions public IP address. A public IP address is accessible from any part of the network. Well private IP address is accessible from the local network, where it resides. The IPV4 addressing has two different formats to represent IP address.

  1. Class full IP address
  2. Class less IP address (CIDR)


Class full IP address:

In class full addressing the IP address is partitioned in different sections with different block size. They are

  • Class 'A'
  • Class 'B'
  • Class 'C'
  • Class 'D'
  • Class 'E'

Actually class 'A','B' and 'C' are well-known to all. The first three classes are unicast address. Class 'D' is multicast and class 'E' is reserved for future use. Every class has associated IP address range.

-------------------------------------------------------------------------------------------------
Class | Start with | IP address range | Number of Blocks | Total Addresses |
-------------------------------------------------------------------------------------------------
A | 0 | 0.0.0.0. to 127.255.255.255 | 128* | 2147483648* |

-------------------------------------------------------------------------------------------------

B | 10 | 128.0.0.0 to 191.255.255.255 | 16384** | 1073741824** |

-------------------------------------------------------------------------------------------------

C | 110 | 192.0.0.0 to 223.255.255.255 | 2097152*** | 536870912*** |

-------------------------------------------------------------------------------------------------

D | 1110 | 224.0.0.0 to 239.255.255.255 | 1 | 268435456 |

-------------------------------------------------------------------------------------------------

E | 1111 | 240.0.0.0 to 255.255.255.255 | 1 | 268435456 |

-------------------------------------------------------------------------------------------------

*Actually the class 'A' has 125 blocks to use in the global internet. Three blocks are used for different purpose. The block with the starting address 10.0.0.0 to 10.255.255.255 is used for private network. That is this block of address are used in home network and the host with the private network address are not accessible from the outside of the network.

The block with the address of 127.0.0.0 to 127.255.255.255 is used as loopback address. That is to test an application on the same machine. The datagrams are not gone out the host when using loopback address. It will come back at the same machine. If you run a server on your machine and at the browser type 'http: //127.x.y.z' (x, y, z are any number from 0~255), it will show you the server default page.

The block with the address 0.0.0.0 to 0.255.255.255 is used for two different purposes. If all zero it is used as 'The host on this network'. When a host does not know its IP address it will send a datagram using the address 0.0.0.0 in its network. If DHCP or other method is established it will work with the datagram and lease a IP address to the host for specific amount of time.

**Sixteen blocks of the class 'B' address are reserved for private addressing. The blocks with the address 172.16.0.0 to 172.31.255.255 are user for this purpose.

***Two hundred fifty-six blocks are used for private addresses. The ranges are 192.168.0.0 to 192.168.255.255

Thursday, August 13, 2009

Bridge, Router, Switch, Hub and Gateway

Bridge, Router, Switch, Hub and Gateway


The Internet is an interconnection of hundreds and thousands of networks. At the bottom of this is the LAN (Local Area Network). Some computers are connected with each other to form a LAN. There are several methods to connect computers in a LAN. Ring, bus, start etc. are some of the popular form. In this tutorial I will describe some of the important concept regarding to interconnect networks (possible LAN segments).


Bridge:

A bridge is used to connect LAN segments. It works on physical layer and used to relay MAC address. The purpose of the bridge can be explained by the following example:

Suppose you have 12 computers to connect with each other. You can make a LAN segments using your computers. On a LAN the computers shares the same collection domain and the bandwidth is divided equally to all the computers. So when a computer sends a packet to another computer then if another computer tries to send at the same time collision will occur. To solve this problem, we can use Bridge. We use a bridge in our LAN to partition it into two LAN segments. Now the collision domain is partitioned into two and bandwidth increase by two. So by using multiple bridges we can increase bandwidth as well as decrease collision domain.

Bridge is IP transparent. This means that, when a host wants to send a packet to another host in the LAN segment, it will send the packet (datagram) directly to the destination host.


Another feature of bridge is that- when a host emits a packet with the broadcast address as destination bridge will forward it to the LAN segment. But router will block it (limited broadcast address will be blocked).

Router:

Router is used to connect different networks. It works on the network layer. Every router has two interfaces associated with it, an input interface and an output interface. When a datagram is received by an input interface of a router, it will see its forwarding table to which output interface it will forward.

Router is visible to IP. That is, any host wants to send datagram can't send it directly to the destination host. The datagram first sends to the router and router will responsible to route it to the correct destination host.


Switch:

Switch is also used to connect different LAN segments. Unlike bridge it has solved the problem of collision domain and bandwidth efficiently. A switch with 'N' LAN segments has 'N' different dedicated link with it. So it is possible to connect the entire host separately with the switch. The switch has the property – self learning. It has switching table which is updated automatically without and human initialization. Switch has also the advantages to connect different LAN with different link capacity. That is, if we have three LAN segments with link capacity of 10Mbps, 100Mbps and 1Gbps. We can connect them with a switch.

The self learning property has some problems too. Basically in wireless network where the wireless station (host) moves from one network to another network.


Hub:

Hub is a device which is also used to connect LAN segments. But the purpose of Hub is to re-generate (re-create) each and every bit and broadcast it to the network. The collision domain in Hub is very huge. Hub has no self learning capacity and it can't connect different LAN with different link capacity. Like switch it is auto configured without human initialization.


Gateway:

Gateway works on the upper layer on TCP/IP protocol suite. Such as, mail gateway in SMTP. It supports address mapping from one network to another, and may also provide transformation of the data between the environments to support end-to-end application connectivity.

A gateway can be said to be opaque to IP. That is, a host cannot send an IP datagram through a gateway; it can only send it to a gateway. The higher-level protocol information carried by the datagrams is then passed on by the gateway using whatever networking architecture is used on the other side of the gateway.

*** Will update periodically