p3 - m8 13 11 9 Expanded

Download as pdf or txt
Download as pdf or txt
You are on page 1of 139

Module 8: Network Layer

Introduction to Networks v7.0


(ITN)
Module 8: Topics
What will I learn to do in this module?

Topic Title Topic Objective


Network Layer Explain how the network layer uses IP protocols for reliable
Characteristics communications.
IPv4 Packet Explain the role of the major header fields in the IPv4 packet.

IPv6 Packet Explain the role of the major header fields in the IPv6 packet.

Explain how network devices use routing tables to direct packets to


How a Host Routes
a destination network.

Router Routing Tables Explain the function of fields in the routing table of a router.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 2
8.1 Network Layer
Characteristics

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 3
Network Layer Characteristics
The Network Layer
• Provides services to allow end devices to exchange
data
• IP version 4 (IPv4) and IP version 6 (IPv6) are the
principle network layer communication protocols.
• The network layer performs four basic operations:
• Addressing end devices
• Encapsulation
• Routing
• De-encapsulation

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 4
Network Layer Characteristics
IP Encapsulation
• IP encapsulates the transport layer
segment.
• IP can use either an IPv4 or IPv6
packet and not impact the layer 4
segment.
• IP packet will be examined by all
layer 3 devices as it traverses the
network.
• The IP addressing does not change
from source to destination.
Note: NAT will change addressing,
but will be discussed in a later
module.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 5
IP – Internet Protocol
IETF: RFC 791 (v4), RFC 8200 (v6)
Unreliable, best effort delivery
Addressing
Network interface
Routing tables
Routing based on longest prefix match
Network Layer Characteristics
Media Independent
IP is unreliable:
• It cannot manage or fix undelivered or
corrupt packets.
• IP cannot retransmit after an error.
• IP cannot realign out of sequence
packets.
• IP must rely on other protocols for
these functions.
IP is media Independent:
• IP does not concern itself with the type
of frame required at the data link layer
or the media type at the physical layer.
• IP can be sent over any media type:
copper, fiber, or wireless.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 7
8.2 IPv4 Packet
8.3 IPv6 Packets

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 8
IPv4 and IPv6 datagram
IP addresses
IPv4: 32 bits, dotted notation, decimal
1.2.3.4
IPv6: 128 bits, RFC-5952-based notation, hexadecimal
2001:db8::1
IPv4 Addresses
Dotted Decimal
Address

Octets

32-Bit
Address
Network and Host Portions, The Subnet Mask
• Comparing the IP Address and the Subnet Mask

• The 1s in the subnet mask identify the network portion while the
0s identify the host portion.
ANDing
• Logical AND is the comparison of two bits.

• ANDing between the IP address and the


subnet mask yields the network address.
The Prefix Length
• Shorthand method of identifying a subnet mask.

• It is the number of bits set to 1 in the subnet mask.

• Written in “slash notation”, a “/” followed by the number of bits


set to 1.
Network, Host, and Broadcast Addresses
Special Use IPv4 Addresses
• Loopback addresses
127.0.0.0 /8 or 127.0.0.1 to 127.255.255.254
• Link-Local addresses or Automatic Private IP Addressing (APIPA) addresses
169.254.0.0 /16 or
169.254.0.1 to 169.254.255.254
• TEST-NET addresses
192.0.2.0/24 or 192.0.2.0
to 192.0.2.255
Legacy Classful Addressing
Classless Addressing
• Formal name is Classless Inter-Domain Routing (CIDR, pronounced
“cider”).
• Created a new set of standards that allowed service providers to
allocate IPv4 addresses on any address bit boundary (prefix length)
instead of only by a class A, B, or C address.
Public and Private IPv4 Addresses
Private Addresses:
• 10.0.0.0/8 or 10.0.0.0 to 10.255.255.255

• 172.16.0.0 /12 or 172.16.0.0 to 172.31.255.255

• 192.168.0.0 /16 or 192.168.0.0 to 192.168.255.255


Limitations of IPv4
• IP address depletion

• Internet routing table expansion

• Lack of end-to-end connectivity


IPv6 Address Representation
Hextets – 4 Hexadecimal digits = 16 binary digits
IPv6 address canonical representation (RFC 5952)
IPv6 address canonical representation (RFC 5952)
Full format
2001:0db8:0000:0000:456c:346f:54d6:e931
IPv6 address canonical representation (RFC 5952)
Full format
2001:0db8:0000:0000:456c:346f:54d6:e931
Lower case
IPv6 address canonical representation (RFC 5952)
Full format
2001:0db8:0000:0000:456c:346f:54d6:e931
Lower case
Omit leading 0s in 16-bit fields
2001:db8:0:0:456c:346f:54d6:e931
IPv6 address canonical representation (RFC 5952)
Full format
2001:0db8:0000:0000:456c:346f:54d6:e931
Lower case
Omit leading 0s in 16-bit fields
2001:db8:0:0:456c:346f:54d6:e931
Shorten subsequent 0 fields ::
At least two fields
The longest group of subsequent fields
Equal? → the left most one
2001:db8::456c:346f:54d6:e931
Motivation for canonical representation
Addresses are writen in configuration files and other files
Text search
Plain string instead of error-prone regex
Make comparison easier for people without necessary
networking knowledge
E.g. judges
Downsides: not all devices support canonical representation
Cisco devices included
8.4 How a Host Routes

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 28
How a Host Routes
Host Forwarding Decision
• Packets are always created at the source.

