Listing Vault CS331 · computer networks · list-question drills

Every list CS331 can ask you to write.

Pure listing points, stripped from the ten chapter slide decks — no prose, no worked examples. Pick a chapter tab, or search to sweep all ten at once. Numbered lists are the ones that come with a fixed count worth memorising.

10chapters
lists
total points
01

Data Communications and Networking

Forouzan ch. 1 · part 1

Components of data communication 5 items

  1. Message — the information being communicated
  2. Sender — the device sending the message
  3. Receiver — the device receiving the message
  4. Transmission medium — the physical path the message travels
  5. Protocol — the set of rules both sides agree on

Forms a message can take 5 items

  1. Text — bit patterns using Unicode
  2. Numbers — represented directly in binary
  3. Images — represented as bit patterns (pixels)
  4. Audio — recording or broadcasting of sound/music
  5. Video — a series of images displayed in rapid succession

Network criteria 3 items

The three things every network must meet.

  1. Performance — evaluated by throughput and delay
  2. Reliability — frequency of failure and recovery time from a failure
  3. Security — protecting data from unauthorised access and damage, plus policies for recovering from breaches and data loss

Performance depends on

  • Number of users
  • Type of transmission medium
  • Capabilities of the network hardware
  • Efficiency of the network software

Performance is measured by

  • Throughput — amount of data a user can send
  • Delay — transit time and response time
  • Good performance = more throughput, less delay (the two contradict each other)

Reliability is measured by

  • Frequency of failure
  • Time it takes a link to recover from failure

Types of network connection 2 items

  1. Point-to-point — dedicated link between two devices
  2. Multipoint — shared link between more than two devices

Data-flow (transmission) modes 3 items

  1. Simplex — one direction only (keyboard, monitor, TV, radio)
  2. Half duplex — both directions, one at a time (walkie-talkie)
  3. Full duplex — both directions at the same time (telephone)

Categories of topology 4 items

Topology = the way a network is physically built / how devices interconnect.

  1. Mesh
  2. Star
  3. Bus
  4. Ring

A hybrid topology mixes them — e.g. star-bus, or a star backbone with three bus networks.

Topology comparison links · pros · cons

Topology Links Advantages Disadvantages
Mesh
dedicated link to every other node
N(N−1)/2
NICs/ports = N−1 per device
Dedicated links → secure, no congestion; robust (one link failing does not stop the network); easy to find faulty links Difficult to install and update (too much wiring); expensive
Star
dedicated link to a central controller
N Less expensive than mesh; easy to install; easy to add/remove devices; robust; easy to find faulty links; secure but less than mesh If the central device fails, the whole network stops
Bus 1 main + N droplines Easy to install; less cabling than mesh and star Difficult to isolate faults; difficult to add new devices; a break in the bus cable stops all transmission
Ring
point-to-point link to the two neighbours
N Easy to install; less cable; easy to add or remove a device; fault isolation is easy Not robust

Categories of network by size 3 items

  1. LAN — Local Area Network
  2. MAN — Metropolitan Area Network (e.g. STC)
  3. WAN — Wide Area Network, provides long-distance transmission of data

An internetwork is made of LANs joined by WANs; a heterogeneous network mixes WANs and LANs through routers.

Requirements to be "on the Internet" 3 items

The Internet = a collection of networks running the TCP/IP protocol suite.

  1. Run the TCP/IP protocol
  2. Have an Internet address
  3. Be able to send IP packets to other machines on the Internet

ISP tiers 3 items

  1. Tier-1 — International / backbone: international coverage, few of them, own their links and routers, connected directly to other tier-1 ISPs (Sprint, AT&T, LUMEN)
  2. Tier-2 — Provider networks (national/regional): gateways to the international Internet, connected to at least one tier-1 ISP (STC, ITC, Mobily)
  3. Tier-3 — Local ISPs: take services from national providers

Methods of ISP interconnection (peering) 2 items

  1. Private peering points (direct connection) — a group of routers connecting one ISP to others; owned and operated by the ISPs, not a third party
  2. Internet Exchange Points (IXP) — public peering — physical infrastructure managed by a third party, letting any ISP connect to any other; complex high-speed switching networks exchanging huge amounts of traffic

Current trend: international ISPs connect at private peering points; national ISPs interconnect using IXPs.

Advantages of standards 3 items

  1. Ensure a large market for equipment and software
  2. Provide guidelines to manufacturers, vendors and government agencies
  3. Allow products from different vendors to communicate

Standards organisations 5 items

  1. ISO — International Organization for Standardization
  2. ITU-T — International Telecommunication Union (a UN agency)
  3. ANSI — American National Standards Institute
  4. IEEE — Institute of Electrical and Electronic Engineers (LAN/MAN standards)
  5. W3C — World Wide Web Consortium
02

Protocol Layering and Network Models

Forouzan ch. 1 · part 2

Advantages of a layered architecture 3 items

  1. Breaks the complicated communication process into layers of simpler processes, allowing easier hardware or software implementation
  2. Each layer implements a distinct set of protocols, so each layer can be implemented independently of the others — different manufacturers can supply different layers, which encourages collaboration and competition
  3. Well-defined interfaces let you replace one layer's implementation entirely without affecting the other layers

The two standard protocol models 2 items

  1. OSI — Open System Interconnect, developed by ISO in the 1970s, dominated before 1990
  2. TCP/IP — Transmission Control Protocol / Internet Protocol, developed in the 1970s

The protocols of the various layers together are called the protocol stack.

The seven OSI layers 7 items

Mnemonic (top → bottom): All People Seem To Need Data Processing.

# Layer PDU Responsibility
7 Application Message User interface and network services that let user applications access the network
6 Presentation Message Translation, encryption/decryption, compression
5 Session Message Setting up, managing and terminating sessions; dialog control; synchronisation checkpoints
4 Transport Segment Process-to-process delivery of the entire message; port addressing
3 Network Packet / Datagram Source-to-destination (host-to-host) delivery of individual packets; logical (IP) addressing and routing
2 Data link Frame Hop-to-hop (node-to-node) delivery; framing; physical addressing
1 Physical Bits Movement of individual bits from one hop to the next

