DEV Community

Cover image for Networking for Ethical Hacking: A Beginner’s Guide
indujawla
indujawla

Posted on

Networking for Ethical Hacking: A Beginner’s Guide

In today’s interconnected world, networking is the backbone of how computers communicate and exchange information. Whether it’s sending an email or streaming a video, networking fundamentals are the foundation that makes it possible. This article covers the essential concepts of networking, including IP addresses, MAC addresses, routers, switches, DNS, network protocols, and subnetting and how networks function.

1. Networking Basics

IP Addresses
An IP (Internet Protocol) address is a unique identifier assigned to each device connected to a network. It’s like the mailing address of your home but for devices like computers, smartphones, and servers.

Example: IPv4 address: 192.168.1.10 (a typical IP for local networks)
IPv6 address: 2001:0db8:85a3:0000:0000:8a2e:0370:7334 (used for modern networks as IPv4 addresses run out)
In a local network, every device must have a unique IP address to send and receive data correctly.

MAC Addresses:
MAC (Media Access Control) addresses are hardware addresses unique to each network interface card (NIC). Unlike IP addresses, which can change, MAC addresses are hardcoded into the network interface of devices.

Example:A MAC address might look like 00:1A:2B:3C:4D:5E.
Think of MAC addresses as your device’s “physical” address, while IP addresses are its “location” on the network.

Routers
Routers are devices that connect different networks and direct network traffic. They help packets of data find their way between networks, typically between your home network and the internet.

Example: When you send a request to load a website, the router in your home directs that request to the internet and ensures the information is returned to your device.

Switches
Switches are devices used to connect devices within a local network (LAN). They intelligently direct data to the correct device based on MAC addresses.

Example: In a company, a switch ensures that when computer A sends data to computer B, it doesn’t flood the entire network with that data — it sends it only to computer B.

DNS (Domain Name System)
DNS translates human-readable domain names (like www.example.com) into IP addresses. Without DNS, we’d have to remember the IP addresses of all the websites we want to visit.

Example:When you type www.google.com into your browser, DNS converts it into an IP address (like 172.217.16.196) to load the website.

HTTP/HTTPS
HTTP (Hypertext Transfer Protocol) is used for transmitting data over the web.
HTTPS (HTTP Secure) is the secure version of HTTP, using encryption (SSL/TLS) to protect data.
Example: When you visit a website and see https:// in the URL, it means your connection is secure, protecting sensitive information like passwords from being intercepted.

2. Network Protocols

TCP/IP (Transmission Control Protocol/Internet Protocol)
TCP/IP is the fundamental suite of protocols that governs how data is transmitted across networks. TCP ensures that data packets are delivered accurately, while IP handles the addressing and routing of packets.

Example: When you send an email, TCP ensures the data is broken into packets, sent, and then reassembled in the correct order. IP ensures those packets take the best route to reach their destination.

UDP (User Datagram Protocol)
Unlike TCP, UDP is a connectionless protocol. It sends data without waiting for acknowledgment, making it faster but less reliable. It’s ideal for applications that need speed over reliability, like online gaming or video streaming.

Example: In an online game, UDP might be used to send position updates between players. Even if some packets are lost, the game continues to run smoothly.

ICMP (Internet Control Message Protocol)
ICMP is used for error reporting and diagnostics, commonly seen in tools like “ping,” which checks whether a device on the network is reachable.

Example: When you type ping www.google.com, ICMP sends small packets to Google’s server to see if it responds, helping diagnose network issues.

ARP (Address Resolution Protocol)
ARP is responsible for converting IP addresses into MAC addresses so that devices on a local network can communicate directly with one another.

Example: When your computer wants to send data to another device on the local network (e.g., 192.168.1.15), ARP finds the MAC address associated with that IP, allowing communication at the data link layer.

3. Subnetting

Subnetting divides a larger network into smaller, more manageable sub-networks (subnets). Each subnet can operate independently, improving network performance and security.

IP addresses consist of two parts:

Network part: Identifies the network.
Host part: Identifies a specific device within that network.
Example: In the IP address 192.168.1.100/24:

192.168.1 is the network part.
.100 is the host part.
/24 represents the subnet mask.

Subnet Masks
A subnet mask defines how much of the IP address is reserved for the network and how much is available for hosts. For example, a subnet mask of 255.255.255.0 means that the first three octets (192.168.1) represent the network, while the last octet represents the device.

Example:
Network Address: 192.168.1.0
Broadcast Address: 192.168.1.255
Usable IP Range: 192.168.1.1 to 192.168.1.254
In this example, you can have 254 devices on this network (192.168.1.1 to 192.168.1.254), with 192.168.1.0 being the network address and 192.168.1.255 reserved as the broadcast address (used to communicate with all devices on the network).

Example of Subnetting
If a company has an IP address range of 192.168.0.0/24 (which supports 256 devices) but needs to split it into smaller networks for different departments, they can divide the network using subnetting.

By changing the subnet mask to /26, they can create four subnets, each supporting 62 devices:

192.168.0.0/26
192.168.0.64/26
192.168.0.128/26
192.168.0.192/26
Each subnet can be used for a different department, with its own range of usable IP addresses.

Conclusion

Understanding networking fundamentals, including IP and MAC addresses, routers, switches, DNS, network protocols, and subnetting, is essential for anyone involved in IT or computer science. These concepts form the backbone

For a comprehensive and practical approach to mastering network security and ethical hacking, Airoman’s Ethical Hacking course is an excellent resource. It covers key topics such as network security, penetration testing, vulnerability assessment, and cryptography, providing a deep understanding of how to safeguard systems and identify potential threats. The course emphasizes hands-on learning, featuring projects that simulate real-world scenarios and give you practical experience using industry-standard tools like Metasploit, Wireshark, and Nmap and many more. Additionally, it offers insights into the latest cybersecurity trends and prepares you for certifications like CEH and OSCP. Whether you’re new to ethical hacking or looking to enhance your skills, this course provides all the knowledge and experience you need to succeed in the cybersecurity field.

Instagram
Facebook
Location

Top comments (0)