You are on page 1of 41

Subnetting & NAT

SE332 – Computer Networking

Presentation no. 1

Group Members
Names ID’s
Maria Ahmed 14005065-083
Saad Tanvir 14005065-045
Talha Imdad 14005065-084
Hina Ilyas 14005065-068

Presented to: Sir Mustahsan Hammad Naqvi

Subnetting

Subnetting is a process of dividing large network into the smaller
networks .
OR
Subnetting means we borrow some bits from the Host part to add to
the Network part.

Every computer on network has an IP address that represent its
location on network.

Subnetting – Classful Networks

• The version of IP address used is IPv4(Internet Protocol version
4).
• Each number of an IP address is made from eight individual bits
known as octet.
• Each octet can create number value from 0 to 255.
• An IP address would be 32 bits long in binary divided into
the two components, network component and host
component.

Subnetting – Classful Network • IP addresses are broken into the two components: • Network component :.Defines the specific device on a particular network segment. IP Classes in decimal notation Class A addresses range from 1-126 Class B addresses range from 128-191 Class C addresses range from 192-223 Class D addresses range from 224-239 Class E addresses range from 240-254 . • Host component :.Defines network segment of device.

.Subnetting – Classful Network • 0 [Zero] is reserved and represents all IP addresses. to identify which part of an IP address is network address and which part is host address. like a loop back on an interface. • 127 is a reserved address and is used for testing. • 255 is a reserved address and is used for broadcasting purposes.  Subnet Mask Subnet mask is always used with IP address. Subnet mask has only one purpose.

255.1. • In binary notation subnet mask ON bit [1] represent network address while OFF bit[0] represent host address.0 IP Address 192 168 1 10 Subnet Mask 255 255 255 0 Network Address Host Address .255.168.10 and subnet mask is 255. • Example: IP address is: 192.Subnetting – Classful Network • In decimal notation subnet mask value 1 to 255 represent network address and value 0 [Zero] represent host address.

0 First 24 bits Last 8 bits /24 .255.0.255.0 First 8 bits Last 24 bits /8 Class B 255.Subnetting – Classful Network Class name Default Networks Host bits CIDR subnet mask bits Class A 255.0.0.0 First 16 bits Last 16 bits /16 Class C 255.255.

Each octet has eight individual bits which has following pattern: . IP Address 192 168 1 10 Subnet Mask 255 255 255 0 • Binary notation.Subnetting – Classful Network  Notations There are two notations to represent IP address and Subnet Mask. • Decimal notation.

Subnetting – Classful Network A network has following things to be calculated: Followings are calculated using IP address and Subnet Mask Network ID of each network Host ID of each network Broadcast ID of each network Hosts per Network .

Subnetting – Classful Network A network has following things to be calculated: Followings are calculated using IP address and Subnet Mask First valid IP address of each network Last valid IP address of each network Total Subnet .

.Subnetting – Classful Network Total Subnets/Number of the networks Calculation Methodology: In order to calculate the total subnet of a network. • Given subnet mask. General Formula: 2^N where N= Number of the host bits added to the network bits of a given subnet mask as compared to the default subnet mask of given IP address class. As we know that the classful networks uses default subnet mask according to the IP address class. Considerable things while calculating total Subnets: • Default subnet mask of the given IP address class. we need the subnet masks of the IP address class.

(Because no other subnet mask is given and we uses the default subnet Mask). So Total Subnet = 2^0 = 1 .255. 11111111 . 00000000 As the no number of network bits added to the host bits as compared to the default subnet mask of the IP address class.Subnetting – Classful Network Total Subnets/Number of the networks Example: Given: IP address: 192. 11111111 .0 and convert the default subnet mask into doted binary notation.20 and we have to calculate total subnet available. 11111111 . So here N will be zero .168. So its default subnet mask is 255. Solution: Step 1: Analyze the IP address class as it is Class C (ranges 192-223).255.1.

The subnet mask successive 1’s will tell the no.Subnetting – Classful Network Network ID of each network Calculation Methodology: we need the subnet masks of given IP address class and IP address. Considerable things while calculating: • Default subnet mask of the given IP address class. • IP address. . General Formula: Change the host bits of the IP address to 0’s while keeping the network bits unchanged . of networks bits.

. 00000000 Here the number of 1’s in the subnet mask tells the network bits in the IP address is 24 bits and remaining 8 bits is host bits.255. 11111111 . 00010100 Subnet Mask 11111111 .0 and convert the IP address & default subnet mask into doted binary notation.168. So its default subnet mask is 255.20 and we have to calculate Network ID.1. IP Address 11000000 . Solution: Step 1: Analyze the IP address class as it is Class C (ranges 192-223). 10101000 .Subnetting – Classful Network Network ID of each network Example: Given: IP address: 192.255. 00000001 . 11111111 .

10101000 .Subnetting – Classful Network Network ID of each network Step 2: Now by changing the host bits of the IP address to 0’s we will get the Network ID.0 /24 No.1. IP Address 11000000 . 00000001 . 00000000 Decimal Network ID 192. 10101000 . 00000001 . of network bits . 00010100 Network ID 11000000 .168.

