IPv4 Addressing -...

Preview:

Citation preview

IPv4Addressing

awal.ece@gmail.com

https://en.wikipedia.org/wiki/Internet

ClientA

ClientB

Server10.10.1.103

192.168.0.5

192.0.2.10

IPAddress

2

IPv432Bit=4.2BillionIPAddresses!!!

Seemsenough? ButnoL

InternetofThings(IoT)3

GlobalInternet

CampusNetwork

PublicIPAddress

PrivateIPAddress

4

GlobalInternet

CampusNetwork

Home(Public/PrivateIP)

LabServer(PrivateIP)

5

IPv6128Bit=2128AddressYourdeviceswouldbeaccessibleinInternet

6

Internet

IPv4 IPv6+=

7

IPv4Address

8

PositionalNotation

9

Decimal– BinaryConversion

10

NetworkandHostBits

• AnIPv4addressiscomposedofaNetworkportionandHostportion.• Alldevicesonthesamenetworkmusthavetheidenticalnetworkportion.• TheSubnetMaskhelpsdevicesidentifythenetworkportionandhostportion.

• SubnetMask• TheIPv4addressiscomparedtothesubnetmaskbitbybit,fromlefttoright.• A1inthesubnetmaskindicatesthatthecorrespondingbitintheIPv4addressisanetworkbit.

11

NetworkAddress

• AlogicalANDisoneofthreebasicbinaryoperationsusedindigitallogic.• UsedtodeterminetheNetworkAddress• TheLogicalANDoftwobitsyieldsthefollowingresults:

12

PrefixLength

• Shorthandmethodofexpressingthesubnetmask.• Equalsthenumberofbitsinthesubnetmasksetto1.• Writteninslashnotation,/followedbythenumberofnetworkbits.

13

Octet DecimalCalculation Summation PrefixLength

1 0 0 0 0 0 0 0 128 128 /17

1 1 0 0 0 0 0 0 128+64 192 /18

1 1 1 0 0 0 0 0 128+64+32 224 /19

1 1 1 1 0 0 0 0 128+64+32+16 240 /20

1 1 1 1 1 0 0 0 128+64+32+16+8 248 /21

1 1 1 1 1 1 0 0 128+64+32+16+8+4 252 /22

1 1 1 1 1 1 1 0 128+64+32+16+8+4+2 254 /23

1 1 1 1 1 1 1 1 128+64+32+16+8+4+2+1 255 /24

AddressTypes

• NetworkAddress• Theaddressbywhichwerefertothenetwork• FirstIPoftheNetwork(allhostbitsare‘0’)

• BroadcastAddress• Aspecialaddressusedtosenddatatoallhostsinthenetwork• LastIPoftheNetwork(allhostbitis‘1’)

• HostAddress• Theaddressesassigned totheenddevicesinthenetwork• AllIPsexceptthenetworkandbroadcastaddress

14

PrivateIPv4Address

• PublicIPAddress:• Registered/MaintainedbyIANA/RIR• Routablethroughpublic internet

• PrivateIPAddress• Onlyusedininternalnetwork• Notvisibleinglobalroutingtable• Mustbetranslatedtoapublic IPv4toberoutable.• DefinedbyRFC1918

15

Class Network AddressRange

Class A 10.0.0.0/8 10.0.0.0 – 10.255.255.255

ClassB 172.16.0.0/12 172.16.0.0– 172.31.255.255

ClassC 192.168.0.0/16 192.168.0.0– 192.168.255.255

Quiz:PrivateandPublicIPAddress

16

Public

Private

64.104.0.22

192.168.3.5

192.169.2.15

172.32.35.2

172.16.30.30

192.168.11.5

10.55.3.168

209.165.201.30

SpecialIPv4Addresses

• Loopbackaddresses(127.0.0.0/8or127.0.0.1)• UsedonahosttotestiftheTCP/IPconfigurationisoperational.

• Link-Localaddresses(169.254.0.0/16or169.254.0.1)• CommonlyknownasAutomaticPrivateIPAddressing(APIPA)addresses.• UsedbyWindowsclienttoselfconfigureifnoDHCPserveravailable.

• TEST-NETaddresses(192.0.2.0/24or192.0.2.0to192.0.2.255)• Usedforteachingandlearning.

17

Legacy“Classful”AddressingConcept

18

ClasslessIPAddressing

• Classful AddressingwastedaddressesandexhaustedtheavailabilityofIPv4addresses.• ClasslessAddressingIntroducedinthe1990s• ClasslessInter-DomainRouting(CIDR,pronounced“cider”)• AllowedserviceproviderstoallocateIPv4addressesonanyaddressbitboundary(prefixlength)insteadofonlybyaclassA,B,orC.

