Introduction to networks — theory with a dataset that crosses the ocean, five devices that do different jobs and packets that pick their own path (and why fibre will not take away those 9 ms)

Faculty library, deadline week. I was downloading a 40 MB CSV for an assignment and it was taking a while. My classmate, very sure of himself: “It’s the Wi-Fi. With 100 Gbit/s fibre the ping to the server in Madrid would drop to zero.” Half right. The download would indeed be faster, but the ping would not go below about 9 milliseconds even with the best fibre in the world. Why? Because there are 1,800 km between Gran Canaria and Madrid, and the signal needs time to cover them.

Half of networks Topic 1 fits inside that misunderstanding: how many bits leave per second is not the same as how long the first one takes to arrive. Today we are going to follow that CSV from the cloud server to your laptop and, on the way, we will see the communications model, the transmission media, what each device does (and what it does not do), switching, the types of networks and how the Internet is put together.

If you come from Linux network configuration, there you played with ip, the gateway and the lab router: this is the theory behind it. And when you finish, test yourself with the exam-style exercises on introduction to networks, which are interactive and mark themselves.

Why does a data person need to know about networks?

Because almost no data lives on your laptop. You get it from APIs, sensors, remote databases and cloud services, and all of it arrives through a network. How well your algorithms perform depends on three things that are not yours:

  • latency (how long each answer takes to arrive),
  • bandwidth (how many bits per second fit),
  • communication losses and errors.

Without networks there are no distributed systems, no real-time processing and no large-scale data science. In other words, this is not a filler topic.

And before anything else, the definition that shows up in the exam:

Network: a set of devices connected to a common transmission medium through network adapters. Each network adapter has a unique identifier (its physical or MAC address). The connected devices are called network nodes.

The communications model: five pieces

Any communication, from a WhatsApp message to our download, can be drawn with the same five-piece diagram. Look at it first and then we go through it piece by piece:

Simplified communications modelFive boxes in a row: source, transmitter, transmission system, receiver and destination. Source and transmitter form the source system; receiver and destination, the destination system. Between them travel g(t), s(t), r(t) and g'(t).Source systemDestination systemSourcegeneratesthe datacloudserverTransmitterturns theminto a signalthe server'snetwork cardTransmissionsystemfibre, copperand Wi-FiReceiversignal → datathe laptop'sWi-Fi cardDestinationuses the datayour pandasscriptg(t)bitss(t)signalr(t)signalg'(t)bitstext → bit stream → signal → signal → bit stream → text
Source and transmitter are the source system; receiver and destination, the destination system. What crosses the medium is a signal, not your data as it is.
  • Source: generates the data to be transmitted. In our case, the cloud server that holds the CSV.
  • Transmitter: transforms the information, generating signals that can be transmitted. It is the server’s network card, which turns bits into light or electrical pulses.
  • Transmission system: carries the information. Here it is the whole path: fibre, copper and, at the end, Wi-Fi.
  • Receiver: transforms the received signal into information. Your laptop’s Wi-Fi card, which turns waves into bits.
  • Destination: takes the data from the receiver. Your pandas script running read_csv.

And the grouping they always ask about: source system = source + transmitter; destination system = receiver + destination. The transmission system sits in the middle and belongs to neither.

