0% found this document useful (0 votes)
55 views17 pages

CCNA Chapter 5477

The document discusses the network layer of the OSI model. The network layer is responsible for addressing packets and routing them from source to destination using IP addresses. It focuses on IPv4, which adds a header to packets that includes the source/destination addresses and other metadata. Networks are divided hierarchically to group hosts, improve performance by limiting broadcasts, and enhance security. Routers use the network portion of IPv4 addresses to route between networks while the host portion ensures delivery to the correct device.

Uploaded by

fsdg
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)
55 views17 pages

CCNA Chapter 5477

The document discusses the network layer of the OSI model. The network layer is responsible for addressing packets and routing them from source to destination using IP addresses. It focuses on IPv4, which adds a header to packets that includes the source/destination addresses and other metadata. Networks are divided hierarchically to group hosts, improve performance by limiting broadcasts, and enhance security. Routers use the network portion of IPv4 addresses to route between networks while the host portion ensures delivery to the correct device.

Uploaded by

fsdg
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/ 17

Module 5

The Network Layer

Introduction

The Network layer (Layer 3) fits into the OSI model - between the Transport
layer (Layer 4) and the Data Link layer (Layer 2). The Network layer is responsible
for taking the Layer 4 PDU (TCP segments) and ensuring that it is correctly
addressed and routed so it can reach its final destination anywhere in the world.

Anyone who accesses the Internet uses the TCP/IP protocol. In the same way
that TCP at Layer 4 has a PDU, so too does IP at the Network layer. The primary
Network layer protocol used on the Internet is IPv4, so this chapter focuses on the
IPv4 packet structure. Understanding the hierarchical IPv4 addressing schemes is
necessary for further networking studies because almost all addresses currently
used on the Internet are IPv4 addresses. FDFFFFFFFFFFFFFDDDDDDDDDDDDFF

LESSON 1: IP VERSION 4 PACKETS and hierarchical


addressing

After studying this lesson, you should be able to:

 Define the following key terms: network layer protocols, media dependent,
packet, packet header, IPv4 address, and gateway.
 Describe the role of the network layer.
 Explain the characteristics of IPv4
 Describe the reasons why hosts are group into networks
 Explain hierarchical addressing scheme
Module 5 – The Network Layer

Purpose of the Network Layer

The Network layer is responsible for addressing packets and then using those
addresses to route packets over the Internet from the sending host computer, through
many intermediary routers to the final destination host computer.

The primary responsibilities of the network layer are:

 Addresses packets with an IP Address.

 Encapsulates the packet.

 Routes the packet to the destination.

 Decapsulates the packet.

Figure 5.1 Connection from Host to Host

Network Layer Protocols

 Internet Protocol version 4 (IPv4) – is the most widely used version of IP.

 Internet Protocol version 6 (IPv6) – new version of IP which is designed to be an


evolutionary step from IPv4. It is a natural increment to IPv4.

 Novell Internetwork Packet Exchange (IPX) - a legacy network protocol used by the
Novell NetWare operating systems to route packets through an internetwork

Module in CCNA 101 – CISCO 1 81


Module 5 – The Network Layer

 AppleTalk - multi-layered protocol of Apple Computers providing internetwork


routing, transaction and data stream service, naming service, and comprehensive file
and print sharing among Apple systems

 Connectionless Network Service (CLNS/DECNet) - an OSI Network Layer service that


does not require a circuit to be established before data is transmitted

IP Characteristics

A. Connectionless – It does not set up connection with destination before sending


packet.

Figure 5.2 Connectionless

B. Best Effort Delivery (Unreliable) - Unreliable means simply that IP does not have the
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.

Figure 5.3 Best Effort

Module in CCNA 101 – CISCO 1 82


Module 5 – The Network Layer

C. Media Independent – It is not concerned with the physical medium. It operates


independent of the layers that handle the physical medium that carries the packet.

Figure 5.4 Media Independent

Packaging the Transport Layer PDU

In TCP/IP based networks, the Network Layer PDU is the IP Packet. A packet
header is added during the encapsulation process.

Figure 5.5 Network Layer Encapsulation

IPV4 Packet Header

Listed below are the fields on the packet header:

a. Source Address: IPv4 address of host sending the packet: Remains unchanged
throughout the passage of the packet across the internetwork. Enables the
destination host to respond to the source if required.

