IP Addressing and Subnetting PDF
Document Details
Uploaded by CourteousPeachTree
STI
Tags
Summary
This document provides an overview of IP addressing and subnetting, covering various aspects like IPv4 and IPv6 versions, address formats, and network identifiers. It explains the concepts of public and private IP addresses and details the classification of these addresses, including their subnet masks. The document covers important details for computer networking.
Full Transcript
IT2203 IP Addressing and Subnetting The Internet Protocol (IP) had undergone several version changes. Currently, there are two (2) versions of an IP, IP version 4 (IPv4) and IP version 6 (IPv6). IP version 4 (IPv4) IP version 6 (IPv6) Deplo...
IT2203 IP Addressing and Subnetting The Internet Protocol (IP) had undergone several version changes. Currently, there are two (2) versions of an IP, IP version 4 (IPv4) and IP version 6 (IPv6). IP version 4 (IPv4) IP version 6 (IPv6) Deployed 1981 1992 32 – bit (4 bytes) Address Size 128 – bit (16 bytes) addressing scheme addressing scheme Dotted Decimal Notation: Hexadecimal Notation: Address Format 192.149.252.76 3FFE:F200:0234:AB00:0123:4567:8901:ABCD Prefix Notation 192.149.0.0/24 3FFE:F200:0234::/48 Number of 2128 = 232 = 4 ̴ ,294,967,296 Addresses 3 ̴ 40,282,366,920,938,463,374,607,431,768,211,456 Network Identifiers via TCP/IP MAC (Media Access Control) address refers to the unique physical address of all computers, which are assigned by the manufacturer of the network interface card. Organizational Unique Identifier (OUI) – This is the first 24 bits of the MAC address that is vendor-specific; it identifies the company that manufactured or sold the device (e.g., network interface card, router ports). Vendor-Assigned – This is the remaining 24 bits of the MAC address that is incrementally and uniquely assigned by the specific vendor of the hardware–denotes the serial number of the individual device. An IP address refers to an address that is usually assigned by the network administrator or internet service provider in order to uniquely and universally identify each device on an IP network. o A public IP address is what computers use to find each other online and exchange information. It is assigned to the computer by the Internet Service Provider as soon as the computer is connected to the Internet gateway. ▪ Static public IP address – It is a fixed IP address and is used primarily for hosting web pages or services on the Internet. ▪ Dynamic public IP address – It is chosen from a pool of available addresses and changes each time one connects to the Internet. o A private IP address is what computers on a network use to communicate with the router. It can change each time they are connected. o Parts of an IP Address ▪ The network ID/field identifies the host that is located on the same physical network. ▪ The host ID (also known as a host address) identifies the individual host (e.g., workstation, server, router, or other TCP/IP host) within a network. Classes of IPv4 Address Class A address – This uses only the first octet (8 bits) 1.0.0.0 to 127.0.0.0 of the 32-bit number to indicate the network address. Network.Host.Host.Host The entire second to the fourth octet is used for host Number of Bits used in Network / Host – 24 addresses, which is now equivalent to a total of 24 bits. Maximum Host of Network – 16,777,214 04 Handout 1 *Property of STI [email protected] Page 1 of 6 IT2203 Class B address – This uses two (2) of the four (4) octets 128.0.0.0 to 191.255.255.255 (16 bits) to indicate the network address. The two Network.Network.Host.Host other octets, which specify the host addresses, now Number of Bits used in Network / Host – 16 have a total of 16 bits. Maximum Host of Network – 65,534 Class C address – This uses the first three octets (24 192.0.0.0 to 233.255.255.255 bits) of the IP address to identify the network portion, Network.Network.Network.Host with the remaining octet reserved for the host portion, Number of Bits used in Network / Host – 8 which is equivalent to eight (8) bits. Maximum Host of Network – 254 Class D address – This is created to enable multicasting 224.0.0.0 to 239.255.255.255 using an IP address. A multicast address is a unique Host.Host.Host.Host address that directs packets with that destination The first four bits of Class D must be 1110. address to predefined groups of hosts. The first octet range for this class is 11100000 to 11101111, or 224 to 239. Class E address – This is reserved by the Internet 240.0.0.0 to 255.255.255.255 Engineering Task Force (IETF) for its own research. The first four bits of Class E is set to “1111”. Therefore, the first octet range for Class E addresses is 11110000 to 11111111, 240 to 255. IANA IPv4 Special-Purpose Addresses Diagnostic It is used for testing and debugging of (Loopback/Localhost 127.0.0.0 – 127.255.255.255 programs, hardware, protocol, and Address) connections. (SYN-ACK) Default Network 0.0.0.0 It is used for routing internet datagram (TCP). It is used for broadcasting messages to the Network Broadcast 255.255.255.255 entire network. 10.0.0.0 – 10.254.254.254 It is the preconfigured default IP addresses for Private-use of 172.16.0.0 – 172.16.254.254 network devices to extend IPv4 spaces Internet Space 192.168.0.0 – 192.168.254.254 (Home, Commercial, Enterprise) If DHCP is not present, these IP addresses will Link-Local Addresses 169.254.0.0 – 169.254.254.254 be selected and configured by the network device. o The subnet mask (default mask) determines which portion of an IP address identifies the network and which portion identifies the host. Like the IP address, it is represented by four octets. The network bits are represented by the 1s in the network mask, and the node bits are represented by the 0s. Class Default Mask Decimal Binary Shorthand A 255.0.0.0 11111111.00000000.00000000.00000000 /8 B 255.255.0.0 11111111.11111111.00000000.00000000 /16 C 225.255.255.0 11111111.11111111.11111111.00000000 /24 Note: Class D & E are used for Multicast and Research purposes. Default Gateway is used to specify the address of the nearest routing device that is used by the host device to forward addressed packets onto the network. 04 Handout 1 *Property of STI [email protected] Page 2 of 6 IT2203 Dotted-Binary to Dotted-Decimal Conversion (Using Positional Notation) 01110101. 10010101. 00011101. 00000010 N10 For: 01110101 For: 10010101 For: 00011101 For: 00000010 The IP address is equivalent to 117.149.29.2 when written in dotted-decimal notation. Subnet Masking For our computer to tell where to break the IP address apart to get the abovementioned Input Output parts of an IP address, the IP address must be “ANDed” with its default mask in binary. x y F = xy 0 0 0 Example: Determine the network and the host portion of an IP address, 200.133.175.33. 0 1 0 Step 1: Convert IPv4 address from decimal into binary. 1 0 0 Step A: Divide the given decimal number by 2 and note down the remainder. 1 1 1 Step B: Divide the obtained quotient by 2, and note the remainder again. Step C: Repeat the above steps until you get 0 as the quotient. Step D: Write the remainders in such a way that the last remainder is written first, followed by the rest in the reverse order. Step E: This can also be understood in another way which states that the Least Significant Bit (LSB) of the binary number is at the top and the Most Significant Bit (MSB) is at the bottom. This number is the binary value of the given decimal number. 200 133 175 33 Div Qou Rem Div Qou Rem Div Qou Rem Div Qou Rem 200/2 100 0 LSB 133/2 66 1 LSB 175/2 87 1 LSB 33/2 16 1 LSB 100/2 50 0 66/2 33 0 87/2 43 1 16/2 8 0 50/2 25 0 33/2 16 1 43/2 21 1 8/2 4 0 25/2 12 1 16/2 8 0 21/2 10 1 4/2 2 0 12/2 6 0 8/2 4 0 10/2 5 0 2/2 1 0 6/2 3 0 4/2 2 0 5/2 2 1 1/2 0 1 MSB 3/2 1 1 2/2 1 0 2/2 1 0 0 1/2 0 1 MSB 1/2 0 1 MSB 1/2 0 1 MSB 0 Binary equivalent is 11001000.10000101.10101111. 00100001. 04 Handout 1 *Property of STI [email protected] Page 3 of 6 IT2203 Step 2: Check the IP Address class and use the “AND” operation to the binary equivalent of the IP address with its equivalent default mask. Note: Default mask to be used is 225.255.255.0 or 11111111.11111111.11111111.00000000 in Class C. Subnetting It refers to a process of borrowing bits from the host ID field to form a new subnet ID field. Example: A company is granted a site address 138.45.0.0 and it needs to be subnetted into 45 individual networks. Step 1: Determine the class and the default mask of the IP address you have been given. First Octet Second Octet Third Octet Fourth Octet 138 45 0 0 Class B Range: 128 to 191. Default Mask is 255.255.0.0 or 11111111.11111111.00000000.00000000 Step 2: Identify the number of subnetworks (subnets) that are required. Subnets Needed: 45 Step 3: Determine how many bits are required to support the total number of subnets. This tells us that it takes a total of 6 bits to support the value of 45, 101101. Step 4: Determine the custom subnet mask for our network by masking. Thus, the custom subnet mask in dotted-decimal notation is 255.255.252.0; to support 45 individual networks with a given network ID of 138.45.0.0, we would have to use a subnet mask of 255.255.252.0 04 Handout 1 *Property of STI [email protected] Page 4 of 6 IT2203 Step 5: Determine all of the valid network IDs by using the smallest bit of the custom subnet mask. Increments of 4: 138.45.4.0 - 138.45.8.0 Step 6: List each subnet address starting with the incremental value. Total number of subnets = 2s – 2; S = 6 bits Total number of hosts = 26 – 2 = 62 Step 7: Determine the number of host addresses that could support each subnetwork. Count the remaining bits (zero’s) to the right-hand side of the custom subnet mask. Default Mask 11111111. 11111111. 00000000. 00000000 Custom Subnet Mask 11111111. 11111111. 11111100. 00000000 Total Hosts = 2h- 2; h = 10 Total Hosts = 210- 2 = 1,024 - 2 (for the invalid addresses) = 1,022 total hosts per subnetwork IPv6 Addresses and Notation The rapid expansion of the Internet scale was unforeseen at that time. In the 1990s, the IETF launched technologies such as Network Address Translation (NAT) and Classless Inter-Domain Routing (CIDR) to delay IPv4 address exhaustion. On February 3, 2011, the Internet Assigned Numbers Authority (IANA) announced even allocation of its last 4.68 million IPv4 addresses to five Regional Internet Registries (RIRs) around the world. On November 25, 2019, the last batch of /22 IPv4 allocation was created. (IPv4 exhaustion) In December 1998, IPv6 became a Draft Standard for the IETF, which subsequently ratified it as an Internet Standard on 14 July 2017. Internet Protocol version 6 (IPv6) is a set of specifications designed by the IETF, which is an upgraded version of IPv4. The other term for this is IP Next Generation (IPng). The length of an IPv6 address is 128 bits. Colons are generally used to divide the IPv6 address into eight segments. Each segment contains 16 bits and is expressed in hexadecimal notation. 04 Handout 1 *Property of STI [email protected] Page 5 of 6 IT2203 Like an IPv4 address, an IPv6 address is expressed in the format of IPv6 address/mask length. o Example: 2001:0DB8:2345:CD30:1230:4567:89AB:CDEF/64 ▪ IPv6 address: 2001:0DB8:2345:CD30:1230:4567:89AB:CDEF ▪ Subnet number: 2001:0DB8:2345:CD30::/64 IPv6 Abbreviation Specifications The leading 0s in each 16-bit segment can be omitted. However, if all bits in a 16-bit segment are 0s, at least one 0 must be reserved. The tailing 0s cannot be omitted. If one or more consecutive 16-bit segments contain only 0s, a double colon (::) can be used to represent them, but only one :: is allowed in an entire IPv6 address. If an abbreviated IPv6 address contains two double colons (::), the IPv6 address cannot be restored to the original one. IPv6 Address Classification Unicast address identifies an interface. A packet destined for a unicast address is sent to the interface having that unicast address. o Unspecified address: 0:0:0:0:0:0:0:0/128, or ::/128. The address is used as the source address of some packets. o Loopback address: 0:0:0:0:0:0:0:1/128, or ::1/128, which is used for local loopback. The data packets sent to ::/1 are actually sent to the local end and can be used for loopback tests of local protocol stacks. Multicast address identifies multiple interfaces. A packet destined for a multicast address is sent to all the interfaces joining in the corresponding multicast group. o Only the interfaces that join a multicast group listen to the packets destined for the corresponding multicast address. o IPv6 does not define any broadcast address. On an IPv6 network, all broadcast application scenarios are served by IPv6 multicast. Anycast address identifies a group of network interfaces (usually on different nodes). o A packet sent to an anycast address is routed to the nearest interface having that address, according to the router's routing table. References: Comer, D. (2019). The Internet book: Everything you need to know about computer networking and how the Internet works. CRC Press. Decimal to Binary. (n.d.). In cuemath.com. Retrieved on February 4, 2022 from https://www.cuemath.com/numbers/decimal-to-binary/ Huawei. (2020). HCIA-Datacom V1.0 Training Material. Karumanchi, N., Damodaram, A., & Rao, S. (2020). Elements of computer networking: An integrated approach. Career Monk. Kurose, T. & Ross, K. (2021). Computer networking: A top-down approach. Pearson. Robertazzi, T. (2017). Introduction to computer networking. Springer International. 04 Handout 1 *Property of STI [email protected] Page 6 of 6