0% found this document useful (0 votes)
2 views25 pages

Network Notes

Computer networks consist of interconnected computers that communicate using shared protocols, organized in a layered architecture to simplify design. They have various applications including resource sharing, data access, e-commerce, and remote work, and utilize hardware components like end devices, intermediary devices, and transmission media. The document also discusses network software, types of services, and classifications of networks based on geographical scale and reference models like OSI and TCP/IP.

Uploaded by

sharmag0552
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views25 pages

Network Notes

Computer networks consist of interconnected computers that communicate using shared protocols, organized in a layered architecture to simplify design. They have various applications including resource sharing, data access, e-commerce, and remote work, and utilize hardware components like end devices, intermediary devices, and transmission media. The document also discusses network software, types of services, and classifications of networks based on geographical scale and reference models like OSI and TCP/IP.

Uploaded by

sharmag0552
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Computer networks are collections of interconnected autonomous

computers that exchange information using shared communication


protocols. They are fundamentally designed as a stack of layers to reduce
design complexity, where each layer offers services to the layer above it
while shielding it from implementation details. [1, 2, 3, 4]

1. Applications of Computer Networks

 Resource Sharing: Making programs, data, and physical


equipment (like printers) available to anyone on the network without
regard to physical location.
 Data Access and Information Exchange: Facilitating
communication through email, instant messaging, and the World
Wide Web.
 E-Commerce and Financial Services: Enabling online shopping,
banking, and real-time stock trading.
 Multimedia and Entertainment: Supporting streaming video,
online gaming, and VoIP (Voice over IP).
 Remote Work and Cloud Computing: Providing access to remote
databases and company files for work-from-home scenarios. [1, 2, 5,
6, 7, 8]

2. Network Hardware
Hardware components are the physical building blocks that establish
communication pathways. [9, 10]

 End Devices: Computers, smartphones, and servers where


communication starts or ends.
 Intermediary Devices:
o Hub: A basic device that broadcasts incoming data to all its
ports.
o Switch: An intelligent device that forwards data only to the
specific port where the destination device (identified by MAC
address) is connected.
o Router: Connects multiple networks and directs data packets
based on IP addresses to find the best path.
o Modem: Converts digital data from a computer into analog
signals for transmission over telephone or cable lines and
vice-versa.
o Gateway: A node that acts as a translator between two
different networks using distinct protocols.
 Transmission Media: Cables (Ethernet, fiber-optic) or wireless (Wi-
Fi, radio waves) that carry the signals. [6, 9, 10, 11, 12, 13, 14, 15]
3. Network Software
Protocol Hierarchies (Layering) [16]
Networks are organized into a stack of layers to minimize design
complexity. [2, 17]

 Peers: Entities at the same layer on different machines that


communicate using the layer's protocol.
 Protocol Stack: The set of protocols used by a specific system.
 Protocol Data Unit (PDU): The unit of data exchanged between
peer entities (e.g., segments in transport, packets in network,
frames in data link). [17, 18, 19, 20, 21]

Design Issues for Layers

 Reliability: Handling bit errors or packet loss.


 Routing: Determining the optimal path for data through a subnet.
 Flow Control: Ensuring a fast sender does not overwhelm a slow
receiver.
 Congestion Control: Managing situations where the network is
oversubscribed by too much traffic.
 Security: Protecting data from unauthorized access or modification.
[1, 9, 22, 23, 24, 25, 26]

Interfaces and Services

 Service: A set of operations a layer provides to the layer above it.


 Interface: Defines the primitive operations and services the lower
layer offers to the upper layer through Service Access Points
(SAPs).
 Service Primitives: Formal operations (system calls) used to
access services:
o LISTEN : Wait for an incoming connection.
o CONNECT : Establish a connection with a peer.
o SEND : Transmit data to the peer.
o RECEIVE : Wait for an incoming message.
o DISCONNECT : Terminate the connection. [18, 24, 27, 28, 29, 30,
31, 32]

4. Connection-Oriented vs. Connectionless Services


Feature [7, 8, Connection-Oriented Connectionless (e.g.,
33, 34, 35, 36, (e.g., TCP) UDP)
37]

Setup Requires a "handshake" No connection setup;


before data transfer. data is sent immediately.

Path All packets usually follow Each packet (datagram)


the same virtual path. is routed independently.

Reliability High; guarantees delivery Best-effort; may lose or


and correct sequencing. reorder packets.

Overhead High due to management Low; no session


and acknowledgments. maintenance required.

Use Case File transfers, email, web Live streaming, online


browsing. gaming, VoIP.

Would you like a detailed breakdown of the OSI model's seven layers or
a comparison with the TCP/IP stack?

In network architecture, communication is categorized by how many


participants are involved in a single transmission. These methods define
the structural logic of how data flows from a source to its intended
destination(s). [1, 2]

1. Point-to-Point (Unicast)
Point-to-Point architecture creates a dedicated link between exactly two
nodes. It is the most common form of data transmission on the internet.
[3, 4, 5]

 Structure: One sender communicating with one receiver (1-to-1).


 Capacity: The entire capacity of the link is reserved for these two
