7: Network Infrastructure

7.1 NIC settings

Every network device has a Network Interface Card (NIC) installed in it.

To see the settings that exists on this network interface card, we can open your command prompt and write the following command,

Ipconfig /all

This will show us all the NIC settings as seen in figure (7.1),

Image1618.JPGFigure 7.1: the NIC settings

We already know the ‘physical address’, the ‘IPv4 address’ and the ‘subnet mask’.

Nevertheless, what is the ‘default gateway’, the ‘DNS servers’ and the ‘DHCP’? That is what we should know in this hour.

7.2 Default gateway

The default gateway is the gateway that interconnects all the network devices in the network with the external world.

In figure (7.2), the default gateway is the router’s interface GE0/0.

Image1625.JPG Figure 7.2:the default gateway

In figure (7.2), if ‘computer A’ needs to send a packet to a computer that exists inside its network, – e.g. ‘computer C’ –, it will send the packet directly to it as seen in figure (7.3),

5548.jpgFigure 7.3: sending a packet inside the network

If ‘computer A’ needs to send a packet to a computer that exists outside its network – e.g. computer 10.0.0.1 that exists outside the network –, it will send the packet to the default gateway as seen in figure (7.4),

Image1633.JPG Figure 7.4: sending a packet outside the network

You can observe that the destination IP is the IP address of the computer that exists outside the network while the destination MAC address is the MAC address of the default gateway. This is because that ‘layer 2’, where the MAC address operates, is responsible for the communication between any two nodes inside the same network.

7.3 DNS server

The DNS (Domain Name System) server is responsible of resolving the names to IP addresses.

This is because computers are able to deal with the IP addresses not the names.

Image1640.JPG Figure 7.5:the DNS server

Suppose that you are setting on ‘computer A’ and need to browse Google’s website, the following will happen,

  1. 1. You open up the web browser and write ‘www.google.com’ in the address bar
  2. 2. ‘Computer A’ asks the DNS server about the IP of ‘www.google.com’ (remember that the DNS server IP is already configured on your NIC)
  3. 3. the DNS server tells ‘computer A’ that the IP of ‘www.google.com’ is ‘209.85.149.103’
  4. 4. ‘Computer A’ starts the communication with ‘209.85.149.103’

7.4 DHCP sever

The DHCP (Dynamic Host Configuration Protocol) server is used to automatically configure NIC settings.

The NIC settings contains the following,

  1. 1. IP address
  2. 2. Subnet mask
  3. 3. Default gateway IP
  4. 4. DNS server IP

There are two ways to configure the NIC settings,

  1. 1. Manually

The network administrator configures every NIC manually. This method has high administrative effort, which is a disadvantage. So, this method is used only when the number of network devices is small.

  1. 2. Automatically (using the DHCP server)

The DHCP server will automatically provide every NIC with the required configuration. This method has a little administrative effort, which is an advantage.

7.4.1 The DHCP configuration

There are some values that should be configured on the DHCP server, the network administrator configure those values on the DHCP server. The following are the values that should be configured on the DHCP server,

Image1649.JPG Figure 7.6: the DHCP server

  1. 1. IP address pool

The IP address range that the DHCP server uses to assign the IP addresses to the network devices.

  1. 2. Subnet mask

The subnet mask that should be assigned to the network devices.

  1. 3. DHCP options

It includes the following, the ‘default gateway IP’, the ‘DNS server IPs’ and the ‘lease time’.

The ‘lease time’ is the lifetime of the IP address that is assigned to a network device. The network device should renew its IP address from the DHCP server before this time expires.

7.4.2 NIC settings assignment process

Suppose that ‘computer A’ in figure (7.7) is starting up and needs to take the NIC configurations from the DHCP server. The following will happen,

Image1656.JPG Figure 7.7:getting the NIC settings

  1. 1. ‘Computer A’ sends a broadcast ‘DHCPDISCOVER’ message as following,

Image1664.JPGFigure 7.8: ‘DHCPDISCOVER‘ packet

