You are on page 1of 37

Assigning IP Addresses in a Multiple Subnet Network

ADVANTAGE PRO Chennais Premier Networking Training Centre

IP Addressing

ADVANTAGE PRO Chennais Premier Networking Training Centre

Virtual Networks
Internetworking software builds a single, seamless virtual network out of multiple physical networks
Universal addressing scheme Universal service

All details of physical networks hidden from users and application programs

ADVANTAGE PRO Chennais Premier Networking Training Centre

IP Protocol Objectives
Connect physical networks of every possible type (even future network technologies not yet developed ) Scale to a WAN connecting many hosts
To succeed, IP has to make minimal assumptions about the physical networks it connects

The IP Service Model


Provides a global Addressing Scheme Provides best-effort, connectionless, variablelength, datagram delivery
ADVANTAGE PRO Chennais Premier Networking Training Centre

Global Addressing Scheme


Specified by Internet Protocol In addition to physical address (contained in NIC), each host is assigned a 32-bit IP address.

ADVANTAGE PRO Chennais Premier Networking Training Centre

Internet Addresses
Each interface on the internet must have a unique Internet Address, or IP address. An IP address is a 32 bit number. Usually written using Dotted Decimal Notation Example: 2365328673 as an unsigned integer is 1000 1100 1111 1100 0000 1101 0010 0001 in binary 8C FC 0D 21 in hex 140.252.13.33 in dotted decimal

ADVANTAGE PRO Chennais Premier Networking Training Centre

Dotted Decimal Notation


Syntactic form used by IP software to make the 32-bit form shorter and easier to read Written in decimal form with decimal points separating the bytes

ADVANTAGE PRO Chennais Premier Networking Training Centre

Details of IP Addresses
Assigned per interface, not per host, hence... Routers always have multiple IP addresses. Three kinds of IP Addresses unicast: destined for a single host broadcast: destined for all hosts on a local net (not all hosts on the internet) multicast: destined for all hosts in a specific multicast group. (We will concentrate for now on unicast addresses)

ADVANTAGE PRO Chennais Premier Networking Training Centre

Classes of IP Addresses
Class
7 bits 24 bits

A 0 B 10 C 1 10

netid
14 bits

hostid
16 bits

netid
21 bits

hostid
8 bits

netid
28 bits

hostid
27 bits

D 1110 E 1 1110
A: 0.0.0.0 to 127.255.255.255 B: 128.0.0.0 to 191.255.255.255 C: 192.0.0.0 to 239.255.255.255
Centre

multicast group id (reserved for future use)


D: 224.0.0.0 to 239.255.255.255 E: 224.0.0.0 to 247.255.255.255

ADVANTAGE PRO Chennais Premier Networking Training

Decimal representation and class ranges of Internet addresses

ADVANTAGE PRO Chennais Premier Networking Training Centre

Details of IP Addresses
Assigned by a central authority the Network Information Center, or InterNIC (rs.internic.net) assigns network ids for the entire internet. Local system administrator gets a network id from the InterNIC, then assigned Ids to individual interfaces on each host. The hostid portion may be broken down by a local system administrator into subnet and host. Special case addresses:

ADVANTAGE PRO Chennais Premier Networking Training Centre

Network and Host Addresses

ADVANTAGE PRO Chennais Premier Networking Training Centre

Summary of special IP addresses


Prefix Suffix Type of Address Purpose

All 0s Network Network All 1s 127

All 0s All 0s All 1s All 1s Any

This computer Network Directed broadcast limited broadcast loop back

Used during bootstrap Identifies a network broadcast on specified net broadcast on local net testing

ADVANTAGE PRO Chennais Premier Networking Training Centre

Domain Name System

DNS

gloin.cis.udel.edu 128.175.201.5

The network interface and hosts are known to the protocols by their IP addresses, e.g. 128.175.201.5 Humans work better with hostnames, such as gloin.cis.udel.edu or brahms.udel.edu Domain Name System (DNS): a distributed database for mapping between hostnames and IP addresses. Details not in this discussion; it suffices that there is a library function we can call to translate. gethostbyname() gethostbyaddr() Most applications accept either one.
ADVANTAGE PRO Chennais Premier Networking Training Centre

Routers and IP addresses


An internet is composed of arbitrarily many physical networks interconnected by routers Each IP address specifies only one physical network. What is the routers address? Routers can have more than two interfaces, therefore must be assigned one IP address for each connection. An IP address identifies a connection between a computer and a network, not a specific computer.

ADVANTAGE PRO Chennais Premier Networking Training Centre

Routers

ADVANTAGE PRO Chennais Premier Networking Training Centre

The IP address shortage


