The function of the internetworking layer is to route the data between networks using the logical address.
One of the protocols that are working in the internetworking layer is the internet protocol.
The logical address in the internet protocol is called the ‘IP address’.
The IP address is formed of four bytes, which are equivalent to 32 bits.
Figure 5.1: the IP address format
Every byte of the IP address equals a decimal value from the range ‘0:255’.
IP addresses are grouped into different ‘IP classes’ depending on the value of the first byte in every IP address.
From the class of the IP address, we can determine the network portion and the host portion of this IP address.
When we determine the network portion and the host portion of the IP address, we can determine the network IP and the broadcast IP of this IP address.
Figure 5.2: the classes of the IP address
From figure (5.2), we can deduce the following,
In the ‘class A’ IP address, the network portion is the first byte while the host portion is the last three bytes.
In the ‘class B’ IP address, the network portion is the first two bytes while the host portion is the last two bytes.
In the ‘class C’ IP address, the network portion is the first three bytes while the host portion is the last byte.
In the ‘class A’ IP addresses, the first byte in the IP address is a decimal value in the range ‘0: 127’.
In the ‘class B’ IP addresses, the first byte in the IP address is a decimal value in the range ‘128: 191’.
In the ‘class C’ IP addresses, the first byte in the IP address is a decimal value in the range ‘192: 223’.
In the ‘class D’ IP addresses, the first byte in the IP address is a decimal value in the range ‘224: 239’.
In the ‘class E’ IP addresses, the first byte in the IP address is a decimal value in the range ‘240: 255’.
The network IP is an IP address that is given to a network.
Figure 5.3: network IP
Suppose that we have some network devices that exist in the same network, the network administrator can assign a certain IP address to every device.
The network IP is the IP address of the network that contains all the network devices.
In figure (5.3), we can see that the network IP of the network that contains all the devices is ‘10.0.0.0’.
To get the network IP from any IP address we should take the following steps,
Note, we should do ‘step 2’ while the IP address is written in the binary numbering format.
Figure 5.4: case study – getting the network IP address
The broadcast IP is used when we need certain packets to reach all of the devices in a certain network.
Figure 5.5: the broadcast IP
To get the broadcast IP from any IP address, we do the following,
Note, we should do ‘step 2’ while the IP address is written in the binary numbering format.
Figure 5.6: case study – getting the broadcast IP address
Unicast communication is a ‘one to one’ communication. One device, a source, sends some data to only one device, a destination.
Figure 5.7: the unicast communication
In the unicast communication, the packet will be as following,
Figure 5.8: the unicast packet
The multicast communication is a ‘one to many’ communication. One device is sending data to many devices in a certain network.
Figure 5.9: the multicast communication
In the multicast communication, the destination IP is a ‘class D’ IP address.
Figure 5.10:the multicast packet
The broadcast communication is a ‘one to all’ communication. One device is sending some data to all devices in a certain network.
Undirected broadcast
In the undirected broadcast communication, one device is sending data to all the devices in its network.
Figure 5.11: the undirected broadcast communication
In the undirected broadcast communication, the destination IP will be all ones (255.255.255.255).
Figure 5.12:the undirected broadcast packet
Directed broadcast
In the directed broadcast communication, one device is sending data toall devices in a certain network.
Figure 5.13:the directed broadcast communication
In this case, the destination IP will be the broadcast IP of the destination network.
Figure 5.14:the directed broadcast packet
Figure 5.15: the IP header
Ver: protocol version
HL: the header length in 32 bit unit.
ToS: (Type of Service), It helps the device to determine the priority of this packet.
Total length: is the total length of the packet including the header and the data.
Identification: it is a unique number for every packet.
Fragment offset: it is used in the fragmentation and the reassembly of the data.
TTL: (Time To Live), it is a lifetime for the packet. Every network device reduces TTL by one, when TTL=0, the packet will be discarded by the network device.
Protocol: it specifies the upper layer protocol.
Header Checksum: it is used to check if any errors occurred in the header during its transmission.
The router is a device working in the internetworking layer (layer 3). The function of the internetworking layer is to route the data between the networks.
The router is a device that contains several ports. Every port is connected to a certain network.
There is a table that is stored in the router’s memory, called the ‘routing table’, which contains the data about which network is connected to which port.
The broadcast domain is the group of network devices, in this group, if one of the devices sent an undirected broadcast packet; this broadcast packet will reach all of the other devices in this group.
Figure 5.16: the broadcast domain
‘Layer 3’ devices – like the router – divides the broadcast domain.
‘Layer 2’ devices – like the switch – divides the collision domain.
‘Layer 1’ device – like the hub – has no effect on any of both domains.
Figure 5.17: the broadcast domain vs. the collision domain