Lekcja 1 z 4 · 9 min
Network basics: the OSI model, TCP/IP and common ports
How data travels between computers, the layer models used to describe it, and the ports and protocols you will see in every firewall and log.
Ta strona jest na razie po angielsku.
You cannot protect a network you cannot describe. Every firewall rule, alert and log line is written in the language of networking: addresses, protocols, ports and layers. This lesson gives you that vocabulary. The University’s TCP/IP and DNS courses go deeper; here the goal is a working map you can use in every lesson that follows.
Layers: splitting a hard problem into pieces
Sending a message across the world involves physical signals, local delivery, global routing, reliable delivery and the application’s own format. Network engineers split this into layers, each doing one job and relying on the layer below. The OSI reference model, standardised by the ITU as X.200 and by ISO, uses seven layers. The internet itself runs on the simpler TCP/IP model, usually drawn with four layers. The OSI numbers survive in everyday speech: a “layer 7 firewall” looks at applications, a “layer 3 device” routes IP packets.
| OSI layer | What it handles | Everyday examples | TCP/IP model |
|---|---|---|---|
| 7 Application | What the program says | HTTP, DNS, SMTP, IMAP | Application |
| 6 Presentation | Formats, encoding, encryption | TLS (roughly), character sets | Application |
| 5 Session | Conversations between programs | Session management | Application |
| 4 Transport | Delivery between programs, ports | TCP, UDP | Transport |
| 3 Network | Addressing and routing across networks | IP (IPv4, IPv6), ICMP | Internet |
| 2 Data link | Delivery on the local network | Ethernet, Wi-Fi frames, MAC addresses | Link |
| 1 Physical | Signals on a wire or radio | Cables, radio waves | Link |
IP addresses: where
Every device on a network has an IP address. IPv4 addresses look like 203.0.113.7; IPv6 addresses look like 2001:db8::7. Some ranges are reserved for private networks and never appear directly on the internet: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 (defined in RFC 1918). Your home router gives your devices private addresses and translates them to its single public address when they go online. Recognising private addresses matters in security: a connection to 192.168.1.20 stays inside your home or office, a connection to a public address leaves it.
TCP and UDP: how
The transport layer offers two main services. TCP (Transmission Control Protocol) sets up a connection with a handshake, numbers every byte, resends what is lost and delivers everything in order: ideal for web pages, email and file transfers. UDP (User Datagram Protocol) just sends packets with no guarantees: ideal for voice, video, games and DNS lookups, where speed matters more than perfection. QUIC, the protocol behind HTTP/3, builds reliability on top of UDP.
Ports: which program
An IP address gets data to a computer; a port number (0 to 65535) gets it to the right program on that computer. Servers listen on well-known ports registered with IANA, so clients know where to knock. Your side of the connection uses a temporary high-numbered port chosen by the operating system.
| Port | Protocol | Security note |
|---|---|---|
| 22 TCP | SSH (remote login) | Encrypted; a favourite target for password guessing when exposed |
| 25, 587 TCP | SMTP (sending email) | Server-to-server mail and submission |
| 53 UDP/TCP | DNS | Name lookups; can be abused to smuggle data out |
| 80 TCP | HTTP | Unencrypted web; anyone on the path can read it |
| 443 TCP/UDP | HTTPS (and HTTP/3 over UDP) | Encrypted web; most traffic today, including most attacker traffic |
| 445 TCP | SMB (file sharing) | Should never be exposed to the internet |
| 3389 TCP | RDP (Windows remote desktop) | Frequent ransomware entry point when exposed |
| 5900 TCP | VNC / screen sharing | Keep on trusted networks only |
Why ports alone are no longer enough
Traditional firewalls decided mostly by address and port: allow 443, block 3389. Today almost everything, good and bad, travels over port 443 inside encrypted HTTPS, so “port 443 is allowed” says very little. That is why modern host firewalls also look at which application is making the connection. FireAI, for example, identifies each app by its code signature and lets you allow or deny that specific app, rather than a whole port. It can also read what an encrypted connection announces at its start, such as the website name, without ever decrypting the content.
A connection, end to end
- An app wants to reach example.com. It asks DNS (port 53) for the address.
- The operating system opens a TCP connection from a temporary port to that address on port 443.
- Your router forwards it, translating your private address to its public one.
- Routers across the internet pass the IP packets towards the destination.
- TLS encrypts the conversation; HTTP carries the actual request inside it.
Each of these steps is a place where security can be applied, and where an attacker might try to interfere. The next lessons look at the defences built around them.
Najważniejsze
- Layer models (OSI with 7 layers, TCP/IP with 4) split networking into jobs; layer numbers are everyday jargon.
- IP addresses say where, TCP/UDP say how, ports say which program.
- Private ranges (10/8, 172.16/12, 192.168/16) stay inside local networks.
- Most traffic now uses port 443, so modern firewalls also judge which application connects.
Sprawdź się
1. Which transport protocol resends lost data and delivers everything in order?
- UDP
- TCP — Dobrze.
- ICMP
- DNS
TCP sets up a connection, tracks every byte and retransmits losses. UDP sends without guarantees.
2. Which address belongs to a private network range defined in RFC 1918?
- 8.8.8.8
- 192.168.1.20 — Dobrze.
- 203.0.113.7
- 17.253.1.1
192.168.0.0/16 is one of the three private IPv4 ranges, along with 10.0.0.0/8 and 172.16.0.0/12.
3. Why is “allow port 443” no longer a meaningful security rule on its own?
- Port 443 is unused today
- Almost all traffic, legitimate and malicious, now travels over HTTPS on port 443 — Dobrze.
- Port 443 is always blocked by routers
- HTTPS cannot be encrypted
Because nearly everything uses 443, the port says little; knowing which application connects is far more useful.
Wypróbuj to z FireAI
Zastosuj tę lekcję w praktyce na swoim Macu.
- Jak FireAI obserwuje połączenia twojego Maca — Wiedz, jaka aplikacja łączy się z internetem, prostymi słowami, bez instalowania czegokolwiek działającego jako ukryta usługa w tle.
- Reguły: aplikacja, strona, domena, IP albo zakres — na zawsze albo do restartu — Napisz regułę tak precyzyjną jak jeden adres albo tak szeroką jak cała domena.
- Coffee Shop Armor: safer on public Wi-Fi, and warned about fake networks — Sit down in any café, hotel or airport and let FireAI tighten up for you.
- Who’s online: see every device on your network, and get told when one comes or goes — Know what’s on your Wi-Fi, from the TV to your kid’s phone, without any extra box.
Źródła
- ITU-T X.200: Open Systems Interconnection basic reference model
- RFC 9293: Transmission Control Protocol (TCP)
- RFC 1918: Address Allocation for Private Internets
- IANA: Service Name and Transport Protocol Port Number Registry
Zastosuj to na swoim Macu
Wypróbuj wszystkie funkcje za darmo przez 17 dni, bez karty.