Show 25 50 100
PDF
11 result(s) in Computer Network Clear

Index

Showing 11 topics
  1. OSI Model
  2. TCP/IP Model
  3. TCP vs UDP
  4. Common Ports and Protocols
  5. IP Address and Subnetting
  6. DNS
  7. HTTP and HTTPS
  8. Network Devices
  9. Network Topologies and Types
  10. ARP, DHCP and ICMP
  11. Network Security Basics
1 Index

The OSI (Open Systems Interconnection) model splits network communication into 7 layers. Each layer serves the layer above it. Mnemonic (top → bottom): All People Seem To Need Data Processing.

OSI layers, example protocols, PDU names and the matching TCP/IP layers

OSI layers, example protocols, PDU names and the matching TCP/IP layers

LayerJobDevice
ApplicationNetwork services to the user (web, mail)Gateway
PresentationTranslation, encryption, compression—
SessionOpen, manage and close sessions—
TransportEnd-to-end delivery, ports, segmentation, flow and error controlFirewall
NetworkLogical addressing (IP) and routingRouter
Data LinkPhysical addressing (MAC), framing, error detectionSwitch, Bridge
PhysicalTransmit raw bits over the mediumHub, Repeater, Cable

Q & A

  1. What is encapsulation?
    Each layer adds its own header while data goes down (data → segment → packet → frame → bits). The receiver removes them going up (decapsulation).
2 Index
TCP/IP layerOSI layersProtocols
ApplicationApplication + Presentation + SessionHTTP, HTTPS, FTP, SMTP, DNS, SSH
TransportTransportTCP, UDP
InternetNetworkIP, ICMP, ARP
Network Access (Link)Data Link + PhysicalEthernet, Wi-Fi

OSI is a theoretical reference model; TCP/IP is the practical model the internet uses.

3 Index
TCPUDP
Connection-oriented (handshake first)Connectionless
Reliable: acknowledgement, retransmissionUnreliable: no guarantee of delivery
Data arrives in orderNo ordering
Flow and congestion controlNone
Slower, 20-byte headerFaster, 8-byte header
Web (HTTP), email, file transfer, SSHVideo streaming, gaming, VoIP, DNS

SYN → SYN-ACK → ACK

SYN → SYN-ACK → ACK

4 Index
ProtocolPortUse
HTTP80Web pages
HTTPS443Secure web (TLS)
FTP20, 21File transfer
SSH22Secure remote login
Telnet23Remote login (plain text)
SMTP25 / 587Send email
POP3110Download email
IMAP143Read email on server
DNS53Domain name → IP
DHCP67, 68Automatic IP address
MySQL3306Database
RDP3389Remote desktop
5 Index

An IPv4 address is 32 bits written as four octets (192.168.1.10). IPv6 is 128 bits written in hex (2001:db8::1).

ClassFirst octetDefault maskPrivate range
A1 – 126255.0.0.0 (/8)10.0.0.0 – 10.255.255.255
B128 – 191255.255.0.0 (/16)172.16.0.0 – 172.31.255.255
C192 – 223255.255.255.0 (/24)192.168.0.0 – 192.168.255.255
D224 – 239—Multicast
E240 – 255—Experimental

127.0.0.1 is the loopback (localhost) address.

Subnetting

Subnetting example: 192.168.1.0/26

  • Mask /26 = 255.255.255.192 → host bits = 32 − 26 = 6
  • Addresses per subnet = 26 = 64, usable hosts = 64 − 2 = 62 (network and broadcast are reserved)
  • Number of subnets from a /24 = 22 = 4 → .0, .64, .128, .192
  • First subnet: network 192.168.1.0, hosts .1 – .62, broadcast 192.168.1.63

Q & A

  1. What is CIDR?
    Classless Inter-Domain Routing: writes the mask as /prefix length (for example /26), so networks are not limited to classes A, B and C.
  2. What is NAT?
    Network Address Translation lets many devices with private IPs share one public IP through the router.
6 Index

DNS (Domain Name System) converts a domain name into an IP address, like the phone book of the internet. It mainly uses UDP port 53.

Recursive resolver asks root → TLD → authoritative server

Recursive resolver asks root → TLD → authoritative server

RecordMeaning
ADomain → IPv4 address
AAAADomain → IPv6 address
CNAMEAlias of another domain
MXMail server
NSName server of the domain
TXTText (SPF, verification)
7 Index

HTTP is a stateless request/response protocol for the web. HTTPS = HTTP over TLS: data is encrypted, the server is verified by a certificate, and it uses port 443.

MethodUse
GETRead data
POSTCreate / submit data
PUTReplace a resource
PATCHUpdate part of a resource
DELETERemove a resource

HTTP status codes

CodeMeaning
1xxInformational
200 OKSuccess
201 CreatedResource created
301 / 302Moved permanently / temporarily (redirect)
304Not modified (use cache)
400Bad request
401Unauthorised (login needed)
403Forbidden
404Not found
500Internal server error
502 / 503Bad gateway / service unavailable

Q & A

  1. What happens when you type a URL and press Enter?
    DNS lookup gives the IP → TCP handshake (and TLS handshake for HTTPS) → browser sends an HTTP request → server sends the response → browser parses HTML, loads CSS/JS/images and renders the page.
  2. Why is HTTP stateless and how do sites remember you?
    Each request is independent. Sites use cookies, sessions or tokens (JWT) to keep state.
8 Index
DeviceLayerWorks withWhat it does
HubPhysical (1)BitsSends data to every port (one collision domain)
RepeaterPhysical (1)BitsRegenerates the signal to extend distance
SwitchData Link (2)MAC addressSends the frame only to the correct port
BridgeData Link (2)MAC addressConnects two LAN segments
RouterNetwork (3)IP addressConnects different networks, chooses the best path
GatewayAll layersProtocolsConnects networks using different protocols
ModemPhysicalSignalsConverts digital ↔ analog
9 Index

Bus, star, ring, mesh and tree

Bus, star, ring, mesh and tree

TopologyAdvantageDisadvantage
BusCheap, easyBackbone cable fails → whole network fails
StarEasy to manage, one cable failure affects one deviceCentral switch is a single point of failure
RingOrderly data flowOne break can stop the ring
MeshVery reliable (many paths)Expensive, many cables

Network types by size: PAN (Bluetooth) < LAN (office) < MAN (city) < WAN (country / internet).

10 Index
  • ARP (Address Resolution Protocol) — finds the MAC address for a known IP address inside the LAN (broadcast "who has 192.168.1.5?").
  • DHCP — gives a device an IP address, mask, gateway and DNS automatically. Steps: DORA — Discover, Offer, Request, Acknowledge.
  • ICMP — error and diagnostic messages; used by ping and traceroute.
Useful commands Bash / Shell 5 lines
ping google.com          # is the host reachable? (ICMP echo)
tracert google.com       # path of routers (Windows; traceroute on Linux)
ipconfig /all            # IP, MAC, gateway, DNS (Windows; ip a on Linux)
nslookup example.com     # DNS lookup
arp -a                   # ARP cache
11 Index
  • Firewall — allows or blocks traffic by rules (IP, port, protocol).
  • Symmetric encryption (AES) — one shared key, fast. Asymmetric (RSA) — public/private key pair, used to exchange keys and for digital signatures.
  • Hashing (SHA-256) — one-way fingerprint for integrity and password storage.
  • VPN — encrypted tunnel over a public network.
  • Common attacks: DoS/DDoS, man-in-the-middle, phishing, SQL injection, XSS.