0% found this document useful (0 votes)
18 views130 pages

10CCN_NetworkLayer_Updated

Chapter 6 of CIS 81 focuses on the Network Layer, detailing its functions such as addressing, encapsulation, routing, and de-encapsulation. It covers key protocols like IPv4 and IPv6, highlighting their characteristics, including IPv4's connectionless nature and best-effort delivery. The chapter also explains the structure of IPv4 and IPv6 packets, including their headers and significant fields.

Uploaded by

memonbismapari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views130 pages

10CCN_NetworkLayer_Updated

Chapter 6 of CIS 81 focuses on the Network Layer, detailing its functions such as addressing, encapsulation, routing, and de-encapsulation. It covers key protocols like IPv4 and IPv6, highlighting their characteristics, including IPv4's connectionless nature and best-effort delivery. The chapter also explains the structure of IPv4 and IPv6 packets, including their headers and significant fields.

Uploaded by

memonbismapari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 130

CIS 81 Fundamentals of Networking

Chapter 6: Network Layer

CCNA Introduction to Networking 5.0

Rick Graziani
Cabrillo College
[email protected]
The Network Layer
Encapsulation and Decapsulation
Data Link IP TCP HTTP Data Link
Data Trailer
Header Header Header Header

Data Link Data Link


IP Packet
Header Trailer

Data Link Data Link


IP Packet
Header Trailer

Data Link Data Link


IP Packet
Header Trailer

Data Link IP TCP HTTP Data Link


Data Trailer
Header Header Header Header

3
Encapsulation

DATA

SEGMENT DATA
S.P / D.P. / S.N. / Ack # / …

DATA (SEGMENT)
PACKET
IPv / HLEN / Flag / S. IP / D. IP / …

Frame Header FRAME


DATA (PACKET) Trailer

111010110101011100001001011010101010010101010101101101010001010101010110101010
IP
Functions of
the Network
Layer

IP

⚫ The network layer, or OSI Layer 3, provides services to allow end devices to
exchange data across the network.
⚫ The network layer uses four basic processes:
 Addressing end devices
 Encapsulation
 Routing
 De-encapsulation
Network Layer Protocols

⚫ Common Network Layer Protocols


 Internet Protocol version 4 (IPv4)
 Internet Protocol version 6 (IPv6)
⚫ Legacy Network Layer Protocols
 Novell Internetwork Packet Exchange (IPX)
 AppleTalk
 Connectionless Network Service (CLNS/DECNet)
Characteristics of IPv4

⚫ Connectionless:
 No connection is established before sending data packets.
⚫ Best effort delivery:
 No additional overhead is used to guarantee packet delivery.
 Makes it unreliable …?
⚫ Media independent:
 Operates independently of the medium carrying the data.
Connectionless Service = Postal Service
Connectionless Service
Best Effort Delivery = Unreliable
Best Effort Delivery = Unreliable

⚫ IP is unreliable because it doesn’t have the capability to manage,


and recover from, undelivered or corrupt packets.
 TCP (if used) will manage the transmission reliability.
⚫ It also makes for a smaller IP header.
 Less overhead = less delay in delivery = very fast.
IPv4 Media Independent

⚫ IP doesn’t care what type of media the packet is carried on.


It is my job to reconstruct
The outgoing link has a
MTU
ink has a smaller MTU so I have to
the packets.
MTU but I fragment the packets.
nstruct IP Packet
s.
IP Packet IP Packet
IP Packet
IP Packet
Network link with Network link with Network link with
larger MTU smaller MTU larger MTU

IP Packet IP Packet

IP Packet IP Packet

IP Packet IP Packet
▪ The Network layer does consider the maximum size of PDU that each medium can
transport.
 This is referred to as the Maximum Transmission Unit (MTU).
▪ The Network layer determines how large to create the packets.
 Routers may need to split up a packet when forwarding it from one media to a
media with a smaller MTU.
 This process is called fragmenting the packet or fragmentation.
▪ This is similar to segmenting at the Transport layer but happens at the Network layer.
IPv4 Packet
IPv4 Packet

IP Header Data (Payload)

⚫ IPv4 has been in use since 1983 when it was deployed on the
Advanced Research Projects Agency Network (ARPANET).
⚫ An IPv4 packet has two parts:
 IP Header - Identifies the packet characteristics.
 Payload - Contains the Layer 4 segment information and the
actual data.
IPv4 Header – Significant Fields

Byte 1 Byte 2 Byte 3 Byte 4

IP Header Differentiated Services


Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional)
Padding
IPv4 Header – Validation Fields

Byte 1 Byte 2 Byte 3 Byte 4

IP Header Differentiated Services


Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding


Sample IPv4 Packet
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding


IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding

