ACN Module 1
ACN Module 1
❖ Applications
The Internet is widely known through its various applications such as the World Wide Web, email,
online social networking, video/audio streaming, instant messaging, and file sharing. These
applications represent the primary way users interact with the network.
there are multiple key stakeholders involved in how the Internet operates:
1. End Users:
These are regular users who access the Internet to browse, communicate, or consume content.
Their primary concern is ease of use, speed, and reliability of applications.
2. Application Developers:
With the growth of smartphones and easy-to-use programming tools, more people are now
able to create Internet applications. Developers need to understand how the network functions
to create efficient and responsive applications that work well across different devices and
networks.
3. Network Operators:
These are the individuals or organizations responsible for managing and maintaining the
infrastructure that keeps networks running (e.g., ISPs, IT departments). Even average home
users have become small-scale operators by managing Wi-Fi routers and home Internet
connections.
4. Network Designers and Engineers:
This group designs the core hardware (routers, switches) and software protocols (like
TCP/IP, HTTP) that form the foundation of the Internet. Their work ensures that applications
can run smoothly and that networks can scale to support millions of users.
❖ Classes of Applications
The Internet is used by billions of people around the world, and its popularity is largely due to the
wide variety of applications it supports. These applications can be grouped into several major classes,
each with different network requirements, user expectations, and technical characteristics.
Understanding these classes helps us design and manage networks more effectively.
• The World Wide Web (WWW) is one of the earliest and most popular uses of the Internet.
• It transformed the Internet from a research tool into a mainstream platform used by the general
public.
• In its basic form, the Web allows users to view web pages that include text, images, and
links.
• Clicking on a link (called a URL, or Uniform Resource Locator) takes the user to another
page or resource.
• Behind the scenes, accessing a web page involves several steps:
o DNS Lookup: The domain name (e.g., [Link]) is translated into an IP
address.
o TCP Connection Setup: A reliable connection is made between the browser and the
server.
o HTTP Request/Response: The browser requests the content, and the server responds.
o TCP Connection Teardown: The connection is closed once the page is received.
• Web applications can tolerate some delay, as users typically wait a moment for pages to load.
• Examples: Wikipedia, online news, online shopping websites.
• These applications provide continuous delivery of media content, such as music or video.
• Instead of downloading an entire file, content is delivered in small chunks and played as it
arrives.
• Examples include YouTube, Netflix, and Spotify.
• Key characteristics:
o Data must arrive fast enough for real-time playback.
o Small delays can be managed using buffering.
o Long delays or interruptions (buffer underflow) degrade user experience.
• Streaming applications typically involve one-way communication (server to user).
• Network designers must ensure sufficient bandwidth and low packet loss for smooth
performance.
• These are interactive applications, such as voice over IP (VoIP) and videoconferencing.
• Examples include Skype, Zoom, Google Meet.
• Communication happens in both directions, and timing is critical.
• Any noticeable delay can cause:
o Awkward pauses during conversation.
o Missed cues like interruptions or reactions.
• These applications have strict timing requirements, unlike streaming which allows some
buffering.
• They also require low latency, low jitter (variation in packet delay), and high reliability.
• Network design must focus on minimizing delays and ensuring real-time data delivery.
❖ REQUIREMENTS
When we want to learn how to build a computer network from scratch, it’s important to start by
understanding the basic principles that guide network design. Instead of just memorizing how
current networks work, we should focus on why networks are designed the way they are.
We use the existing internet protocols, such as IP and TCP, as examples to show how networks are
currently built. However, we don’t simply accept these protocols as the only way to do things.
Instead, we ask questions like:
This way of thinking helps us understand the requirements a network must meet, such as:
Because technology changes rapidly and new applications keep coming up, networks must evolve
too. If we only memorize current protocols, we might struggle when new technologies appear. But if
we understand the fundamental ideas and goals behind networking, learning and adapting to new
protocols becomes easier.
So, the key to learning about computer networks is to focus on the core concepts and the reasons
behind design decisions. This approach prepares us to build networks that meet today’s needs and
can adapt to future challenges.
❖ Perspectives
When learning about computer networks, it’s helpful to look at them from different points of view
because different people use and work with networks in different ways. There are three main groups
of people involved:
❖ Scalable Connectivity
A computer network’s main job is to connect computers so they can communicate with each other.
Sometimes, networks are small and private, like a company’s internal network, where only certain
computers can connect. Other times, networks are very large, like the Internet, which connects
millions of computers worldwide. Networks that can grow very large without losing performance are
called scalable.
• Links: These are the physical connections between computers, like cables or wireless signals.
• Nodes: These are the computers or devices connected by links.
• Links can be point-to-point (connecting exactly two nodes) or multiple-access (connecting
many nodes sharing the same link, like Wi-Fi).
• Wireless connections, such as cellular networks or Wi-Fi, are examples of multiple-access
links.
• But networks can't just rely on direct connections because connecting every computer directly
to every other one would be impossible and expensive.
Indirect Connectivity Through Switched Networks
• To connect many computers, networks use switched networks where special nodes called
switches forward data between nodes.
• Two main types of switched networks exist:
o Circuit-switched networks: Establish a dedicated path for communication (used by
traditional telephone networks).
o Packet-switched networks: Break data into packets and send them independently
through the network (used by the Internet and most modern computer networks).
• Packet switching is more efficient because it allows many users to share the same network
paths.
• We often represent complex networks as a cloud, which hides the internal details and just
shows that many nodes are connected.
• Multiple networks (clouds) can be connected together to form a larger network called an
internetwork or internet (small “i”).
• Devices called routers connect these networks and forward data between them, similar to
switches but at a larger scale.
• This ability to connect different networks into one big global network is the core idea behind
the Internet.
Addressing and Routing
• To communicate, each node must have a unique address so messages can be sent to the right
destination.
• When a computer wants to send data, it includes the destination’s address.
• If the destination is not directly connected, routers and switches use the address to decide how
to forward the message.
• This process is called routing.
• Most messages are sent to a single destination (unicast), but networks can also send messages
to all nodes (broadcast) or to a selected group of nodes (multicast).
• Imagine many computers want to send data at the same time through the same network.
• The big question is: How do multiple computers share the same network links efficiently?
• Since network links (like cables or wireless channels) are limited resources, they need to be
shared carefully so everyone gets a chance to send data.
Multiplexing: Sharing a Single Link
• Multiplexing means dividing a single network link so multiple users can share it.
• It’s like a single processor time-sharing among many programs—each program thinks it has
the processor all to itself.
• In networks, data from different users is combined to travel over one physical link.
Methods of Multiplexing
• Unlike STDM and FDM, statistical multiplexing dynamically shares the link based on
demand.
• If only one user has data, they can use the full link; if many have data, the link is shared
among them.
• This method avoids wasting link capacity and can support many users flexibly.
• To share the network fairly, data is divided into packets—small fixed-size chunks of data.
• A user sends packets one by one; the network interleaves packets from different users.
• This way, no user can monopolize the link, and others get their turn.
How Packets Are Scheduled
• Sometimes packets arrive faster than they can be sent, so switches store them temporarily in
buffers (memory).
• If too many packets arrive and buffers fill up, some packets get dropped—this is called
congestion.
• Managing congestion is a major challenge in network design to keep communication smooth.
1. Request/Reply Channel
o Used by file transfer and digital library applications.
o Guarantees reliable, in-order delivery.
o May include privacy and data integrity protection.
2. Message Stream Channel
o Used by video streaming and videoconferencing.
o Supports one-way or two-way traffic.
o May allow some message loss (tolerates missing video frames).
o Ensures in-order delivery of messages.
o Supports multicast for group communication.
o Also includes privacy and integrity protections.
• Network designers aim for a minimal set of channel types that cover many applications.
• However, too few channel abstractions may force applications to use unsuitable channels.
• New channel types and options will evolve as new applications are developed.
Implementation Location of Services
• The network can provide a simple bit pipe between hosts, with the end hosts handling
complex semantics.
• This keeps network switches simple but places more burden on hosts.
• Alternatively, some functions can be pushed into switches, allowing end hosts to be simpler
devices.
• The choice of function placement between switches and end hosts is an ongoing design
challenge.
Reliability in Networks
❖ Manageability
• Networks must be managed effectively, yet this requirement is often overlooked or
addressed late.
• Management includes:
o Scaling the network to support more traffic and users.
o Troubleshooting issues when the network performance degrades or malfunctions.
• As networks grow huge (like the Internet with billions of users and millions of hosts),
managing and configuring devices becomes very complex.
• Configuring a single router needs expert skills; managing thousands of routers and diagnosing
large network problems is beyond any single person.
• To handle this, many network management tasks must be automated or simplified so they
can be done by less skilled personnel.
• Network management is no longer limited to experts because home networks are common
now.
• This requires that consumer networking devices be easy to set up and manage ("plug-and-
play").
• Achieving true plug-and-play networking has been difficult and remains an active research
area.
• Each layer builds upon the services provided by the layer below it.
• This makes the system more modular and easier to develop, maintain, and update.
For example, a higher-level protocol (like HTTP) doesn't need to know how data is physically
transmitted on cables—it only needs to know how to send and receive messages using TCP/IP.
A protocol is a set of rules that governs communication between entities in a network. Each protocol
typically defines two interfaces:
• Service Interface – defines how local applications or higher-level protocols can use the
protocol (e.g., functions like send, receive).
• Peer Interface – defines how two instances of the protocol (on different machines)
communicate (e.g., message formats, commands).
Each protocol layer implements specific communication services and uses the services of the layer
below.
3. Encapsulation
Encapsulation is the process where each layer adds a header (and sometimes a trailer) to the data
it receives from the layer above before passing it down.
For example:
Multiplexing allows multiple applications or services to share the same communication channel.
Demultiplexing is the reverse process—delivering received data to the correct application.
Each protocol header contains a demux key (e.g., port number) to identify the correct target.
Example:
The OSI (Open Systems Interconnection) model is a conceptual framework developed by the
ISO (International Organization for Standardization). It standardizes the functions of a
telecommunication or computing system into seven distinct layers, each with specific roles.
Purpose of the OSI Model
• To guide product developers and facilitate interoperability between different systems and
networks.
• To break down complex network processes into simpler, modular functions.
• Each layer interacts only with its adjacent layers and provides services to the layer above it.
1. Physical Layer
• Transmits raw bitstreams (0s and 1s) over physical media.
• Defines hardware components, cables, voltages, data rates, and connectors.
• Examples: Ethernet cables, Wi-Fi signals, hubs.
2. Data Link Layer
• Converts raw transmission into frames.
• Responsible for MAC addressing, error detection, and correction.
• Ensures reliable node-to-node communication.
• Examples: Ethernet, PPP, switches.
3. Network Layer
• Handles logical addressing and routing of packets.
• Determines the best path to send data from source to destination.
• Uses IP addresses for communication between networks.
• Examples: IP (Internet Protocol), routers.
4. Transport Layer
• Ensures end-to-end communication, error recovery, and flow control.
• Provides reliable (TCP) or unreliable (UDP) data delivery.
• Breaks large messages into smaller segments.
• Examples: TCP, UDP.
5. Session Layer
• Manages sessions or dialogs between applications.
• Establishes, maintains, and terminates connections.
• Ensures synchronization and proper data exchange.
• Example: NetBIOS, RPC.
6. Presentation Layer
• Ensures that data is in a usable format and is presented correctly.
• Handles data encryption, compression, and translation (e.g., EBCDIC to ASCII).
• Examples: JPEG, MPEG, SSL/TLS.
7. Application Layer
• Closest to the end user; interacts with software applications.
• Provides services like email, file transfer, web browsing.
• Examples: HTTP, FTP, SMTP, DNS
❖ Performance
In networking, performance refers to how efficiently and effectively a network delivers data
between devices. While understanding the functional aspects (how the network operates) is
essential, it is equally critical to evaluate how well the network operates under various conditions.
Unlike general software systems, computer networks must be designed with performance in
mind from the beginning, because the speed and reliability of data delivery directly affect the
performance of distributed applications.
• Distributed systems (e.g., cloud apps, video calls, online gaming) rely heavily on fast and
consistent network performance.
• Delays or errors in data delivery can degrade user experience or even cause failures in real-
time systems.
• Applications like VoIP, video streaming, and real-time data analytics demand low latency
and high throughput.
Understanding these is essential for analyzing how efficiently data moves through a network.
Computer networks are evaluated not just on functionality but also on performance, which is critical
in delivering data efficiently. The two main metrics that define network performance are:
🔹 1. Bandwidth (Throughput)
Bandwidth is the maximum amount of data that can be transferred over a network in a specific
period of time. It is usually expressed in bits per second (bps).
• Example: A 10 Mbps (megabits per second) link can transmit 10 million bits every second.
➤ Influencing Factors:
➤ Types of Bandwidth:
2. Latency (Delay)
Latency is the time delay it takes for a data packet to travel from source to destination across a
network.
RTT is the total time it takes for a message to go from source to destination and back again. RTT is
especially important in applications like web browsing, gaming, and messaging.
1. Propagation Delay
Time for a signal to travel through the medium.
Speed varies:
Transmission Delay
Time to transmit all bits of the packet.
1. Queuing Delay
Time a packet waits in queues (in routers or switches) before being forwarded.
Latency-sensitive applications:
Bandwidth-sensitive applications:
•
o Whether RTT is 1 ms or 100 ms adds very little to this time.
Modern processors are extremely fast. Even small delays in networking cause significant
computational loss.
Example:
instructions
The delay × bandwidth product is a crucial metric in networking that represents the amount of
data that can be “in transit” or “in flight” in the network at any given moment between a sender
and receiver.
• Delay (Latency) = the length of the pipe (how long it takes for a signal or bit to travel from
sender to receiver).
• Bandwidth = the diameter of the pipe (how many bits can flow through the pipe per second).
The delay × bandwidth product tells us how many bits can fit inside that pipe at once.
What is Delay (Latency)?
Latency is the time delay for a bit of data to travel from the sender to the receiver. It has several
components:
• Propagation delay: Time it takes for the signal to travel the physical distance. This is limited
by the speed of light in the medium (fiber, copper, etc.).
• Transmission delay: Time taken to put all bits of a packet onto the wire, calculated by packet
size divided by bandwidth.
• Queuing delay: Time spent waiting in network device buffers if there is congestion.
What is Bandwidth?
Bandwidth refers to the rate at which bits can be transmitted over a network link, usually
measured in bits per second (bps). For example:
• A 10 Mbps link means you can send 10 million bits every second.
• Higher bandwidth means more bits can be sent per unit time.
• For example, a channel with 50 ms delay (0.05 seconds) and 45 Mbps bandwidth:
0.05×45,000,000=2,250,000 bits
This means the pipe can hold about 2.25 million bits at once (approx. 280 KB).
• It determines how much data the sender needs to transmit before the first bit arrives at
the receiver.
• If the sender waits for an acknowledgment from the receiver before sending more data, the
sender can send up to this many bits before stopping to wait.
• If the sender sends less than this amount, the network’s bandwidth is underutilized (the pipe is
not full).
• If the sender sends more data than this before receiving acknowledgment, the receiver’s buffer
might overflow, causing packet loss.
• Often, the delay is taken as the Round-Trip Time (RTT) — the time it takes for a message
to go to the receiver and for the acknowledgment to come back.
• Using RTT in the calculation:
The sender can have up to 4.5 million bits unacknowledged in the network to fully utilize the link.
Practical Implications
• Protocols like TCP use this concept to set their window size — the amount of
unacknowledged data they are allowed to send.
• If the window size is smaller than the delay × bandwidth product, the sender cannot fully
utilize the network.
• High bandwidth-delay product networks (long latency + high bandwidth) require large
buffers and efficient flow control mechanisms.
Real-World Example
• Consider a video streaming server 5000 miles away with 50 ms one-way latency and 45 Mbps
bandwidth.
• The delay × bandwidth product (volume of the pipe) is about 280 KB.
• If the server sends less than 280 KB before waiting for an acknowledgment, the link
bandwidth isn’t fully used.
• If it sends data equal to or more than this amount, it keeps the network "full" and maximizes
throughput.
Chapter 2: Perspectives on Connecting
❖ Perspectives on Connecting
From the end-user perspective, connecting to the Internet always involves some kind of link, but the
type varies:
• Wi-Fi (Wireless link): A user in a coffee shop or home usually connects wirelessly. The
signal uses radio waves, which means it’s subject to interference from walls, other devices, or
distance.
• Ethernet (Wired link): In offices or campuses, devices often connect by Ethernet cables —
twisted pair copper wires that provide stable, fast connections.
• Fiber Optic: High-speed internet providers use fiber optics, which transmit data as pulses of
light. These links offer very high bandwidth over long distances but are more expensive to
install.
• Copper wire or coaxial cable: Traditional telephone lines or cable TV wires, often used for
DSL or cable Internet.
1. Copper Wires (e.g., DSL, coaxial cables) – commonly used in older telephone systems and
some last-mile connections.
2. Optical Fibers – widely used for long-distance, high-speed backbone networks due to their
high bandwidth and low interference.
3. Wireless Links – use radio waves or infrared through free space (e.g., Wi-Fi, mobile
networks).
These various links form the foundation of global networking. Despite their physical differences,
networking protocols abstract them into a unified communication system.
example of a voice-grade telephone line, which carries continuous electromagnetic signals ranging
between 300 Hz and 3300 Hz; a 300-Hz wave traveling through copper would have
a wavelength of
❖ Reliable Transmission
In computer networks, when data is transmitted over a link, it can sometimes get corrupted or lost
due to interference, noise, or hardware failures. To ensure reliable delivery, especially in cases
where error detection is not enough, additional mechanisms are required to recover from errors or
lost frames.
• Error Detection:
o Methods like CRC (Cyclic Redundancy Check) are used to detect errors in
transmitted frames.
o If an error is detected, the corrupt frame is discarded.
• Error Correction:
o Some codes can correct errors too, but they add too much overhead and are not
efficient for all types of errors, especially on noisy links.
o Therefore, most link-level protocols rely on detection and retransmission, not
correction.
a. Acknowledgments (ACKs):
• An ACK is a small control frame sent by the receiver to inform the sender that a frame was
successfully received.
• ACKs can be:
o Sent as a standalone frame, or
o Piggybacked on a data frame going in the reverse direction.
b. Timeouts:
The combination of ACKs and timeouts is called ARQ (Automatic Repeat reQuest). It ensures
reliable delivery by repeating transmission until an acknowledgment is received.
1. Stop-and-Wait ARQ
2. Go-Back-N ARQ
3. Selective Repeat ARQ
Each has different ways of managing retransmissions and tracking which frames were received
correctly.
• While link-layer protocols (like Ethernet or Wi-Fi) may implement reliable delivery, many
modern technologies skip it to reduce complexity or latency.
• Transport layer protocols (like TCP) often take responsibility for reliable delivery.
• In some cases, even the application layer (e.g., HTTP over unreliable UDP) implements
reliability.
• Where to implement reliability depends on performance needs, link behavior, and design
goals.
❖ Stop-and-Wait ARQ
Stop-and-Wait ARQ (Automatic Repeat reQuest) is the simplest form of reliable data
transmission used in computer networks. It ensures that data is transmitted accurately between
sender and receiver over a network link.
1. Basic Principle
• The sender sends one frame at a time and then waits for an acknowledgment (ACK) from
the receiver before sending the next frame.
• If the ACK is received, the sender proceeds to the next frame.
• If no ACK is received within a timeout period, the sender retransmits the same frame.
• If a duplicate frame is delivered (e.g., due to a lost ACK), the receiver might mistakenly treat
it as a new frame.
• To prevent this, Stop-and-Wait uses a 1-bit sequence number (0 or 1) in the frame header.
• The receiver uses this number to recognize and discard duplicates, while still sending back
an ACK to prevent further retransmission.
4. Efficiency Limitation
Example:
Sender-Side
Sender Invariant:
Sender Actions:
Receiver Invariant:
Real protocols use finite-size sequence number fields (e.g., 3-bit = 8 values: 0–7). This means:
o This ensures old and new frames with the same SeqNum are not confused.
Implementation Highlights
Data Structures
Key Assumptions:
• SWS = RWS = 4
• MaxSeqNum = 8 (i.e., sequence numbers: 0 to 7)
• Messages are delivered in order (no actual network simulation)
Sender Code
#define MAX_SEQ 8
#define SWS 4
bool canSend() {
return ((LFS - LAR + MAX_SEQ) % MAX_SEQ) < SWS;
}
Receiver Code
#define RWS 4
Message recv_buffer[RWS];
Message Struct
typedef struct {
char data[100];
} Message;
Example Usage
Message m1 = {"Hello"};
Message m2 = {"World"};
sendData(m1); // Send frame 0
sendData(m2); // Send frame 1
Output (example)
Delivered: 0
Ack received: 0
Delivered: 1
Ack received: 1
Concurrent Logical Channels is a data link layer protocol technique used to improve efficiency
over a network link. It was used in the ARPANET, one of the earliest packet-switched networks
(predecessor to the Internet).
The traditional Stop-and-Wait Protocol is simple but inefficient—it only allows one frame to be
"in-flight" at a time. This leads to wasted link capacity, especially on high-latency links.
Sliding Window Protocol solves this by allowing multiple outstanding frames, but it introduces
more complexity in sequencing and flow control.
Sending a Frame:
1. The sender checks which logical channels are idle (i.e., not waiting for an ACK).
2. It picks the lowest-numbered idle channel.
3. Sends a frame with:
o Channel number (3 bits if 8 channels).
o Sequence number (1 bit: 0 or 1).
o Payload (the actual data).
4. Marks that channel as busy.
Receiving a Frame:
1. The receiver uses the channel number in the frame to find the corresponding logical channel.
2. It checks if the sequence number matches the expectedSeq:
o If it matches: Accept the data, flip expectedSeq, and send ACK.
o If not: It's a duplicate (e.g., retransmission), ignore the data but resend ACK.
Receiving an ACK:
This totals 4 bits, which matches the bits needed for a sliding window of 8 frames (where SWS =
RWS = 8).
Limitations
• No ordering guarantee: Unlike sliding window, the protocol does not preserve the order of
frames.
• No flow control: Assumes receiver can handle all incoming frames; ARPANET handled flow
control at higher layers.
• Fixed number of channels: Unlike sliding window which can adjust the window size, this
protocol is limited by the number of logical channels.