Transcript IP address

IP Addressing
IP Addressing
● IPv4 addresses…
■ Uniquely identify an interface
■ 32 bits long
■ Consist of a network identifier and a host identifier
0
31
Network Identifier
Host Identifier
● Routing outside of the destination host’s subnet is
usually based on the network identifier, while the
host identifier is only used within the destination’s
subnet
● IPv6 uses 128-bit addresses
Five Classes of IP Addresses
● IP addressing was originally based on five classes of
addresses
■ A router can interpret the network and host fields by
examining the first few bits of the IP address
Class A
01234
0 netid
8
16
24
31
Class B
10
Class C
110
netid
Class D
1110
multicast address
Class E
1111
reserved for future use
hostid
netid
hostid
hostid
Classful Addressing
The address space is divided into five classes: A, B, C, D and E.
Finding the classes in binary and dotted-decimal notation
From Figure 19.2 of Data Communications and Networking by Forouzan, 4th
CIDR
● Classless Inter-Domain Routing (CIDR) was
introduced to remedy problems with the rigid classes
of IP addresses
■ Defined in RFCs 1517-1520
● Allows a flexible definition of the boundary between
the network identifier and the host identifier
● Example
■ IP address:
10.1.9.52
■ Subnet mask: 255.255.252.0 (22-bit network identifier)
■ Network:
10.1.8.0/22
■ Packets with address in the range 10.1.8.0-10.1.11.255 will be
routed to network 10.1.8.0/22 based on the first 22 bits
A Problem With IP Addressing
● An IP address serves two different functions…
■ The name for an interface (host) and
■ The location (subnet) of the interface (host) in the network
● The IP address is the only “name” carried in an IP
datagram
■ DNS can be used to map one or more symbolic names to
one or more IP addresses, but a symbolic name is not
carried in the datagram and has no meaning once the DNS
lookup is completed
● The network identifier in the IP address is used by
routers to deliver to the destination subnet
■ The IP address is associated with the location or subnet of
the destination host
IP Routing
● Router uses routing table to direct packets to the
appropriate interface
Target
2.0.0.0/24
3.0.0.0/24
4.0.0.0/24
Interface
a
b
c
3.0.0.2
3.0.0.3
4.0.0.5
4.0.0.6
b
a
Dest = 3.0.0.4
Router
c
3.0.0.4
Traditional Routing for a Mobile Host
● Host moving to another network is unreachable
Target
2.0.0.0/24
3.0.0.0/24
4.0.0.0/24
Interface
a
b
c
3.0.0.2
3.0.0.3
b
X
a
Dest = 3.0.0.4
Router
3.0.0.4
c
Mobile
Host
4.0.0.5
4.0.0.6
3.0.0.4