Table of Contents
Network Layer Addressing
Network layer addressing is one of the network layer’s key responsibilities. The addresses on a network are always logical or software-based.
The Network Layer is the third layer in the OSI model. It responds to transport layer service requests and forwards them to the data link layer.
Converting logical addresses to physical addresses is the responsibility of the network layer. It chooses the best path from the source to the destination and deals with challenges like switching, routing, and data packet congestion.
The fundamental role of the network layer is to transfer packets from a sending host to a receiving host.
Functions of Network Layer:
1. Routing: A packet is sent to the router’s output link when it arrives at the router’s input link and delivered to the next router.
2. Logical Addressing: The data connection layer implements physical addressing, whereas the network layer implements logical addressing. To distinguish between a system’s source and destination, logical addressing is also used. The network layer adds a header to the packet that contains the sender and recipient’s logical addresses.
3. Internetworking: The fundamental goal of the network layer is to create logical links between different types of networks.
4. Fragmentation: It is the process of breaking down packets into the smallest possible data units for transmission across different networks.
Forwarding and Routing:
On the network layer, a router is used to forward packets. Every router comes with a forwarding table. A router sends a packet by checking the header field and indexing it into the forwarding table based on the value of the header field. The router’s outgoing interface connection to which the packet is to be sent is specified by the forwarding table value that matches the header field value.
Network Layer Services:
1. Guaranteed delivery: This layer assures that the packet reaches its intended location.
2. Bounded-delay guaranteed delivery: This service guarantees that the packet will arrive within the specified host-to-host delay.
3. In-Order Packets: With this service, packets are delivered in the order in which they were received.
4. Maximum jitter is guaranteed: With this service, the time between two successive transmissions at the sender is equal to the time between their receipt at the destination.
5. Security services: These are supplied at the network layer, with the source and destination hosts exchanging a session key. The payloads of datagrams sent to the destination host are encrypted by the source host’s network layer. The payload would then be decoded at the target host by the network layer. The network layer ensures data integrity and source authentication services in this way.
Network Layer Addressing:
Network addressing is one of the network layer’s key responsibilities. The addresses on a network are always logical or software-based.
Because it only has one network connection, a host is frequently referred to as an end system. An interface is a physical barrier that separates the host from the connection. As a result, the host is limited to having only one interface.
A router is distinguished from a host by the fact that it has two or more connections. The packet is sent to one of the links when a router forwards a datagram. The border between the router and the connection is known as an interface, and the router can have many interfaces, one for each of its links. IP requires each interface to have an address since it can transmit and receive IP packets.
Each IP address is 32 bits long and is written in “dot-decimal notation,” which separates each byte with a period. 192.168.1.10 is an IP address, with 192 representing the decimal notation of the first 8 bits, 168 representing the decimal notation of the second 8 bits, 1 representing the decimal notation of the third 8 bits, and 10 representing the decimal notation of the fourth 8 bits.
IP Addressing:
IP addresses provide a way to identify between hosts and networks. A host is always associated with a certain network since IP addresses are issued in a hierarchical manner. The host that needs to connect outside its subnet must know the destination network address for the packet/data.
Hosts on different subnets need a way to communicate with one another. This procedure can be handled by DNS. DNS is a server that provides a Layer-3 address for a remote host that is mapped to its domain name. When a host acquires the Layer-3 Address (IP Address) of a faraway host, it sends all of its packets to the gateway. A gateway is a router that has all of the necessary information to route packets to the intended destination.
Classful Addressing:
The notion of classful addressing divides the IPv4 address space into five classes: A, B, C, D, and E. This concept has now been supplanted by classless addressing.
Prior to 1993, IP addresses employed classful addressing, in which each block has a fixed number of hosts and classes have a predetermined number of blocks.
Classful Addressing
An IP address is 32-bit long. An IP address is divided into sub-classes:
- Class A
- Class B
- Class C
- Class D
- Class E
An IP address is divided into two parts:
- Network ID: It represents the number of networks.
- Host ID: It represents the number of hosts.
We can see in the picture above that each class has its own set of IP addresses. The number of bits used in an IP address class, as well as the number of networks and hosts allowed in the class, are determined by the class.
Class A Network
When there are a lot of hosts, this IP address class is employed. The first 8 bits (also known as the first octet) of a Class A network identify the network, while the next 24 bits identify the host into that network.
An example of a Class A address is 102.168.212.226.
“102” identifies the network, whereas 168.212.226 identifies the host.
Class A addresses 127.0.0.0 to 127.255.
255.255 is reserved for loopback and diagnostic tasks and cannot be utilized.
Class B Network
The binary addresses in a B class IP address beginning with 10. The class decimal number of this IP address can range from 128 to 191.
Loopback, which is used for internal testing on the local machine, is assigned the number 127.
The initial 16 bits (known as two octets) aid in network identification. The remaining 16 bits are used to identify the network’s host.
168.212.226.204 is an example of a Class B IP address, where *168 212* identifies the network and *226.204* specifies the Hut network host.
Class C Network
A Class C IP address is one that is appropriate for a small network. Three octets are used to indent the network in this type. This IP address ranges from 192 to 223.
The first two bits of the address are set to 1 and the third bit is set to 0, making the first 24 bits of the address them and the remaining bit the host address in this type of network addressing mechanism. To connect to the network, most local area networks used Class C IP addresses.
Example for a Class C IP address:
192.168.178.1
Class D Network
Multicasting apps only use Class D addresses. Regular networking operations never use Class D. This class handles the first three bits of the address, which are set to “1,” and the fourth bit, which is set to “0.” 32-bit network addresses are known as Class D addresses. To identify multicast groups, all of the values inside the range are used.
As a result, there is no need to extract the host address from the IP address, hence there is no subnet mask in Class D.
Example for a Class D IP address:
227.21.6.173
Class E Network
The first four network address bits of a Class E IP address are set to 1, allowing you to use addresses ranging from 240.0.0.0 to 255.255.255.255. The E class, on the other hand, is reserved and its use is never specified. As a result, many network implementations consider these addresses to be undefinable or unlawful.
Example for a Class E IP address:
243.164.89.28
Classful IP addressing has some drawbacks.
The following are the disadvantages and disadvantages of the classful IP addressing method:
- There’s a chance you’ll run out of address space shortly.
- Class boundaries did not promote efficient address space allocation.
The following are the rules for assigning a Network ID:
The following rules will be used to assign the network ID:
- Because 127 is a class A address reserved for internal loopback functions, the network ID cannot begin with that number.
- All bits of the network ID set to 1 are reserved for use as an IP broadcast address and cannot be used for anything else.
- The network ID’s bits are all set to 0.
They should not be routed because they are used to identify a specific host on the local network.
IP Header Classes:
Class | Address Range | Subnet masking | Example IP | Leading bits | Max number of networks | Application |
---|---|---|---|---|---|---|
IP Class A | 1 to 126 | 255.0.0.0 | 1.1.1.1 | 8 | 128 | Used for a large number of hosts. |
IP Class B | 128 to 191 | 255.255.0.0 | 128.1.1.1 | 16 | 16384 | Used for the medium-size network. |
IP Class C | 192 to 223 | 255.255.255.0 | 192.1.11. | 24 | 2097157 | Used for local area network. |
IP Class D | 224 to 239 | NA | NA | NA | NA | Reserve for multi-tasking. |
IP Class E | 240 to 254 | NA | NA | NA | NA | This class is reserved for research and Development Purposes. |
The following are the rules for assigning a Host ID:
In any network, the Host ID is used to identify the host.
The following rules are used to assign the Host ID:
- Within any network, the Host ID must be unique.
- The Host ID with all bits set to 0 cannot be assigned since it is needed to represent the IP address’s network ID.
- Because it is reserved for the multicast address, the Host ID with all bits set to 1 cannot be assigned.
The following are the rules for assigning a Network ID:
If the hosts are on the same local network, they will have the same network ID issued to them.
The rules for assigning Network ID are as follows:
- Because 127 is used by Class A, the network ID cannot begin with that number.
- Because it is used to designate a specific host on the local network, the Network ID with all bits set to 0 cannot be provided.
- Because it is reserved for the multicast address, the Network ID with all bits set to 1 cannot be assigned.