Friday, May 28, 2010

Supernetting / Classless Inter-Domain Routing (CIDR) Example

If I needed about 1000 addresses, I could supernet 4 Class C networks together:
192.60.128.0   (11000000.00111100.10000000.00000000)  Class C subnet address
192.60.129.0   (11000000.00111100.10000001.00000000)  Class C subnet address
192.60.130.0   (11000000.00111100.10000010.00000000)  Class C subnet address
192.60.131.0   (11000000.00111100.10000011.00000000)  Class C subnet address
--------------------------------------------------------
192.60.128.0   (11000000.00111100.10000000.00000000)  Supernetted Subnet address
255.255.252.0  (11111111.11111111.11111100.00000000)  Subnet Mask
192.60.131.255 (11000000.00111100.10000011.11111111)  Broadcast address

In this example, the subnet 192.60.128.0 includes all the addresses from 192.60.128.0 to 192.60.131.255. As you can see in the binary representation of the subnet mask, the Network portion of the address is 22 bits long, and the host portion is 10 bits long.

Under CIDR, the subnet mask notation is reduced to a simplified shorthand. Instead of spelling out the bits of the subnet mask, it is simply listed as the number of contiguous 1s bits. In the above example, instead of writing the address and subnet mask as
192.60.128.0, Subnet Mask 255.255.252.0
the network address would be written simply as:
192.60.128.0/22
which indicates the length of network portion of the address is 22. If you look at the subnet mask in binary (11111111.11111111.11111100.00000000), you can easily see how this notation works.

The use of a CIDR notated address is the same as for a Classful address. Classful addresses can easily be written in CIDR notation (Class A = /8, Class B = /16, and Class C = /24)

Classless Inter-Domain Routing (CIDR) / Supernetting

By 1992, the exponential growth of the Internet was beginning to raise serious concerns among members of the IETF about the ability of the Internet's routing system to scale and support future growth. These problems were related to:
  • The near-term exhaustion of the Class B network address space
  • The rapid growth in the size of the global Internet's routing tables
  • The eventual exhaustion of the 32-bit IPv4 address space
Projected Internet growth figures made it clear that the first two problems were likely to become critical by 1994 or 1995. The response to these immediate challenges was the development of the concept of Supernetting or Classless Inter-Domain Routing (CIDR).

The third problem, which is of a more long-term nature, is currently being explored by the IP Next Generation (IPng or IPv6) working group of the IETF.

CIDR was officially documented in September 1993 in RFC 1517, 1518, 1519, and 1520.
CIDR supports two important features that benefit the global Internet routing system:
  • CIDR eliminates the traditional concept of Class A, Class B, and Class C network addresses. This enables the efficient allocation of the IPv4 address space which will allow the continued growth of the Internet until IPv6 is deployed.
  • CIDR supports route aggregation where a single routing table entry can represent the address space of perhaps thousands of traditional classful routes. This allows a single routing table entry to specify how to route traffic to many individual network addresses. Route aggregation helps control the amount of routing information in the Internet's backbone routers, reduces route flapping (rapid changes in route availability), and eases the local administrative burden of updating external routing information.

Without the rapid deployment of CIDR in 1994 and 1995, the Internet routing tables would have in excess of 70,000 routes (instead of the current 30,000+) and the Internet would probably not be functioning today!

For example read the post Supernetting / Classless Inter-Domain Routing (CIDR) Example.

[Copied from the document Understanding IP Addressing page no-32 ]

Example of subnetting with extended-network-prefix

An organization has been assigned the network number 193.1.1.0/24 and it needs to define six subnets. The largest subnet is required to support 25 hosts.

Defining the Subnet Mask / Extended-Prefix Length

The first step is to determine the number of bits required to define the six subnets. Since a network address can only be subnetted along binary boundaries, subnets must be created in blocks of powers of two [ 2 (2^1), 4 (2^2), 8 (2^3), 16 (2^4), etc. ]. Thus, it is impossible to define an IP address block such that it contains exactly six subnets. For this example, the network administrator must define a block of 8 (2^3) and have two unused subnets that can be reserved for future growth.