19

RegionalInternetRegistry(RIR)

20

InternetResourcesAllocation

21

Subnetting IPv4Networks

ReasonsForSubnetting

• Reducesoverallnetworktrafficandimprovesnetworkperformance.• Enablesanadministratortoimplementsecuritypoliciessuchaswhichsubnetsareallowedornotallowedtocommunicatetogether.

23

Subnetting byLocation

Subnetting byDeviceType

Subnetting byUserType

Example1:SubnetinOctetBoundary

172.16.0.0/16

24

InterestingOctet

16 24BinaryBitCount 8

Task:Create/24Subnetsfrom172.16.0.0/16.

NetworkPortion HostPortion

Example1:SubnetinOctetBoundary

172.16.0.0/16

25

00000000Subnetting Boundary

16 24

Example1:SubnetinOctetBoundary

172.16.0.0/16

26

00000000000000010000001000000011

11111111........

24

BinaryRepresentation

16

1st Subnet2nd Subnet3rd Subnet4th Subnet

256th Subnet

........

Example1:SubnetinOctetBoundary

172.16.0.0/16

27

0123

255........

24

DecimalRepresentation

16

1st Subnet2nd Subnet3rd Subnet4th Subnet

256th Subnet

........

Example1:SubnetinOctetBoundary

28

1st Subnet2nd Subnet3rd Subnet4th Subnet

256th Subnet

........

172.16.0.0/24172.16.1.0/24172.16.2.0/24172.16.3.0/24

172.16.255.0/24

........

Example1:SubnetinOctetBoundary

172.16.2.0/24

29

00000000

11111111

........

24

BinaryRepresentation

16

1st IP/NetworkAddress

LastIP/BroadcastAddress

........

Task:Calculatenetworkaddress,broadcastaddressandusableIPsof3rd subnet.

000000011st useableIPAddress

11111110LastuseableIPAddress

Example1:SubnetinOctetBoundary

172.16.2.0/24

30

0

255

........

24

DecimalRepresentation

16

1st IP/NetworkAddress

LastIP/BroadcastAddress

........

Task:Calculatenetworkaddress,broadcastaddressandusableIPsof3rd subnet.

11st useableIPAddress

254LastuseableIPAddress

Example1:SubnetinOctetBoundary

SubnetNo.

NetworkAddress SubnetMask Broadcast

Address 1st UsableIP LastUsable IP

0 172.16.0.0/24 255.255.255.0 172.16.0.255 172.16.0.1 172.16.0.254

1 172.16.1.0/24 255.255.255.0 172.16.1.255 172.16.1.1 172.16.1.254

2 172.16.2.0/24 255.255.255.0 172.16.2.255 172.16.2.1 172.16.2.254

… … … … … …

… … … … … …

254 172.16.254.0/24 255.255.255.0 172.16.254.255 172.16.254.1 172.16.254.254

255 172.16.255.0/24 255.255.255.0 172.16.255.255 172.16.255.1 172.16.255.254

31

Example2:SubnetwithinOctetBoundary

172.16.0.0/24

32

InterestingOctet

16 24BinaryBitCount 8

Task:Createfourequal-sized/26subnetsfrom172.16.0.0/24.

32

Example2:SubnetwithinOctetBoundary

172.16.0.0/24

33

00000000

SubnettingBoundary

24 3226

Example2:SubnetwithinOctetBoundary

172.16.0.0/24

34

00000000010000001000000011000000

32

BinaryRepresentation

24

1st Subnet2nd Subnet3rd Subnet4th Subnet

26

Example2:SubnetwithinOctetBoundary

172.16.0.0/24

35

064128192

32

DecimalRepresentation

24

1st Subnet2nd Subnet3rd Subnet4th Subnet

Example2:SubnetwithinOctetBoundary

36

1st Subnet2nd Subnet3rd Subnet4th Subnet

172.16.0.0/26172.16.0.64/26172.16.0.128/26172.16.0.192/26

Example2:SubnetwithinOctetBoundary

SubnetNo.

NetworkAddress SubnetMask Broadcast

Address 1st UsableIP LastUsable IP

0 172.16.0.0/26 255.255.255.192 172.16.0.63 172.16.0.1 172.16.0.62

1 172.16.0.64/26 255.255.255.192 172.16.0.127 172.16.0.65 172.16.0.126

