Networking 101 - Part 1
This article serves as an introductory guide to the fundamentals of networking, aiming to provide beginners with a foundational understanding of how devices connect and communicate within a network, with a focus on networking in AWS.
Overview
In this article, you will get an introductory understanding of how devices connect and communicate in a network. You will learn about the different roles devices can play in a network, how networks are structured, and the basics of network types and connections. This is the first part of Networking 101 a series of articles focused on mastering networking knowledge and providing beginners with an introduction to networking in AWS.
What is Networking?
Networking refers to the practice of linking together multiple devices to facilitate communication and the sharing of resources. These devices are known as nodes.
There are two primary types of nodes in a network:
- Host Nodes (known as Servers): These centralized nodes are responsible for sharing resources such as files, videos, and applications. Their primary purpose is to distribute these resources to client nodes and other host nodes.
- Client Nodes: These nodes rely on host nodes to access shared resources. We are surrounded by client nodes in our daily lives, including smartphones, computers, smart TVs, routers, and various other electronic devices.
To link together multiple nodes, it's essential to have networking devices, which are electronic devices designed to connect and link various devices. The most well-known networking devices that we commonly use in our homes and offices are Routers and Switches. These devices are crucial for enabling communication between connected nodes.
Understanding the Flow in a Network
The diagram illustrates the sequential flow of data as it moves from individual devices through various network components, culminating in cloud integration:
- Client nodes, like smartphones and computers, initiate communication by sending data to a switch. The switch acts as a central point that receives and manages the flow of data between these devices.
- The switch then forwards this data to a router. The router is a device that directs traffic between different networks. In this context, it connects the local network of client nodes to other networks, such as a company's main network or the internet.
- The router directs incoming and outgoing data to the appropriate destinations. For data that is intended for services hosted on a server, such as a website or a file storage service, the router will forward this data to the server, which is the host node.
- For data that needs to reach the internet, the router sends this data to the Internet Service Provider (ISP). The ISP facilitates the connection to the wider internet, allowing for external communication and access to online resources.
- Data that needs to be processed or stored in cloud services provided by AWS (Amazon Web Services) is transmitted from the ISP to the AWS Cloud. The cloud represents a network of remote servers where applications, data processing, and storage services can be accessed on demand.
Understanding Network Types
Networks can be categorized into two types based on the geographical scope they cover:
- LAN (Local Area Network): A LAN connects devices within a confined area, such as the various gadgets in your household—smart TVs, smartphones, computers, and home assistants like Alexa.
- WAN (Wide Area Network): Conversely, a WAN spans a much broader area, linking multiple local networks—like those in homes and offices—via extensive fiber optic networks all the way to the Internet Service Provider (ISP).
Understanding OSI model
Once we grasp how devices communicate with each other, it's helpful to delve deeper into how nodes interact and share resources. To do this, we need to understand the OSI model. But what is the OSI model?
The OSI model, or Open Systems Interconnection Model, is like a blueprint for how data travels from one device or node to another across a network. It begins with the physical connections, like cables, and ends with the applications we use. This model breaks down the communication process into seven distinct layers, each with its own specific role in ensuring data is transmitted accurately and efficiently.
The seven layers are:
- Physical Layer: Deals with the physical connection between devices, like cables and switches. Example: The Ethernet cable connecting your computer to the router.
- Data Link Layer: Manages how data packets are sent and received over the physical layer. Example: The way your computer knows to send a message to the printer and not the fridge.
- Network Layer: Handles the routing of data packets across different networks. Example: The way your email finds its way from your computer to your friend's computer across the internet.
- Transport Layer: Ensures data is transferred reliably and in the correct order. Example: Making sure that your friend receives all parts of your long chat message in the right order.
- Session Layer: Manages the connection and session between two devices. Example: Starting a video call with your friend, chatting, and then ending the call.
- Presentation Layer: Translates data into a format that the application layer can understand. Example: Turning the 0s and 1s of computer language into a viewable video on your screen.
- Application Layer: Interfaces with the applications and is the closest to the end-user. Example: Using WhatsApp to send a message to your friend.
💡 A data packet is like a little digital envelope that carries information across a network. When you send an email or message, it's broken down into these packets, which then travel through the network to reach their destination, where they're put back together to show the original message.
Understanding IP Addresses
To ensure that information is accurately sent to the correct nodes and that each node can communicate effectively, it is essential to have a unique identifier for each node. This is where the IP address, or Internet Protocol Address, comes into play. It serves as a unique identifier for every device connected to a network, much like a postal address for your computer or smartphone, enabling it to send and receive data over the internet or a local network.
There are two types of IP Addresses:
- IPv4 (Internet Protocol version 4):
- The traditional format that has been in use for decades.
- Consists of four sets of numbers separated by periods (e.g.
172.16.254.1
). - Can support approximately 4.3 billion unique addresses.
- IPV6 (Internet Protocol version 6):
- A newer format developed to address the shortage of IP addresses due to the growing number of internet-connected devices.
- Consists of eight groups of four hexadecimal digits separated by colons (e.g.,
2001:0db8:85a3:0000:0000:8a2e:0370:7334
). - Can support a virtually unlimited number of unique addresses, providing a solution to the limitations of IPv4.
The most commonly used version of IP addresses is IPv4, which consists of four sections, each separated by a dot (.) and ranging from 0 to 255:
172.16.254.1
- First Octet: This section often indicates the network's class and size. For example:
172.0.0.0
- Second Octet: Combined with the first octet, it helps identify the specific network within a larger network class. For example:
172.16.0.0
- Third Octet: This section is used to define subnetworks within a larger network, improving data routing efficiency. For example:
172.16.254.0
- Fourth Octet: This section uniquely identifies a specific device (or host) within the network or subnetwork. For example:
172.16.254.1
Each section is known as an "octet" because it is represented by eight binary digits (bits) in the binary form of the IP address. Thus, the entire IPv4 address comprises 32 bits, with each octet contributing 8 bits.
how do we assign IP addresses to our nodes?
To address this, we use a method called Classless Inter-Domain Routing (CIDR) in IPv4.
CIDR involves appending a number after the IPv4 address, which specifies the range of available IP addresses for that address. For example, consider 172.16.2.0/24
; the CIDR value is 24, indicating that there are 8 bits available for defining IP address ranges. Since each octet represents 8 bits, the first three octets are fixed, leaving the last octet available. This creates a range from 172.16.2.0
to 172.16.2.255
, allowing us to assign any of these IP addresses to our nodes or devices.
To calculate the number of available IP addresses, you can use the formula 2^(32-CIDR)
. This gives you the following possible combinations:
0.0.0.0/32
⇒ 1 address10.0.0.0/8
⇒ 16,777,216 addresses10.1.0.0/16
⇒ 65,536 addresses10.1.20.0/24
⇒ 256 addresses0.0.0.0/0
⇒ 4,294,967,296 addresses
Understanding Subnets
Now that we understand how to assign IP addresses to our nodes or devices, let's discuss subnets. Subnets involve dividing a network into smaller segments to enhance efficiency and security. All nodes in the same subnet can communicate directly, while communication between different subnets requires a router.
A subnet is a portion of a network that represents a segmented part of the entire network. This segmentation is crucial for securely grouping nodes that need to communicate with each other. To create our subnets, we will use CIDR Blocks to determine the number of subnets we want to have. The number of subnets will depend on the number of available IP addresses we require.
One important aspect of subnets is that the first and last IP addresses in each subnet are typically reserved. Some cloud providers may reserve more than just these two addresses. Additionally, it's crucial to note that the CIDR block of a subnet cannot be changed, and subnet CIDR blocks cannot overlap with each other. This means that if you have a subnet with CIDR block 127.10.0.0/24
, your next subnet should start in the next available range, for example, 127.10.1.0/24
. This restriction ensures that subnet CIDR blocks remain distinct and do not conflict with each other.
To establish subnets with a specific number of available addresses, as illustrated, you would take the following steps:
- Determine the Number of Subnets Needed: Decide how many subnets you need based on your network requirements.
- Calculate the Required CIDR Prefix Length: Use the formula
CIDR Prefix Length = [log2(Number of Required Addresses + 2)]
to calculate the CIDR prefix length needed for each subnet. The+ 2
accounts for the network address and the broadcast address. - Create Subnets: Use the calculated CIDR prefix length to create your subnets. Each subnet will have
2^(32 - CIDR Prefix Length) - 2
usable IP addresses. - Example: Suppose you need 4 subnets, each with at least 10 usable IP addresses.
- Calculate the CIDR prefix length:
[log2(10 + 2)] = [log2(12)] = [3.58] **≈ 4**
. - Each subnet will have a CIDR block of /28, providing 14 usable IP addresses per subnet.
- Subnets:
- Subnet 1:
192.168.1.0/28
- Subnet 2:
192.168.1.16/28
- Subnet 3:
192.168.1.32/28
- Subnet 4:
192.168.1.48/28
- Subnet 1:
- Calculate the CIDR prefix length:
- Verify and Adjust: Ensure that the number of subnets and the number of addresses per subnet meet your requirements. Adjust the CIDR prefix length and subnetting as necessary.
💡 It's important to understand that a smaller CIDR number results in a larger number of available IP addresses.
Understanding the concept of subnets is crucial in network design. Subnets facilitate organized and efficient traffic routing. Devices within the same subnet can communicate directly. However, to facilitate communication between devices on different subnets, the data must be routed through a network device, typically a router.
The router acts as a gateway, managing the data traffic between different subnets. For instance, if a device with IP address 192.168.1.3
on Subnet 1 wishes to send data to a device with IP address 192.168.1.19
on Subnet 2, the data packets will transit through the router. It's important to note that each IP address identifies a unique node (or network interface) within a network. This routing process is crucial for network segmentation, security, and traffic management.
Exploring Types of Subnets
Subnets are essential building blocks in networking that can be broadly categorized into two distinct types, each serving a specific purpose:
- Public Subnets: These are designed to handle incoming and outgoing traffic to and from the internet via an Internet Gateway. Public subnets are pivotal for hosting services that must be accessible externally, such as web servers or cloud-based applications.
- Private Subnets: In contrast, private subnets are configured to reject direct access from the internet, enhancing security and privacy. They are typically used for backend systems like databases or internal applications, ensuring sensitive operations remain isolated from public exposure.
💡 An Internet Gateway serves as a critical juncture that connects a network to the wider internet. It acts as a portal through which data packets travel, allowing devices within your network to communicate with the outside world. Without an Internet Gateway, devices in the network would be unable to access resources on the internet, severely limiting their functionality.
The diagram showcases a network structure featuring two distinct subnet categories interconnected through a networking appliance. [2] The Public Subnet is granted internet access through an Internet Gateway, [1] while the Private Subnets can only connect to the Public Subnets via a Router.
Summary
This article has provided a comprehensive overview of the fundamental concepts of networking, including the roles of different nodes, the structure of networks, the OSI model, IP addresses, and subnets. By understanding these concepts, you can begin to appreciate the intricacies of how devices communicate and share resources within a network.
As we continue to delve deeper into the world of networking in the upcoming articles of this series, we will explore more advanced topics and practical applications. Whether you're a beginner looking to get started in networking or someone with a keen interest in AWS and cloud technology, this series aims to provide you with the knowledge and tools to navigate the digital landscape with confidence.
🙏 If you found this article informative and helpful, please consider sharing it with your friends and colleagues who might also benefit from this knowledge. Your support through likes and shares is greatly appreciated and motivates to continue creating valuable content for our readers.
Check out the following article: Networking 101 - Part 2
Very nice article.
Simple and clear presentation of basic networking concepts. Thanks for posting this.
相关内容
- AWS 官方已更新 2 年前