Networking Basics


Networking Basics

Maria
It is amazing that a phone can send a message across the planet in milliseconds. This episode explains the networking ideas that make that possible, starting with simple local communication, moving to wide area networks, and finally reaching the internet.

Hope
And we will build the explanation step by step. We will begin with background concepts—network services, protocols, and ports—then examine local area networks, or LANs, including Ethernet. After that, we will see how wide area networks use IP addresses and routers, and how the internet connects networks across the world.

Maria
Let us use one scenario throughout: a DJ business called Techno DJ. The business owns the domain technodj.com, wants to showcase its work, and plans to create an app that lets customers see a song list and stream music.

Hope
The setup has two main programs. One is the client app installed on a customer's computer, and the other is a service installed on an old desktop that acts as the initial server. The client requests information or music, and the server provides it.

Maria
That server needs to run even when nobody is logged into it. On Windows, a service is a program configured to start automatically or in response to a trigger, rather than requiring a user to launch it manually.

Hope
That distinction matters because ordinary programs may start when the computer boots, when a user logs in, or when the user opens the program. Services can run under system or service accounts and can operate before anyone signs in. Windows exposes them through the Services console, while Linux and Unix systems use the term daemon for similar background programs.

Maria
A network service is simply a service that provides something to other devices across the network. For Techno DJ, one service might provide the song list, and another might stream the music.

Hope
DHCP is a useful example. When a computer joins a network, it generally needs an IP address. A DHCP client requests an address, and a DHCP server responds with an address the client can use.

Maria
Web browsing follows the same client-and-service idea. Chrome, Firefox, Safari, or another browser is the client application. On the other side, a web service such as Apache or Microsoft IIS can respond by delivering web pages.

Hope
The two machines may use completely different platforms: Windows, Linux, Unix, Apple devices, phones, or tablets. To communicate despite those differences, they need shared rules. Those rules are called protocols.

Maria
A protocol is a set of communication rules. It specifies things such as who speaks first, the order of messages, the format of each message, and how the receiving application interprets the data.

Hope
For example, the Techno DJ app might say hello, receive a hello in return, request a list of songs, and then receive that list. The protocol would determine whether the songs arrive all at once or individually, and how each song's name, album, artist, artwork, or lyrics are arranged.

Maria
Without an agreed format, the data could be misunderstood. The receiver might mistake an album name for a song title if the fields arrive in the wrong order. Ultimately, computers transmit ones and zeros, which are organized into data strings and then presented in a useful format to the user.

Hope
The application developer normally does not invent every protocol from scratch. Existing protocols are built into software, and several protocols can operate in layers. Each layer contributes rules that help the complete communication work.

Maria
Ports help a server distinguish among different network services. A Techno DJ server might provide a website, a song-list application, music streaming, and remote access. Incoming traffic needs a way to identify which service should receive it.

Hope
That is the role of a port number. Web traffic commonly uses port 80 for HTTP and port 443 for secure HTTP traffic. In the example, the song-list service might use port 81 and the streaming service port 82, so the server can direct each request to the appropriate program.

Maria
Port numbers are grouped into ranges. Ports 0 through 1,023 are well-known ports, generally associated with established services. Registered ports occupy a larger range above that, and dynamic, private, or ephemeral ports make up another range.

Hope
Now let us move from what the data means to how it physically travels on a local network. A LAN connects nearby devices such as computers, phones, and other equipment so they can communicate and use network services.

Maria
Network media is the path carrying the signal. The main possibilities described here are electrical signals through a conductor such as copper cable, radio signals through the air, and light signals, often carried through fiber.

Hope
A simple light example is Morse code: a short flash can represent a dot and a longer flash a dash. Computers can represent a zero with no signal and a one with a signal. A copper cable can do something similar by representing zero with no electrons flowing and one with a voltage present.

Maria
Radio is more complex because information is carried by manipulating waveforms, but the basic goal is the same: represent the computer's ones and zeros in a form that can travel through the selected medium.

Hope
A network interface card, or NIC, performs the translation between computer data and the signal used by the medium. Wireless signals, electrical signals, and optical signals do not all look like raw ones and zeros, so the NIC converts between those forms.

Maria
A NIC used to be a separate expansion card, but it is often built into a computer's motherboard today. A laptop may have built-in Ethernet and wireless interfaces, and a Windows network-connections screen can show interfaces such as Ethernet, Wi-Fi, and Bluetooth.

Hope
That interface also has identifying information. One important identifier is the physical address, also called the burned-in address or MAC address. A wireless NIC and an Ethernet NIC can each have their own address.

Maria
Ethernet cables carry electrical signals, while fiber-optic cables carry light. Fiber can provide fast communication, but it is more fragile because the fiber inside may be glass and can break if bent too far. Infrared remotes also demonstrate communication through light, although computers usually use more direct and controlled media.

Hope
To connect several devices, older Ethernet networks could use a hub. A hub repeats any signal arriving on one port out through all the other ports. Modern networks generally use switches instead, but hubs are useful for understanding how early Ethernet communication worked.

Maria
If one computer sends a message through a hub, every connected device receives the signal. The message therefore needs an address so that only the intended device processes it. That local address is the destination MAC address.

Hope
A MAC address is 48 bits long. Humans usually see it written in hexadecimal, often as twelve hexadecimal characters separated by colons or dashes. It is normally burned into the NIC by its manufacturer rather than assigned manually by the computer owner.

Maria
When a message needs delivery information added to it, that process is called encapsulation. The original information is the data or payload. A header can add addressing, sequencing, protocol identification, or other delivery information, and a trailer may add error-checking information.