Version (4 bits)
– Indicates the version of IP currently used.
– 0100 = 4 and therefore IPv4
– 0110 = 6 and therefore IPv6
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding

IP Header Length (4 bits)


– Identifies the number of 32-bit words in the header.
– The IHL value varies due to the Options and Padding fields.
– The minimum value for this field is 5 (i.e., 5×32 = 160 bits =
20 bytes) and the maximum value is 15 (i.e., 15×32 = 480
bits = 60 bytes).
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding

Differentiated Services (8 bits)


– Formerly called the Type of Service (ToS) field.
– The field is used to determine the priority of each packet.
– First 6 bits identify the Differentiated Services Code Point (DSCP) value for QoS.
– Last 2 bits identify the explicit congestion notification (ECN) value used to prevent
dropped packets during times of network congestion.
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding

Total Length (16 bits)


– Sometimes referred to as the Packet Length.
– Defines the entire packet (fragment) size, including header and data, in bytes.
– The minimum length packet is 20 bytes (20-byte header + 0 bytes data) and the
maximum is 65,535 bytes. .
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional)
A router may have to fragment
Padding
a packet
when forwarding it from one medium to
another medium that has a smaller MTU.
When this happens, fragmentation
occurs and the IPv4 packet uses the
following 3 fields to keep track of the
fragments
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding

Identification (16 bits)


– Field uniquely identifies the fragment of an
original IP packet.
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding

Flag (3 bits)
– This 3-bit field identifies how the packet is fragmented.
– It is used with the Fragment Offset and Identification
fields to help reconstruct the fragment into the original
packet.
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding

Fragment Offset (13 bits)


– Field identifies the order in which to place the packet
fragment in the reconstruction of the original
unfragmented packet.
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding


Time-to-Live (TTL) (8 bits)
– Used to limit the lifetime of a packet.
– It is specified in seconds but is commonly referred to as hop
count.
– The packet sender sets the initial TTL value and is decreased
by one each time the packet is processed by a router, or hop.
– If the TTL field decrements to zero, the router discards the
packet and sends an ICMP Time Exceeded message to the
source IP address.
– The traceroute command uses this field to identify the routers
used between the source and destination.
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding

Protocol (8 bits)
– Field indicates the data payload type that the packet is
carrying, which enables the network layer to pass the data
to the appropriate upper-layer protocol.
– Common values include ICMP (1), TCP (6), and UDP (17).
– Others: GRE (47), ESP (50), EIGRP (88), OSPF (89)
– http://www.iana.org/assignments/protocol-numbers/
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding

Header Checksum (8 bits)


– Field is used for error checking of the IP header.
– The checksum of the header is recalculated and
compared to the value in the checksum field.
– If the values do not match, the packet is discarded.
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding

Source IP Address (32 bits)


– Contains a 32-bit binary value that represents the
source IP address of the packet.
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN

Identification Flag Fragment Offset

Time-To-Live Protocol Header Checksum

Source IP Address

Destination IP Address

Options (optional) Padding

Destination IP Address (32 bits)


– Contains a 32-bit binary value that represents the
destination IP address of the packet.
Sample IPv4 Headers
Sample IPv4 Headers
Sample IPv4 Headers
IPv4
IPv6 Packet
Improved
Packet
Handling

⚫ The IPv6 header has been simplified with fewer fields.


 This improves packet handling by intermediate routers and also
provides support for extensions and options for increased
scalability/longevity.
IPv6 Header

Byte 1 Byte 2 Byte 3 Byte 4

Version Traffic Class Flow Label

Next
Payload Length Hop Limit
Header

Source IP Address

Destination IP Address
Sample IPv4 Packet
Traffic
Version Flow Label
Class
Next
Payload Length Hop Limit
Header

Source IP Address

Destination IP Address
Traffic
Version Flow Label
Class
Next
Payload Length Hop Limit
Header

Source IP Address

Destination IP Address

Version (4 bits)
– Indicates the version of IP currently used.
– 0100 = 4 and therefore IPv4
– 0110 = 6 and therefore IPv6
Traffic
Version Flow Label
Class
Next
Payload Length Hop Limit
Header

Source IP Address

Destination IP Address

Traffic Class (8 bits)


– Field is equivalent to the
IPv4 Differentiated
Services (DS) field.
– It also contains a 6-bit
DSCP value used for QoS
and a 2-bit ECN used for
traffic congestion control.
Traffic
Version Flow Label
Class
Next
Payload Length Hop Limit
Header

Source IP Address

Destination IP Address

Flow Label (20 bits)


– Field provides a special
service for real-time
applications.
– It can be used to inform
routers and switches to
maintain the same path for
the packet flow so that
packets are not reordered.
Traffic
Version Flow Label
Class
Next
Payload Length Hop Limit
Header

