ccna discovery 1 chapter 5: network addressing. contents 5.1: ip addresses & subnet masks ◦...

65
CCNA Discovery 1 CCNA Discovery 1 Chapter 5: Chapter 5: Network Addressing Network Addressing

Upload: antony-carr

Post on 25-Dec-2015

238 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

CCNA Discovery 1CCNA Discovery 1

Chapter 5:Chapter 5:Network AddressingNetwork Addressing

Page 2: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

ContentsContents5.1: IP Addresses & Subnet Masks

◦ 5.1.1- Purpose of an IP Address◦ 5.1.2 – Address Structure◦ 5.1.3 – Parts of an Address◦ 5.1.4 – IP Addresses & Subnet Masks

5.2: Types of IP Addresses◦ 5.2.1 – Address Classes◦ 5.2.2 – Public vs. Private Addresses◦ 5.2.3 – Unicast, Broadcast and Multicast

5.3: Obtaining IP Addresses◦ 5.3.1 – Static vs Dynamic Addresses◦ 5.3.2 – DHCP Servers◦ 5.3.3 – Configuring DHCP

5.4: Address Management◦ 5.4.1 – Address Space◦ 5.4.2 – Address Assignment◦ 5.4 3. – NAT

5.5: Booleans and Anding

Page 3: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

5.1.1: Purpose of the IP 5.1.1: Purpose of the IP AddressAddress

An IP address is a logical network address that identifies a particular host on a network

The IP address is assigned to the Network interface connection for a host.

All hosts need a unique IP address to participate and communicate with other devices on the Internet. ◦ This includes workstations, servers, network printers

and IP phones◦ Some servers can have more than one NIC and each of

these has its own IP address. ◦ Router interfaces that provide connections to an IP

network will also have an IP address. Every packet sent across the Internet has a source

and destination IP address. This information is required by networking devices to

insure the information gets to the destination and that any replies are returned to the source.

Page 4: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

5.1.2: IP Address Structure5.1.2: IP Address StructureIP Addresses are 32 bit addresses written in

dotted decimal notation◦ The address is represented by 32 bits (zeros and

ones)◦ The 32 bits are grouped into four 8-bit bytes

called octets.◦ Each octet is represented by its decimal value,

separated by a decimal point or period.Example: 192.168.1.5

◦ This represents the address: 11000000101010000000000100000101

◦ The dotted decimal format is much easier to useThe 32-bit IP address is called IP version 4

(IPv4) addressing and is currently the most common form of IP address on the Internet.

There are over 4 billion possible IP v4 addresses

Page 5: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Converting IP AddressesConverting IP Addresses

When a host receives an IP address, it reads it as bits as they are received on the NIC.

Humans, on the other hand, need to convert those 32 bits into their four octet decimal equivalent.

Each octet can be converted just like any other 8 bit binary number

The maximum values for each octet are:◦Binary : 11111111◦Decimal: 255

Page 6: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Conversion of an IP Conversion of an IP AddressAddress

Page 7: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

5.1.3: Parts of an IP 5.1.3: Parts of an IP AddressAddress

IP addresses are hierarchical and re made up of two parts.:◦ The Network Portion: identifies the network ◦ The Host Portion: identifies a host on that

networkIP Addressing is considered hierarchical

addressing because the network portion indicates the network on which each unique host address is located.◦ Telephone numbers are also hierarchical : the

country code, area code and exchange represent the network address and the remaining digits represent a local phone number

Example: The IP host address192.168.18.57 ◦ The 1st 3 octets are the Network portion:

192.168.18◦ The last octet is the Host portion: 57

Page 8: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Network AddressesNetwork AddressesThe network portion of the address, is

used to represent the entire network ◦ It represents a group of IP addresses that can

be used on that networkThe network address is created by taking

the Network portion of the address and putting all 0’s in the host portion of the address◦192.168.18.00000000◦192.168.18.0

The Network address is not a usable host IP address

Network addresses are only used by routers to decide how to get packets to their destination

Page 9: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Usable Host AddressesUsable Host Addresses

As we just saw, the Network address is not a usable host address

