1. Home
  2. Explore
  3. Computer Science
  4. Networking Fundamentals

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Networking Fundamentals

Networking Fundamentals

Networking is the process of devices communicating with one another. Devices may include computers, smartphones, wireless clients, servers, switches, routers, firewalls, and Internet-connected equipment.

A network administrator needs to understand how data moves:

  • Between devices on the same local network

  • Between different local networks

  • Through a firewall or router

  • From a private network to the public Internet

  • Across the different layers of the OSI networking model

The most important foundational topics are the distinction between LANs and WANs, the OSI model, Layer 2 switching, Layer 3 routing, MAC addresses, IP addressing, subnetting, CIDR notation, private address ranges, DHCP, and DNS.


Local Area Networks and Wide Area Networks

Local Area Network (LAN)

A local area network, or LAN, is the internal network controlled by an organization or network administrator.

LAN devices may include:

  • Desktop and laptop computers

  • Smartphones and tablets

  • Wireless access points

  • Network printers

  • Servers

  • Security cameras

  • Internet of Things devices

  • Switches and other internal networking equipment

A LAN generally exists on the inside of a firewall. The network administrator controls its addressing, switching, routing, security policies, and connected devices.

Wide Area Network (WAN)

A wide area network, or WAN, connects a local network to networks outside the organization.

In a typical home or business network, the WAN includes:

  • The connection from the firewall or router to the Internet service provider

  • The ISP’s network

  • The public Internet

  • External services and websites

The firewall or router usually separates the LAN from the WAN. Traffic moving between these areas is commonly routed and filtered by the firewall.

LAN and WAN relationship

A typical path looks like this:

  1. A device on the LAN generates traffic.

  2. The device sends the traffic to its default gateway.

  3. The firewall or router examines the traffic.

  4. If permitted, the router forwards it through the WAN connection.

  5. The ISP and wider Internet deliver the traffic to its destination.

The reverse process occurs when an external service sends traffic back toward a device on the LAN.


The OSI Networking Model

The Open Systems Interconnection (OSI) model divides network communication into seven conceptual layers. Each layer represents a different responsibility in the process of transferring information.

The layers are numbered from the bottom upward:

  1. Physical

  2. Data Link

  3. Network

  4. Transport

  5. Session

  6. Presentation

  7. Application

A common mnemonic for remembering the layers from bottom to top is:

Please Do Not Throw Sausage Pizza Away

Another mnemonic is:

Please Do Not Touch Steve’s Pet Alligator

The OSI model is a conceptual framework. Real networking protocols do not always fit perfectly into only one layer, but the model is useful for understanding where different technologies operate.


Layer 1: Physical Layer

The Physical layer concerns the physical signals and hardware used to transmit data.

Examples include:

  • Ethernet cables

  • Fiber-optic cables

  • Copper wiring

  • RJ45 connectors

  • Radio signals used by Wi-Fi

  • Electrical signals

  • Physical network ports

  • Connectors and patch panels

This layer deals with things that can be physically touched or measured. Problems at this layer may include:

  • A disconnected cable

  • A damaged cable

  • A faulty network port

  • Incorrect cable type

  • Poor wireless signal

  • Electrical interference

  • A failed transceiver

The Physical layer does not decide which device should receive a message. It only provides the physical medium through which bits are transmitted.


Layer 2: Data Link Layer

The Data Link layer is responsible for communication on the local network segment. It is primarily associated with switching and MAC addresses.

Layer 2 commonly handles:

  • Ethernet frames

  • MAC addresses

  • Local delivery between devices

  • VLAN identifiers

  • Switching decisions

  • Network interface communication

Traditional network switches operate primarily at Layer 2. A switch examines the destination MAC address in an Ethernet frame and forwards the frame through the appropriate port.

Layer 2 switching

Layer 2 switching is efficient because a switch can forward traffic within a local network without performing full routing decisions for every frame.

A switch learns which MAC addresses are associated with which ports. It stores this information in a MAC address table, sometimes called a forwarding table or switching table.

For example:

  • A switch receives a frame from a computer.

  • It records the computer’s source MAC address and the port where it was received.

  • When traffic later needs to reach that MAC address, the switch forwards it through the learned port.

  • If the destination is unknown, the switch may temporarily flood the frame to multiple ports until it learns the destination’s location.

