Show
In the seven-layer OSI model of computer networking, the network layer is layer 3. The network layer is responsible for packet forwarding including routing through intermediate routers.[2] FunctionsThe network layer provides the means of transferring variable-length network packets from a source to a destination host via one or more networks. Within the service layering semantics of the OSI network architecture, the network layer responds to service requests from the transport layer and issues service requests to the data link layer. Functions of the network layer include: Connectionless communication For example, IP is connectionless, in that a data packet can travel from a sender to a recipient without the recipient having to send an acknowledgement. Connection-oriented protocols exist at other, higher layers of the OSI model. Host addressing Every host in the network must have a unique address that determines where it is. This address is normally assigned from a hierarchical system. For example, you can be : "Fred Murphy" to people in your house, "Fred Murphy, 1 Main Street" to Dubliners, "Fred Murphy, 1 Main Street, Dublin" to people in Ireland, "Fred Murphy, 1 Main Street, Dublin, Ireland" to people anywhere in the world. On the Internet, addresses are known as IP addresses (Internet Protocol). Message forwarding Since many networks are partitioned into subnetworks and connect to other networks for wide-area communications, networks use specialized hosts, called gateways or routers, to forward packets between networks.Relation to TCP/IP modelThe TCP/IP model describes the protocols used by the Internet.[3] The TCP/IP model has a layer called the Internet layer, located above the link layer. In many textbooks and other secondary references, the TCP/IP Internet layer is equated with the OSI network layer. However, this comparison is misleading, as the allowed characteristics of protocols (e.g., whether they are connection-oriented or connection-less) placed into these layers are different in the two models.[citation needed] The TCP/IP Internet layer is in fact only a subset of functionality of the network layer. It describes only one type of network architecture, the Internet.[citation needed] ProtocolsThe following are examples of protocols operating at the network layer.
References
External links
In the previous chapter, we looked at the role of the OSI transport layer in communication. In this chapter, we will look at the network layer. We will discuss the addressing used, the functions, and the different network layer protocols, introduce IPv4, understand how packets move in the network and finally give an overview in how we address the network using IPv4. You should be able to understand these concepts as they will be used in the chapter on addressing in IPv4 as well as in subsequent chapters. IntroductionThe network layer defines communication over the network through four basic processes which are addressing, routing, encapsulation and decapsulation. These concepts are vital in understanding routing. AddressingYou may have sent a letter through the post office, while doing this, you are required to write the address of the recipient on the envelope and most likely your address for reply purposes. In the same manner, the network layer is responsible for identifying the various devices in the network. However, unlike the postal addresses, addressing in the network layer is logical. This means that addresses are not fixed to the devices and they may change. The addresses that are used in this layer are for remote delivery, if we use the post office analogy, remote delivery would be sending a letter to another organization. Local delivery – which will be discussed in a later chapter can be likened to sending a note to a colleague who is seated next to you. EncapsulationThe network layer PDU- protocol Data Unit is the packet. Encapsulation entails adding layer 3 specific information based on the segments from the transport layer. Such information includes headers and trailers. It also divides the segments from the transport layer for remote delivery. Routing
|
South Korea, Seoul, 134- 00100. |
In this diagram, the address structure is hierarchical, the first level is the country that we are sending to, the second level is the city and the third level is the exact address of the recipient. Similarly, the logical addresses in the network layer contain a network portion and a host portion.
At the post office, the postman only needs to know the post office where the letter is to be sent to, which is similar to the code. When the letter gets to the post office, the post man there is responsible for delivering the letter to the intended recipient.
A layer 3 address also has a network and host portion. The routers in the network forward packets between the various separate networks by only looking at the destination network. When the packet arrives at the destination, the router will have to look at the whole address so as to deliver the packet to the intended destination.
When dividing large networks into smaller ones, we need to create other levels or layers of addressing. Just like the postal example we had above, when we use hierarchical addressing schemes, we can retain the higher level such as the country. We can then divide the country into various cities, and finally address the various hosts or users in the lowest level.
The IPv4 address is made up of 2 parts which are the network and the host portion. The address should have both parts for communication to be successful.
Network portion |
Host portion |
||
192 |
168 |
1 |
83 |
The IPv4 address is made up of 32 bits, we can divide these bits differently to either create more hosts addresses or more networks, however, in either case, the address has to be 32 bits long for the address to be complete.
Communication at layer 3
When a host wants to communicate with a host on a different network, an intermediary device such as a router has to be used. The router acts as a gateway to the other network as shown in the figure below.
As you can see from the diagram above, there are two hosts on 2 different networks. In order to make communication between them possible, an intermediary device is needed between them, in this case a router. The router has the default gateway for the hosts and traffic from these hosts will pass through the routers. It is the job of the routers to determine where the packets belong.
Packets can only be forwarded when a route is present. All layer 3 devices must have a logical address so as to forward packets.
In our scenario above, the network connected to host B is a remote network from Host A, as such, we must have routes to this network from HOST A to HOST B. routers can forward packets based on routes that have either been statically configured or learned dynamically.
NOTE: we will discuss routing in upcoming chapters.
The router forward the packets using a routing table contained in its memory which contains information such as the Destination network, the metric and the next-hop device.
Summary
In this chapter, we have looked at the network layer. We have seen how communication is aided through logical addressing. We outlined the protocols in the network layer and discussed how networks are divided as well as how communication between hosts happens. In the next chapter, we will look at IPv4 addressing in depth and also discuss subnetting.