unit 3 and 4 data networking
unit 3 and 4 data networking
The Data Link Layer (Layer 2) is the second layer in the OSI (Open Systems Interconnection)
model of computer networking. Its primary function is to ensure reliable communication over
a physical link between two directly connected nodes (such as computers or network devices).
The Data Link Layer is responsible for framing, flow control, and error control to provide a
reliable link between nodes.
1. Framing:
o Framing refers to the process of dividing the stream of data bits into manageable chunks, called
frames, that can be transmitted over the physical medium.
o Each frame typically contains control information (such as the destination address, source address,
and error-checking data) as well as the actual data payload.
Types of Framing:
o Character-oriented framing: Each frame is identified by a special character that marks the beginning
and the end of the frame (e.g., Byte Stuffing).
o Bit-oriented framing: Frames are defined by specific bit patterns (e.g., High-Level Data Link Control or
HDLC).
o Physical layer framing: This involves defining specific physical boundaries (like voltage levels or bit
sequences) for data transmission.
2. Flow Control:
o Flow control ensures that the sender does not overwhelm the receiver with too much data too
quickly. The receiver must have enough buffer space to process incoming data.
o Stop-and-Wait: In this method, the sender transmits one frame and waits for an acknowledgment
(ACK) from the receiver before sending the next frame. It’s simple but not efficient for high-speed
connections due to idle time.
o Sliding Window: A more efficient flow control method where the sender can transmit several frames
before receiving an acknowledgment, based on the receiver's buffer capacity. The window size
determines how many frames can be in transit at a time.
Example:
o If the receiver's buffer can handle only 3 frames at once, the sender can send up to 3 frames and must
wait for an acknowledgment for one of them before sending the next.
3. Error Control:
o Error control involves detecting and correcting errors that may occur during data transmission. Errors
can be caused by noise, interference, or signal degradation in the physical medium.
Error control is primarily achieved through error detection and error correction techniques.
Error detection and error correction are critical mechanisms for ensuring the integrity of data
transmission over a network. The Data Link Layer uses various techniques to detect errors and, in some
cases, automatically correct them.
1. Error Detection
Error detection involves identifying whether an error has occurred during the transmission of a frame or
packet. Some common error detection methods are:
1. Parity Check:
o Parity is a simple error detection method where a bit (called the parity bit) is added to the data to
make the total number of 1s either even (even parity) or odd (odd parity).
o Example:
For a data byte 1011001, if the system uses even parity, a 1 will be added to make the
number of 1s even (10110011).
Limitations:
o Parity check can only detect single-bit errors. It cannot detect multiple-bit errors.
2. Checksums:
o A checksum is a value calculated from the sum of the binary data in a frame. The sender calculates a
checksum value based on the data, sends the data along with the checksum, and the receiver
recalculates the checksum to verify if the data is correct.
o If the checksum at the receiver does not match the calculated value, an error is detected, and the data
may be discarded or retransmitted.
3. Cyclic Redundancy Check (CRC):
o CRC is a more robust error detection technique that uses polynomial division to generate a checksum
(called CRC code). The sender appends the CRC code to the data, and the receiver performs the same
polynomial division to check for errors.
o CRC is widely used in networks and storage devices due to its ability to detect burst errors and its
effectiveness for detecting multiple-bit errors.
Example:
o Suppose a sender transmits a message along with a CRC checksum. If a bit error occurs during
transmission, the receiver will detect the mismatch between the CRC checksum and the data.
Advantages of CRC:
o Highly efficient in detecting errors in large data blocks (can detect burst errors).
2. Error Correction
Error correction techniques allow the receiver to automatically correct errors without needing
retransmission. These methods are more complex than error detection, but they help to maintain data
integrity in scenarios where retransmission is impractical (e.g., satellite communication).
1. Hamming Code:
o The Hamming Code is an error-correcting code that adds parity bits to data in such a way that single-
bit errors can be both detected and corrected. The number of parity bits used depends on the length
of the data being transmitted.
o How it Works:
Parity bits are placed at positions that are powers of 2 (1, 2, 4, 8, etc.).
The receiver checks the parity bits and calculates the error syndrome, which indicates the
position of any erroneous bit.
If a single-bit error is detected, the receiver can correct it by flipping the incorrect bit.
2. Reed-Solomon Codes:
o Reed-Solomon codes are powerful error-correcting codes used in systems such as CDs, DVDs, and
satellite communication. These codes are capable of correcting multiple-bit errors and are widely used
for burst error correction.
o How it Works:
The data is divided into blocks, and additional redundant bits (error correction bits) are added.
The receiver can correct errors in the data using these redundant bits.
3. Forward Error Correction (FEC):
o FEC is a method where the sender transmits redundant data (error correction codes) along with the
original data. This allows the receiver to correct errors without requiring retransmission.
o Example: In wireless communication systems like satellite communication, FEC allows the receiver to
recover lost or corrupted data due to interference or noise.
Advantages:
o Reduces the need for retransmissions, making it ideal for high-latency systems (e.g., satellite
communication).
4. Automatic Repeat Request (ARQ):
o ARQ is an error control method in which the receiver requests the sender to retransmit a frame if an
error is detected.
o Common ARQ protocols:
Stop-and-Wait ARQ: The sender waits for an acknowledgment of the last frame before
sending the next one. If the receiver detects an error, it requests retransmission.
Go-Back-N ARQ: The sender can transmit multiple frames but must resend all frames from the
point of error onwards if an error is detected.
Selective Repeat ARQ: Only the erroneous frames are retransmitted, improving efficiency over
Go-Back-N.
Concept Description
Dividing data into manageable units (frames) for transmission, which include control information and
Framing
error-checking data.
Flow Control Ensuring that data transmission is at a pace the receiver can handle, preventing buffer overflow.
Concept Description
Mechanisms to detect and correct transmission errors, including error detection techniques like Parity
Error Control
Check, Checksums, and CRC, and error correction methods like Hamming Code and Reed-Solomon.
Error Identifying errors in data transmission, commonly using techniques like Parity Bits, Checksums, and
Detection CRC.
Error Automatically correcting errors in transmitted data, through methods such as Hamming Code, Reed-
Correction Solomon Codes, FEC, and ARQ.
The Sliding Window Protocol is a flow control and error control mechanism used in computer networks
to manage the transmission of multiple frames in a reliable and efficient manner. It ensures that data is
sent in a controlled and orderly manner between two communicating devices while optimizing the use of
available bandwidth.
In the Sliding Window Protocol, both the sender and the receiver maintain a "window" that defines how
many frames can be sent and received at any given time. This window size can adjust dynamically,
depending on the conditions of the communication channel.
Sender Window: The sender is allowed to send a fixed number of frames (within the window) before receiving
an acknowledgment from the receiver. The number of frames in the sender's window is determined by the
window size.
Receiver Window: The receiver also has a window that defines how many frames it can receive and buffer
before processing.
1. The sender sends a set of frames within the window without waiting for an acknowledgment for each
individual frame.
2. As the receiver acknowledges frames (typically the highest sequence number received), the sender slides the
window forward, allowing new frames to be sent.
3. If a frame is lost or corrupted, the receiver requests a retransmission, and the sender resends the frame
within the window.
Window size: Determines the number of frames the sender is allowed to transmit without receiving an
acknowledgment. The larger the window, the more efficient the transmission but the more complex the flow
control.
Sequence numbers: Used to keep track of the frames sent and to identify the frames that need
acknowledgment or retransmission.
The Media Access Control (MAC) layer is part of the Data Link Layer and is responsible for managing
how devices on a shared communication medium (such as Ethernet or Wi-Fi) access and share the
transmission medium. It ensures that the devices don't interfere with each other while transmitting data.
There are two primary categories of MAC protocols that manage access to the shared medium:
Random Access protocols are designed for situations where multiple devices share a communication
channel and attempt to transmit at any time, leading to possible collisions. The protocols define how
devices behave when a collision occurs, ensuring the channel is efficiently utilized.
Aloha Protocol:
o One of the earliest random access protocols, originally used in satellite communication.
o Basic Aloha: Devices transmit data at any time. If a collision occurs (i.e., another device transmits at
the same time), the device waits for a random amount of time and retransmits the data.
o Slotted Aloha: This improves on Basic Aloha by dividing the time into discrete slots. Devices can only
transmit at the beginning of a time slot, reducing the chances of a collision.
o Efficiency: The slotted version is more efficient than the basic version, as it reduces the chances of
collisions.
Carrier Sense Multiple Access with Collision Detection (CSMA/CD):
o CSMA/CD is used in Ethernet networks. Before transmitting data, a device listens to the channel to
check if it is idle. If the channel is clear, the device starts transmitting. If a collision is detected (i.e.,
two devices transmit simultaneously), both devices stop transmitting and wait for a random time
before retrying.
o Steps:
1. Carrier Sense: The device listens to the channel to see if it's busy.
2. Multiple Access: Multiple devices can use the same channel.
3. Collision Detection: Devices detect if their transmission collided with another, and if so, they
back off and retry after a random delay.
o Advantages: Simple, and effective in networks with light to moderate traffic.
o Disadvantages: Inefficient under high load, as collisions increase, and the need for retransmissions
grows.
Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA):
o Used in wireless networks (such as Wi-Fi) where collision detection is difficult due to the hidden node
problem (when devices cannot detect each other's signals).
o How it Works:
1. Before sending data, a device listens to the channel and waits for the medium to be idle.
2. It then sends a Request to Send (RTS) signal to the receiver to check if it is available.
3. The receiver responds with a Clear to Send (CTS) signal if the channel is clear.
4. After receiving the CTS, the sender transmits the data.
o Advantages: Reduces collisions, especially in wireless environments.
o Disadvantages: Adds overhead due to RTS/CTS exchange.
Token Passing protocols avoid collisions by using a special "token" that grants permission for a device to
transmit. Only the device holding the token is allowed to transmit, ensuring orderly and collision-free
access to the shared medium.
Access Control Devices can transmit at any time. Only the device with the token can transmit.
Feature Random Access Protocols Token Passing Protocols
Collision Collisions may occur, leading to No collisions, as only one device can transmit at a
Handling retransmissions. time.
Can become inefficient with high traffic due More efficient in high-traffic environments, as
Efficiency
to collisions. collisions are avoided.
These technologies pertain to different types of network architectures and standards that enable
communication between devices. They involve various methods for managing data transmission over
local area networks (LANs) and wide area networks (WANs).
1. Token Ring
Token Ring is a LAN technology developed by IBM in the 1980s, where devices are connected in a
physical or logical ring topology. Data is transmitted in a token-passing manner.
Key Features:
o Topology: Devices are connected in a ring, either physically or logically.
o Access Method: A special "token" circulates the network. Only the device that holds the token can
transmit data.
o Collision-Free: Since only the device with the token can transmit, there are no collisions.
o Data Transfer: Each device checks the token; if the token is not in use, it can send data. After sending
the data, it passes the token to the next device.
o Speed: Typically operates at speeds of 4 Mbps or 16 Mbps.
Advantages:
o No collisions, ensuring a predictable data transfer.
o Suitable for smaller networks where collision-free transmission is necessary.
Disadvantages:
o More complex than Ethernet (especially in handling token loss).
o Slower data rates compared to Ethernet and other more modern technologies.
FDDI is a high-speed LAN technology that uses fiber-optic cables for transmission and follows a
ring topology, similar to Token Ring but with higher data rates.
Key Features:
o Topology: FDDI uses a dual-ring topology, which ensures redundancy; if one ring fails, the other can
take over.
o Data Rate: Typically operates at 100 Mbps and is designed for use in backbone networks and long-
distance connections.
o Fiber Optics: FDDI uses fiber-optic cables, which offer high bandwidth and long-distance transmission
capabilities without the interference associated with electrical transmission.
Advantages:
o High data rate of up to 100 Mbps.
o Greater resistance to electromagnetic interference (EMI) due to the use of fiber-optic cables.
o Redundant ring structure ensures reliability.
Disadvantages:
o More expensive due to the cost of fiber-optic cables.
o Complex setup and maintenance, especially for large-scale networks.
Wireless LANs (Wi-Fi) allow devices to connect to a network without physical cables, typically
using radio waves for communication. Wi-Fi has become one of the most popular methods for
connecting devices to a local area network.
Key Features:
o Topology: Typically operates in a star topology, where devices communicate with an access point (AP)
rather than directly with each other.
o Access Method: CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance) is used for
managing channel access, particularly to avoid collisions in a wireless medium.
o Data Rate: Wi-Fi data rates vary depending on the standard (e.g., IEEE 802.11b, 802.11g, 802.11n,
802.11ac), ranging from 11 Mbps to several Gbps.
o Frequency Bands: Wi-Fi commonly operates in the 2.4 GHz and 5 GHz frequency bands (and recently 6
GHz in Wi-Fi 6).
Advantages:
o Provides flexibility and mobility, as devices can move around within the coverage area.
o Easy to deploy, requiring minimal infrastructure.
Disadvantages:
o Limited range and potential interference from other devices using the same frequency bands.
o Security concerns if not properly configured (e.g., WPA2, WPA3).
4. Bluetooth
Network hardware is crucial for setting up and maintaining reliable communication between devices in a
network. Below are various components found in networking environments:
1. Connectors
Connectors are the physical interfaces used to connect networking cables to network devices (e.g., Ethernet
ports, fiber-optic connectors, etc.). They are essential for making physical connections between devices like
routers, switches, and computers.
o Examples: RJ45 connectors (Ethernet), SC, LC, and ST connectors (fiber-optic).
2. Transceivers
A transceiver is a device that both transmits and receives data over a network. Transceivers convert digital
signals to analog signals for transmission and vice versa.
o Types: Media Access Control (MAC) transceivers, fiber-optic transceivers, and wireless transceivers.
3. Repeaters
Repeaters are used to extend the range of a network by amplifying or regenerating signals. They are
commonly used in wired networks (such as Ethernet) or wireless networks to boost signals that weaken over
long distances.
o Function: Repeaters receive signals, regenerate them, and send them forward to the next network
segment.
4. Hubs
A hub is a basic network device that connects multiple devices in a LAN, typically in a star topology. It
broadcasts data to all connected devices.
o Advantages: Simple and inexpensive.
o Disadvantages: Not efficient for high-traffic networks, as it doesn't manage data traffic or prevent
collisions (due to its broadcasting nature).
A NIC is a hardware component that allows a device (such as a computer or server) to connect to a network. It
provides the physical and data link layer interface for communication.
o Types: Wired NICs (Ethernet NICs), wireless NICs (Wi-Fi cards), fiber-optic NICs.
o Function: NICs are essential for providing devices with an address (MAC address) and enabling
communication within a network.
PC Cards (often called PCMCIA cards) are removable expansion cards that provide network connectivity to
devices like laptops.
o Example: A wireless network card that plugs into a laptop's PC card slot to enable Wi-Fi connectivity.
7. Bridges
A bridge is a device that connects two or more network segments, creating a single, larger network. It
operates at the data link layer (Layer 2) and filters traffic based on MAC addresses.
o Function: Bridges help divide a network into smaller segments to reduce collisions and improve
performance.
8. Switches
A switch is a network device that connects multiple devices within a LAN. It operates at the data link layer
(Layer 2) and makes forwarding decisions based on MAC addresses.
o Function: Unlike hubs, switches create a direct path between communicating devices, reducing
collisions and improving network efficiency.
o Managed vs. Unmanaged: Managed switches allow more control and monitoring, while unmanaged
switches are simple plug-and-play devices.
9. Routers
A router connects multiple networks, often different subnets or LANs, and routes data between them based
on IP addresses (Layer 3).
o Function: Routers direct traffic to the correct network, often involving network address translation
(NAT) and firewall features.
o Internet Access: Routers are typically used to provide internet access to private networks by
connecting to the ISP (Internet Service Provider).
10. Gateways
A gateway is a device that acts as a bridge between two networks that use different communication
protocols. It operates at multiple layers (sometimes Layer 7, the Application Layer).
o Function: Gateways translate data between different communication formats or protocols. For
instance, they can translate data between a local network and the internet or between different
applications.
o Example: A VoIP gateway that translates between the internet protocol and the traditional phone
system.
Component Function
Hubs Basic device that connects multiple devices, broadcasts data to all devices.
PC Cards Removable expansion cards that provide network connectivity to portable devices.
These networking technologies and hardware components play essential roles in ensuring data can be
efficiently transmitted, routed, and managed in both wired and wireless environments.
UNIT-4
The Network Layer (Layer 3) of the OSI model is responsible for the delivery of data packets across
different networks. It handles the logical addressing, routing, and packet forwarding, ensuring that data
is sent from the source to the destination across potentially multiple intermediate devices and networks.
These two methods define how data is transmitted through the network and how the network layer
handles communication between devices.
Virtual Circuits
A Virtual Circuit (VC) is a logical path established between two endpoints for the duration of a session.
In this approach, a connection is created between the sender and receiver before data transmission
begins, and all packets follow the same predetermined path through the network.
Characteristics:
o Connection-Oriented: A connection is established before data transfer starts.
o Path Predefined: The path is fixed for the duration of the communication session.
o Reliability: Virtual circuits ensure reliable delivery since all packets follow the same route, and the
network can detect and recover from errors.
o Packet Order: Since all packets follow the same route, packet order is maintained.
How It Works:
o Connection Setup: Before transmission, a path is determined, and a virtual circuit is established
between the source and destination.
o Data Transmission: Data packets are sent along this predefined path.
o Connection Teardown: Once the data has been delivered, the connection is torn down.
Advantages:
o Reliable and orderly communication.
o Easier to manage in terms of error correction and congestion control.
Disadvantages:
o Overhead due to connection establishment and teardown.
o Not flexible, as the path is fixed.
Example: Frame Relay and ATM (Asynchronous Transfer Mode) are examples of network
technologies that use virtual circuits.
Datagrams
A Datagram is a self-contained, independent packet that contains both the destination address and all
necessary information to be routed to its destination. Unlike virtual circuits, datagrams are sent
independently, and each packet can take a different path to reach its destination.
Characteristics:
o Connectionless: There is no need to establish a connection before sending data.
o Independent Packets: Each packet is routed individually and may take a different path.
o No Guarantee of Delivery: Packets may be lost, and the network doesn't provide guarantees for
delivery or order.
o Flexibility: The network can handle dynamic routing and adjust the path for each packet based on
current conditions (e.g., congestion, network failures).
How It Works:
o Each data packet is treated independently, containing all the information necessary for routing.
o The packet is forwarded by routers toward the destination, with each router making a decision on the
best path at the time of forwarding.
Advantages:
o Simple and efficient, with no need for connection setup or teardown.
o Flexible, as packets can take different paths depending on network conditions.
Disadvantages:
o No guarantee of packet delivery or order.
o More complex error handling, as the sender must be responsible for retransmitting lost packets.
Example: IP (Internet Protocol) is a typical example of a datagram-based service in the Internet.
2. Routing Algorithms
Routing is the process of determining the optimal path for data packets to travel across a network. There
are several algorithms used to compute the best paths in networks, each with its strengths and
weaknesses.
Flooding
Flooding is the simplest routing technique, where a packet is sent to every device in the network. When a
router or node receives a packet, it forwards the packet to all its neighbors (except the one it came from),
essentially "flooding" the network with copies of the packet.
How It Works:
o When a packet enters a router or network node, it is sent to all other connected nodes.
o Each router repeats the process and sends the packet to all its neighboring routers until it reaches the
destination.
Advantages:
o Simple to implement.
o It doesn't require prior knowledge of the network topology, so it's robust to changes in the network.
Disadvantages:
o Inefficiency: Flooding can cause redundancy and congestion since many copies of the same packet are
sent.
o Waste of Resources: It can overwhelm the network and devices with unnecessary traffic.
o No Loop Prevention: Without a mechanism to track already visited nodes, flooding can cause infinite
loops.
Use Cases:
o Routing in very dynamic or unknown topologies.
o Broadcasting in small, controlled environments.
Shortest Path Routing
Shortest Path Routing aims to find the optimal route from the source to the destination, typically using a
cost metric (e.g., distance, time, or bandwidth). The path chosen is the one with the minimum "cost"
from the source to the destination.
1. Dijkstra's Algorithm
o Dijkstra’s Algorithm is one of the most widely used shortest path algorithms. It calculates the shortest
path from a source node to all other nodes in the network by iteratively selecting the node with the
smallest tentative distance and updating its neighbors.
o How It Works:
1. Assign tentative distances to all nodes: set the distance to the source node as 0 and the
distance to all other nodes as infinity.
2. Mark all nodes as unvisited. Select the node with the smallest tentative distance.
3. For the current node, calculate the tentative distance for its neighbors. If the calculated
distance is smaller than the current assigned value, update it.
4. Mark the node as visited once its neighbors have been processed, and continue to the next
node with the smallest tentative distance.
5. Repeat the process until all nodes are visited.
o Advantages:
Guaranteed to find the shortest path.
Works well for both large and small networks.
o Disadvantages:
Computationally expensive in large networks.
Requires the entire topology to be known upfront.
2. Bellman-Ford Algorithm
o Bellman-Ford is another algorithm for finding the shortest paths in a network, particularly useful in
networks where link costs can change dynamically or are negative.
o How It Works:
0. Initialize the distance to the source node as 0 and all other nodes as infinity.
1. Relax all edges (i.e., update the tentative distances) repeatedly for all nodes. This process is
repeated for the number of nodes minus one.
2. The algorithm checks for negative weight cycles by performing an additional iteration to
ensure that no further updates are possible.
o Advantages:
Can handle negative weights, unlike Dijkstra's algorithm.
Works well in dynamic networks where link costs can change.
o Disadvantages:
Slower than Dijkstra’s algorithm for large networks.
3. Link-State Routing (e.g., OSPF)
o Link-State Routing is a more advanced technique where each router maintains a complete map of the
network topology.
o Each router periodically sends a Link-State Advertisement (LSA) to all other routers, allowing them to
build a consistent view of the network and compute the best routes using Dijkstra’s algorithm.
o Advantages:
Efficient and fast convergence.
Can handle large, dynamic networks.
o Disadvantages:
Requires more memory and processing power due to the need to store the entire network
topology.
4. Distance Vector Routing (e.g., RIP)
o Distance Vector Routing algorithms determine the best path by exchanging information with
neighboring routers, based on a vector of distances (usually hops) to various destination nodes.
o Example: Routing Information Protocol (RIP) uses a distance-vector approach, where routers
periodically share their routing tables with neighbors.
o Advantages:
Simple and easy to implement.
Suitable for smaller networks.
o Disadvantages:
Slower convergence and the possibility of routing loops.
Less scalable for large networks.
Summary:
Concept Description
Virtual Circuits A connection-oriented approach where a logical path is established before data transmission.
A connectionless approach where each packet is sent independently, potentially via different
Datagrams
paths.
A routing technique where packets are broadcast to all devices in the network. Inefficient but
Flooding
robust.
A routing approach where the best path is determined by minimizing a cost metric (e.g.,
Shortest Path Routing
distance or time).
Dijkstra’s Algorithm A shortest-path algorithm that iteratively selects the node with the smallest tentative distance.
Bellman-Ford
A shortest-path algorithm that works with negative edge weights and uses edge relaxation.
Algorithm
A routing approach where each router has a complete view of the network and uses
Link-State Routing
algorithms like Dijkstra’s.
Distance Vector A simpler routing approach where routers share distance vectors with neighbors to determine
Routing the best route.
Distance Vector Routing is a type of routing protocol in which each router maintains a table (or vector)
containing the cost of reaching every possible destination in the network. The routers periodically share
these tables with their immediate neighbors to update their own routing tables. This approach works
based on the idea that each router knows the distance to every other router in the network and the next-
hop router to get there.
How Distance Vector Routing Works:
1. Routing Table: Each router maintains a table that lists the best known distance (in terms of hops or cost) to
reach each destination.
2. Distance Updates: Routers periodically share their routing tables with their neighboring routers. This is known
as the "exchange of distance vectors."
3. Path Updates: After receiving routing tables from neighbors, each router updates its table based on the new
information, choosing the shortest or lowest-cost path to each destination.
4. Bellman-Ford Algorithm: This algorithm is often used in Distance Vector Routing. It calculates the shortest
path to each destination by iteratively updating the distance vector.
Key Features:
Routing Metric: Typically uses hop count (number of routers between source and destination) or other
metrics (such as cost or delay).
Periodic Updates: Routers send periodic updates (e.g., every 30 seconds) to their neighbors, even if no
changes have occurred.
Slow Convergence: It can be slow to adapt to changes in the network, especially when network topology
changes (e.g., links go down).
Routing Loops: Without safeguards, such as split horizon or poison reverse, routing loops can occur.
Advantages:
Disadvantages:
Slow convergence.
Can suffer from routing loops.
Less scalable for large networks.
Example Protocols:
RIP (Routing Information Protocol): Uses Distance Vector Routing with hop count as the routing metric.
2. Link-State Routing
Link-State Routing is a more sophisticated routing method where each router shares its view of the
network (or "link state") with all other routers in the network. Unlike Distance Vector Routing, which
uses periodic updates, Link-State Routing routers share information about the state of their directly
connected links and the costs associated with those links.
1. Link-State Database: Each router sends information about its directly connected links (e.g., cost, bandwidth,
and state) to all other routers in the network.
2. Flooding: This information is broadcast to all routers in the network using a process called flooding, ensuring
all routers have an identical view of the network.
3. Shortest Path Calculation: After receiving the link-state information, routers use Dijkstra’s Algorithm to
compute the shortest path from the source router to all other routers based on the link-state information.
Key Features:
Complete Topological View: Each router has a complete map of the network.
Faster Convergence: Link-State Routing converges faster than Distance Vector Routing, as routers don’t need
to wait for periodic updates.
Complexity: Requires more resources (memory and CPU power) to store the topology and calculate the best
paths.
Advantages:
Disadvantages:
Example Protocols:
OSPF (Open Shortest Path First): A common Link-State Routing protocol used in large IP networks.
IS-IS (Intermediate System to Intermediate System): Another Link-State protocol used mainly in large
enterprise and service provider networks.
3. Hierarchical Routing
Hierarchical Routing is used to manage routing in large-scale networks by dividing the network into
smaller, more manageable segments (or regions). This reduces the size of routing tables and enhances
scalability and efficiency. Routers in different regions or hierarchies handle local routing, while inter-
region routing is handled by higher-level routers.
1. Network Division: The network is divided into domains or areas (like regions). Within each area, routers only
need to know the local network topology.
2. Area Border Routers (ABRs): Routers that sit at the border of an area handle traffic between different regions
or areas. They summarize the routes in the area and advertise this summarized information to the rest of the
network.
3. Two-Level Structure: The two-level structure consists of an Interior Gateway Protocol (IGP) to manage routing
within an area and an Exterior Gateway Protocol (EGP) to handle routing between different areas or
autonomous systems.
4. Reduced Overhead: Hierarchical routing reduces the amount of information exchanged between routers, as
routers within the same area don’t need to exchange full network topology information with all other routers.
Key Features:
Scalability: Suitable for large networks as it reduces the complexity of routing tables.
Aggregation of Routes: Routers advertise only summarized routes to distant routers, reducing overhead.
Advantages:
Disadvantages:
Example Protocols:
Congestion in a network occurs when the demand for resources exceeds the available capacity, leading to
delays, packet loss, and degraded performance. Congestion Control Algorithms are mechanisms designed
to detect and manage congestion to ensure that the network operates efficiently.
How It Works:
o Slow Start: Initially, the sender begins with a small congestion window and gradually increases the
sending rate until packet loss occurs (indicating congestion).
o Congestion Avoidance: After slow start, the sending rate is increased more slowly to avoid
overwhelming the network.
o Fast Retransmit and Fast Recovery: When packet loss is detected, the sender retransmits the lost
packet and reduces the sending rate to alleviate congestion.
2. Network-Assisted Congestion Control:
o The network provides feedback about congestion (e.g., through explicit congestion notification or
ECN), and routers or switches actively signal congestion to senders to adjust their transmission rate.
o Explicit Congestion Notification (ECN): Routers mark packets to indicate congestion instead of
dropping them, allowing the sender to reduce its rate before packet loss occurs.
3. Traffic Shaping:
o Traffic shaping is used to smooth out bursts of traffic that might otherwise cause congestion. This
involves controlling the flow of data into the network to ensure that the transmission rate does not
exceed the network's capacity.
o Leaky Bucket Algorithm and Token Bucket Algorithm are common traffic shaping techniques.
Key Features:
Flow Control: Ensures that traffic flow is managed and kept within network limits.
Feedback Mechanisms: Routers or endpoints provide feedback to manage congestion.
Rate Limiting: Traffic flow is limited to prevent network overload.
Advantages:
Disadvantages:
Example Protocols:
TCP Congestion Control (includes Slow Start, Congestion Avoidance, Fast Retransmit, Fast Recovery).
Explicit Congestion Notification (ECN).
Differentiated Services (DiffServ): A QoS (Quality of Service) model to manage network traffic.
Summary of Concepts:
Concept Description
Distance Vector Each router exchanges routing tables with neighbors; slower convergence, but simple to
Routing implement.
Each router floods link-state information to all routers, which then compute the best paths
Link-State Routing
using Dijkstra’s algorithm.
Hierarchical Routing Divides a network into areas or domains to reduce overhead and improve scalability.
Algorithms that prevent network congestion by controlling the rate of data flow and adjusting
Congestion Control
traffic based on feedback.
On the other hand, Network Security involves protecting the integrity, confidentiality, and availability of
data and resources within a network. This includes addressing potential security threats and employing
strategies such as encryption, authentication, and key management techniques to ensure secure
communication.
1. Internetworking
Internetworking enables communication between multiple computer networks, which may use different
technologies and protocols. It involves the use of routers, gateways, and protocol translation to
interconnect different types of networks, such as Local Area Networks (LANs), Wide Area Networks
(WANs), and the Internet.
1. Routers: Devices that determine the best path for data to travel across networks. They operate at
the Network Layer (Layer 3) of the OSI model.
2. Gateways: Devices that act as bridges between two different networks, often operating at multiple
layers of the OSI model. They provide protocol translation, allowing different types of networks to
communicate with each other.
3. Protocols: Different networks may use different protocols (e.g., TCP/IP, Ethernet, ATM, etc.).
Internetworking protocols ensure that communication is seamless across networks.
4. IP Addressing and Subnetting: Each device on an internetwork is assigned an IP address, which
helps route data across networks. Subnetting divides an IP address into multiple sub-networks to
optimize routing and management.
5. NAT (Network Address Translation): A method used by routers and gateways to map private IP
addresses in a local network to public IP addresses on the Internet.
Network security threats can be categorized into several types, each posing unique risks to the
confidentiality, integrity, and availability of data. Common threats include unauthorized access, data
interception, malware, denial of service, and more.
1. Unauthorized Access: When an attacker gains access to a network or system without permission.
This can lead to data theft, manipulation, or destruction.
2. Data Interception: The unauthorized capture of data as it travels across a network. This can occur
in the form of man-in-the-middle attacks (MITM), where attackers intercept and potentially alter
communications between devices.
3. Malware: Malicious software designed to damage, disrupt, or gain unauthorized access to systems.
Types include viruses, worms, Trojan horses, and ransomware.
4. Denial of Service (DoS): Attacks designed to make a network or service unavailable to users by
overwhelming the network with traffic or requests. Distributed Denial of Service (DDoS) attacks
amplify this threat by using multiple sources to flood the network.
5. Phishing and Social Engineering: Attacks that trick individuals into revealing sensitive
information like passwords or credit card numbers through deceptive messages or websites.
6. Eavesdropping and Sniffing: The unauthorized monitoring of network traffic, often to capture
sensitive data such as passwords, emails, or credit card details.
7. Replay Attacks: Involves the attacker capturing and retransmitting legitimate data to trick
systems into performing actions they wouldn’t otherwise.
3. Encryption Methods
Encryption is a fundamental technique used to secure data in transit and at rest by converting plaintext
into unreadable ciphertext. Encryption ensures that even if data is intercepted, it remains confidential.
Types of Encryption:
1. Symmetric-Key Encryption:
o Definition: In symmetric encryption, the same key is used for both encryption and decryption of data.
o How It Works: A sender encrypts the data with a shared secret key, and the recipient uses the same
key to decrypt the data.
o Advantages: Fast and efficient, especially for large datasets.
o Disadvantages: The major challenge is secure key distribution, as both the sender and the receiver
must have the same key.
o Examples:
AES (Advanced Encryption Standard): A widely used symmetric-key encryption algorithm.
DES (Data Encryption Standard): An older symmetric encryption standard, now considered
insecure due to its short key length.
2. Asymmetric-Key Encryption:
o Definition: Uses a pair of keys (public and private) for encryption and decryption. The public key is
used for encryption, and the private key is used for decryption.
o How It Works: The sender encrypts data with the receiver’s public key, and the receiver decrypts it
with their private key.
o Advantages: Solves the key distribution problem, as the public key can be shared openly.
o Disadvantages: Computationally slower than symmetric encryption.
o Examples:
RSA (Rivest-Shamir-Adleman): A widely used public-key encryption algorithm.
ECC (Elliptic Curve Cryptography): A modern asymmetric encryption technique that uses
smaller key sizes for the same level of security.
3. Hybrid Encryption:
o Definition: A combination of symmetric and asymmetric encryption methods. Typically, asymmetric
encryption is used to securely exchange a symmetric key, which is then used for the actual data
encryption.
o How It Works: The sender uses the recipient's public key to encrypt a symmetric key, which is then
used to encrypt the actual data. The recipient uses their private key to decrypt the symmetric key and
then uses it to decrypt the data.
o Examples: TLS (Transport Layer Security) uses hybrid encryption to secure internet communications.
4. Authentication
Authentication is the process of verifying the identity of a user, device, or system, ensuring that only
authorized entities can access network resources. Authentication methods ensure that users are who they
claim to be.
1. Password-Based Authentication:
o Users provide a secret password, which is matched against a stored password to grant access. It is the
most common form of authentication but also prone to weaknesses like password guessing and
phishing.
2. Two-Factor Authentication (2FA):
o Combines two separate methods of authentication, typically something you know (password) and
something you have (e.g., a smartphone app or hardware token).
o Examples:
SMS-based 2FA: A one-time password (OTP) sent to the user's phone.
App-based 2FA: Uses an app (like Google Authenticator or Authy) to generate time-based
codes.
3. Biometric Authentication:
o Uses unique physical characteristics for authentication, such as fingerprints, face recognition, or iris
scans.
o Advantages: Difficult to replicate, providing a high level of security.
4. Public Key Infrastructure (PKI):
o PKI uses asymmetric cryptography for authentication, with digital certificates issued by a trusted
Certificate Authority (CA).
o How It Works: Users authenticate using private keys, which are matched against a public key stored in
a certificate.
5. Symmetric-Key Encryption
Symmetric-Key Encryption is one of the most commonly used encryption methods. As mentioned earlier,
it involves the use of a single key for both encryption and decryption.
Key Generation: A secret key is generated, which both the sender and receiver use.
Encryption: The sender encrypts the plaintext using the key.
Decryption: The receiver decrypts the ciphertext using the same key to recover the plaintext.
Key Distribution: The biggest challenge with symmetric encryption is securely distributing the shared key
between parties, as anyone with the key can decrypt the data.
Summary
Concept Description
Network Security Risks such as unauthorized access, data interception, malware, DDoS, phishing, eavesdropping,
Threats and replay attacks.
Encryption Methods Techniques to secure data by converting plaintext into unreadable ciphertext (Symmetric and
Concept Description
Asymmetric encryption).
Verifying the identity of users or devices using methods like passwords, 2FA, biometrics, and
Authentication
PKI.
Symmetric-Key A single key is used for both encryption and decryption, fast but requiring secure key
Encryption management.