Modern switches can maintain very large MAC address tables. Older or inexpensive equipment sometimes had relatively small table limits, and reaching those limits could cause forwarding problems until the device was rebooted or its table was cleared.


Layer 3: Network Layer

The Network layer is responsible for logical addressing and routing between networks. It is primarily associated with IP addresses.

Layer 3 commonly handles:

  • IPv4 and IPv6 addresses

  • Routing between subnets

  • Routers

  • Layer 3 switches

  • Default gateways

  • Communication between LANs and WANs

A router examines the destination IP address of a packet and determines where the packet should be sent next.

For example, when a device on one subnet communicates with a device on another subnet:

  1. The source device recognizes that the destination is outside its local subnet.

  2. It sends the traffic to its default gateway.

  3. The router examines the destination IP address.

  4. The router selects an appropriate route.

  5. The packet is forwarded toward the destination network.

A router commonly performs this function between the LAN and WAN.


Layer 2 Switches and Layer 3 Switches

Layer 2 switch

A Layer 2 switch forwards Ethernet frames based primarily on MAC addresses.

It is generally used for:

  • Connecting devices within the same VLAN

  • Forwarding local network traffic

  • Connecting computers, access points, printers, and other devices

  • Separating collision domains and improving local network efficiency

A Layer 2 switch does not normally perform routing between IP subnets.

Layer 3 switch

A Layer 3 switch is still a switch, but it also includes routing capabilities.

It can route traffic between:

  • Different VLANs

  • Different IP subnets

  • Layer 3 interfaces configured on the switch

For example, if a network contains separate employee and guest VLANs, a Layer 3 switch may route traffic between those VLANs without sending every packet back to the firewall.

The firewall may still be required for:

  • Internet access

  • Security filtering

  • Network address translation

  • Advanced policy enforcement

  • VPN connections

  • WAN connectivity

However, local inter-VLAN routing can often occur directly within the Layer 3 switch.

Switching efficiency

Switches are designed to forward traffic extremely efficiently. They commonly use specialized hardware called an ASIC, or application-specific integrated circuit.

An ASIC allows switching operations to occur at very high speeds, often far more efficiently than general-purpose software-based routing. This makes switches well suited for moving large amounts of local traffic.


Layer 4: Transport Layer

The Transport layer manages communication between applications or services on different devices.

Two major Layer 4 protocols are:

TCP

Transmission Control Protocol (TCP) provides reliable, connection-oriented communication.

TCP can provide:

  • Ordered delivery

  • Error detection

  • Retransmission of lost data

  • Flow control

  • Connection establishment and termination

TCP is useful when the complete and correct delivery of data is more important than minimal delay.

UDP

User Datagram Protocol (UDP) provides simpler, connectionless communication.

UDP generally has:

  • Lower overhead

  • No guarantee of delivery

  • No guarantee of ordering

  • No automatic retransmission

UDP is useful for applications where speed and low latency are more important than perfect delivery, such as some voice, video, gaming, and real-time communication applications.

Transport protocols also use port numbers to identify particular services or applications on a device.


Layer 5: Session Layer

The Session layer manages communication sessions between devices or applications.

A session represents an ongoing exchange of information. Network equipment may track sessions using a state table, especially when traffic passes through a router or firewall.

A state table can help a device remember:

  • Which internal device initiated a connection

  • The external destination

  • The protocol and port being used

  • The current state of the communication

  • How return traffic should be associated with the original connection

State tracking is particularly important for firewalls and network address translation.


Layer 6: Presentation Layer

The Presentation layer is concerned with how information is represented to applications and users.

It may involve:

  • Data formatting

  • Encoding

  • Compression

  • Encryption and decryption

  • Converting data into a form applications can interpret

This layer helps ensure that information transmitted between systems can be displayed or used correctly. For example, the content displayed when a user watches a video or loads a web page must be interpreted and presented in a usable form.


Layer 7: Application Layer

The Application layer is closest to the software and services used by people.

Examples include:

  • Web browsers

  • Facebook Messenger

  • Signal

  • Email applications

  • Video streaming services

  • File transfer applications

  • Network management applications

Network administrators are also increasingly concerned with the Application layer because modern routers and firewalls can identify application signatures. This allows them to create rules based on applications rather than only on IP addresses and ports.