Source MAC: the MAC address of ‘computer A’.

Destination MAC: the ‘layer 2’ broadcast (all Ones).

Source IP: all zeros (This means that this computer is asking for its IP address).

Destination IP: ‘layer 3’ broadcast (all Ones).

  1. 2. The DHCP sends a unicast ‘DHCPOFFER’ message to ‘computer A’ offering it an IP address.
  2. 3. ‘Computer A’ sends a broadcast ‘DHCPREQUEST’ message requesting the offered IP address.
  3. 4. The DHCP sends a unicast ‘DHCPACK’ message to ‘computer A’ acknowledging it that the offered IP is assigned to you.

Note: The network administrator may configure the router to work as a DHCP server.

7.4.3 APIPA

APIPA (Automatic Private IP Addressing) is a range of IP addresses (169.254.0.0: 169.254.255.255).

Suppose that a computer is configured to take its NIC settings from a DHCP server.

At startup, the computer will try to communicate with the DHCP by sending a broadcast ‘DHCPDISCOVER’ message.

If the computer is unable to communicate with the DHCP to have its NIC settings from it, it will give itself an APIPA IP address which is an IP address in the range (169.254.0.0: 169.254.255.255).

7.5 ARP

ARP is the ‘Address Resolution Protocol’.

Every computer contains a table called the ‘ARP table’ stored in its memory. This table contains the IP and the MAC addresses of the other devices.

Image1672.JPG Figure 7.9: the ARP table

If a source computer needs to send some data to a destination computer, the source computer must know the IP address and the MAC address of the destination computer.

If the source computer knows only the IP address of the destination computer, it will use the ‘ARP protocol’ to know the MAC address of the destination computer and store those IP and the MAC addresses in its ARP table.

7.5.1 Case study

Image1681.JPG Figure 7.10: the ARP protocol

In figure (7.10), suppose the following,

Computer A needs to send some data to 192.168.18.91 (computer B)

In this case, ‘computer A’ will find the MAC address of 192.168.18.91 in the ARP table. Therefore, ‘computer A’ will simply send the data to ‘computer B’ as following,

Image1690.JPG 

Computer A needs to send some data to 192.168.18.92 (computer C)

  1. 1. In this case, ‘computer A’ will not find the MAC address of 192.168.18.92 in its ARP table.

Therefore, it will use the ARP protocol to get the MAC address of 192.168.18.192 as following,

Image1701.JPG

  1. 2. Then, 192.168.18.92 will reply to ‘computer A’ telling it its MAC address as following,

Image1712.JPG

  1. 3. Then, ‘computer A’ will simply send the data to 192.168.18.92 as following,

Image1719.JPG 

7.5.2 Proxy ARP

5580.jpgFigure 7.11: the proxy ARP

The proxy ARP is used when the computer needs to know the MAC address of a computer in a different network.

As seen in figure (7.11), if PC_A needs to know the MAC address of PC_B, it will use the proxy ARP.

7.5.3 RARP (Reverse ARP)

It is used if the computer knows the MAC address of the destination computer, and it needs to know its IP address.

Currently, the DHCP replaced the RARP. Therefore, nodoby uses RARP now.

7.6 ICMP

ICMP (Internet Control Message Protocol) provides the network devices with the information about different network problems.

Examples of ICMP messages:

Echo request and echo reply:

It is used to examine the network connectivity.

The destination unreachable:

The router uses ICMP to send a message to the sender in case that the destination is unreachable.

7.6.1 Case study

Image1727.JPGFigure 7.12: ICMP protocol case study

In figure (7.12), you are setting on ‘computer A’ and need to test the connectivity to ‘computer B’.

First, ‘computer A’ will use ARP protocol to know the MAC address of ‘computer B’.

Then, ‘computer A’ will use ICMP protocol to send an echo request to ‘computer B’.

Then, ‘computer B’ will use ICMP protocol to send an echo reply to ‘computer A’.

If the echo request and the echo reply are successful, you will know that there are no problems in the connectivity between the source and the destination.