A usable host IP address is an IP address that does not have all 0’s or 1’s in the host portion of the address

Only a usable host IP address can be assigned to a host device

Example: on the network 192.168.18.0, the usable host IP addresses are: ◦192.168.18.1 to 192.168.18.254

Page 10: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Host vs. Network PortionHost vs. Network Portion

Network Number

Host Number

Page 11: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Network vs. Host PortionNetwork vs. Host PortionNetwork Addresses

Host IP Addresses

Page 12: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

5.1.4: Subnet Masks5.1.4: Subnet MasksSince there are two parts to every IP

address, how do hosts and routers know which portion is the network and which is the host?

This is the job of the subnet mask◦ A subnet mask is a 32 bit address, like an IP

address, which is written in dotted decimal notation

The subnet mask is a special address that tells devices which part of the IP address is network and which part is host ◦ A subnet mask is assigned to devices at the

same time as the IP addressExample Subnet Masks:

◦ 255.255.255.0◦ 255.255.0.0◦ 255.255.255.128◦ 255.254.0.0

Page 13: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

How is the Subnet Mask How is the Subnet Mask Used?Used?

When a host sends a packet, it uses the Subnet mask to decide if the packet is destined for a host on the local network or on a different network: ◦ It compares its own subnet mask to its own IP

address, from left to right, bit for bit.◦ The 1s in the subnet mask represent the network

portion; the 0s represent the host portion◦ Once it knows what network it belongs to, it

compares its own subnet mask to the destination IP address

◦ If the network bits in its own address and the destination address match, it knows that the destination host is on the same network

◦ This means the packet can be delivered locally◦ If the network bits do not match, the sending host

forwards the packet to the local router interface to be forwarded to the other network.

Page 14: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Using the Subnet MaskUsing the Subnet Mask

Page 15: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Network vs. Host BitsNetwork vs. Host BitsThe subnet masks we see most often with

home and small business networking are:◦ 255.0.0.0 (8-bit network)

{11111111.00000000.00000000.00000000}

◦ 255.255.0.0 (16 bit network) {11111111. 11111111.00000000.00000000}

◦ 255.255.255.0 (24 bit network) {11111111.11111111.1111111.00000000}

A subnet mask of 255.0. 0.0 uses 8 bits to identify the network number, which leaves 24 bits to create host addresses for the network

A subnet mask of 255.255. 0.0 uses 16 bits to identify the network number, which leaves 16 bits to create host addresses for the network

A subnet mask of 255.255.255.0 uses 24 bits to identify the network number which leaves 8 bits to number the hosts on that network.

Page 16: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Available Host AddressesAvailable Host AddressesThe number of available host addresses on a

network can be calculated with the formula: 2 ^ host bits – 2

Network type Available Hosts◦ 255.0.0.0 2 ^ 24 = 16, 777, 216 – 2 = 16, 277,

214◦ 255.255.0.0 2 ^ 16 = 65, 536 – 2 = 65,

534◦ 255.255.255.0 2 ^ 8 = 256 – 2 = 254

The reason we always subtract 2 from the total host addresses to determine the available host addresses, is because a valid host address can not have all 0’s or all 1’s in the host portion of the address

Therefore, every network has 2 addresses that can not be assigned to hosts, the very 1st address (all 0’s in the host portion) and the very last address (all 1’s in the host portion)

Page 17: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Network and Broadcast Network and Broadcast AddressesAddresses

Example Networks: ◦ 120.◦ 170.5◦ 192.168.10

All 0’s in the host portion of an IP address, represents the Network Address for that network, and can not be assigned to a host

120.0.0.0 170.5.0.0 192.168.10.0

All 1s in the host portion of an IP address, represents the broadcast address for that network, and can not be assigned to a host◦ 120.255.255.255◦ 170.5.255.255◦ 192.168.10.255

Page 18: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

5.2.1: IP v. 4 Address 5.2.1: IP v. 4 Address ClassesClasses

As we have seen, the IP address and subnet mask work together to determine which portion of the IP address represents the network address and which portion represents the host address.

IP v. 4 addresses are grouped into 5 classes: ◦Classes A, B and C are commercial addresses