How OSI layers are implemented 3 items

  1. Software — Application, Presentation, Session, Transport
  2. Mixed hardware and software — Network
  3. Hardware (in the NIC) — Data link and Physical

Physical layer duties 5 items

  1. Physical characteristics of interfaces and media — topology, shape/size/pin count of connectors, voltages and currents, type of transmission medium, transmission (duplex) mode
  2. Representation of bits — encoding into electrical or optical signals
  3. Data rate — transmission rate / bandwidth, bits sent per second
  4. Synchronisation of bits — sender and receiver clocks must be synchronised
  5. Devices at this level — network card, hub, repeater

Data link layer duties 2 core items

  1. Framing — dividing the stream of bits into units called frames
  2. Physical addressing — sender and receiver physical addresses (also called local / hardware / NIC / LAN address)

Transfers frames across direct connections — node-to-node (hop-to-hop) delivery.

Network layer duties 2 items

  1. Logical addressing — a unique global address distinguishing each host on the Internet (the IP address)
  2. Routing — connecting devices (routers) route or switch packets to their final destination

If two systems are on the same link, in theory there is no need for a network layer.

Session layer duties 3 items

  1. Session management — setting up, managing and terminating sessions, keeping each application's data separate from another's
  2. Dialog control — full or half duplex: processes send and receive at the same time, or at different times
  3. Synchronisation checkpoints — let long transmissions continue from where they were after a crash

Presentation layer duties 3 items

  1. Translation — lets devices with different data representations communicate; sender format → common format → receiver format (EBCDIC vs ASCII)
  2. Encryption / decryption
  3. Compression — fewer bits, important for multimedia applications

Application layer services 4 items

  1. Web access — a browser using HTTP to reach the WWW
  2. Telnet — remote host access
  3. File transfer, access and management
  4. Mail services

The five TCP/IP layers 5 items

  1. Application — message
  2. Transport — segment
  3. Network — packet
  4. Data link — frame
  5. Physical — bits

The four lower layers match OSI's four lower layers; OSI's top three (application, presentation, session) are represented in TCP/IP by the single application layer. The original TCP/IP model had 4 layers.

Key layering vocabulary 4 items

  1. PDU — Protocol Data Unit: the payload from the next higher layer plus the current layer's control information
  2. Peers — entities on two or more machines communicating at the same layer
  3. Control information — carried in header fields (data link has both a header and a trailer); read and executed only by the peer layer at the receiver
  4. Encapsulation — layer N−1 carries the PDU of layer N in its data part, with no knowledge of its content
03

Data Link Layer Control

Forouzan ch. 3 · part 1

Data link layer services 5 items

  1. Framing / deframing — encapsulate the datagram into a frame by adding a header and trailer; deframe at the receiver
  2. Addressing — layer-2 addresses; in a LAN, the physical or MAC address used in frame headers to identify source and destination
  3. Error control — error detection and correction to provide reliable delivery
  4. Flow control — the sender must not send frames faster than the receiver can process them
  5. Access control — controlling access to a shared medium (the MAC sublayer)

Types of framing protocol 2 items

  1. Character-oriented — frame length is a multiple of bytes (multiple of 8)
  2. Bit-oriented — frame length is not a multiple of bytes

Both add an 8-bit flag at the start and end of the frame, usually 01111110.

Byte stuffing (character-oriented)

  • Sender adds one extra ESC byte whenever a flag character appears in the data
  • If ESC itself appears in the data, it is also preceded by ESC
  • Receiver removes each ESC and treats the next character as data, not as a flag

Bit stuffing (bit-oriented)

  • Sender stuffs one extra 0 after every 5 consecutive 1s in the data
  • Receiver seeing five 1s checks the next bit: if 0 it is discarded (unstuffed); if 1 it flags the end of the data

Types of error 2 items

  1. Single-bit error — only 1 bit in the data unit has changed
  2. Burst error — 2 or more bits in the data unit have changed

Burst error facts

  • Does not necessarily mean the errors are in consecutive bits
  • Burst length = number of bits from the first corrupted bit to the last corrupted bit
  • The effect of a burst error is higher at high data rates
  • Bits affected = bandwidth × burst duration

Error detection methods 4 items

To detect or correct errors we must send extra (redundant) bits with the data.

  1. Simple parity check — one parity bit added so the total number of 1s is even (or odd for odd parity)
  2. Two-dimensional parity check — bits arranged in rows and columns with a redundant row added to the whole block
  3. Cyclic Redundancy Check (CRC) — modulo-2 binary division by a generator polynomial held by both sender and receiver
  4. Checksum — one's complement addition of 16-bit words

What simple parity can detect 2 items

  1. All single-bit errors
  2. Burst errors only if the total number of changed bits in each data unit is odd

C(n,k) = a codeword of n bits for every k-bit dataword.

Two-dimensional parity — steps 4 items

  1. Data blocks are organised into a table
  2. Last column holds the check bits for the rows
  3. Last row holds the check bits for the columns
  4. It can detect and correct a single-bit error

Detects one, two and three errors — but not all four-bit error patterns.

What cyclic (CRC) codes detect well 4 items

  1. Single-bit errors
  2. Double errors
  3. An odd number of errors
  4. Burst errors

They are also easy to implement in hardware and software, and especially fast in hardware — which makes them a good candidate for many networks. The divisor is called the generator polynomial (e.g. x³+x+1 → key 1011).

Checksum — sender site 5 steps

  1. The message is divided into 16-bit words
  2. The value of the checksum word is set to 0
  3. All words including the checksum are added using one's complement addition
  4. The sum is complemented and becomes the checksum
  5. The checksum is sent with the data

Checksum — receiver site 4 steps

  1. The message (including the checksum) is divided into 16-bit words
  2. All words are added using one's complement addition
  3. The sum is complemented and becomes the new checksum
  4. If the value of the checksum is 0 the message is accepted; otherwise it is rejected

