Network layer - computer networks 1 (2023)

The network layer or OSI layer 3 receives data segments or PDUs from the transport layer. These data bits have been processed into a transportable size and numbered for reliability. It is now up to the network layer to use protocols to add addressing and other information to the PDU and send it down the best path or to the next routerRoute,to the target network.

Network-layer protocols, such as the widespread IP, are rules and directives that devices use to allow upper-layer information to be shared between hosts. If the hosts are on different networks, additional routing protocols are used to select routes between networks. Networks, additional routing protocols are used to select routes between networks. Network layer protocols specify the addressing and packetization of a transport layer PDU and describe how the PDU should be transported with minimal overhead.

The network layer describes four tasks to be performed:

    1. Addressing packets with an IP address
    2. Encapsulation
    3. Routing
    4. decapsulation

The next sections describe each task in more detail and describe common network layer protocols.


IP requires that each sending, advertising-receiving device has a unique IP address. Devices on IP networks have named IP addressesHost.The IP address of the sending host is known asUrsprungs IP-Addresseand the IP address of the receiving host is denoted asdestination IP address.The conventions of IP addressing are discussed in more detail in Chapter 6 "Addressing the network: IPv4".


Each PDU sent between networks must be identified with source and destination IP addresses in oneIP-Header.The IP header contains the address information and some other bits that identify the PDU as a network layer PDU. This process of adding information is calledEncapsulation.When an OSI layer 4 PDU has been encapsulated at the network layer, it is referred to as a packet.Chapter 4: OSI Transport Layer; Chapter 5: OSI network layer. In Network Basics: CCNA Exploration Companion Guide (pp. 100-153). Indianapolis, Indiana: Cisco Press.

Section 5-1

Network layer encapsulation

Network layer - computer networks 1 (1)

Section 5-2 shows how segments are encapsulated at the network layer and become IP packets. At the destination, the process is reversed.

(Video) Networking: Unit 4 - Network Layer - Lesson 1 - Intro


When a packet is encapsulated at the network layer, it contains all of the information needed for transmission to near and far networks. The path between networks can be very short and relatively simple, or it can be complex and involve many steps between routers connected to different networks.

Routerare devices that connect networks. They specialize in understanding OSI Layer 3 packets and protocols and calculating the best path for the packets. Routing is the process that routers perform when they receive packets, analyzing the destination address information to choose a path for the packet and forwarding the packet to the next router on the selected network. Each route a packet takes to reach the next device is called a hop. A packet can hop between several different routers on its way to its destination. Each router examines the address information in the packet, but either the IP address information or the encapsulated transport layer data in the packet is modified or removed until the packet reaches the destination network.

At the network layer, the router opens the packet and looks for IP address information in the packet header. The router chooses the best network to deliver the packet based on how it's configured and what it knows about the destination network. The router directs the packet out of the interface connected to the selected network. The last router on the way recognizes that the packet belongs to adirectly connected networkand forwards it to the correct network interface for final delivery on the local network.

In order for a network layer packet to be transmitted between hosts, it must be forwarded to the data link layer (OSI layer 2) for another layer of encapsulation called framing, and then encoded and transmitted to the physical layer (OSI layer 1) and sent to the next router. Details on how these two layers handle the data are the subject of Chapter 7, “OSI Data Link Layer” and Chapter 8, “OSI Physical Layer”.Chapter 4: OSI Transport Layer; Chapter 5: OSI network layer. In Network Basics: CCNA Exploration Companion Guide (pp. 100-153). Indianapolis, Indiana: Cisco Press.

Section 5-2 Multiple Network Paths Between Hosts

Network layer - computer networks 1 (2)


An IP packet arrives at a router's network interface encapsulated in a Layer 2 frame on the OSI physical layer. The router's network interface card (NIC) accepts the packet and removes the Layer 2 encapsulation data at various layers known asdecapsulation.

Encapsulation and de-encapsulation occur at all layers of the OSI model. As a packet travels from network to network to its destination, there can be several cases where layers 1 and 2 are encapsulated and decapsulated by routers. The network layer only decapsulates the IP packet at the final destination, after examining the destination addresses and determining that the journey is complete. The IP packet is decapsulated, the information in the packet is passed to the upper layers for delivery and processing.

network layer protocols

IP is the most common network layer protocol, but it's important to understand that other protocols are available that offer different capabilities than IP. At one time, network protocols were largely proprietary and communications were limited to a manufacturer's specific equipment. Internet Protocol Version 4 (IPv4), on the other hand, is open source and allows devices from different manufacturers to communicate with each other.

Internet Protocol Version 4 (IPv4)Most common network protocol. Basic protocol of the Internet.
Internetprotokoll Version 6 (IPv6)Currently in use in some areas. Works with IPv4 and will likely replace it.
Novell IPXPart of Novell NetWare, an internetworking protocol widely used in the 1980s and 1990s.
AppleTalkApple Computer's proprietary network protocol.
Connectionless Network Service (CLNS)A protocol used in telecommunications networks that does not require established connections.