Since 8 = 2^3, three bits are required to enumerate the eight subnets in the block. In this example, the organization is subnetting a /24 so it will need three more bits, or a /27, as the extended-network-prefix. A 27-bit extended-network-prefix can be expressed in dotted-decimal notation as 255.255.255.224. This is illustrated in Figure blow.


A 27-bit extended-network-prefix leaves 5 bits to define host addresses on each subnet.
This means that each subnetwork with a 27-bit prefix represents a contiguous block of 2^5(32) individual IP addresses. However, since the all-0s and all-1s host addresses cannot be allocated, there are 30 (2^5 -2) assignable host addresses on each subnet.

Defining Each of the Subnet Numbers

The eight subnets will be numbered 0 through 7. The 3-bit binary representation of the decimal values 0 through 7 are: 0 (0002), 1 (0012), 2 (0102), 3(0112), 4 (1002), 5 (1012), 6 (1102), and 7 (1112).

In general, to define Subnet #n, the network administrator places the binary representation of n into the bits of the subnet-number field. For example, to define Subnet #6, the network administrator simply places the binary representation of 6 (1102) into the 3-bits of the subnet-number field.

The eight subnet numbers for this example are given below. The underlined portion of each address identifies the extended-network-prefix, while the bold digits identify the 3-bits representing the subnet-number field:
Base Net: 11000001.00000001.00000001.00000000 = 193.1.1.0/24
Subnet #0: 11000001.00000001.00000001.00000000 = 193.1.1.0/27
Subnet #1: 11000001.00000001.00000001.00100000 = 193.1.1.32/27
Subnet #2: 11000001.00000001.00000001.01000000 = 193.1.1.64/27
Subnet #3: 11000001.00000001.00000001.01100000 = 193.1.1.96/27
Subnet #4: 11000001.00000001.00000001.10000000 = 193.1.1.128/27
Subnet #5: 11000001.00000001.00000001.10100000 = 193.1.1.160/27
Subnet #6: 11000001.00000001.00000001.11000000 = 193.1.1.192/27
Subnet #7: 11000001.00000001.00000001.11100000 = 193.1.1.224/27
An easy way to check if the subnets are correct is to ensure that they are all multiples of the Subnet #1 address. In this case, all subnets are multiples of 32: 0, 32, 64, 96, ...

Defining Host Addresses for Each Subnet

According to Internet practices, the host-number field of an IP address cannot contain all 0-bits or all 1-bits. The all-0s host-number identifies the base network (or subnetwork) number, while the all-1s host-number represents the broadcast address for the network (or subnetwork).

In our current example, there are 5 bits in the host-number field of each subnet address.
This means that each subnet represents a block of 30 host addresses (2^5-2 = 30, note that the 2 is subtracted because the all-0s and the all-1s host addresses cannot be used).The hosts on each subnet are numbered 1 through 30.

In general, to define the address assigned to Host #n of a particular subnet, the network administrator places the binary representation of n into the subnet's host-number field. For example, to define the address assigned to Host #15 on Subnet #2, the network administrator simply places the binary representation of 15 (011112) into the 5-bits of Subnet #2's host-number field.

The valid host addresses for Subnet #2 in our example are given below. The underlined portion of each address identifies the extended-network-prefix, while the bold digits identify the 5-bit host-number field:

Subnet #2: 11000001.00000001.00000001.01000000 = 193.1.1.64/27
Host #1: 11000001.00000001.00000001.01000001 = 193.1.1.65/27
Host #2: 11000001.00000001.00000001.01000010 = 193.1.1.66/27
Host #3: 11000001.00000001.00000001.01000011 = 193.1.1.67/27
Host #4: 11000001.00000001.00000001.01000100 = 193.1.1.68/27
Host #5: 11000001.00000001.00000001.01000101 = 193.1.1.69/27
.
.
Host #15: 11000001.00000001.00000001.01001111 = 193.1.1.79/27
Host #16: 11000001.00000001.00000001.01010000 = 193.1.1.80/27
.
.
Host #27: 11000001.00000001.00000001.01011011 = 193.1.1.91/27
Host #28: 11000001.00000001.00000001.01011100 = 193.1.1.92/27
Host #29: 11000001.00000001.00000001.01011101 = 193.1.1.93/27
Host #30: 11000001.00000001.00000001.01011110 = 193.1.1.94/27