• Each host devices creates their own routing table.

• A host can send packets to the following:


• Itself – 127.0.0.1 (IPv4), ::1 (IPv6)
• Local Hosts – destination is on the same LAN
• Remote Hosts – devices are not on the same LAN

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 29
How a Host Routes
Host Forwarding Decision (Cont.)
• The Source device determines whether the destination is local or remote

• Method of determination:
• IPv4 – Source uses its own IP address and Subnet mask, along with the destination IP
address
• IPv6 – Source uses the network address and prefix advertised by the local router
• Local traffic is dumped out the host interface to be handled by an intermediary device.

• Remote traffic is forwarded directly to the default gateway on the LAN.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 30
How a Host Routes
Default Gateway
A router or layer 3 switch can be a default-gateway.
Features of a default gateway (DGW):
• It must have an IP address in the same range as the rest of the LAN.
• It can accept data from the LAN and is capable of forwarding traffic off of the LAN.
• It can route to other networks.
If a device has no default gateway or a bad default gateway, its traffic will not be
able to leave the LAN.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 31
How a Host Routes
A Host Routes to the Default Gateway
• The host will know the default
gateway (DGW) either statically or
through DHCP in IPv4.
• IPv6 sends the DGW through a
router solicitation (RS) or can be
configured manually.
• A DGW is static route which will be
a last resort route in the routing
table.
• All device on the LAN will need the
DGW of the router if they intend to
send traffic remotely.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 32
8.5 Introduction to Routing

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 33
Introduction to Routing
Router Packet Forwarding Decision
What happens when the router receives the frame from the host device?

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 34
Introduction to Routing
IP Router Routing Table
There three types of routes in a router’s routing table:
• Directly Connected – These routes are automatically added by the router, provided the interface
is active and has addressing.
• Remote – These are the routes the router does not have a direct connection and may be learned:
• Manually – with a static route
• Dynamically – by using a routing protocol to have the routers share their information with each other
• Default Route – this forwards all traffic to a specific direction when there is not a match in the
routing table

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 35
Introduction to Routing
Static Routing
Static Route Characteristics:
• Must be configured manually

• Must be adjusted manually by the


administrator when there is a change
in the topology
• Good for small non-redundant
networks
• Often used in conjunction with a
dynamic routing protocol for
configuring a default route

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 36
Introduction to Routing
Dynamic Routing
Dynamic Routes Automatically:
• Discover remote networks

• Maintain up-to-date information

• Choose the best path to the


destination
• Find new best paths when there is a
topology change
Dynamic routing can also share static
default routes with the other routers.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 37
Introduction to Routing
Introduction to an IPv4 Routing Table
The show ip route command shows the
following route sources:
• L - Directly connected local interface IP
address
• C – Directly connected network
• S – Static route was manually configured
by an administrator
• O – OSPF
• D – EIGRP
This command shows types of routes:
• Directly Connected – C and L
• Remote Routes – O, D, etc.
• Default Routes – S*

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 38
Module 13: ICMP

Introduction of Networks v7.0


(ITN)
Module Objectives
Module Title: ICMP
Module Objective: Use various tools to test network connectivity.

Topic Title Topic Objective

ICMP Messages Explain how ICMP is used to test network connectivity.

Ping and Traceroute Testing Use ping and traceroute utilities to test network connectivity.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 40
13.1 ICMP Messages

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 41
ICMP Messages
ICMPv4 and ICMPv6 Messages
• Internet Control Message Protocol (ICMP) provides feedback about issues related to the
processing of IP packets under certain conditions.
• ICMPv4 is the messaging protocol for IPv4. ICMPv6 is the messaging protocol for IPv6 and
includes additional functionality.
• The ICMP messages common to both ICMPv4 and ICMPv6 include:
• Host reachability
• Destination or Service Unreachable
• Time exceeded

Note: ICMPv4 messages are not required and are often not allowed within a network for
security reasons.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 42
ICMP Messages
Host Reachability
ICMP Echo Message can be used to
test the reachability of a host on an IP
network.
In the example:
• The local host sends an ICMP Echo
Request to a host.
• If the host is available, the
destination host responds with an
Echo Reply.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 43
13.2 Ping and Traceroute Tests

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 44
Ping and Traceroute Tests
Ping – Test Connectivity
• The ping command is an IPv4 and IPv6 testing
utility that uses ICMP echo request and echo
reply messages to test connectivity between
hosts and provides a summary that includes the
success rate and average round-trip time to the
destination.
• If a reply is not received within the timeout, ping
provides a message indicating that a response
was not received.
• It is common for the first ping to timeout if
address resolution (ARP or ND) needs to be
performed before sending the ICMP Echo
Request.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 45
Ping and Traceroute Tests
Ping the Loopback
Ping can be used to test the internal
configuration of IPv4 or IPv6 on the local
host. To do this, ping the local loopback
address of 127.0.0.1 for IPv4 (::1 for
IPv6).
• A response from 127.0.0.1 for IPv4,
or ::1 for IPv6, indicates that IP is
properly installed on the host.
• An error message indicates that TCP/IP
is not operational on the host.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 46
Ping and Traceroute Tests
Ping the Default Gateway
The ping command can be used to test the
ability of a host to communicate on the local
network.