For example, a firewall may be able to identify and control:

  • Video streaming

  • Social media

  • Messaging applications

  • Peer-to-peer traffic

  • Cloud services


Data Encapsulation

As data moves down the OSI model, each layer adds information needed for its function. This process is called encapsulation.

A simplified data structure is:

  1. Data is generated by an application.

  2. The Transport layer places the data into a segment.

  3. The Network layer places the segment into a packet.

  4. The Data Link layer places the packet into a frame.

  5. The Physical layer transmits the resulting bits over a physical medium.

The receiver reverses this process through decapsulation, removing the relevant headers as the information moves upward through the layers.

Data

The original content generated by an application is called data.

Examples include:

  • A portion of a video stream

  • A message

  • A file segment

  • A web request

  • Application instructions

Segment

At the Transport layer, data is placed into a segment. The segment may include:

  • TCP or UDP information

  • Source and destination port numbers

  • Reliability or sequencing information, depending on the protocol

Packet

At the Network layer, the segment is placed inside an IP packet.

The packet contains logical addressing information, including:

  • Source IP address

  • Destination IP address

  • Other IP control information

Routers and Layer 3 switches primarily examine the packet’s IP addressing to make forwarding decisions.

Frame

At the Data Link layer, the packet is placed inside an Ethernet frame.

A frame commonly includes:

  • Source MAC address

  • Destination MAC address

  • VLAN information when applicable

  • Error-checking information

  • The encapsulated packet

Switches primarily examine the frame and use its MAC addresses to determine how to forward it.

A packet is primarily associated with Layer 3 IP addressing, while a frame is primarily associated with Layer 2 MAC addressing.


MAC Addresses

A Media Access Control (MAC) address is a Layer 2 identifier associated with a network interface.

Every Ethernet interface normally has a MAC address, and wireless interfaces also use MAC addresses. Examples of devices with MAC addresses include:

  • Ethernet ports

  • Wi-Fi adapters

  • Smartphones

  • Laptops

  • Wireless access points

  • Printers

  • Cameras

  • Network appliances

A MAC address allows devices on a local network to identify the source and destination of Ethernet frames.

MAC address structure

A MAC address is commonly divided into two sections:

  1. Organizationally Unique Identifier (OUI)

  2. Device-specific identifier

Organizationally Unique Identifier

The OUI is the manufacturer-related portion of the MAC address.

It identifies the organization assigned a particular block of MAC addresses. Network management systems can use the OUI to provide a likely manufacturer name, such as:

  • Apple

  • Google

  • Ubiquiti

  • Other network and device manufacturers

This is why a network controller may identify a device vendor even before the device has been manually named.

Device-specific portion

The remaining portion identifies the individual network interface.

This part is intended to distinguish one interface from another, even when both interfaces are produced by the same manufacturer.

Changing and randomizing MAC addresses

Although MAC addresses are often treated as burned-in hardware identifiers, they can sometimes be changed or overridden in software. This is called MAC address spoofing or MAC address randomization.

Modern smartphones, especially when connecting to wireless networks, may generate a randomized MAC address for privacy.

This can create administrative challenges:

  • A device may appear as a new client each time it connects.

  • MAC-based access rules may stop matching the device.

  • Monitoring and tracking become less reliable.

  • Reservations based on a fixed MAC address may no longer work consistently.

An organization may use mobile device management, or MDM, controls to disable or manage MAC randomization when appropriate.


IP Addresses

An IP address is a Layer 3 logical address used to identify a device or interface on an IP network.

An IPv4 address consists of four octets separated by periods. Each octet can have a decimal value from 0 through 255.

For example:

  • 192.168.1.25

  • 10.0.0.50

  • 172.16.10.1

Each octet represents eight bits, so an IPv4 address contains 323232 bits in total. Computers process IP addresses in binary, although people generally use decimal notation because it is easier to read.

Subnetting and CIDR notation rely on understanding how these bits are divided between the network and host portions.


Subnets

A subnet is a logical division of an IP network. A subnet mask determines which part of an IP address identifies the network and which part identifies a host within that network.

Subnet mask structure

Consider the subnet mask:

255.255.0.0

This indicates that:

  • The first two octets represent the network portion.

  • The final two octets represent the host portion.

A smaller and very common subnet mask is:

255.255.255.0

This indicates that:

  • The first three octets represent the network portion.

  • The final octet represents the host portion.