The valid host addresses for Subnet #6 are given below. The underlined portion of each address identifies the extended-network-prefix, while the bold digits identify the 5-bit host-number field:

Subnet #6: 11000001.00000001.00000001.11000000 = 193.1.1.192/27
Host #1: 11000001.00000001.00000001.11000001 = 193.1.1.193/27
Host #2: 11000001.00000001.00000001.11000010 = 193.1.1.194/27
Host #3: 11000001.00000001.00000001.11000011 = 193.1.1.195/27
Host #4: 11000001.00000001.00000001.11000100 = 193.1.1.196/27
Host #5: 11000001.00000001.00000001.11000101 = 193.1.1.197/27
.
.
Host #15: 11000001.00000001.00000001.11001111 = 193.1.1.207/27
Host #16: 11000001.00000001.00000001.11010000 = 193.1.1.208/27
.
.
Host #27: 11000001.00000001.00000001.11011011 = 193.1.1.219/27
Host #28: 11000001.00000001.00000001.11011100 = 193.1.1.220/27
Host #29: 11000001.00000001.00000001.11011101 = 193.1.1.221/27
Host #30: 11000001.00000001.00000001.11011110 = 193.1.1.222/27

Defining the Broadcast Address for Each Subnet

The broadcast address for Subnet #2 is the all 1's host address or:
11000001.00000001.00000001.010 11111 = 193.1.1.95

Note that the broadcast address for Subnet #2 is exactly one less than the base address for Subnet #3 (193.1.1.96). This is always the case - the broadcast address for Subnet #n is one less than the base address for Subnet #(n+1).The broadcast address for Subnet #6 is simply the all 1's host address or:
11000001.00000001.00000001.11011111 = 193.1.1.223

Again, the broadcast address for Subnet #6 is exactly one less than the base address for Subnet #7 (193.1.1.224). Again, the broadcast address for Subnet #6 is exactly one less than the base address for Subnet #7 (193.1.1.224).

[This example is collected from the document Understanding IP Addressing.]

Subnet Design

There are four key questions that must be answered before any design
should be undertaken:
1) How many total subnets does the organization need today?
2) How many total subnets will the organization need in the future?
3) How many hosts are there on the organization's largest subnet today?
4) How many hosts will there be on the organization's largest subnet in the future?

At first take the maximum number of subnets required and round up to the nearest power of two. For example, if an organization needs 9 subnets,2^3 (or 8) will not provide enough subnet addressing space, so the network administrator will need to round up to 2^4 (or 16). When performing this assessment, it is vital that the network administrator always allow sufficient room for future growth. For example, if 14 subnets are required today, then 16 subnets might not be as much as necessary in two years when the 17th subnet needs to be installed. In this case, it is wise to keep space for further growth and select 2^5 (or 32) as the maximum number of subnets.

Secondly ensure that there are enough space host addresses for the organization's largest subnet. If the largest subnet needs to support 50 host addresses today, 2^5 (or 32) will not provide sufficient host address space so the network administrator will need to level up to 2^6 (or 64).

Finally ensure that the organization's address allocation provides enough bits to deploy the required subnet addressing plan. For example, if the organization has a single /16, it could easily deploy 4-bits for the subnet-number and 6-bits for the host number. However, if the organization has several /24s and it needs to deploy 9 subnets, it may be required to subnet each of its /24s into four subnets (using 2 bits) and then build the internet by combining the subnets of 3 different /24 network numbers. An alternative solution, would be to deploy network numbers from the private address space (RFC1918) for internal connectivity and use a Network Address Translator (NAT) to provide external Internet access. For example read the post Example of subnetting  with extended-network-prefix.