The default gateway address is most often used


because the router is normally always
operational.
• A successful ping to the default gateway
indicates that the host and the router
interface serving as the default gateway
are both operational on the local network.
• If the default gateway address does not
respond, a ping can be sent to the IP
address of another host on the local
network that is known to be operational.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 47
Ping and Traceroute Tests
Ping a Remote Host
Ping can also be used to test the ability of a
local host to communicate across an
internetwork.
A local host can ping a host on a remote
network. A successful ping across the
internetwork confirms communication on
the local network.

Note: Many network administrators limit or


prohibit the entry of ICMP messages therefore,
the lack of a ping response could be due to
security restrictions.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 48
Ping and Traceroute Tests
Traceroute – Test the Path
• Traceroute (tracert) is a utility that is used
to test the path between two hosts and
provide a list of hops that were
successfully reached along that path.

Note: Traceroute makes use of a function of the


TTL field in IPv4 and the Hop Limit field in IPv6 in
the Layer 3 headers, along with the ICMP Time
Exceeded message.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 49
Module 11: IPv4
Addressing
Introduction to Networks v7.0
(ITN)
Module Objectives
Module Title: IPv4 Addressing

Module Objective: Calculate an IPv4 subnetting scheme to efficiently segment your network.
Topic Title Topic Objective

IPv4 Address Structure ✓ Describe the structure of an IPv4 address including


the network portion, the host portion, and the
subnet mask.
IPv4 Unicast, Broadcast, and Multicast Compare the characteristics and uses of the
unicast, broadcast and multicast IPv4 addresses.

Types of IPv4 Addresses ✓ Explain public, private, and reserved IPv4


addresses.
Network Segmentation Explain how subnetting segments a network to
enable better communication.
Subnet an IPv4 Network Calculate IPv4 subnets for a /24 prefix.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 51
11.2 IPv4 Unicast, Broadcast,
and Multicast

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 52
IPv4 Unicast, Broadcast, and Multicast
Unicast
• Unicast transmission is sending a packet to one destination IP address.

• For example, the PC at 172.16.4.1 sends a unicast packet to the printer at


172.16.4.253.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 53
IPv4 Unicast, Broadcast, and Multicast
Broadcast
• Broadcast transmission is sending a packet to all other destination IP addresses.

• For example, the PC at 172.16.4.1 sends a broadcast packet to all IPv4 hosts.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 54
IPv4 Unicast, Broadcast, and Multicast
Multicast
• Multicast transmission is sending a packet to a multicast address group.

• For example, the PC at 172.16.4.1 sends a multicast packet to the multicast group
address 224.10.10.5.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 55
11.4 Network Segmentation

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 56
Network Segmentation
Broadcast Domains and Segmentation
• Many protocols use broadcasts or multicasts (e.g., ARP use broadcasts to locate
other devices, hosts send DHCP discover broadcasts to locate a DHCP server.)
• Switches propagate broadcasts out all interfaces except the interface on which it was
received.

• The only device that stops


broadcasts is a router.
• Routers do not propagate
broadcasts.
• Each router interface connects
to a broadcast domain and
broadcasts are only
propagated within that specific
broadcast domain.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 57
Network Segmentation
Problems with Large Broadcast Domains
• A problem with a large broadcast domain is that
these hosts can generate excessive broadcasts
and negatively affect the network.

• The solution is to reduce the size of the


network to create smaller broadcast domains in
a process called subnetting.

• Dividing the network address 172.16.0.0 /16


into two subnets of 200 users each:
172.16.0.0 /24 and 172.16.1.0 /24.
• Broadcasts are only propagated within the
smaller broadcast domains.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 58
Network Segmentation
Reasons for Segmenting Networks
• Subnetting reduces overall network traffic and improves network performance.
• It can be used to implement security policies between subnets.
• Subnetting reduces the number of devices affected by abnormal broadcast traffic.

• Subnets are used for a variety of reasons including by:

Location Group or Function Device Type

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 59
11.5 Subnet an IPv4 Network

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 60
Subnet an IPv4 Network
Subnet on an Octet Boundary
• Networks are most easily subnetted at the octet boundary of /8, /16, and /24.

• Notice that using longer prefix lengths decreases the number of hosts per subnet.

Prefix Length Subnet Mask Subnet Mask in Binary (n = network, h = host) # of hosts

nnnnnnnn.hhhhhhhh.hhhhhhhh.hhhhhhhh
/8 255.0.0.0 11111111.00000000.00000000.00000000
16,777,214

