Networking

Networking

Networking is the building block of any modern group, organization, or company. This section reviews networking history, introduces networking terminology and concepts, and teaches how networking operates.

Terminology

All the items listed above work together when communication between computers is established. Several computers connected in a network can communicate with each other by sending and receiving packets by network protocols.

basic network structure

Basic Network Structure

The basic structure is shown below, with three network devices for packet management. Switches forward packets within the same network, and routers transfer packets among networks.

Network Addressing

Internet Protocol (IP) Addresses

An IP address is used to identify computers on the network uniquely. Other IP addresses are used for access rights, permission management, and documenting activity (who did what).

Currently, two versions of IP addresses are used: IPv4 and IPv6. IP addresses enable communication among networks. They are also known as logical addresses because they are configured by software rather than physically embedded on the network card.

IPv4 is composed of four numbers divided by dots (.). Each number is called an octet (a collection of eight bits or one byte), and the value of each octet can be between 0 and 255. IPv4 is a 32-bit format with a decimal value that has the following structure:192.168.0.0.

Decimal is a numerical system composed of 10 values (Base 10) 0–9. It is the world's most popular system for counting and calculating (for example, 1, 15, 246, and so on). A Base 10 digit represents each value.

A bit (binary digit) is the smallest data unit a computer uses. It represents a logical state of 0 or 1. Based on it, the computer can perform calculations and store data. Together, several bits represent a piece of data or an instruction that can be executed.

IPv4 can produce a total of 4,294,967,296 addresses. Today, when so many electronic devices (such as dishwashers and washing machines) use IP addresses, almost no IPv4 addresses are left.

IPv6 is composed of eight hexadecimal values divided by colons (:). Each value is called a hextet. IPv6 is a 128-bit format with the following structure: 2001:0db8:0000:0042:0000:8a2e:0370:7334.

IPv6 can produce a total of 340,282,366,920,938,463,463,374,607,431,768,211,456—which is (2128) addresses!

subnetting

Subnetting is a logical way of dividing networks into smaller networks. It is also used for grouping IP addresses in a network, which helps determine the network scope (from IP to IP).

There are three main types (classes) of networks: Class A, Class B, and Class C.

Class A Networks

~16M hosts (IP addresses) are represented by the subnet mask 255.0.0.0 and the prefix/8. For example, the network address 10.0.0.0/8 states that 10 is the network portion (this does not change), and the rest is for the hosts. A host can have the addresses 10.5.1.240, 10.0.25.150, 10.150.1.15, etc.

Class B Networks

65,024 hosts (IP addresses) are represented by the subnet mask 255.255.0.0 and the prefix /16. For example, the network address 10.0.0.1/16 states that 10.0 is the network portion (this does not change), and the rest is for the hosts. A host can have the addresses 10.0.1.240, 10.0.25.150, 10.0.1.15, etc.

Class C Networks

A total of 254 hosts (IP addresses) is represented by the subnet mask 255.255.255.0 and the prefix /24. For example, the IP address 10.0.0.1/24 states that 10.0.0 is the network portion (this does not change), and the rest is for the hosts. A host can have the addresses 10.0.0.240, 10.0.0.150, 10.0.0.15, etc.

Private IP Addresses

Private IP addresses are defined in RFC 1918, which describes IP addresses in an internal or private network. The idea is to delay the depletion of IPv4 addresses. Private addresses cannot be used to communicate directly over the internet.

The following addresses are recommended as internal or private addresses:

10.0.0.0 – 10.255.255.255 

172.16.0.0 – 172.31.255.255

192.168.0.0 – 192.168.255.255

IP Address Configuration Modes

This mode is configured manually in the network interface configuration panel. It can be accessed via the network and sharing center on a computer.

This mode sets the IP automatically, and the IP can be used for a limited time. It is configured when selecting the automatic option. The IP is allocated automatically by a router or DHCP server.

router & switches

Network Traffic

If a network is like a road system, routers and switches are interchanges, junctions, and traffic lights. They redirect traffic across the network and help deliver traffic to specific addresses. They can also allow or block specific traffic.

Data Packets

A network is similar to a road system, where packets are the vehicles moving among sources and destinations, while routers and switches control the traffic flow.

Routers and Switches

Routers and switches provide traffic control like intersections, junctions, and traffic lights. They decide when and where to forward a packet to reach its destination.

Switches

A switch is a networking device that forwards traffic between computers within the same network, based on MAC addresses. Multiple computers are connected to a switch, and the switch maintains a table that binds physical switch ports and MAC addresses. When a packet arrives at one of the switch's ports, it inspects its destination MAC address and forwards it to the port connected to the end device that matches that MAC address. They act as stop signs, which regulate local traffic.

When the switch receives a data packet:

● It inspects the destination MAC address.

● It looks up the table for the MAC address.

● It forwards the packet to the MAC destination address through the physical port.

Routers

A router is a networking device that forwards traffic between networks based on IP addresses. Routers are connected to two (or more) links, each from a different network. They identify the packet’s source and destination by IP address and use routing tables to direct the data to its destination.

Routing tables are internal lists that tell the network which router is connected and where traffic should be forwarded. According to its destination, the router inspects the table to determine the most suitable route for a packet (where it needs to be forwarded). It acts as a stop light, regulating traffic from one neighborhood to another.

When a router receives a data packet:

● It inspects the destination IP address.

● It determines where it should be sent according to its routing table.

● It verifies if the traffic is allowed by the routing policy (ACL).

● If allowed, it forwards the packet to the next network.

Router and Switch Protection

Switch Port Security

Switch port security is a mechanism that protects against MAC flooding. The number of addresses a switch can store in its table is limited. When the limit is exceeded, the switch begins to forward any received packets to all of its ports. By initiating a MAC flooding attack, information from computer A, designated for computer B, will also be forwarded to computer C (the potential attacker).

Port security allows limits for ports and takes note of specific MAC addresses to prevent this type of attack. In addition, it is also used to stop unauthorized devices from connecting to the network and using the switch.

Router ACL

The Access Control List (ACL) is a rule-based feature that allows network administrators and engineers to configure basic traffic filtering. ACL is a series of rules that determine whether to drop a packet or forward it based on information in the packet header.