and are assigned to business, organizations and individuals to be used for hosts on the Internet

◦Class D is reserved for multicast use ◦Class E is for experimental use

Page 19: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Commercial IP Address Commercial IP Address ClassesClasses

Class C addresses are usually assigned to small networks◦ Use 3 octets for the network and 1 for the hosts N.N.N.H◦ The default subnet mask is 24 bits: 255.255.255.0◦ 2, 097, 150 (2 ^ 21 – 2) possible networks◦ 254 (2 ^ 8 – 2) available host addresses per network

Class B addresses are typically used for medium-sized networks◦ Use 2 octets for the network and 2 for the hosts N.N.H.H◦ The default subnet mask is 16 bits: 255.255.0.0◦ 16, 382 (2 ^ 14 – 2) possible networks◦ 65, 534 (2 ^ 16 – 2) available host addresses per network

Class A addresses are typically assigned to large organizations.◦ Use 1 octet for the network and 3 for the hosts N.H.H.H◦ The default subnet mask is 8 bits: 255.0.0.0◦ 126 (2 ^ 7 – 2) possible networks◦ 16, 777, 214 (2 ^ 24 – 2) available host addresses per network

Page 20: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

The value of the 1The value of the 1stst Octet OctetThe class of an address can be determined by

the value of the first octetEach Class of IP Address can only begin with a

certain valueAlso notice, that there is a leading bit

pattern that never changes for each class of addresses

Class Decimal Value of 1st Octet Leading Bit value◦Class A 1 - 126 0◦Class B 128 – 191 10◦Class C 192 – 223 110◦Class D 224 – 239 1110◦Class E 240 – 255 1111

Page 21: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

1 to 126

Page 22: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

5.2.2: Public vs. Private 5.2.2: Public vs. Private AddressesAddresses

All hosts that connect directly to the Internet require a unique public IP address.

Because there are a limited number of 32-bit addresses available, there is a risk of running out of IP addresses.

One solution to this problem was to reserve some private addresses for use exclusively inside an organization.

Private IP Addresses allow hosts within an organization to communicate with one another without needing a unique public IP address.

The RFC 1918 standard reserves 3 ranges of Private IP Addresses, for classes A, B and C.

Page 23: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Private Network Addresses

Private Network Addresses

Page 24: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Private IP AddressesPrivate addresses can be used internally by

hosts in an organization as long as the hosts do not connect directly to the Internet. ◦ Private addresses are not routed on the Internet

and are blocked by ISP routers.◦ Hosts that are using private addresses, must use

the services a computer or network device with a public IP address to access the Internet.

This allows multiple organizations to use the same set of private addresses internally.

The use of private addresses can also provide a measure of security since they are only visible on the local network, and outsiders cannot gain direct access to the private IP addresses.

Page 25: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

The Loopback AddressThere are also private addresses that

can be used for the diagnostic testing of devices.

This type of private address is known as a loopback address.

The class A, 127.0.0.0 network address, is reserved for loopback testing.

The loopback IP address, 127.0.0.1 is used to test a NIC card to verify that it is sending and receiving signals.

Page 26: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Private IP AddressesPrivate IP Addresses

Page 27: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

5.2.3: Unicast, Broadcast, 5.2.3: Unicast, Broadcast, MulticastMulticastIn addition to address classes, we also categorize IP addresses as :◦Unicast - one-to-one◦Broadcast - one-to-many◦Multicast- one-to-all

Page 28: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Unicast AddressesA unicast address is the most common

type on an IP network. A packet with a unicast destination

address is intended for a specific host. ◦ Example: a host with IP address 192.168.1.5

(source) requests a web page from a server at IP address 192.168.1.200 (destination)

For a unicast packet to be sent and received, a destination IP address must be in the IP packet header.

A corresponding destination MAC address must also be present in the Ethernet frame header.

The IP address and MAC address combine to deliver data to one specific destination host.

Page 29: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Unicast AddressesUnicast Addresses

Page 30: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Multicast IP AddressMulticast IP addresses allow a source device to

send a packet to a group of devices.Devices that belong to a multicast group are

assigned a multicast group IP address. The range of multicast addresses is:

◦224.0.0.0 to 239.255.255.255Since multicast addresses represent a group

of addresses (sometimes called a host group), they can only be used as the destination of a packet.

The source will always have a unicast address.Examples:

◦ Remote gaming, with many players connected remotely to the same server

◦ Distance learning through video conferencing, with many students connected

Page 31: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Multicast MAC AddressesA packet with a destination multicast IP

address needs a corresponding multicast MAC address to actually deliver the packet on the local network.

The multicast MAC address is a special value that begins with 01-00-5E in hexadecimal.

The rest of the address is a result of converting the lower 23 bits of the IP multicast group address into the remaining 6 hexadecimal characters of the Ethernet address.

Example:◦ Multicast IP Address: 224. 15.100.197◦ Multicast MAC Address: 01-00-5E-0F-64-C5

Page 32: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Multicast MAC Address ExampleMulticast IP Address: 224.15.100.197Multicast MAC Address: 01-00-5E-0F-

64-C5◦01-00-5E - Standard Multicast MAC prefix◦0F-64-C5 = The last 23 bits of the

Multicast IP address in HEXConversion:

◦ The last 23 bits of the IP address are:◦ 0001111.01100010.11000101◦ Those bits in Hex are:◦ 000 = 0 1111= F (15) 0110 = 6

0010 = 4 1100 = C (12) 0101 = 5

Page 33: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Multicast AddressesMulticast Addresses

Page 34: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Broadcast IP AddressA Broadcast IP Address has all ones

(1s) in the host portion. A Broadcast packet will be received and

looked at by every host in the local network, or in the broadcast domain

Many network protocols, such as ARP and DHCP use broadcasts.

Examples: ◦ The Class C network 192.168.1.0 uses the

Broadcast address 192.168.1.255◦ The Class B network 172.16.0.0 uses the

broadcast address 172.16.255.255◦ The Class A network 10.0.0.0 uses the

broadcast address 10.255.255.255.

Page 35: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Broadcast MAC AddressA packet with a broadcast IP address needs a corresponding broadcast MAC address in the Ethernet frame.

On Ethernet networks, the broadcast MAC address is FF-FF-FF-FF-FF-FF

Page 36: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Broadcast Addresses

Page 37: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

5.3.1: Static IP Addresses5.3.1: Static IP AddressesWith static IP assignment, the network

administrator must manually configure the network information for a host.

At a minimum, this includes the host IP address, subnet mask and default gateway.

Static addresses have some advantages: ◦ Useful for printers, servers and other networking devices

that need to be accessible to clients on the network. ◦ Can provide increased control of network resources,

Static Addresses have some disadvantages:◦ Time Consuming◦ The host only performs basic error checks on the IP

address. So errors are more likely to occur. When using static IP addressing, it is important to

maintain an accurate list of which IP addresses are assigned to which devices.

Page 38: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Static IP AddressingStatic IP Addressing

Page 39: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Dynamic IP AddressesDynamic Assignment of IP Addresses is

achieved using a protocol known as Dynamic Host Configuration Protocol (DHCP).

DHCP can provide the automatic assignment of addressing information such as IP address, subnet mask, default gateway, and other configuration information.

Advantages:◦ On local networks the user population changes

frequently◦ It reduces the burden on network support staff ◦ It virtually eliminates IP Address entry errors◦ Addresses are not permanently assigned to a host

but are only leased for a period of time. If the host is powered down or taken off the network, the address is returned to the pool for reuse.

Page 40: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Dynamic IP Addressing

Page 41: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

5.3.2: DHCP Server5.3.2: DHCP ServerHow does a Host receive an IP Address with DHCP?

◦ The host acts as a DHCP client and contacts the local DHCP server

◦ The DHCP server assigns an IP address to your laptop. A DHCP Server is a device that is running the DHCP

service software. ◦ A dedicated PC or server (medium to large networks)◦ An Integrated Router (home networks)◦ A dedicated Router (an ISP)

Many home networks and small businesses use an integrated router to connect to the ISP modem. ◦ In this case, the integrated router is both a DHCP client and

a server. ◦ The integrated router acts as a client to receive its IP