nnnnnnnn.nnnnnnnn.hhhhhhhh.hhhhhhhh
/16 255.255.0.0 11111111.11111111.00000000.00000000
65,534

nnnnnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh
/24 255.255.255.0 11111111.11111111.11111111.00000000
254

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 61
Subnet an IPv4 Network
Subnet on an Octet Boundary (Cont.)
• In the first table 10.0.0.0/8 is subnetted using /16 and in the second table, a /24 mask.
Subnet Address Host Range Subnet Address
Host Range
(256 Possible (65,534 possible hosts per Broadcast (65,536 Possible Broadcast
(254 possible hosts per subnet)
Subnets) subnet) Subnets)

10.0.0.0/16 10.0.0.1 - 10.0.255.254 10.0.255.255 10.0.0.0/24 10.0.0.1 - 10.0.0.254 10.0.0.255


10.0.1.0/24 10.0.1.1 - 10.0.1.254 10.0.1.255
10.1.0.0/16 10.1.0.1 - 10.1.255.254 10.1.255.255
10.0.2.0/24 10.0.2.1 - 10.0.2.254 10.0.2.255
10.2.0.0/16 10.2.0.1 - 10.2.255.254 10.2.255.255
… … …
10.3.0.0/16 10.3.0.1 - 10.3.255.254 10.3.255.255 10.0.255.0/24 10.0.255.1 - 10.0.255.254 10.0.255.255
10.4.0.0/16 10.4.0.1 - 10.4.255.254 10.4.255.255 10.1.0.0/24 10.1.0.1 - 10.1.0.254 10.1.0.255

10.5.0.0/16 10.5.0.1 - 10.5.255.254 10.5.255.255 10.1.1.0/24 10.1.1.1 - 10.1.1.254 10.1.1.255


10.1.2.0/24 10.1.2.1 - 10.1.2.254 10.1.2.255
10.6.0.0/16 10.6.0.1 - 10.6.255.254 10.6.255.255
… … …
10.7.0.0/16 10.7.0.1 - 10.7.255.254 10.7.255.255
10.100.0.0/24 10.100.0.1 - 10.100.0.254 10.100.0.255
... ... ... ... ... ...
10.255.0.0/16 10.255.0.1 - 10.255.255.254 10.255.255.255 10.255.255.0/24 10.255.255.1 - 10.2255.255.254 10.255.255.255
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 62
Subnet an IPv4 Network
Subnet within an Octet Boundary
• Refer to the table to see six ways to subnet a /24 network.

Subnet Mask in Binary # of


Prefix Length Subnet Mask # of hosts
(n = network, h = host) subnets
nnnnnnnn.nnnnnnnn.nnnnnnnn.nhhhhhhh
/25 255.255.255.128 11111111.11111111.11111111.10000000 2 126

nnnnnnnn.nnnnnnnn.nnnnnnnn.nnhhhhhh
/26 255.255.255.192 11111111.11111111.11111111.11000000 4 62

nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnhhhhh
/27 255.255.255.224 11111111.11111111.11111111.11100000 8 30

nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnnhhhh
/28 255.255.255.240 11111111.11111111.11111111.11110000 16 14

nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnnnhhh
/29 255.255.255.248 11111111.11111111.11111111.11111000 32 6

nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnnnnhh
/30 255.255.255.252 11111111.11111111.11111111.11111100 64 2

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 63
11.7 Subnet to Meet
Requirements

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 64
Subnet to Meet Requirements
Minimize Unused Host IPv4 Addresses and Maximize Subnets

There are two considerations when planning subnets:


• The number of host addresses required for each network
• The number of individual subnets needed

Subnet Mask in Binary # of


Prefix Length Subnet Mask # of hosts
(n = network, h = host) subnets
nnnnnnnn.nnnnnnnn.nnnnnnnn.nhhhhhhh
/25 255.255.255.128 11111111.11111111.11111111.10000000 2 126

nnnnnnnn.nnnnnnnn.nnnnnnnn.nnhhhhhh
/26 255.255.255.192 11111111.11111111.11111111.11000000 4 62

nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnhhhhh
/27 255.255.255.224 11111111.11111111.11111111.11100000 8 30

nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnnhhhh
/28 255.255.255.240 11111111.11111111.11111111.11110000 16 14

nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnnnhhh
/29 255.255.255.248 11111111.11111111.11111111.11111000 32 6

nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnnnnhh
/30 255.255.255.252 11111111.11111111.11111111.11111100 64 2

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 65
Subnetting Formulas
To calculate the number of subnets. 2 b
b ~ bits borrowed
Subnetting Formulas (cont.)
To calculate the number of hosts.
2 -2 h‘
h‘ ~ number of bits
remaining in the host field
11.8 VLSM

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 68
VLSM
IPv4 Address Conservation
Given the topology, 7 subnets are required (i.e, four LANs and three WAN links) and the
largest number of host is in Building D with 28 hosts.

• A /27 mask would provide 8 subnets of 30 host IP addresses and therefore support
this topology.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 69
VLSM
IPv4 Address Conservation (Cont.)
However, the point-to-point WAN links only require two addresses
and therefore waste 28 addresses each for a total of 84 unused
addresses.

