Computer Networking Fundamentals
Computer Networking: From Binary Data to Internet Communication
1. Why computer networking is needed
Computer networking is the communication of information between computers and other devices. Its purpose is to let devices share data without physically carrying storage media between them.
Before networks, one computer could transfer a file to another using a floppy disk, hard drive, or similar medium. This required both computers to support the storage device and someone or something to carry it. For computers separated by great distances, this method was slow and inconvenient.
Electrical communication systems such as telegraphs showed that information could be encoded and sent over a wire. Computer networks apply the same broad idea: information is represented in a form that can be transmitted through a communication medium, received, and interpreted by another device.
A network must address several connected problems:
How is information represented in a form that computers can process?
How are bits carried through cables or through the air?
How does a device identify the intended recipient?
How does data travel between different networks?
How can large messages be transmitted efficiently and checked for errors?
How does the receiving computer know what the data means and which application should receive it?
2. Representing information as numbers and bits
Computers process information using binary data: sequences of bits, each of which has one of two possible values, 0 or 1.
2.1 Representing text
A computer can represent text by assigning numbers to characters. For instance, a simple teaching scheme could assign one number to each letter. A real computer system uses standardized character encodings, such as UTF-8, to represent text as bytes.
The important principle is that text is not transmitted as an abstract idea. It is converted into numbers, then into binary data that computers can store and transmit.
2.2 Representing images and video
Digital images are usually represented as grids of pixels. Each pixel stores numerical information about its color.
A common representation uses three color components:
Red
Green
Blue
These components are combined at different intensities to produce many colors. In an image format that assigns eight bits to each component, each component can represent 28 intensity levels, commonly numbered from 0 to 255. A pixel represented this way therefore stores three component values.
A digital image is a collection of pixel values. A video is a sequence of images, or frames, shown over time. Video may also include timing information and other data needed for playback.
Color itself is a perceptual experience produced by the visual system in response to light. Digital displays take advantage of how human vision responds to combinations of red, green, and blue light. The physics of light and color is a separate subject from the networking process, but the networking-relevant point is that an image can be encoded as numerical data.
2.3 Binary and other number systems
Information may be described using decimal numbers for human convenience, but computers represent data in binary. A sequence of bits can encode text, image values, instructions, or other kinds of information, depending on the rules used to interpret it.
The same sequence of bits does not inherently reveal whether it represents a sentence, an image, or some other type of data. The receiver needs agreed-upon rules that explain how to interpret the bits.
3. How bits can be stored physically
A bit is an abstract value, but a computer must represent it using physical states. A physical property that can reliably be distinguished in two states can be used to represent binary information.
Examples include:
Memory capacitors: In some kinds of memory, a charged state and an uncharged state represent different bit values. The system must periodically refresh this stored charge.
Magnetic storage: A storage device can use different magnetic orientations to encode information.
Electrical signals: A circuit can interpret different voltage ranges as different logical values.
A simplified example might associate a higher voltage with 1 and a lower voltage with 0. Real systems use defined voltage ranges and thresholds rather than relying on one universal rule such as “exactly five volts means one.” The actual electrical signaling standard depends on the hardware.
Thus, binary data has both a logical meaning and a physical representation. Circuits store, read, and transform physical states so that the computer can process the corresponding bits.
4. Sending bits through a communication medium
Two computers can communicate when each has hardware capable of sending and receiving signals, and when there is a medium connecting them.
4.1 A basic wired connection
In a simplified model, a sending computer can encode bits as changes in an electrical signal on a wire. The receiving computer measures the signal and interprets it according to the same encoding rules.
The process is:
The sending device obtains the data as bits.
Its communication hardware encodes the bits into signals.
The signals travel through a cable or another medium.
The receiving hardware detects the signals.
The receiver reconstructs the bits and passes them to the computer for processing.
Actual networks transmit data far faster than one bit per second. A real signaling system may transmit many bits in a short period, using carefully designed timing and signal patterns. The one-bit-per-second example is only a way to illustrate the basic idea.
4.2 Network interface cards
A computer connects to a network through a network interface card, or NIC. A NIC may be a separate card or a component built into a computer or other device. It handles network-interface tasks such as sending and receiving link-level data and converting between data and physical signals.
A NIC may communicate through:
Copper cables using electrical signals
Fiber-optic cables using light
Wireless links using radio signals
The specific signal encoding depends on the technology.
4.3 Wireless signaling and modulation
Wireless systems transmit data using radio waves. Modulation is a method of encoding information by varying a property of a carrier signal. Depending on the system, information may be conveyed through changes in amplitude, frequency, phase, or combinations of these properties.
The receiving device detects the signal and decodes it back into digital information. Wireless communication therefore follows the same general pattern as wired communication—encode, transmit, receive, decode—but uses a different physical medium and signaling method.
4.4 Fiber-optic communication
Fiber-optic systems carry information as pulses or patterns of light through a fiber. The equipment at each end converts between electrical or digital data and optical signals.
A network may also share a physical medium among multiple users or channels. Technologies can distinguish simultaneous transmissions using different frequencies, time slots, wavelengths, or other methods. This makes it possible for multiple streams of information to use shared infrastructure without being treated as one undifferentiated signal.
5. Why a switch is needed
5.1 The problem with connecting every computer to every other computer
With only two computers, a direct cable can connect them. But connecting every computer directly to every other computer becomes impractical as the network grows.
If each of n computers had a dedicated connection to every other computer, each computer would need many network connections, and the total number of links would grow rapidly. A computer would require n−1 connections in this arrangement. This is costly and unmanageable for large networks.
5.2 The switch as a central forwarding device
A switch provides a more practical arrangement. Each computer connects to a switch, and the switch forwards data between the devices connected to it.
A switch does not simply copy every message to every computer under normal circumstances. It uses link-layer addressing to determine which port should receive a frame. If the switch does not yet know the destination, it may temporarily send the frame out multiple ports; this is called flooding.
5.3 MAC addresses
Devices on a local network use Media Access Control (MAC) addresses for communication at the link layer. A MAC address identifies a network interface on a local link. It is commonly assigned to the interface by its manufacturer, although it can sometimes be changed or overridden by software.
MAC addresses are not the same as IP addresses:
A MAC address is used to deliver data across a local link.
An IP address is used to identify a device or interface at the network layer and to route data between networks.
A MAC address is often described as a hardware address, but it should not be treated as an unchangeable, universally reliable identity for a person or computer.
5.4 Frames and switch forwarding
At the link layer, a unit of transmitted data is commonly called a frame. A frame includes data and link-layer information, such as source and destination MAC addresses. Real frame formats contain additional fields for purposes such as identifying the protocol and detecting transmission errors.
A switch learns which MAC addresses are reachable through which ports by examining the source MAC addresses of frames it receives. It builds a MAC address table that associates MAC addresses with switch ports.
When a frame arrives:
The switch examines the source MAC address and may update its table.
It checks the destination MAC address.
If the destination is known, it forwards the frame through the appropriate port.
If the destination is unknown, it floods the frame to relevant ports other than the one on which it arrived.
A response from the intended device helps the switch learn where that device is connected.
This learning process avoids sending every frame to every device once the switch has enough information.
6. Why IP addresses and routers are needed
6.1 The limits of MAC-address forwarding
Switches are designed to forward traffic within a local network using MAC addresses. If a message must cross many networks, relying only on MAC addresses would require devices to know the MAC address of a distant destination and would make large-scale forwarding inefficient.
A person’s computer also generally cannot know the MAC address of a remote server before communication. MAC addresses are local-link identifiers, so a different system is needed for identifying destinations across networks.
6.2 IP addresses and hierarchical addressing
An IP address is a logical address used by the Internet Protocol. IP addresses are structured so that routing can use network-related information to move data toward its destination.
A simplified hierarchical address can be thought of as containing:
A part identifying a network or network prefix
A part identifying a device or interface within that network
For example, a conceptual address such as “network C, device 8” illustrates the hierarchy. Real IP addresses use defined formats and are interpreted using a subnet mask or prefix length, which indicates which bits belong to the network portion.
A subnet is a subdivision of an IP network. Devices can use their IP address and subnet information to determine whether a destination is on the same local network or must be reached through a router.
6.3 The router
A router connects different IP networks and forwards packets between them. A router examines network-layer information—especially the destination IP address—and uses a routing table to decide where to forward a packet.
A routing table can include information such as:
Which destination networks are reachable
Which next hop should be used
Which outgoing interface or port should be used
Which route is preferred when multiple routes are available
A route may be direct or may lead through one or more other routers. Each router makes a forwarding decision based on its own routing information. Routing protocols allow routers to exchange information about reachable networks and paths.
A router does not generally search every computer on the Internet one by one. It forwards traffic toward the next network or next hop indicated by its routing table.
6.4 Local versus remote destinations
When a computer sends an IP packet, it first determines whether the destination IP address is on the same local subnet.
Destination on the same subnet: The computer sends the data directly to the destination’s MAC address.
Destination on another subnet: The computer sends the data to the MAC address of a suitable local router, often called the default gateway.
The IP destination remains the intended remote device. The MAC destination is the next device to receive the frame on the current local link.
As a packet crosses routers, the link-layer frame is replaced for each new link. The router uses a new source MAC address and a new next-hop destination MAC address for the outgoing link. The source and destination IP addresses generally remain the same across the route, apart from mechanisms such as Network Address Translation (NAT).
This distinction is central:
IP addresses identify the network-layer destination; MAC addresses deliver a frame to the next device on a particular local link.
7. ARP: finding a local MAC address
A computer may know the IP address of a device on its local subnet but not its MAC address. In IPv4 networks, the Address Resolution Protocol (ARP) helps map a local IPv4 address to a MAC address.
A simplified ARP exchange works like this:
A device broadcasts a request asking which device has a specified local IP address.
The device that owns that IP address responds with its MAC address.
The requester stores the result temporarily in an ARP cache.
The requester can then send frames directly to that MAC address.
If the destination is on another subnet, the computer usually resolves the MAC address of its default gateway rather than the MAC address of the remote destination.
ARP applies to IPv4. IPv6 uses a different mechanism called Neighbor Discovery, which operates through the Internet Control Message Protocol for IPv6 (ICMPv6).
8. Frames, packets, and encapsulation
Different networking layers use different names for the data they handle.
A frame is a link-layer unit, used for communication over a local link.
A packet commonly refers to a network-layer unit, such as an IP packet.
A segment is often used for data handled by a transport-layer protocol such as TCP.
Exact terminology can vary by protocol, but the distinction between layers is useful.
8.1 Encapsulation
As data moves down through networking layers, each layer adds information needed for its own task. This process is called encapsulation.
A simplified sequence is:
An application creates data, such as an HTTP request.
A transport protocol may add information such as source and destination port numbers and sequence information.
IP adds source and destination IP addresses.
The link layer adds source and destination MAC addresses for the current local link.
The NIC sends the resulting bits as electrical, optical, or radio signals.
At the receiving end, the process is reversed: each layer examines and removes the information intended for that layer, then passes the remaining data upward.
The information added by a layer is commonly called a header. Real protocols include more fields than this simplified description, including fields for length, identification, options, and error detection.
9. Breaking large data into manageable units
Sending a very large file as one uninterrupted unit would be inefficient. If an error occurred, resending the entire file could waste time and network capacity.
Instead, data is sent in smaller units. The exact size depends on the protocols and network links involved. On many Ethernet networks, the common maximum frame payload is about 1,500 bytes, though actual limits vary. This link-level limit is known as the Maximum Transmission Unit (MTU).
The general benefits of dividing data include:
Smaller units are easier to fit into network links.
Other devices can use the network between transmissions.
Errors need not require resending an entire large file.
The receiver can reassemble the data in the correct order when the protocol provides the necessary information.
9.1 Sequence numbers and reliability
Some transport protocols, especially Transmission Control Protocol (TCP), use sequence numbers to track the order of transmitted data. A receiver can use this information to detect missing or out-of-order data and reassemble the original stream.
TCP also uses acknowledgments and retransmissions. If data is missing or damaged, the sender may retransmit the relevant portion rather than restarting the whole transfer.
Not every packet includes the same kind of sequence number, and not every networking layer provides retransmission. For example, an IP packet by itself does not guarantee reliable delivery. Reliability depends on the protocols being used above or alongside IP.
9.2 Error detection
Networks use methods such as checksums or cyclic redundancy checks to detect certain kinds of corruption. Error detection can indicate that data is damaged, but it does not necessarily identify and repair every incorrect bit. A higher-level protocol may need to request retransmission.
10. Application protocols: interpreting the data
Bits alone do not say what kind of message they represent. The sender and receiver need agreed-upon rules for formatting and interpreting data. These rules are protocols.
An application-layer protocol defines how applications communicate. It may specify message structure, allowed commands, required fields, and expected responses.
Examples include:
HTTP: Used for communication between web clients and web servers.
FTP: A protocol family associated with transferring files.
SMTP: Used for sending email between mail systems.
For example, an HTTP request may specify a method, a requested resource, a protocol version, and headers. A body may contain additional data. The receiving server interprets the request according to HTTP’s rules and responds accordingly.
A web browser normally creates HTTP messages automatically. When a user visits a website, the browser formats the request, encodes the message as bytes, and passes it to the operating system’s networking services.
If a sender formats a message according to one protocol while the receiver expects another, the receiver may be unable to interpret it. Both sides must follow compatible rules.
11. Ports: delivering data to the right application
A computer may run many networked applications at the same time. An IP address can identify the destination computer, but it does not by itself identify which application should receive the data.
Transport protocols use port numbers to direct data to the appropriate process or service.
A destination port helps the receiving computer select the application or service that should receive the data.
A source port helps identify the sending communication endpoint and supports replies.
TCP and UDP each use port numbers. A port is a logical identifier, not a physical socket on a NIC. The operating system maintains the information needed to associate ports and active network connections with applications.
A network message may therefore be directed using several kinds of address information:
MAC address: Which device receives the frame on the current local link
IP address: Which device or interface is the network-layer destination
Port number: Which transport-level service or application should receive the data
12. The operating system’s role
The operating system (OS) mediates access to hardware and manages shared resources. Applications generally do not directly control memory, network interfaces, and other hardware as they wish. Instead, they request services from the operating system through defined interfaces.
The OS helps manage:
Processor time: It schedules processes so that many programs can share a processor.
Memory: It allocates memory and protects one program’s memory from unauthorized access by another.
Devices: It coordinates access to hardware such as storage and network interfaces.
Networking: It accepts data from applications, applies networking protocols, and passes data to the appropriate device.
This separation improves security, reliability, and fairness. If every application could directly control all hardware, one program could interfere with another program’s memory or monopolize a device.
12.1 Kernel and user applications
The kernel is the core part of an operating system. It manages important system resources and provides services to applications. Applications commonly request networking services through operating-system interfaces rather than directly manipulating the NIC.
A simplified outbound process is:
An application creates data according to an application protocol.
The application asks the operating system to send the data to a destination.
The operating system applies transport- and network-layer processing, including port and IP information.
The system prepares link-layer information for the next local hop.
The NIC transmits the data through the appropriate medium.
Exact responsibilities can be divided differently among the OS, drivers, and NIC hardware, and the order of some processing steps depends on the system. The key idea is that networking involves coordinated work across applications, the OS, device drivers, and hardware.
12.2 NIC queues and direct memory access
Applications may generate data faster than a NIC can transmit it. Systems therefore use queues to hold data while it waits to be sent.
A NIC and the operating system may use Direct Memory Access (DMA) to transfer data between memory and the device with less direct involvement from the CPU. DMA does not mean that the NIC has unrestricted access to all memory; systems use hardware and OS controls to manage and limit access.
13. Modems, routers, and access networks
A router forwards packets between IP networks. A modem converts signals to and from a form suitable for a particular access technology. The word modem comes from modulator-demodulator.
The two functions are related but distinct:
A router handles network-layer forwarding and often provides local-network services.
A modem or access device adapts communication to the provider’s transmission system.
In some consumer equipment, these functions are combined in one device. In other systems, they are separate. Fiber systems may use optical network terminals or other optical equipment rather than a traditional cable modem.
The signal conversions required depend on the medium. A router alone does not necessarily perform every electrical-to-radio or electrical-to-optical conversion; those functions may belong to the NIC, a transceiver, a modem, or a separate access device.
14. Network layers and the OSI and TCP/IP models
Networking is organized into layers because communication involves many different tasks. Each layer provides services to the layer above it and relies on the layer below it. This makes complex systems easier to design and allows different technologies to work together through shared protocols.
14.1 OSI model
The OSI model is a seven-layer reference model. Its layers, from highest to lowest, are:
Application: Services and protocols used by applications, such as HTTP and SMTP.
Presentation: Representation, encoding, compression, and encryption of data.
Session: Organization and management of communication sessions.
Transport: End-to-end communication between processes, including protocols such as TCP and UDP.
Network: Logical addressing and routing, including IP.
Data link: Local-link delivery, frames, and MAC addressing.
Physical: Transmission of raw signals through a medium.
In practice, some functions can be combined or assigned differently by particular protocols. The OSI model is primarily a conceptual framework for discussing networking responsibilities.
14.2 TCP/IP model
The TCP/IP model describes the suite of protocols used in Internet communication. It is often presented with four layers:
Application: Application protocols such as HTTP, DNS, and SMTP.
Transport: Process-to-process communication, including TCP and UDP.
Internet: IP addressing and routing.
Link: Local-link delivery and physical transmission.
The OSI and TCP/IP models are not identical, but both help explain how responsibilities are divided. A browser’s HTTP data, for example, is carried by a transport protocol, placed in IP packets, put into link-layer frames, and transmitted as physical signals.
15. A complete example: sending a web request
A simplified web request illustrates how the concepts work together:
A browser creates an HTTP request according to the application protocol.
The request is encoded as bytes.
The operating system’s transport layer prepares communication between the client application and the server service, using port numbers. If TCP is used, TCP also manages sequencing, acknowledgments, and retransmission.
IP adds the source and destination IP addresses.
The computer determines whether the destination is local or remote.
If the destination is remote, the computer uses the MAC address of its default gateway as the frame’s immediate destination.
The NIC sends the frame through a cable, fiber, or wireless connection.
A local switch forwards the frame toward the router.
The router examines the destination IP address and consults its routing table.
At each routed link, the router forwards the packet in a new frame addressed to the next hop.
The destination network delivers the data to the server’s network interface.
The server’s operating system uses the port information to deliver the data to the appropriate service.
The server interprets the HTTP request and generates a response, which travels back through the network.
This process brings together the core roles of networking: signals carry bits, frames deliver data across local links, IP packets move between networks, transport protocols support communication between applications, and application protocols give the data meaning.

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