1/103
Looks like no tags are added yet.
Three fundamental network principles
Packet switching - stack of layers - encapsulation
Cryptography (as a defence)
Protects data by making it unreadable to anyone without the keys
Software controls - examples
Password managers - VM sandboxes - virus scanners - Git - firewalls - Tor - VPNs
Hardware controls - examples
YubiKey-style hardware tokens - hardware firewalls - intrusion detection systems
Why use a hardware key (YubiKey)?
A stolen password is useless without the physical key plugged in
Physical controls - examples
Security guards - locks - off-site backups - not placing critical systems in disaster zones (floods/tornadoes)
Policies and procedures
Non-technical controls on how people behave around systems - includes legal requirements such as GDPR
Weakest link in most secure systems
Human beings - hence policies and procedures
Packet switching
Data is split into packets - each is transported independently and forwarded on its own
Best effort delivery
Each device tries to deliver a packet but gives NO guarantee - it may be dropped
Can packets from one message take different routes?
Yes - same endpoints but different paths (e.g. A-B-F vs A-C-D-E-F)
Why is the network a connected mesh?
Resilience - alternative paths exist if a node fails
What happens when a packet is dropped?
The destination notices it is missing and the sender resends it - cheap but should not be overdone
Why can packets get corrupted?
Physics - bit flips (e.g. cosmic rays) and noise on wires - error correction helps but is not perfect
Ethernet cable range
About 100 m - beyond that you need a repeater
The five layers (top to bottom)
Application - Transport - Network - Link - Physical
Application layer
Application logic (browser or game) - knows its own messages but nothing about lower-level networking
Transport layer protocols
TCP and UDP
Network layer protocol
IP
Link layer protocol
Ethernet
Physical layer
The actual wires or wireless signals - the only layer that is real hardware
Which layers are software?
All layers above the physical layer - they are abstractions
Layering principle
Each layer provides a service the layer above relies on without knowing HOW it is done - only the interface matters
Virtual vs actual channel
Actual channel exists only at the physical layer - higher layers have virtual (logical) channels between peers
Which layers does a router need?
Only up to the network layer (IP) - it only cares where the packet is going
Journey of a packet
Down the stack at the source - up and down at each router - up to the application at the destination
Simplified Internet stack
HTTPS (application) - TLS (security) - TCP (reliability) - IP (internet routing) - ARP (LAN routing) - physical
Role of TLS
Security layer sitting beneath HTTPS
Role of TCP
Reliability
Role of ARP
LAN routing - maps an IP address to a MAC address
Benefit of layering
Each layer is built by someone else and reused - developers only handle their own layer
Encapsulation
A packet p of protocol P is placed inside (as the payload of) a packet q of protocol Q
What does a packet consist of?
Control information (header and footer) plus data (payload)
Why add headers?
They tell the lower layers what to do with the packet (e.g. packet 1 of 3 and length)
Headers going down vs up the stack
Added going down at the sender - stripped away going up at the receiver
Internet packet encapsulation order
Application data inside TCP inside IP inside link frame (frame header + IP hdr + TCP hdr + data + frame footer)
Letter-in-envelopes analogy
Each handler reads only its own outer label - inner packets stay hidden in the payload
Why do packets grow going down the stack?
Each layer adds its own header (and footer at the link layer)
Link layer data unit
Frame
Fragmentation - which layers?
Can happen at ANY layer if the data is too big for the next layer down
Network interface
Device connecting a computer to a network (Ethernet card - WiFi adapter - DSL modem)
Can a computer have several network interfaces?
Yes - and packets can be transmitted between them inside the computer
How do most LANs (Ethernet and WiFi) deliver frames?
They broadcast them
MAC address
48-bit hardware address of a network interface - usually written in hex (e.g. 00-1A-92-D4-BF-86)
MAC address structure
First 3 octets = OUI assigned by IEEE to the manufacturer - last 3 chosen by the organisation (must be unique)
OUI
Organizationally Unique Identifier - the first 3 octets of a MAC - identifies the manufacturer
Why do we need addresses?
To reach anything not physically on your wire you must know where to send it
Hub
Dumb device - repeats every frame on ALL ports
Switch
Link layer device in a LAN - learns MAC addresses and forwards frames only to the destination
How does a switch work?
Learns the MAC of each connected computer - builds a table - sends frames only down the right port
Hub vs switch traffic
Hub multiplies traffic across all ports - switch saves traffic by sending to one port
Switch layer vs router layer
Switch = link layer (MAC addresses) - router = network layer (IP addresses)
What is the Internet?
A network of networks joined by routers
Protocol
An agreed set of messages and rules for how to respond - everyone must follow the same standard to understand each other
IP (Internet Protocol)
The standard everyone on the internet speaks - decides how packets get from one place to another
Four functions of IP
Addressing - routing - fragmentation and reassembly - data encapsulation and packaging
IP addressing function
Gives each destination a unique address so data can be delivered
IP routing function
Lets packets cross networks and reach networks not directly connected
IP fragmentation and reassembly
Splits packets to fit each network's maximum packet length - reassembled at the destination
IPv4 address size
32-bit addresses (2^32 possible)
IPv6 address size
128-bit addresses (2^128 possible)
Effect of adding one bit to an address
Doubles the number of addresses
Why must IP addresses be unique?
Otherwise you cannot tell which machine a packet is meant for
IP address subdivision
Network - subnet - host (e.g. 128.148.32.110)
Broadcast address
Ends in 255 (e.g. 128.148.32.255) - delivers to every host on the network - used later in attacks
Private IP ranges
10.0.0.0/8 - 172.16.0.0/12 - 192.168.0.0/16 - never routed on the public internet
Why can private ranges be reused by everyone?
They never leave the local network so uniqueness is only needed inside each LAN
Typical home WiFi address
192.168.x.x - a private LAN address
IP header fields
Version - length - fragmentation info - TTL - protocol - source address - destination address
Max IP packet length
Up to 64KB
TTL (time to live)
Counter decremented at every hop - packet dropped at 0 - stops packets looping forever (max 255)
Most important IP header fields
Source and destination address
IP protocol field
States which transport protocol is inside (e.g. TCP)
Why must some headers be plain text?
Network devices need to read them to route the packet - crypto cannot work with strangers who share no keys
Can the payload be encrypted?
Yes - but at least some headers must stay in plain text
Router
Network layer device that bridges two or more networks and forwards using a routing table
What does a router base forwarding on?
Solely the DESTINATION address - not the source
Routing table
Maps ranges of addresses to LANs or other gateway routers
Default route
0.0.0.0/0 - used when no other rule matches - forwards to the gateway router
Gateway
Router that connects a LAN to the rest of the internet
ICMP
Internet Control Message Protocol - network layer - simple messages in single IP packets - for testing and debugging
Ping
Sends ICMP echo requests - reports roundtrip times and packet loss - shows if a host is alive
Traceroute
Sends ICMP packets with increasing TTL to discover the route to a host
How traceroute works
TTL=1 dies at router 1 which replies time exceeded - then TTL=2 and so on - until the destination sends an echo response
Attacker use of ping and traceroute
Reconnaissance - find live machines and map the paths to them
Why is scanning every IP feasible?
Only 2^32 IPv4 addresses - even fewer in private ranges
Security insight from traceroute
Reveals the path so an adversary knows which machines to compromise or influence to intercept or block traffic
Traceroute to facebook.com showed
Hosting provider in Germany then Hetzner then tfbnw.net (Facebook-owned) then Facebook's server
Real-world cable case study
Physical cables are a weak point - cutting submarine cables (about 60 worldwide) can knock regions offline
Network attack - DoS
Blocks traffic from reaching the destination - attacks availability
Network attack - wiretapping (passive)
Attacker copies traffic without affecting the flow - attacks confidentiality
Network attack - tampering (active)
Attacker changes bits or messages in transit - attacks integrity
Network attack - spoofing (creation)
Attacker creates messages that appear to come from a legitimate source - attacks authenticity
Passive vs active attacker
Passive only observes - active modifies blocks or injects traffic
Redirecting traffic via attacker's server
Attacker may learn more than from sniffing alone because they can process data before forwarding
Wireshark
Packet sniffer and protocol analyzer - captures and displays packets - free from wireshark.org
Why does Wireshark need admin or root?
It needs control of the network card - and the program carries security risks
Promiscuous mode
Captures all traffic on the network - not just traffic addressed to your machine
Wireshark decoders
Parse raw ones and zeros into protocols like TCP and IP
Wireshark filters
Show only packets for a given host or protocol - regex-like