• Applying a traditional subnetting scheme to this scenario is not very efficient and is
wasteful.

• VLSM was developed to avoid wasting addresses by enabling us to subnet a subnet.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 70
VLSM
VLSM
• The left side displays the traditional subnetting scheme
(i.e., the same subnet mask) while the right side
illustrates how VLSM can be used to subnet a subnet
and divided the last subnet into eight /30 subnets.

• When using VLSM, always begin by satisfying the host


requirements of the largest subnet and continue
subnetting until the host requirements of the smallest
subnet are satisfied.

• The resulting topology with VLSM applied.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 71
VLSM
VLSM Topology Address Assignment
• Using VLSM subnets, the LAN and inter-router networks can be addressed without
unnecessary waste as shown in the logical topology diagram.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 72
IP Addressing and
Subnetting IP networks
examples
Libor Polčák
Vysoké učení technické v Brně, Fakulta informačních technologií
Božetěchova 1/2, 612 66 Brno
[email protected]
Cvičebnice v souborech předmětu
Příklady (examples)
Ip_Addressing_and_Subnetting_Workbook_-_Student_Version_v2_0.pdf
VLSM_Workbook__Student_Edition_-_v2_0.pdf
Převod IP adresy do binární soustavy
Převeďte adresu serveru merlin do binární soustavy
(147.229.176.19):
Převod IP adresy do binární soustavy
Převeďte adresu serveru merlin do binární soustavy
(147.229.176.19):
147 = 128 + 16 + 2 + 1
Převod IP adresy do binární soustavy
Převeďte adresu serveru merlin do binární soustavy
(147.229.176.19):
147 = 128 + 16 + 2 + 1
229 = 128 + 64 + 32 + 4 + 1
Převod IP adresy do binární soustavy
Převeďte adresu serveru merlin do binární soustavy
(147.229.176.19):
147 = 128 + 16 + 2 + 1
229 = 128 + 64 + 32 + 4 + 1
176 = 128 + 32 + 16
Převod IP adresy do binární soustavy
Převeďte adresu serveru merlin do binární soustavy
(147.229.176.19):
147 = 128 + 16 + 2 + 1
229 = 128 + 64 + 32 + 4 + 1
176 = 128 + 32 + 16
19 = 16 + 2 + 1
Převod IP adresy do binární soustavy
Převeďte adresu serveru merlin do binární soustavy
(147.229.176.19):
147 = 128 + 16 + 2 + 1 10010011
229 = 128 + 64 + 32 + 4 + 1 11100101
176 = 128 + 32 + 16 10110000
19 = 16 + 2 + 1 00010011
Převod IP adresy do binární soustavy
Převeďte adresu serveru merlin do binární soustavy
(147.229.176.19):
147 = 128 + 16 + 2 + 1 10010011
229 = 128 + 64 + 32 + 4 + 1 11100101
176 = 128 + 32 + 16 10110000
19 = 16 + 2 + 1 00010011
10010011.11100101.10110000.00010011
Maska sítě
Zapište hodnotu masky serveru merlin binárně a dekadicky
$ ip addr show
...
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 00:25:90:c8:3f:1b brd ff:ff:ff:ff:ff:ff
inet 147.229.176.19/23 brd 147.229.177.255 scope global eth2
valid_lft forever preferred_lft forever
Maska sítě
Zapište hodnotu masky serveru merlin binárně a dekadicky
$ ip addr show
...
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 00:25:90:c8:3f:1b brd ff:ff:ff:ff:ff:ff
inet 147.229.176.19/23 brd 147.229.177.255 scope global eth2
valid_lft forever preferred_lft forever
Maska sítě
Zapište hodnotu masky serveru merlin binárně a dekadicky
$ ip addr show
...
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 00:25:90:c8:3f:1b brd ff:ff:ff:ff:ff:ff
inet 147.229.176.19/23 brd 147.229.177.255 scope global eth2
valid_lft forever preferred_lft forever

● Délka prefixu: /23


→ 23 jedniček, zbytek 0
Maska sítě
Zapište hodnotu masky serveru merlin binárně a dekadicky
$ ip addr show
...
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 00:25:90:c8:3f:1b brd ff:ff:ff:ff:ff:ff
inet 147.229.176.19/23 brd 147.229.177.255 scope global eth2
valid_lft forever preferred_lft forever

● Délka prefixu: /23


→ 23 jedniček, zbytek 0
● 11111111.11111111.11111110.00000000
Maska sítě
Zapište hodnotu masky serveru merlin binárně a dekadicky
$ ip addr show
...
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 00:25:90:c8:3f:1b brd ff:ff:ff:ff:ff:ff
inet 147.229.176.19/23 brd 147.229.177.255 scope global eth2
valid_lft forever preferred_lft forever

● Délka prefixu: /23


→ 23 jedniček, zbytek 0
● 11111111.11111111.11111110.00000000
● 255.255.254.0
Vyhrazené adresy
Jaká je adresa sítě a všesměrová adresa serveru merlin
(147.229.176.19/23)
Vyhrazené adresy
Jaká je adresa sítě a všesměrová adresa serveru merlin
(147.229.176.19/23)