Module in CCNA 101 – CISCO 1 83


Module 5 – The Network Layer

b. Destination Address: IPv4 address of host to receive the packet: Remains


unchanged throughout the passage of the packet across the internetwork.
Enables routers at each hop to forward the packet towards the destination.

c. Type of Service: Data QoS priority: Enables router to give priority to voice and
network route information over regular data.

d. Protocol: The data payload protocol type: Denotes if the data is a UDP datagram
or TCP segment because these Transport layer protocols manage the receipt of
their PDUs differently.

e. Time to Live – It is reduced by 1 at each router. Packet dropped if it goes to 0.

f. Protocol - TCP or UDP used in Transport layer.

g. Header Checksum –It is used for checking if header has been corrupted.

h. Flag – It shows if packet has been fragmented or must not be fragmented.

i. Fragment Offset - If router has to split a packet, this gives order for putting
pieces together.

j. Packet Length – It indicates the length of the whole packet

k. IHL – The header length

l. Version – Version 4

Figure 5.6 Fields of a Packet Header

Networks: Dividing Hosts into Groups

IPv4 uses a hierarchical network-addressing scheme that allows for hosts to be


grouped into sets of addresses for simpler network management, assured connectivity,
unique identification and for limiting the need for broadcasting. Hosts are often grouped

Module in CCNA 101 – CISCO 1 84


Module 5 – The Network Layer

according to their physical location or geography, performance (Quality of Service) and


security are also becoming important factors in deciding how to group hosts.

a. Geographically – Group hosts according to their physical location or geography; for


example all of the hosts on one floor of a building are grouped together into one
subnet.

b. Purpose – what software and shared resources do people use? How much bandwidth
do they use? The volume of traffic can also be considered in network design. For
example, if a lot of video conferencing is required, the excessive traffic caused by
multicasting during video conferencing would create a need for a separate network
subnet for this purpose.

c. Ownership – different companies or departments in a company, security


requirements

Why Separate Hosts into Networks?

Why split it up?

a. Performance - Too much broadcast traffic can lead to network congestion. Routers
block broadcasts unless specifically configured to forward them. Replacing the
switch in the diagram with a router creates two separate IP sub-networks and two
broadcast domains. Broadcasts are now contained within each network.

Figure 5.7 Two Subnets and Two Broadcast Domain

b. Security - Dividing networks based on ownership means that access to and from
resources outside each network can be prohibited, allowed, or monitored. Security
should always be considered in network design. Access Control Lists, Firewalls and
server access policies are some of the ways in which network security can be
regulated.

Module in CCNA 101 – CISCO 1 85


Module 5 – The Network Layer

c. Address Management - Dividing large networks so that hosts who need to


communicate are grouped together reduces the unnecessary overhead of all hosts
needing to know all addresses.

For all other destinations, the hosts only need to know the address of an
intermediary device, to which they send packets for all other destinations addresses.
This intermediary device is called a gateway. The gateway is a router on a network
that serves as an exit from that network.

Figure 5.8 Hierarchical Addressing

 To support data communications between networks over internetworks, Network


layer addressing schemes are hierarchical.

 Using hierarchical addressing means that the layer 3 address are divided into a
network level and then the host level.

o Layer 3 addresses supply the network portion of the address. Routers


forward packets between networks by referring only to the part of the
Network layer address that is required to direct the packet toward the
destination network.

o By the time the packet arrives at the destination host network, the whole
destination address of the host will have been used to deliver the packet.

Dividing Networks from Networks

The IP Version 4 Address contains elements that uniquely identify both the network
and host. An IPv4 address has 32 bits or 4 bytes. We divide these 32 bits into two
components: the network portion and the host portion. The length of network part can
vary.

Module in CCNA 101 – CISCO 1 86


Module 5 – The Network Layer

In the figure below, the network part (prefix) is 24 bits or /24.

Figure 5.9 Complete IPv4 Address

• The network portion of the address is the same for all hosts on the network.

• Each device is identified by a unique host portion.

This hierarchy means that routers only need to know the network portion – not the
address of each individual host.

Lesson 1 Review Questions

Direction. Answer the following questions.

1. What are the four main processes at the network layer?

2. Encapsulation at the network layer is the addition of a layer 3 header. What


addresses are in this header?

3. What are the basic characteristics of IP? Why was IP designed with these
characteristics?

