1 / 34

Network Layer: IP Addressing

Network Layer: IP Addressing. CE 306, IEU/Computer Eng. S. Kondakci. Topics Covered. Addresses for the Virtual Internet The IP Addressing Scheme The IP Address Hierarchy Original Classes of IP Addresses Dotted Decimal Notation Address Masks

bpratt
Download Presentation

Network Layer: IP Addressing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Network Layer: IP Addressing CE 306, IEU/Computer Eng. S. Kondakci

  2. Topics Covered • Addresses for the Virtual Internet • The IP Addressing Scheme • The IP Address Hierarchy • Original Classes of IP Addresses • Dotted Decimal Notation • Address Masks • Division of the Address Space (Subnetting) • Subnet and Classless Addressing: CIDR Notation • Special IP Addresses • Routers and the IP Addressing Principle • Multi-Homed Hosts

  3. Addresses for the Virtual Internet • All host computers must use a uniform addressing scheme • Each address of a node must be unique • MAC addresses do not suffice because • the Internet can include multiple network technologies • and 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

  4. The IP Addressing Scheme • When sending a packet across the Internet, sender’s protocol software must specify • its own 32-bit IP address (the source address) • and the address of the destination machine

  5. Example Communication Browser/client DNS server Another network 68.80.0.0/13 Your network 68.80.2.0/24 web page Server/destination Google’s network 64.233.160.0/19 64.233.169.105

  6. IP Address Structure & Hierarchy • Each host is assigned a unique 32-bit numberknown as the host's IP address or Internet address. • IP address is divided into two parts: • A prefix (Network part) • identifies the physical network to which the host is attached • Each network in the Internet is assigned a unique network number • A suffix (Host part) • identifies a specific computer (host/node) on the network • Each computer on a given network is assigned a unique suffix • IP address scheme guarantees two properties: • Each computer is assigned a unique address Network number assignments must be coordinated globally • Suffixes are assigned locally without global coordination bit 0 bit 31

  7. Original Classes of IP Addresses • The original classful IP addressing divides the IP address space into three (3) primary classes, A, B, and C • each class has a different size of prefix and suffix

  8. Dotted Decimal Notation • express each 8-bit section of a 32-bit number as a decimal value • uses periods (dots) to separate the sections • The scheme is known as dotted decimal notation • Each octet (byte) is an unsigned binary integer • dotted decimal addresses range is 0.0.0.0 through 255.255.255.255

  9. Division of the Address Space • The classful scheme divides the address space into unequal sizes

  10. IP Address Ranges

  11. Subnetworking • As the number of distinct local networks grows, managing them can become a serious problem • Solution: Split a network into several parts (subnetworks) for internal use but still act like a single network to the outside world. • E.g., Split the 16-bit host address area into 6-bit subnet number plus 10-bit host number. • Two mechanisms are used to split the network: • 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 prefix/suffix on an arbitrary bit boundary

  12. Subnets (cont’d) Outside the network, subnetting is not visible so allocating a new subnet does not require contacting NIC or changing any external databases Every router has tables for Network IP addresses (network, 0) Local host IP addresses (this-network, host) When a packet arrives, the router checks its tables If it is destined for a distant network, the packet is forwarded to the next router If destined for a local host, it is sent directly to the destination Subnet masks are AND’ed by the IP address to determine the subnet address 12

  13. Subnetworking byNetmasks • How can an IP address be divided at an arbitrary boundary? • Theclassless and subnet addressing schemes require hosts and routers to store an additional piece of information: • a value that specifies the exact boundary between the network prefix and the host suffix • To mark the boundary, IP uses a 32-bit value • known as an address mask, also called a subnet mask or netmask • Why store the boundary size as a bit mask? • A mask makes processing efficient • Hosts and routers need to compare the network prefix portion of the address to a value in their forwarding tables • The bit-mask representation makes the comparison fast and efficient

  14. Address Masks • Suppose a router is given • a destination address, D • a network prefix represented as a 32-bit value, N • a 32-bit address mask, M • Assume the top bits of N contain a network prefix, and the remaining bits have been set to zero • To test whether the destination lies on the specified network, the router tests the condition: N == (D & M) • The router • uses the mask with a “logical and (&)” operation to set the host bits of address D to zero (0) • and then compares the result with the network prefix N

  15. Address Masks in Action As an example: • Consider the following 32-bit network prefix: 10000000 00001010 00000000 00000000 = 128.10.0.0 • Consider a 32-bit mask: 11111111 11111111 00000000 00000000 = 255.255.0.0 • Consider a 32-bit destination address 10000000 00001010 00000010 00000011 = 128.10.2.3 • A logical AND between the destination address and the address mask extracts the high-order 16-bits 10000000 00001010 00000000 00000000 = 128.10.0.0

  16. Subnets: Example A campus network consisting of LANs for various departments. 16

  17. Using (Sub)net Masks Given a class C network of 204.15.5.0. Create 8 subnets Show subnet addressess Show host address range on each subnet 204.15.5.0 11001100.00001111.00000101.00000000 255.255.255.224 11111111.11111111.11111111.11100000 ----------------------------------------------------------------------------|sub| host Number of hosts on each subnet = = 2^5-2=30 Subnet Netmask Host address range 204.15.5.0 255.255.255.224 1 to 30 204.15.5.32 255.255.255.224 33 to 62 204.15.5.64 255.255.255.224 65 to 94 204.15.5.96 255.255.255.224 97 to 126 204.15.5.128 255.255.255.224 129 to 158 204.15.5.160 255.255.255.224 161 to 190 204.15.5.192 255.255.255.224 193 to 222 204.15.5.226 255.255.255.224 225 to 254 17

  18. Overall Structure of the 8 Subnets

  19. Examples on Ubuntu

  20. Class B subnetting • You have 172.16.0.0 As the network ID • Take 5 bits from the host ID and use them as subnet bits, 172.16.0.0 10101100.00000000.00000000.00000000 255.255.248.0 11111111.11111111.11111000.00000000 -------------------------------------------------------------|subnet| host • Number of subnets = 2^5 = 32 • Number of hosts on each subnet = 2^11-2= 2048-2 = 2046

  21. Class A subnetting • You have 10.0.0.0 As the network ID • Take 7 bits from the host ID and use them as subnet bits, 10.0.0.0 00001010.00000000.00000000.00000000 255.254.0.0 11111111.11111110.00000000.00000000 ------------------------------------------------| subnet | host • Number of subnets = 2^7 = 128 • Number of hosts on each subnet = 2^17-2= 131072-2 = 131070

  22. CIDR Notation • Classless Inter-Domain Routing (CIDR) • The name is unfortunate because CIDR only specifies addressing and forwarding • Designers wanted to make it easy for a human to specify a mask • Consider the mask needed for the example in Figure 21.4b • It has 26 bits of 1s followed by 6 bits of 0s • In dotted decimal, the mask is: 255.255.255.192 • 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 number of one bits in the mask • Thus, one might write the following: 192.5.48.69/26 • which specifies a mask of 26 bits • Figure 21.5 lists address masks in CIDR notation • along with the dotted decimal equivalent of each

  23. 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 and 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 prefixes 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 prefix • More important, the ISP retains most of the original address block • it can then allocate to other customers

  24. CIDR Host Addresses

  25. A list of address masks in CIDR notation and in dotted decimal

  26. Subnet and Classless Addressing • Assume an Internet service prvider (ISP) owns a class C prefix • Classful addressing assigns the entire prefix to one organization • With classless addressing • the ISP can divide the prefix into several longer prefixes • and assign each to a subscriber • Figure illustrates how classless addressing allows an ISP to divide a class C prefix into four (4) longer prefixes • each one can accommodate a network of up to 62 hosts • the host portion of each prefix is shown in gray • The original class C address has 8 bits of suffix • and each of the classless addresses has 6 bits of suffix • Assuming that the original class C prefix was unique • each of the classless prefixes will also be unique • Thus, instead of wasting addresses • ISP can assign each of the four (4) classless prefixes to a subscriber

  27. Subnet and Classless Addressing

  28. Special IP Addresses • IP defines a set of special address forms that are reserved • Special addresses are reserved and never assigned to hosts, for example, • Loopback Address 127.0.0.1:Loopback address (127.0.0.1) is used to test network applications • It is used for preliminary debugging after a network application has been created

  29. Special IP Addresses Loopback Address 127.0.0.1 • A programmer can test the program logic quickly • without needing two computers and without sending packets across a network • IP reserves the network prefix 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 number 1 • so it makes 127.0.0.1 the most popular loopback address • During loopback testing no packets ever leave a computer • the IP software forwards packets from one application to another • The loopback address never appears in a packet traveling across a network

  30. Summary of Special IP Addresses • The following table summarizes the special IP addresses

  31. Routers and the IP Addressing Principle • Each router is assigned two or more IP addresses • one address for each network to which the router attaches • To understand why, recall two facts: • A router has connections to multiple physical networks • Each IP address contains a prefix that specifies a physical network • A single IP address does not suffice for a router • because each router connects to multiple networks • and each network has a unique prefix • 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 and a network • A computer with multiple network connections (e.g., a router) must be assigned one IP address for each connection

  32. Multi-homed Hosts: Routers and the IP Addressing Principle

  33. The Internet Control Message Protocol (ICMP) Provides control messaging among the routers to monitor the operation of the Internet Messages are encapsulated in IP packets DESTINATION UNREACHABLE TIME EXCEEDED PARAMETER PROBLEM SOURCE QUENCH REDIRECT ECHO REQUEST ECHO REPLY TIMESTAMP REQUEST TIMESTAMP REPLY TANENBAUM Computer Networks 1 33

  34. Internet Control Message Protocol The principal ICMP message types. 5-61 TANENBAUM Computer Networks 1 34

More Related