Blue Team · 9 min read · Log Academy training team
Networking basics for cybersecurity: TCP/IP, ports and DNS
Networking basics for cybersecurity means understanding how computers talk to each other: IP addresses, the TCP/IP model, the difference between TCP and UDP, ports and DNS. Almost every attack leaves a trace on the network: a port scan, a suspicious DNS query, an unusual outbound connection. An analyst who doesn’t know what normal traffic looks like can’t spot what is abnormal either. That’s why both Blue Team and Red Team training start with networking basics.
- The TCP/IP model has four layers, and each layer has its own attack and defense topics.
- TCP sets up a connection with acknowledgments, while UDP sends without them — this difference helps you recognize attacks in traffic.
- A port is a service’s “door number”: you should know ports such as 22 SSH, 53 DNS, 443 HTTPS and 3389 RDP by heart.
- DNS often shows the first trace of an attack: the query to a malicious domain comes before the connection.
- The fastest way to learn networking is to look at your own traffic in Wireshark.
Why do you need networking knowledge for cybersecurity?
Most of the alerts a SOC analyst sees are network events: an internal machine has connected to an unfamiliar external address, one IP has sent requests to hundreds of ports, DNS queries have suddenly spiked. To assess these alerts you have to answer the question “is this normal?”, and that’s impossible without knowing how the network normally behaves.
It’s the same on the Red Team side. A penetration test (pentest) starts with reconnaissance: which hosts are up, which ports are open, which services are running. To read Nmap output, you need to know how TCP establishes a connection.
What is the TCP/IP model?
The TCP/IP model splits the journey of data from one computer to another into layers. Each layer does its own job and serves the layer above it. Courses also often cover the seven-layer OSI model; it’s a more detailed breakdown, but real-world protocols are built around the TCP/IP model.
| Layer | What it does | Example protocols | Security example |
|---|---|---|---|
| Application | The language programs speak | HTTP, HTTPS, DNS, SMTP, SSH | Phishing link, SQL injection, DNS tunneling |
| Transport | Which port the data goes to and how it is delivered | TCP, UDP | Port scan, SYN flood |
| Internet | Addressing and routing | IP, ICMP | IP spoofing, ping sweep |
| Network access | Physical transmission within the same local network | Ethernet, Wi-Fi, ARP | ARP spoofing, rogue Wi-Fi access point |
What is an IP address, and how do internal and external addresses differ?
An IP address is the address of a device on a network. An IPv4 address consists of four numbers separated by dots, for example 192.168.1.10. One part of the address identifies the network and the other identifies the device on that network; the subnet mask (for example /24) defines this split.
The RFC 1918 standard reserves three ranges for internal networks: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. These addresses are not routed on the internet. The practical takeaway for an analyst: an unusual connection in the logs from one internal address to another can point to lateral movement, while a regular connection from an internal address to an unknown external one can point to communication with a command-and-control server.
What is the difference between TCP and UDP?
| Criterion | TCP | UDP |
|---|---|---|
| Connection | Starts with a three-way handshake (SYN, SYN-ACK, ACK) | No connection is set up; the packet is sent straight away |
| Delivery | Acknowledged; lost packets are resent | No acknowledgment |
| Speed | Slower but reliable | Faster |
| Examples | HTTP/HTTPS, SSH, SMTP, RDP | DNS queries, VoIP, video streaming |
| What looks suspicious in traffic | Lots of SYN packets left unanswered | Unusually large or numerous DNS queries |
Understanding the three-way handshake is the foundation for recognizing a port scan. If one IP sends SYN packets to dozens of different ports in a short time and never completes the connection, it is almost always a sign of a scan.
Which ports should you know?
A port separates the services running on the same IP address. Standard port numbers are defined by the IANA registry. You don’t need to memorize them all, but you’ll run into the ones below every day.
| Port | Service | Why it matters |
|---|---|---|
| 22/TCP | SSH | Remote access to Linux servers; a prime target for password guessing |
| 25/TCP | SMTP | Email delivery; the route phishing emails take |
| 53/UDP, TCP | DNS | Domain name resolution; queries to malicious domains show up here |
| 80 and 443/TCP | HTTP and HTTPS | Web traffic; malware also often uses 443 |
| 445/TCP | SMB | Windows file sharing; frequently used for lateral movement |
| 3389/TCP | RDP | Windows Remote Desktop; leaving it exposed to the internet is a serious risk |
How does DNS work, and why does it matter for security?
- You type a domain name into the browser, and the computer first checks its own memory (cache).
- If there is no answer, the query goes to the configured DNS server (resolver).
- If needed, the resolver asks the root servers, then the domain zone (.az, .com) and finally the domain’s own DNS server.
- The IP address is found, returned to the computer and kept in the cache for a while.
- Only then is a TCP connection made to that IP address.
This sequence is a big advantage for defenders: a connection to a malicious server is usually preceded by a DNS query. That makes DNS logs an early warning source. Suspicious signs include newly registered domains or domains made of random letters, very long subdomains (a sign of DNS tunneling) and queries to the same domain at regular intervals.
What does an attack look like in network traffic?
| What to look for | Sign in the traffic | Wireshark filter |
|---|---|---|
| Port scan | Unanswered SYNs from one IP to many ports | tcp.flags.syn == 1 && tcp.flags.ack == 0 |
| Suspicious DNS | Odd or very long domain names | dns |
| Unencrypted login | A form sent in plain text over HTTP | http.request.method == "POST" |
| Lateral movement | SMB and RDP between workstations | tcp.port == 445 || tcp.port == 3389 |
A filter doesn’t give you the answer; it only narrows down where to look. The analyst then looks at the context: who owns this IP, is this behavior normal for that machine, and are there other events in the SIEM at the same time?
How we do it in our lab
The Log Academy Blue Team program starts with exactly this topic: the first module covers networking and protocol basics — reading TCP/IP, DNS and HTTP traffic and hunting for anomalies with Wireshark. Students work in a personal virtual lab, and in later modules the same traffic skills are combined with Sysmon telemetry and a SIEM built on ELK / Wazuh. The question we hear most often in our courses is “I don’t know much about IT — can I still start?” The answer is yes: the program starts from the basics, and no coding is required at this stage.
Frequently asked questions
- How much networking do you need to know for cybersecurity?
- To get started, the TCP/IP model, IP addressing, the difference between TCP and UDP, the main ports, DNS and HTTP are enough. You don’t need in-depth knowledge of routing protocols.
- Do you need CCNA before learning cybersecurity?
- It isn’t required. CCNA is useful, but the networking knowledge you need for security is narrower than what it covers. Learning the core topics and practicing in Wireshark is enough to get started.
- What is Wireshark?
- Wireshark is a free, open-source network traffic analyzer. It captures the packets passing through a computer and displays the fields of each protocol in a readable form.
- Should you learn the OSI model or the TCP/IP model?
- Both. The seven OSI layers come up often in interviews and documentation, while TCP/IP shows how real protocols are built. It’s enough to know how the layers map to each other.
- Can you learn networking basics in a cybersecurity course?
- Yes. The 6-month Log Academy Blue Team program starts with networking and protocol basics, then moves on to Sysmon, SIEM, detection rules and incident response. Classes run in person and online. The first lesson is free.