devices, meaning there is no competition for bandwidth from other
nodes.
 Security: High, as the communication channel is private and not
shared with other machines.
 Components: Often involves Point-to-Point Protocol (PPP) for
authentication and encryption.
 Use Cases: Web browsing (HTTP), file downloads (FTP), or a direct
link between two routers in a WAN. [4, 6, 7, 8, 9]

2. Multicast
Multicast is a one-to-many (specifically, one-to-subscribed group)
communication method. It serves as an efficient middle ground between
point-to-point and broadcast. [5, 10]
 Structure: One sender sends a single data stream that is replicated
only as needed by network devices to reach a specific group of
recipients.
 Efficiency: Highly bandwidth-efficient because the source doesn't
have to send a separate copy for every receiver.
 Architecture & Protocols:
o Addressing: Uses Class D IP addresses ([Link] to
[Link]).
o Management: Internet Group Management Protocol (IGMP)
allows hosts to join or leave a group.
o Routing: Protocol Independent Multicast (PIM) is used by
routers to build "distribution trees" that find the most efficient
path to all group members.
 Use Cases: IPTV (live television), video conferencing, and real-time
stock market data feeds. [10, 11, 12, 13, 14]

3. Broadcast
Broadcast architecture is a one-to-all transmission method within a
specific network segment. [5, 15]

 Structure: A single packet is sent to every device on the network,


regardless of whether they requested it or need it.
 Scope: Typically restricted to the Local Area Network (LAN)
because routers generally do not forward broadcast packets to
prevent internet-wide congestion.
 Efficiency: Low for data transmission, as every device must process
the packet even if it's discarded, wasting CPU and bandwidth.
 Types:
o Limited Broadcast: Sent to all devices on the same local
network.
o Directed Broadcast: Sent to all devices on a specific remote
network.
 Use Cases: Address Resolution Protocol (ARP) for finding MAC
addresses and Dynamic Host Configuration Protocol (DHCP) for
assigning IP addresses. [5, 10, 13, 15, 16, 17, 18]

Would you like to explore the specific protocol headers or addressing


schemes used for each of these transmission types?
Computer networks are primarily categorised by their geographical scale,
while reference models like OSI and TCP/IP provide the structural rules
for how data moves through these networks. [1, 2]

Classification of Networks by Geographical Area [3]


Networks are distinguished by the area they cover, ownership, and data
transmission speeds. [1, 4, 5]

 LAN (Local Area Network):


o Coverage: Limited to a small area like a single room, building,
or office campus (typically up to 2 km).
o Ownership: Privately owned by a single individual or
organisation.
o Speed & Performance: Offers very high data transfer rates
(10 Mbps to 10 Gbps) and extremely low latency.
o Common Use: Sharing resources like printers, files, and
internet access within a home or office.
 MAN (Metropolitan Area Network):
o Coverage: Spans an entire city or a large campus, typically
covering a range of 5–50 km.
o Ownership: Can be public (like a city-wide ISP) or private
(connecting multiple company branches in one city).
o Technology: Often uses fiber optic cables and high-speed
wireless links.
o Common Use: Interconnecting multiple LANs within a city or
providing cable TV networks.
 WAN (Wide Area Network):
o Coverage: Covers massive distances across countries,
continents, or the entire globe.
o Ownership: Usually not owned by a single entity; managed
by telecommunications companies and governments.
o Speed & Performance: Higher latency and lower speeds
than LANs due to long-distance transmission.
o Common Use: The internet is the most well-known example
of a WAN. [1, 4, 5, 6, 7, 8, 9, 10]

Reference Models
1. The OSI Reference Model (Open Systems Interconnection) [11, 12]
The OSI model, developed by the ISO in 1984, is a theoretical 7-layer
framework used for teaching and network design. [2, 12]

Layer [2, Name Key Function Example


12, 13, Protocols/Device
14, 15] s

7 Applicatio User-level interaction and HTTP, FTP, SMTP,


n network services. DNS

6 Presentat Data formatting, SSL/TLS, JPEG,


ion encryption, and ASCII
compression.
5 Session Manages dialogue and RPC, NetBIOS
communication sessions.

4 Transport End-to-end reliable TCP, UDP


delivery, flow, and error
control.

3 Network Logical addressing and IP, ICMP, Routers


best-path routing.

2 Data Link Node-to-node delivery, Ethernet, Switches


framing, and MAC
addressing.

1 Physical Physical transmission of Cables, Hubs, Wi-Fi


raw bit streams.

2. The TCP/IP Reference Model


The TCP/IP model is a practical 4-layer architecture specifically designed
for the Internet. [16, 17]

 Application Layer: Combines the top three OSI layers (Application,


Presentation, and Session). It handles high-level user interface and
protocol needs like web browsing (HTTP) and email (SMTP).
 Transport Layer: Matches the OSI Transport layer. It uses TCP for
reliable, ordered delivery and UDP for fast, connectionless
transmission.
 Internet Layer: Corresponds to the OSI Network layer. It is
responsible for routing data packets (datagrams) using IP (Internet
Protocol).
 Network Access Layer: Combines the OSI Data Link and Physical
layers. It handles the physical transmission of data frames over
network hardware like Ethernet cards and cables. [17, 18, 19, 20,
21]

Summary Comparison
The OSI Model serves as a generic, protocol-independent blueprint that
clearly distinguishes between services, interfaces, and protocols. In
contrast, the TCP/IP Model is protocol-dependent and streamlined for
real-world implementation, forming the actual backbone of the modern
internet. [16, 20, 22, 23]
Would you like a deeper explanation of a specific layer, such as how TCP
ensures reliability?

The primary difference between the OSI (Open Systems Interconnection)


and TCP/IP (Transmission Control Protocol/Internet Protocol) models lies in
their structure and application. The OSI model is a theoretical seven-
layer framework used for teaching and network design, while TCP/IP is a
practical four-layer protocol suite used for real-world internet
communication. [1, 2, 3, 4, 5]

Comparison Overview
The following table summarizes the key structural differences between the
two models:

Feature [1, 2, OSI Model TCP/IP Model


5, 6, 7, 8, 9,
10, 11]

Number of 7 Layers 4 to 5 Layers


Layers

Approach Vertical Horizontal

Usage Primarily Practical; foundation of the


theoretical/educational Internet

Development Designed first, then Protocols developed first,


protocols were created then the model

Layer Separate Session and Combines


Structure Presentation layers Session/Presentation into
Application layer

Data Link Exists as a distinct Layer Often merged with Physical


Layer 2 into the Network Access
layer
Data Link Layer: Design Issues
The Data Link Layer (DLL) acts as a bridge between the physical hardware
and the network layer above it. Its primary goal is to ensure reliable, error-
free transmission between two adjacent nodes. [12, 13, 14]

Key design issues include:

 Framing: The DLL must break the raw bit stream from the Physical
Layer into discrete blocks called frames. It identifies the start and
end of each frame using methods like byte counting or flag bytes
with bit/byte stuffing.
 Error Control: To maintain data integrity, the DLL detects and
sometimes corrects errors that occur during transmission. It
typically uses checksums, CRC, or parity bits to verify frames and
may request retransmission if an error is found.
 Flow Control: This mechanism prevents a fast sender from
overwhelming a slow receiver. Common methods include feedback-
based (receiver sends permission to send more) or rate-based
(sender limits transmission speed). [12, 14, 15, 16, 17]

Services Provided to the Network Layer [18]


The principal function of the Data Link Layer is to provide a well-defined
service interface to the Network Layer. It offers three primary types of
services: [16, 19, 20]

1. Unacknowledged Connectionless Service: The source sends


independent frames without the destination acknowledging them. It
is suitable for low-error environments or real-time traffic like voice
where speed is more critical than 100% reliability.
2. Acknowledged Connectionless Service: Each frame is
individually acknowledged by the receiver. The sender knows if a
frame arrived safely and can retransmit if it doesn't receive a
response within a set time. This is useful for unreliable channels like
Wi-Fi.
3. Acknowledged Connection-Oriented Service: A logical
connection is established before data is sent. Frames are numbered
to guarantee they are received exactly once and in the correct
order. This is the most reliable service, used for long-distance or
satellite communications. [12, 15, 16, 17, 21]

Would you like to dive deeper into specific framing methods or see how
error detection algorithms like CRC work?
Flow control is a networking mechanism that regulates the rate of data
transmission between a sender and a receiver to ensure the receiver's
buffer does not overflow. By using feedback, it prevents a fast sender from
overwhelming a slower receiver, which would otherwise lead to packet
loss and the need for retransmissions. [1, 2, 3, 4]

Core Mechanisms
There are two primary techniques used to manage this flow:

 Stop-and-Wait: The simplest method where the sender transmits a


single frame and then must wait for an acknowledgement (ACK)
from the receiver before sending the next one. While easy to
implement, it is inefficient because the link remains idle during the
waiting period.
 Sliding Window: A more advanced technique that allows the
sender to transmit multiple frames (up to a defined "window size")
before needing an acknowledgement. As acknowledgements arrive,
the window "slides" forward, enabling continuous data flow and
significantly higher throughput than stop-and-wait. [2, 3, 5, 6, 7, 8]

Key Implementation Layers


Flow control is primarily handled at two distinct layers of the OSI model:
[7]

 Data Link Layer: Manages the flow between two directly


connected adjacent nodes (e.g., computer to switch).
 Transport Layer: Specifically within TCP, it manages the end-to-
end flow between the source and final destination applications
across the entire network. [4, 6, 9, 10, 11]

Benefits of Flow Control

 Prevents Data Loss: Keeps the receiver from dropping packets


due to memory exhaustion.
 Optimizes Resource Use: Ensures network capacity is used
effectively without causing congestion.
 Improves Reliability: Reduces the frequency of transmission
errors and resets.
 Handles Device Disparity: Enables smooth communication
between devices with vastly different processing speeds, such as a
high-speed server and a low-power IoT sensor. [1, 4, 12]

Would you like to dive deeper into the specific algorithms used in TCP
sliding windows, such as "slow start" or "congestion avoidance"?
Elementary data link protocols manage data transfer, with key types
including the idealistic Unrestricted Simplex, flow-controlled Stop-and-
Wait, and robust Noisy Channel protocols. Unrestricted Simplex operates
one-way without errors, while Stop-and-Wait introduces feedback for flow
control, and noisy protocols use timeouts/sequence numbers for reliability.
[1, 2, 3, 4]

1. Unrestricted Simplex Protocol (Utopian Protocol) [5]

This is the simplest, most idealistic protocol, often called a “Utopian”


protocol because it assumes an error-free channel where data
transmission is strictly unidirectional (simplex).

• Key Assumptions: The channel is perfect (no frames are lost, damaged,
or duplicated), the receiver has infinite buffer space, and the receiver can
process data instantly.

• Operation: The sender’s data link layer accepts data from the network
layer, packages it into a frame, and transmits it immediately. The
receiver’s physical layer receives the frame, extracts the data, and passes
it to the network layer without any delay or checking.

• Limitation: It is entirely impractical. Due to its “Utopian” nature, it does


not use flow control or error detection, meaning if the sender is faster
than the receiver, the receiver’s buffer will overflow (flooding). [2, 5, 6, 7,
8]

2. Simplex Stop and Wait Protocol (Noiseless Channel)

This protocol adds flow control to the unrestricted simplex protocol by


ensuring that the sender does not overwhelm the receiver with data.

• Operation: The sender sends a single frame of data and then stops,
waiting for an acknowledgment (ACK) from the receiver before sending
the next frame.

• Flow Control: The receiver only sends an acknowledgement (a dummy


frame without data) after the previous frame has been successfully
processed and passed to its network layer.

• Suitability: It is designed for a noiseless channel, meaning it still


assumes frames are never lost or corrupted. It only solves the issue of a
fast sender and slow receiver.
• Diagram:

3. Simplex Protocol for a Noisy Channel (Stop and Wait ARQ) [2,
3, 6]

This is a more robust version of the stop-and-wait protocol designed for


real-world channels where frames can be damaged, lost, or delayed.

• Error Control Mechanisms:

• Timeouts: The sender starts a timer after sending a frame. If an


ACK is not received within a set time, the sender assumes the frame was
lost and retransmits it.

• Sequence Numbers: Frames are numbered (usually 0 or 1) so that


the receiver can detect duplicate frames and discard them, ensuring that
each frame is passed to the network layer exactly once.

• Operation:

1. Sender transmits frame, sets timer.

2. Receiver receives frame, sends ACK.

3. If timer expires, sender retransmits (Time Out).

4. If receiver detects a duplicate frame, it discards the frame but re-


sends the ACK. [4, 7, 10, 11]

Summary Table

| Protocol [1, 2, 3, 9, 12] | Direction | Error Handling | Flow Control |


Scenario |

| Unrestricted Simplex | Unidirectional | None | None | Ideal/Perfect |


| Simplex Stop & Wait | Unidirectional | None | Yes (Stop & Wait) | Noiseless
|

| Simplex Noisy (ARQ) | Unidirectional | Yes (Timer/Seq No) | Yes (Stop &
Wait) | Real/Noisy |

Simple Protocol for a Music Channel [8]

A “music channel” implies that data, such as a compressed audio stream,


must be transmitted continuously in one direction from a server (sender)
to a listener (receiver).

• Recommended Protocol: Simplex Protocol (Noiseless or Lightly Loaded)

• Reasoning: Since music is a streaming service, it requires high


throughput and consistent delivery rather than low latency or high
reliability for every single packet.

• If the channel is highly reliable: An unrestricted simplex approach


works best because it avoids the overhead of acknowledgments [9, 10,
14, 15, 16]

The network layer's primary role is to move packets from a source host to
a destination host, often across multiple intermediate routers. [1, 2]

Network Layer Design Issues


Designers must balance several critical factors to ensure efficient end-to-
end packet delivery: [3, 4, 5]

 Store-and-Forward Packet Switching: Routers store incoming


packets until they have fully arrived and their checksums are
verified before forwarding them to the next hop.
 Logical Addressing: Providing a uniform numbering system (e.g.,
IPv4 or IPv6) that identifies devices across different network types.
 Congestion Control: Managing data flow to prevent network
overload and ensure fair resource distribution.
 Scalability: Ensuring the network can grow in size and traffic
without significant performance drops. [2, 4, 6, 7, 8]
Services to the Transport Layer
The network layer provides an interface to the transport layer with specific
goals to ensure seamless communication: [5, 9, 10, 11]

1. Independence from Router Technology: Services must not


depend on the specific hardware or technology used by routers.
2. Topology Shielding: The transport layer should be unaware of the
number, type, or physical layout of the routers.
3. Uniform Addressing: Offering a consistent addressing plan for
both Local Area Networks (LANs) and Wide Area Networks (WANs).
[2, 6, 11, 12]

Types of Service Provided

 Connection-Oriented Service: A virtual circuit (VC) path is


established between the source and destination before data is sent.
All packets follow this single path in order.
 Connectionless Service: Packets (called datagrams) are injected
independently into the network. Each carries a full destination
address and may follow different paths to the destination. [2, 6, 11,
12, 13]

Routing Algorithms
Routing algorithms decide which output line an incoming packet should
use. They are classified based on how they respond to network changes.
[14, 15]

Static (Non-Adaptive) Algorithms


These algorithms follow pre-planned pathways that do not change based
on real-time network conditions. [15, 16]

 Mechanism: Routes are calculated in advance and manually loaded


into routers.
 Pros: Low CPU/memory overhead, predictable behavior, and high
security (no route sharing).
 Cons: Not fault-tolerant; if a link fails, the administrator must
manually update the route.
 Examples: Flooding and shortest-path routing based on fixed
metrics. [14, 15, 16, 17, 18, 19, 20]

Dynamic (Adaptive) Algorithms


These algorithms automatically update routing decisions based on
changes in topology and traffic load. [14, 20]

 Mechanism: Routers exchange status information with neighbors to


recalculate the best paths continuously.
 Pros: Highly scalable and self-healing; they can route around
failures or congestion.
 Cons: High consumption of bandwidth and CPU; more complex to
implement.
 Examples: Distance Vector (e.g., RIP) and Link State (e.g., OSPF)
protocols. [18, 19, 20, 21, 22]

Would you like a more detailed comparison of Distance Vector versus


Link State dynamic routing protocols?

The Transport Layer is a critical end-to-end layer that manages the


reliability, integrity, and rate of data transmission between processes.
Congestion control at this layer often utilizes traffic-shaping algorithms
like the Leaky Bucket and Token Bucket to regulate the flow of data
entering the network and prevent performance degradation. [1, 2, 3, 4]

Congestion Control Algorithms


1. Leaky Bucket Algorithm
This algorithm acts as a traffic smoother, ensuring a constant and
predictable output rate regardless of how bursty the input traffic is. [5, 6]

 Mechanism: Packets enter a "bucket" (a FIFO queue). The bucket


"leaks" at a fixed, predetermined rate.
 Packet Drops: If the bucket (queue) is full, new incoming packets
are immediately discarded.
 Best For: Applications requiring steady, low-jitter streams like VoIP
or video conferencing.
 Limitation: It is rigid and can waste available bandwidth during
low-traffic periods because it cannot handle bursts even if the
network is idle. [5, 6, 7, 8, 9]

2. Token Bucket Algorithm


This algorithm provides more flexibility by allowing short bursts of traffic
while still maintaining a long-term average rate. [3, 6]

 Mechanism: Tokens are added to a bucket at a fixed rate ($r$). To


transmit a packet, the sender must "consume" a token.
 Bursts: If the bucket has accumulated tokens during idle periods, a
burst of packets can be sent at once.
 Packet Handling: When the bucket is empty, packets must wait for
new tokens to be generated. Unlike the Leaky Bucket, it typically
discards tokens when full, not packets.
 Best For: Applications with variable traffic patterns, such as web
browsing or cloud services, where occasional bursts are common.
[7, 10, 11, 12, 13]
Comparison Summary
Feature [5, 7, 11, 12, Leaky Bucket Token Bucket
14, 15, 16, 17]

Output Rate Constant and rigid Variable (allows bursts)

Data Loss Excess packets are Tokens are dropped;


dropped packets wait

Flexibility Low High

Implementation Simple FIFO queue Token counter variable

Transport Layer Design Issues


Designing the transport layer involves addressing several key challenges
to ensure reliable process-to-process communication: [1, 2]

 Service Point Addressing: Must include "port addresses" to


deliver messages to the specific process on a computer, rather than
just the computer itself.
 Segmentation and Reassembly: Messages must be broken into
segments with sequence numbers to ensure they can be put back
together in the correct order at the destination.
 Connection Control: Designers must decide between connection-
oriented services (like TCP, requiring a handshake) or connectionless
services (like UDP).
 Flow Control: Managing the speed difference between a fast
sender and a slow receiver on an end-to-end basis to prevent buffer
overflow.
 Error Control: Ensuring the entire message arrives without
damage, loss, or duplication, typically through checksums and
retransmissions.
 Multiplexing/Demultiplexing: Allowing multiple applications to
use the network simultaneously by differentiating their data streams
via port numbers. [1, 2, 18, 19]

Would you like to see a numerical example comparing how many


packets each algorithm would drop during a specific traffic burst?

The transport layer is responsible for process-to-process delivery, ensuring


data reaches the correct application on a host using specific identifiers
and protocols. [1, 2]
Transport Layer Addressing
To deliver data to the correct application, the transport layer uses port
numbers (also called Transport Service Access Points or TSAPs). [3, 4]

 Port Numbers: 16-bit identifiers (0–65,535) that distinguish


different processes on a single device.
o Well-known Ports (0–1023): Reserved for standard services
like HTTP (80) or FTP (21).
o Ephemeral Ports (>1023): Temporary ports assigned to
client applications for a session.
 Sockets: The combination of an IP address and a port number,
uniquely identifying a specific connection endpoint. [5, 6, 7, 8]

Connection Management (TCP)


As a connection-oriented protocol, the Transmission Control Protocol
(TCP) manages the lifecycle of a connection through distinct phases. [6,
9]

1. Establishing a Connection (Three-Way Handshake) [10]


TCP uses a three-way handshake to synchronize sequence numbers and
ensure both parties are ready. [10, 11]

 Step 1 (SYN): The client sends a SYN (Synchronize) packet with an


initial sequence number ($x$).
 Step 2 (SYN-ACK): The server responds with a SYN-ACK packet. It
acknowledges the client’s request ($x+1$) and sends its own initial
sequence number ($y$).
 Step 3 (ACK): The client sends an ACK (Acknowledge) packet back
to the server ($y+1$), completing the setup. [6, 10, 12, 13, 14]

2. Releasing a Connection (Four-Way Handshake)


TCP provides a graceful release that closes each direction of the full-
duplex connection independently. [8, 15]

 Step 1 (FIN): One side (e.g., client) sends a FIN (Finish) packet,
indicating it has no more data to send.
 Step 2 (ACK): The server acknowledges the FIN and may continue
sending its remaining data.
 Step 3 (FIN): Once finished, the server sends its own FIN packet to
the client.
 Step 4 (ACK): The client sends a final ACK . The connection enters a
TIME_WAIT state to ensure all lingering packets have expired before
fully closing. [8, 10, 12, 15, 16, 17]
Comparison of Transport Protocols: TCP vs. UDP
The choice between protocols depends on whether the application
requires reliability or speed. [5, 18]

Feature [5, 8, 10, TCP (Transmission UDP (User


18, 19, 20, 21, Control Protocol) Datagram Protocol)
22]

Connection Connection-oriented Connectionless (No


(Handshake required) handshake)

Reliability Reliable; guarantees order Unreliable; best-effort


and delivery delivery

Speed Slower due to overhead Faster; minimal


and error checking latency and overhead

Header Size 20–60 bytes Fixed 8 bytes

Flow Control Uses sliding window for No built-in flow or


flow and congestion control congestion control

Use Cases Web browsing (HTTP), VoIP, Streaming,


Email (SMTP), File transfer Online gaming, DNS
(FTP)

Would you like to see a diagram of the TCP three-way handshake


or more detail on specific port numbers?

The Application Layer is the topmost layer (Layer 7) of the OSI model,
serving as the direct interface between end-user applications and the
network. It handles protocols that enable services like web browsing, file
transfers, and communication. [1, 2]

The DNS Name Space


The Domain Name System (DNS) translates human-readable domain
names (e.g., [Link] ) into numerical IP addresses required for network
communication. [3, 4]
 Hierarchical Structure: The DNS name space is organized as an
inverted tree with a maximum of 128 levels, starting with the Root
(.) at the top.
 Levels of the Tree:
o Root Level: The topmost node, often represented by a null
string or dot.
o Top-Level Domains (TLDs): Categorized into Generic
Domains (e.g., .com , .edu , .org ) and Country Domains
(e.g., .in , .us ).
o Second-Level Domains: Specific names registered to
organizations (e.g., example in [Link] ).
 Fully Qualified Domain Name (FQDN): A complete name
including all labels from the host up to the root, ensuring global
uniqueness (e.g., [Link]. ). [3, 5, 6, 7, 8, 9]

Electronic Mail (E-Mail)


Electronic mail is a distributed service allowing users to exchange
asynchronous messages. [7, 10]

 Core Architecture:
o User Agent (UA): The software users interact with to
compose and read mail (e.g., Outlook, Gmail).
o Message Transfer Agent (MTA): Handles the actual transfer
of mail between servers using SMTP.
o Message Access Agent (MAA): Protocols used by a client to
retrieve mail from a server.
 Key Protocols:
o SMTP (Simple Mail Transfer Protocol): The standard
protocol for sending mail between servers via TCP port 25.
o POP3 (Post Office Protocol v3): Used to retrieve mail; it
typically downloads messages to a local device and may
delete them from the server.
o IMAP (Internet Message Access Protocol): A more
advanced retrieval protocol that syncs mail across multiple
devices while keeping it stored on the server. [7, 11, 12, 13,
14, 15]

The World Wide Web (WWW)


The Web is a system of interconnected hypertext documents and
resources accessed via the internet. [10, 16]

 Primary Components:
o URL (Uniform Resource Locator): A unique address for
identifying resources (e.g., [Link] ).
o HTTP (HyperText Transfer Protocol): An application layer
protocol that governs how browsers and servers communicate
to transfer web pages.
o HTML (HyperText Markup Language): The standard
language used to structure and format web content.
 Operation: The Web follows a client-server model. A web
browser (client) sends an HTTP request to a web server, which then
returns an HTTP response containing the requested data (like text or
images). [10, 17, 18, 19, 20]

Would you like a deeper dive into how DNS resolution works or a
comparison of SMTP vs. HTTP?

In network security, cryptography is the primary mechanism used to


transform readable data (plaintext) into an unintelligible format
(ciphertext) to protect it during transmission or storage. This discipline
ensures secure communication even over untrusted media like the
internet. [1, 2, 3, 4]

Core Principles (The CIA Triad)


Modern security frameworks are built on three foundational pillars, often
referred to as the CIA Triad: [5, 6]

 Confidentiality: Ensuring that sensitive information is accessible


only to authorized users. Encryption is the main tool used to achieve
this.
 Integrity: Guaranteeing that data has not been altered or tampered
with during transit. Hashing is typically used to verify integrity.
 Availability: Ensuring that systems and data are reliable and
accessible to authorized users when needed. [7, 8, 9, 10, 11, 12]

Other critical concepts include Authentication (verifying identity) and


Non-repudiation (ensuring a sender cannot deny sending a message).
[7, 13]

Primary Types of Cryptography

1. Symmetric-Key Cryptography:
o Uses a single shared key for both encryption and
decryption.
o Pros: Fast and efficient for large amounts of data.
o Cons: Securely distributing the shared key is a major
challenge.
o Examples: AES (current industry standard), DES, and
Blowfish.
2. Asymmetric-Key Cryptography:
o Uses a pair of keys: a public key for encryption and a
private key for decryption.
o Pros: Solves the key distribution problem; supports digital
signatures.
o Cons: Computationally slower than symmetric encryption.
o Examples: RSA, ECC (Elliptic Curve Cryptography), and Diffie-
Hellman.
3. Hash Functions:
o Mathematical algorithms that convert input of any size into a
fixed-length string (hash value).
o They are one-way (cannot be reversed) and do not use keys.
o Examples: SHA-256 (used in blockchain and SSL), MD5. [1, 2,
3, 7, 10, 13, 14, 15, 16, 17]

Recommended Resources for Beginners


If you are looking for introductory textbooks or guides, here are some
widely used resources:

An Introduction to Network Security and Cryptography (First


Edition, 2025): Available at [Link] and other retailers.

Introduction to Cryptography and Network Security by Sunil Gupta:


This text provides a solid foundation for students and is available from
merchants like S.K. Kataria & Sons and [Link].

Cryptography and Network Security: Principles and Practice: A


comprehensive survey of network security tools often used in academic
courses. [18, 19]

Would you like to explore a specific cryptographic algorithm like RSA or


AES in more detail?

6. Substitution Cipher: One Time Pad (OTP) - YouTube

The One-Time Pad: The Only Truly Unbreakable Encryption - DEV ...

In network security, classical ciphers rely on two primary mechanisms:


substitution and transposition. While substitution ciphers change the
identity of characters but keep their position, transposition ciphers keep
the identity of characters but change their position. The one-time pad
(OTP) is a special form of substitution that is mathematically proven to be
unbreakable when used correctly. [1, 2, 3, 4, 5]
1. Substitution Ciphers
Substitution involves replacing each unit of plaintext (bit, letter, or group
of letters) with a different character or symbol according to a fixed system
or key. [6, 7]

 Mechanism: The original character's identity is changed, but its


sequence in the message remains the same.
 Common Types:
o Monoalphabetic: Uses a single substitution rule for the
entire message (e.g., Caesar Cipher, where each letter is
shifted by a fixed number of places).
o Polyalphabetic: Uses multiple substitution alphabets that
rotate based on the character's position (e.g., Vigenère
Cipher).
 Weakness: They are vulnerable to frequency analysis, where
common characters in the ciphertext are matched against the
known letter frequencies of a language. [6, 7, 8, 9, 10, 11]

2. Transposition Ciphers
Transposition ciphers (also called permutation ciphers) rearrange the order
of existing characters according to a defined system without changing the
characters themselves. [12, 13]

 Mechanism: The character's identity is preserved, but its position is


changed.
 Common Types:
o Rail Fence Cipher: Plaintext is written in a zigzag pattern
across multiple "rails" and read off row by row.
o Columnar Transposition: Text is written horizontally in a
grid and read out column-by-column based on a keyword.
 Weakness: Because the original characters are still present, they
are susceptible to anagramming and pattern recognition. [2, 3, 12,
14, 15, 16, 17]

3. One-Time Pads (OTP)


The one-time pad is an advanced substitution technique that offers
perfect secrecy, meaning ciphertext reveals zero information about the
original message. [1, 18]

 Key Requirements: For a one-time pad to be unbreakable, the


following must be met:
o Randomness: The key must be truly random, not generated
by an algorithm.
o Length: The key must be at least as long as the message
being sent.
o Single Use: The key must never be reused and must be
destroyed immediately after use.
 Encryption: Typically uses the XOR operation or modular addition
to combine each plaintext character with a corresponding character
from the random key.
 Drawbacks: The primary challenges are key distribution
(securely sharing a key as long as the message) and the
management of large quantities of truly random data. [1, 19, 20, 21,
22, 23]

Would you like to see a step-by-step example of how a specific cipher,


like the Columnar Transposition or Caesar Cipher, is calculated?

Public-key cryptography is built on two primary principles that solve the


critical issues of secure key distribution and the need for digital
signatures. Unlike traditional methods that use a single shared secret,
these systems use a pair of mathematically linked but distinct keys. [1, 2,
3, 4]

Fundamental Principles

 Asymmetric Key Pairs: Every user has a public key (shared


openly) and a private key (kept secret). Information encrypted with
one key can only be decrypted by the other in the pair.
 Computational Infeasibility (One-Way Functions): The security
relies on "trapdoor" one-way functions, which are easy to calculate
in one direction but virtually impossible to reverse without specific
"secret" information (the private key). For example, it is easy to
multiply two large primes, but extremely difficult to factor their
product back into those primes. [4, 5, 6, 7, 8, 9, 10, 11]

The RSA Algorithm


RSA (Rivest-Shamir-Adleman) is the most widely used public-key
algorithm. Its security is specifically based on the integer factorization
problem. [3, 12, 13, 14]

 Key Generation: It involves selecting two very large prime


numbers ($p$ and $q$) and calculating their product $n$.
 Operation: The public key $(n, e)$ is used for encryption, while the
private key $(n, d)$ is used for decryption.
 Strength: Modern implementations typically use key lengths of at
least 2048 bits to resist brute-force attacks. [3, 10, 14, 15, 16]
Other Major Public-Key Algorithms

 Diffie-Hellman (DH): Primarily used for secure key exchange,


allowing two parties to establish a shared secret over an insecure
channel without actually sending the key itself.
 Elliptic Curve Cryptography (ECC): An alternative to RSA that
uses the algebraic structure of elliptic curves. It offers the same
level of security as RSA but with much smaller key sizes, making it
faster and more efficient for mobile devices.
 Digital Signature Algorithm (DSA): A standard for digital
signatures that provides authentication and data integrity. [16, 17,
18, 19, 20, 21]

Would you like to see a step-by-step mathematical example of how


RSA generates its keys and encrypts a message?

Digital signatures rely on a combination of message digests and public-


key cryptography to ensure a document's authenticity and integrity.
While the term "symmetric-key signature" is sometimes used to describe
Message Authentication Codes (MACs), true digital signatures are almost
exclusively asymmetric. [1, 2, 3, 4]

1. Message Digests (The "Fingerprint")


A message digest is a fixed-length string of numbers generated by a one-
way hash function from a variable-length message. [1, 3]

 Purpose: Acts as a unique digital fingerprint for the data.


 Key Properties: It must be computationally impossible to reverse
the hash to find the original message (one-way) or to find two
different messages that produce the same digest (collision-
resistant).
 Common Algorithms: MD5 (older, less secure), SHA-1, and the
more modern SHA-256 family. [1, 3, 5, 6, 7, 8]

2. Public-Key (Asymmetric) Signatures


Public-key signatures are the standard for digital signing. They use a key
pair: a private key (known only to the signer) and a public key (shared
with everyone). [2, 9, 10]

 The Process:
1. The sender creates a message digest of the document.
2. The sender encrypts this digest using their private key to
create the digital signature.
3. The recipient uses the sender's public key to decrypt the
signature and retrieve the original digest.
4. The recipient calculates a new digest from the received
document. If the two digests match, the document is
authentic and has not been tampered with.
 Security Pillars: Provides Authentication (proves who sent it),
Integrity (proves it wasn't changed), and Non-repudiation (the
sender cannot deny sending it). [2, 9, 11, 12, 13, 14]

3. Symmetric-Key "Signatures" (MACs)


In symmetric-key cryptography, the sender and receiver share the same
secret key. [9, 15]

 Message Authentication Codes (MACs): A message digest


created using a shared secret key is known as a MAC.
 Limitations: While MACs provide integrity and authentication, they
do not provide non-repudiation. Because both parties have the
same key, a third party cannot prove which of the two created the
signature in a dispute.
 Speed: Symmetric operations are much faster than public-key
operations, making them useful for high-volume data. [1, 6, 12, 15,
16, 17, 18, 19]

Comparison Table
Feature [1, 2, 3, 9, 12, Symmetric-Key Public-Key (Digital
14, 15, 16] (MAC) Signature)

Key Type Shared Secret Private & Public Key Pair


Key

Integrity Yes Yes

Authentication Yes (between Yes (to any third party)


parties)

Non-repudiation No Yes

Performance Very Fast Slower (computationally


intensive)

Would you like to see a step-by-step breakdown of a specific algorithm


like RSA or DSA?

You might also like