The layer is responsible for the source-to-destination delivery of a packet

The network layer, or Open Systems Interconnection (OSI) Layer 3, provides services to exchange the individual pieces of data over the network between identified end devices.  To accomplish this end-to-end transport, Layer 3 uses the processes outlined in the following sections to address the packet to the proper destination, encapsulate the packet with necessary data for delivery route the packet through the web of connected networks that will deliver the packet to the destination network for delivery, and finally, have the destination host decapsulate the data for processing.  The details of these processes are explored further in the next sections.  Chapter 5: OSI Network Layer. In Network Fundamentals: CCNA Exploration Companion Guide (pp. 100-153). Indianapolis, Ind.: Cisco Press

The network layer, or OSI Layer 3, receives segments of data, or PDU's, from the transport layer.  These bits of data have been processed into a transportable size and numbered for reliability.  It is now up the network layer to use protocols to add addressing and other information to the PDU and send it to the next router along the best path or route,  to the destination network.  

Network layer protocols, such as the widely used IP, are rules and instructions that devices use to enable sharing of upper-layer information between hosts.  When the hosts are in different networks, additional routing protocols are used to choose routes between networks.  Networks, additional routing protocols are used to choose routes between networks.  Network layer protocols specify the addressing and packaging of a transport layer PDU and describe how the PDU is to be carried with minimum overhead.

The network layer describes four task 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 popular network layer protocols.

IP requires each sending ad receiving device to have a unique IP address.  Devices in IP networks have IP addresses are called hosts.  The IP address of the sending host is kown as the source IP address and the IP address of the receiving host is referred to as the destination IP address.  The conventions of IP addressing will be explored in greater detail in Chapter 6 "Addressing the Network:  IPv4".

Each PDU sent between networks needs to be identified with source and destination IP addresses in an IP  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 called encapsulation. 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 Fundamentals: CCNA Exploration Companion Guide (pp. 100-153). Indianapolis, Ind.: Cisco Press.

Network layer encapsulation

The layer is responsible for the source-to-destination delivery of a packet

http://networking.layer-x.com/

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

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

Routers are devices that connect networks.  They specialize in understanding OSI Layer 3 packets and protocols as well as calculating the best path for the packets.  Routing is the process routers perform when receiving packets, analyzing the destination address information to select a path for the packet and forwarding the packet on to the next router on the selected network.  Each route that a packet takes to reach the next device is called a hop.  A packet can hop between several different routers en route to the destination.  Each router examines the address information in the packet, but in either the IP address information nor the encapsulated transport layer date in the packet is changed or removed until the packet reached the destination network.

At the network layer, the router opens the packet and looks in the packet header for IP address information.  The router, depending on how it is configured and what it knows about the destination network, will choose the best network to deliver the packet.  The router forwards the packet out of the interface connected to the chosen network.  The last router along the path will realize that the packet belongs to a directly connected network and will forward it out the correct network interface for final delivery on the local network.

For a network layer packet to travel between hosts, it must be handed down to the data link layer (OSI Layer 2) for another layer of encapsulation called framing,l and then encoded and put onto the physical layer (OSI Layer 1) to be sent to the next router.  Details of 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 Fundamentals: CCNA Exploration Companion Guide (pp. 100-153). Indianapolis, Ind.: Cisco Press.

Section 5-2  Multiple Network Paths Between Hosts

The layer is responsible for the source-to-destination delivery of a packet

An IP packet arrives at a router's network interface encapsulated in a Layer 2 frame on the physical OSI layer.  The router's network interface card (NIC) accepts the packet, removes the Layer 2 encapsulation data at different layers is referred to as decapsulation.

Encapsulation and decapsulation occur at all layers of the OSI model.  As a packet travels from network to network to its destination, there can be several instances in which 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 over.  The IP packet is decapsulated, the information in the packet is handed up to the upper layers for delivery and processing.

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

Protocol Description Internet Protocol version 4 (IPv4) Most widely used network protocol.  Basic protocol of the Internet. Internet Protocol version 6 (IPv6) Currently in use in some areas.  Will work with IPv4 and likely replace it. Novell IPX Part of Novell NetWare, a widely popular internetworking protocol in the 1980s and 1990s. AppleTalk Apple Computer's proprietary networking protocol. Connectionless Network Service (CLNS) A protocol used in telecommunication networks that does not require established circuits. Table 5-1
 Chapter 4: OSI Transport Layer; Chapter 5: OSI Network Layer. In Network Fundamentals: CCNA Exploration Companion Guide (pp. 100-153). Indianapolis, Ind.: Cisco Press.

The IPv4 protocol describes services and packet structure that are used to encapsulate User Datagram Protocol (UDP) datagrams or TCP segments handed down from the transport layer of the OSI model.  Because the Internet Protocol IPv4) and (IPv6) is the most widely used Layer 3 data-carrying protocol it is the focus of this book.  Discussion of the other protocol is minimal.