The problem:
almost all class B addresses have already been allocated. 32 bit addresses are inadequate for the predicted growth of the internet. Routing table growth Current Routing Structure is not hierarchical; there are only two layers (network, host). As multiple C class addresses are given out instead of a single class B address for each network, routing tables will get too large

The solution:
short term: Subnetting Classless Interdomain Routing (CIDR) addresses routing table growth problem long term: IPv6 (128-bit addresses)
ADVANTAGE PRO Chennais Premier Networking Training Centre

Subnetting
IP addressing has only two levels of hierarchy Subnetting - Add another level to address/routing hierarchy: subnetworks

ADVANTAGE PRO Chennais Premier Networking Training Centre

Subnetting
3 levels of hierarchy: Netid, subnetid, hostid Subnets are visible only within the local site Masking: process that extracts address of physical network from an IP address. Subnet masks define variable partition of host part of Class A and B addresses

Class B Address 00000000 111111111111111111111111 Subnet Mask (255.255.255.0) Network Number SubnetID HostID Subnetted Address PRO Chennais Premier Networking Training ADVANTAGE
Centre

Masking
To find network or subnetwork address, apply (perform AND) the mask to the IP address

ADVANTAGE PRO Chennais Premier Networking Training Centre

Finding the Subnet Address


Given an IP address, we can find the subnet address the same way we found the network address in the previous chapter. We apply the mask to the address. We can do this in two ways: straight or short-cut.
ADVANTAGE PRO Chennais Premier Networking Training Centre

Straight Method In the straight method, we use binary notation for both the address and the mask and then apply the AND operation to find the subnet address.
ADVANTAGE PRO Chennais Premier Networking Training Centre

Example 1

What is the subnetwork address if the destination address is 200.45.34.56 and the subnet mask is 255.255.240.0?

ADVANTAGE PRO Chennais Premier Networking Training Centre

Solution

11001000 00101101 00100010 00111000 11111111 11111111 11110000 00000000 11001000 00101101 00100000 00000000 The subnetwork address is 200.45.32.0.
ADVANTAGE PRO Chennais Premier Networking Training Centre

Short-Cut Method ** If the byte in the mask is 255, copy the byte in the address. ** If the byte in the mask is 0, replace the byte in the address with 0. ** If the byte in the mask is neither 255 nor 0, we write the mask and the address in binary and apply the AND operation.
ADVANTAGE PRO Chennais Premier Networking Training Centre

Example 2

What is the subnetwork address if the destination address is 19.30.80.5 and the mask is 255.255.192.0?
Solution

See Figure 5.6


ADVANTAGE PRO Chennais Premier Networking Training Centre

Example 2
Figure 5-6

ADVANTAGE PRO Chennais Premier Networking Training Centre

Figure 5-7

Comparison of a default mask and a subnet mask

ADVANTAGE PRO Chennais Premier Networking Training Centre

The number of subnets must be a power of 2.

ADVANTAGE PRO Chennais Premier Networking Training Centre

Example 3

A company is granted the site address 201.70.64.0 (class C). The company needs six subnets. Design the subnets.
Solution

The number of 1s mask is 24 (class C).


Centre

in

the

default

ADVANTAGE PRO Chennais Premier Networking Training

Solution (Continued)

The company needs six subnets. This number 6 is not a power of 2. The next number that is a power of 2 is 8 (23). We need 3 more 1s in the subnet mask. The total number of 1s in the subnet mask is 27 (24 + 3). The total number of 0s is 5 (32 27). The mask is
ADVANTAGE PRO Chennais Premier Networking Training Centre

Solution (Continued)

11111111 11111111 11111111 11100000 or 255.255.255.224 The number of subnets is 8. The number of addresses in each subnet is 25 (5 is the number of 0s) or 32.
ADVANTAGE PRO Chennais Premier Networking Training Centre

Example 3

ADVANTAGE PRO Chennais Premier Networking Training Centre

Example 4

A company is granted the site address 181.56.0.0 (class B). The company needs 1000 subnets. Design the subnets.
Solution

The number of 1s in the default mask is 16 (class B).


ADVANTAGE PRO Chennais Premier Networking Training Centre

Solution (Continued)

The company needs 1000 subnets. This number is not a power of 2. The next number that is a power of 2 is 1024 (210 ). We need 10 more 1s in the subnet mask. The total number of 1s in the subnet mask is 26 (16 + 10). The total number of 0s is 6 (32 26).
ADVANTAGE PRO Chennais Premier Networking Training Centre

Solution (Continued)

The mask is 11111111 11111111 11111111 11000000 or 255.255.255.192. The number of subnets is 1024. The number of addresses in each subnet is 26 (6 is the number of 0s) or 64.
ADVANTAGE PRO Chennais Premier Networking Training Centre

Example 4

ADVANTAGE PRO Chennais Premier Networking Training Centre

You might also like