Source IP Address

Destination IP Address

Payload Length (16 bits)


– Field is equivalent to the Total Length field
in the IPv4 header.
– It defines the entire packet (fragment) size,
including header and optional extensions
Traffic
Version Flow Label
Class
Next
Payload Length Hop Limit
Header

Source IP Address

Destination IP Address

Next Header (8 bits)


– Field is equivalent to the IPv4 Protocol
field.
– It indicates the data payload type that the
packet is carrying, enabling the network
layer to pass the data to the appropriate
upper-layer protocol.
– This field is also used if there are optional
extension headers added to the IPv6
packet.
Traffic
Version Flow Label
Class
Next
Payload Length Hop Limit
Header

Source IP Address

Destination IP Address

Hop Limit (8 bits)


– Field replaces the IPv4 TTL field.
– This value is decremented by one by each
router that forwards the packet.
– When the counter reaches 0 the packet is
discarded and an ICMPv6 message is
forwarded to the sending host, indicating
that the packet did not reach its
destination.
Traffic
Version Flow Label
Class
Next
Payload Length Hop Limit
Header

Source IP Address

Destination IP Address

Source Address (128 bits)


– Field identifies the IPv6
address of the sending host.
Traffic
Version Flow Label
Class
Next
Payload Length Hop Limit
Header

Source IP Address

Destination IP Address

Destination Address (128 bits)


– Field identifies the IPv6 address of
the receiving host.
Sample IPv6 Headers
Sample IPv6 Headers
Sample IPv6 Headers
IPv6 no more secure than IPv4

⚫ IPv6 natively supports authentication and privacy capabilities.


⚫ With IPv4, additional features had to be implemented to do this.
Routing
Host Can Send a Packet To Itself
⚫ The IP address 127.0.0.1 is a loopback interface that is automatically
assigned to a TCP/IP host.
 Any IP address within the network 127.0.0.0/8 refers to the local
host.
 Useful for testing purposes.
C:\Users\Admin> ping 127.0.0.1

Pinging 127.0.0.1 with 32 bytes of data:


Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128

Ping statistics for 127.0.0.1:


Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:\Users\Admin>

54
Host Can Send a Packet To a Local Host

⚫ Hosts on the same network, sending host and receiving host share the
same network address.

⚫ PC1 (192.168.10.10 /24) sends a packet to PC2 (192.168.10.11 /24)


 Since they are both on the same network (192.168.10.x /24) the
services of a default gateway are not required.

.10
PC1 192.168.10.0/24
.1
.11 G0/0
PC2

R1
.10 G0/1
PC3 .1

.11 192.168.11.0/24
PC4
55
Host Can Send a Packet To a Remote Host
▪ When a host on a remote network, the hosts do not share the same
network address.
 A default gateway IP address is required.

▪ PC1 (192.168.10.10 /24) sends a packet to PC4 (192.168.11.11 /24)


 Since they are on different networks (192.168.10.x /24 and
192.168.11.x /24) the services of a default gateway is required.

.10
PC1 192.168.10.0/24
.1
.11 G0/0
PC2

R1
.10 G0/1
PC3 .1

.11 192.168.11.0/24
PC4
56
Host Can Send a Packet To a Remote Host
⚫ The default gateway is the device (i.e, router) that routes traffic
from the local network to remote networks.
 A host sending a packet to a remote host does not maintain
routing information beyond the local network.
 The default gateway maintains a routing table containing directly
connected and remote network route information.

.10
PC1 192.168.10.0/24
.1
.11 G0/0
PC2

R1
.10 G0/1
PC3 .1

.11 192.168.11.0/24
PC4
57
Default Gateway

58
Configuring Default Gateway on Hosts
⚫ The default gateway address can be configured on the host
manually or learned dynamically.

59
Default Gateway – ipconfig

C:\Users\Admin>ipconfig

Windows IP Configuration

Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . : cisco.com


Link-local IPv6 Address . . . . . : fe80::b572:c6c:f983:cadc%11
IPv4 Address. . . . . . . . . . . : 192.168.11.99
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.11.1

C:\Users\Admin>

60
C:\Users\Admin> ipconfig /all
Windows IP Configuration

Host Name . . . . . . . . . . . . : Admin-wxp


Primary Dns Suffix . . . . . . . : cisco.com
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : cisco.com

Ethernet adapter Local Area Connection:


Connection-specific DNS Suffix . : cisco.com
Description . . . . . . . . . . . : Intel(R) PRO/1000 PL
Network Connection
Physical Address. . . . . . . . . : 00-16-41-E4-82-43
Dhcp Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IP Address. . . . . . . . . . . . : 192.168.11.99
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.11.1
DHCP Server . . . . . . . . . . . : 192.168.151.41
DNS Servers . . . . . . . . . . . : 10.0.0.36
10.0.0.16
<Output omitted>
C:\Users\Admin>
61
Host Packet Forwarding Decision

⚫ So how does a host keep track of whether or not to forward packets


to the default gateway?
⚫ Hosts must maintain their own, local, routing table to ensure that
network layer packets are directed to the correct destination
network.
62
Host Routing Table
C:\Users\PC1> netstat -r

<Output omitted>

IPv4 Route Table


===========================================================================
Active Routes:

⚫ The local table of the host typically contains:


 Direct connection - A route to the loopback interface
(127.0.0.1).
 Local network route - The host’s network IP address.
 Local default route - The default route which is the IP address
of the network interface of the router that is connected to the
local network.
⚫ The route print or netstat -r command can be used to
display the host routing table on a Windows host.
 Both commands generate the same output.
 The commands displays interface information, IPv4 route in
formation and IPv6 route information 63
Lists reachable networks

netstat IPv4 Information Lists a subnet mask used by the host to determine
the network / host portions of the IP address.

Lists the address to get to a remote network. A


directly reachable destination displays “On-link”.

Lists the address of the physical interface used to


send the packet to the gateway.
C:\Users\PC1> netstat -r
Lists the cost of each route and is used to
<Output omitted> determine the best route to a destination.

IPv4 Route Table


===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.10.1 192.168.10.10 25
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
192.168.10.0 255.255.255.0 On-link 192.168.10.10 281
192.168.10.10 255.255.255.255 On-link 192.168.10.10 281
192.168.10.255 255.255.255.255 On-link 192.168.10.10 281
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 192.168.10.10 281
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 192.168.10.10 281
===========================================================================

<Output omitted>

64
0.0.0.0
• This is the local default route.
• Forwards all non-matching packets.
• All non-matching destination routes are sent to 192.168.10.1
netstat IPv4 Information (R1) exiting from the interface with IP address 192.168.10.10.

127.0.0.0 – 127.255.255.255
•These loopback addresses all relate to the direct connection and
provide services to the local host.

192.168.10.0 - 192.168.10.255
• These addresses all relate to the host and local network.
• 192.168.10.0 - The local network route address.
C:\Users\PC1> netstat -r • 192.168.10.10 - The address of the local host.
• 192.168.10.255 - The network broadcast address.
<Output omitted>
224.0.0.0
IPv4 Route Table • Special multicast addresses reserved for use through either
the loopback interface or the host IP address.
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.10.1 192.168.10.10 25
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
192.168.10.0 255.255.255.0 On-link 192.168.10.10 281
192.168.10.10 255.255.255.255 On-link 192.168.10.10 281
192.168.10.255 255.255.255.255 On-link 192.168.10.10 281
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 192.168.10.10 281
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 192.168.10.10 281
===========================================================================
255.255.255.255
<Output omitted> • Limited broadcast IP address values for use through either the
loopback interface or the host IP address.

65
PC1 wants to ping PC2.
Which route will be chosen?

C:\Users\PC1> netstat -r

<Output omitted>

IPv4 Route Table


===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.10.1 192.168.10.10 25
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
192.168.10.0 255.255.255.0 On-link 192.168.10.10 281
192.168.10.10 255.255.255.255 On-link 192.168.10.10 281
192.168.10.255 255.255.255.255 On-link 192.168.10.10 281
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 192.168.10.10 281
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 192.168.10.10 281
===========================================================================

<Output omitted>

66
PC1 wants to ping 10.10.10.10.
Which route will be chosen?

C:\Users\PC1> netstat -r

<Output omitted>

IPv4 Route Table


===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.10.1 192.168.10.10 25
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
192.168.10.0 255.255.255.0 On-link 192.168.10.10 281
192.168.10.10 255.255.255.255 On-link 192.168.10.10 281
192.168.10.255 255.255.255.255 On-link 192.168.10.10 281
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 192.168.10.10 281
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 192.168.10.10 281
===========================================================================

<Output omitted>

67
netstat IPv6 Information

C:\Users\PC1> netstat -r
<Output omitted>
IPv6 Route Table
=====================================================
Active Routes:
If Metric Network Destination Gateway Lists the address of the physical
16 58 ::/0 On-link interface used to send the packet to
1 306 ::1/128 On-link the gateway.
16 58 2001::/32 On-link
16 306 2001:0:9d38:953c:2c30:3071:e718:a926/128 Lists the cost of each route and is
On-link used to determine the best route to a
15 281 fe80::/64 On-link destination.
16 306 fe80::/64 On-link
Lists reachable networks
16 306 fe80::2c30:3071:e718:a926/128
On-link Lists the address to get to a remote
15 281 fe80::b1ee:c4ae:a117:271f/128 network. A directly reachable
On-link destination displays “On-link”.
1 306 ff00::/8 On-link
16 306 ff00::/8 On-link
15 281 ff00::/8 On-link
=====================================================
<Output omitted>

