Chapter 1.4: The Internet

Computer Fundamentals and Introduction to Programming
Network basicsAddressingThe WebDigital servicesSecurity
Sercan KÜLCÜ · Giresun University

Introduction

Learning Outcomes

Network concepts

Explain how the Internet, clients, servers and protocols relate.

Addressing

Distinguish IP addresses, domain names, DNS and URLs.

Using the Web

Use browsers and search engines effectively.

Security

Recognize threats and build safe habits.

Network Basics

What Is the Internet?

A computer network connects devices so they can share data and resources. The Internet is a global network of networks that joins networks of every size under common rules (TCP/IP).

Internet backbonelinks between ISPsHome networkPhoneLaptopRUniversity networkLabServerRCompany networkPCPrinterRData centerWebVideoRR = router: connects networks to each other

Network Basics

How the Internet Grew

1969ARPANETfirst links (UCLA–SRI)1983TCP/IPARPANET’s common protocol1989Web proposalTim Berners-Lee, CERN1991First websiteWeb opened to everyone1993TürkiyeMETU–NSFNET link2007Smartphonesmobile Internet spreads
The Web and the Internet are not the same: the Internet is an infrastructure dating from 1969; the Web is a service that started on top of it in 1991. Today mobile networks, fiber and cloud services keep extending global access.

Network Basics

The Internet in Türkiye

Türkiye's first permanent Internet connection was set up between METU (ODTÜ) and NSFNET on April 12, 1993.

1993ODTÜ – NSFNET64 Kbps line1996ULAKBİMULAKNET launched in 1997Todayfiber · mobile · satelliteup to 1 Gbps on home fiber
1993

Academic access began over a 64 Kbps link.

1996

TÜBİTAK ULAKBİM was founded; the ULAKNET academic network went live in 1997.

Today

Fiber, mobile and satellite links offer different ways to connect.

Network Basics

Getting Online

Fiber

High capacity and low latency.

DSL

A fixed connection over the phone line.

Mobile data

Portable access through cell towers.

Fixed wireless and satellite

An option where cables are hard to run.

An ISP (Internet service provider) connects users to the Internet backbone.
DevicesModem/routerAccess linefiber · DSL · mobile · satelliteISPBackboneWi-Fi / cableInternet service providerhome LAN ←→ wide area network (WAN)

Network Basics

Bandwidth and Latency

Bandwidthbits carried per second10 Mbit/s100 Mbit/sLatency (ping)first bit's arrival time5 ms (same city)≈ 600 ms (satellite, GEO)
Download time

On a 100 Mbit/s line, a 500 MB file downloads in at best 500 ÷ 12.5 MB/s = 40 s.

Which matters?

Bandwidth for large downloads; low latency for gaming and video calls.

Network Basics

Clients, Servers and Protocols

Laptop (browser)Phone (app)Network / InternetServerweb, email, games…requestrequestresponseresponse
Client

A device or program that requests a service.

Server

A system that answers requests and provides resources.

Protocol

Rules for the format and order of communication.

Network Basics

Network Devices

InternetModemFirewallRouterSwitchAccess pointPCPrinterPhoneWi-FiAt home, the modem, router, switch and access point are often one box; every device has a NIC.
NIC

Connects a device to the network.

Switch

Forwards frames to the right device on the local network.

Router

Routes packets between different networks.

Modem

Converts the signal on the access line into network data.

Access point

Connects wireless devices to the local network.

Firewall

Filters network traffic according to rules.

Network Basics

A Typical Network: From LAN to WAN

LAN (office)PC 1PC 2PrinterSwitchAccess pointPhoneTabletRouterFirewallModemWAN / InternetISP linesBranch LANRouter

A switch connects devices on the same local network; a router connects different networks. At home, the modem, router, switch and access point usually share one box.

Network Basics

Geographic Scope of Networks

WANMANLANPAN
TypeScopeExample
PANPersonal areaPhone and earbuds
LANRoom, building or campusOffice network
MANCity scaleMunicipal network
WANCountry or continentA company's branches; the Internet is the largest WAN

Network Basics

Wi-Fi Standards

NameIEEEBandsMain difference
Wi-Fi 5802.11ac5 GHzWide channels; much faster than 802.11n
Wi-Fi 6802.11ax2.4 and 5 GHzMore efficient in crowded places (OFDMA); better with many devices
Wi-Fi 6E802.11ax2.4, 5 and 6 GHzWi-Fi 6 plus the 6 GHz band; less interference
Wi-Fi 7802.11be2.4, 5 and 6 GHzWider channels (320 MHz), simultaneous links on several bands (MLO)
4G (LTE) → 5G3GPPCarrier bands5G typically brings higher speed and lower latency; real values depend on the carrier and coverage

Theoretical speeds rise with each generation; real speed depends on distance, obstacles, channel width and support on both the router and the device.

Network Basics

Wi-Fi Bands

2.4 GHz

Long range, passes walls better; usually slower. Crowded by microwave ovens, Bluetooth and neighboring networks.

5 GHz

Medium range, higher speed. Weakens more through walls than 2.4 GHz.

6 GHz

Short range, highest potential speed, little congestion (Wi-Fi 6E and 7). Most affected by obstacles.

Wi-Fi6 GHzfastest, shortest5 GHzmedium range2.4 GHzlongest rangerange
The general trade-off: higher frequency means more potential speed but less range and wall penetration. In a far room 2.4 GHz often works better; up close, 5/6 GHz.

Network Basics

Wi-Fi Security

ProtocolStatusNote
WEPInsecureVery old; can be cracked in minutes. Should no longer be used.
WPA / TKIPLegacyNot recommended; exists only for old devices.
WPA2 (AES)WidespreadNeeds a strong, long password; weak ones can be guessed.
WPA3CurrentMore resistant to weak passwords; the 6 GHz band uses WPA3 (or Enhanced Open). Requires device support.
WEP1997 · brokenWPA2003 · legacyWPA22004 · widespreadWPA32018 · currentold, weaknew, strong
Open (password-free) networks: traffic may be unencrypted; someone on the same network can eavesdrop or set up a fake access point. For sensitive tasks (banking, government services) use HTTPS and, if needed, a VPN.

