Start with a connection and small packets
Connected devices exchange data according to shared rules. At different layers, information is organized into smaller units; for now, think of packets carrying pieces of data and delivery information.
Packets may be delayed, lost, or reordered. Protocols such as TCP provide a reliable ordered byte stream; other situations use other protocols. A remote request cannot be assumed to succeed as quickly as a local operation.
An image loading on your screen involves transmitted data being assembled and decoded by software.
Take this with you · Networked programs need waiting and failure behavior as well as a successful path.
IP addresses and local switching
An IP address helps locate a network interface. IPv4 commonly uses four dotted numbers; IPv6 looks different. Addresses can change and are not permanent names for devices.
An ordinary layer-2 switch mainly forwards Ethernet frames using MAC addresses within a local network. Routers forward between networks using IP information. One household box often combines several roles.
Office computers can connect through a switch. Sending data to a distant network involves routing as well.
Take this with you · First distinguish your local network from other networks; protocol details can come later.
Ports: which service is listening?
One computer can run multiple network services. A port number, together with protocol and address information, helps deliver data to the right endpoint. Services generally listen on specified addresses and ports.
localhost normally means the current device. In localhost:3000, 3000 is the port. A phone's localhost points to the phone, not your computer. Reaching an address does not prove a service is listening at that port.
A service listening on 8080 won't answer merely because you tried 3000. You've reached the building but tried the wrong door.
Take this with you · Keep the full address and startup output, including the port, when reporting connection problems.
Send a packet to the right door
The destination has a service listening on port 8080. Change the connection and destination port to compare outcomes.
Predict: will a wrong port and a disconnected network fail in the same way?
A local diagram only: it neither scans ports nor sends requests to external devices.
Wi-Fi changes the medium, not the whole story
Wi-Fi uses radio instead of a cable for part of the connection. IP, ports, and application protocols still matter. Joining a wireless network is different from reaching the internet.
The radio link, router, internet connection, or destination server can each be responsible for a failure. Comparing local and external access can narrow the search.
A hotel Wi-Fi icon may show a connection while a sign-in page still blocks internet access.
Take this with you · Connected to Wi-Fi means one part of the connection is working.
Routers connect networks
A router chooses a next hop using routing information. Your home network connects through an internet provider and multiple networks to a destination. Responses need a usable path back as well.
Home devices often use private addresses and address translation at the edge. For now, distinguish access from this computer, access from the local network, and access from the wider internet.
A friend failing to open your development address doesn't prove the webpage code is wrong. The service may never have been made reachable outside your machine.
Take this with you · When asking whether a service is reachable, say from which device and network.
Your server runs at localhost:3000. A friend opens the same address on their computer and it fails. What should you understand first?
Choose an answer before reading the explanation.
Turn “the page won't open” into a useful report about devices, addresses, and ports.
Think first, then uncover help as needed. Later chapters expect more complete descriptions and clearer checks.
Bring this chapter's context to your AI. Going deeper is optional; you can keep reading without it.
Explain IP, ports, and routers using mail delivery, including the limits of the comparison.
One approach you can make your own
I'm learning computers and AI-assisted programming from scratch. In this chapter I learned: Network:Distinguish device addresses from service ports;Understand switches, routers, and wireless connections;Separate a disconnected network from a wrong address or listening port Explain IP, ports, and routers using mail delivery, including the limits of the comparison. Check my understanding first. Explain one small question at a time with a concrete example and the limits of any analogy. Ask a scenario question, then adapt to my answer. Distinguish facts, guesses, and uncertainty; suggest hands-on ways to check. Confirm the version before giving tool-specific advice, and don't invent features or references.
Complete this chapter
Mark the sections as read, finish the experiment, and pass the scenario check to record completion. You can visit the next chapter at any time.
Read the original references
This is an introduction. These official resources help you check details and explore further.
MDN · How does the Internet work?Cloudflare · Switch vs. routerData can reach another machine. Next, connect names, requests, and pages into a complete web visit.