68
netstat IPv6 Information

::/0
• This is the IPv6 equivalent of the local
default route.
C:\Users\PC1> netstat -r
<Output omitted> ::1/128
• This is equivalent to the IPv4 loopback
IPv6 Route Table
address and provides services to the local
===================================================== host.
Active Routes:
If Metric Network Destination Gateway 2001:: Global Unicast Addresses
16 58 ::/0 On-link •2001::/32 - This is the global unicast network
1 306 ::1/128 On-link prefix.
16 58 2001::/32 On-link ••2001:0:9d38:953c:2c30:3071:e718:a926/128
16 306 2001:0:9d38:953c:2c30:3071:e718:a926/128 - This is the global unicast IPv6 address of the
On-link local computer.
15 281 fe80::/64 On-link
fe80:: Link Local Addresses
16 306 fe80::/64 On-link
• fe80::/64 - This is the local link network
16 306 fe80::2c30:3071:e718:a926/128 route address and represents all computers
On-link on the local link IPv6 network.
15 281 fe80::b1ee:c4ae:a117:271f/128 • fe80::2c30:3071:e718:a926/128 - This is the
On-link link local IPv6 address of the local
1 306 ff00::/8 On-link computer.
16 306 ff00::/8 On-link
15 281 ff00::/8 On-link ff00::/8 Multicast Addresses
===================================================== • These are special reserved multicast class
<Output omitted> D addresses equivalent to the IPv4
224.x.x.x addresses.

69
Default Gateway on a Switch S1# show running-config
Building configuration...
!
<output omitted>
service password-encryption
!
hostname S1
!
Interface Vlan1
ip address 192.168.10.5
!
ip default-gateway 192.168.10.1
<output omitted>

.10
PC1 192.168.10.0/24 192.168.11.0/24
.1 .1
G0/0 G0/1 S2
S1 R1
.11 .5
PC2

⚫ A switch must (should) also be configured with a default gateway


address, because packets that originate from the switch are
handled just like packets that originate from a host device.
⚫ This is not used by normal user frames!
70
⚫ Use the ip default-gateway global config command.
Default Gateway on a Switch
⚫ For example, the administrator wants to Telnet to the S1.
 Without the default gateway configured on S1, packets from S1
would not be able to reach the administrator at 192.168.11.10.
S1# show running-config
Building configuration...
!
<output omitted>
service password-encryption
!
hostname S1
!
Interface Vlan1
ip address 192.168.10.5
!
ip default-gateway 192.168.10.1
<output omitted>

.10
PC1 192.168.10.0/24 192.168.11.0/24
.1 .1
G0/0 G0/1 S2
S1 R1
.11 .5
PC2

71
Router Routing Tables
Routers

⚫ A router is the main infrastructure device that makes forwarding


decisions on any network.
⚫ It’s goal is to forward a packet to its correct destination!
⚫ To do so, a router keeps track of local and remote networks.
⚫ This information is stored in a routing table.
73
Routing IP Packets

74
Routing IP Packets

75
Routing IP Packets

76
Router Operational Goal

⚫ Once a router receives a frame …


 De-capsulates the data link header.
 Examines the IP address to determine the destination network.
 Consults its routing tables to determine which of its interfaces it
will use to send the frame.
 It encapsulates the frame and forwards it.

77
Routing IP Packets

78
Routing IP Packets

79
Routing IP Packets

80
Routing IP Packets

81
Routing Table Routes

82
Routing Table
Routes

⚫ The routing table of a router stores information about:


 Directly-connected routes:
 These routes come from the active router interfaces. Routers
 Add a directly connected route when an interface is
configured with an IP address and is activated.
 Remote routes:
 These routes come from remote networks connected to other
routers.
 Routes to these networks can either be manually configured
or dynamically learned using a dynamic routing protocol. 83
Routers and the Network Layer

84
IPv4 Router Routing Table
192.168.10.0/24 10.1.1.0/24
.10 G0/0 .10
PC1 209.165.200.224 /30
.1 .1
.225 .226
R1 S0/0/0 R2
.10 .1 .1 .10
PC2 G0/1

192.168.11.0/24 10.1.2.0/24
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks


D 10.1.1.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
D 10.1.2.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
192.168.10.0/24 is variably subnetted, 2 subnets, 3 masks
C 192.168.10.0/24 is directly connected, GigabitEthernet0/0
L 192.168.10.1/32 is directly connected, GigabitEthernet0/0
192.168.11.0/24 is variably subnetted, 2 subnets, 3 masks
C 192.168.11.0/24 is directly connected, GigabitEthernet0/1
L 192.168.11.1/32 is directly connected, GigabitEthernet0/1
209.165.200.0/24 is variably subnetted, 2 subnets, 3 masks
C 209.165.200.224/30 is directly connected, Serial0/0/0
L 209.165.200.225/32 is directly connected, Serial0/0/0
R1# 85
Directly Connected Interfaces
192.168.10.0/24
.10 G0/0
PC1 209.165.200.224 /30
.1
.225
R1 S0/0/0
.10 .1
PC2 G0/1

192.168.11.0/24

⚫ Two routing table entries are automatically created when an active


router interface is configured with an IP address and subnet mask.
 C:
 Identifies a directly connected network.
 Directly connected networks are automatically created when
an interface is configured with an IP address and activated.
 L:
 Identifies that this is a local route, the IP address of the
interface.
 Local routes are automatically created when an interface is
configured with an IP address and activated. 86
Directly Connected Routing Table Entries
192.168.10.0/24 64.100.0.1 10.1.1.0/24
.10 G0/0 .10
PC1 209.165.200.224 /30
.1 .1
.225 .226
R1 S0/0/0 R2
.10 .1 .1 .10
PC2 G0/1

192.168.11.0/24 10.1.2.0/24

A B C
C 192.168.10.0/24 is directly connected, GigabitEthernet0/0
L 192.168.10.1/32 is directly connected, GigabitEthernet0/0

A Identifies how the network was learned by the router.


B Identifies the destination network and how it is connected.
C Identifies the interface on the router connected to the destination network.

87
Remote Network Routing Table Entries
192.168.10.0/24 64.100.0.1 10.1.1.0/24
.10 G0/0 .10
PC1 209.165.200.224 /30
.1 .1
.225 .226
R1 S0/0/0 R2
.10 .1 .1 .10
PC2 G0/1

192.168.11.0/24 10.1.2.0/24

D 10.1.1.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0

A Identifies how the network was learned by the router.


B Identifies the destination network.
C Identifies the administrative distance (trustworthiness) of the route source.
D Identifies the metric to reach the remote network.
E Identifies the next hop IP address to reach the remote network.
F Identifies the amount of elapsed time since the network was discovered.
G Identifies the outgoing interface on the router to reach the destination network.

88
Destination Network
192.168.10.0/24 10.1.1.0/24
.10 G0/0 .10
PC1 209.165.200.224 /30
.1 .1
.225 .226
R1 S0/0/0 R2
.10 .1 .1 .10
PC2 G0/1

192.168.11.0/24 10.1.2.0/24
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks


D 10.1.1.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
D 10.1.2.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
192.168.10.0/24 is variably subnetted, 2 subnets, 3 masks
C 192.168.10.0/24 is directly connected, GigabitEthernet0/0
L 192.168.10.1/32 is directly connected, GigabitEthernet0/0
192.168.11.0/24 is variably subnetted, 2 subnets, 3 masks
C 192.168.11.0/24 is directly connected, GigabitEthernet0/1
L 192.168.11.1/32 is directly connected, GigabitEthernet0/1
209.165.200.0/24 is variably subnetted, 2 subnets, 3 masks
C 209.165.200.224/30 is directly connected, Serial0/0/0
L 209.165.200.225/32 is directly connected, Serial0/0/0
R1# 89
Next-Hop Address
192.168.10.0/24 10.1.1.0/24
.10 G0/0 .10
PC1 209.165.200.224 /30
.1 .1
.225 .226
R1 S0/0/0 R2
.10 .1 .1 .10
PC2 G0/1

192.168.11.0/24 10.1.2.0/24
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks


D 10.1.1.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
D 10.1.2.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
192.168.10.0/24 is variably subnetted, 2 subnets, 3 masks
C 192.168.10.0/24 is directly connected, GigabitEthernet0/0
L 192.168.10.1/32 is directly connected, GigabitEthernet0/0
192.168.11.0/24 is variably subnetted, 2 subnets, 3 masks
C 192.168.11.0/24 is directly connected, GigabitEthernet0/1
L 192.168.11.1/32 is directly connected, GigabitEthernet0/1
209.165.200.0/24 is variably subnetted, 2 subnets, 3 masks
C 209.165.200.224/30 is directly connected, Serial0/0/0
L 209.165.200.225/32 is directly connected, Serial0/0/0
R1# 90
PC1 wants to ping another
host on the same network
Which Route?
192.168.10.0/24 64.100.0.1 10.1.1.0/24
.10 G0/0 .10
PC1 209.165.200.224 /30
.1 .1
.225 .226
R1 S0/0/0 R2
.10 .1 .1 .10
PC2 G0/1

