Why create a subnet mask? Tells device which part of an address is the network # including the subnet and which part is the host Filters the node IP address to determine which subnet it belongs to NETWORK/SUBNET/HOST
How to Create Subnets
The class determines which part of the address belongs to the network and which part belongs to the host Class A NNNNNNNN.hhhhhhhh.hhhhhhhh.hhhhhhhh Class B NNNNNNNN.NNNNNNNN.hhhhhhhh.hhhhhhhh Class C NNNNNNNN.NNNNNNNN.NNNNNNNN.hhhhhhhh
IP Subnet addressing default subnet masks In Binary Form Class A Class B Class C Class A Class B Class C
Restrictions on subnets Network addresses of all 0’s in the host portion are reserved for specifying the network Network addresses of all 1’s in the host portions are reserved for the broadcast address
How an IP address Is Composed Part of the 32 Bits represents A network ID The remainder is Used to represent A host with the network
Network & Host IDs Network ID – Each network has a unique network number –Each Network connected to the Internet has to have a globally unique ID – no other Internet- connected network in the world can have the same Network ID Host ID – –Within a given network – Host IDs are used to identify hosts Hosts – any device that needs to be addressed by an IP address - computers, printers, routers, etc. –Host IDs must be unique within a given network.
How Bits Are Set Up for Each IP Address Class Note – This shows the binary values in the first 3 bits of the 3 classes: 0?? For class A 10? For class B 110 for class C
How Address Classes Affect a Network Ranges of 1st octet network ID’s A B C
“private” address – cannot be routed on the internet
IP Address Guidelines First Octet Network ID Rules –Network ID cannot be 127. –ID bits cannot be all “1”s. –ID bits cannot be all “0”s. For class B or C Network IDs –Second octet (and the third octet for class C networks) can be any number from , or to Class B: x.x or x.x are OK Class C: x or x or are all OK
IP Address Guidelines First Octet Network ID Rules –Network ID cannot be 127. –ID bits cannot be all “1”s. –ID bits cannot be all “0”s. For class B or C Network IDs –Second octet (and the third octet for class C networks) can be any number from , or to Class B: x.x or x.x are OK Class C: x or x or are all OK
Problems with default masks They only provide for a single network segment –Class C – allows for a maximum of 254 hosts on the segment –Class B – allows for a maximum of 65,534 hosts on the segment –Class C – allows for a maximum of 16,777,214 hosts on the segment –Beyond class C networks, current LAN technologies will not support anywhere near the maximum number of hosts/segment Since there is only 1 network segment: –Difficult to use different topologies in the LAN (Ethernet, FDDI, Token Ring) –Difficult to have a geographically dispersed LAN connected using a WAN technology.
Common masks Masks – / hosts – / hosts – / hosts – / hosts – /26 64 hosts – /27 32 hosts – /28 16 hosts – /29 8 hosts /30 4 hosts – /31 not usable – /32 single host –Learn or memorize them. –Or, use the addition trick in column 2
Subnetting IP Addresses Variable length subnet masks –Could subnet a class B into several chunks Network Host Network HostSubnet Subnet Mask
Problem #1: Lifetime of Address Space Example: an organization needs 500 addresses. A single class C address not enough (256 hosts). Instead a class B address is allocated. (~64K hosts) That’s overkill -a huge waste.
IPv4 Addressing Dotted Decimal Notation Dotted Decimal Notation –Four bytes (8 bits = 1 byte) per address –Each byte separated by a dot –Each byte expressed in decimal notation Example: –Dotted Decimal Notation: –Binary Notation?: –What is the minimum decimal value any byte can be assigned? –What is the maximum decimal value any byte can be assigned?