IPv4:  Example Network Layer Protocol

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

IP version 6 (IPv6) is developed and being implemented in some areas.  IPv6 will operate alongside IPv4 and might replace it in the future.  The  services provided b y IP, as well as the packet header structure and contents, are specified by either IPv4 or IPv6.

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

IP 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 other layers.  

IPv4 basic characteristics include the following:

    • Connectionless:  IPv4 does not establish a connection before sending data packets.
    • Best effort (unreliable):  IPv4 does not use processes that guarantee packet delivery, which reduces processing time on routers and saves the bandwidth that acknowledgement messages would otherwise require.
    • Media Independent:  IPv4 operates independently of the medium carrying the data

TCP's reliability comes from being connection-oriented.  TCP uses a connection between the sender and the receiver to exchange control data and ensure reliability of packet delivery.  

IP is connectionless, meaning that there is no established connection between the sender and the receiver.  IP simply sends packets without informing the the receiver.  Lacking a connection is not a problem for IP and is part of the "best effort" design.  This si why IP and TCP work together so well in a TCP/IP stack:  If a packet is lost or late, TCP will correct the problem at Layer 4, and IP can work more efficiently at Layer 3.

Because IP does not have to be accountable for reliability or keep a connection, it does not need as much information in the header as a TCP segment does.  Because IP requires less data to perform the required tasks, it uses much less processing power and bandwidth, called overhead, than TCP.

TCP is reliable because communication is established with the receiver and receipt of the data is confirmed by the receiver.  If packets are lost, the receiver communicates with the sender to request a retransmission.  The TCP segment contains information that allows reliability to be ensured.

IP is an unreliable, best-effort protocol in that it is unaware of the quality of job it is performing.  IP packets are sent without certanty that they are lost en route.  IP has no way to inform the sender of reliability problems.  TCP can be relied on to inform the sender of delivery problems.  

IP is media independent, which means it is not concerned with the physical medium that carries the packet.  Internetwork communication is likely to be multimedia journey using a combination of wireless, Ethernet cable, fiber-optic, cable, and other OSI Layer 1 media.  The arrangement of bits in the IP packet and header will not be changed as the packet transfers from wireless to fiber or any other media.

IP Packets Are Media Independent

The layer is responsible for the source-to-destination delivery of a packet

Section 5-3 shows how there can be several different physical layer media between the source host and destination host.  One important consideration, however, is the size of the PDU.  Some networks have media restrictions and must enforce a maximum transmission unit (MTU).  The MTU is determined by the OSI data link layer, and that requirement is passed to the network layer.

The network layer then builds the packets according to specification.  Should the packet come across a network that requires smaller packets, the router connected to the network will fragment the packets before forwarding then on the network's medium.  This process is called fragmentation.

The process of sending a packet across the web with the IP protocol is analogous to someone sending a surprise gift to a friend using a package delivery service.  The gift, in this example three boxes strapped together, is taken to the delivery office already wrapped.  The delivery service does not know (nor does it care) what is in the package.  The package is an acceptable size, so the delivery workers add a label with the destination and return address and some of their own routing codes to the package.  They place the gift in a standard container used for easy shipping. To keep costs low, the sender chooses simple service, which means nothing is guaranteed and the sender can not track the package on the web.  The container with the package travels by car to the dock terminal and then by boat to its destination terminal.  From there it travels by truck to a city delivery office.  The final local delivery is by bicycle.  The package is too large for the bicycle carrier, so it is broken into three pieces for separate delivery.  All pieces arrive at the destination, and the job of the delivery service is complete.  Later the sender receives a thank-you note from her friend, and she is assured that the gift was delivered.   Chapter 4: OSI Transport Layer; Chapter 5: OSI Network Layer. In Network Fundamentals: CCNA Exploration Companion Guide (pp. 100-153). Indianapolis, Ind.: Cisco Press.

IPv4 Packet:  Packaging the Transport Layer PDU

IPv4 encapsulates, or packages, the transport layer segment or datagram so that the network can deliver it to the destination host.  The IPv4 encapsulation remains in place from the time the packet leaves the network layer of the originating host until it arrives at the network layer of the destination host.

The process of encapsulating data by layer enables the services at the different layer segments can readily packaged by existing network layer protocols, such as IPv4 and IPv6, or by any new protocol that might be developed in the future.  

Routers can implement theses different network layer protocols to operate concurrently over network to and from the same or different hosts.  The routing performed by the intermediary devices only considers the contents of the packet header that encapsulates the segment only considers the contents of the packet header that encapsulates the segment.

In all cases, the data portion of the packet--that is, the encapsulated transport layer PDU--remains unchanged during the network layer processes.

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

Components of an IP Header

The layer is responsible for the source-to-destination delivery of a packet

Section 5-4 shows the outline on an IP header.  There are several fields in the packet, and not every network uses every field.  There are highlighted fields that are important to understanding how the IP header helps route IP packets successfully.