192.168.11.0/24 10.1.2.0/24
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks


D 10.1.1.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
D 10.1.2.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
192.168.10.0/24 is variably subnetted, 2 subnets, 3 masks
C 192.168.10.0/24 is directly connected, GigabitEthernet0/0
L 192.168.10.1/32 is directly connected, GigabitEthernet0/0
192.168.11.0/24 is variably subnetted, 2 subnets, 3 masks
C 192.168.11.0/24 is directly connected, GigabitEthernet0/1
L 192.168.11.1/32 is directly connected, GigabitEthernet0/1
209.165.200.0/24 is variably subnetted, 2 subnets, 3 masks
C 209.165.200.224/30 is directly connected, Serial0/0/0
L 209.165.200.225/32 is directly connected, Serial0/0/0
R1# 91
PC1 wants to ping PC2

Which Route?
192.168.10.0/24 64.100.0.1 10.1.1.0/24
.10 G0/0 .10
PC1 209.165.200.224 /30
.1 .1
.225 .226
R1 S0/0/0 R2
.10 .1 .1 .10
PC2 G0/1

192.168.11.0/24 10.1.2.0/24
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks


D 10.1.1.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
D 10.1.2.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
192.168.10.0/24 is variably subnetted, 2 subnets, 3 masks
C 192.168.10.0/24 is directly connected, GigabitEthernet0/0
L 192.168.10.1/32 is directly connected, GigabitEthernet0/0
192.168.11.0/24 is variably subnetted, 2 subnets, 3 masks
C 192.168.11.0/24 is directly connected, GigabitEthernet0/1
L 192.168.11.1/32 is directly connected, GigabitEthernet0/1
209.165.200.0/24 is variably subnetted, 2 subnets, 3 masks
C 209.165.200.224/30 is directly connected, Serial0/0/0
L 209.165.200.225/32 is directly connected, Serial0/0/0
R1# 92
PC1 wants to ping the R2
WAN Interface
Which Route?
192.168.10.0/24 64.100.0.1 10.1.1.0/24
.10 G0/0 .10
PC1 209.165.200.224 /30
.1 .1
.225 .226
R1 S0/0/0 R2
.10 .1 .1 .10
PC2 G0/1

192.168.11.0/24 10.1.2.0/24
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks


D 10.1.1.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
D 10.1.2.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
192.168.10.0/24 is variably subnetted, 2 subnets, 3 masks
C 192.168.10.0/24 is directly connected, GigabitEthernet0/0
L 192.168.10.1/32 is directly connected, GigabitEthernet0/0
192.168.11.0/24 is variably subnetted, 2 subnets, 3 masks
C 192.168.11.0/24 is directly connected, GigabitEthernet0/1
L 192.168.11.1/32 is directly connected, GigabitEthernet0/1
209.165.200.0/24 is variably subnetted, 2 subnets, 3 masks
C 209.165.200.224/30 is directly connected, Serial0/0/0
L 209.165.200.225/32 is directly connected, Serial0/0/0
R1# 93
PC1 wants to ping
10.1.1.10
Which Route?
192.168.10.0/24 64.100.0.1 10.1.1.0/24
.10 G0/0 .10
PC1 209.165.200.224 /30
.1 .1
.225 .226
R1 S0/0/0 R2
.10 .1 .1 .10
PC2 G0/1

192.168.11.0/24 10.1.2.0/24
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks


D 10.1.1.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
D 10.1.2.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
192.168.10.0/24 is variably subnetted, 2 subnets, 3 masks
C 192.168.10.0/24 is directly connected, GigabitEthernet0/0
L 192.168.10.1/32 is directly connected, GigabitEthernet0/0
192.168.11.0/24 is variably subnetted, 2 subnets, 3 masks
C 192.168.11.0/24 is directly connected, GigabitEthernet0/1
L 192.168.11.1/32 is directly connected, GigabitEthernet0/1
209.165.200.0/24 is variably subnetted, 2 subnets, 3 masks
C 209.165.200.224/30 is directly connected, Serial0/0/0
L 209.165.200.225/32 is directly connected, Serial0/0/0
R1# 94
Routers
Types of Routers Cisco Routers

Branch Routers
• Designed for teleworkers, small business, and
medium-size branch sites.
• Includes Cisco 800, 1900, 2900, and 3900
Integrated Series Routers (ISR) G2.
Cisco 2901

WAN Routers
• Large businesses, organizations, and
enterprises.
• Includes the Cisco Aggregation Service
7200 Series Router Router (ASR) 1000, 7200 Series Router, and
the Cisco Catalyst 6500 Series Switches.

