Download presentation
Presentation is loading. Please wait.
Published byGabriella Underwood Modified over 9 years ago
1
1 26-Aug-15 Addressing the network using IPv4 Lecture # 2 Engr. Orland G. Basas Prepared by: Engr. Orland G. Basas IT Lecturer
2
226-Aug-15 IP addressing – works at OSI model layer 3 TCP/IP model Internet layer Application Presentation Session Transport Network Data link Physical Application Transport Internet Network Access TCP, UDP IP Ethernet, WAN technologies HTTP, FTP, TFTP, SMTP etc Segment Packet Frame Bits Data stream
3
326-Aug-15 The 32-bit binary addresses used on the Internet are referred to as Internet Protocol (IP) addresses Commonly written in dotted-decimal format – 192.168.10.1 When IP addresses are assigned to computers, some of the bits on the left side of the 32-bit IP number represent a network. The bits left over in the 32-bit IP address identify a particular computer on the network A computer is referred to as the host The IP address of a computer consists of a network & a host part that represents a particular computer on a particular network IP addressing
4
426-Aug-15 In the early days of the Internet, IP addresses were allocated to organizations based on request rather than actual need. When an organization received an IP network address, that address was associated with a “Class”, A, B, or C. This is known as Classful IP Addressing The first octet of the address determined what class the network belonged to and which bits were the network bits and which bits were the host bits. It was not until 1992 when the IETF introduced CIDR (Classless Interdomain Routing), making the address class meaning less. This is known as Classless IP Addressing. For now, all you need to know is that today’s networks are classless, except for those networks that still use Classful routing protocols. Classful IP Addressing
5
526-Aug-15 IPv4 Address Classes
6
626-Aug-15 Class A Class B Class C NetworkHost Network Host Network Host 1st octet2nd octet3rd octet4th octet N = Network number assigned by Internet registry H = Host number assigned by administrator Address Classes
7
726-Aug-15 Class A addresses NetworkHost First octet is between 0 – 127, begins with 0 Number between 0 - 127 8 bits With 24 bits available for hosts, there a 2 24 possible addresses. That’s 16,777,216 nodes! There are 126 class A addresses. 0 and 127 have special meaning and are not used. 16,777,214 host addresses, one for network address and one for broadcast address. Only large organizations such as the military, government agencies, universities, and large corporations have class A addresses. For example ISPs have 24.0.0.0 and 63.0.0.0
8
826-Aug-15 Class B addresses Network Host First octet is between 128 – 191, begins with 10 Number between 128 - 191 8 bits With 16 bits available for hosts, there a 2 16 possible addresses. That’s 65,536 nodes! There are 16,384 (2 14 ) class B networks. 65,534 host addresses, one for network address and one for broadcast address. Class B addresses are assigned to large organizations including corporations (such as government agencies, and school districts).
9
926-Aug-15 Class C addresses Network Host First octet is between 192 – 223, begins with 110 Number between 192 - 223 8 bits With 8 bits available for hosts, there a 2 8 possible addresses. That’s 256 nodes! There are 2,097,152 possible class C networks. 254 host addresses, one for network address and one for broadcast address. Usually assigned for small networks
10
1026-Aug-15 Class D Addresses A Class D address begins with binary 1110 in the first octet. First octet range 224 to 239. Class D address can be used to represent a group of hosts called a host group, or multicast group. Class E Addresses First octet of an IP address begins with 1111 Class E addresses are reserved for experimental purposes and should not be used for addressing hosts or multicast groups. IPv4 Address Classes
11
1126-Aug-15 Types of Addresses
12
1226-Aug-15 Subnet Mask To inform a computer how the 32-bit IP address has been split, a second 32-bit number called a subnetwork mask is used This mask is a guide that indicates how the IP address should be interpreted by identifying how many of the bits are used to identify the network of the computer The subnetwork mask sequentially fills in the 1s of the network portion.
13
1326-Aug-15 Class A IP Address Default Subnet Mask: 255.0.0.0 (/8) Default Subnet Mask Class B IP Address Default Subnet Mask: 255.255.0.0 (/16) Class C IP Address Default Subnet Mask: 255.255.255.0 (/24)
14
1426-Aug-15 Network Prefix How do we know how many bits represent the network portion and how many bits represent the host portion? We use network prefix. The prefix length is the number of bits in the address that gives us the network portion Ex: 172.16.4.0 /24, the /24 tells us that the first 24 bits are the network address. This leaves the remaining 8 bits, the last octet, as the host portion.
15
1526-Aug-15 IPv4 address 192.168.21.17 11000000101010000001010100010001 octet network parthost part 255. 0 11111111 00000000 Prefix /24 Subnet mask:
16
1626-Aug-15 Find the network address 192.168.21.17 11000000101010000001010100010001 In a network address, all the host bits are 0. 192.168.21.0 11000000101010000001010100000000 The router needs to do this for every packet.
17
1726-Aug-15 Logical AND 192.168.21.17 11000000101010000001010100010001 255. 0 11111111 00000000 Do a logical AND at each position 192.168.21.0 11000000101010000001010100000000
18
1826-Aug-15 Find the broadcast address 192.168.21.17 11000000101010000001010100010001 In a broadcast address, all the host bits are 1. 192.168.21.255 11000000101010000001010111111111 The broadcast is the last address in the network.
19
1926-Aug-15 Reminder: 3 types of address Every network has: Network address – the first one Broadcast address – the last one Host addresses – everything in between
20
2026-Aug-15 Recall: Classful addressing 10.17.53.60 network parthost part A 172.16.38.201 network parthost part B 192.168.21.17 network parthost part C
21
2126-Aug-15 Classful addressing Easy to work out but very wasteful. Routers and hosts still assume default subnet masks by class Class A/8255.0.0.0 Class B/16255.255.0.0 Class C/24255.255.255.0
22
2226-Aug-15 Classless addressing Any suitable prefix can be used We (and devices) need to know what the prefix is. More flexible, less wasteful.
23
2326-Aug-15 Classless addressing /16 172.16.0.0/16 mask 255.255.0.0 Broadcast address 172.16.255.255 Hosts 172.16.0.1 to 172.16.255.254 65534 host addresses 172.16.0.0 101011000001000000000000
24
2426-Aug-15 Classless addressing /24 172.16.0.0/24 mask 255.255.255.0 Broadcast address 172.16.0.255 Hosts 172.16.0.1 to 172.16.0.254 254 host addresses 172.16.0.0 101011000001000000000000
25
2526-Aug-15 Classless addressing /22 172.16.0.0/22 mask 255.255.252.0 Broadcast address 172.16.3.255 Hosts 172.16.0.1 to 172.16.3.254 1022 host addresses 172.16.0.0 101011000001000000000000
26
2626-Aug-15 Classless addressing /26 172.16.0.0/22 mask 255.255.255.192 Broadcast address 172.16.0.63 Hosts 172.16.0.1 to 172.16.0.62 62 host addresses 172.16.0.0 101011000001000000000000
27
2726-Aug-15 Classless addressing /28 172.16.0.0/28 mask 255.255.255.240 Broadcast address 172.16.0.15 Hosts 172.16.0.1 to 172.16.0.14 14 host addresses 172.16.0.0 101011000001000000000000
28
2826-Aug-15 Calculating addresses A host has IP address 192.168.1.70/24 What is the subnet mask? What is the network address? What is the broadcast address? What is the range of host addresses in the network?
29
2926-Aug-15 192.168.1.70/24 – fill in the table Last octet binary Last octet decimal Full Host Subnet mask Network Broadcast First host Last host
30
3026-Aug-15 192.168.1.70/24 Last octet binary Last octet decimal Full Host0100011070192.168.1.70 Subnet mask000000000255.255.255.0 Network000000000192.168.1.0 Broadcast11111111255192.168.1.255 First host000000011192.168.1.1 Last host11111110254192.168.1.254
31
3126-Aug-15 Calculating addresses A host has IP address 192.168.1.70/26 What is the subnet mask? What is the network address? What is the broadcast address? What is the range of host addresses in the network?
32
3226-Aug-15 192.168.1.70/26 fill in the table Last octet binary Last octet decimal Full Host Subnet mask Network Broadcast First host Last host
33
3326-Aug-15 192.168.1.70/26 Last octet binary Last octet decimal Full Host0100011070192.168.1.70 Subnet mask11000000192255.255.255.192 Network0100000064192.168.1.64 Broadcast01111111127192.168.1.127 First host0100000165192.168.1.65 Last host01111110126192.168.1.126
34
3426-Aug-15 Calculating addresses A host has IP address 192.168.1.70/28 What is the subnet mask? What is the network address? What is the broadcast address? What is the range of host addresses in the network?
35
3526-Aug-15 192.168.1.70/28 fill in the table Last octet binary Last octet decimal Full Host Subnet mask Network Broadcast First host Last host
36
3626-Aug-15 192.168.1.70/28 Last octet binary Last octet decimal Full Host0100011070192.168.1.70 Subnet mask11110000240255.255.255.240 Network0100000064192.168.1.64 Broadcast0100111179192.168.1.79 First host0100000165192.168.1.65 Last host0100111078192.168.1.78
37
3726-Aug-15 Unicast, Multicast, Broadcast Unicast – a message addressed to one host Broadcast – a message addressed to all hosts on a network. Uses network’s broadcast address or 255.255.255.255 locally Multicast – a message addressed to a group of hosts. Uses an address starting 224 - 239
38
3826-Aug-15 Private IP addresses Unrestricted use on private networks. Not routed across the Internet. 10.0.0.0 – 10.255.255.255 (10.0.0.0/8) 172.16.0.0 – 172.31.255.255 (172.16.0.0/20) 192.168.0.0 – 192.168.255.255 (192.168.0.0/24)
39
3926-Aug-15 Public IP addresses Routed over the Internet Master holder is IANA (Internet Assigned Numbers Authority) Assigned to regional registries and then to ISPs ISPs allocate them to organisations and individual users Use is strictly controlled as duplicate addresses are not allowed
40
4026-Aug-15 Special addresses 0.0.0.0 “all addresses” in default route. Hosts cannot be given addresses starting 0. 127.0.0.1 is loopback. Hosts cannot be given addresses starting 127. 240.0.0.0 and higher – reserved for experimental purposes. 169.254.0.0 - 169.254.255.255 local only 192.0.2.0 to 192.0.2.255 for teaching
41
4126-Aug-15 Network address translation A large number of hosts on a network use private addresses to communicate with each other. The ISP allocates one or a few public addresses. NAT allows the hosts to share the public addresses when they want to use the Internet
42
4226-Aug-15 Addressing hosts Static addressing – address is configured by an administrator Servers, printers, routers, switches need static addresses Dynamic addressing – address is allocated automatically by DHCP by leasing addresses from a pool Dynamic addressing is best for workstations
43
4326-Aug-15 Subnetting 192.168.1.0/24 Address192.168.1.000000000 Subnet mask255.255.255.000000000 Last octet binary Borrow 1 bit from host part, give it to network part, /25 Addresses192.168.1.0 192.168.1.128 00000000 10000000 Subnet mask255.255.255.12810000000
44
4426-Aug-15 Subnetting 192.168.1.0/24 Borrow 2 bits from host part, give to network part, /26 Addresses192.168.1.0 192.168.1.64 192.168.1.128 192.168.1.192 00000000 01000000 10000000 11000000 Subnet mask255.255.255.19211000000
45
4526-Aug-15 Subnetting 192.168.1.0/24 Borrow 3 bits from host part, give to network part, /27 Addresses192.168.1.0 192.168.1.32 192.168.1.64 192.168.1.96 192.168.1.128 192.168.1.160 192.168.1.192 192.168.1.224 00000000 00100000 01000000 01100000 10000000 10100000 11000000 11100000 Subnet mask255.255.255.22411100000
46
4626-Aug-15 Subnetting 192.168.1.0/24 Borrow 4 bits from host part, give to network part, /28 192.168.1.0 192.168.1.16 192.168.1.32 192.168.1.48 192.168.1.64 192.168.1.80 192.168.1.96 192.168.1.112 192.168.1.128 192.168.1.144 192.168.1.160 192.168.1.176 192.168.1.192 192.168.1.208 192.168.1.224 192.168.1.240 00000000 00010000 00100000 00110000 01000000 01010000 01100000 01110000 10000000 10010000 10100000 10110000 11000000 11010000 11100000 11110000 Subnet mask 255.255.255.240 11110000 And so on…
47
4726-Aug-15 Subnetting 192.168.1.0/24 Every time you borrow another bit you: Double the number of subnets Halve the size of the subnets Each subnet has a network address, a broadcast address, and everything in between is a host address. Here are some ways of visualising the process.
48
4826-Aug-15 Subnetting 192.168.1.0/24 Bits borrowed123456 No of networks248163264 Prefix/25/26/27/28/29/30 Bit value/ network size 12864321684 No of hosts12662301462 Subnet mask128192224240248252
49
4926-Aug-15 Ping and traceroute Ping sends an ICMP message. If all is well, the destination replies. If not, a router may reply to say the destination is unreachable, or the ping may time out. Traceroute sends a series of messages so that each router along the path replies. You get a list of addresses of all the routers.
50
5026-Aug-15 IPv6 Development started in 1990s because of concerns about IPv4 addresses running out A whole new protocol suite – not just layer 3 Uses 128-bit hierarchical addressing, written using hexadecimal Simpler header Integrated security – authentication, privacy Quality of service mechanisms
51
5126-Aug-15 Why Subnet? To break the network down into pieces, each of which can be addressed separately. Controls network traffic Reduces broadcasts Can provide low level security with access lists on the router Organization of IP address space
52
5226-Aug-15 Subnetting a Default Class C Network Address: 200.129.41.0 Default Class C address is divided into network and host portions as follows: N. N. N. H To subnet we “borrow” bits from the host portion of the address (8 bits for Class C) N. N. N. x x x x x x x x Borrowing n bits yields 2 n – 2 subnets. Leaving n bits yields 2 n – 2 hosts. For a class C, we can borrow from 2 to 6 bits. Why not 1 bit? (How many usable subnets?) Why not 7 bits? (How many usable hosts?)
53
5326-Aug-15 Subnetting a Default Class C Network Address: 200.129.41.0 Suppose we need 14 usable subnets, how many bits do we borrow? Remember, borrowing n bits give us: 2 n – 2 subnets Try borrowing 3 bits (n = 3): 2 3 – 2= 8 – 2 = 6 usable subnets (not enough) Try borrowing 4 bits 2 4 – 2= 16 – 2 = 14 usable subnets (enough)
54
5426-Aug-15 Subnetting a Default Class C Network Address: 200.129.41.0 Write it with the network octet in binary: 200.129.41.0000 0000 Borrowing 4 bits yields 14 usable subnets How many usable hosts per subnet? Same formula as subnets (2 n – 2) 4 host bits (n = 4) 2 4 – 2 = 16 – 2 = 14 usable hosts per subnet subnet bits host bits Break here
55
5526-Aug-15 Subnetting a Default Class C Network Address: 200.129.41.0 Examples: First usable 200.129.41.0001 ^ 0000 subnet address:200.129.41.16 First usable host200.129.41.0001 ^ 0001 on the first subnet: 200.129.41.17 Second usable host200.129.41.0001 ^ 0010 on the first subnet: 200.129.41.18... Last usable host200.129.41.0001 ^ 1110 on the first subnet: 200.129.41.30 Broadcast address200.129.41.0001 ^ 1111 for the first subnet:200.129.41.31
56
5626-Aug-15 Subnetting a Default Class C Network Address: 200.129.41.0 Examples: Second usable 200.129.41.0010 ^ 0000 subnet address:200.129.41.32 Third usable 200.129.41.0011 ^ 0000 subnet address:200.129.41.48 Fourth usable 200.129.41.0100 ^ 0000 subnet address:200.129.41.64... Last usable 200.129.41.1110 ^ 0000 subnet address:200.129.41.224
57
5726-Aug-15 The Subnet Mask: How the Router Determines the Subnet The subnet mask (in binary) has: all ones in the network and subnet portion of the address all zeros in the host potion of the address The subnet mask for the previous example is: 255.255.255. 240 255.255.255. 1111 ^ 0000 (128 + 64 + 32 + 16 =240) ANDing this mask with any valid host address on the network will always yield the subnet address for that host.
58
5826-Aug-15 The Subnet Mask: How the Router Determines the Subnet Example (our subnet mask is 255.255.255.240) IP host address: 200.129. 41.23 Last octet to binary: 200.129. 41.0001 0111 AND subnet mask: 255.255.255.1111 0000 200.129. 41.0001 0000 Subnet Address: 200.129. 41.16 So the host address 200.129. 41.23 is on the 200.129.41.16 subnet.
59
5926-Aug-15 Subnetting a Default Class B Network Address: 132.178.0.0 Default Class B address is divided into network and host portions as follows: N. N. H. H To subnet we “borrow” bits from the host portion of the address (16 bits for Class B) N. N. x x x x x x x x. x x x x x x x x For a class B, we can borrow from 2 to 14 bits.
60
6026-Aug-15 Subnetting a Default Class B Network Address: 132.178.0.0 Suppose we need 80 usable subnets, how many bits do we borrow? Remember, borrowing n bits give us: 2 n – 2 subnets Try borrowing 6 bits (n = 6): 2 6 – 2= 64 – 2 = 62 usable subnets (not enough) Try borrowing 7 bits 2 7 – 2= 128 – 2 = 126 usable subnets (enough)
61
6126-Aug-15 Subnetting a Default Class B Network Address: 132.178.0.0 Write it with the network octets in binary: 132.178.0000000 0.00000000 Borrowing 7 bits yields 126 usable subnets How many usable hosts per subnet? Same formula as subnets (2 n – 2) 9 host bits (n = 9) 2 9 – 2 = 512 – 2 = 510 usable hosts per subnet subnet bits host bits
62
6226-Aug-15 Subnetting a Default Class B Network Address: 132.178.0.0 Examples: First usable 132.178.0000001 ^ 0.00000000 subnet address: 132.178.2.0 First usable host 132.178.0000001 ^ 0.00000001 on the first subnet: 132.178.2.1 Second usable host 132.178.0000001 ^ 0.00000010 on the first subnet: 132.178.2.2... Last usable host 132.178.0000001 ^ 1.11111110 on the first subnet: 132.178.3.254 Broadcast address 132.178.0000001 ^ 1.11111111 for the first subnet: 132.178.3.255
63
6326-Aug-15 Subnetting a Default Class B Network Address: 132.178.0.0 Examples: Second usable 132.178.0000010 ^ 0.00000000 subnet address: 132.178.4.0 Third usable 132.178.0000011 ^ 0.00000000 subnet address: 132.178.6.0... Ninety-first usable 132.178.1011011 ^ 0.00000000 subnet address: 132.178.182.0... Last usable 132.178.1111110 ^ 0.00000000 subnet address: 132.178.252.0
64
6426-Aug-15 Subnetting a Default Class B Network Address: 132.178.0.0 The subnet mask for this example is: 255.255.254.0 255.255.1111111 ^ 0.00000000 ANDing this mask with any valid host address on this network will always yield the subnet address.
65
6526-Aug-15 Subnetting a Default Class B Network Address: 132.178.0.0 Example: IP host address: 132.178.119.112 Last octets to binary: 132.178.0111011 ^ 1.01110000 AND subnet mask: 255.255.1111111 ^ 0.00000000 132.178.0111011 ^ 0.00000000 Subnet Address: 132.178.118.0 Which subnet is this. How can you tell?
66
6626-Aug-15 Additional Info on subnetting
67
67 26-Aug-15 The End
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.