Look at the bottom row of the drawing: what goes into the transmitter is data (g(t)), but what crosses the medium is a signal (s(t) when it leaves, r(t) when it arrives, possibly a little damaged along the way). The receiver turns it back into data (g'(t)). The full chain in the course notes is: text → bit stream → analogue signal → analogue signal → bit stream → text.

Thinking the destination turns the signal into information. That is the receiver’s job; the destination gets the data already prepared. The same at the start: the data is generated by the source, not by the transmitter.

The 11 tasks of a communication system

For those five pieces to work, someone has to take care of a lot of things. The course notes list 11 tasks, and in the exam they usually appear mixed with others that have nothing to do with networks:

TaskWhat it means, in one line
Use of the transmission systemMaking good use of the medium, which is shared
Interface implementationHow each device hooks up to the medium
Signal generationCreating the signal that will travel
SynchronisationSender and receiver agree on when each bit starts and ends
Exchange managementWho talks, when and how much
Error detection and correctionNoticing damaged bits (and fixing them)
Addressing and routingWho it is for and how it gets there
RecoveryResuming the communication if it breaks
Message formattingAgreeing on how the data is laid out
SecurityOnly the right person reads it and nobody alters it
Network managementConfiguring and monitoring the network

If a multiple-choice question offers “CPU scheduling”, “compilation” or “memory management”, that is not a communication task: it belongs to operating systems (topics 3 to 6). If it is not about moving data from one place to another, it does not belong.

Transmission media: where the bits travel

Transmission media are the channels the information travels through. They come in two families: cables (guided media) and wireless links.

  • Cables: twisted pair (the classic network cable, from 1 to 1000 Mbit/s), coaxial (10 to 20 Mbit/s) and optical fibre (100 Gbit/s).
  • Wireless: infrared, radio (Wi-Fi at 300 Mbit/s, Bluetooth at 24 Mbit/s) and microwaves (terrestrial and satellite).

On a logarithmic scale it is easier to see how far apart they are:

Transmission media and their speedBars on a logarithmic scale: twisted pair from 1 to 1000 Mbit/s, coaxial 10 to 20 Mbit/s, optical fibre 100 Gbit/s, Wi-Fi 300 Mbit/s and Bluetooth 24 Mbit/s.Typical speeds (logarithmic scale)1 Mbit/s101001 Gbit/s10100 Gbit/sTwisted paircable1 – 1000 Mbit/sCoaxialcable10 – 20 Mbit/sOptical fibrecable100 Gbit/sWi-Fi (radio)wireless300 Mbit/sBluetooth (radio)wireless24 Mbit/s
Each axis mark multiplies by 10. Fibre is a hundred times faster than the best twisted pair; infrared and microwaves are wireless too.

Each axis mark multiplies by 10. Fibre (100 Gbit/s) is a hundred times faster than the best twisted pair (1 Gbit/s): 100 / 1 = 100. And a curious fact that often appears in ordering questions: coaxial, although it is a cable, tops out at 20 Mbit/s, below Bluetooth (24 Mbit/s).

For “which ones are wireless?”, ask yourself whether there is a physical cable. Fibre = a glass cable, so it is guided, even though light travels inside it.

Bit/s and latency: two different questions

This is where my classmate went wrong. They are two definitions you should know almost word for word:

  • Bit/s: the number of elementary pulses (1 or 0) transmitted every second. It answers “how many bits fit per second?”.
  • Latency: the amount of time that passes between sending an electrical signal and the corresponding action happening. It answers “how long does it take?”.

And latency is calculated by adding three pieces:

Latency = propagation time + transmission time + time in the switches

  • Propagation: how long the signal takes to cover the distance (metres / signal speed). In copper and fibre the signal travels at about 2·10⁸ m/s, two thirds of the speed of light.
  • Transmission: how long it takes to “push out” all the bits of the packet onto the medium (bits / bit/s). Here a faster medium does help.
  • Time in the switches (and routers): how long each intermediate device takes to receive and forward.

For our CSV, with a 1500-byte packet and the path from the cloud to your laptop, the split looks like this (the numbers come from the simulator at the end of the article):

The three pieces of latencyBar with the total latency of 9.233 ms: propagation fills almost the whole bar; devices and transmission are two very thin strips.Latency of one 1500-byte packet: 9.233 msPropagation9.0453 ms98.0 %distance / signal speedDevices0.1000 ms1.1 %time inside switches and routersTransmission0.0881 ms1.0 %packet bits / bit/s of the link
Almost all the latency is propagation: 1,800 km of fibre weigh more than all the bit/s in the world.

See the bar? It is almost all coral. The 1,800 km of fibre to Madrid mean 1,800,000 / 200,000,000 = 0.009 s = 9 ms of propagation, and no faster medium fixes that: we are already at two thirds of the speed of light. Transmission along the whole path adds up to only 0.088 ms. That is why my classmate was half right: with more bit/s the CSV would arrive sooner, but the first packet would still take its 9 ms.

Confusing latency with speed. “This connection has high latency” does not mean it downloads slowly: it means it takes long to respond. A satellite connection can have plenty of Mbit/s and still a huge latency, because the satellite is extremely far away.

The limits of technology

The course notes name three limits to keep in mind with any technology:

  1. The speed of light: no signal goes faster, so propagation always exists.
  2. Many users sharing the same connections: the medium is shared and everyone gets less.
  3. Heterogeneity: different technologies, protocols and operating systems live together in the same LAN, and they have to understand each other.

Devices: what each one does and does NOT do

In the exam it is not enough to know what each device does: they ask just as much about what it does not do. This is the path our download follows inside the faculty, from top to bottom:

What each device does and does not doColumn of devices from top to bottom: modem, router, switch, access point and laptop, with what each one does and does not do.carrier (ISP)DoesDoes notModemconnects to the carriertranslates its network's signaldoes not choose routes(that is the router)Routerconnects your LAN to the Internetrouting, NAT and DHCPdoes not translate the carrier'ssignal (that is the modem)Switchconnects the devicesof the LANdoes not connect to the Internetdoes not give Wi-FiAccess pointplugs into the switchgives Wi-Fi to the LANdoes not routedoes not reach the InternetLaptopis a network node(its adapter has a MAC)—download
The download comes down this ladder. Look at the red column: the exam asks both what each device does and what it does not.

Let’s go through it with the same logic, starting where the data comes in:

  • Modem: connects to the carrier and translates the signal of the provider’s network into something your network understands.
  • Router: connects your local network to the Internet. It does routing, NAT and DHCP (it hands out addresses to the devices).
  • Switch: connects all the devices of the LAN. It does not connect to the Internet and does not give Wi-Fi.
  • Access point (AP): plugs into the switch and gives Wi-Fi to the LAN. It does not route and does not reach the Internet.

For the exam, remember the keywords that give each one away:

If the question says…It is the…
“plugs into the switch”, “gives Wi-Fi to the LAN”Access point
“connects all the devices of the LAN”Switch
“connects the local network to the Internet”, “routing”, “NAT”, “DHCP”Router
“connects to the carrier”, “translates the provider’s network signal”Modem

At home you usually have one single box acting as modem, router, switch and access point at the same time. That is why they are hard to tell apart. In the exam, think of them as four different devices, each with its own job.

Saying the switch takes the network to the Internet or that the AP routes. If a statement gives a switch or an AP the job of “reaching the Internet”, it is false.

Transmission networks: why we don’t run a cable from every device to every device

The simplest way to connect two devices is a point-to-point link: one cable between them. But it is usually not practical, for two reasons from the course notes:

  1. The devices may be very far apart (your laptop and a server in Madrid).
  2. With many devices you would need a huge number of connections.

How many? If each of the 20 PCs in a lab were joined to all the others, you would need 20 × 19 / 2 = 190 cables. With 100 devices, 100 × 99 / 2 = 4,950. The solution is a communication network: each device connects only once and the network takes care of carrying the data.

Switching: reserved path or each packet on its own?

Inside that network, how does data get from A to B? There are two ways to do it, and it is one of the star comparisons of the topic:

Circuit switching versus packet switchingAt the top, a fixed route from A to B highlighted through the nodes. At the bottom, packets 1, 2 and 3 go from A to B along different paths.Circuit switchinga dedicated, continuous route is reserved (telephone network)ABPacket switchingeach packet travels on its own, with no reserved route (Internet, IP)AB123
At the top, the violet path stays reserved even when you are silent. At the bottom, packets 1, 2 and 3 share the network and each one picks its path.
  • Circuit switching: a dedicated, continuous communication route is set up before starting, and it stays reserved for the whole communication, whether you talk or not. Example: the traditional telephone network.
  • Packet switching: the data is split into packets and there is no dedicated route. Each packet carries its header and the devices of the network decide where it goes, so packet 2 of your CSV may take a different path from packet 1. Example: the Internet (IP).
CircuitsPackets
RouteDedicated and continuousNo dedicated route
What is reservedThe path, for the whole communicationNothing: the network is shared
If you send nothingThe path stays busyOthers use the network
ExampleTraditional telephone networkThe Internet (IP)
Transfer modeSynchronous (TDM)Asynchronous (IP; ATM as a historical example)

The last row is about transfer modes. In synchronous mode (TDM, time-division multiplexing) the medium is split into fixed time slots, in frames. In asynchronous mode data is sent when there is data, without fixed slots: that is IP’s mode, and ATM was a historical example.

“circuit” sounds like a reserved cable; “packet” sounds like an envelope travelling alone. If the question mentions “dedicated route” or “telephone”, it is circuits; if it mentions “Internet” or “IP”, packets.

Types of networks

By size and by how the devices share the work, the course notes distinguish five types:

TypeDefinitionIn our example
LAN (Local Area Network)Small network in a limited area (home, office)The faculty network
WAN (Wide Area Network)Network covering large geographical distances (countries, continents)The carrier’s network up to Madrid
InternetGlobal network of networksEverything together
P2P (Peer-to-Peer)Everyone shares resources directlyClassmates passing notes around with no server
Client-serverCentral servers with many clientsA hundred laptops asking for the same dataset

LAN and WAN also have their own characteristics, which in the exam appear as multiple-choice questions with the other one’s mixed in:

LANWAN
Small coverage: a building or nearby buildingsWide geographical area
Usually belongs to the owner of the devicesNeeds to cross public access routes
Larger amount of data transmittedPartly uses circuits from telecom providers
Uses broadcast systemsBuilt with circuit switching, packet switching, TDM and ATM
Recent introduction of switching and ATM

Learn them in pairs: small ↔ wide; it’s mine ↔ crosses public routes and uses other people’s circuits. When a WAN question offers “belongs to the owner of the devices”, you know which column it came from.

The Internet: ISP, PoP and NAP

The Internet is the evolution of ARPANET, developed to solve the problem of communicating between many arbitrary packet-switching networks, and it is based on the TCP/IP protocols. But how are the networks actually joined? With three acronyms that come up as short answers:

Internet architecture: ISP, PoP and NAPTwo carriers, ISP A and ISP B, each with its point of presence. The home and ULPGC LANs enter through ISP A's PoP; the data centre, through ISP B's PoP. Both ISPs meet at a NAP.ISP: connects you to the Internet · PoP: where your network enters the ISP's · NAP: where ISPs meetISP A (your carrier)ISP B (the cloud's)PoPPoPNAPyour home LANthe ULPGC LANdata centre
Your download leaves the data centre, enters ISP B through its PoP, changes carrier at the NAP and reaches your LAN through ISP A's PoP.
  • ISP (Internet Service Provider): the provider that connects users’ and companies’ LANs to the Internet. Your carrier.
  • PoP (Point of Presence): the physical point where the ISP has its network and connects to other networks. That is where your home LAN comes in.
  • NAP (Network Access Point): the point where different ISPs interconnect and share traffic.