Extended-Network-Prefix

For enhancing subnetting Extended-Network-Prefix is introduced, where to the default subnet mask (class A - 255.0.0.0, Class B - 255.255.0.0, Class C - 255.255.255.0) some more 1bits is used further contiguous 1bits and the length of network address increase. This idea is to divide the standard classful host-number field into two parts - the subnet-number and the host number on that subnet. It is three level hierarchy instead of two level hierarchy.



To calculate the number of subnets or hosts, use the formula (2^n-2) where n = number of bits in either field, and 2^n represents 2 raised to the nth power. Multiplying the number of subnets by the number of hosts available per subnet gives you the total number of nodes available for your class and subnet mask. For example read the post Subnet Design.

Wednesday, May 26, 2010

Subnet Mask

Subnet Mask with an IP address allows you to identify the network part and host part of the address. Expression of Subnet Mask is similar to IP address, four binary octets is shown by dotted decimal. Bits representing network and host are split by its corresponding bits in Subnet Mask. The network bits are represented by the 1s in the mask and the node bits are represented by the 0s. The length of network part is equal to the number of contiguous one-bits in the subnet mask.
For example, using an IP address with subnet mask, we get:
10000010.00000101.00000101.00011001      130. 5 . 5 . 25   Class B IP Address
11111111.11111111.11111111.00000000      255.255.255. 0    Subnet Mask
--------------------------------------------------------
10000010.00000101.00000101.00000000      130. 5 . 5 . 0    Network Address
Though 24 contiguous one-bits are in subnet mask, the length of the network part in this IP address is 24. So network address is 130.5.5.0

Default subnet masks:
Class A - 255.0.0.0 - 11111111.00000000.00000000.00000000
Class B - 255.255.0.0 - 11111111.11111111.00000000.00000000
Class C - 255.255.255.0 - 11111111.11111111.11111111.00000000

Subnetting

Subnetting means dividing a larger network into several smaller networks. You can find some matching with branching of a tree. Nutrition's from ground travels trough the branches, first come to the main thick vertical branch then thin brunches and at the last fruit or leafs. Networks must follow such branching or hierarchy where internet is like the ground (largest data container and service provider) then large networks (regional/national service organization) are like the thick vertical branch then sub-networks or route to group of hosts are like thin branches and hosts/nodes are like fruits/leafs.

Subnetting or branching or sub-grouping an IP Network is done for a variety of reasons, such as preservation of address space, use of different physical media (such as Ethernet, FDDI, WAN, etc.), organization/business and security. The most important issue is to control network traffic. All nodes on a segment observe all the packets transmitted by all the other nodes on that segment, in an Ethernet network. Due to collisions, performance can be adversely affected under heavy traffic loads and the resulting retransmissions.  Routers are used to connect networks/sub-networks to minimize the amount of traffic each segment must receive.

Saturday, May 22, 2010

Reserved IP for Private Network

Three network addresses is reserved for private networks. The addresses are 10.0.0.0, Subnet Mask 255.0.0.0, 172.16.0.0, Subnet Mask 255.240.0.0, and 192.168.0.0, Subnet Mask 255.255.0.0. These addresses are also expressed as 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. They can be used by anyone setting up internal IP networks, such as a lab or home LAN behind a NAT or proxy server or a router. It is always safe to use these because routers on the Internet by default will never forward packets coming from these addresses. These addresses are defined in RFC 1918.

IP Address Classes or Classful IP Addressing

There are 5 different address classes (Class-A, Class-B, Class-C, Class-D, Class-E). 
Before knowing these classes, let us see how an IP address contitutes.
IP: 255 255 255 255
Binary value: 11111111 11111111 11111111 11111111
Decimal value of Octet : 255 255 255 255
You can determine IP class of any IP address by examining the first 4 bits of the IP address.
  • Class A addresses begin with 0xxx (binary), or 1 to 126 (decimal).
  • Class B addresses begin with 10xx (binary), or 128 to 191 (decimal).
  • Class C addresses begin with 110x (binary), or 192 to 223 (decimal).
  • Class D addresses begin with 1110 (binary), or 224 to 239 (decimal).
  • Class E addresses begin with 1111 (binary), or 240 to 254 (decimal).