In a typical /24 network, the final octet contains 256 total numerical values, from 0 through 255. Some addresses are reserved, leaving 254 commonly usable host addresses.

Reserved addresses

Within a subnet, not every address can normally be assigned to a device.

Commonly reserved addresses include:

  • The network address, which identifies the subnet itself

  • The broadcast address, which represents all hosts on the subnet

  • Sometimes an address used by the default gateway or another infrastructure device

For a typical /24 network such as 192.168.1.0/24:

  • 192.168.1.0 is normally the network address.

  • 192.168.1.255 is normally the broadcast address.

  • 192.168.1.1 through 192.168.1.254 are commonly usable host addresses.

The exact allocation of gateway and infrastructure addresses depends on the network design.


CIDR Notation

Classless Inter-Domain Routing (CIDR) notation expresses a subnet using a slash followed by the number of network bits.

For example:

  • 255.255.255.0 is equivalent to /24

  • 255.255.0.0 is equivalent to /16

  • A single IPv4 address can be represented as /32

The number after the slash indicates how many of the 323232 IPv4 bits belong to the network portion.

Common CIDR sizes

/16

A /16 subnet contains:

  • 16 network bits

  • 16 host bits

  • 216=65,5362^{16} = 65,536216=65,536 total addresses

  • Approximately 65,534 usable host addresses after excluding the network and broadcast addresses

A common example is:

192.168.0.0/16

This range can be divided into many smaller networks, such as:

  • 192.168.0.0/24

  • 192.168.1.0/24

  • 192.168.2.0/24

  • 192.168.3.0/24

/24

A /24 subnet contains:

  • 24 network bits

  • 8 host bits

  • 256 total addresses

  • Approximately 254 usable host addresses

The /24 is one of the most common subnet sizes for small networks because it offers enough addresses for many typical LANs while remaining easy to manage.

/25

A /25 divides a /24 network into two equal subnets.

Each /25 contains:

  • 128 total addresses

  • Approximately 126 usable host addresses

For example, a /24 network could be divided into:

  • 192.168.0.0/25

  • 192.168.0.128/25

The second subnet begins at 192.168.0.128 rather than beginning at 192.168.0.1. Subnet boundaries depend on the block size.

/29

A /29 contains:

  • 8 total addresses

  • Approximately 6 usable host addresses

ISPs commonly use /29 allocations for customers who need multiple static public IP addresses. An ISP may reserve one address for its gateway, leaving five usable addresses for the customer.

/32

A /32 represents one specific IPv4 address.

It contains:

  • 32 network bits

  • 0 host bits

  • One total address

A /32 is commonly used when referring to one exact host or address rather than an entire network.

Splitting and combining subnets

Subnetting divides a larger network into smaller networks by increasing the CIDR prefix length.

For example:

  1. A /16 can be divided into two /17 networks.

  2. Each /17 can be divided into smaller networks.

  3. A /24 can be divided into two /25 networks.

  4. Two adjacent /25 networks can be combined back into one /24 network when their boundaries align correctly.

Subnet calculators are useful because they display:

  • Network address

  • CIDR notation

  • Full address range

  • Usable host range

  • Broadcast address

  • Number of hosts

  • Possible subnet divisions

They are especially useful when planning VLANs, LANs, WAN allocations, and infrastructure networks.


RFC 1918 Private IPv4 Address Ranges

RFC 1918 private address ranges are IPv4 ranges reserved for internal network use. These addresses are not directly routable across the public Internet.

The three private ranges are:

10.0.0.0/8

This range includes addresses from:

10.0.0.0 through 10.255.255.255

It provides a very large private address space and is frequently used in enterprise networks.

172.16.0.0/12

This range includes addresses from:

172.16.0.0 through 172.31.255.255

It is also reserved for private networks, although it is often seen less frequently in small home networks.

192.168.0.0/16

This range includes addresses from:

192.168.0.0 through 192.168.255.255

It contains many possible /24 subnets, including:

  • 192.168.0.0/24

  • 192.168.1.0/24

  • 192.168.2.0/24

  • 192.168.3.0/24

The 192.168.0.0/16 range is very common in consumer routers, and individual /24 networks from it often provide approximately 254 usable addresses.

Avoiding overlapping networks

Network designers should avoid using the most common default subnets when possible, especially in environments involving VPNs or externally connected equipment.