configuration from the ISP and ◦ It then acts a DHCP server for internal hosts on the local

network.

Page 42: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

DHCP ServicesDHCP Services

Page 43: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

5.3.3 DHCP Negotiation5.3.3 DHCP NegotiationWhen a host is first configured as a DHCP client, it

does not have an addressing information It obtains this information from a DHCP server,

either on the local network or one located at the ISP. ◦ The DHCP server is configured with a range, or pool, of IP

addresses that can be assigned to DHCP clients.These are the 4 steps in the DHCP Negotiation

Process: 1. When a client configured with DHCP boots, it sends

out a DHCP Discover message ◦ Using the broadcast destination IP 255.255.255.255 and the

broadcast destination MAC FF-FF-FF-FF-FF-FF ◦ All hosts on the network will receive this broadcast DHCP

frame, but only a DHCP server will reply. 2. The DHCP server will respond with a DHCP Offer,

suggesting an IP address for the client. 3. The host then sends a DHCP Request to that

server asking to use the suggested IP address. 4. The server responds with a DHCP

Acknowledgment.

Page 44: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Configuring DHCP on an ISRFor most home and small business networks, a multi-

function device provides DHCP services to the local network clients.

To configure a Linksys wireless router, you access its graphical web interface by opening the browser and entering the in the router’s default IP address: 192.168.1.1◦ Other brands of wireless routers might use the default address

192.168.1.254 or 192.168.2.1◦ The IP address 192.168.1.1 and subnet mask 255.255.255.0 are

the defaults for the internal router interface. ◦ This is the default gateway for all hosts on the local network and

also the internal DHCP server IP address. DHCP configuration:

◦ Most ISR have DHCP Server enabled by default◦ Use the default DHCP range or specify your own (do not use

192.168.1.1)◦ Specify the lease time (default is 24 hours).

Verify DHCP Configuration: ◦ The DHCP Client Table shows the client name and whether it is

connected via the Ethernet LAN or wireless (Interface).

Page 45: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

ISR DHCP ConfigurationISR DHCP Configuration

Page 46: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

5.4.1: Default Gateway5.4.1: Default GatewayA router provides a gateway through which hosts on

one network can communicate with hosts on different networks.

Each interface on a router is connected to a separate network.

The IP address assigned to the router interface identifies which local network is connected directly to it.

Every host on a network must use the router as a gateway to other networks.

Therefore, each host must know the IP address of the router interface connected to the network where the host is attached.

This address is known as the default gateway address.◦ It can be either statically configured on the host, or received

dynamically by DHCP.

Page 47: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Default Gateway with an ISRWhen an integrated router is configured

to be a DHCP server for the local network, it automatically sends the correct interface IP address to the hosts as the default gateway address.

All hosts on the network can use that IP address to forward messages to hosts located at the ISP and get access to hosts on the Internet.

The IP address of that local router interface becomes the default gateway address for all hosts on the network

Page 48: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Default GatewayDefault Gateway

Page 49: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

5.4.2: Address Assignment5.4.2: Address AssignmentWhen hosts on a local network use the

services of a DHCP server, they are referred to as being located on an internal, or inside, network.

Most DHCP servers are configured to assign private addresses to the hosts on the internal network◦ This secures the internal network because it is not

directly accessible from the InternetMany ISPs also use DHCP servers to provide

IP addresses to the Internet side of home or small business routers installed at their customer sites.

The network address assigned to the Internet side of the integrated router is referred to as the external, or outside, network.

Page 50: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

ISR Address AssignmentThe default IP address configured on an ISR router

interface is usually a private Class C address. The Internal hosts must also be assigned addresses

within the same network as the integrated router, either statically configured, or through DHCP.

When configured as a DHCP server, the integrated router provides host addresses in this range.

It also provides the subnet mask information and its own interface IP address as the default gateway.

When an integrated router is connected to the ISP, it acts like a DHCP client to receive the correct external network IP address for the Internet interface.

When using an ISR on a home network, all hosts use the same PUBLIC Internet-routable address to connect to the internet

Page 51: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

IP Address Assignment

External Network

Internal Network

Page 52: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Address Management There are several ways hosts can be connected to an ISP and the Internet. Whether or not an individual host is assigned a public or private address

depends on how it is connected. Direct Connection

◦ A single host with a direct connection from the ISP through a modem

◦ A public address from the ISP’s DHCP server is assigned to the host

Connection Through an Integrated Router◦ More than one host that needs access to the Internet◦ The ISP modem and hosts are attached directly to an ISR ◦ The ISR receives a public address from the ISP◦ Internal hosts receive private addresses from the ISR

Connection Through a Gateway Device◦ Gateway devices combine an integrated router and a

modem in one unit◦ The Gateway is directly connected to the ISP service◦ The gateway device receives a public address from the ISP ◦ Internal hosts receive private addresses from the gateway

device

Page 53: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Address Management

Page 54: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

5.4.3: NAT5.4.3: NATWhen a network is using one or a few Public IP

address and Private IP addresses internally, a process is needed to translate private addresses into unique public addresses◦ The hosts on the internal network must share the single

Public Internet routable addressed assigned to the network or household

The process used to convert private addresses to Internet-routable addresses is called Network Address Translation (NAT). ◦ Internal private source IP addresses are translated to one

or more public IP address. ◦ Only packets destined for other networks need to be

translated.NAT Servers provide this translation process

◦ A NAT server is a device like an ISR or a dedicated PC server configured with NAT software

◦ NAT servers are able to translate many internal IP addresses to the same public address

Page 55: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

NAT TranslationNAT TranslationSo how do NAT servers keep track of which

private IP addresses sent or should receive a packet?

The NAT server adds a port number to the IP Packet, in order to keep track of which internal private IP address sent the message

Each internal Private IP Address is assigned a different port number, to keep track of which packets go to which address

The internal Private IP addresses are called Inside Local Addresses

The public IP address that all hosts must use to connect to the internet is called the Inside Global Address

Page 56: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

NATNAT

Inside Local Addresses

(Private IP Address)

Inside Global Address (Public IP Address)

Page 57: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

5.5: Booleans and AndingComputers operate based on electronic

circuitsThe circuits in a computer depend on logic

gates, which are like little decision makers that receive binary input and produce an output in binary

The logic gates are used to make decisions and to make comparisons between data

A logic gate accepts 1’s and 0’s as input, compares the bits and then produces a binary output of 1 or 0

Page 58: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Logic GatesThe 3 primary logic gates are:AND

◦ if either input is off (0), the result is off (0)◦ And is like multiplication (0 x anything is 0)

OR◦ if either input is on (1), the result is on (1)◦ Or is like adding (think of it like adding 1 to

something)NOT

◦ if the input is on (1), the result is off (0)◦ if the input is off (0), the result is on (1)◦ NOT is the exact reverse of the input

There is also 1 additional Gate: NOR

◦ if either input is on (1), the result is off (0)◦ A combination of NOT and OR

Page 59: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

Boolean Operations

OR 0 1

0 0 1

1 1 1

AND 0 1

0 0 0

1 0 1

NOR 0 1

0 1 0

1 0 0

NOT

0 1

1 0

Page 60: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

ANDINGEarlier we saw how a host uses its Subnet

Mask to make comparisons against its own IP address and the IP address of a destination packet, to see if they are on the same network.

The process that is used to compare a Subnet Mask against an IP address, is called ANDING

When ANDING, each bit in the IP Address is compared with each bit in the Subnet Mask, using the AND boolean operation

The result is the network address that the host address belongs to

Page 61: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

ANDINGExample: a host compares its subnet

mask with its IP address to see which Network it belongs to

IP Address: 192.100.10.33 Mask: 255.255.255.0Anding Process:

Network Address = 192.100.10.0

Page 62: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

5.1 Summary5.1 Summary

Page 63: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

5.2 Summary

Page 64: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

5.3 Summary

Page 65: CCNA Discovery 1 Chapter 5: Network Addressing. Contents 5.1: IP Addresses & Subnet Masks ◦ 5.1.1 - Purpose of an IP Address 5.1.1 ◦ 5.1.2 – Address Structure

5.4 Summary