Show 25 50 100
PDF
4 result(s) in Computer Network with 5+ ★ Clear

Index

Showing 4 topics
  1. OSI Model
  2. TCP vs UDP
  3. IP Address and Subnetting
  4. HTTP and HTTPS
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
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

3 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.
4 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.