IP Addressing
● IPv4 addresses… ■ Uniquely identify an interface ■ 32 bits long ■ Consist of a network identifier and a 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 Network IdentifierHost Identifier 031
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 B 10netidhostid Class C 110hostidnetid Class D 1110multicast address Class E 1111reserved for future use Class A 0netid hostid
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 Classful Addressing
CIDR ● Classless Inter-Domain Routing (CIDR) was introduced to remedy problems with the rigid classes of IP addresses ■ Defined in RFCs ● Allows a flexible definition of the boundary between the network identifier and the host identifier ● Example ■ IP address: ■ Subnet mask: (22-bit network identifier) ■ Network: /22 ■ Packets with address in the range will be routed to network /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 a b c Router Dest = TargetInterface /24 a /24 b /24 c
Traditional Routing for a Mobile Host ● Host moving to another network is unreachable a b c Router Dest = X Mobile Host TargetInterface /24 a /24 b /24 c