Addressing

Communication Protocols

IP

Addressing and routing packets between networks.

TCP

Ordered, reliable delivery of data.

UDP

Low-latency, connectionless delivery.

DNS

Translating domain names into IP addresses.

HTTP/HTTPS

Transferring web resources. HTTPS encrypts the communication.

SMTP/IMAP

Sending and receiving email.

Addressing

Protocols Work in Layers

ApplicationHTTP, DNS, SMTPDataTransportTCP, UDPInternetIPLinkEthernet, Wi-Fi

The browser produces an HTTP request (data). The application layer decides “what to say”.

ApplicationHTTP, DNS, SMTPDataTransportTCP, UDPTCPDataInternetIPLinkEthernet, Wi-Fi

The transport layer splits the data and adds a TCP header to each piece: port number, sequence number. A lost piece can be requested again.

ApplicationHTTP, DNS, SMTPDataTransportTCP, UDPTCPDataInternetIPIPTCPDataLinkEthernet, Wi-Fi

The Internet layer adds an IP header: source and destination IP addresses. Routers choose a path by looking only at this header.

ApplicationHTTP, DNS, SMTPDataTransportTCP, UDPTCPDataInternetIPIPTCPDataLinkEthernet, Wi-FiEthIPTCPData

The link layer adds a frame header (MAC address) and sends the bits over a cable or radio.

ApplicationHTTP, DNS, SMTPTransportTCP, UDPInternetIPLinkEthernet, Wi-Fireceiver: headers are removedone by one, bottom to topData

At the receiver the process reverses: each layer reads and strips its own header, and the data reaches the server application just as the browser sent it.

Addressing

Data Travels in Packets

SenderReceiverR1R2R3R4#1HELL#2O, W#3ORLD#4!message: “HELLO, WORLD!”receive buffer#1#2#3#4

The message is not sent in one piece: it is split into 4 packets. Each packet's header holds a sequence number and the source and destination addresses.

SenderReceiverR1R2R3R4message: “HELLO, WORLD!”receive buffer#1#2#3#4

Packets travel independently: #1 and #3 take R1 → R2 → R4.

SenderReceiverR1R2R3R4message: “HELLO, WORLD!”receive buffer#1HELL#2#3ORLD#4

#2 and #4 take R1 → R3 → R4. Routers choose the best path for each packet at that moment.

SenderReceiverR1R2R3R4message: “HELLO, WORLD!”receive buffer#1HELL#2#3ORLD#4!#2 lost ✗

Packets arrive out of order: first #1, #3, #4. #2 was lost at a busy router.

SenderReceiverR1R2R3R4message: “HELLO, WORLD!”receive buffer#1HELL#2#3ORLD#4!receiver: “#2 missing, resend”

TCP notices the missing sequence number; #2 is resent (via R3 again).

SenderReceiverR1R2R3R4message: “HELLO, WORLD!”receive buffer#1HELL#2O, W#3ORLD#4!HELLO, WORLD!

All packets have arrived. The receiver orders them by sequence number and reassembles the message: “HELLO, WORLD!”.

Addressing · Step by step

A Packet's Path Through Routers, Step by Step

laptopR0R1R2R3server203.0.113.10192.168.1.10R4R5R6TTL = 64

The laptop (192.168.1.10) sends a packet to the server at 203.0.113.10. The IP header has TTL = 64. The destination is not on the local network → the packet goes to the default gateway (R0, the home router).

laptopR0R1R2R3server203.0.113.10192.168.1.10R4R5R6TTL = 63R0 routing table192.168.1.0/24→ local network0.0.0.0/0→ R1 (ISP)matches (/0)

R0 receives the packet and decrements TTL (63). The destination matches only 0.0.0.0/0 (the default route) → the ISP's router R1. (With NAT, the source address is also changed here.)

laptopR0R1R2R3server203.0.113.10192.168.1.10R4R5R6TTL = 62R1 routing table203.0.113.0/24→ R2matches (/24)198.51.100.0/24→ R40.0.0.0/0→ R5matches (/0)

R1: TTL 62. Two entries match: /24 and /0. Longest prefix wins: 203.0.113.0/24 is more specific → R2. The routes to R4 and R5 are not used.

laptopR0R1R2R3server203.0.113.10192.168.1.10R4R5R6TTL = 61R2 routing table203.0.0.0/16→ R6matches (/16)203.0.113.0/24→ R3matches (/24)

R2: TTL 61. Both 203.0.0.0/16 and 203.0.113.0/24 match; /24 is longer → R3. Had /16 been chosen, the packet would have gone to R6.

laptopR0R1R2R3server203.0.113.10192.168.1.10R4R5R6TTL = 60R3 routing table203.0.113.0/24→ directly connectedmatches (/24)

R3: TTL 60. The destination network is directly connected to R3; the packet is delivered to the server.

laptopR0R1R2R3server203.0.113.10192.168.1.10R4R5R6TTL = 60

The packet crossed 4 routers and TTL dropped from 64 to 60. TTL keeps a packet caught in a loop from circulating forever: when it hits 0, the packet is dropped and a “time exceeded” message goes back to the sender. tracert / traceroute sends packets with TTL 1, 2, 3… to list the routers on the path.

receive packet, look at destination IP
TTL = TTL − 1;  if 0, drop and notify source
find table entries that match the destination
pick the longest-prefix (most specific) entry
forward to that entry's next hop

Addressing

IP Addresses

An IP address identifies a network interface and lets packets be routed to it.

19211000000.16810101000.100000001.2500011001network part (/24): 192.168.1host part: 25
IPv4

32 bits: four numbers separated by dots (each 0–255), called dotted-decimal notation.

192.168.1.25
IPv6

128 bits: groups of hex digits; a much larger address space.

2001:db8::25
A device's local IP address need not be the same as the public IP address seen on the Internet.

Addressing