Error correction methods 3 items

  1. Retransmission
  2. Forward Error Correction (FEC) — detect and correct a limited number of errors without retransmission
  3. Burst error correction using chunk interleaving

Why retransmission is a poor fit 2 items

  1. Wireless applications — the bit error rate on a wireless link can be very high, causing a large number of retransmissions
  2. Real-time multimedia — retransmissions create unacceptable delay; the application has to wait until the corrupted packet is resent

FEC techniques 3 items

  1. Two-dimensional parity
  2. XOR property — XOR all codewords to create block R, transmit the codewords with R, then recover any corrupted block by XOR-ing all the other blocks with R
  3. Chunk interleaving — allow small chunks to be missing at the receiver; one missing chunk per packet is acceptable in multimedia, all chunks of the same packet missing is not
04

Data Link Layer — MAC Protocols

Forouzan ch. 3 · part 2

The two data link sublayers 2 items

  1. LLC (Logical Link Control) — responsible for error and flow control
  2. MAC (Medium Access Control) — responsible for framing, MAC addressing and multiple access control

Categories of multiple-access protocol 3 items

  1. Random access — CSMA family (wired LAN)
  2. Controlled access — reservation, polling, token passing
  3. Channelization — FDMA, TDMA, CDMA

The problem: on a broadcast (shared) link, when two or more nodes transmit at the same time their frames collide and the link bandwidth is wasted.

The three CSMA persistence methods 3 items

They differ in what a station does when the medium is idle and when it is busy.

  1. Non-persistent — if idle, transmit; if busy, back off a random amount of time and sense again
  2. 1-persistent — if idle, transmit immediately; if busy, keep listening until idle then transmit immediately with probability 1
  3. p-persistent — time is slotted (one slot ≈ max propagation delay); if idle, transmit with probability p or wait one slot with probability 1−p; if busy, listen until idle and repeat

Non-persistent — performance

  • Stations are "deferential" (respect others)
  • Random delays reduce the probability of collision
  • Bandwidth is wasted if the backoff is large — the medium stays idle even when stations have frames

1-persistent — performance

  • Stations are "selfish"
  • If two or more stations become ready at the same time, a collision is guaranteed
  • Avoids idle channel time

p-persistent — performance

  • Reduces the possibility of collisions, like non-persistent
  • Reduces channel idle time, like 1-persistent

CSMA/CD — what a station does on collision 4 steps

  1. Abort the transmission
  2. Transmit a jam signal (48 bits) so other stations discard the frame and so the collision signal lasts until the furthest station detects it
  3. Back off for a random amount of time
  4. Reapply the CSMA persistence algorithm being used

Widely used in a star topology with a hub — IEEE 802.3, Ethernet. While transmitting, the sender listens for collisions and stops early, reducing channel waste.

Performance of random access 6 items

  1. Simple and easy to implement
  2. Decentralised — no central device that can fail and bring down the whole system
  3. In low traffic, packet transfer has low delay
  4. In heavier traffic, packet delay has no limit
  5. A station may never get a chance to transfer its packet — it is an unfair protocol
  6. A single active node can transmit at the full channel rate R, but with M nodes the maximum average throughput per node will not reach R/M because of collisions

Controlled access methods 3 items

  1. Reservation
  2. Polling
  3. Token passing

Controlled access gives in-order access to the shared medium so every station gets a chance — a fair protocol. It eliminates collisions completely and limits each node to a throughput of R/M.

Reservation access — how it works 5 points

  1. Stations take turns transmitting a single frame at the full rate R
  2. Transmissions are organised into variable-length cycles
  3. Each cycle begins with a reservation frame of N minislots — one per station
  4. A station needing to send makes a reservation in its own minislot
  5. By listening to the reservation interval every station knows who will transmit and in what order; reserved stations then send their data frames

Polling — the two models 2 items

  1. Centralized polling — one device is the primary station, the rest are secondary; all exchanges go through the primary. It sends a select frame with the address of the intended secondary when it has data, and a poll frame to ask each device whether it has data (answered with data, or NAK). Polling can be round-robin or in a predetermined order.
  2. Distributed polling — no primary/secondary; stations follow a known polling order list, and the station with the highest priority takes the access right first then passes it to the next station. Reservation and token passing are examples.

Token passing — the procedure 4 steps

  1. A special frame called the token rotates in the ring
  2. A station that wants to send waits for a free token to arrive
  3. It makes the token busy by inserting its data and the destination address
  4. The destination station receives the data and changes the token back to free

Token passing implements a distributed polling system.

Channelization protocols 3 items

Channelization shares the available bandwidth of a link in time, frequency, or through code.

Protocol Shares by Key points
FDMA
Frequency Division
Frequency Medium divided into M separate frequency bands; each station transmits continuously on its band at an average rate of R/M; a node is limited to R/M even when it is the only one sending
TDMA
Time Division
Time Whole bandwidth is a single channel shared in time between M stations; a node must wait for its slot even when it is the only one sending; limited to R/M
CDMA
Code Division
Code One channel carries all transmissions simultaneously; each station codes its signal with a specific code, and receivers use those codes to recover the desired station's data
05

Ethernet and LANs

Forouzan ch. 4

Ethernet in one definition 3 points

  1. A LAN data link layer protocol used in bus and star topologies
  2. Implements CSMA/CD as its medium access method
  3. Original (traditional) Ethernet developed in 1980 by Digital, Intel and Xerox (DIX); in 1985 the IEEE Computer Society started Project 802 so equipment from different manufacturers could intercommunicate

IEEE 802.3 — the two sublayers 2 items

  1. MAC (bottom, IEEE 802.3) — handles part of framing, MAC addressing and medium access control; specific to each LAN protocol (CSMA/CD for Ethernet, token passing for Token Ring)
  2. LLC (top, IEEE 802.2) — handles the other part of framing, provides error and flow control if needed, and makes the MAC sublayer transparent so different LAN data link layers can interconnect

Ethernet frame fields 7 fields