4. What is the purpose of the time to live (TTL) field in the packet header?

5. Networks have to be split up because very large networks are too difficult to
manage. What are the ways of splitting up a network?

6. Why is a large broadcast domain inefficient?

7. What is hierarchical addressing?

Module in CCNA 101 – CISCO 1 87


Module 5 – The Network Layer

LESSON 2. Gateways and routing

After studying this lesson, you should be able to:

 Define the following key terms: IPv4, connectionless, packets, fragmentation,


maximum transmission unit, routing, default gateway, hop, metric, default
route, routing table, and routing protocol.
 Define and demonstrate gateways
 Explain how IPv4 packets are routed
 Differentiate the static routing and dynamic routing
 Describe a routing protocol

Routing: How Data Packets Are Handled

Routing is the process of moving data packets through a series of networks from the
sending host to the destination host. Routers are the devices that connect a network to
other networks. A router has two or more gateways - connections or "interfaces" - one for
each network to which it is connected. Each host on a network is given a gateway, which is
the router interface (the IPv4 address on a router) that will take data packets from the host
and route them to other hosts outside of the sending host’s network.

A gateway is like a doorway that leads into and out of a room - all data packets into
or out of a network go through the gateway.

Figure 5.10 Message to the Same Network

Module in CCNA 101 – CISCO 1 88


Module 5 – The Network Layer

Figure 5.11 Message to a Different Network

Default Gateway

Each PC is configured with an IP address and a default gateway. The default


gateway is the IP address of a router port on the same network as the PC. It is the router’s
job to handle messages to other networks.

Each router port is on a different network and has a different IP address.

Figure 5.12 Default Gateway

Module in CCNA 101 – CISCO 1 89


Module 5 – The Network Layer

Address Types

Each host on the network has two addresses: the MAC address and the IP address.

MAC address IP Address


Physical address of the host Logical address of the host
Burned in to the NIC Assigned by network administrator
Layer 2 address Layer 3 address
This is the address that is absolutely Routers base their decisions on the
necessary to get the information into NETWORK PORTION of the IP
the host. The IP address by itself address when determining the best
won't accomplish that. path for the packet.

Figure 5.13 The MAC and IP address

Route: A Path to a Network

The routing table stores information about directly connected and remote networks.
Remote networks are networks not directly connected to the router (manual configuration
or learned dynamically).

Each router has a routing table. This contains a list of known networks and the
best way to get there – outgoing port and address of next-hop router. The routing table
stores information about connected and remote networks.

 Connected networks are directly attached to one of the router interfaces.

o These interfaces are the gateways for the hosts on different local
networks.

Module in CCNA 101 – CISCO 1 90


Module 5 – The Network Layer

o When a router interface is configured with an IP address and subnet


mask, the interface becomes part of that network.

 Remote networks are networks that are not directly connected to the router.

o Routes to these networks can be manually configured on the router


by the network administrator or learned automatically using dynamic
routing protocols.

The router looks at the IP address of a packet. It decides which network this address
is on. If it knows the network it forwards the packet. If it does not know the network it
drops the packet.

Metric Next Hop


Destination Network

Figure 5.14 Parts of a Routing Table

 Directly connected shown by C

 Static, configured by administrator, shown by S

 Default route, configured by administrator, shown by S*

 Learned from another router using RIP routing protocol, shown by R

Routes in a routing table have three main features:

 Destination network

 Next-hop

 Metric

Module in CCNA 101 – CISCO 1 91


Module 5 – The Network Layer

The hierarchical nature of Layer 3 addressing means that:

• One route entry could refer to a large general network.

• Another entry could refer to a subnet of that same network.

• When forwarding a packet, the router will select the most specific
route.

Default Route

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.

Hops

A packet may pass through many routers on its journey. The trip from one router
to the next is called a hop and the next router is called the next hop router. Each router
looks at the IP address in the packet header and decides what to do with the packet next

Some routes can have multiple next-hops. This indicates that there are multiple
paths to the same destination network

Packet Forwarding

Routing is done packet-by-packet and hop-by-hop. Each packet is treated


independently in each router along the path. At each hop, the router examines the
destination IP address for each packet and then checks the routing table for forwarding
information.

The router will do one of three things with the packet:

o Forward it to the next-hop router

o Forward it to the destination host

o Drop it