Table 5-1
Chapter 4: OSI Transport Layer; Chapter 5: OSI network layer. In Network Basics: CCNA Exploration Companion Guide (pp. 100-153). Indianapolis, Indiana: Cisco Press.

(Video) Networking: Unit 2 - Application Layer - Lesson 1

The IPv4 protocol describes services and packet structures used to encapsulate User Datagram Protocol (UDP) datagrams or TCP segments passed by the transport layer of the OSI model. Since the internet protocol IPv4) and (IPv6) is the most widely used layer 3 data transmission protocol, it is the focus of this book. Discussion of the other protocol is minimal.

IPv4: example of a network layer protocol

Version 4 of IP (IPv4) is currently the most widely used version of IP. It is the only Layer 3 protocol used to transmit user data over the Internet and is the focus of CCNA. Therefore, it will be the example that you will use in this course for the network layer protocols.

IP Version 6 (IPv6) is being developed and implemented in some areas. IPv6 operates in parallel with IPv4 and could replace it in the future. The services provided by IP and the packet header structure and contents are specified by either IPv4 or IPv6.

The properties of IPv4 and IPv6 are different. Understanding these characteristics will allow you to understand how the services described by this protocol work.

IP was designed to be a low-overhead protocol. It provides only the functions necessary to deliver a packet from a source to a destination over an interconnected network system. The protocol was not designed to track and manage packet flow. These functions are performed by other protocols in other layers.

The basic characteristics of IPv4 include:

    • Connectionless:IPv4 does not establish a connection before sending data packets.
    • Best effort (unreliable):IPv4 does not use any processes that guarantee packet delivery, reducing processing time on routers and saving bandwidth that would otherwise be required for acknowledgment messages.
    • Media independent:IPv4 works independently of the medium that carries the data


The reliability of TCP comes from beingconnection oriented.TCP uses a connection between the sender and receiver to exchange control data and ensure packet delivery reliability.

IP isconnectionless, which means that there is no connection between the transmitter and receiver. IP simply sends packets without notifying the recipient. A missing connection is not a problem for IP and is part of the "best effort" design. This is why IP and TCP work so well together in a TCP/IP stack: if a packet is lost or delayed, TCP corrects the problem at layer 4, and IP can work more efficiently at layer 3.

Because IP doesn't have to be responsible for reliability or maintaining a connection, it doesn't require as much information in the header as a TCP segment. Because IP requires less data to perform the required tasks, it uses much less processing power and bandwidth, calledOverhead, als TCP.

best effort

(Video) 4.1 Introduction to the Network Layer

TCP is reliable because communication is established with the receiver and the receiver acknowledges receipt of the data. If packets are lost, the receiver communicates with the sender to request retransmission. The TCP segment contains information that makes it possible to ensure reliability.

IP is an unreliable,best effortProtocol as it is unaware of the quality of the work it performs. IP packets are sent with no certainty that they will be lost en route. IP has no way of informing the sender of reliability issues. TCP can rely on informing the sender of delivery problems.

media independent

IP ismedia independent, which means that it is not the physical medium that carries the package. Internetwork communications will likely be a multimedia journey using a combination of wireless, Ethernet cable, fiber optics, cable, and other OSI Layer 1 media. The ordering of the bits in the IP packet and header does not change when the packet is transmitted from wireless to fiber or other media.

Section 5-3

IP packets are media independent

Network layer - computer networks 1 (3)

Section 5-3 shows how several different physical layer media can exist between the source host and the destination host. However, an important consideration is the size of the PDU. Some networks have media restrictions and must enforce aMaximum Transmission Unit (MTU). The MTU is determined by the OSI link layer, and this requirement is passed to the network layer.

The network layer then builds the packets according to the specification. Should the packet encounter a network that requires smaller packets, the router connected to the network fragments the packets before forwarding them onto the network's medium. This process is calledfragmentation.

The process of sending a package over the Internet using the IP protocol is equivalent to sending a surprise gift to a friend through a courier service. The gift, in this example three boxes tied together, is brought to the delivery point already packed. The delivery service doesn't know (nor care) what's in the package. The package is an acceptable size, so the couriers add a label to the package with the destination and return addresses and some of their own routing codes. You place the gift in a standard container used for easy shipping. To keep costs down, the shipper chooses simple service, which means nothing is guaranteed and the shipper cannot track the package on the internet. The container with the package goes to the dock terminal by car and then by ship to the destination terminal. From there it goes by truck to a municipal delivery office. The last delivery on site is by bicycle. The package is too big for the bike rack, so it will be disassembled into 3 parts for separate delivery. All parts arrive at their destination and the delivery service's job is done. Later, the sender receives a thank you note from her friend and is assured that the gift has been delivered.Chapter 4: OSI Transport Layer; Chapter 5: OSI network layer. In Network Basics: CCNA Exploration Companion Guide (pp. 100-153). Indianapolis, Indiana: Cisco Press.

IPv4 Packet: Encapsulation of the transport layer PDU