Local and Public IP Addresses (NAT)

Home network (local addresses)Laptop192.168.1.10Phone192.168.1.11Tablet192.168.1.12Routerinside: 192.168.1.1outside: 203.0.113.7InternetServer198.51.100.20source: 192.168.1.10destination: 198.51.100.20

The laptop sends a packet to the server. The source is its local IP (192.168.1.10); private addresses are not routed on the Internet. The router replaces it (together with the port number, NAPT) with a public IP.

Home network (local addresses)Laptop192.168.1.10Phone192.168.1.11Tablet192.168.1.12Routerinside: 192.168.1.1outside: 203.0.113.7InternetServer198.51.100.20source: 203.0.113.7destination: 198.51.100.20NAT table192.168.1.10:50000 ↔ 203.0.113.7:61000

The router replaces the source address with its own public IP (203.0.113.7) and records the mapping in its NAT table.

Home network (local addresses)Laptop192.168.1.10Phone192.168.1.11Tablet192.168.1.12Routerinside: 192.168.1.1outside: 203.0.113.7InternetServer198.51.100.20source: 198.51.100.20destination: 203.0.113.7NAT table192.168.1.10:50000 ↔ 203.0.113.7:61000

The server sees only 203.0.113.7 and sends its reply there. From outside, every device in the home looks like one address.

Home network (local addresses)Laptop192.168.1.10Phone192.168.1.11Tablet192.168.1.12Routerinside: 192.168.1.1outside: 203.0.113.7InternetServer198.51.100.20source: 198.51.100.20destination: 192.168.1.10NAT table192.168.1.10:50000 ↔ 203.0.113.7:61000

The router checks its NAT table: the reply belongs to the laptop at 192.168.1.10. It rewrites the destination and forwards the packet.

Addressing

Domain Names and DNS

www.ornek.edu.tr
DNS query
203.0.113.10
Web server

A domain name is a name people can read. DNS translates it into an IP address you can connect to.

Addressing

DNS Resolution, Step by Step

Browsercache + operating systemResolverISP or organization DNSRoot (.)root server.tr servertop-level domain (TLD)ornek.edu.trauthoritative serverWeb server203.0.113.10

1. The user types www.ornek.edu.tr into the address bar. Connecting requires this name's IP address.

Browsercache + operating systemResolverISP or organization DNSRoot (.)root server.tr servertop-level domain (TLD)ornek.edu.trauthoritative serverWeb server203.0.113.10not in cache

2. The browser and operating system check their own caches first: no record.

Browsercache + operating systemResolverISP or organization DNSRoot (.)root server.tr servertop-level domain (TLD)ornek.edu.trauthoritative serverWeb server203.0.113.10www.ornek.edu.tr?

