Network Layer And Addressing

FREE Online Courses: Elevate Your Skills, Zero Cost Attached - Enroll Now!

The Network Layer is the OSI model’s third layer. It responds to service requests from the transport layer and sends them to the data link layer.

The network layer is responsible for converting logical addresses into physical addresses. It decides the path from the source to the destination and manages issues such as switching, routing, and data packet congestion.

The network layer’s primary function is to transport packets from the sending host to the receiving host.

Functions of Network Layer:

1. Routing: When a packet arrives at the router’s input link, it is routed to the router’s output link. A packet from S1 to R1, for example, must be sent to the next router on the way to S2.

2. Logical Addressing: The physical addressing is implemented by the data connection layer, while the logical addressing is implemented by the network layer. Logical addressing is also utilised to distinguish between a system’s source and destination. The network layer appends a header to the packet that contains the logical addresses of the sender and recipient.

3. Internetworking: The network layer’s primary function is to establish logical connections between different types of networks.

4. Fragmentation: It is the act of breaking down packets into the smallest individual data units that transit across various networks.

Forwarding and Routing:

A router is used on the network layer to forward packets. A forwarding table is included on every router. A router passes a packet by inspecting the header field and then indexing it into the forwarding table using the header field value. The forwarding table value matching to the header field value specifies the router’s outgoing interface connection to which the packet is to be forwarded.

Network Layer Services:

1. Guaranteed delivery: This layer offers a service that ensures the packet arrives at its destination.

Technology is evolving rapidly!
Stay updated with DataFlair on WhatsApp!!

2. Guaranteed delivery with bounded delay: This service assures that the packet will arrive within the given host-to-host delay bound.

3. In-Order packets: This service assures that packets reach their destination in the order they were delivered.

4. Guaranteed maximum jitter: This service assures that the time between two consecutive transmissions at the sender equals the time between their receipt at the destination.

5. Security services: These are provided at the network layer through the use of a session key between the source and destination hosts. The payloads of datagrams transmitted to the destination host are encrypted by the network layer of the source host. The payload would subsequently be decrypted by the network layer at the target host. In this manner, the network layer ensures data integrity and source authentication services.

Network Layer Addressing:

One of the network layer’s primary duties is network addressing. Network addresses are always logical, or software-based.

A host is sometimes called an end system since it only has one network connection. An interface is the barrier between the host and the connection. As a result, the host can only have one interface.

A router differs from a host in that it has two or more connections to it. When a router forwards a datagram, the packet is sent to one of the links. An interface is the border between the router and the connection, and the router can have many interfaces, one for each of its links. Because each interface may transmit and receive IP packets, IP needs each interface to have an address.

Each IP address is 32 bits long and is expressed by “dot-decimal notation,” in which each byte is written in decimal form and separated by a period. An IP address would be 192.10.216.9, where 192 is the decimal notation of the first 8 bits of an address and 10 is the decimal notation of the second 8 bits of an address.

IP Addressing:

IP addressing offers a technique for distinguishing between hosts and networks. Because IP addresses are issued in a hierarchical fashion, a host is always associated with a certain network. The host that needs to connect outside its subnet must know the target network address to which the packet/data is to be delivered.

Hosts on separate subnets require a means for locating one another. DNS can handle this operation. DNS is a server that offers a distant host’s Layer-3 address that is mapped to its domain name. When a host obtains the distant host’s Layer-3 Address (IP Address), it sends all of its packets to its gateway. A gateway is a router that has all of the information needed to route packets to the target host.

Classful Addressing:

There are 2 parts of an IP Address:

  • Network ID: Signifies number of networks
  • Host ID: Signifies number of hosts

1. Class A:

class a

An IP address is allocated to networks with a high number of hosts in Class A. The network ID has an 8-bit length. The host ID has a length of 24 bits.

The first bit in the higher order bits of the first octet is always set to 0 in Class A, while the following 7 bits define the network ID. In any network, the host ID is determined by the remaining 24 bits.

Total number of networks = 2⁷ = 128

Total number of hosts = 224 – 2 = 16777214

2. Class B:

class b

An IP address is issued to Class B networks, which range in size from modest to big. The Network ID is made up of 16 bits. The Host ID has a length of 16 bits.

The higher order bits of the first octet are always 10 in Class B, while the remaining 14 bits define the network ID. The last 16 bits define the Host ID.

Total number of networks = 214 = 16384

Total number of hosts = 216 – 2 = 65534

3. Class C:

class c

Only small-sized networks are allocated an IP address in Class C. The Network ID has a length of 24 bits. The host ID has an 8-bit length.

The higher order bits of the first octet are always set to 110 in Class C, while the remaining 21 bits define the network ID. The host ID, which consists of 8 bits, identifies the host in a network.

Total number of networks = 221 = 2097152

Total number of hosts = 28 – 2 = 254

4. Class D:

class d

An IP address in Class D is designated for multicast addresses. It doesn’t have subnetting. The first octet’s higher order bits are always 1110, while the remaining bits decide the host ID in any network.

5. Class E:

class e

An IP address is utilised in Class E for future usage or for research and development. It doesn’t have any subnetting. The first octet’s higher order bits are always 1111, while the remaining bits decide the host ID in any network.

Network ID Rules:

Within any network, the Host ID must be unique. The Host ID with all bits set to 0 cannot be issued since it represents the network ID of the IP address. Because it is reserved for the multicast address, the Host ID with all bits set to 1 cannot be issued.

Host ID Rules:

Because 127 is utilised by Class A, the network ID cannot begin with that number. The Network ID with all bits set to 0 cannot be issued since it is needed to identify a specific host on the local network. Because it is reserved for the multicast address, the Network ID with all bits set to 1 cannot be issued.

Classful Addressing:

classful addressing

Classful addressing is a concept that splits the IPv4 address space into five classes: A, B, C, D, and E. This idea is now obsolete and has been superseded by classless addressing.

Prior to 1993, IP addresses used classful addressing, in which classes have a predetermined number of blocks and each block has a fixed number of hosts.

ClassHigher BitsNetwork ID BitsHost ID BitsNumber of NetworksNumber of Hosts
A082427224
B101616214216
C11024822128
D1110Not DefinedNot DefinedNot DefinedNot Defined
E1111Not DefinedNot DefinedNot DefinedNot Defined

Summary:

In this article, we took an in-depth look at the functions and services offered by the network layer, such as forward and routing, and logical addressing .We also looked at the various kinds of IP addressing available to us in the network layer. We looked at the different classes of networks under both classless and classful addressing. We also looked at the rules used to assign network and host IDs.

You give me 15 seconds I promise you best tutorials
Please share your happy experience on Google

follow dataflair on YouTube

Leave a Reply

Your email address will not be published. Required fields are marked *