10CCN_NetworkLayer_Routing
10CCN_NetworkLayer_Routing
Rick Graziani
Cabrillo College
[email protected]
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
C:\Users\Admin>
3
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
4
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
5
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
6
Default Gateway
7
Configuring Default Gateway on Hosts
The default gateway address can be configured on the host
manually or learned dynamically.
8
Default Gateway – ipconfig
C:\Users\Admin>ipconfig
Windows IP Configuration
C:\Users\Admin>
9
C:\Users\Admin> ipconfig /all
Windows IP Configuration
<Output omitted>
<Output omitted>
13
0.0.0.0
• This is the local default route.
• Forwards all non-matching packets.
netstat IPv4 Information • All non-matching destination routes are sent to 192.168.10.1
(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.
14
PC1 wants to ping PC2.
Which route will be chosen?
C:\Users\PC1> netstat -r
<Output omitted>
<Output omitted>
15
PC1 wants to ping 10.10.10.10.
Which route will be chosen?
C:\Users\PC1> netstat -r
<Output omitted>
<Output omitted>
16
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
S1 G0/0 G0/1 S2
.11 R1
PC2 .5
18
Router Routing Tables
Routers
21
Routing IP Packets
22
Routing IP Packets
23
Router Operational Goal
24
Routing IP Packets
25
Routing IP Packets
26
Routing IP Packets
27
Routing IP Packets
28
Routing Table Routes
29
Routing Table
Routes
31
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
34
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
35
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
42
A Day in the Life of a Packet
43
A Day in the Life of a Packet
44
A Day in the Life of a Packet
45
A Day in the Life of a Packet
46
A Day in the Life of a Packet
47
A Day in the Life of a Packet
48
A Day in the Life of a Packet
49
A Day in the Life of a Packet
50
A Day in the Life of a Packet
51
A Day in the Life of a Packet
52
A Day in the Life of a Packet
53
A Day in the Life of a Packet
54
A Day in the Life of a Packet
55
A Day in the Life of a Packet
56
A Day in the Life of a Packet
57