2 172.16.0.128/26 255.255.255.192 172.16.0.191 172.16.0.129 172.16.0.190

3 172.16.0.192/26 255.255.255.192 172.16.0.255 172.16.0.193 172.16.0.254

37

Example3:SubnetwithMultipleOctet

172.16.0.0/22

38

InterestingOctets

Task:Createsubnetsfrom172.16.0.0/22tosupport100hostsineachsubnetwithminimumIPwastage.

16 24BinaryBitCount 8 32

Example3:SubnetwithMultipleOctet

172.16.0.0/22

39

00000000.00000000SubnettingBoundary

22 3224 2516

Example3:SubnetwithMultipleOctet

172.16.0.0/22

40

00000000.000000003224 25

00000000.1 000000000000001.0 0000000

00000011.10000000

BinaryRepresentation

00000001.1000000000000010.00000000

221st Subnet2nd Subnet3rd Subnet

6th Subnet

8th Subnet

4th Subnet5th Subnet

00000010.10000000

16

00000011.0 00000007th Subnet

Example3:SubnetwithMultipleOctet

172.16.0.0/22

41

0.03224

0.1281.0

3.128

DecimalRepresentation

1.1282.0

1st Subnet2nd Subnet3rd Subnet

6th Subnet

8th Subnet

4th Subnet5th Subnet

2.128

16

3.07th Subnet

Example3:SubnetwithMultipleOctet

42

1st Subnet2nd Subnet3rd Subnet

6th Subnet7th Subnet

172.16.0.0/25172.16.0.128/25172.16.1.0/25

172.16.2.128/25172.16.3.0/25

4th Subnet5th Subnet

172.16.1.128/25172.16.2.0/25

8th Subnet 172.16.3.128/25

Example3:SubnetwithMultipleOctet

43

SubnetNo.

NetworkAddress SubnetMask Broadcast

Address 1st UsableIP LastUsable IP

0 172.16.0.0/25 255.255.255.128 172.16.0.127 172.16.0.1 172.16.0.126

1 172.16.0.128/25 255.255.255.128 172.16.0.255 172.16.0.129 172.16.0.254

2 172.16.1.0/25 255.255.255.128 172.16.1.127 172.16.1.1 172.16.1.126

3 172.16.1.128/25 255.255.255.128 172.16.1.255 172.16.1.129 172.16.1.254

4 172.16.2.0/25 255.255.255.128 172.16.2.127 172.16.2.1 172.16.2.126

5 172.16.2.128/25 255.255.255.128 172.16.2.255 172.16.2.129 172.16.2.254

6 172.16.3.0/25 255.255.255.128 172.16.3.127 172.16.3.1 172.16.3.126

7 172.16.3.128/25 255.255.255.128 172.16.3.255 172.16.3.129 172.16.3.254

PracticeTest1

• Create8Equal-sizedSubnetsfrom192.168.1.0/25• Createsubnetsfrom10.0.0.0/22tosupport200hostsineachsubnetwithminimumIPwastage.• Createsubnetsfrom172.16.0.0/23tosupport50hostsineachsubnetwithminimumIPwastage.

44

PracticeTest2

• Findanswersforaddress192.168.1.34• IsitanetworkaddressorbroadcastaddressorhostIP?• Networkandhostbits:• Subnetmask:• NumberofusableIP:• Networkaddress:• Broadcastaddress:• HostIPrange:

• Dothesamefor172.16.5.0/18.

45

VariableLengthSubnetMasks

TraditionalSubnetting:IPWastage

47

VLSMBenefits

48

PracticeVLSM

• Giventhenetwork172.16.0.0/23createssubnets:• Network-Afor200hosts• Network-Bfor50hosts• Network-Cfor10hosts• 4point-to-pointnetworksfor2hostseach

49

50

172.16.0.0/23

172.16.0.0/24Net-A(200Hosts)

172.16.1.0/24

172.16.1.0/26Net-B(50Hosts)

172.16.1.64/26 172.16.1.128/26 172.16.1.192/26

172.16.1.64/28Net-C(10Hosts)

172.16.1.80/28 172.16.1.96/28 172.16.1.112/28

172.16.1.80/30P2P-1

172.16.1.84/30P2P-2

172.16.1.88/30P2P-3

172.16.1.92/30P2P-4

PracticeTest3

• Giventhenetwork172.16.0.0/22• createssubnets,calculatesubnetmask,broadcastaddress,firstIPandlastIP:• UserLANfor500hosts• ServerLANfor25hosts• 2 point-to-pointnetworks

51

Questions?

52

Recommended