UNIHIVE

Study Hub UNIPORT CSC 498

CSC 498 · Computer Network and Data Communications

Protocols and layered models

What a protocol is, the OSI seven-layer model, the TCP/IP model, encapsulation, and flow control with stop-and-wait and sliding windows.

Our notes

2 min read

Protocols

A protocol is a set of rules for communication: syntax (format of messages), semantics (meaning of each field and what to do), timing (when and how fast). Standards come from ISO, ITU-T, IEEE (802 LANs) and IETF (Internet RFCs).

Why layers

A big problem is split into layers, each giving services to the layer above and using the one below. Layers can change separately (Wi-Fi replaces Ethernet without changing your browser).

The OSI reference model (ISO, 1984)

LayerJobExamples
7 Applicationservices for usersHTTP, SMTP, FTP, DNS
6 Presentationformat, encryption, compressionTLS encryption, JPEG, character codes
5 Sessiondialogue control, checkpointssession set-up in RPC
4 Transportend-to-end delivery, reliability, portsTCP, UDP
3 Networkaddressing and routing between networksIP, ICMP, routers
2 Data linkframes on one link, MAC addresses, error detectionEthernet, Wi-Fi MAC, PPP, switches
1 Physicalbits as signals on the mediumcables, connectors, voltages, modulation

Memory aid (top down): "All People Seem To Need Data Processing".

The TCP/IP model (the Internet's)

TCP/IP layerOSI layersProtocols
Application5-7HTTP/HTTPS, DNS, SMTP, IMAP, SSH, DHCP
Transport4TCP (reliable, ordered, connection-oriented: web, email); UDP (fast, no guarantees: video calls, DNS, games)
Internet3IP (IPv4, IPv6), ICMP (ping), routing protocols
Link (network access)1-2Ethernet, Wi-Fi, 4G/5G

Encapsulation

Each layer adds its own header to the data from above: application data → TCP segment → IP packet → Ethernet frame → bits. The receiver strips the headers layer by layer. A web request carries a TCP header (ports, sequence numbers), an IP header (addresses) and an Ethernet header (MAC addresses).

TCP in outline

  • Three-way handshake: SYN → SYN-ACK → ACK.
  • Sequence numbers and acknowledgements; retransmission after a timeout.
  • Flow control (receiver window) and congestion control (slow start, back off when packets are lost).
  • Ports identify the application: 80 HTTP, 443 HTTPS, 53 DNS, 25 SMTP, 22 SSH.

Flow control: stop-and-wait

The sender sends one frame and waits for its acknowledgement. Simple, but the line sits idle while waiting.
Link utilisation U = 1/(1 + 2a), where a = propagation time ÷ transmission time.
Worked example. 1,000-bit frames on a 1 Mbps link (transmission 1 ms) with 10 ms propagation: a = 10; U = 1/21 = 4.8%. On a short LAN (a ≈ 0.01) U ≈ 98%.

Sliding window

The sender may have up to W frames unacknowledged. U = 1 if W ≥ 1 + 2a, otherwise W/(1 + 2a).
Worked example. For the link above, W = 21 frames keeps the line fully busy. Sequence numbers must count at least as high as the window (with 3-bit numbers, W ≤ 7 for go-back-N).

  • Go-back-N: on an error, resend that frame and all after it. Selective repeat: resend only the bad frame (needs buffering at the receiver).

Exams usually ask: define protocol and its elements; why layering; the OSI layers with functions and examples; compare OSI and TCP/IP; encapsulation; TCP versus UDP; stop-and-wait utilisation; sliding window size.

Common mistake: putting routers at the data link layer or switches at the network layer. Ordinary switches work with MAC addresses (layer 2); routers forward by IP address (layer 3).

Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.

Read

Watch

We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.

All CSC 498 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.