10010011.11100101.10110000.00010011
11111111.11111111.11111110.00000000
-----------------------------------
Vyhrazené adresy
Jaká je adresa sítě a všesměrová adresa serveru merlin
(147.229.176.19/23)

10010011.11100101.10110000.00010011
11111111.11111111.11111110.00000000
-----------------------------------
10010011.11100101.10110000.00000000
Vyhrazené adresy
Jaká je adresa sítě a všesměrová adresa serveru merlin
(147.229.176.19/23)

10010011.11100101.10110000.00010011
11111111.11111111.11111110.00000000
-----------------------------------
10010011.11100101.10110000.00000000

Adresa sítě: 147.229.176.0


Vyhrazené adresy
Jaká je adresa sítě a všesměrová adresa serveru merlin
(147.229.176.19/23)

10010011.11100101.10110000.00010011
11111111.11111111.11111110.00000000
-----------------------------------
10010011.11100101.10110000.00000000

Adresa sítě: 147.229.176.0


Všesměrová adresa: 147.229.177.255
Počet podsítí
Víte, že VUT má k dispozici IP adresy 147.229.0.0/16 a server
merlin používá rozsah /23, kolik podsítí v rozsahu /23 může na
VUT maximálně existovat?
Počet podsítí
Víte, že VUT má k dispozici IP adresy 147.229.0.0/16 a server
merlin používá rozsah /23, kolik podsítí v rozsahu /23 může na
VUT maximálně existovat?

223-16=27=128
Počet zařízení v síti
Kolik zařízení může být nejvýše v síti 147.229.176.0/23?
Počet zařízení v síti
Kolik zařízení může být nejvýše v síti 147.229.176.0/23?

32-23=9
Počet zařízení v síti
Kolik zařízení může být nejvýše v síti 147.229.176.0/23?

32-23=9
29-2=510 zařízení
Podsíťování
Máte k dispozici rozsah IP adres 10.15.80.0/22. Máte za úkol
vytvořit podsítě pro A) nejméně 40 zařízení, B) nejméně 60
zařízení, C) nejméně 16 zařízení, D) nejméně 14 zařízení,
E) nejméně 8 point-to-point propojů. Navrhněte podsíťování,
kolik volných adres vám zbyde v rezervě?
Podsíťování

nes.at.fit
PAGE
98 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Podsíťování
10.15.80.0/22

nes.at.fit
PAGE
99 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Podsíťování
10.15.80.0/22
A) 40 zařízení

nes.at.fit
PAGE
100 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Podsíťování
10.15.80.0/22
A) 40 zařízení
26 → /26

nes.at.fit
PAGE
101 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Podsíťování
10.15.80.0/22
A) 40 zařízení
26 → /26
B) 60 zařízení

nes.at.fit
PAGE
102 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Podsíťování
10.15.80.0/22
A) 40 zařízení
26 → /26
B) 60 zařízení
26 → /26

nes.at.fit
PAGE
103 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Podsíťování
10.15.80.0/22
A) 40 zařízení
26 → /26
B) 60 zařízení
26 → /26
C) 16 zařízení

nes.at.fit
PAGE
104 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Podsíťování
10.15.80.0/22
A) 40 zařízení
26 → /26
B) 60 zařízení
26 → /26
C) 16 zařízení
25 → /27

nes.at.fit
PAGE
105 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Podsíťování
10.15.80.0/22
A) 40 zařízení
26 → /26
B) 60 zařízení
26 → /26
C) 16 zařízení
25 → /27
D) 14 zařízení

nes.at.fit
PAGE
106 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Podsíťování
10.15.80.0/22
A) 40 zařízení
26 → /26
B) 60 zařízení
26 → /26
C) 16 zařízení
25 → /27
D) 14 zařízení
24 → /28

nes.at.fit
PAGE
107 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Podsíťování
10.15.80.0/22
A) 40 zařízení
26 → /26
B) 60 zařízení
26 → /26
C) 16 zařízení
25 → /27
D) 14 zařízení
24 → /28
E) 8 point-to-point propojů

nes.at.fit
PAGE
108 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Podsíťování
10.15.80.0/22
A) 40 zařízení
26 → /26
B) 60 zařízení
26 → /26
C) 16 zařízení
25 → /27
D) 14 zařízení
24 → /28
E) 8 point-to-point propojů
22 → /30 (8-krát)

nes.at.fit
PAGE
109 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Podsíťování
10.15.80.0/22 .80.0
A) 40 zařízení
26 → /26
B) 60 zařízení
26 → /26
C) 16 zařízení
25 → /27
D) 14 zařízení
24 → /28
E) 8 point-to-point propojů .83.255

22 → /30 (8-krát)

nes.at.fit
PAGE
110 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Podsíťování
10.15.80.0/22
A) 40 zařízení
26 → /26
B) 60 zařízení
.80.0 .82.0
26 → /26
C) 16 zařízení
25 → /27
D) 14 zařízení
24 → /28
.81.0 .83.0
E) 8 point-to-point propojů
22 → /30 (8-krát)

