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
Listing questions almost always want the count first. If a card's
badge says 5 items, an answer with four bullets loses a mark
even when all four are right.
No list matches that search.
01
Data Communications and Networking
Forouzan ch. 1 · part 1
Components of data communication
5 items
Message — the information being communicated
Sender — the device sending the message
Receiver — the device receiving the message
Transmission medium — the physical path the message
travels
Protocol — the set of rules both sides agree on
Forms a message can take 5 items
Text — bit patterns using Unicode
Numbers — represented directly in binary
Images — represented as bit patterns (pixels)
Audio — recording or broadcasting of sound/music
Video — a series of images displayed in rapid succession
Network criteria 3 items
The three things every network must meet.
Performance — evaluated by throughput and delay
Reliability — frequency of failure and recovery time from
a failure
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
Point-to-point — dedicated link between two devices
Multipoint — shared link between more than two devices
Data-flow (transmission) modes
3 items
Simplex — one direction only
(keyboard, monitor, TV, radio)
Half duplex — both directions, one at a time
(walkie-talkie)
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.
Mesh
Star
Bus
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
LAN — Local Area Network
MAN — Metropolitan Area Network
(e.g. STC)
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.
Run the TCP/IP protocol
Have an Internet address
Be able to send IP packets to other machines on the Internet
ISP tiers 3 items
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)
Tier-2 — Provider networks (national/regional): gateways
to the international Internet, connected to at least one tier-1
ISP
(STC, ITC, Mobily)
Tier-3 — Local ISPs: take services from national
providers
Methods of ISP interconnection (peering)
2 items
Private peering points (direct connection) — a group of
routers connecting one ISP to others; owned and operated by the
ISPs, not a third party
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
Ensure a large market for equipment and software
Provide guidelines to manufacturers, vendors and government
agencies
Allow products from different vendors to communicate
Standards organisations 5 items
ISO — International Organization for Standardization
ITU-T — International Telecommunication Union (a UN
agency)
ANSI — American National Standards Institute
IEEE — Institute of Electrical and Electronic Engineers
(LAN/MAN standards)
W3C — World Wide Web Consortium
02
Protocol Layering and Network Models
Forouzan ch. 1 · part 2
Advantages of a layered architecture
3 items
Breaks the complicated communication process into layers of
simpler processes, allowing easier hardware or software
implementation
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
Well-defined interfaces let you replace one layer's
implementation entirely without affecting the other layers
The two standard protocol models
2 items
OSI — Open System Interconnect, developed by ISO in the
1970s, dominated before 1990
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
Movement of individual bits from one hop to the next
How OSI layers are implemented
3 items
Software — Application, Presentation, Session, Transport
Mixed hardware and software — Network
Hardware (in the NIC) — Data link and Physical
Physical layer duties 5 items
Physical characteristics of interfaces and media —
topology, shape/size/pin count of connectors, voltages and
currents, type of transmission medium, transmission (duplex)
mode
Representation of bits — encoding into electrical or
optical signals
Data rate — transmission rate / bandwidth, bits sent per
second
Synchronisation of bits — sender and receiver clocks must
be synchronised
Devices at this level — network card, hub, repeater
Data link layer duties
2 core items
Framing — dividing the stream of bits into units called
frames
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
Logical addressing — a unique global address
distinguishing each host on the Internet (the IP address)
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
Session management — setting up, managing and terminating
sessions, keeping each application's data separate from
another's
Dialog control — full or half duplex: processes send and
receive at the same time, or at different times
Synchronisation checkpoints — let long transmissions
continue from where they were after a crash
Presentation layer duties 3 items
Translation — lets devices with different data
representations communicate; sender format → common format →
receiver format
(EBCDIC vs ASCII)
Encryption / decryption
Compression — fewer bits, important for multimedia
applications
Application layer services
4 items
Web access — a browser using HTTP to reach the WWW
Telnet — remote host access
File transfer, access and management
Mail services
The five TCP/IP layers 5 items
Application — message
Transport — segment
Network — packet
Data link — frame
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
PDU — Protocol Data Unit: the payload from the next
higher layer plus the current layer's control information
Peers — entities on two or more machines communicating at
the same layer
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
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
Framing / deframing — encapsulate the datagram into a
frame by adding a header and trailer; deframe at the receiver
Addressing — layer-2 addresses; in a LAN, the physical or
MAC address used in frame headers to identify source and
destination
Error control — error detection and correction to provide
reliable delivery
Flow control — the sender must not send frames faster
than the receiver can process them
Access control — controlling access to a shared medium
(the MAC sublayer)
Types of framing protocol 2 items
Character-oriented — frame length is a multiple of bytes
(multiple of 8)
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
Single-bit error — only 1 bit in the data unit has
changed
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.
Simple parity check — one parity bit added so the total
number of 1s is even (or odd for odd parity)
Two-dimensional parity check — bits arranged in rows and
columns with a redundant row added to the whole block
Cyclic Redundancy Check (CRC) — modulo-2 binary division
by a generator polynomial held by both sender and receiver
Checksum — one's complement addition of 16-bit words
What simple parity can detect
2 items
All single-bit errors
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
Data blocks are organised into a table
Last column holds the check bits for the rows
Last row holds the check bits for the columns
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
Single-bit errors
Double errors
An odd number of errors
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
The message is divided into 16-bit words
The value of the checksum word is set to 0
All words including the checksum are added using one's
complement addition
The sum is complemented and becomes the checksum
The checksum is sent with the data
Checksum — receiver site 4 steps
The message (including the checksum) is divided into 16-bit
words
All words are added using one's complement addition
The sum is complemented and becomes the new checksum
If the value of the checksum is 0 the message is accepted;
otherwise it is rejected
Error correction methods 3 items
Retransmission
Forward Error Correction (FEC) — detect and correct a
limited number of errors without retransmission
Burst error correction using chunk interleaving
Why retransmission is a poor fit
2 items
Wireless applications — the bit error rate on a wireless
link can be very high, causing a large number of retransmissions
Real-time multimedia — retransmissions create
unacceptable delay; the application has to wait until the
corrupted packet is resent
FEC techniques 3 items
Two-dimensional parity
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
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
LLC (Logical Link Control) — responsible for error and
flow control
MAC (Medium Access Control) — responsible for framing,
MAC addressing and multiple access control
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.
Non-persistent — if idle, transmit; if busy, back off a
random amount of time and sense again
1-persistent — if idle, transmit immediately; if busy,
keep listening until idle then transmit immediately with
probability 1
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
Abort the transmission
Transmit a jam signal (48 bits) so other stations discard
the frame and so the collision signal lasts until the furthest
station detects it
Back off for a random amount of time
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
Simple and easy to implement
Decentralised — no central device that can fail and bring down
the whole system
In low traffic, packet transfer has low delay
In heavier traffic, packet delay has no limit
A station may never get a chance to transfer its packet — it is
an
unfair protocol
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
Reservation
Polling
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
Stations take turns transmitting a single frame at the full rate
R
Transmissions are organised into variable-length cycles
Each cycle begins with a reservation frame of N minislots — one
per station
A station needing to send makes a reservation in its own
minislot
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
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.
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
A special frame called the token rotates in the ring
A station that wants to send waits for a free token to arrive
It makes the token busy by inserting its data and the
destination address
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
A LAN data link layer protocol used in bus and star topologies
Implements CSMA/CD as its medium access method
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
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)
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
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
Unicast — second hex digit from the left is
even (one recipient)
Multicast — second hex digit from the left is
odd (a group of stations, e.g. conferencing)
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
Attached stations must have full-duplex NIC cards
Must use two pairs of wire — one for host→switch (inbound), one
for switch→host (outbound)
Must use a switch as the central device, not a hub
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
Hub — physical layer
Link-layer switch — data link layer
Router — network layer
Hub characteristics 6 items
A physical layer device that operates on bits, not frames
Connects station adapters in a physical star but logical bus
topology
Receives a bit from one adapter and sends it to all the
others, with no access method
Does no filtering — it cannot check the destination
link-layer address to pick an outgoing port
The entire hub forms a
single collision domain and a single broadcast domain
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
Collision domain — the part of the network (set of
devices) where a collision happens if two or more nodes transmit
at the same time
Broadcast domain — the part of the network where each
device can receive the other devices' broadcast messages
Interconnecting with hubs
1 pro · 1 con
Advantage — extends the maximum distance between nodes
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.
No match — add the frame's source address and the
interface it arrived on to the table
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.
Match, different interface — forward the frame through
the interface stored in the table
Match, same interface — discard (drop) the frame
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
Implements CSMA/CD when the medium is shared
Isolates collision domains — each LAN segment is a
separate collision domain, which reduces collisions and raises
total maximum throughput
Forwards a broadcast frame to all devices on the whole network —
it is a
single broadcast domain
Increases performance and security by isolating traffic — the
frame goes only to the port of the receiving device
Increases geographical coverage — no limit on the size of LANs
connected through switches
Transparent — installing or removing a switch does not
require reconfiguring the stations' networking software
Plug-and-play — no configuration needed at installation
or when a host is removed
Can operate in full-duplex mode
Performs MAC address recognition and frame forwarding in
hardware (a bridge does it in software)
The two switch forwarding types
2 items
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
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
Redundant switches and links are used for reliability, so two
hosts can be connected by multiple paths — that is a loop
A switch floods broadcast frames, multicast frames, and unknown
unicast frames out of every port except the one they arrived on
With a loop, every switch keeps re-flooding the same frame
The frame is replicated continuously — a
broadcast storm that consumes all network resources and
stops the network
Spanning Tree Protocol is used to eliminate the loops
Spanning tree — key points
5 items
For any connected graph there is a spanning tree that maintains
connectivity but contains no closed loops
Loops are logically disabled by the spanning tree algorithm
Some ports are blocked to eliminate loops
Blocked ports do not forward data frames, but do forward the
special spanning-tree frames
A blocked port becomes a forwarding port if a network change
makes the protocol run again
Router characteristics 9 items
Operates at the network layer — deals with packets, not
frames
Connects LANs and WANs with similar or different protocols
Each router interface has a physical and an IP address
Isolates both collision domains and broadcast domains
Each router interface is connected to a separate broadcast
domain
Acts like a normal station but has more than one logical (IP)
address
Forwards packets based on the destination IP address
Communicates with other routers and exchanges routing
information; determines the best route using a routing algorithm
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
Creating LAN subnets (broadcast domains) by
software instead of physical wiring
Allows grouping computers logically instead of physically
Divides one physical LAN into several logical LANs
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
Reduce cost and installation time — a station is moved to
another segment or switch by software instead of physically
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
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
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
Routing — finding the best path by running routing
protocols to fill the routing table
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
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.
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
No handshaking — each packet is sent and routed independently
and can follow a different path
The full source and destination address must be attached to
every packet
No setup delay
Packets are not guaranteed to arrive in the order they were sent
Robust — if a router crashes only the packets inside it are
lost, others take another path
IPv4 address facts 5 items
A 32-bit address, written as 4 octets (bytes)
Address space = 2³² = 4,294,967,296
Unique — each connection has a different address
Universal — must be accepted by any host wanting to
connect to the Internet
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
Network address — host bits all 0s
(192.168.10.0/24)
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)
Directed broadcast address — host bits all 1s
(192.168.10.255)
The two IPv4 broadcast types
2 items
Limited broadcast — 255.255.255.255,
received by all nodes in the same network as the source; routers
do not forward it (routers isolate broadcast domains)
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
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.
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
Dividing the network into smaller groups (subnets), each with
its own subnet IP address
The site looks like a single network to the rest of the Internet
— outside routers use only the main network address
Local routers route within the subnetted network using the
subnet address
The host portion is split into a subnet number (most significant
part) and a host number (least significant part)
The IP address now has 3 levels: main network, subnet, host
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.
Subtract 1 from the number of needed subnets
Convert the result to binary
Count the number of bits obtained
Add that count to the default mask of the original network to
get the subnet mask
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
Number of subnets = 2(subnet mask length − classful mask length)
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
IP address from the correct subnet
Subnet mask
Default gateway IP address
(a router interface on the same subnet as the end
devices)
Domain name server IP address
These can be assigned in two ways: manual configuration by
the administrator, or DHCP.
DHCP — key points 5 items
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
Keeps two databases: static IP addresses, and a dynamic
pool of unused temporary addresses
The static database maps physical (MAC) addresses to permanent
IP addresses — used for diskless workstations
On a request the server checks the static database first; if
there is no match it picks a temporary address from the dynamic
pool
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
A network layer protocol that translates between an Internet IP
address and a MAC sublayer (layer-2) address
Needed because the IP address of the next node is not enough to
move a frame through a link — the link-layer address is
An ARP request is broadcast; an ARP reply is unicast
IPv4 datagram header fields
7 to know
Header length — minimum 20 bytes without options
Total length — header + data, maximum 65,535 bytes
Identification, flags and offset — used for fragmentation
and reassembly at the destination
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
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)
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
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
M = 1 — the packet is not the last fragment
M = 0 — the packet is the last fragment
D = 1 — do not fragment this packet
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
No need to be allocated a range of global addresses from the ISP
— one global IP serves all devices, saving IP addresses
You can change the addresses of devices in the local network
without notifying the outside world
You can change ISP without changing the addresses of local
devices
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
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
The company connects to the ISP through a NAT-enabled router
holding a unique IP given by the ISP
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
Every machine inside has a unique private address, usually from
10.x.y.z
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
Routing — filling and updating routing tables by finding
the shortest (best) path from each source to each destination
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
The source host does not — it delivers its packet to the
default router in its local network
The destination host does not — it receives the packet
from its default router
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.
Number of networks (hops or routers)
Geographic distance
Link delay
Capacity (speed)
Reliability
A combination of the above
Routing algorithm classifications
2 items
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
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
Network-specific routing — the destination network IP
address is listed in the table
Host-specific routing — the destination host IP address
is listed in the table
Default routing — 0.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
Apply all the available masks to the destination IP address
If a match is found in the destination address column, forward
to the next-hop IP through the corresponding interface
If no match is found, send the packet through the default
interface
Otherwise a "host unreachable" error message is sent back to the
sender
The two shortest-path algorithms
2 items
Distance Vector — Bellman-Ford algorithm
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
Each node keeps a distance vector table of the distances from
itself to
all possible destination nodes in the domain
Distances use a chosen metric — usually hop count, bandwidth or
delay
A router sends its distance vector table to each of its
neighbours, periodically or when something changes
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
Calculation minimises the cost to each destination; the routing
table is derived directly from the distance vector
Examples: RIP and EIGRP
Link State routing 6 points
Each router measures the cost (delay, bandwidth) between itself
and its directly connected neighbours
The router builds a packet (LSP) containing all these costs
These packets are distributed by flooding to all other
routers in the routing area
Information is sent only when there is a change in a link, to
reduce traffic
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
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
An AS is a single network or a group of networks controlled by a
common network administrator
Each AS is assigned a globally unique Autonomous System Number
(ASN)
AS systems are connected by special routers called
border routers or gateway routers
Routers inside the same AS run the same routing protocol —
intra-AS (interior) routing
Routing between autonomous systems is
inter-AS (exterior) routing; border routers run both
protocols
Popular routing protocols
2 groups
Interior routing — RIP, OSPF, EIGRP: between routers
inside a single AS
Exterior routing — BGP (Border Gateway Protocol): between
routers connecting several ASs
09
Transport Layer
Forouzan ch. 9
Transport layer duties 7 items
Process-to-process communication
Addressing — port numbers to identify which network
application
Encapsulation and decapsulation
Multiplexing and demultiplexing
Connection control — connection-oriented and
connectionless services
Reliability — flow control and error control
Congestion control
Port number ranges 3 facts
Port numbers are 16-bit integers, 0 – 65535, unique to
the host
Well-known (0–1023) — assigned and controlled by IANA
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
Local host IP
Local process port number
Remote host IP
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
Multiplexing (many to one) — the transport layer at the
source accepts messages from more than one
application-layer process
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:
Without error
Without loss
Without duplication
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
Connection-oriented — with establishment and termination
Reliable
Each segment gets a unique sequence number needed for
error control; performs error, flow and congestion control
Header is 20 bytes by default, extendable to
60 bytes with options
TCP sequence numbers 4 rules
Sequence numbers are given to individual bytes
Each side announces a random initial sequence number when the
connection is established
The first segment's sequence number is the initial sequence
number
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
SYN — the client sends the initial segment with the SYN
flag set to 1, carrying a randomly selected initial sequence
number
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
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
The first host sends a segment with the FIN bit set
The second host replies with the ACK bit set
The second host can continue sending data; the first can only
acknowledge, not send
When the second host wants to close, it sends a FIN and the
first host replies with an ACK
Reliable delivery rules 3 items
Every segment must be acknowledged; the acknowledgment number is
the number of the last received byte + 1
Acknowledgments are cumulative — an ACK of X means all
bytes up to X−1 were received and the receiver is ready for byte
X
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
Windows prevent a receiver from being overwhelmed by incoming
data
The window size specifies the maximum data the sender can
forward without an acknowledgment
Window size is included in every TCP segment, starting with the
three-way handshake
TCP implements flow control by increasing and decreasing window
sizes as required
TCP is full duplex — both client and server specify their own
window sizes, and each side has a
send window and a receive window
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
WWW using HTTP
Electronic mail using SMTP
Telnet
File transfer using FTP
UDP properties 6 items
Connectionless — no handshaking, each segment handled
independently
A UDP server application serves only
one request at a time; other requests wait in a queue
Unreliable — no flow or error control; a segment can be
lost, arrive out of order, duplicated, or corrupted
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
Uses port numbers to multiplex / demultiplex data from and to
the application layer
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.
Multimedia applications
Internet telephony
Real-time video conferencing
Domain Name System messages
Audio
Some routing protocols
When UDP is / is not suitable
3 cases
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
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
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
The Internet directory service
A client-server application that maps host names to their
corresponding IP addresses
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
Each name is made of several parts, each part called a
label
Names are defined on a tree structure with the root at the top
Each node has a label
Children of the same node must have different labels,
which guarantees uniqueness
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
A subtree of the domain name space
A group of hosts under the administrative control of a single
entity, such as a company or government agency
Each domain is subdivided into subdomains; the leaves represent
domains with no subdomains
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
FQDN — Fully Qualified Domain Name; only an FQDN can be
translated into its IP address
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
Heavy traffic from requests all over the world
A failure makes the data unavailable
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
A primary server loads all its information from a disk
file
A secondary server loads all its information from the
primary server; that download is called a zone transfer
A root server holds references for the top-level domains
— there are 13 distributed all over the world
Caching — a server stores answers for names outside its
domain so later searches are faster and more efficient
The two resolution techniques
2 items
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
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.
The host contacts its local name server
DNS.PSU.EDU.SA
Having no answer in cache or database, the local server contacts
a
root name server
The root server contacts the name server for the
.com domain (DNS.com)
DNS.com contacts DNS.mcgraw.com, which
holds the IP for
sales.mcgraw.com
DNS.mcgraw.com returns the answer to
DNS.com
DNS.com returns the answer to the root name server
The root name server returns the answer to
DNS.PSU.EDU.SA
DNS.PSU.EDU.SA returns the answer to the host
Iterative resolution — the 8 steps
8 steps
The host contacts its local name server
DNS.PSU.EDU.SA
The local server contacts a root name server
The root server replies with the IP of the
.com name server (DNS.com)
The local server contacts DNS.com
DNS.comreplies with the IP of
DNS.mcgraw.com
The local server contacts DNS.mcgraw.com
DNS.mcgraw.com, the local server for that domain,
replies with the IP of
sales.mcgraw.com
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.