Addresses beginning with 01111111, or 127 decimal, are reserved for loopback and for internal testing on a local machine [You can test this: you should always be able to ping 127.0.0.1, which points to device itself]; Class D addresses are reserved for multicasting; Class E addresses are reserved for future use. They should not be used for host addresses.

An IP address has four binary octet to represent network address and host address. you need to know which octet represents network and which octets are host number. Now we can see how the Class determines, by default, which part of the IP address belongs to the network (N, in red) and which part belongs to the host (H, in black).
  • Class A -- NNNNNNNN.HHHHHHHH.HHHHHHHH.HHHHHHHH
  • Class B -- NNNNNNNN.NNNNNNNN. HHHHHHHH.HHHHHHHH
  • Class C -- NNNNNNNN.NNNNNNNN.NNNNNNNN. HHHHHHHH
In the example, 140.178.200.220 is a Class B address so by default the Network part or network prefix/address of the full address is represented by the first two octets (140.178.x.x) and the node/host part is represented by the last 2 octets (x.x.200.220).
In order to specify the network address for a given IP address, the host section is set to all "0"s. In our example, 140.178.0.0 specifies the network address for 140.178.200.220. 

When the host section is set to all "1"s, it specifies a broadcast that is sent to all hosts on the network. 140.178.255.255 (10001100.10110010.11111111.11111111) specifies the example broadcast address. Note that this is true regardless of the length of the node section.
Class Address Range Supports
Class A 1.0.0.1 to 126.255.255.254 Supports 16 million hosts on each of 127 networks.
Class B 128.1.0.1 to 191.255.255.254 Supports 65,000 hosts on each of 16,000 networks.
Class C 192.0.1.1 to 223.255.254.254 Supports 254 hosts on each of 2 million networks.
Class D 224.0.0.0 to 239.255.255.255 Reserved for multicast groups or broadcast address.
Class E 240.0.0.0 to 254.255.255.254 Reserved for future use, or Research and Development
Purposes.

Classful IP addressing was primarily used but at the present due to the fast expansion of internet classless IP addressing is used widely.

IP Addressing

An IP (Internet Protocol) address is a unique identifier for a node or device or host connection on an IP network. An IP address is a 32 bit binary number usually represented as 4 decimal values, each value comes from 8 bits binary value. So each value is minimum 0 and maximum 255 (known as octets) and separated by decimal points. This is known as dotted decimal notation.
Example: 140.178.200.220
It hides the binary digits that required for understanding the IP addressing, so useful to view the values in their binary form.
140     .178     .200     .220
10001100.10110010.11001000.11011100
Every IP address consists of two parts, one represents the network and one represents the node/host. The Class of the address and the subnet mask determine which part belongs to the network address and which part belongs to the host address.

Network Topologies

There are five basic topologies:

In mesh topology, every device has a dedicated point-to-point link to every other device. In a mesh network of n number of device each device must have (n-1) number of port to plug network cable in coming from the other (n-1) device and total number of dedicated connection in the network is n(n+1)/2 .
Mesh Topology

In a star topology, each device has a dedicated point-to-point link only to a central controller device, usually called a hub.
Star Topology

A bus topology is multi point. One long cable acts as backbone to link all the devices in a network.
BUS Topology

In a ring topology, each device has a dedicated point-to-point connection with only the two devices on either side of it.
Ring Topology

In a tree topology, two or more hubs and/or data centers are connected to one another in a succession of levels to provide redundancy. It also called cascaded star topology or hierarchical network. (A network that is based upon the physical hierarchical topology must have at least three levels in the hierarchy of the tree, since a network with a central 'root' node and only one hierarchical level below it would exhibit the physical topology of a star)
Tree Topology

Hybrid topology is not another topology but the combination of more than one topology in a network. Below examples can help to understand.

Draw a hybrid topology with a star backbone and three ring networks.