Following the drawing: the CSV leaves the data centre, enters ISP B’s network through its PoP, changes carrier at the NAP, crosses your ISP’s network and reaches the faculty LAN through ISP A’s PoP.

Mixing up PoP and NAP. A PoP belongs to one ISP (where it connects its customers); a NAP is where several ISPs meet.

Addresses and interconnection: who do I hand it to?

Last step of the journey. The data sent between two devices gets some control fields (a header) added to it. Among them, who the data is for (destination address) and who sends it (source address).

Header and delivery decisionA frame with destination address, source address and data. Below, the question: is the destination station on my network? If yes, it is delivered directly; if not, it is handed to a router.Destination address08002B00EE1BSource address08002B00EE0BDataa slice of the CSVheader (control fields)Is the destinationstation on my network?yesnoI deliver it directly:the adapter whose physicaladdress (MAC) matches gets itI hand it to a router:it carries it, network bynetwork, to the destination
The header says who it is for and who sends it. If the destination is not on your network, the message does not go to a switch: it goes to the router.

There are two rules, and both show up in true/false questions:

  1. The transmission is received by the device whose destination address matches its adapter’s address (the physical or MAC address, like 08002B00EE1B).
  2. Network interconnection: if the destination station is on my network, I deliver the message directly. If it is not on my network, I hand it to a router: devices connected to more than one network take care of sending it on until it reaches the destination network.