Subnetting – Classful Network Host ID of each network Calculation Methodology: we need the subnet masks of given IP address class and IP address. The subnet mask successive 1’s will tell the no. General Formula: Change the network bits of the IP address to 0’s while keeping the host bits unchanged. of networks bits. Considerable things while calculating: • Default subnet mask of the given IP address class. . • IP address.

So its default subnet mask is 255. .20 and we have to calculate Host ID.Subnetting – Classful Network Host ID of each network Example: Given: IP address: 192. 10101000 . IP Address 11000000 .255.1.0 and convert the IP address & default subnet mask into doted binary notation. 00010100 Subnet Mask 11111111 . 00000000 Here the number of 1’s in the subnet mask tells the network bits in the IP address is 24 bits and remaining 8 bits is host bits. 11111111 . 11111111 . 00000001 .255.168. Solution: Step 1: Analyze the IP address class as it is Class C (ranges 192-223).

00000001 . 00000000 .Subnetting – Classful Network Host ID of each network Step 2: Now by changing the network bits of the IP address to 0’s we will get the Network ID. 10101000 .0. 00000000 .20 .0. 00010100 Decimal Host ID 0. 00010100 Host ID 00000000 . IP Address 11000000 .

Considerable things while calculating: • Default subnet mask of the given IP address class. General Formula: Change the Host bits of the IP address to 1’s while keeping the network bits unchanged. • IP address. . The subnet mask successive 1’s will tell the no.Subnetting – Classful Network Broadcast ID of each network Calculation Methodology: we need the subnet masks of given IP address class and IP address. of networks bits.

11111111 . 00010100 Subnet Mask 11111111 . IP Address 11000000 . . Solution: Step 1: Analyze the IP address class as it is Class C (ranges 192-223).255.Subnetting – Classful Network Broadcast ID of each network Example: Given: IP address: 192.255.0 and convert the IP address & default subnet mask into doted binary notation. 10101000 . 00000000 Here the number of 1’s in the subnet mask tells the network bits in the IP address is 24 bits and remaining 8 bits is host bits. 11111111 .20 and we have to calculate Broadcast ID.1. So its default subnet mask is 255. 00000001 .168.

00000001 .255/24 No.1. 10101000 . 00010100 Broadcast ID 11000000 . 11111111 Decimal Broadcast ID 192.Subnetting – Classful Network Broadcast ID of each network Step 2: Now by changing the host bits of the IP address to 1’s we will get the Broadcast ID. of network bits .168. 00000001 . IP Address 11000000 . 10101000 .

Subnetting – Classful Network First Valid host address of each network Calculation Methodology: we need to calculate the Network ID first (already mentioned details in slide 14-16) then we will easily calculate the first valid IP address. General Formula: Find the Decimal Notation of Network Id and add 1(integer) to the address of the Network ID. Considerable things while calculating: • Network ID .

1 .168.168.1.Subnetting – Classful Network First Valid Host Address ID of each network Example: Given: IP address: 192.0 + 1 First Valid Address 192. Solution: Step 1: Decimal Network ID 192.1.168.0 /24 (Already Calculated) Step 2: Decimal Network ID 192.1.168.20 and we have to calculate First valid host address.1.

Considerable things while calculating: • Broadcast ID . General Formula: Find the Decimal Notation of Broadcast Id and subtract 1(integer) to the address of the Broadcast ID.Subnetting – Classful Network Last Valid host address of each network Calculation Methodology: we need to calculate the Broadcast ID first (already mentioned details in slide 20-22) then we will easily calculate the last valid IP address.

1.254 .1.1. Solution: Step 1: Decimal Broadcast ID 192. 1 Last Valid Address 192.1.20 and we have to calculate First valid host address.Subnetting – Classful Network First Valid Host Address ID of each network Example: Given: IP address: 192.168.168.255 .168.255/24 (Already Calculated) Step 2: Decimal Broadcast ID 192.168.

We subtract two address which is Network ID and Broadcast ID which cannot assigned to any host. General Formula: ((2^32-N )-2) where N = number of the network bits in the subnet marks which is calculated by the no. Considerable things while calculating: • Network bits of subnet mask. of successive 1’s in the subnet mask. . of network bits in the subnet mask.Subnetting – Classful Network Hosts per network Calculation Methodology: To calculate the hosts per network we need to find the no.

Subnetting – Classful Network Host per network Example: Given: IP address: 192. So.255. 11111111 .0 and convert the default subnet mask into doted binary notation.168. 00000000 Step 2: Here N = 24 . Applying the formula : ((2^32-24)-2) = 2^8 – 2 = 254 hosts per network. Subnet Mask 11111111 .1.20 and we have to calculate host per network.255. . 11111111 . Solution: Step 1: Analyze the IP address class as it is Class C (ranges 192-223). So its default subnet mask is 255.