Draw a hybrid topology with a bus backbone connecting three ring networks and each ring networks connects three star networks.

Comparison of the Network Topologies:
Mesh Star Bus Ring Tree
Installation Cost High Moderate Low Low Moderate
Device Adding Difficult Easy Easy Easy Easy
Fault Ditection Easy Easy Difficult Easy Difficult
Network Robustness High Morderate Low Low Low
Connection Media Twested Pair, Optical Fiber Twisted Pair Optial Fiber, Coaxial Cable Optial Fiber, Coaxial Cable Twested Pair, Optical Fiber

Network Criteria

Performance can be measured in many ways, including transit time and response time. Performance is often evaluated by two networking metrics: throughput and delay.

In addition to accuracy of delivery, network reliability is measured by the frequency of failure, the times it takes a link to recover from a failure and the network’s robustness in a catastrophe.

Network security issues include protecting data from unauthorized access, protecting data from damage and development, and implementing policies and procedures for recovery from breaches and data losses.

Modes of data flow

In Simplex mode, the communication is unidirectional, as on a one-way street. Only one of the two devices on a link can transmit, other one can only receive.

In Half-Duplex mode, each station can both transmit and receive, but not at the same time. When one device is sending other can only receive and vice versa.

In Full-Duplex mode (Duplex), both stations can transmit and receive simultaneously.

Componenets of a data communication system

A data communication system has five components:

1. Message: the message is the information (data) to be communicated.

2. Sender: The sender is the device that data message. It can be a computer, cell phone, camera and so on.

3. Receiver: the receiver is the device that receives the message. It can be a computer, cell phone, television and so on.

4. Transmission medium: the Transmission medium is the physical path by which a message travels from sender to receiver. Example twisted-pair wire, coaxial cable, fiber-optic cable, radio waves …

5. Protocol: a protocol is a set of rules govern data communications.

Fundamental Characteristics of Data Communication

The effectiveness of data communication system depends on four fundamental characteristics:

1. Delivery: the system must deliver data to correct destination. Data must be received by the intended device or user.

2. Accuracy: The system must deliver the data accurately. Data that have been altered in transmission and left uncorrected are unusable.

3. Timeliness: the system must deliver data in a timely manner. Data delivered late are useless.

4. Jitter: jitter refers to the variation in the packet arrival time. It is the uneven delay in the delivery of packets.

Terms in Networking

The word data refers to information presented in whatever form is agreed upon by the parties creating and using the data.

Data communications are the exchange of data between two devices via some form of transmission medium such as wire cable.

In Distributed Processing a task is divided among multiple computers. Instead of one single large machine being responsible for all aspects of process, separate computers handle a subnet.

The term physical topology refers to the way in which a network is laid out physically.

The topology of a network is the geometric representation of the relationship of all the links and linking devices to one another.

A Local Area Network(LAN) is usually privately owned and links the devices in a single office, building or campus.

A Wide Area Network(WAN) provide long-distance transmission of data, image, audio and video information over large geographic areas that may comprise a country, a region etc.

A Metropolitan Area Network(MAN) is a network with a size between a LAN and WAN. It normally covers the area inside a town or city. It is designed for customers who need a high-speed connectivity, normally to the internet and endpoints spread over a city or part of a city.

When two or more networks are connected, they are become internetwork or internet. When the network combine networks worldwide is Internet(I) .

Network Operating System indicates some operating system that has some special functionality required to perform jobs involving a network as well as general operating system functionality. Now a days most operating systems has this functionality such as windows xp, vista, 7, Mac, Linx versions Ubuntu, redhat etc.

Server Operating Systems are designed to be used for some special service run on it to serve people online. These services are File Service, Domain Name Service, Mail Service and the most popular server operating system is Redhat.

Friday, May 21, 2010

What means by networking?

A network is a set of devices or nodes connected by communication links. A node or device can be a computer, printer or any other device capable of sending and/or receiving data generated by other nodes on the network.

Networking is the job that is done to establish or to manage a network. A network can be large, medium or small depending on number of devices it connect or distance cover.