IP Addressing

Download Report

Transcript IP Addressing

IP Addressing
IP Addressing
• A 32-bit logical naming convention used on the
Internet
• A dotted-decimal notation is used:
– 170.56.70.1
• Part denotes the network and part denotes the
client on the network
• IP address must be unique and clients on the same
network must have the same network ID
• IP Classes
–
–
–
–
–
Class A- Starts with 0, range of 1-127
Class B – Starts with 10, range of 128 - 191
Class C – Starts with 110, range of 192 - 223
Class D – Starts with 1110, range of 224 – 239
Class E – Starts with 1111, range 240 – 255
IP Addressing Contiuned
• IP address come pared with a subnet mask
• There is a default subnet mask for each IP class
– Class A 255.0.0.0
– Class B 255.255.0.0
– Class C 255.255.255.0
• The subnet mask tells what part of the IP address
denotes the network and which part denotes the
client
Division of Address Space
• The IP class scheme does not divide the 32-bit
address space into equal size classes
Authority for Addresses
• An organization obtains its IP network numbers
from an Internet Service Provider (ISP).
• ISPs coordinate with a central organization, the
Internet Assigned Number Authority, to ensure
that each network prefix is unique throughout the
entire Internet.
A Classful Example
• When assigning a network prefix, a number must
be chosen from class A, B, or C
• Usually networks are assigned a class C address
• For networks connected to the global Internet, a
service provider makes the choice.
• For a private network, the local network
administrator selects the class
A Classful Example
Classless Addressing
• The original classful scheme was limiting
• IP addresses were being exhausted
• Many assigned network numbers caused many
addresses to be unused
• New mechanisms were developed:
– Subnet addressing
– Classless addressing
• Idea: Instead of having three distinct address
classes, allow the division between prefix and
suffix to occur at any bit
Why Classless Addressing Helps
• Consider a network that contains 9 hosts
• Only 4 bits of host suffix are needed to represent
all possible host values.
• However, a class C address has names for 256
hosts.
• Classless addressing solves this problem by
allowing an ISP to assign a prefix that is 28 bits
long and the suffix then is 4 bits long.
• With 4 bits for the suffix, there are 16-2 = 14 host
numbers
Address Masks
• Classless addressing requires an additional
bit of information with each address
• This additional information specifies the
exact boundary between the network prefix
and the host suffix.
• Thus with classless addressing, tables inside
hosts and routers must contain two pieces of
information: the 32-bit address and another
32 bit value that specifies the boundary
between the prefix and the suffix (subnet
Address Masks Continued
• The subnet mask is stored as a 32-bit binary
number
• This allows for efficiency in extracting the
network part of the IP address by the host or
router
• The prefix portion of the IP address needs
to be compared to values in the routing
table.
• This can be done in two machine
How Routing Table Comparison
is Done
• Suppose D is a packet final destination
• Suppose (A, M) represents a 32-bit network
Address and a 32-bit Mask entry in the
routing table
• The router tests the condition:
Is A = (D &M) ?
• M = 255.255.0.0
• A = 128.10.0.0
• D = 128.10.2.3
CIDR Notation
• 128.10.0.0/16
• This notation specifies that the first 16 bits
of the address make up the network prefix
CIDR Address Block Example
• If an ISP has two computers each with only
12 computers each, the ISP can use CIDR to
partition a class B IP address into three
parts: two for each of the customers and the
remainder available for future use.
• One customer can be assigned:
128.211.0.16/28
• The other customer can be assigned:
128.211.0.32/28
CIDR Host Addresses
Special IP Addresses
Routers and IP Addressing
Principle
• Routers are assigned IP addresses as well as
host machines
• A router may be assigned two or more IP
addresses
Homework 14
• Finish reading Chapter 21
• Question. You have a network ID of
150.150.0.0 and you need to divide it into
multiple subnets. You need 600 host IDs for
each subnet, with the largest amount of
subnets available. Which subnet mask
would you use: 255.255.224.0;
255.255.240.0; 255.255.248.0;
255.255.252.0