440 likes | 544 Views
Lecture 6 Network Layer. Objectives: Explain how network layer protocols and services support communications across data networks. Explain how routers enable end-to-end connectivity in a small to medium-sized business network.
E N D
Lecture 6Network Layer Objectives: • Explain how network layer protocols and services support communications across data networks. • Explain how routers enable end-to-end connectivity in a small to medium-sized business network. • Determine the appropriate device to route traffic in a small to medium-sized business network. • Configure a router with basic configurations.
encapsulation decapsulation Network Layer in CommunicationEnd to End Transport Processes
Network Layer in CommunicationEnd to End Transport Processes • Addressing - each device must have a unique address • Encapsulation • Network layer receives the Transport layer segment and adds a Network header (becomes a packet) • the Network header contains a source address, destination address and other control information • the packet is sent down to the Data Link layer • Routing - intermediary devices, called routers, are used to route packets toward the destination • De-encapsulation • the destination host examines the destination address to verify that the packet was addressed to this device • the packet is de-capsulated by the Network layer and the Transport layer segment contained in the packet is passed up to the appropriate service at the Transport layer
Network Layer in CommunicationNetwork 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)
IPv4Hierarchical IPv4 Address • The logical 32-bit IPv4 address is hierarchical and is made up of two parts • the first part identifies the network • the second part identifies a host on that network • IPv4 address are divided into four groups of 8 bits • each group of one octet is converted into its decimal value • complete address is written as four decimal values separated by dots
IPv4 PacketIPv4 Packet Header Byte 1 Byte 2 Byte 3 Byte 4
IPv4 PacketIPv4 Header Fields • Version - contains the IP version number (4) • Header Length (IHL) - Specifies the size of the packet header in 4 byte words (the minimum size is 5, meaning 5*4 = 20 bytes) • Type of service - used to assign a priority to each packet • Time to Live (TTL) - this value is decremented at each hop to prevent packets being passed around the network in routing loops • Source address - represents the packet source Network layer host address • Destination address - represents the packet destination Network layer host address • Fragment offset - when fragmentation occurs, the packet uses this field with the MF (more fragment) flag to reconstruct the packet at the destination • Protocol - indicates the data payload type that the packet is carrying example values (decimal) are: 1- ICMP, 6-TCP, 17-UDP
Network Layer in CommunicationLimitations of IPv4 • IPv4 has theoretical maximum of 4.3 billion addresses plus private addresses in combination with NAT • NAT provides a way for multiple devices to share a single public IP address. However, because the public IP address is shared, the IP address of an internal network host is hidden, leading to problems for technologies that require end-to-end connectivity • Increased number of servers connected to the Internet increases the number of network routes to be stored in routing tables • Projections show that all five RIRs will run out of IPv4 addresses between 2015 and 2020
Network Layer in CommunicationIntroducing IPv6 • Increased address space • 128-bit hierarchical addressing is used • Improved packet handling • header simplified with fewer fields • Eliminates the need for NAT • a large number of public IPv6 addresses available • Integrated security • Authentication and privacy supported
IPv6 PacketIPv6 Packet Header Byte 1 Byte 2 Byte 3 Byte 4
RoutingDefault Gateway on a Host • Both the host IP address and the gateway address must have the same network (and subnet) portion of the address
RoutingDefault Gateway on a Host • The IP address of the default gateway on a host can be displayed by using ipconfig or routeat the command line of a Windows computer
RoutingDefault Gateway on a Host .10 .11 .10 .10 PC2 PC1 PC2 PC1 • To send a packet within the local network, just send to the host via the local switch directly. • To send a packet out of the local network, send to the gateway. .10 .10 PC3 PC3 .11 .10 PC4 PC4 192.168.10.0/24 192.168.10.0/24 .1 G0/0 .1 G0/0 R1 R1 G0/1 .1 G0/1 .1 192.168.11.0/24 192.168.11.0/24
RoutingHost Routing Tables C:\>route print
RoutingHost Routing Tables Hosts must maintain their own, local, routing table to ensure that network layer packets are directed to the correct destination network. The local table of the host typically contains: • Direct connection • A route to the loopback interface (127.0.0.1) • Local network route • The network which the host is connected to • Local default route • The route at packets must take to reach all remote network addresses (created when a default gateway address is present) R
RoutingRouter Routing Tables • Destination network • a route in the routing table • Metric • if there are two or more possible routes to the destination, the metric is used to decide which route appears on the routing table • Next-hop • the packet is forwarded to the next-hop router • Exit interface • the packet is forwarded out of the interface (directly connected networks have no next-hop address) • Default route • the default route is used to forward the packet when the destination network is not represented by any other route in the routing table
Router Routing TablesIPv4 Router Routing Table 192.168.10.0/24 10.1.1.0/24 .10 .10 G0/0 .1 209.165.200.224 /30 PC1 .1 .226 .225 S0/0/0 R1 R2 .1 G0/1 .1 .10 .10 PC2 10.1.2.0/24 192.168.11.0/24 R1#show ip route Codes: <omitted . . .> 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
Router Routing TablesDirectly Connected Routing Table Entries 192.168.10.0/24 10.1.1.0/24 64.100.0.1 .10 .10 G0/0 .1 209.165.200.224 /30 PC1 .1 .226 .225 S0/0/0 R1 R2 .1 G0/1 .1 .10 .10 PC2 10.1.2.0/24 192.168.11.0/24 A C B C 192.168.10.0/24 is directly connected, GigabitEthernet0/0 L 192.168.10.1/32 is directly connected, GigabitEthernet0/0
Router Routing TablesRemote Network Routing Table Entries 192.168.10.0/24 10.1.1.0/24 64.100.0.1 .10 .10 G0/0 .1 209.165.200.224 /30 PC1 .1 .226 .225 S0/0/0 R1 R2 .1 G0/1 .1 .10 .10 PC2 10.1.2.0/24 192.168.11.0/24 D 10.1.1.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
Router Routing TablesNext-Hop Address 192.168.10.0/24 10.1.1.0/24 64.100.0.1 .10 .10 G0/0 .1 209.165.200.224 /30 PC1 .1 .226 .225 S0/0/0 R1 R2 .1 G0/1 .1 .10 .10 PC2 10.1.2.0/24 192.168.11.0/24 R1#show ip route Codes: <omitted . . .> 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
Router Routing TablesStatic Routes • Routes to remote networks with associated next hops that are configured manually by an administrator • requires manual updating when the internetwork structure changes • router must be configured with static routes to next hop that reflect its location in the internetwork
Router Routing TablesDynamic Routes • Routers use routing protocols to dynamically share their routing information • Allows the network to adjust to changes in the topology automatically
Animation • 6111 Network layer • 6431 Default gateway Activity • 6126 Connectionless/best effort/media independent • 6134 IPv4 • 6146 IPv6 • 6217 Host routing table • 6227 Router routing table
Introduction to Networks Chapter 6: Network Layer Further Exploration …
Router Boot-upRouter Bootup Process Perform the POST and load the bootstrap program Locate and load the Cisco IOS software Locate and load the startup configuration file or enter setup mode System Bootstrap, Version 15.0(1r)M15, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport <output omitted>
Configure Initial SettingsRouter Configuration Steps 192.168.10.0/24 10.1.1.0/24 .10 .10 G0/0 .1 209.165.200.224 /30 PC1 .1 .226 .225 S0/0/0 R1 R2 .1 G0/1 .1 .10 .10 PC2 10.1.2.0/24 192.168.11.0/24 Router> en Router# conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)# ho R1 R2(config)# Router> enable Router# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)# hostname R1 R1(config)# OR R1(config)# enable secret class R1(config)# R1(config)# line console 0 R1(config-line)# password cisco R1(config-line)# login R1(config-line)# exit R1(config)# R1(config)# line vty 0 4 R1(config-line)# password cisco R1(config-line)# login R1(config-line)# exit R1(config)# R1(config)# service password-encryption R1(config)# R1(config)# banner motd # Enter TEXT message. End with the character '#'. *********************************************** WARNING: Unauthorized access is prohibited! *********************************************** # R1(config)# R1# copy running-config startup-config Destination filename [startup-config]? Building configuration... [OK] R1#
Configure InterfacesConfigure LAN Interfaces 192.168.10.0/24 10.1.1.0/24 .10 .10 G0/0 .1 209.165.200.224 /30 PC1 .1 .226 .225 S0/0/0 R1 R2 .1 G0/1 .1 .10 .10 PC2 10.1.2.0/24 192.168.11.0/24 R1# conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)# R1(config)# interface gigabitethernet 0/0 R1(config-if)# ip address 192.168.10.1 255.255.255.0 R1(config-if)# description Link to LAN-10 R1(config-if)# no shutdown %LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up R1(config-if)# exit R1(config)# R1(config)# int g0/1 R1(config-if)# ip add 192.168.11.1 255.255.255.0 R1(config-if)# des Link to LAN-11 R1(config-if)# no shut %LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up R1(config-if)# exit R1(config)#
Configure InterfacesVerify Interface Configuration 192.168.10.0/24 10.1.1.0/24 .10 .10 G0/0 .1 209.165.200.224 /30 PC1 .1 .226 .225 S0/0/0 R1 R2 .1 G0/1 .1 .10 .10 PC2 10.1.2.0/24 192.168.11.0/24 R1# show ip interface brief Interface IP-Address OK? Method Status Protocol GigabitEthernet0/0 192.168.10.1 YES manual up up GigabitEthernet0/1 192.168.11.1 YES manual up up Serial0/0/0 209.165.200.225 YES manual up up Serial0/0/1 unassigned YES NVRAM administratively down down Vlan1 unassigned YES NVRAM administratively down down R1# R1# ping 209.165.200.226 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 209.165.200.226, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/9 ms R1#