The trap sentence in the exam is “if the destination is not on my network, I hand it to a switch“. False: the switch does not connect to other networks. It goes to the router.

This is exactly what you configured in Linux with the default gateway: the address of the router your machine hands everything that is not on its network to.

Check it with Python

Does propagation really eat almost all the latency? This simulator reproduces the CSV’s journey with the article’s data: six links with their medium, speed and distance, a 1500-byte packet and 0.02 ms for each intermediate device (a reasonable value chosen for the example). It calculates the transmission and propagation of each link, adds up the latency and finds the bottleneck:

# Check it with Python: a dataset's journey from the cloud to your laptop.
# Latency of a packet = transmission time + propagation time + time inside the devices.

PACKET = 1500 * 8           # bits in one packet: 1500 bytes, the typical size on Ethernet
DATASET = 40 * 10**6 * 8    # bits in the dataset: 40 MB (the grades CSV of the whole faculty)
DEVICE = 0.00002            # seconds each intermediate device takes to forward (0.02 ms)
V_CABLE, V_AIR = 2e8, 3e8   # m/s: in copper and fibre the signal travels at about 2/3 of light

# Links in the order the download travels: (link, medium, bit/s, metres)
ROUTE = [
    ("server → NAP → PoP", "optical fibre", 100e9, 1_800_000),   # the cloud is in Madrid
    ("PoP → modem", "optical fibre", 1e9, 9_000),                # your plan: 1 Gbit/s
    ("modem → router", "twisted pair", 1000e6, 2),
    ("router → switch", "twisted pair", 1000e6, 30),
    ("switch → AP", "twisted pair", 1000e6, 25),
    ("AP → laptop", "Wi-Fi", 300e6, 8),                          # the only link without a cable
]

