4: Network Interface Layer

4.1 Ethernet protocol in the physical layer

The Ethernet protocol has another name, which is ‘IEEE 802.3’. Moreover, it specifies the electrical and physical specifications of the devices’ network interfaces, the cables, and the connectors that connect the network interfaces to the cables.

The Ethernet protocol determines some standards that are used to determine the specifications of the cables that connect between the network devices.

Every standard determines the cable type that should be used, and the maximum usable length of this cable.

4.1.1 Different cable types

1. Unshielded Twisted Pair (UTP)

Image1152.JPG Figure 4.1:the UTP cable and its connector ‘RJ45‘

The UTP cable consists of eight ‘wires’. Every two wires are twisted with each other, and they are called a ‘pair’. Therefore, the UTP cable has four pairs.

Every pair consists of two wires. One of them has a certain color and the other has the same color mixed with the white color.

The eight wires of the UTP cable has the following colors, brown, white brown, blue, white blue, orange, white orange, green, and white green.

The UTP cable connector is called the ‘RJ45’, which consists of eight bins. Every bin connects to one of the UTP wires.

2. Coaxial cable

Another cable type that can be used to connect between the end devices is called the ‘coaxial cable’ which is seen the figure (4.2).

Image1163.JPG Figure 4.2: the coaxial cable

3. Optical fiber cable

Image1174.JPG Figure 4.3: the optical fiber cable

The optical fiber cable transmits optical pulses instead of electrical signals. So, it does not get interfered by electrical interference.

There are two types of the optical fiber cables, single-mode, and multimode.

4.1.2 Ethernet protocol cable standards

As seen in table (4.1), every standard determines the cable type it uses and the maximum length of this cable that can be used.

Image1181.JPGTable 4.1: Ethernet protocol cable standards

As you can see, the standard name consists of three parts,

First part

It determines the connection speed,

If the first part is ‘10’, this means that the speed of the connection is 10Mbps (Ethernet connection).

If the first part is ‘100’, this means that the speed of the connection is 100Mbps (fast Ethernet connection).

If the first part is ‘1000’, this means that the speed of the connection is 1000Mbps (gigabit Ethernet connection).

Second part

It determines the modulation technique; ‘Base’ means that the standard is using the ‘baseband modulation’.

Third part

It determines the type of cable that should be used.

From the previous illustration, we can know that, ‘100BaseFX’ means that the connection is a ‘fast Ethernet’ connection and the cable type is an ‘optical fiber multimode’ cable.

4.2 UTP cabling

The UTP cable connector is called ‘RJ45’. The ‘RJ45’ has eight pins; every pin should be connected to one of the UTP cable wires.

Image1191.JPG Figure 4.4: a UTP cable and its connector

There are three connection methods for the UTP cable with its connector, every method is used in a certain situation. The three methods are, ‘straight through’, ‘cross over’, and ‘rolled’.

5352.jpgFigure 4.5: dividing network devices into two boxes

We can divide the network devices into two groups or boxes as seen in figure (4.5).

The devices in any network are one of the following, a host (e.g. a PC or a server), a hub, a switch, or a router.

As seen in figure (4.5), we can put the host and the router in the same group, and we can put the hub and the switch in the same other group.

If we need to connect between two devices that exist in the same group, we use a ‘cross over’ cable.

If we need to connect between two devices that exist in different groups, we use a ‘straight through’ cable.

Straight through cable

In the straight through cable, the first pin in the first connector is connected to the first pin in the second connector, and the same connection for the remaining pins as seen in figure (4.6).

Image1198.JPG Figure 4.6: a straight through cable

Cross over cable

In the cross over cable, as seen in figure (4.7), we connect the first pin in the first connector to the third pin in the second connector, and we connect the second pin in the first connector to the sixth pin in the second connector, and the third pin in the first connector to the first pin in the second connector.

Image1207.JPG Figure 4.7: a cross over cable

Rolled cable

It is used to connect a PC to the router’s consol port in case that we need to configure the router.

Image1214.JPG Figure 4.8: a rolled cable

As seen in figure (4.8), we connect the first pin in the first connector to the last pin in the second connector, and connect the second pin in the first connector to the seventh pin in the second connector, and so on until we reach the last pin.

4.3 ‘Hub’, a device working in the physical layer

As seen in figure (4.9), the ‘hub’ is a device that has several ports in it. Every port can be connected to a network device.

