Home / Blog

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.

TCP/IP model layers and security examples
LayerWhat it doesExample protocolsSecurity example
ApplicationThe language programs speakHTTP, HTTPS, DNS, SMTP, SSHPhishing link, SQL injection, DNS tunneling
TransportWhich port the data goes to and how it is deliveredTCP, UDPPort scan, SYN flood
InternetAddressing and routingIP, ICMPIP spoofing, ping sweep
Network accessPhysical transmission within the same local networkEthernet, Wi-Fi, ARPARP 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?

TCP vs UDP comparison
CriterionTCPUDP
ConnectionStarts with a three-way handshake (SYN, SYN-ACK, ACK)No connection is set up; the packet is sent straight away
DeliveryAcknowledged; lost packets are resentNo acknowledgment
SpeedSlower but reliableFaster
ExamplesHTTP/HTTPS, SSH, SMTP, RDPDNS queries, VoIP, video streaming
What looks suspicious in trafficLots of SYN packets left unansweredUnusually 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.

The most common ports and why they matter
PortServiceWhy it matters
22/TCPSSHRemote access to Linux servers; a prime target for password guessing
25/TCPSMTPEmail delivery; the route phishing emails take
53/UDP, TCPDNSDomain name resolution; queries to malicious domains show up here
80 and 443/TCPHTTP and HTTPSWeb traffic; malware also often uses 443
445/TCPSMBWindows file sharing; frequently used for lateral movement
3389/TCPRDPWindows Remote Desktop; leaving it exposed to the internet is a serious risk

How does DNS work, and why does it matter for security?

  1. You type a domain name into the browser, and the computer first checks its own memory (cache).
  2. If there is no answer, the query goes to the configured DNS server (resolver).
  3. If needed, the resolver asks the root servers, then the domain zone (.az, .com) and finally the domain’s own DNS server.
  4. The IP address is found, returned to the computer and kept in the cache for a while.
  5. 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?

Starter Wireshark filters for finding suspicious traffic
What to look forSign in the trafficWireshark filter
Port scanUnanswered SYNs from one IP to many portstcp.flags.syn == 1 && tcp.flags.ack == 0
Suspicious DNSOdd or very long domain namesdns
Unencrypted loginA form sent in plain text over HTTPhttp.request.method == "POST"
Lateral movementSMB and RDP between workstationstcp.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.
Book a consultationView course →

We teach these skills hands-on here: Blue Team course.

Related articles

BTL1 and Other Centri Certifications in Azerbaijan: Which to Choose and How to PrepareWhat is phishing and how do you spot it? Telling fake emails, texts and calls apartWhat Is Incident Response? The Phases ExplainedWhat is SIEM and how does it work? A simple guide with Wazuh and ELK