3. The question goes to the DNS resolver in the network settings (usually the ISP's server).

Browsercache + operating systemResolverISP or organization DNSRoot (.)root server.tr servertop-level domain (TLD)ornek.edu.trauthoritative serverWeb server203.0.113.10→ ask .tr

4. The resolver starts at the top: the root server doesn't know the name but says “ask the .tr servers”.

Browsercache + operating systemResolverISP or organization DNSRoot (.)root server.tr servertop-level domain (TLD)ornek.edu.trauthoritative serverWeb server203.0.113.10→ ask ornek.edu.tr

5. The .tr server doesn't know the full name either: “ask the authoritative server for ornek.edu.tr”.

Browsercache + operating systemResolverISP or organization DNSRoot (.)root server.tr servertop-level domain (TLD)ornek.edu.trauthoritative serverWeb server203.0.113.10203.0.113.10

6. The authoritative server knows the record and answers: 203.0.113.10.

Browsercache + operating systemResolverISP or organization DNSRoot (.)root server.tr servertop-level domain (TLD)ornek.edu.trauthoritative serverWeb server203.0.113.10203.0.113.10

7. The resolver passes the answer to the browser and caches it for a while (TTL); the next question is answered at once.

Browsercache + operating systemResolverISP or organization DNSRoot (.)root server.tr servertop-level domain (TLD)ornek.edu.trauthoritative serverWeb server203.0.113.10connect: 203.0.113.10

8. Now that it knows the IP address, the browser connects to the web server at 203.0.113.10.

Addressing · Step by step

The DNS Resolver and Its Cache, Step by Step

browserresolverroot.trornek.edu.tr authoritativeresolver cache:empty

The browser asks the resolver for www.ornek.edu.tr. The resolver's cache is empty (it just started).

browserresolverroot.trornek.edu.tr authoritativeresolver cache:empty

Not in the cache, and no known server either → ask a root server.

browserresolverroot.trornek.edu.tr authoritativereferral: ask .trresolver cache:.tr → server

The root doesn't know the name; it points to the .tr servers. This is written to the cache.

browserresolverroot.trornek.edu.tr authoritativeresolver cache:.tr → server

The .tr server is asked.

browserresolverroot.trornek.edu.tr authoritativereferral: ask authoritativeresolver cache:.tr → serverornek.edu.tr → authoritative

.tr points to the authoritative server for ornek.edu.tr; that is cached too.

browserresolverroot.trornek.edu.tr authoritativeresolver cache:.tr → serverornek.edu.tr → authoritative

The authoritative server is asked.

browserresolverroot.trornek.edu.tr authoritativeanswer: 203.0.113.10, TTL 3600 sresolver cache:.tr → serverornek.edu.tr → authoritativewww → 203.0.113.10203.0.113.10

The authoritative server knows the record: 203.0.113.10. It is cached for its TTL (here 1 hour) and passed to the browser. 3 queries.

browserresolverroot.trornek.edu.tr authoritativeresolver cache:.tr → serverornek.edu.tr → authoritativewww → 203.0.113.10

Within the same minute, another page asks for ogrenci.ornek.edu.tr.

browserresolverroot.trornek.edu.tr authoritativeresolver cache:.tr → serverornek.edu.tr → authoritativewww → 203.0.113.10

That name isn't cached, but the authoritative server for ornek.edu.tr is known: root and .tr are skipped, and the authoritative server is asked directly.

browserresolverroot.trornek.edu.tr authoritativeanswer: 203.0.113.20resolver cache:.tr → serverornek.edu.tr → authoritativewww → 203.0.113.10ogrenci → 203.0.113.20203.0.113.20

The answer is 203.0.113.20; just 1 query.

browserresolverroot.trornek.edu.tr authoritativeresolver cache:.tr → serverornek.edu.tr → authoritativewww → 203.0.113.10ogrenci → 203.0.113.20203.0.113.10

Another user asks for www.ornek.edu.tr: the record is cached → 0 queries, an instant answer. When the TTL expires the record is removed and the next question goes back to the authoritative server; that is why an address change doesn't reach everyone at once.

is the name in the cache?  Yes → answer, done
server = closest known (else root)
ask that server for the name
referral: cache it, ask the referred server
IP received: cache it (TTL), answer

Addressing

Parts of a Domain Name

www.giresun.edu.tr
. (root)trcountry code (ccTLD)comeduorganization typegovgiresuninstitutionwwwsubdomain / host
  • A name is read right to left: from general to specific.
  • tr: country-code top-level domain.
  • edu: organization type (education).
  • giresun: the institution's domain.
  • www: subdomain or host name.
  • A DNS lookup follows this tree down from the root.

Addressing

The Structure of a URL

httpsprotocol://www.ornek.edu.trdomain name/announcementspath?id=42query#detailsfragment
httpsThe rules for communicating (encrypted HTTP)
www.ornek.edu.trThe server's domain name; DNS turns it into an IP
/announcementsPath to the resource on the server
?id=42Extra information for the server (name=value)
#detailsA section of the page; not sent to the server, the browser scrolls to it

Addressing

Ports: IP Is the Building, Port Is the Apartment

An IP address is like a building, a port number like an apartment in it. Common ports: 80 HTTP, 443 HTTPS, 22 SSH, 53 DNS.

Client(browser)Server: IP 203.0.113.10:22 SSH:53 DNS:443 HTTPS:80 HTTP:8080 Local app (e.g. test server)IP: 203.0.113.10port: 443packet label

1. The browser opens https://ornek.edu.tr. DNS supplies the IP; the default port for HTTPS is 443. The packet is addressed to IP:port.

Client(browser)Server: IP 203.0.113.10:22 SSH:53 DNS:443 HTTPS:80 HTTP:8080 Local app (e.g. test server)over the Internet

2. Routers first deliver the packet to the IP address (the building). The IP only decides which computer to reach.

Client(browser)Server: IP 203.0.113.10:22 SSH:53 DNS:443 HTTPS:80 HTTP:8080 Local app (e.g. test server)port 443?

3. The server's operating system looks at the port number (the apartment) and hands the packet to the service listening on it, here the HTTPS web server. :80 and :22 go to other services.

Client(browser)Server: IP 203.0.113.10:22 SSH:53 DNS:443 HTTPS:80 HTTP:8080 Local app (e.g. test server)…:8080 address

4. If the URL includes a port, it replaces the default: http://203.0.113.10:8080 goes to another application listening on :8080. One IP can host many services on different ports.

Addressing · Step by step

TCP: Three-Way Handshake, Data and Teardown

clientserver :443SYN-SENTSYN-RECEIVEDSYN seq=1000

The client asks to connect: a SYN segment with initial sequence number 1000 (random in practice). The server was listening on port 443.

clientserver :443SYN-SENTSYN-RECEIVEDSYN seq=1000SYN + ACK seq=5000, ack=1001

The server accepts: its own sequence number is 5000 and ack = 1001, meaning “got 1000, expecting 1001”. A SYN consumes one sequence number.

clientserver :443ESTABLISHEDESTABLISHEDSYN seq=1000SYN + ACK seq=5000, ack=1001ACK seq=1001, ack=5001

The client confirms with an ACK (ack = 5001). Three segments set up the connection: the three-way handshake. No data has been sent yet.

clientserver :443ESTABLISHEDESTABLISHEDSYN seq=1000SYN + ACK seq=5000, ack=1001ACK seq=1001, ack=5001data (100 bytes) seq=1001

The client sends a 100-byte HTTP request: bytes 1001–1100. With HTTPS, a TLS handshake also runs over this channel first.

clientserver :443ESTABLISHEDESTABLISHEDSYN seq=1000SYN + ACK seq=5000, ack=1001ACK seq=1001, ack=5001data (100 bytes) seq=1001ACK ack=1101

With ack = 1101, the server reports that all 100 bytes arrived. Without the ACK, the client would resend the same bytes after a timeout.

clientserver :443FIN-WAITCLOSE-WAITSYN seq=1000SYN + ACK seq=5000, ack=1001ACK seq=1001, ack=5001data (100 bytes) seq=1001ACK ack=1101FIN seq=1101

Done; the client closes its direction with a FIN.

clientserver :443FIN-WAITCLOSE-WAITSYN seq=1000SYN + ACK seq=5000, ack=1001ACK seq=1001, ack=5001data (100 bytes) seq=1001ACK ack=1101FIN seq=1101ACK ack=1102

The server acknowledges the FIN (ack = 1102). If it still has data to send, it can keep sending.

clientserver :443TIME-WAITLAST-ACKSYN seq=1000SYN + ACK seq=5000, ack=1001ACK seq=1001, ack=5001data (100 bytes) seq=1001ACK ack=1101FIN seq=1101ACK ack=1102FIN seq=5001

The server sends its own FIN.

clientserver :443TIME-WAITCLOSEDSYN seq=1000SYN + ACK seq=5000, ack=1001ACK seq=1001, ack=5001data (100 bytes) seq=1001ACK ack=1101FIN seq=1101ACK ack=1102FIN seq=5001ACK ack=5002

The client sends the final ACK; the connection is closed in both directions. Setup took 3 segments, teardown 4. UDP has none of these steps.

client → SYN
server → SYN + ACK
client → ACK        // connected
client → data (HTTP request)
server → ACK
client → FIN;  server → ACK
server → FIN;  client → ACK  // closed

Addressing

HTTP vs. HTTPS: What Does Encryption Change?

BrowserServerornek.edu.truser=ali password=Secret123Eavesdropping attackersees: the password ✗

HTTP: If you log in over HTTP on public Wi-Fi, someone on the same network can read the packets and see the password in plain text.

BrowserServerornek.edu.tr7f3a 9c1e b24d 0e88 …lock: encrypted with TLSEavesdropping attackersees: meaningless data ✓

HTTPS: Data is encrypted with TLS: an interceptor sees only meaningless bytes. The browser's “connection is secure” indicator in the address bar shows this (a padlock in older versions).

BrowserServerornek.edu.tr7f3a 9c1e b24d 0e88 …lock: encrypted with TLSEavesdropping attackersees: meaningless data ✓certificate: ornek.edu.trsigned by a trusted authority

Certificate: The browser also checks the server's certificate: it verifies that you really reached the organization behind ornek.edu.tr. The padlock doesn't mean the site is honest; phishing sites use HTTPS too.

Addressing

Encryption Basics

Symmetric: one shared keytestx7#QptestKKencryptdecryptAsymmetric: a key pairtestx7#QptestpublicprivateencryptdecryptHash: one-waytest9f86d081…SHA-256✗ cannot be reversed
Symmetric encryption

The same key encrypts and decrypts. It is fast; the problem is getting the key to the other side safely. Example: AES.

Asymmetric encryption

The public key is given to everyone (encrypts/verifies); the private key stays secret (decrypts/signs). Slower, but it solves key distribution. Examples: RSA, elliptic curves.

Hash

Produces a fixed-length fingerprint of the data. It is not encryption: it cannot be reversed; used for storing passwords and checking integrity. Example: SHA-256.

HTTPS uses both together: asymmetric for agreeing on a key, symmetric for the actual data. A hash is no substitute for encryption; “encrypted” and “hashed” are different things.

Addressing · Step by step

How Encryption Works Together in HTTPS

BrowserServercertificate + public keyprivate key (secret)

1. The server sends the browser its certificate and public key. The private key stays secret on the server.

BrowserServersession key KK (encrypted with public key)private key (secret)

2. The browser generates a random session key (K), encrypts it with the server's public key and sends it (the asymmetric step). An eavesdropper can't decrypt K. This is the older “RSA key transport” model. In TLS 1.3 both sides derive a shared key with Diffie–Hellman; the certificate's public key only proves the server's identity (with a signature).

BrowserServerKKthe same secret key on both sides

3. The server decrypts K with its private key. Both sides now share the same secret key; asymmetric encryption has done its job.

BrowserServerdata: symmetrically encrypted with K(fast, both directions)KK

4. The actual data (page, form, password) flows both ways encrypted symmetrically with K: symmetric encryption is fast, and asymmetric is used only to deliver the key safely.

Web

The Internet and the Web

WebHTTP/HTTPSEmailSMTP, IMAPFile transferFTP, SFTPVideo callsRTPOnline gamesUDPInternet (infrastructure)cables, fiber, radio links, routers and the TCP/IP protocols
The Web is not the whole Internet. The Internet is the infrastructure; the Web is one of the services on top of it (linked pages and web applications).

Web

HTML and the Web Browser

  • HTML defines the structure of a page.
  • CSS controls its appearance.
  • JavaScript adds interaction and behavior.
  • The browser interprets these resources and displays them.
source (HTML)<h1>Hello</h1><p>My first web page.</p>Browserrendersornek.edu.trHelloMy first web page.

Web

The Journey of a Web Request

BrowserDNS resolverWeb serverURL typed

1. The user types https://www.ornek.edu.tr/announcements and presses Enter; the browser splits the URL into its parts.

BrowserDNS resolverWeb serverURL typedwww.ornek.edu.tr ?

2. The browser asks for the domain's IP address (DNS resolution).

BrowserDNS resolverWeb serverURL typedwww.ornek.edu.tr ?203.0.113.10

3. The answer arrives: the server is at 203.0.113.10.

BrowserDNS resolverWeb serverURL typedwww.ornek.edu.tr ?203.0.113.10TCP connection + TLS

4. The browser opens a TCP connection to the server; since this is HTTPS, the two sides agree on encryption keys with TLS.

BrowserDNS resolverWeb serverURL typedwww.ornek.edu.tr ?203.0.113.10TCP connection + TLSGET /announcements

5. The HTTP request goes over the encrypted channel: “give me /announcements”.

BrowserDNS resolverWeb serverURL typedwww.ornek.edu.tr ?203.0.113.10TCP connection + TLSGET /announcementspage is built

6. The server handles the request: it reads a file, or pulls the announcements from a database and generates HTML.

BrowserDNS resolverWeb serverURL typedwww.ornek.edu.tr ?203.0.113.10TCP connection + TLSGET /announcementspage is built200 OK + HTML

7. The response comes back: status code 200 OK (success) and the page's HTML. (404 if not found.)

BrowserDNS resolverWeb serverURL typedwww.ornek.edu.tr ?203.0.113.10TCP connection + TLSGET /announcementspage is built200 OK + HTMLGET style.css, logo.png…

8. While reading the HTML, the browser fetches the CSS, JavaScript and images it needs with separate requests.

BrowserDNS resolverWeb serverURL typedwww.ornek.edu.tr ?203.0.113.10TCP connection + TLSGET /announcementspage is built200 OK + HTMLGET style.css, logo.png…page is rendered

9. The browser combines the HTML structure, CSS styling and JavaScript behavior and draws the page on screen.

Web

How Does a Search Engine Work?

Ajava loop exampleBjava coffee typesCloop and arraycrawlindexarrayCloopA, CjavaA, BcoffeeBtypesBexampleAquery: java loopresult: page A
  • Web crawlers discover pages by following links.
  • The content is stored in a search index.
  • A query is answered by intersecting the pages that contain each word in the index (the Web itself is not searched).
  • Results are ranked by relevance, freshness, links and other signals.

The Web · Step by step

Search Engines: Crawl, Index, Rank

1. Crawl2. Index3. Rank4. Results

When you search, the Web is not visited at that moment; the answer comes from an index built in advance. Four stages: crawl, index, rank, results.

1. Crawl2. Index3. Rank4. ResultsWeb crawlerStart pagePage 2Page 3Page 4Page 5Page 6Page 7Page 8follow linkEvery link found is queued, and the page content is downloaded.

Crawl: the crawler follows links from seed pages to discover new pages and download their content. Only reachable, permitted pages are crawled, not the whole Web.

1. Crawl2. Index3. Rank4. Resultscrawled pagesinverted index (word → pages)Page 1: cat foodPage 2: cat carePage 3: dog foodPage 4: cat food pricecat → pages 1, 2, 4food → pages 1, 3, 4care → page 2dog → page 3price → page 4“cat food”: {1, 2, 4} ∩ {1, 3, 4} = {1, 4}; two candidate pages remain.

Index: the words on each page go into an inverted index (word → pages). At query time, pages aren't read one by one; the lists are consulted.

1. Crawl2. Index3. Rank4. ResultsQuery: cat foodCandidates in the intersection, sample scores1Page 1: cat food0.922Page 4: cat food price0.78Ranking signals• word match (relevance)• freshness• incoming links• load speed, mobile-friendliness

Rank: the candidates containing both words (the intersection: Page 1 and Page 4) are scored and ordered by relevance, freshness, incoming links and so on (the scores are just examples).

1. Crawl2. Index3. Rank4. Resultscat foodSearch1.How to choose cat foodcat-food.example2.Cat food prices comparedcat-food-prices.example

Results: the top-scoring pages are listed with title, address and snippet. The whole process usually takes a fraction of a second.

Web

Effective Searching

TechniqueExamplePurpose
Exact phrase"computational thinking"Search for the words together
Exclusionjava -coffeeRemove an unwanted meaning
Site restrictionsite:gov.tr scholarshipSearch within certain domains
File typefiletype:pdf network securityRestrict the document format

Web

Evaluating Sources and AI Output

QuestionWhat to look for
AuthorWho wrote it? An expert or an accountable organization?
DateWhen was it published or updated? Is it current for the topic?
SourceWhere did the information come from? Are citations and links given?
VerificationCan the data and claims be checked?
Cross-checkingDo other independent, reliable sources say the same?
AI output can be wrong too: fluent, confident text may contain false or made-up information (and sources). Check important facts against the criteria above.

Digital Services

Online Services

Government

e-Government, health, tax and education services.

Communication

Social networks, instant messaging and community platforms.

Media

Video, music and digital broadcasting.

Commerce

Stores, marketplaces and payment systems.

Cloud

File storage, collaboration and applications.

AI

Tools for text, images and decision support.

Digital Services

Cloud Service Models

LayerOn-premisesIaaSPaaSSaaS
ApplicationYouYouYouProvider
DataYouYouYouYou (content)
RuntimeYouYouProviderProvider
Operating systemYouYouProviderProvider
Server and network hardwareYouProviderProviderProvider
ExampleYour own server roomRenting virtual serversApp hosting platformEmail, online office
A CDN (content delivery network) keeps copies of the same content on servers around the world and serves each user from a nearby one, cutting latency.

Digital Services

E-Commerce

Buyer →Consumer (C)Business (B)Seller ↓Business(B)Consumer(C)B2ConlinestoreB2Bwholesaler →retailerC2Csecond-handlistingC2Bfreelancer→ company
B2C

Firms sell to consumers.

B2B

Trade between businesses.

C2C

Consumers sell to each other.

C2B

An individual offers goods or services to a business.

Check the seller, price, delivery, return policy and payment security before you buy.

Digital Services

Email Addresses

sercan.kulcu@giresun.edu.tr
User name

Identifies the mailbox.

The @ sign

Separates the user from the domain.

Domain

Shows the organization that runs the mail service.

Digital Services

Parts of an Email

New messageTo:ali@ornek.edu.trCc:ayse@ornek.edu.trBcc:mehmet@ornek.edu.trSubject:HW 1 submission(others don't see)Dear Professor,My homework is attached. Thanks.Attached: hw1.pdfSend
To

The main recipient.

Cc

People who receive the message for information.

Bcc

Recipients the others can't see.

Subject

A short, descriptive title for the message.

Attachment

A file sent with the message.

Reply / Forward

Answer the message or pass it on to someone else.

Digital Services

How Does an Email Get There?

Ali's mail clientsmtp.ornek.edu.trDNSmx.ornek.com.trMailboxAyşe's phoneali@ornek.edu.trayse@…

1. Ali writes a message to ayse@ornek.com.tr and clicks Send.

Ali's mail clientsmtp.ornek.edu.trDNSmx.ornek.com.trMailboxAyşe's phoneali@ornek.edu.trayse@…SMTP

2. The client sends the message over SMTP to his organization's outgoing mail server.

Ali's mail clientsmtp.ornek.edu.trDNSmx.ornek.com.trMailboxAyşe's phoneali@ornek.edu.trayse@…ornek.com.tr MX?

3. The server asks DNS for the mail server of the domain after the @ sign (the MX record).

Ali's mail clientsmtp.ornek.edu.trDNSmx.ornek.com.trMailboxAyşe's phoneali@ornek.edu.trayse@…mx.ornek.com.tr

4. DNS answers: mail for ornek.com.tr is accepted by mx.ornek.com.tr.

Ali's mail clientsmtp.ornek.edu.trDNSmx.ornek.com.trMailboxAyşe's phoneali@ornek.edu.trayse@…SMTP

5. The message is transferred over SMTP to the recipient's mail server.

Ali's mail clientsmtp.ornek.edu.trDNSmx.ornek.com.trMailboxAyşe's phoneali@ornek.edu.trayse@…filter

6. The receiving server runs the message through spam/virus filters and stores it in Ayşe's mailbox.

Ali's mail clientsmtp.ornek.edu.trDNSmx.ornek.com.trMailboxAyşe's phoneali@ornek.edu.trayse@…IMAP

7. Ayşe reads the message over IMAP. Since it stays on the server, it looks the same on her phone and computer.

Security

The Three Goals of Information Security (CIA)

InformationsecurityConfidentialityencryption, passwordsIntegrityhashes, digital signaturesAvailabilitybackups, redundant systems
Confidentiality

Only authorized people have access. Threat: a stolen password.

Integrity

Information is not changed without permission. Threat: an altered grade record.

Availability

Information is there when needed. Threats: ransomware, a server crash.

Security

Personal Data and Your Digital Footprint

YouActive footprint: shared on purposePassive footprint: left unknowinglyPosts, photosLocation historyComments, likesCookiesForms, sign-upsIP and search history
Personal data

Information about an identified or identifiable person.

Digital footprint

The records left by your online activity.

Privacy

Controlling who your information is shared with, for what purpose and for how long.

Before sharing something, ask whether it is necessary, who will see it and whether it can be deleted later.

Security

KVKK and e-Devlet Security

KVKK

Türkiye's Law No. 6698 on the Protection of Personal Data (KVKK) protects people's rights when their personal data is processed. Data controllers must state why data is processed and keep it secure.

e-Devlet

Türkiye's government services portal requires authentication. Choose a strong password, don't reuse it elsewhere, and turn on two-step verification. Never share your password.

For anything involving your credentials, type the address into the browser yourself instead of clicking links in emails and text messages.

Security

Malware

TypeCore behavior
VirusInfects files and spreads when a user acts.
WormCan spread on its own over a network.
Trojan horseLooks useful but hides a harmful function.
RansomwareMakes files inaccessible and demands payment.
SpywareSecretly monitors user activity.
Virus: needs a user actionWorm: spreads by itselfInfected fileOther filesuser opensor sharesPC 1PC 2PC 3over the network

Security

Social Engineering and Phishing

Urgent or tempting message
Fake link
Data entered
Account taken over
  • Check the sender's address and domain carefully.
  • Inspect the target address before opening a link.
  • Never share passwords, card details or verification codes in a message.
  • Verify a suspicious request through a separate channel.

Security · Step by step

The Phishing Attack Chain and How to Break It

Fake emailFake pagePassword enteredAccount takeoverFrom: support@account-verify.exampleSubject: Your account will be closed in 24 hours!Dear user, click to verify your password.Verify my accountGoal: urgency and fear make you click without thinking.

Fake email: the attacker sends an official-looking, urgent, threatening message. The sender's domain is not the organization's.

Fake emailFake pagePassword enteredAccount takeoverhttps://giresun-login.example/sessionNot the organization's domain: it should be giresun.edu.tr.UsernamePasswordLog in

Fake page: the link leads to a login page that closely imitates the real one. The domain is different; https and the padlock only show that the connection is encrypted, not that the site is trustworthy.

Fake emailFake pagePassword enteredAccount takeoverUsernamestudent123Password••••••••••Log insentAttacker's servercredentials recordedThe victim is then usually sent to the real site.

Password entered: the credentials the user types go straight to the attacker's server. The victim is often redirected to the real site and never notices.

Fake emailFake pagePassword enteredAccount takeoverAttacker in the accountReads email, steals dataChanges the password,locks the owner outTries the same password elsewhereSends new phishing to contacts

Account takeover: the attacker logs in, may change the password to lock the owner out, tries the same password on other accounts and sends new phishing to the contacts.

Fake emailFake pagePassword enteredAccount takeoverCheck the sender's domain;don't click,report itType the address;a password manager won'tfill in a fake siteBefore entering a password,verify via a separatechannelKeep multi-factor authon; change the password,report itEvery link is a breaking point:break the chain anywhere and the attack fails.When in doubt, go to the organization's known address, not the link.

Protection: every link in the chain is a chance to break it. Break one link and the attack fails; multi-factor authentication protects the account even if the password is stolen.

Security

A Phishing Email, Annotated

From:“Giresun Univ. IT Services” <support@support-info.example>Subject:URGENT: Your account will be closed in 24 hours!Dear user,Your mailbox is over quota. To keep your account open,verify your password now using the link below.Verify My AccountFile:Quota_Report.pdf.exe1

1. The sender: the display name looks official, but the domain is support-info.example; the real one should be giresun.edu.tr.

From:“Giresun Univ. IT Services” <support@support-info.example>Subject:URGENT: Your account will be closed in 24 hours!Dear user,Your mailbox is over quota. To keep your account open,verify your password now using the link below.Verify My AccountFile:Quota_Report.pdf.exe12

2. The subject uses urgency and threats: “closed in 24 hours”. The goal is a click without thinking.

From:“Giresun Univ. IT Services” <support@support-info.example>Subject:URGENT: Your account will be closed in 24 hours!Dear user,Your mailbox is over quota. To keep your account open,verify your password now using the link below.Verify My AccountFile:Quota_Report.pdf.exe123

3. A generic greeting (“Dear user”): your organization knows your name.

From:“Giresun Univ. IT Services” <support@support-info.example>Subject:URGENT: Your account will be closed in 24 hours!Dear user,Your mailbox is over quota. To keep your account open,verify your password now using the link below.Verify My AccountFile:Quota_Report.pdf.exe1234

4. A request to verify your password: real organizations never ask for it by email or through a link.

From:“Giresun Univ. IT Services” <support@support-info.example>Subject:URGENT: Your account will be closed in 24 hours!Dear user,Your mailbox is over quota. To keep your account open,verify your password now using the link below.Verify My Accounthttp://support-account-login.example/loginFile:Quota_Report.pdf.exe12345

5. Hovering over the button (without clicking) reveals that the real address points to a completely different domain.

From:“Giresun Univ. IT Services” <support@support-info.example>Subject:URGENT: Your account will be closed in 24 hours!Dear user,Your mailbox is over quota. To keep your account open,verify your password now using the link below.Verify My Accounthttp://support-account-login.example/loginFile:Quota_Report.pdf.exe123456

6. The attachment has a double extension: .pdf.exe is actually an executable program, not a document.

Security

Safe Habits

Updates

Keep the operating system and applications up to date.

Passwords

Use a long, unique password for every account.

Multi-factor authentication

Adds a second layer of verification even if the password is stolen.

Backups

Back up important files to a separate, reliable location.

Downloads

Get software only from trusted sources.

Connections

Be careful with sensitive tasks on shared networks.

Security

Password Strength: Why Length Matters

8 lowercase letters26^8 ≈ 2.1×10^11≈ 21 seconds8 chars (letters, digits, symbols)94^8 ≈ 6.1×10^15≈ 7 days16 lowercase (passphrase)26^16 ≈ 4.4×10^22≈ 1.4×10^5 yearstime: worst case for an attacker trying 10 billion guesses per second (log scale)
  • Each added character multiplies the possibilities; length beats adding symbols.
  • Passwords that are dictionary words, contain personal information or are reused elsewhere fall outside this calculation: they are easy to guess.
  • A password manager generates and stores a long, unique password for every account.

Security

Multi-Factor Authentication, Step by Step

UserPhoneServerpassword

1. The user enters a username and password (factor 1: something you know).

UserPhoneServercode: 482 913

2. If the password is correct, the server asks for a second proof: an authenticator app on the phone generates a code that changes every 30 seconds (factor 2: something you have).

UserPhoneServer482 913

3. The user enters the code; the server verifies it and logs the user in.

UserPhoneServerAttacker✗ rejectedstolen password

4. Even with a leaked password, the attacker usually fails without the phone. Real-time phishing and SIM swapping are still possible; the most resistant methods are FIDO2 passkeys and hardware keys.

Security

VPNs: What They Do and Don't Do

Your deviceencrypted tunnelVPN serverWebsiteCafé Wi-Fi and ISP: see only encrypted dataProvider: can see which site you visitsees the VPN's IP
What a VPN does

Builds an encrypted tunnel between your device and the VPN server. It makes local eavesdropping on public Wi-Fi harder, shows sites the VPN server's IP instead of yours, and gives secure remote access to a corporate network.

What a VPN doesn't do

It doesn't make you anonymous. The VPN provider can see which sites your traffic goes to, so you have to trust it. If you're logged in or have cookies, sites still recognize you. It doesn't block malware or phishing either.

“No logs” claims are the provider's own statements. A VPN requires choosing a trustworthy provider; it complements HTTPS rather than replacing it.

Security

Firewall Rules: An Example

A firewall allows or blocks incoming and outgoing connections according to rules; the rules are tried top to bottom and are usually based on IP and port.

#DirectionDest. portSourceAction
1In443 (HTTPS)AnyoneAllow (web server)
2In22 (SSH)Admin IP onlyAllow
3In23 (Telnet)AnyoneBlock (unencrypted legacy protocol)
4InEverything elseAnyoneBlock (default deny)
firewallServer443 and admin SSH openvisitor → :443rule 1: allowadmin IP → :22rule 2: allowother IP → :22✗ rule 4: blockother IP → :23✗ rule 3: block
Good practice: block everything by default and allow only the ports you need. A firewall limits what gets into the network; on its own it won't stop a malicious file the user downloads.

Security

Backups: The 3-2-1 Rule

ComputerCopy 1 (original data)External driveCopy 2 (2nd medium)Cloud or another buildingCopy 3 (offsite)3 copies · 2 different media · 1 copy offsite
3 copies

The original data and at least two backups.

2 media

Different kinds of storage, e.g. SSD and external drive, so they don't fail together.

1 offsite

In a different location (cloud or another building) to survive fire, theft or ransomware.

A backup is only useful if it can be restored: test it now and then. A drive left permanently connected can be hit by ransomware.

Summary

Chapter Summary

  • The Internet is a global infrastructure of networks connected by common protocols.
  • An IP address identifies a device, a domain name gives it a human-readable name, and a URL identifies a specific resource.
  • The Web is one of the services that run on the Internet.
  • Search techniques speed up finding information; evaluating sources improves accuracy.
  • Updates, unique passwords, multi-factor authentication and backups are the basic security measures.

Summary

Review Questions

  1. What is the difference between the Internet and the Web?
  2. Without DNS, how would we reach a website?
  3. How do the jobs of a router and a switch differ?
  4. Show the protocol, domain name and path of a URL.
  5. What signs help you spot a phishing message?
  6. Which three measures would you combine for strong account security?

Summary

Exercises

  1. At best, how many seconds does a 1.5 GB file take to download on a 200 Mbit/s line?
  2. Split https://obs.ornek.edu.tr/grades?term=2#midterm into protocol, domain name, path, query and fragment.
  3. Write the last octet of 192.168.10.37 as an 8-bit binary number.
  4. List the DNS steps for a domain name that is not cached.
  5. Your IP is 192.168.1.5, so why does a website see a different IP?
  6. What three things would you check to tell whether a “parcel could not be delivered” text message is phishing?
Answers
  1. 1.5 GB = 1500 MB = 12,000 Mbit; 12,000 ÷ 200 = 60 s.
  2. https · obs.ornek.edu.tr · /grades · ?term=2 · #midterm
  3. 37 = 32 + 4 + 1 → 00100101.
  4. Cache → resolver → root → .tr → authoritative server → IP (cached).
  5. The router uses NAT to replace the local address with its own public IP.
  6. The link's domain, pressure to act fast or pay, and requests for card or personal details.

Summary

References

  • Internet Society, A Brief History of the Internet.
  • IETF, Internet Standards and RFC documents.
  • W3C, Web Standards.
  • NIST, Cybersecurity and Privacy guidance.

The End

Chapter 1.4: The Internet
Previous: Chapter 1.3: Computers · Next: Chapter 1.5: Computation and Computational Thinking
1 / 1Sercan KÜLCÜ. All rights reserved.