Department of Engineering Science ES465/CES 440, Intro. to Networking & Network Management IP: Internet Addressing http://www.sonoma.edu/users/k/kujoory References • “Computer Networks & Internet,” Douglas Comer, 6th ed, Pearson, 2014, Ch 21, Textbook, 5th ed, slides by Lami Kaya (LKaya@ieee.org) with some changes. • “Computer Networks,” A. Tanenbaum, 5th ed., Prentice Hall, 2011, ISBN: 13:978013212695-3. • “Computer & Communication Networks,” Nader F. Mir, 2nd ed, Prentice Hall, 2015, ISBN: 13: 9780133814743. • “Data Communications Networking,” Behrouz A. Forouzan, 4th ed, McGraw-Hill, 2007 • “Data & Computer Communications,” W. Stallings, 7th ed., Prentice Hall, 2004. • “Computer Networks: A Systems Approach," L. Peterson, B. Davie, 4th Ed., Morgan Kaufmann 2007. Ali Kujoory 6/30/2016 Not to be reproduced without permission 1 Topics Covered • 21.1 Introduction • 21.2 The Move to IPv6 • 21.3 The Hourglass Model & Difficulty of Change • 21.4 Addresses for the Virtual Internet • 21.5 The IP Addressing Scheme • 21.6 The IP Address Hierarchy • 21.7 Original Classes of IPv4 Addresses • 21.8 IPv4 Dotted Decimal Notation • 21.9 Authority for Addresses • 21.10 IPv4 Subnet & Classless Addressing • 21.11 Address Masks • 21.12 CIDR Notation Used With IPv4 Ali Kujoory 6/30/2016 • • • • • • • • • • 21.13 A CIDR Example 21.14 CIDR Host Addresses 21.15 Special IPv4 Addresses 21.16 Summary of Special IPv4 Addresses 21.17 IPv4 Berkeley Broadcast Address Form 21.18 Routers & the IPv4 Addressing Principle 21.19 Multi-Homed Hosts 21.20 IPv6 Multihoming & Network Renumbering 21.21 IPv6 Addressing 21.22 IPv6 Colon Hexadecimal Notation Not to be reproduced without permission 2 21.1 Introduction • This chapter – Explains the physical architecture of the Internet that allows routers interconnect physical networks – Begins a description of protocol software that makes the Internet appear to be a single, seamless communication system – Introduces the addressing scheme used by IP version 4 (IPv4) – Discusses the use of address masks for classless & subnet addressing – The Internet transition between IPv4 & IPv6 Ali Kujoory 6/30/2016 Not to be reproduced without permission 3 2.2 The Move To IPv6 • Before we discuss IPv4 & IPv6 addressing, it is important to – understand the change that is occurring – used a 32-bit address • However, the global Internet continues to grow exponentially • IPv4 addressing has been extremely successful to accommodate – The size doubling < a year – all IPv4 has been assigned – Heterogeneous networks connect in the Internet – Dramatic changes in hardware technology – Large scale across the world • So why change? Ali Kujoory 6/30/2016 • IPv4 was designed to connect a few computers originally & • So, the primary motivation for defining a new version of IP is to allow – much more address space to accommodate the growth & – Internet of Things Not to be reproduced without permission 4 21.3 The Hourglass Model & Difficulty of Change • Although the scarcity of IP addresses was apparent & work on IPv6 began in 1993, organizations were reluctant to change to IPv6 • IPv4 with relatively insufficient addressing capability lies in the center of the Internet where the hourglass is thin, although – all applications use IP – IP runs over different network technologies • So IP requires a change to the entire Internet Figure 21.1 The hourglass model of Internet communication with IP at the center. Ali Kujoory 6/30/2016 Not to be reproduced without permission 5 21.4 Addresses for the Virtual Internet • To achieve a seamless communication system – protocol software must hide the details of physical networks – it should offer the illusion of a single, large network • From the point of view of an application – the virtual Internet operates like any network • allowing computers to send & receive packets • The main difference between the Internet & a physical network is – Internet is an abstraction imagined by its designers & created entirely by protocol software • Thus, the designers chose – addresses, packet formats, & delivery techniques independent of the details of the underlying hardware Ali Kujoory 6/30/2016 Not to be reproduced without permission 6 21.4 Addresses for the Virtual Internet • Addressing is a critical component of the Internet • All host computers must use a uniform addressing scheme • Each address must be unique • MAC (physical) addresses do not suffice because – the Internet can include multiple network technologies, & – each technology defines its own MAC addresses • The advantage of IP addressing lies in uniformity: – an arbitrary pair of application programs can communicate without knowing the type of network hardware or MAC addresses being used • IP addresses are supplied by protocol software – They are not part of the underlying network • Many layers of protocol software use IP addresses Ali Kujoory 6/30/2016 Not to be reproduced without permission 7 21.5 The IPv4 Addressing Scheme • Each host is assigned a unique 32-bit number – known as the host's IP address (RFC 791, 2113) or Internet address • When sending a packet across the Internet, sender’s protocol software must specify – its own 32-bit IP address (source address) & – the address of the intended recipient (destination address) Ali Kujoory 6/30/2016 Not to be reproduced without permission 8 21.6 The IP Address Hierarchy • IP address is divided into two parts: • A prefix, called Network address part or Net-ID – identifies the physical network to which the host is attached – Each network in the Internet is assigned a unique network ID • A suffix, called Host address part or Host_ID – identifies a specific computer (host/node) on the network – Each computer on a given network is assigned a unique Host_ID • IP address scheme guarantees two properties: – Each computer is assigned a unique address, i.e., • a single address is never assigned to more than one computer – Net_ID assignment must be coordinated globally & Host_ID is assigned locally without global coordination Ali Kujoory 6/30/2016 Not to be reproduced without permission 9 21.7 Original Classes of IP Addresses • How many bits to place in each part of an IP address? – The Net_ID needs sufficient bits to allow a unique network # to be assigned to each physical network in the Internet – The Host_ID needs sufficient bits to permit each computer attached to a network to be assigned a unique Host_ID • No simple choice was possible to allocate bits! – Choosing a large Net_ID accommodates many networks • but limits the size of each network – Choosing a large Host_ID means each physical network can contain many computers • but limits the total # of networks Ali Kujoory 6/30/2016 Not to be reproduced without permission 10 21.7 Original Classes of IP Addresses • Internet contains a few large physical networks & many small networks – the designers chose an addressing scheme to accommodate a combination of large & small networks • The original classful IP addressing divides the IP address space into 3 primary classes – each class has a different size Net_ID & Host_ID • The first 4 bits of an IP address determines the class to which the address belongs – They specify how the remainder of the address is divided into Net_IDs & Host_IDs • Fig. 21.1 illustrates the five address classes – the leading bits identify each class, & – the rest identify the Network address & Host address parts Ali Kujoory 6/30/2016 Not to be reproduced without permission 11 21.7 Original Classes of IPv4 Addresses Net_ID = Prefix Host_ID = Suffix Replaces Figure 21.2 of Comer. From IP address formats, Tanenbaum, computer networks, 5th ed, Fig 5-53. Show: - How many networks & how many host each network type allows? - How can you identify each class by logical binary AND or OR operations? Ali Kujoory 6/30/2016 Not to be reproduced without permission 12 21.8 IPv4 Dotted Decimal Notation • A notation more convenient for humans to understand is used • The accepted Notation is: – Express each 8-bit section of a 32bit number as a decimal value – Use periods to separate the sections • The scheme is known as dotted decimal notation Figure 21.3 Examples of 32-bit binary #s & their equivalent in dot-decimal notation used in IPv4 • Fig. 21.3 illustrates examples of binary numbers & the equivalent dotted decimal notation • Dotted decimal treats each octet (byte) as an unsigned binary integer – the smallest value, 0 • occurs when all bits of an octet are zero (0) – the largest value, 255 • occurs when all bits of an octet are one (1) – dotted decimal addresses range 0.0.0.0 through 255.255.255.255 Ali Kujoory 6/30/2016 Not to be reproduced without permission 13 21.9 Authority for Addresses • Internet Corporation for Assigned Names & Numbers (ICANN) authority has been established – to handle address assignment & settle disputes • ICANN does not assign individual Net_IDs – Instead, ICANN authorizes a set of registrars to do so • Registrars make blocks of addresses available to ISPs – ISPs provide addresses to subscribers • To obtain a Net_ID – a corporation usually contacts an ISP Ali Kujoory 6/30/2016 Not to be reproduced without permission 14 21.10 IPv4 Subnet & Classless Addressing • As the Internet grew – the original classful addressing scheme became a limitation • Everyone demanded a class A or class B address – So they would have enough addresses for future growth • but many addresses in class A & B were unused – Many class C addresses remained & few wanted to use them Ali Kujoory 6/30/2016 • Two mechanisms were invented to overcome the limitation: – Subnet addressing – Classless addressing • The two mechanisms are closely related – they can be considered to be part of a single abstraction: • instead of having three distinct address classes, allow the division between Net_ID & Host_ID on an arbitrary bit boundary Not to be reproduced without permission 15 21.10 IPv4 Subnet & Classless Addressing • Subnet addressing was initially used within large organizations – used also in IPv6 • Classless addressing extended the approach to all Internet • They both facilitate using the IP addresses more effectively since IP addresses are scarce • Suppose an ISP that hands out Net_IDs & a small business requests a Net_ID for a network that contains 35 hosts – Classful addressing requires a complete class C with 8-bit Host_ID – While 6 bits of Host_ID are needed to cover all possible host_IDs • This means 28-35= 219 of the 254 possible Host_IDs would never be assigned – So most of the class C address space is wasted • For the above example – classless addressing allows the ISP to assign • a Net_ID that is 26 bits long • a Host_ID that is 6 bits long Ali Kujoory 6/30/2016 Not to be reproduced without permission 16 21.10 IPv4 Subnet & Classless Addressing • Assume an ISP owns a class C Net_ID • Classful addressing assigns the entire Net_ID to one organization • With classless addressing, the – ISP can divide the Net_ID into several longer Net_IDs, subnet & – assign each to a subscriber • Fig. 21.4 show classless addressing Figure 21.4 (a) An IPv4 Class C prefix, & (b) same prefix divided into 4 classless prefixes • It allows ISP to divide a class C Net_ID into 4 longer Net_IDs – each one can accommodate a network of up to 62 hosts – the host portion of each Net_ID is shown in gray • The original class C address uses 8 bits for Host_ID, while – each of the classless addresses has 6 bits of Host_ID • The classless Net_IDs will be unique as its original Class C • Thus, instead of wasting addresses – ISP can assign each of the 4 classless Net_IDs to a subscriber Ali Kujoory 6/30/2016 Not to be reproduced without permission 17 21.11 Address Masks • How can an IP address be divided at an arbitrary boundary & be recognizable by routers? • Classless & subnet addressing schemes require hosts & routers to specify & store an additional 32-bit addressing information that – specifies the exact boundary between Net_ID & Host_ID fields – known as an address mask, also called a subnet mask • The boundary size is represented as a bit-mask to make the processing efficient • Hosts & routers need to compare the Net_ID portion of the address with the subnet mask in their forwarding tables Ali Kujoory 6/30/2016 Not to be reproduced without permission 18 Address Mask • In the 32-bit Mask in a classful address (below) – N leftmost bits of Net_ID are 1s, & – “32 – N” rightmost bits of Host_ID are 0s N is fixed in Classful address • In classless addressing, N can vary depending upon the desired # of bits set for Net_ID field to design a cost effective subnet • Thus, the Address Mask separates the network & host addresses to facilitate the routing function in a router • It identifies the block of addresses for devices on the same subnet, e.g., – Class C network addresses 199.199.5.0, 199.199.6.0, & 199.199.7.0 can be combined by using a subnet mask of 255.255.252.0 for each Ali Kujoory 6/30/2016 Not to be reproduced without permission 19 Routing Using Subnets To forward a packet, a router identifies the subnet by its address Mask • IP network addresses that are to be combined must share the same high-order bits • By bitwise “AND”ing a given IP address & its Subnet Mask a router can quickly identify which subnet the address belongs to & should forward the packet to Ali Kujoory 6/30/2016 Default Class C mask 255.255.255.0 Not to be reproduced without permission 20 21.12 CIDR Notation • Classless Inter-Domain Routing (CIDR, RFC 1817) – CIDR only specifies addressing & forwarding – Designers wanted to make it easy for a human to specify a mask • Consider the mask needed for the example in Fig. 21.4b – It has 26 bits of 1s followed by 6 bits of 0s – In dotted decimal, the mask is: 255.255.255.192 192|10=1100,0000|2 Figure 21.4 (a) An IPv4 Class C prefix, & (b) same prefix divided into 4 classless prefixes • The general form of CIDR notation is: ddd.ddd.ddd.ddd/m – ddd is the decimal value for an octet of the address – m is the # of 1 bits in the mask • Thus, one might write the following: 192.5.48.69/26 – which specifies a mask of 26 bits • Fig. 21.5 lists address masks in CIDR notation – along with the dotted decimal equivalent of each Ali Kujoory 6/30/2016 Not to be reproduced without permission 21 Fig. 21.5 A list of address masks in CIDR notation & in dotted decimal Ali Kujoory 6/30/2016 Not to be reproduced without permission 22 21.13 A CIDR Example • Assume an ISP has the following block 128.211.0.0/16 • Suppose the ISP has 2 customers – one customer needs 12 IP addresses & the other needs 9 • The ISP can assign – customer1 CIDR: 128.211.0.16/28 – customer2 CIDR: 128.211.0.32/28 – both customers have the same mask size (28 bits), the Net_IDs differ • The binary value assigned to customer1 is: 10000000 11010011 00000000 0001 0000 • The binary value assigned to customer2 is: 10000000 11010011 00000000 0010 0000 • There is no ambiguity – Each customer has a unique Net_ID – More important, the ISP retains most of the original address block • it can then allocate to other customers Ali Kujoory 6/30/2016 Not to be reproduced without permission 23 21.14 CIDR Host Addresses • Once an ISP assigns a customer a CIDR Net_ID – the customer can assign host addresses for its network users • Suppose an organization is assigned 128.211.0.16/28 • Fig. 21.6 illustrates that the organization will have 4-bits to use as a host address field Figure 21.6 Illustration of IPv4 CIDR addressing for an example /28 prefix. – It shows the highest/lowest addresses in binary & dotted decimal – The example avoids assigning the all 1s & all 0s host addresses • Fig. 21.6 illustrates a disadvantage of classless addressing • Because the host Host_ID can start on an arbitrary boundary – values are not easy to read in dotted decimal, e.g., • when combined with the network Net_ID, the 14 possible host Host_IDs result in dotted decimal values from 128.211.0.17 through 128.211.0.30 Ali Kujoory 6/30/2016 Not to be reproduced without permission 24 21.15 Special IPv4 Addresses • There are some special addresses that are reserved by IP to denote networks or set of computers – Special addresses are never assigned to hosts • The syntax & semantics of each special address form is explained in the following subsections – 21.15.1 Network Address – 21.15.2 Directed Broadcast Address – 21.15.3 Limited Broadcast Address – 21.15.4 This Computer Address – 21.15.5 Loopback Address Ali Kujoory 6/30/2016 Not to be reproduced without permission 25 21.15.1 IPv4 Network Address • One of the motivations for defining special address forms can be seen in Fig. 21.6 • It is convenient to have an address that can be used to denote the Net_ID assigned to a given network • IP reserves host address zero – & uses it to denote a network connecting a number of hosts Figure 21.6 Illustration of IPv4 CIDR addressing for an example /28 prefix. • Thus, the address 128.211.0.16/28 denotes a network – because the bits beyond the 28 are zero • A network address should never appear as the destination address in a packet • Note: Section 21.17 discusses the Berkeley broadcast address form, which is a nonstandard exception Ali Kujoory 6/30/2016 Not to be reproduced without permission 26 21.15.2 IPv4 Directed Broadcast Address • To simplify broadcasting (send to all) – IP defines a directed broadcast address for each physical network • When a packet is sent to a network's directed broadcast – a single copy of the packet travels across the Internet • until it reaches the specified network – the packet is then delivered to all hosts on the network • The directed broadcast address for a network is formed by adding a Host_ID that consists of all 1 bits to the network Net_ID How does broadcast work? • If network hardware supports broadcast – a directed broadcast will be delivered using the hardware broadcast capability • If a particular network does not have hardware support for broadcast – software must send a separate copy of the packet to each host on the network Ali Kujoory 6/30/2016 Not to be reproduced without permission 27 21.15.3 IPv4 Limited Broadcast Address • Limited broadcast refers to a broadcast on a directlyconnected network – informally, we say that the broadcast is limited to a “single wire” • Limited broadcast is used during system startup – by a computer that does not yet know the network number • IP reserves the address consisting of 32-bits of 1s – refer to limited broadcast • Thus, IP will broadcasts any packet sent to the all-1s address across the local network Ali Kujoory 6/30/2016 Not to be reproduced without permission 28 21.15.4 IPv4 This Computer Address • A computer needs to know its IP address – before it can send or receive Internet packets • TCP/IP contains protocols a computer can use to obtain its IP address automatically when the computer boots – The startup protocols also use an IP to communicate • When using such startup protocols – a computer cannot supply a correct IP source address – To handle such cases • IP reserves the address that consists of all 0s to mean this computer Find out: - How do you identify your computer IP address? - What is your computer address whether Windows or Mac PC? Ali Kujoory 6/30/2016 Not to be reproduced without permission 29 21.15.5 IPv4 Loopback Address • Loopback address used to test network applications • It is used for preliminary debugging after a network application has been created • A programmer must have two application programs that are intended to communicate across a network – Each application includes the code needed to interact with TCP/IP • Instead of executing each program on a separate computer – the programmer runs both programs on a single computer, & – instructs them to use a loopback address when communicating • When one application sends data to another – data travels down the protocol stack to the IP software, then – forwards it back up through the protocol stack to the second program Ali Kujoory 6/30/2016 Not to be reproduced without permission 30 21.15.5 IPv4 Loopback Address • A programmer can test the program logic quickly – without needing two computers & without sending packets across a network • IP reserves the network Net_ID 127/8 for use with loopback • The host address used with 127 is irrelevant – all host addresses are treated the same – programmers often use host # 1 – so it makes 127.0.0.1 the most popular loopback address • During loopback testing no packets ever leaves a computer – the IP software forwards packets from one application to another • The loopback address never appears in a packet traveling across a network Ali Kujoory 6/30/2016 Not to be reproduced without permission 31 21.16 Summary of Special IPv4 Addresses • Figure 21.7 lists a set of special address forms reserved by IP – Special addresses are never assigned to hosts Figure 21.7 Summary of the special IP address forms. Ali Kujoory 6/30/2016 Not to be reproduced without permission 32 21.17 IPv4 Berkeley Broadcast Address Form • The UC Berkeley developed & distributed an early implementation of TCP/IP protocols – known as Berkeley Software Distribution as part of UNIX (BSD UNIX) • BSD implementation contained a nonstandard feature – Berkeley implementation uses a host Host_ID that contains all 0s instead of all 1s to represent directed broadcast – this address form is known as Berkeley broadcast • Initially many computer manufacturers derived their early TCP/IP software from the Berkeley implementation, & – a few sites still use Berkeley broadcast • TCP/IP implementations often include a configuration parameter – that can select between the TCP/IP standard & the Berkeley form Ali Kujoory 6/30/2016 Not to be reproduced without permission 33 21.18 Routers & IP Addressing Principle • Each router is assigned two or more IP addresses – one address for each network to which the router attaches • A single IP address does not suffice for a router – because each router connects to multiple networks, & – each network has a unique Net_ID • The IP scheme can be explained by a principle: – An IP address does not identify a specific computer – Each address identifies a connection between a computer & a network – A computer with multiple network connections (e.g., a router) must be assigned one IP address for each connection Ali Kujoory 6/30/2016 Not to be reproduced without permission 34 21.18 Routers & the IP Addressing Principle Ali Kujoory 6/30/2016 Not to be reproduced without permission 35 21.19 Multi-Homed Hosts • Can a host connect to multiple networks? Yes • A host computer with multiple network connections is said to be multi-homed • Multi-homing is sometimes used to increase reliability – if one network fails, the host can still reach the Internet through the second connection • Alternatively, multi-homing is used to increase performance – connections to multiple networks can make it possible to send traffic directly & avoid routers, which are sometimes congested • Like a router, a multi-homed host has multiple protocol addresses – one for each network connection • The computers in Salazar 2006 have three Ethernet ports Ali Kujoory 6/30/2016 Not to be reproduced without permission 36 21.20 IPv6 Multihoming & Network Renumbering • IPv6 promotes multihoming to a central position, though IPv4 prohibits it • IPv6 host assumes to have multiple connections & multiple addresses – Motivation for a network to have multiple prefixes (Net_IDs) comes from need to renumber networks • When an organization changes its service provider, IPV6 makes it easier Ali Kujoory 6/30/2016 • Protocols were designed so the new prefix could be added while running applications continued to use the old prefix – When an application was launched, the application would use the new prefix & • soon all applications would be using the new prefix & • the old prefix could be removed • It is sad that after years of work on network renumbering in IPv6, automated renumbering is not still practical Not to be reproduced without permission 37 21.21 IPv6 Addressing • IPv4 & IPv6 (RFC 1365, 2590) assign address for each computer connection & a physical network – A router needs at least 3 IPv6 addresses to connect to 3 physical networks – IPv6 permits multiple prefixes (Net_IDs) to be assigned to a given network • IPv6 uses 128 bits & includes 3 levels of addressing hierarchy – Global prefix for routing in the Internet (variable size) – Subnet for subnets at the organization (variable size) – Interface for a specific computer (64 bits) Figure 21.9 The division of a 128-bit IPv6 address into Net_ID, subnet, & interface sections. The interface is 64 bit wide. Ali Kujoory 6/30/2016 Not to be reproduced without permission 38 21.21 IPv6 Addressing • IPv6 defines three types of addresses Figure 21.10 The three types of IPv6 addresses. Ali Kujoory 6/30/2016 Not to be reproduced without permission 39 21.21 IPv6 Addressing • Anycast addressing was originally known as cluster addressing – The motivation for such addressing arises from a desire to allow replication of services, e.g., • A corporation that offers a service over the network assigns an anycast address to several computers/servers that provide the service • When a user sends a datagram to the anycast address, IPv6 routes the datagram to one of the computers in the set (i.e., in the cluster) • If a user from another location sends a datagram to the anycast address – IPv6 can choose to route the datagram to a different member of the set – allowing both computers to process requests at the same time Ali Kujoory 6/30/2016 Not to be reproduced without permission 40 21.22 IPv6 Colon Hexadecimal Notation • IPv6 address occupies 128 bits – writing such #s can be unwieldy & difficult to handle • Consider a 128-bit number in the dotted decimal notation: 105.220.136.100.255.255.255.255.0.0.18.128.140.10.255.255 • To reduce the # of characters used to write addresses – designers of IPv6 chose a more compact syntactic form known as colon hexadecimal notation, usually abbreviated colon hex – each group of 16 bits is written in hex with a colon separating groups • When the above # is written in colon hex: 69DC : 8864 : FFFF : FFFF : 0 : 1280 : 8C0A : FFFF Ali Kujoory 6/30/2016 Not to be reproduced without permission 41 21.22 IPv6 Colon Hexadecimal Notation • An additional optimization known as zero compression further reduces the size – Zero compression replaces sequences of zeroes with two colons – E.g., the address: FF0C:0:0:0:0:0:0:B1 FF0C : : B1 • The large IPv6 address spaces make zero compression especially important – designers expect many IPv6 addresses to contain strings of zeroes • To help ease the transition to the new protocol – designers mapped existing IPv4 addresses into the IPv6 address space – Any IPv6 address that begins with 96-zero bits contains an IPv4 address in the low-order 32-bits Ali Kujoory 6/30/2016 Not to be reproduced without permission 42