Field Size Purpose
Preamble 8 bytes Pattern 10101010 used to synchronise receiver and sender clock rates; in IEEE 802.3 the eighth byte is the start-of-frame delimiter 10101011
Addresses 6 bytes each Destination and source MAC addresses
Type (DIX) 2 bytes Type of network-layer protocol in the payload — IP (0800), Novell IPX (8137), AppleTalk (809B), ARP (0806). Allows multiplexing several network-layer protocols on one machine. Values start at 0600h (1536 decimal)
Length (802.3) 2 bytes Number of bytes in the data field, maximum 1500 (05DCh)
Data 46–1500 bytes Data encapsulated from the upper-layer protocols
Pad as needed Zeros added so the minimum data length reaches 46 bytes
CRC 4 bytes CRC-32, checked at the receiver; the frame is discarded if an error is detected

Frame length: minimum 64 bytes (512 bits), maximum 1518 bytes (12,144 bits).

Ethernet address facts 4 items

  1. Six bytes = 48 bits
  2. Flat address, not hierarchical
  3. Burned into the NIC ROM
  4. The first three bytes from the left identify the vendor (Cisco 00-00-0C, Juniper 00-05-85); the last 24 bits are created uniquely by the company

Types of destination MAC address 3 items

  1. Unicast — second hex digit from the left is even (one recipient)
  2. Multicast — second hex digit from the left is odd (a group of stations, e.g. conferencing)
  3. Broadcast — all ones, FF:FF:FF:FF:FF:FF (all stations)

The least significant bit of the first byte defines the type: 0 = unicast, 1 = multicast. Broadcast is a special case of multicast where all bits are 1. The source address is always unicast.

Ethernet standards / generations 3 items

Standard Topology Rate Media
Fast Ethernet — 100 Base T / 100 Base F Star 100 Mbps Twisted pair or fiber optic
Gigabit Ethernet — 1000 Base T / 1000 Base F Star 1000 Mbps Twisted pair or fiber optic
10 Gigabit Ethernet — 10 gigabit F Star 10000 Mbps Fiber optic only

Changes needed for full-duplex operation 4 items

  1. Attached stations must have full-duplex NIC cards
  2. Must use two pairs of wire — one for host→switch (inbound), one for switch→host (outbound)
  3. Must use a switch as the central device, not a hub
  4. Devices must be connected point-to-point (dedicated) to the switch

Traditional Ethernet is half duplex because of CSMA/CD. With full duplex, each station is its own collision domain, CSMA/CD is no longer needed, and throughput doubles — 100 Mbps becomes 200 Mbps, 1 Gbps becomes 2 Gbps.

06

Interconnecting Devices and VLANs

Forouzan ch. 6

The three categories of connecting device 3 items

  1. Hub — physical layer
  2. Link-layer switch — data link layer
  3. Router — network layer

Hub characteristics 6 items

  1. A physical layer device that operates on bits, not frames
  2. Connects station adapters in a physical star but logical bus topology
  3. Receives a bit from one adapter and sends it to all the others, with no access method
  4. Does no filtering — it cannot check the destination link-layer address to pick an outgoing port
  5. The entire hub forms a single collision domain and a single broadcast domain
  6. Multiple hubs can extend the network length; in a star the maximum host-to-central-device length is 100 m, so the maximum between two nodes is 200 m

Two domain definitions 2 items

  1. Collision domain — the part of the network (set of devices) where a collision happens if two or more nodes transmit at the same time
  2. Broadcast domain — the part of the network where each device can receive the other devices' broadcast messages

Interconnecting with hubs 1 pro · 1 con

  1. Advantage — extends the maximum distance between nodes
  2. Disadvantage — individual segment collision domains merge into one large collision domain, reducing performance

Switch learning process 2 cases

The switch compares the source address of each received frame with the forwarding table.

  1. No match — add the frame's source address and the interface it arrived on to the table
  2. Match — update the interface number if it differs from the one stored, and update the record time

A switch table entry holds: the host's MAC address, the switch interface it is connected to, and the record creation time. The table starts empty and fills automatically.

Switch forwarding process 3 cases

The switch compares the destination address with the MAC table.

  1. Match, different interface — forward the frame through the interface stored in the table
  2. Match, same interface — discard (drop) the frame
  3. No match — flood the frame on all interfaces except the one it arrived on

A multicast or broadcast frame is sent to all ports.

Switch features 9 items

  1. Implements CSMA/CD when the medium is shared
  2. Isolates collision domains — each LAN segment is a separate collision domain, which reduces collisions and raises total maximum throughput
  3. Forwards a broadcast frame to all devices on the whole network — it is a single broadcast domain
  4. Increases performance and security by isolating traffic — the frame goes only to the port of the receiving device
  5. Increases geographical coverage — no limit on the size of LANs connected through switches
  6. Transparent — installing or removing a switch does not require reconfiguring the stations' networking software
  7. Plug-and-play — no configuration needed at installation or when a host is removed
  8. Can operate in full-duplex mode
  9. Performs MAC address recognition and frame forwarding in hardware (a bridge does it in software)

The two switch forwarding types 2 items

  1. Store-and-forward — receives the whole frame, buffers it briefly, performs error checking, then routes it to the right output line; buffering causes some delay
  2. Cut-through — since the destination address appears at the start of the frame, it sends the frame straight to the output line as soon as the address is recognised (if the output buffer is empty) — no buffering delay, but no error checking

The loop problem and broadcast storms 5 points

  1. Redundant switches and links are used for reliability, so two hosts can be connected by multiple paths — that is a loop
  2. A switch floods broadcast frames, multicast frames, and unknown unicast frames out of every port except the one they arrived on
  3. With a loop, every switch keeps re-flooding the same frame
  4. The frame is replicated continuously — a broadcast storm that consumes all network resources and stops the network
  5. Spanning Tree Protocol is used to eliminate the loops

Spanning tree — key points 5 items

  1. For any connected graph there is a spanning tree that maintains connectivity but contains no closed loops
  2. Loops are logically disabled by the spanning tree algorithm
  3. Some ports are blocked to eliminate loops
  4. Blocked ports do not forward data frames, but do forward the special spanning-tree frames
  5. A blocked port becomes a forwarding port if a network change makes the protocol run again

