IPv4 and Subnetting Part 1 Announcements and Outline IPv4 • Review of packet formats and addressing • Assigning Addresses • • Public vs. Private Dotted decimal notation 2 IP Packet Formats IPv4 Header: 192 bits (24 bytes) IPv6 Header: 320 bits (40 bytes) 5-3 IPv6 Addressing IPv4 uses 4 byte addresses: Total of 4 billion possible addresses IP addresses often assigned in (large) groups • Giving out many numbers at a time • IPv4 address space has been used up quickly IPv6 uses 16 byte addresses: 3.2 x 1038 addresses, 320 undecillion Little chance this address space will ever be used up 5-4 Types of Addresses • Application Layer Address Application Layer • Network Layer Address Transport Layer Network Layer Data Link Layer • Data Link Layer Address 5-5 Assigning Addresses 5-6 IP Addressing Structure The dotted decimal structure of a binary IP address and label its parts © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 7 IP Addressing Structure The general role of 8-bit binary in network addressing and convert 8-bit binary to decimal 6.1.1.1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 8 IPv4 Addresses 4 byte (32 bit) addresses Strings of 32 binary bits Dotted decimal notation Used to make IP addresses easier to understand for human readers Breaks the address into four bytes and writes the digital equivalent for each byte Example: 128.192.56.1 10000000 11000000 0011100000000001 5-9 IP Addresses (dotted decimal notation) Examples 11000000 10101000 00000001 00000101 192 . 168 . 1 5 10 Binary and Decimal Conversion 5 - 11 Converting from binary to decimal • Use the same template as before • Add the place values corresponding to the locations that have 1 in the number • E.g.: 11100011 128 (2^7) 64 (2^6) 32 (2^5) 16 (2^4) 8 (2^3) 4 (2^2) 2 (2^1) In decimal, this number is: 12 1 (2^0) Converting from binary to decimal You should be comfortable working with binary numbers with up to 8 bits e.g.: 10011011 128 64 32 16 8 4 2 1 • This number is equal to: • Largest possible number with 8 digits? 13 Converting from binary to decimal Try converting the following numbers to decimal 10000110 128 64 32 16 8 4 2 1 32 16 8 4 2 1 11001000 11110000 128 64 14 IPv4 – Binary to Dotted Decimal Notation 5 - 15 Converting from decimal to binary • Used to compute subnet sizes, broadcast addresses etc. – You should be comfortable with binary numbers with up to 8 digits • One technique is to fill-in-the-blanks – Start with template below – Place 1 in the leftmost-possible position – Subtract place-value and repeat until subtraction yields 0 128 64 32 16 8 4 2 1 16 Converting from decimal to binary e.g.: 133 128 128 64 64 32 32 16 16 8 8 4 4 2 1 2 1 17 Converting from decimal to binary Try converting the following numbers to binary 134 200 240 18 IP addresses – structure • IP addresses are not assigned at random like MAC addresses – Or even on first-come-first-serve basis • The first few address bits define the organization to which the address belongs – Remaining bits are unique to the computer (host) within the organization 19 Assigning Addresses - Network Classes (IPv4) https://www.arin.net/knowledge/address_filters.html 5 - 20 Class A networks 21 Class B and C networks Class B networks Class C networks 22 Public and Private IP Addresses The use of these addresses need not be unique among outside networks. Hosts that do not require access to the Internet at large may make unrestricted use of private addresses. The private address blocks are: • 10.0.0.0 to 10.255.255.255 (10.0.0.0 /8) • 172.16.0.0 to 172.31.255.255 (172.16.0.0 /12) • 192.168.0.0 to 192.168.255.255 (192.168.0.0 /16) Does UNCW use the private address blocks within their network? 5 - 23 Introducing NAT and PAT NAT is designed to conserve IP addresses and enable networks to use private IP addresses on internal networks. These private, internal addresses are translated to routable, public addresses. IPv4 addresses are almost depleted. NAT/PAT has allowed IPv4 to be the predominant network protocol © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 24 When should you use public / private addresses? 5 - 25