nes.at.fit
PAGE
111 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Podsíťování
10.15.83.0/24
10.15.80.0/22
A) 40 zařízení .0

26 → /26
B) 60 zařízení
26 → /26
C) 16 zařízení
25 → /27
D) 14 zařízení
24 → /28
E) 8 point-to-point propojů
22 → /30 (8-krát) .255

nes.at.fit
PAGE
112 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Podsíťování
10.15.83.0/24
10.15.80.0/22
A) 40 zařízení .0 .128

26 → /26
B) 60 zařízení
26 → /26
C) 16 zařízení
25 → /27
D) 14 zařízení
24 → /28
E) 8 point-to-point propojů
.127 .255
22 → /30 (8-krát)

nes.at.fit
PAGE
113 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Podsíťování
10.15.83.0/24
10.15.80.0/22
A) 40 zařízení .0 .128

26 → /26
B) 60 zařízení
26 → /26
C) 16 zařízení .63 .191
25 → /27 .64 .192

D) 14 zařízení
24 → /28
E) 8 point-to-point propojů
.127 .255
22 → /30 (8-krát)

nes.at.fit
PAGE
114 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Podsíťování
10.15.83.0/24
10.15.80.0/22
A) 40 zařízení .0 .128

26 → /26
B) 60 zařízení
26 → /26
C) 16 zařízení .63 .191
25 → /27 .64 .192

A
D) 14 zařízení
24 → /28
E) 8 point-to-point propojů
.127 .255
22 → /30 (8-krát)

nes.at.fit
PAGE
115 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Podsíťování
10.15.83.0/24
10.15.80.0/22
A) 40 zařízení .0 .128

B
26 → /26
B) 60 zařízení
26 → /26
C) 16 zařízení .63 .191
25 → /27 .64 .192

A
D) 14 zařízení
24 → /28
E) 8 point-to-point propojů
.127 .255
22 → /30 (8-krát)

nes.at.fit
PAGE
116 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Podsíťování
10.15.83.0/24
10.15.80.0/22
A) 40 zařízení .0 .128

B
26 → /26
B) 60 zařízení
26 → /26
C) 16 zařízení .63 .191
25 → /27 .64 .96 .192

A
D) 14 zařízení
24 → /28
E) 8 point-to-point propojů
.95 .127 .255
22 → /30 (8-krát)

nes.at.fit
PAGE
117 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Podsíťování
10.15.83.0/24
10.15.80.0/22
A) 40 zařízení .0 .128

B
26 → /26
B) 60 zařízení
26 → /26
C) 16 zařízení .63 .191
25 → /27 .64 .96 .192

C A
D) 14 zařízení
24 → /28
E) 8 point-to-point propojů
.95 .127 .255
22 → /30 (8-krát)

nes.at.fit
PAGE
118 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Podsíťování
10.15.83.0/24
10.15.80.0/22
A) 40 zařízení .0 .128

B
26 → /26
B) 60 zařízení
26 → /26
C) 16 zařízení .63 .191
25 → /27 .64 .96 .192

C A
D) 14 zařízení .79
2 → /28
4
.80
E) 8 point-to-point propojů
.95 .127 .255
22 → /30 (8-krát)

nes.at.fit
PAGE
119 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Podsíťování
10.15.83.0/24
10.15.80.0/22
A) 40 zařízení .0 .128

B
26 → /26
B) 60 zařízení
26 → /26
C) 16 zařízení .63 .191
25 → /27 .64 .96 .192

C A
D) 14 zařízení .79

D
2 → /28
4
.80
E) 8 point-to-point propojů
.95 .127 .255
22 → /30 (8-krát)

nes.at.fit
PAGE
120 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Podsíťování
10.15.83.0/24
10.15.80.0/22
A) 40 zařízení .0 .128

B
26 → /26
B) 60 zařízení
26 → /26
C) 16 zařízení .63 .191
25 → /27 .64 .72 .96 .192

C A
D) 14 zařízení .68 .76
.79

D
24 → /28 .80
E) 8 point-to-point propojů
.95 .127 .255
22 → /30 (8-krát)

nes.at.fit
PAGE
121 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Podsíťování
10.15.83.0/24
10.15.80.0/22
A) 40 zařízení .0 .128

B
26 → /26
B) 60 zařízení .48 .56
2 → /26
6
.52 .60
C) 16 zařízení .63 .191
25 → /27 .64 .72 .96 .192

C A
D) 14 zařízení .68 .76
.79

D
24 → /28 .80
E) 8 point-to-point propojů
.95 .127 .255
22 → /30 (8-krát)

nes.at.fit
PAGE
122 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Podsíťování
10.15.83.0/24
10.15.80.0/22
A) 40 zařízení .0 .128

B
26 → /26

E
B) 60 zařízení .48 .56
2 → /26
6
.52 .60
C) 16 zařízení .63 .191

E
25 → /27 .64 .72 .96 .192

C A
D) 14 zařízení .68 .76
.79

D
24 → /28 .80
E) 8 point-to-point propojů
.95 .127 .255
22 → /30 (8-krát)