When the frames arrive to the hub on one of its ports, it forwards those frames to all the devices connected to its ports.

5365.jpgFigure 4.9: sending data between the end devices through a hub

As seen in figure (4.9), suppose that we have a network that contains several computers, ‘computer A’ needs to send some data to ‘computer B’.

Simply, ‘computer A’ will send the data to the hub, and then the hub will take the data and flood it through all of its ports. Therefore, the data will reach ‘computer B’.

4.4 Ethernet protocol in the data link layer

The function of the Ethernet protocol in the data link layer is to enable two end devices in the same network to be able to send data to each other using the physical address.

The physical address in the Ethernet protocol is called the ‘MAC address’.

Suppose that we have three computers connected with a hub, as seen in figure (4.10).

Suppose that ‘computer A’ needs to send some data to ‘computer B’.

To accomplish this task, ‘computer A’ will send a frame that contains the MAC address of the ‘computer B’ as the destination address.

Image1222.JPG Figure 4.10: computers in the same network connected using a hub

4.4.1 Ethernet frame

In figure (4.11), we can see the full components of the Ethernet frame.

Image1230.JPGFigure 4.11: Ethernet frame

Data is the data that are received by the data link layer from the upper layers.

Preamble is a stream of bits that is used by the source and the destination to make synchronization between them.

Length is the length of the whole frame in bytes.

Destination MAC address is the MAC address of the destination device.

Source MAC address is the MAC address of the source device.

FCS (Frame Check Sequence), Ethernet uses it to check if there are any errors in the received frame, and it will reject the frame if any errors are found.

4.5 What is the MAC address?

The MAC (Media Access Control) address may be called the ‘physical address’ or the ‘hardware address’.

The manufacturer of the network interface card (NIC) hard codes the MAC address on every (NIC).

Every NIC has its unique MAC address.

The MAC address consists of six bytes (48 bits).

The most significant 24 bits (3 bytes) represents the Organizationally Unique Identifier (OUI), which is a unique code for every manufacturer of the NICs.

The least significant 24 bits (3 bytes) represents the manufacturer assigned code to the NIC.

Image1238.JPG Figure 4.12: example of a MAC address

4.6 ‘Switch’, a device working in the data link layer

The switch is an intelligent device, because when it receives an electrical signal on one of its ports, it does not flood it through all of the ports, but it looks at the destination MAC address and forwards the data through a certain port according to this destination MAC address. This process is called filtering’.

The switch forwards the data it receives to a certain port depending on the MAC address table’, which is stored on the switch’s memory.

The MAC address table contains two columns, the ‘Port Number’, and the ‘MAC address’, as seen in figure (4.13).

Image1247.JPG Figure 4.13: the MAC address table

4.6.1 Case study

In Figure (4.14), ‘computer A’ needs to send some data to ‘computer B’.

5381.jpgFigure 4.14: sending data through a switch

In this case, ‘computer A’ will send the frames with the MAC address of the ‘computer B’ as the destination MAC address. When the frames reach the switch, the switch will look for the destination MAC address in its MAC address table. Therefore, it will decide through which port it should forward the frames.

In this case, the switch will forward the frames through port ‘fa 0/1’.

Some of the switch operation notes,

  1. 1. How does a switch build its MAC address table?

Whenever the switch receives a frame on any port of its ports, it will look at the source MAC address that exists in this frame. Then, it will record this MAC address in its MAC address table, combined with the switch port that received the frame.

  1. 2. What happens if the switch did not find any match to the destination MAC address in the MAC address table?

In this case, it will flood the frame out of all of its ports. Therefore, in this case it will work as a hub.

4.7 Collision domain

The collision domain is the group of devices that share the same medium. This means that if two of those devices sent some data in the same time, there will be a collision between those data.

The hub does not divide the collision domain

In figure (4.15), we have three computers connected with a hub. The three computers exist in the same collision domain. This means that if two of those devices sent some data at the same time, a collision will happen between those data. In addition, no device will receive any data.

5397.jpg Figure 4.15: the hub does not divide the collision domain

To avoid the collision between the data, devices should use CSMA/CD protocol.

The switch divides collision domains

In figure (4.16), we have three computers connected with a switch.

5408.jpg Figure 4.16: the switch divides the collision domain

The switch divides the collision domain. Therefore, every computer exists in its own collision domain. This means that if two of those computers sent some data in the same time, there will be no collision between those data.

So, using a switch will increase the through output of the network and will enhance the network performance.