Router characteristics 9 items

  1. Operates at the network layer — deals with packets, not frames
  2. Connects LANs and WANs with similar or different protocols
  3. Each router interface has a physical and an IP address
  4. Isolates both collision domains and broadcast domains
  5. Each router interface is connected to a separate broadcast domain
  6. Acts like a normal station but has more than one logical (IP) address
  7. Forwards packets based on the destination IP address
  8. Communicates with other routers and exchanges routing information; determines the best route using a routing algorithm
  9. Forwards traffic if the destination is known, otherwise discards it (unlike a switch)

Switch vs router 7 rows

Router Switch
Layer 3 device, deals with packets Layer 2 device, deals with frames
Each interface has an IP address and a MAC address Each interface has a MAC address
Isolates broadcast and collision domains Isolates collision domains only, not broadcast domains
Drops the packet if the destination is not in the routing table Floods the frame in all directions if the destination MAC is not in the MAC table
Forwards based on the routing table Forwards based on the MAC address table
Needs configuration Plug-and-play device
Does not do cut-through Supports cut-through forwarding

What a VLAN is 4 points

  1. Creating LAN subnets (broadcast domains) by software instead of physical wiring
  2. Allows grouping computers logically instead of physically
  3. Divides one physical LAN into several logical LANs
  4. The switch maintains a lookup table recording which VLAN each machine belongs to

VLANs create broadcast domains — each VLAN is a separate broadcast domain, i.e. a separate network.

Advantages of VLANs 3 items

  1. Reduce cost and installation time — a station is moved to another segment or switch by software instead of physically
  2. Increase security — a high-security group can be isolated in its own VLAN so no outside user can communicate with them, and their broadcasts are not received by other VLANs
  3. Create virtual workgroups — stations in physically different locations can join the same broadcast domain, e.g. people from different departments on the same project
07

Network Layer — Data Transfer

Forouzan ch. 7

Network layer duties 3 items

  1. Packetizing — encapsulating the payload in a network-layer packet at the source and decapsulating it at the destination, carrying it without changing or using it
  2. Routing — finding the best path by running routing protocols to fill the routing table
  3. Forwarding — the action a router takes when a packet arrives at one of its interfaces: deciding which other interface to send it out of

The two packet-switching approaches 2 items

  1. Virtual circuit (connection-oriented) — a setup phase reserves buffer, bandwidth and delay parameters in every switch along the path; packets carry a flow label (virtual circuit identifier) and all follow the same path. Called "virtual" because switches, buffers and lines are shared by packets from multiple connections.
  2. Datagram (connectionless) — each packet is treated independently with no relationship to any other; packets may or may not travel the same path. This is what the Internet uses.

Connectionless service properties 5 items

  1. No handshaking — each packet is sent and routed independently and can follow a different path
  2. The full source and destination address must be attached to every packet
  3. No setup delay
  4. Packets are not guaranteed to arrive in the order they were sent
  5. Robust — if a router crashes only the packets inside it are lost, others take another path

IPv4 address facts 5 items

  1. A 32-bit address, written as 4 octets (bytes)
  2. Address space = 2³² = 4,294,967,296
  3. Unique — each connection has a different address
  4. Universal — must be accepted by any host wanting to connect to the Internet
  5. Managed by ICANN, which assigns addresses to regional authorities (who assign to ISPs) and also assigns and manages DNS

Classful addressing 5 classes

Class Starts with Range Blocks Addresses per block
A 0 0–127 (valid 1–126) 126 valid blocks — all allocated 2²⁴ = 16,777,216 − 2
B 10 128–191 2¹⁴ = 16,384 — all allocated 2¹⁶ = 65,536 − 2
C 110 192–223 2²¹ = 2,097,152 — nearly all allocated 256 − 2
D 1110 224–239 Multicast addresses — no network/host hierarchy
E 1111 240–255 Reserved

Two addresses are always subtracted: the all-zeros host (network address) and the all-ones host (broadcast address). 0.0.0.0 is the default route and the 127 block is reserved for loopback. Default masks: A = /8 (255.0.0.0), B = /16 (255.255.0.0), C = /24 (255.255.255.0).

Private address ranges 3 items

Range Total
10.0.0.0 – 10.255.255.255 2²⁴
172.16.0.0 – 172.31.255.255 2²⁰
192.168.0.0 – 192.168.255.255 2¹⁶

The three address types in a network 3 items

  1. Network address — host bits all 0s (192.168.10.0/24)
  2. Host addresses — first is all 0s and a 1, last is all 1s and a 0 (192.168.10.1 to 192.168.10.254)
  3. Directed broadcast address — host bits all 1s (192.168.10.255)

The two IPv4 broadcast types 2 items

  1. Limited broadcast255.255.255.255, received by all nodes in the same network as the source; routers do not forward it (routers isolate broadcast domains)
  2. Directed broadcast — net ID plus all ones in the host portion, aimed at all nodes of a specific other network; it is forwarded by routers and converted to a limited broadcast by the receiving router. Usually blocked, as it can be used for denial-of-service attacks.

Why the network address is needed 2 cases

  1. A device sending a packet — the network layer needs the destination's network address to see whether the destination is on the same network. If yes, it hands the packet to the data link layer; if no, it asks the data link layer to send it to the default gateway.
  2. A router forwarding a packet — the routing table is arranged mostly by network addresses, so the router derives the destination's network address to look it up and find the next hop.

Subnetting — key points 6 items

  1. Dividing the network into smaller groups (subnets), each with its own subnet IP address
  2. The site looks like a single network to the rest of the Internet — outside routers use only the main network address
  3. Local routers route within the subnetted network using the subnet address
  4. The host portion is split into a subnet number (most significant part) and a host number (least significant part)
  5. The IP address now has 3 levels: main network, subnet, host
  6. The subnet mask is 32 bits of ones and zeros; ANDed with the IP address it gives the subnetwork address

A valid subnet mask must be longer than the class default mask and shorter than /30.

Subnetting steps 5 steps

