Computer Networks Notes
Computer Networks Notes
1
○ Characteristics
○ Applications
➢ Message Switching
○ Characteristics
○ Applications
➢ Packet Switching
○ Characteristics
○ Applications
➢ Comparison Summary
➢ Data Link Layer
➢ Functions of the Data Link Layer
➢ Sub-layers of the Data Link Layer
➢ Data Link Control
➢ Framing
➢ Flow Control
➢ Error Control
➢ High-Level Data Link Control (HDLC)
➢ Point-to-Point Protocol (PPP)
➢ Channel Allocation Problem
➢ Multiple Access Methods
➢ Channelization Techniques
➢ Transport Layer
➢ Functions of the Transport Layer
➢ Key Protocols
➢ Elements of Transport Protocols
➢ 1. Addressing
➢ 2. Establishing and Releasing Connection
➢ 3. Flow Control & Buffering
➢ 4. Error Control
➢ 5. Multiplexing & De-multiplexing
➢ 6. Crash Recovery
➢ User Datagram
➢ UDP Operations
➢ Uses of UDP
➢ Remote Procedure Call (RPC)
2
Introduction to Computer Networks
Definition
A computer network is a system that connects multiple independent computers, enabling them
to share information and resources. This interconnection can occur through various media,
including wired connections (like copper wires or optical fibers) and wireless methods (such as
radio waves or satellite links). The primary purpose of a computer network is to facilitate
communication and data exchange among users and devices.
- Resource Sharing: Networks allow multiple users to access shared resources such as
printers, files, and applications, which enhances efficiency and reduces costs[1][5].
- Reliability: High reliability ensures that resources remain accessible even in the event of
hardware failures. This is often achieved through redundancy, where data is replicated
across multiple machines[2][3].
- Performance: Networks are designed to minimize latency and maximize throughput,
ensuring that applications run smoothly and respond quickly to user requests[1][3].
- Security: Protecting data from unauthorized access is paramount. Security measures
include firewalls, encryption, and authentication protocols to safeguard sensitive
information[1][2].
- Scalability: Networks must be able to adapt to changing demands, accommodating
growth in users and devices without compromising performance[2][3].
- Bus Topology: All devices share a single communication line. It's simple but can be less
reliable due to a single point of failure.
- Star Topology: All devices connect to a central hub or switch. This topology is more
reliable since failure in one connection does not affect others.
- Ring Topology: Each device connects to two others, forming a circular pathway for
data. While efficient, a failure in any single device can disrupt the entire network.
- Mesh Topology: Every device connects directly to multiple other devices. This provides
high redundancy and reliability but can be complex and costly to implement.
3
Broadcast and Point-to-Point Networks
Broadcast Networks
In a broadcast network, all nodes share a common communication medium. When one node
sends a message, it is received by all other nodes on the network. Broadcast networks are
typically easier to set up but can become congested with high traffic volumes.
Characteristics:
Point-to-Point Networks
In contrast, a point-to-point network establishes a direct link between two nodes. This type of
network is often used for dedicated connections where high bandwidth and low latency are
required.
Characteristics:
4
- Physical Topology: This describes the actual physical layout of the network, including
how devices are interconnected through cables or wireless signals.
- Logical Topology: This focuses on the way data flows within the network, regardless of
the physical connections. It illustrates how devices communicate with each other.
Star Topology All devices connect to - Easy to manage - Central hub failure
a central hub or and troubleshoot can disrupt the entire
switch. network
- Failure of one
device does not - Requires more
affect others cabling than bus
topology
Ring Topology Each device - Equal access for all - A failure in any link
connects to two nodes can disrupt the entire
others, forming a network
circular pathway for - Data travels in a
data. predictable manner - Adding/removing
nodes can be
disruptive
Tree Topology A hybrid topology that - Scalable and - If the root node fails,
combines hierarchical the entire segment
characteristics of star goes down
and bus topologies.
5
Topology Type Description Advantages Disadvantages
- In bus topology, all devices are connected to a single central cable known as the
bus. Data transmitted by any device travels along this cable until it reaches its
intended recipient.
- Use Cases: Commonly used in small networks due to its simplicity.
- In star topology, all nodes connect independently to a central hub or switch. This
structure allows for easy addition or removal of devices without disrupting the
network.
- Use Cases: Widely used in home and office networks.
- Mesh topology can be fully meshed (where every node connects directly to every
other node) or partially meshed (where some nodes are interconnected). This
provides multiple pathways for data transmission.
- Use Cases: Ideal for critical applications like military communications or air traffic
control systems.
6
- Tree topology is structured like a hierarchy with a root node branching out into
various levels of nodes. It combines characteristics of both star and bus
topologies.
- Use Cases: Suitable for large networks that require hierarchical organization.
Types of Networks
Computer networks can be classified into several types based on their scale, purpose, and
technology. Here are the primary types:
7
- Characteristics: Utilizes various communication channels such as leased lines and
satellite links.
- Use Cases: Connecting branch offices of multinational corporations.
7. Backbone Network
- Description: A central part of a computer network that interconnects various networks
and sub-networks.
- Characteristics: High-capacity transmission lines that carry data between different
networks.
- Use Cases: Forms the core infrastructure of large organizations and the Internet.
Network Software
Network software includes applications and protocols that facilitate communication between
devices on a network. This software can be categorized into:
- Network Operating Systems (NOS): Software that manages network resources and
allows devices to communicate (e.g., Windows Server, Linux).
- Protocols: Sets of rules governing data transmission (e.g., TCP/IP, HTTP).
- Network Management Software: Tools for monitoring and managing network
performance (e.g., SolarWinds).
8
Design Issues for the Layers
When designing networks based on layered architectures like OSI or TCP/IP, several issues
must be considered:
1. Interoperability: Ensuring different systems can work together seamlessly across
layers.
2. Scalability: Designing the network to accommodate growth in users and devices without
performance degradation.
3. Security: Implementing measures at each layer to protect against unauthorized access
and data breaches.
4. Performance Optimization: Balancing load across layers to maximize throughput and
minimize latency.
Connection-Oriented Service
- Establishes a dedicated connection between sender and receiver before data
transmission begins.
- Guarantees delivery of packets in the same order they were sent (e.g., TCP).
Connectionless Service
- Sends packets without establishing a dedicated end-to-end connection.
- Does not guarantee delivery or order of packets (e.g., UDP).
1. File Sharing: Allows users to access shared files across the network.
2. Email Communication: Facilitates sending and receiving messages over the Internet.
3. Web Browsing: Enables access to websites and online services through browsers.
4. Streaming Services: Supports video and audio streaming applications like Netflix or
Spotify.
5. Remote Access: Allows users to connect to their work networks from remote locations.
9
1. Transmission Control Protocol (TCP): Ensures reliable transmission of data with error
correction.
2. Internet Protocol (IP): Responsible for addressing and routing packets across
networks.
3. Hypertext Transfer Protocol (HTTP): Used for transferring web pages on the Internet.
Standards ensure interoperability among different systems and devices, with organizations like
IEEE and IETF defining these standards.
The OSI model is essential for understanding how different networking protocols interact and
provides a standardized approach to networking.
10
Layers of the TCP/IP Model
1. Application Layer: Corresponds to the OSI's application, presentation, and session
layers. It includes protocols like HTTP, FTP, SMTP, and DNS that enable user-level
applications to communicate over the network.
2. Transport Layer: Similar to the OSI transport layer, it ensures reliable or unreliable
delivery of messages using protocols like TCP (connection-oriented) and UDP
(connectionless).
3. Internet Layer: Equivalent to the OSI network layer, it handles packet forwarding
through routers using IP addresses.
4. Network Access Layer: Combines the functions of the OSI physical and data link
layers, dealing with hardware addressing and defining protocols for physical
transmission.
The TCP/IP suite is widely adopted due to its robustness and flexibility in supporting diverse
networking environments.
Layer Functions More distinct roles per layer Some layers combine
functions
Key Differences
- The OSI model is more comprehensive with distinct layers for each function, while
TCP/IP combines some functionalities.
- The OSI model serves as a theoretical guideline for understanding networking concepts,
whereas TCP/IP is designed for practical implementation in real-world networks.
11
Physical Layer: Functions of Physical Layer, Analog signals, Digital signals, Transmission
Impairment, Data Rate Limits, and Performance.Data Transmission Media: Guided
Transmission Media, Magnetic Media, Twisted Pairs, Coaxial Cable, Power Lines, Fiber Optics,
Wireless Transmission, Electromagnetic Spectrum, Radio Transmission, Microwave
Transmission, Infrared Transmission, Light Transmission, Digital Modulation and Multiplexing,
Public Switched Telephone Networks. Switching: Circuit switching, Message switching &
Packet switching
Physical Layer
The Physical Layer is the first layer of the OSI (Open Systems Interconnection) model. It is
responsible for the transmission of raw data bits over a physical medium, defining the electrical
and physical specifications for devices and their connections. This layer encompasses various
aspects of the hardware involved in data transmission, including cables, connectors, and
signaling methods.
1. Establishment and Termination of Connections: The Physical Layer establishes and
terminates connections between devices and the communication medium. This involves
activating the physical connection when data transmission begins and deactivating it
once communication ends[1][2].
2. Signal Encoding and Modulation: It converts digital data (binary values) into signals
suitable for transmission over the communication channel. This process includes
modulation, where binary data is transformed into electrical signals, light pulses, or radio
waves[4][5].
3. Data Rate Control: The Physical Layer determines the rate at which data can be
transmitted, measured in bits per second (bps). It ensures that devices can send and
receive data at compatible rates[6].
4. Synchronization: This layer ensures that sending and receiving devices are
synchronized to maintain data integrity during transmission. It handles both synchronous
and asynchronous transmissions[4][6].
5. Transmission Modes: The Physical Layer defines how data is transmitted, including
simplex (one-way), half-duplex (two-way but not simultaneous), and full-duplex
(simultaneous two-way communication)[4].
12
6. Physical Medium Specification: It specifies the characteristics of the transmission
medium (e.g., copper cables, fiber optics) and how devices connect to it. This includes
pin configuration, voltage levels, and cable standards[1][7].
7. Configuration Types: The Physical Layer supports different configurations such as
point-to-point (direct connection between two devices) and multipoint (multiple devices
sharing a single communication line) setups[4][5].
Transmission Impairment
Transmission impairment refers to any degradation of signal quality as it travels through a
medium. Common causes include:
C=Blog2 (1+SNR)
where C is capacity in bits per second, B is bandwidth in hertz, and SNR is the signal-to-noise
ratio.
Performance
The performance of the Physical Layer is critical for overall network efficiency. Key performance
metrics include:
13
- Throughput: The actual rate at which data is successfully transmitted.
- Latency: The time delay from when a request is made until it is fulfilled.
- Error Rates: The frequency of errors occurring during transmission, which can
necessitate retransmissions.
14
- Cladding: Reflects light back into the core.
- Sheath: Protects the fiber from environmental damage.
- Applications: Internet backbones, long-distance telecommunications, and
high-speed data connections.
Electromagnetic Spectrum
The electromagnetic spectrum encompasses all types of electromagnetic radiation, ranging
from low-frequency radio waves to high-frequency gamma rays. Different segments of this
spectrum are utilized for various forms of wireless communication:
15
Digital Modulation and Multiplexing
- Digital Modulation: Refers to techniques used to encode digital information onto carrier
waves for transmission over various media. Common methods include Phase Shift
Keying (PSK), Frequency Shift Keying (FSK), and Amplitude Shift Keying (ASK).
- Multiplexing: Allows multiple signals to share the same transmission medium by
combining them into a single signal. Techniques include Time Division Multiplexing
(TDM) and Frequency Division Multiplexing (FDM).
Circuit Switching
Definition: Circuit switching is a method of communication where a dedicated communication
path (or circuit) is established between two endpoints for the duration of the connection. This
method is commonly associated with traditional telephone networks.
Characteristics
- Dedicated Bandwidth: The entire bandwidth of the circuit is reserved for the duration of
the call, ensuring consistent quality.
- Reliability: Provides a high level of reliability since the path remains dedicated until
disconnection.
16
- Quality of Service (QoS): Guarantees a certain level of service quality, making it
suitable for applications requiring real-time communication (e.g., voice calls).
- Inefficiency in Resource Use: Resources may be wasted during silent periods in a call
since they remain reserved even when not actively transmitting data.
Applications
- Traditional telephone systems (landlines).
- Dial-up internet connections.
- Optical circuit switching in data centers.
Message Switching
Definition: Message switching is a method where entire messages are sent from one node to
another without establishing a dedicated path. Each message is stored at intermediate nodes
until it can be forwarded to its destination.
Characteristics
- Store-and-Forward: Each message is stored at an intermediate node before being
forwarded, allowing for efficient handling of traffic bursts.
- No Dedicated Path: Unlike circuit switching, there is no dedicated connection;
resources are used only when messages are being transmitted.
- Variable Delay: Transmission delays can vary depending on network congestion and
message size.
Applications
- Used in early email systems and telegraphy where messages could be queued at
various points before reaching their final destination.
Packet Switching
Definition: Packet switching divides data into smaller packets that are transmitted
independently across the network. Each packet may take different paths to reach the
destination, where they are reassembled into the original message.
Characteristics
- Dynamic Routing: Packets can take multiple paths based on current network
conditions, allowing for efficient use of bandwidth.
- No Connection Setup: There is no need for a dedicated connection; packets are sent
as needed.
- Flexibility and Scalability: Suitable for high-traffic environments as it allows multiple
users to share network resources effectively.
17
Applications
- The backbone of modern Internet communication, including web browsing, file transfers,
and streaming services.
- Used in protocols such as TCP/IP, which underpins most Internet traffic.
Comparison Summary
Feature Circuit Switching Message Switching Packet Switching
18
Data Link Layer: Functions of Data Link Layer, Data Link Control: Framing, Flow and Error
Control, Error Detection and Correction, High-Level Data Link Control (HDLC) & point — to —
Point protocol (PPP), Channel Allocation Problem, Multiple Access: Radom Access (ALOHA,
CSMA, CSMA/CD, CSMA/CA), ControlledAccess (Reservation, Polling, Token Passing),
Channelization (FDMA, TDMA, CDMA), Wired LAN: Ethernet Standards and FDDI, Wireless
LAN: IEEE 802.1 Ix and Bluetooth Standards.
- The Data Link Layer encapsulates packets received from the Network Layer into
frames for transmission over the physical medium. Each frame includes headers
and trailers that contain control information, such as source and destination
addresses.
- Framing helps to delineate where one packet ends and another begins, allowing
for organized data transmission.
2. Addressing
- The Data Link Layer assigns a unique hardware address (MAC address) to each
device on the network. This addressing ensures that frames are delivered to the
correct destination node.
- The MAC address is embedded in the frame header, enabling devices to identify
each other on the same local area network (LAN).
- To ensure data integrity, the Data Link Layer implements error detection and
correction mechanisms. It adds error-checking bits (such as checksums or cyclic
redundancy checks) to frames.
- If an error is detected during transmission, the layer can request retransmission
of corrupted frames to ensure reliable communication.
19
- Flow control mechanisms are employed to manage data transmission rates
between sender and receiver devices. This prevents overwhelming a slower
device with too much data at once.
- Techniques such as stop-and-wait or sliding window protocols are used to
regulate data flow effectively.
- The Data Link Layer manages how multiple devices share the same
communication medium to avoid collisions. It determines when a device can
transmit data over a shared channel.
- Protocols like CSMA/CD (Carrier Sense Multiple Access with Collision Detection)
for wired networks and CSMA/CA (Carrier Sense Multiple Access with Collision
Avoidance) for wireless networks are examples of media access control
methods.
6. Synchronization
- The Data Link Layer ensures that both sender and receiver are synchronized
during transmission. This synchronization is crucial for maintaining the integrity of
data being sent across the link.
- The LLC sub-layer manages communication between the network layer and
upper layers. It handles flow control, error checking, and acknowledgment of
received frames.
- This sub-layer allows multiple network protocols to coexist over the same
physical medium by providing multiplexing capabilities.
20
Data Link Control
Data Link Control refers to the mechanisms and protocols used in the Data Link Layer to ensure
reliable data transmission over a physical medium. This includes functions such as framing, flow
control, error control, and various protocols designed to manage data communication effectively.
Framing
Framing is the process of encapsulating network layer packets into frames for transmission.
Each frame consists of a header, payload (data), and trailer, which contain control information
such as:
Framing helps in defining the start and end of each packet, ensuring that data is organized for
transmission and reception.
Flow Control
Flow control mechanisms are essential to manage the rate of data transmission between sender
and receiver, preventing buffer overflow at the receiving end. Common flow control techniques
include:
1. Stop-and-Wait Protocol: The sender transmits a frame and waits for an
acknowledgment (ACK) before sending the next frame. This method is simple but can be
inefficient due to idle time while waiting for ACKs.
2. Sliding Window Protocol: Allows multiple frames to be sent before requiring an
acknowledgment. The sender maintains a window of frames that can be sent, increasing
efficiency by utilizing the available bandwidth more effectively.
Error Control
Error control ensures that transmitted data is received accurately by detecting and correcting
errors that may occur during transmission. Key components include:
1. Error Detection: Techniques used to identify errors in received frames. Common
methods include:
- Parity Check: Adds a parity bit to ensure that the total number of 1s is even or
odd.
- Checksum: Sums up the binary values of data segments and sends this sum
along with the data.
21
- Cyclic Redundancy Check (CRC): A more robust method that uses polynomial
division to detect errors.
2. Error Correction: Involves retransmitting corrupted or lost frames. Common techniques
include:
- ALOHA: A simple protocol where devices transmit whenever they have data but
may collide with other transmissions.
- Carrier Sense Multiple Access (CSMA): Devices sense the channel before
transmitting:
22
- CSMA/CD (Collision Detection): Used in wired networks; devices detect
collisions and retransmit after a random backoff period.
- CSMA/CA (Collision Avoidance): Used in wireless networks; devices
avoid collisions by waiting for a clear channel before transmitting.
Channelization Techniques
Channelization techniques divide available bandwidth into distinct channels for multiple users:
1. Frequency Division Multiple Access (FDMA): Divides the frequency spectrum into
separate channels for each user.
2. Time Division Multiple Access (TDMA): Allocates time slots for each user on a shared
channel.
3. Code Division Multiple Access (CDMA): Uses unique spreading codes for each user,
allowing multiple users to share the same frequency band simultaneously.
Transport Layer
The Transport Layer is the fourth layer of the OSI (Open Systems Interconnection) model,
responsible for ensuring reliable data transfer between end systems in a network. It provides
essential services that facilitate communication between applications running on different hosts,
managing how data is segmented, transmitted, and reassembled.
23
Functions of the Transport Layer
1. End-to-End Communication
- The Transport Layer ensures that data is transmitted from the source to the
destination reliably. It takes messages from the upper layers (like the Session
Layer), segments them into smaller units, and sends them over the network.
- Data from applications is divided into smaller segments for transmission. Each
segment is assigned a header containing control information (such as sequence
numbers) to facilitate reassembly at the destination. This process allows for
efficient use of network resources and ensures that large messages can be
transmitted without overwhelming the network.
- Flow control mechanisms prevent the sender from overwhelming the receiver
with too much data at once. This is typically implemented using protocols such
as:
- Sliding Window Protocol: Allows multiple segments to be in transit
before requiring an acknowledgment, optimizing throughput while
ensuring that the receiver can handle incoming data without loss.
6. Multiplexing
24
- The Transport Layer enables multiple applications to use the same network
connection simultaneously by multiplexing. It uses port numbers to differentiate
between different applications or services running on a host, allowing for
organized and efficient communication.
- The Transport Layer can establish, maintain, and terminate connections between
devices. For connection-oriented protocols like TCP, a handshake process is
used to establish a connection before data transfer begins, ensuring both parties
are ready for communication.
Key Protocols
- Transmission Control Protocol (TCP): A connection-oriented protocol that provides
reliable data transmission through error checking, flow control, and acknowledgment
mechanisms.
- User Datagram Protocol (UDP): A connectionless protocol that allows for faster
transmission without guarantees of delivery or order, suitable for applications where
speed is critical (e.g., video streaming).
- Datagram Congestion Control Protocol (DCCP) and Stream Control Transmission
Protocol (SCTP) are also used in specific scenarios requiring different levels of
reliability and ordering.
1. Addressing
Transport protocols use port numbers to identify specific applications or services on a host.
Each application running on a device is assigned a unique port number, allowing the transport
layer to direct incoming data to the appropriate application. For example:
- TCP and UDP protocols utilize source and destination port numbers in their headers to
facilitate communication between applications.
25
- Connection Establishment: In connection-oriented protocols like TCP, a three-way
handshake process is used to establish a connection. This involves:
- Buffering: Data is temporarily stored in buffers at both sender and receiver ends to
accommodate differences in processing speeds.
- Techniques:
- Stop-and-Wait Protocol: The sender waits for an acknowledgment after sending
each segment.
- Sliding Window Protocol: Allows multiple segments to be sent before requiring
an acknowledgment, optimizing throughput while ensuring that the receiver can
handle incoming data.
4. Error Control
Error control mechanisms ensure data integrity during transmission:
- Error Detection: Techniques like checksums and cyclic redundancy checks (CRC) are
used to identify errors in transmitted segments.
- Error Correction: If an error is detected, mechanisms such as Automatic Repeat
Request (ARQ) are employed to retransmit corrupted segments.
- Multiplexing: The transport layer gathers data from multiple application processes and
encapsulates it with headers containing port numbers before sending it over the network.
- De-multiplexing: At the receiving end, the transport layer examines incoming packets'
headers to direct them to the correct application based on destination port numbers. This
process ensures that each application receives only its intended data.
26
6. Crash Recovery
Crash recovery mechanisms are essential for maintaining data integrity and continuity in case of
failures:
User Datagram Protocol (UDP) is a fundamental transport layer protocol within the Internet
Protocol (IP) suite, designed for applications that require fast and efficient data transmission.
Below is an overview of its key components, operations, uses, and related concepts.
User Datagram
A User Datagram is the basic unit of data transmitted over UDP. It consists of a header and a
payload:
- Header: Contains essential information such as source and destination port numbers,
length of the datagram, and a checksum for error-checking.
- Payload: The actual data being transmitted.
UDP Operations
UDP operates in a connectionless manner, meaning it does not establish a dedicated
end-to-end connection before sending data. Key operational characteristics include:
- No Connection Setup: UDP allows for immediate data transmission without the
overhead of establishing a connection.
- Best-Effort Delivery: UDP does not guarantee delivery, order, or error correction. If
packets are lost or arrive out of order, the application must handle these issues.
- Low Overhead: The simplicity of UDP results in lower latency and reduced processing
time compared to connection-oriented protocols like TCP.
Uses of UDP
UDP is particularly suited for applications where speed is critical and occasional data loss is
acceptable. Common use cases include:
- Voice over IP (VoIP): Real-time voice communication where timely delivery is prioritized
over reliability.
27
- Streaming Media: Video and audio streaming services that can tolerate some packet
loss without significant degradation in quality.
- Online Gaming: Fast-paced games that require quick updates and can manage
occasional lost packets.
- Domain Name System (DNS): Quick query-response transactions where speed is
essential.
28