5: Internetworking Layer

5.1 IP (Internet Protocol)

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.

Image1258.JPG Figure 5.1: the IP address format

Every byte of the IP address equals a decimal value from the range ‘0:255’.

5.1.1 IP address classes

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.

Image1269.JPGFigure 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.

How to determine the class of the IP address

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’.

5.2 Network IP?

The network IP is an IP address that is given to a network.

5436.jpgFigure 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’.

How to get the network IP from any IP address

To get the network IP from any IP address we should take the following steps,

  1. 1. Determine the network portion and the host portion in the IP address.
  2. 2. Convert the host portion of the IP address to ‘zeros’.

Note, we should do ‘step 2’ while the IP address is written in the binary numbering format.

Case study:

5447.jpgFigure 5.4: case study – getting the network IP address

5.3 Broadcast IP?

The broadcast IP is used when we need certain packets to reach all of the devices in a certain network.

Image1276.JPG Figure 5.5: the broadcast IP

How to get the broadcast IP from any IP address

To get the broadcast IP from any IP address, we do the following,

  1. 1. Determine the network portion and the host portion in this IP address.
  2. 2. Convert the entire host portion to ‘ones’.

Note, we should do ‘step 2’ while the IP address is written in the binary numbering format.

Case study:

Image1284.PNGFigure 5.6: case study – getting the broadcast IP address

5.4 Unicast, multicast and broadcast communication

5.4.1 Unicast communication

Unicast communication is a ‘one to one’ communication. One device, a source, sends some data to only one device, a destination.

Image1359.JPG Figure 5.7: the unicast communication

In the unicast communication, the packet will be as following,

Image1368.PNG Figure 5.8: the unicast packet

5.4.2 Multicast communication

The multicast communication is a ‘one to many’ communication. One device is sending data to many devices in a certain network.

Image1375.JPG Figure 5.9: the multicast communication

In the multicast communication, the destination IP is a ‘class D’ IP address.

Image1383.JPG Figure 5.10:the multicast packet

5.4.3 Broadcast communication

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.

5466.jpgFigure 5.11: the undirected broadcast communication

In the undirected broadcast communication, the destination IP will be all ones (255.255.255.255).

Image1391.JPG 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.

Image1399.JPG Figure 5.13:the directed broadcast communication

In this case, the destination IP will be the broadcast IP of the destination network.

Image1408.JPG Figure 5.14:the directed broadcast packet

5.5 IP header

Image1419.JPG 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.

5.6 ‘Router’, a device working in the internetworking layer

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.

5.7 Broadcast domain

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.

Image1432.JPG Figure 5.16: the broadcast domain

5.7.1 Broadcast domain vs. collision 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.

5480.jpgFigure 5.17: the broadcast domain vs. the collision domain