Hope
Encapsulation can happen repeatedly. A protocol can add its own header to data that already includes another protocol's header. That layered wrapping is one reason multiple protocols can cooperate during a single communication.

Maria
In Ethernet, the complete unit is called a frame. The frame contains a destination MAC address, a source MAC address, a type field identifying the frame or payload, the payload itself, and a frame check sequence at the end.

Hope
The destination address tells the receiving device whether the frame belongs to it, while the source address identifies the sender. The frame check sequence helps the receiver determine whether the contents were corrupted during transmission.

Maria
A hub-based Ethernet network can also experience collisions. That happens when two devices transmit at the same time. Their signals interfere, so the communication is considered invalid and both devices must stop and try again.

Hope
Ethernet uses carrier sense multiple access with collision detection, or CSMA/CD, in this situation. A device first senses whether another device is transmitting. If it detects a collision after beginning transmission, it stops, waits for a randomly selected backoff period, and then retries.

Maria
A broadcast is different from ordinary addressed traffic. A device may intentionally send one message to every device on the local network. The broadcast MAC address is represented by all Fs, so devices recognize the frame as intended for everyone.

Hope
A LAN is a local collection of connected devices. In the older hub model, it could contain a collision domain, and traffic could be visible to every connected device, creating security concerns. Replacing hubs with switches greatly reduces those problems, although broadcasts can still exist.

Maria
The local network needs a boundary, because collisions, broadcasts, and local addressing should not spread across the entire planet. A router forms the edge of a LAN and separates it from other networks.

Hope
That leads to wide area networking. A WAN connects networks over much greater distances. For example, a company might connect LANs at headquarters in Seattle, a campus in Chicago, offices in New York, and a factory in Texas using routers and WAN links.

Maria
MAC addresses work well locally, but they are not suitable for routing across the world. Their assignment is not geographical, so using them globally would require an enormous database of where every device is located.

Hope
IP addresses solve that problem through hierarchical addressing. Ranges can be assigned to large regions or organizations, then divided into smaller ranges for internet service providers, businesses, and individual networks. Routers can use those ranges to move traffic progressively closer to its destination.

Maria
An IPv4 address is 32 bits long and is usually written as four decimal octets separated by dots, such as 192.168.40.41. A device commonly receives an IP address dynamically when it joins a network, and it may receive a different address when it moves to another network.

Hope
Organizations responsible for address allocation divide the global address space into increasingly smaller assignments. The hierarchical structure makes global routing manageable. On Windows, the ipconfig command displays interface information such as IPv4 addresses, subnet masks, default gateways, and, with the appropriate option, MAC addresses.

Maria
An IP packet is the IP-level unit used for delivery across networks. It contains the payload and an IP header, including the source IP address and destination IP address, along with other control information.

Hope
The packet remains relatively consistent as it travels across the WAN. For local delivery, however, the packet is placed inside a local-network frame. The frame may change from one link to the next, while the packet is routed toward its final IP destination.

Maria
Routers make forwarding decisions using the destination IP address. Each router examines the packet, chooses the next best route, and sends it to another router or to the destination network. In short, Ethernet frames are forwarded locally, while IP packets are routed across networks.

Hope
The distinction can be summarized this way: Ethernet uses MAC addresses and frames and operates at the local, layer-two level. Internet Protocol uses IP addresses and packets and operates at layer three. A router removes the old local frame and adds a new frame appropriate for the next link.

Maria
For example, a computer creates a packet addressed to a remote machine. To reach its local router, it places that packet inside an Ethernet frame addressed to the router's MAC address. The router removes that local frame, keeps the packet, and encapsulates it in a new layer-two format for the next connection.

Hope
That process repeats across the WAN. Different links may use different technologies and protocols, but the packet can continue toward the destination. Near the destination, the final router places the packet into a local frame for the receiving device.

Maria
Two useful troubleshooting tools are ping and tracert. Ping sends packets to a target and measures whether replies return and how long the round trip takes. A successful ping to an address such as 8.8.8.8 shows that packets were sent and received without loss in that test.

Hope
Tracert shows the intermediate hops between the source and destination. It can reveal the routers a packet passes through, helping identify the path and response times across the network.

Maria
Now we can define the internet. It is not one company's single network and it is not controlled by one central entity. It is a network of networks: many independently operated networks interconnected through routers and links.

Hope
Those networks may connect through terrestrial fiber, undersea fiber-optic cables, radio systems, or satellites. Satellite communication can cover large distances but may be slower because the signal travels to space and back.

Maria
The internet is often drawn as a cloud because it is enormous, constantly changing, and no single organization has a complete map of every network and connection. A business can place a server on the internet, assign it an IP address, run network services, and allow users around the world to connect.

Hope
Most homes reach that global network through an internet service provider, or ISP. The ISP connects the customer's home to larger networks and, ultimately, to the backbone—the major connections carrying traffic across regions and countries.

Maria
The backbone is expensive to build because it requires materials, planning, rights of way, and long-distance cables. The cost can be distributed across many users, but connecting an individual home is also costly. That final connection is often called the last mile.

Hope
The last mile may use telephone lines with DSL, cable lines, fiber, cellular service, or satellite. Power lines can carry some data, but they are not generally the preferred solution, and water and sewer lines are not data connections. The available technology depends on what reaches the home.

Maria
So the journey from a phone to a distant server combines every level we discussed. An application creates a request, protocols define its format, ports identify the service, IP addresses guide the packet across routed networks, and local technologies repeatedly wrap that packet in frames.

Hope
And that is how a simple button press becomes global communication: local interfaces translate data into signals, Ethernet handles nearby delivery, routers move IP packets across WANs, ISPs connect homes to the larger network, and the internet links those many networks into one worldwide system.

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