nes.at.fit
PAGE
123 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Podsíťování
10.15.80.0/22
10.15.83.0/24
A) 10.15.83.192/26 .128
.0
B) 10.15.83.128/26

B
C) 10.15.83.96/27
D) 10.15.83.80/28 .48 .56
E) 8 point-to-point propojů
.52 .60
10.15.83.48/30 .191
10.15.83.52/30 .64 .72 .96 .192
10.15.83.56/30

C A
.68 .76
10.15.83.60/30

D
10.15.83.64/30 .80
10.15.83.68/30
.95 .127 .255
10.15.83.72/30
10.15.83.76/30
nes.at.fit
PAGE
124 © 2018 Brno University of Technology, Faculty of Information Technology, UIFS, Libor Polčák, [email protected]
Module 9: Address Resolution

Introduction to Networks v7.0


(ITN)
Module Objectives
Module Title: Address Resolution

Module Objective: Explain how ARP and ND enable communication on a network .

Topic Title Topic Objective


MAC and IP Compare the roles of the MAC address and the IP address.

ARP Describe the purpose of ARP.

Neighbor Discovery Describe the operation of IPv6 neighbor discovery.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 126
9.1 MAC and IP

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 127
MAC and IP
Destination on Same Network
There are two primary addresses assigned to a device on an Ethernet LAN:
• Layer 2 physical address (the MAC address) – Used for NIC to NIC communications
on the same Ethernet network.
• Layer 3 logical address (the IP address) – Used to send the packet from the source
device to the destination device.
Layer 2 addresses are used to deliver frames from one NIC to another NIC on the same
network. If a destination IP address is on the same network, the destination MAC address
will be that of the destination device.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 128
MAC and IP
Destination on Remote Network
When the destination IP address is on a remote network, the destination MAC address is
that of the default gateway.
• ARP is used by IPv4 to associate the IPv4 address of a device with the MAC address
of the device NIC.
• ICMPv6 is used by IPv6 to associate the IPv6 address of a device with the MAC
address of the device NIC.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 129
9.2 ARP (IPv4)

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 130
ARP
ARP Overview
A device uses ARP to determine the
destination MAC address of a local
device when it knows its IPv4 address.

ARP provides two basic functions:


• Resolving IPv4 addresses to MAC
addresses
• Maintaining an ARP table of IPv4 to
MAC address mappings

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 131
ARP
ARP Functions
To send a frame, a device will search its ARP table for a destination IPv4 address and a
corresponding MAC address.
• If the packet’s destination IPv4 address is on the same network, the device will
search the ARP table for the destination IPv4 address.
• If the destination IPv4 address is on a different network, the device will search the
ARP table for the IPv4 address of the default gateway.
• If the device locates the IPv4 address, its corresponding MAC address is used as the
destination MAC address in the frame.
• If there is no ARP table entry is found, then the device sends an ARP request.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 132
ARP
Removing Entries from an ARP Table
• Entries in the ARP table are not permanent and are removed when an ARP cache
timer expires after a specified period of time.
• The duration of the ARP cache timer differs depending on the operating system.
• ARP table entries can also be removed manually by the administrator.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 133
ARP
ARP Tables on Networking Devices
• The show ip arp command displays the ARP table on a Cisco router.
• The arp –a command displays the ARP table on a Windows 10 PC.

R1# show ip arp


Protocol Address Age (min) Hardware Addr Type Interface
Internet 192.168.10.1 - a0e0.af0d.e140 ARPA GigabitEthernet0/0/0

C:\Users\PC> arp -a

Interface: 192.168.1.124 --- 0x10


Internet Address Physical Address Type
192.168.1.1 c8-d7-19-cc-a0-86 dynamic
192.168.1.101 08-3e-0c-f5-f7-77 dynamic

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 134
ARP
ARP Issues – ARP Broadcasting and ARP Spoofing
• ARP requests are received and processed by every device on the local network.
• Excessive ARP broadcasts can cause some reduction in performance.
• ARP replies can be spoofed by a threat actor to perform an ARP poisoning attack.
• Enterprise level switches include mitigation techniques to protect against ARP
attacks.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 135
9.3 Neighbor Discovery (IPv6)

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 136
IPv6 Neighbor Discovery
IPv6 Neighbor Discovery Messages
IPv6 Neighbor Discovery (ND) protocol provides:
• Address resolution
• Router discovery
• Redirection services
• ICMPv6 Neighbor Solicitation (NS) and Neighbor Advertisement (NA)
messages are used for device-to-device messaging such as address
resolution.
• ICMTPv6 Router Solicitation (RS) and Router Advertisement (RA) messages
are used for messaging between devices and routers for router discovery.
• ICMPv6 redirect messages are used by routers for better next-hop selection.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 137
IPv6 Neighbor Discovery
IPv6 Neighbor Discovery – Address Resolution
• IPv6 devices use ND to resolve
the MAC address of a known
IPv6 address.
• ICMPv6 Neighbor Solicitation
messages are sent using
special Ethernet and IPv6
multicast addresses.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 138

You might also like