10CCN_NetworkLayer_Updated
10CCN_NetworkLayer_Updated
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
3
Encapsulation
DATA
SEGMENT DATA
S.P / D.P. / S.N. / Ack # / …
DATA (SEGMENT)
PACKET
IPv / HLEN / Flag / S. IP / D. IP / …
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
⚫ 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 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
⚫ 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
Source IP Address
Destination IP Address
Options (optional)
Padding
IPv4 Header – Validation Fields
Source IP Address
Destination IP Address
Source IP Address
Destination IP Address
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
IP Header Differentiated Services
Version Total Length
Length
DSCP ECN
Source IP Address
Destination IP Address
Source IP Address
Destination IP Address
Source IP Address
Destination IP Address
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
Source IP Address
Destination IP Address
Source IP Address
Destination IP Address
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
Source IP Address
Destination IP Address
Source IP Address
Destination IP Address
Source IP Address
Destination IP Address
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
Source IP Address
Destination IP Address
Source IP Address
Destination IP Address
Source IP Address
Destination IP Address
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
Source IP Address
Destination IP Address
Source IP Address
Destination IP Address
Source IP Address
Destination IP Address
Source IP Address
Destination IP Address
Source IP Address
Destination IP Address
Source IP Address
Destination IP Address
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.
.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.
.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
C:\Users\Admin>
60
C:\Users\Admin> ipconfig /all
Windows IP Configuration
<Output omitted>
netstat IPv4 Information Lists a subnet mask used by the host to determine
the network / host portions of the IP address.
<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>
<Output omitted>
66
PC1 wants to ping 10.10.10.10.
Which route will be chosen?
C:\Users\PC1> netstat -r
<Output omitted>
<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
.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
74
Routing IP Packets
75
Routing IP Packets
76
Router Operational Goal
77
Routing IP Packets
78
Routing IP Packets
79
Routing IP Packets
80
Routing IP Packets
81
Routing Table Routes
82
Routing Table
Routes
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
192.168.11.0/24
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
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
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
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
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
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
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
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
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.
96
How Fast is 322 Tb/s?
97
Router Components
98
Router Memory
Volatile /
Memory Stores
Non-Volatile
NVRAM
Non-Volatile • Startup configuration file
(Non-Volatile RAM )
• IOS
Flash Non-Volatile
• Other system files
99
Router Front
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
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
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
⚫ 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.
112
Configuring a Cisco Router
Remember …
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