•Class B has default subnet mask 255. .255.255. In slash notation it would be written as /24. means address has 24 bits on.0. In slash notation it would be written as /8. In slash notation it would be written as /16.255. CIDR tells us number of on bits in a network address.0. means address has 16 bits on. that means first three octets of the subnet mask have all on bits. •Class C has default subnet mask 255. that means first octet of the subnet mask has all on bits.Subnetting – Classless Network CIDR [ Classless Inter Domain Routing]: CIDR is a slash notation of subnet mask. that means first two octets of the subnet mask have all on bits.0.0. •Class A has default subnet mask 255.0. means address has 8 bits on.0.

What is the first valid IP of the first network? iv.Calculate i.113.Subnetting – Classless Network Consider 200.16/28 a.20. How many networks are possible? ii.What is the last valid IP of the first network? v. What is the broadcast ID of first network? . How many hosts per network are possible? iii.

of possible networks = 2^4 = 16 . So. /28 means that 28 bits are the network bits i. we get no. 11111111 . 11111111 . 00000000 As the number of network bits is 28 (as given) and IP address class is C. 11111111 . Here N = 4 because 4 bits are extra used as compared to Default subnet mask(255.255.0) of the class C. Applying formula(Slide 10).Subnetting – Classless Network Solution: In this question. How many networks are possible? Answer: Given Subnet Mask 1 1 1 1 1 1 1 1 .255. 0000 0000 Default Subnet Mask 11111111 . 11111111 .

01110001 . So. 00010000 Given Subnet Mask 11111111 . 1111 0000 As the number of network bits is 28 (as given) and IP address class is C. How many hosts per network are possible? Answer: Given IP Address 11001000 . Number of host = ((2^32-28)-2) = 2^4 – 2 = 16 – 2 = 14 . Using (Slide-27) formula. 11111111 .Subnetting – Classless Network Solution: In this question. 00010100 . /28 means that 28 bits are the network bits ii. 11111111 .

17 / 28 . /28 means that 28 bits are the network bits iii.Subnetting – Classless Network Solution: In this question. 11111111 .20. 00010100 .113. 01110001 . What is the first valid IP of the first network? Answer: Given IP Address 11001000 . 1111 0000 To calculate the first valid IP we have to calculate Network ID and add one to It as already mentioned.16 / 28 First Valid IP 200. Network ID 11001000 01110001 00010100 00010000 Decimal Network ID 200. 00010000 Given Subnet Mask 11111111 .20.113. 11111111 .

31/ 28 Last Valid IP 200.30 / 28 . 1111 0000 To calculate the last valid IP we have to calculate Broadcast ID and subtract one to It as already mentioned. 11111111 . /28 means that 28 bits are the network bits iv.113.20. 00010100 .20. 00010000 Given Subnet Mask 11111111 . 01110001 . What is the Last valid IP of the first network? Answer: Given IP Address 11001000 .113.Subnetting – Classless Network Solution: In this question. 11111111 . Broadcast ID 11001000 01110001 00010100 00011111 Decimal Network ID 200.

•Allows a company to combine multiple ISDN connections into a single Internet connection .  Purpose: NAT serves three main purposes: •Provides a type of firewall by hiding internal IP addresses •Enables a company to use more internal IP addresses. NAT is an Internet standard that enables a local-area network (LAN) to use one set of IP addresses for internal traffic and a second set of addresses for external traffic.NAT(Network address translation) Definition: NAT is short for Network Address Translation. Since they're used internally only. there's no possibility of conflict with IP addresses used by other companies and organizations.

NAT(Network address translation) Basic Operation Of NAT • NAT device has address translation table • One to one address translation .

NAT(Network address translation) Types of NAT • Static NAT: A pool of public IP addresses are assigned to the NAT device. A private IP address can then be statically mapped to anyone of these public addresses. .

This time though the pool of IP addresses will be used when needed and then given back to the pool. The next time the same computer wanted an IP address it may be assigned a different public address from the pool. So if computer A needed a public address. . hence the name "dynamic". then hand it back when done.NAT(Network address translation) Types of NAT •Dynamic NAT: The NAT device will consist of a pool of IP addresses. because the one used previously may be in use by another computer. it would take one from the pool.

but with a different port number assignment. . each computer on LAN is translated to the same IP address.NAT(Network address translation) Types of NAT • NAT overload or Port Address translation: During PAT.

this is the dynamically or statically-assigned public address assigned to a private host. this is the same address as the Outside Global. • Outside Local : the address that identifies an outside host to the inside network. Often. However. Essentially. it is occasionally necessary to translate an outside (usually public) address to an inside (usually private) address. • Outside Global: the address assigned to an outside host (usually a public address).NAT(Network address translation) Terminology of NAT: Specific terms are used to identify the various NAT addresses: • Inside Local: the specific IP address assigned to an inside host behind a NAT-enabled device (usually a private address). . • Inside Global: the address that identifies an inside host to the outside world (usually a public address).

. Thank You You can download this presentation from Slideshare.