Service Provider Routers • Large service providers.


• Includes Cisco CRS-3 Carrier Routing
CRS-1 Multishelf System System, Cisco ASR 9000, Cisco ASR 1000,
Cisco XR 12000, and 7600 Series routers
• CRS-3 support s bandwidths of up to 322
Tb/s.

96
How Fast is 322 Tb/s?

97
Router Components

⚫ Regardless of their function, size or complexity, all router models are


essentially computers and require:
 Operating systems (OS)
 Central processing units (CPU)
 Random-access memory (RAM)
 Read-only memory (ROM)

⚫ Routers also have special memory that includes Flash and


nonvolatile random-access memory (NVRAM).

98
Router Memory

Volatile /
Memory Stores
Non-Volatile

RAM • Running IOS


• Running configuration file
Volatile
(Random Access • IP routing and ARP tables
Memory)
• Packet buffer

ROM • Bootup instructions


(Read-Only Non-Volatile • Basic diagnostic software
Memory)
• Limited IOS

NVRAM
Non-Volatile • Startup configuration file
(Non-Volatile RAM )

• IOS
Flash Non-Volatile
• Other system files

99
Router Front

System Power LED System Activity LED


Solid green indicates the Blinks when packets are transmitted or
presence of power. received on any WAN or LAN interface. 100
Router Backplane

4-port EtherSwitch HWIC 2 port Smart Serial HWIC


High-speed WAN Interface Card

Compact Flash Module Integrated ports


Stores Cisco IOS Console, Auxiliary, and FastEthernet
101
Router Backplane

Double-wide eHWIC slots eHWIC 0 AUX LAN


port interfaces

⚫ The backplane of a router includes:

Console
RJ45 USB
Ports
Two 4 GB flash card slots Console
USB Type B

102
Connecting to a Router

AUX LAN
Double-wide eHWIC slots eHWIC 0 port interfaces

⚫ Cisco router ports can be grouped into two categories:


 Management ports – Includes console and auxiliary ports used
to configure, manage, and troubleshoot the router.
 Inband Router interfaces – Includes LAN and WAN interfaces
configured with IP addressing to carry user traffic.
Console
RJ45
Console
USB Type B 103
Console and Ethernet Connections

104
Console Port

105
Auxiliary Ports

106
Router Interfaces
⚫ A router interface is a physical connector that enables a router to
send or receive packets
 Each interface connects to a separate network
 Consist of socket or jack found on the outside of a router

⚫ Types of router interfaces:


 Ethernet
 FastEthernet
 Gigabit Ethernet
 Serial
 DSL
 Cable
 ISDN

107
LAN and WAN Interfaces
⚫ Router interfaces can be grouped into two categories:
 Ethernet LAN interfaces: Requires an IP address and enabled.
 Serial WAN interfaces – Requires an IP address and enabled.

Serial interfaces

LAN interfaces 108


Router Bootup
Cisco IOS

⚫ The IOS file itself is several megabytes in size and similar to Cisco
IOS switches, is stored in flash memory.
 IOS stored in Flash can be upgraded to newer versions or to
have new features added.
⚫ During bootup, the IOS is copied from slower flash memory into
faster RAM (DRAM).
110
Bootset Files
⚫ During bootup, the router loads two files into RAM:
 IOS: Copied from flash into RAM.
 Startup configuration: Copied from NVRAM into RAM.

111
Router Bootup Process
1. Both POST and the
Bootstrap program are
located in ROM.

1. Load IOS from Flash.


2. None in Flash, then
load from TFTP server.

1. Load from NVRAM.


2. None in NVRAM, then
load from TFTP server.
3. No Server/file, then
enter Setup mode from
the console.

112
Configuring a Cisco Router
Remember …

⚫ As a packet travels from one networking device to another


 The Source and Destination IP addresses NEVER change
 The Source & Destination MAC addresses CHANGE as
packet is forwarded from one router to the next.
 TTL field decrement by one until a value of zero is reached at
which point router discards packet (prevents packets from
endlessly traversing the network)
114
A Day in the Life of a Packet

115
A Day in the Life of a Packet

116
A Day in the Life of a Packet

117
A Day in the Life of a Packet

118
A Day in the Life of a Packet

119
A Day in the Life of a Packet

120
A Day in the Life of a Packet

121
A Day in the Life of a Packet

122
A Day in the Life of a Packet

123
A Day in the Life of a Packet

124
A Day in the Life of a Packet

125
A Day in the Life of a Packet

126
A Day in the Life of a Packet

127
A Day in the Life of a Packet

128
A Day in the Life of a Packet

129
A Day in the Life of a Packet

130

You might also like