Given the desired number of subnets and the original classful network address.

  1. Subtract 1 from the number of needed subnets
  2. Convert the result to binary
  3. Count the number of bits obtained
  4. Add that count to the default mask of the original network to get the subnet mask
  5. Write out the subnets: take 2position of the first non-zero bit in the mask (from the rightmost octet) as the weight; the first subnet is the original network address, then keep adding the weight until the result exceeds 255

Subnet counting formulas 2 formulas

  1. Number of subnets = 2(subnet mask length − classful mask length)
  2. Hosts per subnet = 2(32 − subnet mask length) − 2

Two is subtracted because the first address in the block is the network address and the last is the broadcast — neither can be assigned to a host.

IP configurations every host needs 4 items

  1. IP address from the correct subnet
  2. Subnet mask
  3. Default gateway IP address (a router interface on the same subnet as the end devices)
  4. Domain name server IP address

These can be assigned in two ways: manual configuration by the administrator, or DHCP.

DHCP — key points 5 items

  1. An application layer protocol that dynamically provides an IP address, subnet mask, gateway router IP and DNS server IP to a host or diskless computer
  2. Keeps two databases: static IP addresses, and a dynamic pool of unused temporary addresses
  3. The static database maps physical (MAC) addresses to permanent IP addresses — used for diskless workstations
  4. On a request the server checks the static database first; if there is no match it picks a temporary address from the dynamic pool
  5. Leasing — the address is assigned for a specific period so addresses are not wasted; when it expires the host must return it or renew the lease

ARP 3 points

  1. A network layer protocol that translates between an Internet IP address and a MAC sublayer (layer-2) address
  2. Needed because the IP address of the next node is not enough to move a frame through a link — the link-layer address is
  3. An ARP request is broadcast; an ARP reply is unicast

IPv4 datagram header fields 7 to know

  1. Header length — minimum 20 bytes without options
  2. Total length — header + data, maximum 65,535 bytes
  3. Identification, flags and offset — used for fragmentation and reassembly at the destination
  4. Time to Live (TTL) — prevents lost packets circulating between routers forever; set by the OS, decremented by one at each router, and the packet is dropped when it hits zero
  5. Protocol — a code for what is carried in the data field, so the destination network layer can deliver it to the right protocol (TCP, UDP, or a routing protocol)
  6. Header checksum — checks for errors in the header only; recomputed at each router because fields such as TTL change; the packet is dropped if an error is found
  7. Source and destination addresses — 32 bits each

A packet can be fragmented at any node between source and destination, but reassembly happens only at the destination.

Fragmentation flags 4 rules

  1. M = 1 — the packet is not the last fragment
  2. M = 0 — the packet is the last fragment
  3. D = 1 — do not fragment this packet
  4. If a packet with D = 1 arrives at a router and is larger than the link MTU, the router drops it

MTU = maximum transfer unit, the limit each link-layer format puts on the data that can be encapsulated in a frame. The network-layer packet must be smaller than it.

Advantages of NAT 4 items

  1. No need to be allocated a range of global addresses from the ISP — one global IP serves all devices, saving IP addresses
  2. You can change the addresses of devices in the local network without notifying the outside world
  3. You can change ISP without changing the addresses of local devices
  4. Can be used as a firewall — an external computer cannot connect to yours unless yours initiated the contact, because Internet routers do not recognise or forward packets with private destination IP addresses

NAT — how it works 5 points

  1. NAT maps between private (local) and public (global) IP addresses, letting a site use private addresses internally and at least one global address for the outside world
  2. The company connects to the ISP through a NAT-enabled router holding a unique IP given by the ISP
  3. The router keeps a translation table of 65,536 entries; each row has: private source address, source port number, destination address, and a unique NAT port number
  4. Every machine inside has a unique private address, usually from 10.x.y.z
  5. NAT will not allow more than one host to contact the same destination
08

Network Layer — Routing

Forouzan ch. 8

What a routing protocol is responsible for 2 items

  1. Routing — filling and updating routing tables by finding the shortest (best) path from each source to each destination
  2. Forwarding — deciding which output interface an incoming packet should be transmitted on, by referring to the routing table

Who needs a forwarding table 3 points

  1. The source host does not — it delivers its packet to the default router in its local network
  2. The destination host does not — it receives the packet from its default router
  3. Only the routers gluing the networks together need forwarding tables

Cost metrics for a link 6 items

An internet is modelled as a weighted graph — routers are nodes, networks between routers are edges, and each edge carries a cost. The good path is the one with minimum total cost.

  1. Number of networks (hops or routers)
  2. Geographic distance
  3. Link delay
  4. Capacity (speed)
  5. Reliability
  6. A combination of the above

Routing algorithm classifications 2 items

  1. Static — routes change slowly; shortest paths are precomputed offline and entered manually by the administrator; cannot update automatically on a change or failure; used in small networks
  2. Dynamic (adaptive) — each router learns the state of the network by communicating with its neighbours and fills its own routing table from what it collects; adds complexity to the router

Ways to reduce routing table entries 3 items

  1. Network-specific routing — the destination network IP address is listed in the table
  2. Host-specific routing — the destination host IP address is listed in the table
  3. Default routing0.0.0.0/0, used when the destination network is not found in the table; it corresponds to "any other"

Classful forwarding — what a router does 4 steps

  1. Apply all the available masks to the destination IP address
  2. If a match is found in the destination address column, forward to the next-hop IP through the corresponding interface
  3. If no match is found, send the packet through the default interface
  4. Otherwise a "host unreachable" error message is sent back to the sender

The two shortest-path algorithms 2 items

  1. Distance Vector — Bellman-Ford algorithm
  2. Link State — Dijkstra's algorithm

The shortest path is the path whose sum of link costs is minimum over all possible paths between source and destination.

Distance Vector routing 6 points

  1. Each node keeps a distance vector table of the distances from itself to all possible destination nodes in the domain
  2. Distances use a chosen metric — usually hop count, bandwidth or delay
  3. A router sends its distance vector table to each of its neighbours, periodically or when something changes
  4. A router recalculates its vector when it receives a different vector from a neighbour, or when it discovers a link to a neighbour has gone down or up
  5. Calculation minimises the cost to each destination; the routing table is derived directly from the distance vector
  6. Examples: RIP and EIGRP

