Chapter 5 - OSI Network Layer
CCNA Exploration version 4.0CCNA Exploration version 4.0
Overview
• Identify the role of the Network Layer, as it describes communication from one end device to another end device
• Examine the most common Network Layer protocol, Internet Protocol (IP), and its features for providing connectionless and best-effort service
• Understand the principles used to guide the division or grouping of devices into networks
Học viện mạng Bách khoa - Website: www.bkacad.com 2
of devices into networks• Understand the hierarchical addressing of devices and how this
allows communication between networks• Understand the fundamentals of routes, next hop addresses and
packet forwarding to a destination network
Network Layer Protocols and Internet Protocol (IP)
Học viện mạng Bách khoa - Website: www.bkacad.com 3
• Define the basic role of the Network Layer in data networks• The protocols of the OSI model Network layer specify addressing and
processes that enable Transport layer data to be packaged and transported. The Network layer encapsulation allows its contents to be passed to the destination within a network or on another network with minimum overhead.
Network Layer – Communication from Host to Host
• Layer 3 uses four basic processes:1. Addressing2. Encapsulation3. Routing : Intermediary devices that connect the networks are called
routers. The role of the router is to select paths for and direct packets toward their destination. This process is known as routing.
4. Decapsulation
Học viện mạng Bách khoa - Website: www.bkacad.com 4
( Refer to 5.1.1 )
Network Layer Protocols
• Protocols implemented at the Network layer that carry user data include:– Internet Protocol version 4 (IPv4) *– Internet Protocol version 6 (IPv6) *
Học viện mạng Bách khoa - Website: www.bkacad.com 5
– Novell Internetwork Packet Exchange (IPX).– AppleTalk.– Connectionless Network Service (CLNS/DECNet).
The roles of IPv4 protocol
• IPv4 is currently the most widely-used version of IP• The Internet Protocol was designed as a protocol with low
overhead. It provides only the functions that are necessary to deliver a packet from a source to a destination over an interconnected system of networks.
• The protocol was not designed to track and manage the flow of packets. These functions are performed by other protocols in
Học viện mạng Bách khoa - Website: www.bkacad.com 6
packets. These functions are performed by other protocols in other layers.
• IPv4 basic characteristic– Connectionless.– Best-effort.– Media Independent.
The IPv4 protocol – Connectionless
• Describe the implications for the use of the IP protocol as it is connectionless.
Học viện mạng Bách khoa - Website: www.bkacad.com 7
The IPv4 protocol – Best Effort
• Describe the implications for the use of the IP protocol as it is considered an unreliable protocol
• Unreliable means simply that IP does not have the capability to manage, and
Học viện mạng Bách khoa - Website: www.bkacad.com 8
capability to manage, and recover from, undelivered or corrupt packets.
• Since protocols at other layers can manage reliability, IP is allowed to function very efficiently at the Network layer.
The IPv4 protocol – Media independent
• Describe the implications for the use of the IP as it is media independent
• One major characteristic of the media that the Network layer considers: the maximum size of PDU that each medium can
Học viện mạng Bách khoa - Website: www.bkacad.com 9
PDU that each medium can transport. This characteristic is referred to as the Maximum Transmission Unit (MTU). Part of the control communication between the Data Link layer and the Network layer is the establishment of a maximum size for the packet.
IPv4 packet – Packaging the Transport layer PD
• In some cases, an intermediary device - usually a router - will 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.
Học viện mạng Bách khoa - Website: www.bkacad.com 10
IPv4 packet header
• Identify the major header fields in the IPv4 protocol and describe each field's role in transporting packets
Học viện mạng Bách khoa - Website: www.bkacad.com 11
Network Layer Fields
Học viện mạng Bách khoa - Website: www.bkacad.com 12
• 4 bits• Indicates version of IP used• IPv4: 0100; IPv6: 0110
Network Layer Fields
Học viện mạng Bách khoa - Website: www.bkacad.com 13
• 4 bits
• Indicates datagram header length in 32 bit words
Network Layer Fields
Học viện mạng Bách khoa - Website: www.bkacad.com 14
• 8 bits
• Specifies the level of importance that has been assigned by upper-layer protocol
Network Layer Fields
Học viện mạng Bách khoa - Website: www.bkacad.com 15
• 16 bits
• Specifies the length of the entire packet in bytes, including data and header
Network Layer Fields
Học viện mạng Bách khoa - Website: www.bkacad.com 16
• 16 bits• Identifies the current datagram
Network Layer Fields
Học viện mạng Bách khoa - Website: www.bkacad.com 17
• 3 bits(R, DF. MF)
– R(reserved): set to 0.
– DF(Don’t fragment):
• 0: Fragment if necessary.
• 1: Do not fragment.
– MF(More fragment):
• 0: This is the last fragment.
• 1: More fragment follow this fragment.
Network Layer Fields
Học viện mạng Bách khoa - Website: www.bkacad.com 18
• 13 bits
• Used to help piece together datagram fragments
Network Layer Fields
Học viện mạng Bách khoa - Website: www.bkacad.com 19
• 8 bits
• Specifies the number of hops a packet may travel. T his number is decreased by one as the packet travels th rough a router
Network Layer Fields
Học viện mạng Bách khoa - Website: www.bkacad.com 20
• 8 bits
• Indicates which upper-layer protocol, such as TCP(6 ) or UDP(17), receives incoming packets after IP process ing has been completed
Network Layer Fields
Học viện mạng Bách khoa - Website: www.bkacad.com 21
• 16 bits• Helps ensure IP header integrity• Not caculated for the encapsulation data
Network Layer Fields
Học viện mạng Bách khoa - Website: www.bkacad.com 22
• 32 bits• Specifies the sending node IP address
Network Layer Fields
Học viện mạng Bách khoa - Website: www.bkacad.com 23
• 32 bits• Specifies the receiving node IP address
Network Layer Fields
Học viện mạng Bách khoa - Website: www.bkacad.com 24
• Variable length
• Allows IP to support various options, such as secur ity
Network Layer Fields
Học viện mạng Bách khoa - Website: www.bkacad.com 25
• Variable length• Extra zeros are added to this field to ensure that t he
IP header is always a multiple of 32 bits.
Network Layer Fields
Học viện mạng Bách khoa - Website: www.bkacad.com 26
• Variable length up to 64 Kb • Contains upper-layer information
Grouping Devices into Networks
• Reasons for grouping devices into sub-networks and define several terms used to identify the sub-networks– Geographic
Học viện mạng Bách khoa - Website: www.bkacad.com 27
• Reasons for grouping devices into sub-networks and define several terms used to identify the sub-networks– Purpose
Grouping Devices into Networks
Học viện mạng Bách khoa - Website: www.bkacad.com 28
• List several different reasons for grouping devices into sub-networks and define several terms used to identify the sub-networks– Ownership
Grouping Devices into Networks
Học viện mạng Bách khoa - Website: www.bkacad.com 29
• Reasons for grouping devices into sub-networks and define several terms used to identify the sub-networks– Ownership
Grouping Devices into Networks
Học viện mạng Bách khoa - Website: www.bkacad.com 30
Broadcast domain ? - Performance
• A broadcast is a message sent from one host to all other hosts on the network.
• Managing the size of broadcast domains by dividing a network into subnets or replace switch by router.
Học viện mạng Bách khoa - Website: www.bkacad.com 31
Why separate hosts into networks ? - Security
• List several ways in which dividing a large network can increase network security
Học viện mạng Bách khoa - Website: www.bkacad.com 32
Grouping Devices into Networks
• Explain the communication problems that emerge when very large numbers of devices are included in one large network.
Học viện mạng Bách khoa - Website: www.bkacad.com 33
Hierarchical Addressing
• Hierarchical addressing solves the problem of devices communicating across networks of networks.
Học viện mạng Bách khoa - Website: www.bkacad.com 34
Hierarchical Addressing
• Router only need to know network portion(network address) to indicate the best path to reach the network.
Học viện mạng Bách khoa - Website: www.bkacad.com 35
Routing Protocols
• Routing is an OSI Layer 3
function. It is a hierarchical
scheme and allows individual
addresses to be group
together.
Học viện mạng Bách khoa - Website: www.bkacad.com 36
together.
• Routing is the process of
finding the most efficient path
from one device to another.
Routing Metrics
Học viện mạng Bách khoa - Website: www.bkacad.com 37
• Two key functions of a router:– Maintain routing tables and make sure other routers know of changes in
the network topology. – Use the routing table to determine where to send them
• Routing metrics are values used in determining the advantage of one route over another. They use various combinations of metrics for determining the best path for data.
Routing vs Switching
• Switching occurs at
Layer 2, routing
occurs at Layer 3.
• Routing and switching
Học viện mạng Bách khoa - Website: www.bkacad.com 38
• Routing and switching
use different
information in the
process of moving
data from source to
destination.
Routing and Layer 2 Switching
Học viện mạng Bách khoa - Website: www.bkacad.com 39
Router and Switch
Học viện mạng Bách khoa - Website: www.bkacad.com 40
• Each computer and router interface maintains an ARP table for Layer 2 communication. The ARP table is only effective for the broadcast domain (or LAN) that it is connected to
• MAC addresses are not logically organized, but IP addresses are organized in a hierarchical manner.
Routed versus Routing
Học viện mạng Bách khoa - Website: www.bkacad.com 41
• Routed protocol : used at the network layer that transfer data from one hostto another across a router.
• Routing protocols : allow routers to choose the best path for data from source to destination
Examples: Internet Protocol (IP); Novell's Internetwork Packet Exchange (IPX); DECnet, AppleTalk, Banyan VINES, and Xerox Network Systems (XNS).
Routing protocol
Học viện mạng Bách khoa - Website: www.bkacad.com 42
• Provides processes for sharing route information. • Allows routers to communicate with other routers to update and maintain
the routing tables • Examples: Routing Information Protocol (RIP), Interior Gateway Routing
Protocol (IGRP), Open Shortest Path First (OSPF), Border Gateway Protocol (BGP) and Enhanced IGRP (EIGRP).
Default Gateway Address
• Default Gateway address is used by hosts in local network to communicate with another ones in remote network.
• Netstat –r and route print command.
Học viện mạng Bách khoa - Website: www.bkacad.com 43
IP packet – Carrying Data End to End
• Trace the steps of an IP packet as it traverses unchanged via routers from sub network to sub-network.
• Refer to 5.3.2.1
Học viện mạng Bách khoa - Website: www.bkacad.com 44
IP packet – Carrying Data End to End
Học viện mạng Bách khoa - Website: www.bkacad.com 45
IP packet – Carrying Data End to End
Học viện mạng Bách khoa - Website: www.bkacad.com 46
IP packet – Carrying Data End to End
Học viện mạng Bách khoa - Website: www.bkacad.com 47
IP packet – Carrying Data End to End
Học viện mạng Bách khoa - Website: www.bkacad.com 48
IP packet – Carrying Data End to End
Học viện mạng Bách khoa - Website: www.bkacad.com 49
Manually configure default gateway on PC
Học viện mạng Bách khoa - Website: www.bkacad.com 50
A gateway – the way out of our network
Học viện mạng Bách khoa - Website: www.bkacad.com 51
Routes, Next Hop Addresses and Packet Forwarding ?
• Describe the role of a gateway and the use of a simple route table in directing packets toward their ultimate destinations
Học viện mạng Bách khoa - Website: www.bkacad.com 52
• Define a route and its three key parts
Routes, Next Hop Addresses and Packet Forwarding ?
Học viện mạng Bách khoa - Website: www.bkacad.com 53
• Routes in routing table include 3 main features(Destination Network, Next-Hop and Metric)
• Use “show ip route” to display routing table in Cisco CLI.
Routes, Next Hop Addresses and Packet Forwarding ?
Học viện mạng Bách khoa - Website: www.bkacad.com 54
• Describe the purpose and use of the next hop in a route.
Routes, Next Hop Addresses and Packet Forwarding ?
Học viện mạng Bách khoa - Website: www.bkacad.com 55
Default route
Refer to 5.3.5.2
Học viện mạng Bách khoa - Website: www.bkacad.com 56
• A router can be configured to have a default route. A default route is a route that will match all destination networks.
• In IPv4 networks, the address 0.0.0.0 is used for this purpose. The default route is used to forward packets for which there is no entry in the routing table for the destination network.
• Packets with a destination network address that does not match a more specific route in the routing table are forwarded to the next-hop router associated with the default route.
Host Routing Table
• A host creates the routes used to forward the packets it originates. These routes are derived from the connected network and the configuration of the default gateway.
• Hosts automatically add all
Route print
Học viện mạng Bách khoa - Website: www.bkacad.com 57
• Hosts automatically add allconnected networks to the host’s routing table. These routes for the local networks allow packets to be delivered to hosts that are connected to these networks.
• Tracert example
Routes, Next Hop Addresses and Packet Forwarding ?
Học viện mạng Bách khoa - Website: www.bkacad.com 58
Static route
• Two types of route:– Static route.– Dynamic route.
Học viện mạng Bách khoa - Website: www.bkacad.com 59
Dynamic routing
Học viện mạng Bách khoa - Website: www.bkacad.com 60
IGP and EGP
Học viện mạng Bách khoa - Website: www.bkacad.com 61
• Autonomous system is a network or set of networks under common administrative control. An autonomous system consists of routers that present a consistent view of routing to the external world.
• Interior Gateway Protocols (IGP): route data within an autonomous system. Eg: RIP and RIPv2; IGRP; EIGRP; OSPF; IS-IS;
• Exterior Gateway Protocols (EGP): route data between autonomous systems. Eg: BGP
Labs
62Học viện mạng Bách khoa - Website: www.bkacad.com
Học viện mạng Bách khoa - Website: www.bkacad.com 63
Học viện mạng Bách khoa - Website: www.bkacad.com 64