total = 0
print(f"{'link':<22}{'medium':<14}{'transmission':>12}{'propagation':>13}")
for link, medium, bps, metres in ROUTE:
    t_tx = PACKET / bps                           # how long it takes to "push out" all the bits of the packet
    v = V_AIR if medium == "Wi-Fi" else V_CABLE   # air slows the wave down less than copper or glass
    t_prop = metres / v                           # distance / speed: it does not depend on the packet size
    total += t_tx + t_prop
    print(f"{link:<22}{medium:<14}{t_tx * 1000:>9.4f} ms{t_prop * 1000:>10.4f} ms")

devices = len(ROUTE) - 1                          # devices sit BETWEEN links: 6 links, 5 devices
total += devices * DEVICE
print(f"\nIntermediate devices: {devices} × {DEVICE * 1000:.2f} ms")
print(f"Latency of one packet: {total * 1000:.3f} ms")

bottleneck = min(ROUTE, key=lambda t: t[2])       # the slowest link sets the speed of the download
t_down = DATASET / bottleneck[2] + total          # packets travel in a row: the narrowest link rules
print(f"Bottleneck: {bottleneck[0]} ({bottleneck[2] / 1e6:.0f} Mbit/s)")
print(f"Downloading the 40 MB: about {t_down:.2f} s")

And this is its real output:

link                  medium        transmission  propagation
server → NAP → PoP    optical fibre    0.0001 ms    9.0000 ms
PoP → modem           optical fibre    0.0120 ms    0.0450 ms
modem → router        twisted pair     0.0120 ms    0.0000 ms
router → switch       twisted pair     0.0120 ms    0.0001 ms
switch → AP           twisted pair     0.0120 ms    0.0001 ms
AP → laptop           Wi-Fi            0.0400 ms    0.0000 ms

Intermediate devices: 5 × 0.02 ms
Latency of one packet: 9.233 ms
Bottleneck: AP → laptop (300 Mbit/s)
Downloading the 40 MB: about 1.08 s

What to look at:

  1. The propagation of the first link (9 ms) is nearly everything. 1,800,000 m / 2·10⁸ m/s = 0.009 s. The other links are so short that their propagation comes out as 0.0000 or 0.0001 ms.
  2. Transmission depends on bit/s, not on distance. The three twisted-pair links at 1000 Mbit/s all give the same, 12,000 / 1,000,000,000 = 0.012 ms, whether they are 2 or 30 metres long. On the 100 Gbit/s link, a hundred times less.
  3. Devices sit between links: six links, five devices, 5 × 0.02 = 0.1 ms. Check: 9.0453 + 0.0881 + 0.1 = 9.233 ms, which is what it prints.
  4. The bottleneck is the Wi-Fi. For a big download, the slowest link rules: 40 MB = 320,000,000 bits; 320,000,000 / 300,000,000 = 1.07 s, plus the latency, about 1.08 s.
  5. The two questions have different answers: replacing the Wi-Fi with a cable would shorten the download (with a 1000 Mbit/s cable the slowest link would become the 1 Gbit/s one: 320,000,000 / 1,000,000,000 = 0.32 s, about 0.33 s with the latency), but the latency would barely drop. Exactly what my classmate was missing.

Change the numbers and run it again on your computer: put the server in Gran Canaria (50_000 metres) and you will see the latency fall below 1 ms; put 100e9 on the Wi-Fi and you will see the bottleneck move.

Summary

ConceptWhat you need to know
NetworkDevices connected to a common medium through adapters with a unique identifier; the devices are nodes
Communications modelSource → transmitter → transmission system → receiver → destination; source system = source + transmitter, destination system = receiver + destination
Tasks11, all about moving data (synchronisation, errors, addressing, security…)
MediaCables (twisted pair, coaxial, fibre) and wireless (infrared, radio, microwaves)
Bit/s and latencyBits per second versus time until the action; latency = propagation + transmission + switches
DevicesAP gives Wi-Fi; switch joins the LAN; router reaches the Internet (routing, NAT, DHCP); modem talks to the carrier
SwitchingCircuits: dedicated route (telephone). Packets: no dedicated route (Internet, IP)
Types of networksLAN, WAN, Internet, P2P and client-server
InternetEvolution of ARPANET, on TCP/IP; ISP, PoP and NAP
DeliveryThe matching MAC receives it; if the destination is not on my network, to the router

Three ideas to take away

  1. How many bits per second and how long it takes are different questions. Fibre improves the first; distance rules the second.
  2. Each device has one job and only one: the switch joins, the AP gives Wi-Fi, the router goes outside and the modem talks to the carrier.
  3. The Internet is packet switching: each packet travels on its own, carriers meet at NAPs and, if the destination is not on your network, the packet goes to the router.

Now it is your turn: in the introduction to networks exercises you will find an interactive quiz with every exam format (single choice, multiple choice that subtracts for wrong ticks, true/false, fill in the gaps, matching, ordering, short answer, a calculation and open answers) plus the topic’s cheat sheet. After that, the next topic shows how all of this is organised in layers: the OSI and TCP/IP models.

Next step: exercisesIntroduction to networks — exam-style exercises with a quiz that marks itself, the switch trap and a latency worked out by hand (and why you should never tick “just in case”)

Did this article help you? Here is how you can support SergioLearns →

Sigue aprendiendo

Leave a Reply

Your email address will not be published. Required fields are marked *