IPv4 encapsulates or wraps the transport layer segment or datagram so the network can deliver it to the destination host. IPv4 encapsulation persists from the time the packet leaves the source host's network layer until it arrives at the destination host's network layer.

The process of encapsulating data by layer allows the services in the different layer segments to be easily packaged by existing network layer protocols such as IPv4 and IPv6 or by any new protocol that might be developed in the future.

(Video) Overview of the Internet Protocol - IP Network Layer | Computer Networks Ep. 4.1 | Kurose & Ross

Routers can implement these different network layer protocols to work simultaneously across the network to and from the same or different hosts. The routing performed by the intermediate devices only considers the content of the packet header that encapsulates the segment and considers only the content of the packet header that encapsulates the segment.

In all cases, the data part of the packet - i.e. the encapsulated transport layer PDU - remains unchanged during the network layer processes.


The IP header contains the delivery and processing instructions for an IP packet. For example, when a packet arrives at a router's interface, the router needs to know whether the packet is IPv4 or IPv6. The router looks in a specific field in the header to see which type is arriving. The header also contains addressing information and other data about how the packet should be handled along the way.

Section 5-4

Components of an IP header

Network layer - computer networks 1 (4)

Section 5-4 shows the structure of an IP header. The packet contains multiple fields, and not every network uses every field. There are highlighted fields that are important to understand how the IP header helps IP packets to be forwarded successfully.

      • IP-Quelladresse:Contains a 32-bit binary value representing the host receiving the packet. Routers use this data to route the packet to the correct network.
      • Destination IP address:Contains a 32-bit binary value representing the host receiving the packet. Routers use this data to route the packet to the correct network.
      • Lifetime (TTL): The 8-bit TTL field describes the maximum hops the packet can make before it is considered "lost" or undeliverable. Each router that processes the packet decrements the TTL field by at least 1. The packet is discarded when the TTL value reaches 0. This prevents the Internet from being overloaded with lost packets.
      • Type of Service (ToS). Each of the 8 bits in this field describes a throughput priority level that a router should use when processing the packet. For example, a packet of IP voice data is given priority over a packet of streaming music. The way a router processes a packet of this data is calledQoS (Quality of Service).
      • Protocol:This 8-bit field specifies the upper layer protocol - for example TCP, UDP OR ICMP - that the packet will receive when it is decapsulated and passed to the transport layer.
      • Flag and fragment offset:A router may need to fragment a packet when forwarding it from one medium to another medium with a smaller MTU. When fragmentation occurs, the IPv4 packet uses the fragment offset field and MF flag in the IP header to reconstruct the packet when it arrives at the destination host. The fragment offset field identifies the order in which the packet fragment should be placed in the reconstruction.

Other fields are as follows:

      • Execution:Displays IP version 4 or 6.
      • Internet-Header-Length (IHL):Tells the router how long the header is. The length is not always the same due to variable data in the option field.
      • Package length:This is the total length of the datagram, including the header. The minimum length of a packet is 20 bytes (header without data) and the maximum length with data is 65,535 bytes.
      • Identification:Sent from the source to reassemble fragments.
      • Header-Prüfsumme:This data is used to indicate the length of the header and is checked by each router along the way. Each router runs an algorithm and if the checksum is invalid, the packet is assumed to be corrupt and discarded. Because the TTL value is changed by each router that processes the packet, the header checksum is recalculated on each hop.
      • Options:A rarely used field that can provide special routing services.
      • Upholstery:Padding is used to pad bits when header data does not end on a 32-bit boundary.Chapter 4: OSI Transport Layer; Chapter 5: OSI network layer. In Network Basics: CCNA Exploration Companion Guide (pp. 100-153). Indianapolis, Indiana: Cisco Press.

Section 5-5

Components of a complete package.

(Video) Network Layer - 1 | Computer Networks | CS & IT | GATE | Sanchit Jain

Network layer - computer networks 1 (5)


1. CCNA1-ITNv7 - Module 08 - Network Layer
(Arthur Salmon)
2. Computer Networks 4 1 Network Layer Overview YouTube 360p
(Zufolo Zufoli)
3. Networking: Unit 3 - The Transport Layer - Lesson 1, Introduction
(Mitch Davis)
4. Network layer (1/6): Routing and addressing (Computer networks)
5. Computer Networks Lecture 16: The Network Layer
(Geoffrey Messier)
6. Chapter 5 - Transport & Network Layer (Part 1)
(Connect with Networking)


Top Articles
Latest Posts
Article information

Author: Ouida Strosin DO

Last Updated: 15/09/2023

Views: 6507

Rating: 4.6 / 5 (56 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Ouida Strosin DO

Birthday: 1995-04-27

Address: Suite 927 930 Kilback Radial, Candidaville, TN 87795

Phone: +8561498978366

Job: Legacy Manufacturing Specialist

Hobby: Singing, Mountain biking, Water sports, Water sports, Taxidermy, Polo, Pet

Introduction: My name is Ouida Strosin DO, I am a precious, combative, spotless, modern, spotless, beautiful, precious person who loves writing and wants to share my knowledge and understanding with you.