Link State routing 6 points

  1. Each router measures the cost (delay, bandwidth) between itself and its directly connected neighbours
  2. The router builds a packet (LSP) containing all these costs
  3. These packets are distributed by flooding to all other routers in the routing area
  4. Information is sent only when there is a change in a link, to reduce traffic
  5. Each router builds a map (LSDB) of the entire network and runs a shortest-path algorithm (usually Dijkstra) to compute the routing table — every router ends up with the same database
  6. Example: OSPF (Open Shortest Path First)

Distance vector vs link state 4 rows

Distance vector Link state
Sends routing information to its neighbours Sends routing information to all routers in the area
Sends an estimate of the path cost to all known destinations in the area Sends the exact cost of the links connecting the router to its neighbours
Sent periodically (every 30 s) on the router's own timer Sent only when there is a change
Reacts to link failure very slowly Reacts to network failure quickly

Autonomous systems 5 points

  1. An AS is a single network or a group of networks controlled by a common network administrator
  2. Each AS is assigned a globally unique Autonomous System Number (ASN)
  3. AS systems are connected by special routers called border routers or gateway routers
  4. Routers inside the same AS run the same routing protocol — intra-AS (interior) routing
  5. Routing between autonomous systems is inter-AS (exterior) routing; border routers run both protocols

Popular routing protocols 2 groups

  1. Interior routing — RIP, OSPF, EIGRP: between routers inside a single AS
  2. Exterior routing — BGP (Border Gateway Protocol): between routers connecting several ASs
09

Transport Layer

Forouzan ch. 9

Transport layer duties 7 items

  1. Process-to-process communication
  2. Addressing — port numbers to identify which network application
  3. Encapsulation and decapsulation
  4. Multiplexing and demultiplexing
  5. Connection control — connection-oriented and connectionless services
  6. Reliability — flow control and error control
  7. Congestion control

Port number ranges 3 facts

  1. Port numbers are 16-bit integers, 0 – 65535, unique to the host
  2. Well-known (0–1023) — assigned and controlled by IANA
  3. Well-known ports are only given to the destination (server) process; the source (client) process uses an ephemeral port

Ports to memorise

  • 20, 21 — FTP data / FTP
  • 23 — TELNET
  • 25 — SMTP
  • 53 — DNS
  • 67 — DHCP
  • 69 — TFTP
  • 80 — HTTP
  • 123 — NTP
  • 161, 162 — SNMP

The four entities in a client/server exchange 4 items

  1. Local host IP
  2. Local process port number
  3. Remote host IP
  4. Remote process port number

A socket is the interface between the application layer and the transport layer within a host; a socket address is an IP plus a port number. Different connections can use the same destination port on the server as long as the source ports or source IPs differ.

Multiplexing vs demultiplexing 2 items

  1. Multiplexing (many to one) — the transport layer at the source accepts messages from more than one application-layer process
  2. Demultiplexing (one to many) — the transport layer at the destination delivers segments to more than one application-layer process

Connectionless vs connection-oriented 2 services

Connectionless (UDP)

  • Independence between segments
  • No flow and error control
  • No congestion control

Connection-oriented (TCP)

  • Dependency between segments
  • Data transferred only after the connection is established
  • Logical connection — segments are delivered in the order they were sent even if they travel different physical paths
  • Both sides must initialise and get approval before any transfer
  • Flow and error control are applied
  • Congestion control is applied
  • The connection is terminated after the exchange

Error control guarantees 4 items

Error control ensures the entire message arrives at the receiving transport layer:

  1. Without error
  2. Without loss
  3. Without duplication
  4. In the same order it was sent

Flow control makes sure the sender process does not overflow the receiver's buffer. Congestion happens when the load on the network exceeds the network's capacity; congestion control keeps the load below capacity.

TCP properties 4 items

  1. Connection-oriented — with establishment and termination
  2. Reliable
  3. Each segment gets a unique sequence number needed for error control; performs error, flow and congestion control
  4. Header is 20 bytes by default, extendable to 60 bytes with options

TCP sequence numbers 4 rules

  1. Sequence numbers are given to individual bytes
  2. Each side announces a random initial sequence number when the connection is established
  3. The first segment's sequence number is the initial sequence number
  4. Any other segment's sequence number = previous segment's sequence number + bytes carried by the previous segment

Used in flow control, error control, and segmenting / reassembling.

Three-way handshake 3 steps

  1. SYN — the client sends the initial segment with the SYN flag set to 1, carrying a randomly selected initial sequence number
  2. SYN + ACK — the server responds with both SYN and ACK set to 1. It acknowledges the client's SYN, carries the server's own initial sequence number, and defines the server receive window — how many bytes the client may send before waiting for an acknowledgment
  3. ACK — the client acknowledges the server's segment and carries the client receive window — how many bytes the server may send before waiting for an acknowledgment

Connection termination 4 steps

  1. The first host sends a segment with the FIN bit set
  2. The second host replies with the ACK bit set
  3. The second host can continue sending data; the first can only acknowledge, not send
  4. When the second host wants to close, it sends a FIN and the first host replies with an ACK

Reliable delivery rules 3 items

  1. Every segment must be acknowledged; the acknowledgment number is the number of the last received byte + 1
  2. Acknowledgments are cumulative — an ACK of X means all bytes up to X−1 were received and the receiver is ready for byte X
  3. The sender starts a timer when it sends a segment and retransmits if the timer expires before an acknowledgment arrives

TCP flow control — sliding windows 6 items

  1. Windows prevent a receiver from being overwhelmed by incoming data
  2. The window size specifies the maximum data the sender can forward without an acknowledgment
  3. Window size is included in every TCP segment, starting with the three-way handshake
  4. TCP implements flow control by increasing and decreasing window sizes as required
  5. TCP is full duplex — both client and server specify their own window sizes, and each side has a send window and a receive window
  6. Window sizes are variable during the lifetime of a connection; initial sizes are set at connection establishment and either side can change them later

One side's send window equals the other side's receive window.

Applications that need TCP 4 items

  1. WWW using HTTP
  2. Electronic mail using SMTP
  3. Telnet
  4. File transfer using FTP

UDP properties 6 items

  1. Connectionless — no handshaking, each segment handled independently
  2. A UDP server application serves only one request at a time; other requests wait in a queue
  3. Unreliable — no flow or error control; a segment can be lost, arrive out of order, duplicated, or corrupted
  4. The checksum field is optional and covers the entire UDP segment; UDP does nothing to recover from an error, it just discards the segment and the application takes full responsibility
  5. Uses port numbers to multiplex / demultiplex data from and to the application layer
  6. Advantages: simple, minimum overhead, no connection delay

Services provided by UDP: process-to-process delivery, and error checking (detection only).

Applications that use UDP 6 items

Used where a small amount of packet loss is tolerable.

  1. Multimedia applications
  2. Internet telephony
  3. Real-time video conferencing
  4. Domain Name System messages
  5. Audio
  6. Some routing protocols

When UDP is / is not suitable 3 cases

  1. Suitable — one request, one response: DNS sends a short request and gets a quick response, each fitting in a single user datagram, so connectionless ordering is not an issue
  2. Not suitable — long messages: SMTP email with multimedia must be split by the application into many datagrams, which may arrive out of order and the receiver may not be able to reorder them; the same applies to downloading a large file, where reliability matters and delay does not
  3. Suitable — real-time interactive: with Skype-style audio/video, resending a corrupted frame would break synchronisation; instead UDP lets the receiver ignore the lost packet and deliver the rest, so a small part of the screen blanks for a moment
10

DNS and the Application Layer

Forouzan ch. 10

What DNS is 3 points

  1. The Internet directory service
  2. A client-server application that maps host names to their corresponding IP addresses
  3. That mapping is called name resolution (also name translation, name mapping, or address resolution)

Why: IP addresses are hard to remember, but the network only understands numeric addresses — so we use alphanumeric names plus a distributed, hierarchical protocol to map between them.

Hierarchical name space rules 5 items

  1. Each name is made of several parts, each part called a label
  2. Names are defined on a tree structure with the root at the top
  3. Each node has a label
  4. Children of the same node must have different labels, which guarantees uniqueness
  5. This decentralises name assignment: IANA assigns the part defining the nature of the organisation (com, net, SA, CA) and its name, and the rest is managed by the local organisation

The root name is a dot (.). A domain name is a sequence of labels separated by dots, read from the node up to the root.

Generic domain labels 14 items

Label Description Label Description
aero Airlines and aerospace int International organizations
biz Businesses or firms mil Military groups
com Commercial organizations museum Museum
coop Cooperative organizations name Personal names (individuals)
edu Educational institutions net Network support centers
gov Government institutions org Nonprofit organizations
info Information service providers pro Professional organizations

Domain — definition points 4 items

  1. A subtree of the domain name space
  2. A group of hosts under the administrative control of a single entity, such as a company or government agency
  3. Each domain is subdivided into subdomains; the leaves represent domains with no subdomains
  4. The domain name is the domain name of the node at the top of the subtree

The Internet is divided into more than 200 top-level domains. A leaf domain may contain a single host or represent a company with thousands.

FQDN vs PQDN 2 items

  1. FQDN — Fully Qualified Domain Name; only an FQDN can be translated into its IP address
  2. PQDN — Partially Qualified Domain Name; used for a name belonging to the same site, with the remaining suffix completed by the DNS client program (the resolver)

Why name space storage is not centralised 3 items

  1. Heavy traffic from requests all over the world
  2. A failure makes the data unavailable
  3. Hard to maintain

Instead DNS is a distributed database system using a large number of name servers, organised hierarchically and distributed worldwide, so no single host holds all the mappings.

Server and caching facts 4 items

  1. A primary server loads all its information from a disk file
  2. A secondary server loads all its information from the primary server; that download is called a zone transfer
  3. A root server holds references for the top-level domains — there are 13 distributed all over the world
  4. Caching — a server stores answers for names outside its domain so later searches are faster and more efficient

The two resolution techniques 2 items

  1. Recursive resolution — the local name server passes the query up the chain and each server it asks keeps chasing the answer; the answer then travels back down the same chain to the local server and finally to the host
  2. Iterative resolution — each server that cannot answer replies with the IP of the next server to ask; the local name server queries each one directly until it gets the mapping, then answers the host

DNS is a client-server application: the client part is the resolver, the server part is the name server. DNS can use UDP or TCP on well-known port 53.

Recursive resolution — the 8 steps 8 steps

Example: lab.CS.PSU.EDU.SA resolving sales.mcgraw.com.

  1. The host contacts its local name server DNS.PSU.EDU.SA
  2. Having no answer in cache or database, the local server contacts a root name server
  3. The root server contacts the name server for the .com domain (DNS.com)
  4. DNS.com contacts DNS.mcgraw.com, which holds the IP for sales.mcgraw.com
  5. DNS.mcgraw.com returns the answer to DNS.com
  6. DNS.com returns the answer to the root name server
  7. The root name server returns the answer to DNS.PSU.EDU.SA
  8. DNS.PSU.EDU.SA returns the answer to the host

Iterative resolution — the 8 steps 8 steps

  1. The host contacts its local name server DNS.PSU.EDU.SA
  2. The local server contacts a root name server
  3. The root server replies with the IP of the .com name server (DNS.com)
  4. The local server contacts DNS.com
  5. DNS.com replies with the IP of DNS.mcgraw.com
  6. The local server contacts DNS.mcgraw.com
  7. DNS.mcgraw.com, the local server for that domain, replies with the IP of sales.mcgraw.com
  8. The local server replies to the host with the IP of sales.mcgraw.com

The difference in one line: in recursive resolution the contacted server chases the answer for you; in iterative resolution it hands you the address of the next server and your local server does the chasing.