For example, if the internal LAN uses 192.168.1.0/24 and an external router or service also uses 192.168.1.0/24, routing becomes ambiguous. A firewall cannot reliably distinguish whether traffic belongs to the internal or external network.

This can occur with:

  • Site-to-site VPNs

  • Remote-access VPNs

  • Cellular routers

  • ISP-provided equipment

  • Satellite Internet equipment

  • Double-router configurations

A better design may use a less common private range, such as an appropriately selected subnet from 10.0.0.0/8 or 172.16.0.0/12.

Avoiding public address ranges internally

Some routers permit administrators to use public IP ranges inside a LAN. This is generally a poor design choice and can cause routing problems.

For example, if a network internally uses an address range assigned publicly to a service such as Netflix, a router may believe that the service is located on the local network. Traffic intended for the actual public service may therefore be routed incorrectly.

Private RFC 1918 addresses should normally be used for internal LANs unless there is a specific, carefully planned reason to use another addressing scheme.


DHCP

Dynamic Host Configuration Protocol (DHCP) automatically provides network configuration to client devices.

When a device connects to a network, it may request configuration such as:

  • IP address

  • Subnet mask

  • Default gateway

  • DNS server addresses

  • Lease duration

A DHCP server selects an available address from a configured subnet and leases it to the client.

Basic DHCP process

A simplified DHCP exchange works as follows:

  1. A client joins the network without a usable IP address.

  2. The client broadcasts a request for network configuration.

  3. A DHCP server offers an available IP address and configuration.

  4. The client requests the offered address.

  5. The DHCP server confirms the assignment.

The client can then communicate on the local network and, if a default gateway is provided, reach other networks and the Internet.

Additional DHCP information

DHCP can provide more than just an IP address. It may also distribute information such as:

  • Network time protocol, or NTP, server details

  • Trivial File Transfer Protocol, or TFTP, server details

  • Default gateway information

  • DNS server information

  • Other vendor- or network-specific configuration options

DHCP is one of the most common services configured on a router, firewall, or Layer 3 network device.


DNS

Domain Name System (DNS) translates human-readable domain names into IP addresses.

People generally find names easier to remember than numerical addresses. For example, a user can enter:

www.google.com

instead of having to remember the current IP address of the website.

A complete domain name is called a fully qualified domain name (FQDN). DNS resolves the FQDN to an IP address so that the client can establish a connection.

Basic DNS process

  1. A user enters a domain name into an application.

  2. The device sends a DNS query to its configured DNS server.

  3. The DNS server finds or retrieves the corresponding IP address.

  4. The device uses that IP address to connect to the destination.

DNS may be provided by:

  • The local router or firewall

  • The ISP

  • A public DNS provider

  • An internal organizational DNS server

  • A specialized security or filtering DNS service

DNS troubleshooting

DNS failures can make a network appear to be offline even when the underlying connection is functioning.

For example:

  • A device may have a valid IP address.

  • The default gateway may be reachable.

  • The Internet link may be operational.

  • However, websites may fail to load because domain names cannot be translated into IP addresses.

This is the basis of the common troubleshooting phrase, “It’s always DNS.” DNS is not always the cause, but it is a frequent source of apparent connectivity failures.


Core Relationships to Remember

  • LAN: The controlled internal network.

  • WAN: The network outside the LAN, including the ISP and Internet.

  • Layer 2: Local switching using MAC addresses and frames.

  • Layer 3: Routing between networks using IP addresses and packets.

  • Layer 2 switch: Forwards traffic within local Layer 2 segments.

  • Layer 3 switch: Adds routing capabilities, including inter-VLAN routing.

  • MAC address: Identifies a network interface at Layer 2.

  • IP address: Provides logical addressing at Layer 3.

  • Subnet mask or CIDR prefix: Defines the network and host portions of an IP address.

  • Private IP ranges: RFC 1918 addresses intended for internal networks.

  • DHCP: Automatically assigns network configuration.

  • DNS: Converts domain names into IP addresses.

  • Frame: The Layer 2 container carrying a packet.

  • Packet: The Layer 3 container carrying transport-layer data.

  • Segment: A Transport-layer container carrying application data.

A solid understanding of these concepts is essential for designing reliable, secure networks and for configuring VLANs, switches, routers, firewalls, wireless networks, and other network infrastructure.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent