Chapter 18. IP: Internet Protocol Addresses Jing Wang Towson University 18.1. Introduction • Addressing scheme used by the Internet Protocol (IP) • How IP addressing scheme divided addresses into classes • Subnet addressing and classless addressing 18.2. Addresses For The Virtual Internet • To provide uniform addressing in an internet, protocol software defines an abstract addressing scheme that assigns each host a unique protocol address. • Users, application programs, and higher layers of protocol software use the abstract protocol addresses to communicate. 18.3. The IP Addressing Scheme • Internet Protocol address (IP address or Internet address) • An Internet Address (IP address) is a unique 32-bit binary number assigned to a host and used for communication with the host 18.4. The IP Address Hierarchy • Each 32-bit IP address is divided into – A prefix – a unique value known as network number – A suffix – a unique address on a given physical network 18.4. The IP Address Hierarchy • Properties of IP address hierarchy – Each computer is assigned a unique address – Although network number assignments must be coordinated globally, suffixes can be assigned locally without global coordination 18.5. Original Classes Of IP Addresses Figure 18.1. The five classes of IP addresses in the original classful scheme. The address assigned to a host is either class A, B, or C; the prefix identifies a network, and the suffix is unique to a host on that network. 18.5. Original Classes Of IP Addresses • Classful IP addressing • The original IP addressing scheme divides host addresses into three primary classes. The class of an address determines the boundary between the network prefix and host suffix. 18.6. Computing The Class of An Address Figure 18.2. The mapping between the first four bits of an IP address and the class of the address. The mapping was used with the original classful scheme. 18.7. Dotted Decimal Notation • Dotted decimal notation is a syntactic form that IP software uses to express 32-bit binary values when interacting with humans. • Dotted decimal represents each octet in decimal and uses a dot to separate octets. – Dotted decimal addresses range from 0.0.0.0 through 255.255.255.255 • 00000000 – 0 • 11111111 – 255 18.7. Dotted Decimal Notation Figure 18.3. Examples of 32-bit binary numbers and their equivalent in dotted decimal notation. Each octet is written in decimal with periods (dots) used to separate octets. 18.8. Classes And Dotted Decimal Notation Figure 18.4. The range of decimal values found in the first octet of each address class. 18.9. Division Of The Address Space Figure 18.5. The number of networks and hosts per network in each of the three primary IP address classes. 18.10. Authority For Addresses • An organization obtains network numbers from ISPs – Internet Service Providers (ISPs) • the communication company that supplies Internet connections • ISPs coordinate with Internet Assigned Number Authority – To ensure that each network prefix is unique throughout the entire Internet 18.11. A Classful Addressing Example Figure 18.6. An example private internet with IP addresses assigned to hosts. The size of the cloud used to denote a physical network corresponds to the number of hosts expected on the network; the size of a network determines the class of address assigned. 18.12. Subnet And Classless Addressing • Limitation of the original classful addressing scheme – IP address space being exhausted – Because all networks had to choose one of three possible sizes, many addresses unused • New mechanism – Subnet addressing – Classless addressing 18.12. Subnet And Classless Addressing • Instead of having three distinct address classes, allow the division between prefix and suffix to occur on an arbitrary bit boundary • Example – A network contains 9 hosts – Classless addressing subdivide a single class C address into 16 address that each have a 28-bit prefix and a 4-bit suffix – Created 16 networks that each have up to 14 hosts. 18.13. Address Masks • To use classless or subnet masking, tables inside hosts and routers that contain addresses must keep two pieces of information with each address: – The 32-bit address itself – Another 32-bit value that specifies the boundary between network prefix and suffix • Address mask or subnet mask – 1 bits mark the network prefix – 0 bits mark the host portion – Subnet addressing was in use for a decade before the idea was extended to classless addressing 18.13. Address Masks • How can an IP address be divided at an arbitrary boundary? • Suppose a router is given a destination address D, and a pair (A, M) that represents a 32-bit IP address and a 32-bit address mask • To make a comparison, the router tests the condition A== (D&M) • The router uses the mask with a “logical and” operation to set the host bits of address D to zero, and then compares the result with the network prefix A 18.13. Address Masks • Example – – – – – – – 32-bit mask 255.255.0.0 11111111 11111111 00000000 00000000 32-bit network prefix 128.10.0.0 10000000 00001010 00000000 00000000 Consider a destination address 128.10.2.3 10000000 00001010 00000010 00000011 A logical “and” between destination address and the address mask produces the binary result – 10000000 00001010 00000000 00000000 – Which is equal to the prefix 128.10.0.0 18.14. CIDR Notation • Classless Inter-Domain Routing (CIDR) and IP subnetting techniques each use a 32-bit address mask to denote the boundary between the network prefix and host suffix. • Software that interacts with humans either uses the slash notation that was developed for CIDR or dotted decimal notation instead of binary notation 18.14. CIDR Notation • Classless Inter-Domain Routing (CIDR) • Known as CIDR notation, the new form specifies the mask associated with an address by appending a slash and the size of the mask in decimal (slash notation) • Example – Classful address 128.10.0.0 consists of 16-bit network prefix and a 16-bit host suffix – In CIDR notation, the address can be written 128.10.0.0/16 • Appendix 3 18.15. A CIDR Address Block Example • Suppose an ISP begins with a single class B prefix (e.g., 128.211.0.0) • Classful addressing – The ISP can only assign the prefix to one customer with up to 216 host addresses – Can not have 2 customers with 12 computers each • Under CIDR – 128.211.0.0/16 correspond to classful – 128.211.9.16/28 and 128.211.0.32/28 for each of the 2 customers, same mask size but prefixes differ – ISP retains most of the original addresses 18.16. CIDR Host Addresses Figure 18.7. Illustration of CIDR addressing for a /28 prefix. Note that because bits are numbered starting at zero, the prefix covers bits 0 through 27. Thus, bits 28 through 31 correspond to the host suffix. 18.17. Special IP Addresses • • • • • Network Address – Address 128.211.0.0/16 denotes a network that has been assigned the prefix 128.211 Directed Broadcast Address – IP defines a directed broadcast address for each physical network Limited Broadcast Address – Limited broadcast is used during system startup by a computer that does not know the network number – IP will broadcast any packet sent to the all-ones address across the local network This Computer Address – The TCP/IP protocol suite contains protocols a computer can use to obtain its IP address automatically when the computer boots. – When using such startup protocols to use IP to communicate, the computer can not supply a correct IP source address Loopback Address – IP defines a loopback address used to test network applications. – When one application sends data to another, data travels down the protocol stack to the IP software, which forwards it back up through the protocol stack to the second program – IP reserves the network prefix 127/8 for use with loopback. Most popular: 127.0.0.1 18.18. Summary Of Special IP Addresses Figure 18.8. Summary of the special IP address forms. 18.20. Routers And The IP Addressing Principle • An IP address does not identify a specific computer. Instead, each IP address identifies a connection between a computer and a network. • A computer with multiple network connections (e.g., a router) must be assigned one IP address for each connection 18.20. Routers And The IP Addressing Principle Figure 18.9. An example of IP addresses assigned to two routers. Each interface is assigned an address that contains the prefix of the network to which the interface connects. 18.21. Multi-Homed Hosts • A computer that connects to multiple networks is called multi-homed – Increase reliability, performance – Like a router, a multi-homed host has multiple protocol addresses, one for each network connection. 18.22. Summary • Addressing scheme – IP divides each internet address into a two-level hierarchy – An IP address is a 32 bit number. – Originally, an address was placed in one of five classes which can be determined by the values of the first four bits • CIDR – Stores a 32-bit mask along with each address • Each IP address identifies a connection between a computer and a network.