Module in CCNA 101 – CISCO 1 92


Module 5 – The Network Layer

If the routing table does not contain a more specific route entry for an arriving
packet, the packet is forwarded to the interface indicated by a default route, if one exists.
The default route is also known as the Gateway of Last Resort.

Default routes are important because the gateway router is not likely to have a
route to every possible network on the Internet. If the packet is forwarded using a default
route, it should eventually arrive at a router that has a specific route to the destination
network.

Routing Processes: How Routes Are Learned

Routing requires that every hop, or router, along the path to a packet's destination
have a route to forward the packet. The routing table contains the information to make
packet forwarding decisions.

Routing table information is learned in two ways:

a. Manual configuration of the information (Static)

 It is manually configured by the network administrator and he must know


network structure.

 Every router between each source and destination must have routes.

 Changes to the topology require static route changes. If updating is not done
in a timely fashion, the routing information may be incomplete or inaccurate,
resulting in packet delays and possible packet loss

b. Information received from another router (Dynamic)

 Routing information is exchanged among the routers using a routing protocol.


Routing protocols are the set of rules by which routers dynamically share their
routing information.

 Examples of routing protocols are Routing Information Protocol


(RIP),Enhanced Interior Gateway Protocol (EIGRP) and Open Shortest Path
First (OSPF)

 Although routing protocols provide routers with up-to-date routing tables,


there are costs.

o First, the exchange of route information adds overhead that consumes


network bandwidth. This overhead can be an issue, particularly for low
bandwidth links between routers.

Module in CCNA 101 – CISCO 1 93


Module 5 – The Network Layer

o Second, the route information that a router receives is processed


extensively by protocols such as EIGRP and OSPF to make routing
table entries. This means that routers must have sufficient processing
capacity to implement the protocol's algorithms and to perform timely
packet routing and forwarding.

STATIC ROUTING DYNAMIC ROUTING

 Entered by administrator  Learned from other routers


 Time consuming, different for  Start the protocol then it runs by
each router itself
 Must be updated if routes change  Automatically updates when
 Little processing routes change
 No bandwidth used  More processing
 Gives nothing away  Uses bandwidth
 Gives away information

Lesson 2 Review Questions

Direction. Answer the following questions.

1. Describe routing.

2. What is the role of a router?

3. What is a routing table?

4. What is a default route used for?

5. Differentiate static and dynamic routing.

Module in CCNA 101 – CISCO 1 94


Module 5 – The Network Layer

Module 5 Quiz

Directions. On the space provided before each number, write the letter of the correct
answer.

__________1. The network layer PDU is called _________________.


A. A frame C. A packet
B. A segment D. A header

__________2. An IPv4 address can be broken down into two parts. These are
A. Network portion and transport portion
B. Network portion and host portion
C. Gateway portion and host portion
D. Source portion and destination portion

__________3. What information from a packet does a router use in order to choose a route
for forwarding the packet?
A. Host portion of destination IP address
B. Host portion of source IP address
C. Network portion of destination IP address
D. Network portion of source IP address

__________4. What name is given to one stage of a packet’s journey as it moves from one
router to the next?
A. Trip C. Step
B. Hop D. Section

__________5. What contact does IPv4 make with the destination before sending a packet?
A. It sends a message to say that a packet will be arriving.
B. It checks that the destination host exists.
C. It checks that the destination host is ready to receive.
D. It does not make any contact before sending

__________6. Which function is the responsibility of the network layer?


A. Encoding signals to put them on the transport medium.
B. Re-sending packets that have been lost in transmission.
C. Finding the best route for a packet to travel to its destination.
D. Managing the access of hosts to the transport medium.

Module in CCNA 101 – CISCO 1 95


Module 5 – The Network Layer

__________7. How many bits make up an IPv4 address?


A. 8 c. 32
B. 16 d. 64

__________8. Refer to the diagram. What should be configured as the default gateway for
host A?
A. 192.168.5.3 C. 192.168.7.254
B. 192.168.5.253 D. 192.168.5.254

__________9. Which is true of static routing?


A. The router always sends packets on the same route.
B. The router has been configured with a default route.
C. Routes are entered manually by an administrator.
D. The router learns routes from other routers.

__________10. Which device can limit the spread of broadcasts?


A. Router C. Hub
B. Switch D. Host

Module in CCNA 101 – CISCO 1 96

You might also like