0% found this document useful (0 votes)
5 views9 pages

Topic Wise Notes For Computer Network

The document covers key concepts in computer networking, focusing on reliable data transfer, congestion control, multiplexing, demultiplexing, router structure, queuing, traffic shaping, and switching fabrics. It explains the importance of reliable data transfer for applications like file transfer and email, and outlines TCP's mechanisms for ensuring data integrity. Additionally, it discusses congestion control algorithms in TCP, the functions of multiplexing and demultiplexing in the transport layer, and the internal structure and operation of routers.

Uploaded by

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

Topic Wise Notes For Computer Network

The document covers key concepts in computer networking, focusing on reliable data transfer, congestion control, multiplexing, demultiplexing, router structure, queuing, traffic shaping, and switching fabrics. It explains the importance of reliable data transfer for applications like file transfer and email, and outlines TCP's mechanisms for ensuring data integrity. Additionally, it discusses congestion control algorithms in TCP, the functions of multiplexing and demultiplexing in the transport layer, and the internal structure and operation of routers.

Uploaded by

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

Topic Wise Notes for Computer Network

Reliable Data Transfer Principles


What is Reliable Data Transfer?

Reliable data transfer ensures that data is delivered accurately and in the correct order from
sender to receiver, even when the underlying network is unreliable. This is essential for many
applications (e.g., file transfer, email) that cannot tolerate data loss, corruption, or duplication.

Where is it Used?

Implemented in transport protocols:

 TCP (Transmission Control Protocol): provides reliable data transfer.


 UDP (User Datagram Protocol): does not provide reliability—used where speed is more
critical than accuracy (e.g., live streaming).

Key Principles

1. Acknowledgments (ACKs):
Receiver sends an ACK when it receives a segment correctly.
2. Negative Acknowledgments (NAKs):
Receiver requests retransmission if it detects an error (e.g., via checksum). Not
commonly used in TCP.
3. Checksums:
Sender adds a checksum to the segment; the receiver verifies it to detect bit errors.
4. Sequence Numbers:
Used to order segments and detect duplicates.
5. Timeouts and Retransmissions:
If no ACK is received within a certain time (timeout), the sender retransmits the segment.
6. Pipelining (Go-Back-N, Selective Repeat):
Multiple segments are sent before waiting for ACKs to increase efficiency.

Example

Let’s say Host A is sending a file to Host B:

1. Host A segments the file and numbers the segments (1, 2, 3, ...).
2. Host B receives segment 1, sends ACK 1.
3. If segment 2 is lost, Host B does not send ACK 2.
4. After timeout, Host A retransmits segment 2.
Congestion Control Algorithms
What is Congestion?

Congestion occurs when too much data is injected into the network, causing queue buildup,
packet loss, and long delays.

Why is Congestion Control Important?

Without congestion control:

 Routers may drop packets due to full buffers.


 Network resources get overused.
 TCP sessions slow down, leading to poor application performance.

How TCP Handles Congestion

TCP dynamically adjusts its sending rate using the congestion window (cwnd) and various
algorithms.

Core Congestion Control Algorithms

1. Slow Start

 Starts with a small congestion window (usually 1 MSS).


 Doubles cwnd every RTT (exponential growth).
 Continues until a threshold is reached or packet loss occurs.

2. Congestion Avoidance

 After reaching threshold, cwnd grows linearly to avoid congestion.

3. Fast Retransmit

 If three duplicate ACKs are received, the segment is considered lost and is retransmitted
immediately (before timeout).

4. Fast Recovery

 Instead of going back to slow start, TCP reduces cwnd and continues in congestion
avoidance mode.
Example Scenario

1. TCP connection starts:


o cwnd = 1 MSS.
2. After 1 RTT, ACK is received → cwnd = 2 MSS.
3. Next RTT, cwnd = 4 MSS (exponential growth).
4. At cwnd = 16 MSS, a packet is lost → 3 duplicate ACKs received.
5. Fast retransmit is triggered → cwnd halved to 8 MSS.
6. Enters congestion avoidance → cwnd increases linearly.

Impact Without Congestion Control

Imagine 100 users stream HD video simultaneously:

 If each floods the network, routers get overwhelmed.


 Packets drop → retransmissions → more congestion → vicious cycle.

With congestion control:

 Each user’s TCP limits sending rate.


 Network load stays within capacity.

Comparison of Reliable Data Transfer and Congestion Control

Feature Reliable Data Transfer Congestion Control


Goal Ensure data integrity & order Avoid overwhelming the network
ACKs, checksums, sequence
Main Techniques cwnd, slow start, fast retransmit
numbers
Protocols Using It TCP TCP
Example Use Case File transfer Video streaming, bulk data uploads
What is Multiplexing and Demultiplexing?
These are two key functions of the transport layer that allow multiple applications to use the
network simultaneously and correctly.

Multiplexing

Multiplexing at the sender side involves:

 Combining data from multiple application processes.


 Adding a header (with source and destination port numbers).
 Sending the segment to the network layer.

Purpose: Allow multiple applications (like browser, email client, file transfer) to share a single
network connection (like one IP address).

Demultiplexing

Demultiplexing at the receiver side involves:

 Examining the destination port number in each segment.


 Delivering the data to the correct application process.

Purpose: Make sure that incoming data reaches the correct application.

Example: Real-Life Analogy


Imagine you live in an apartment (IP address) with multiple residents (applications). Each
resident has a mailbox slot with a unique number (port number).

 Sender side (multiplexing): The post office (transport layer) collects all letters from
different people (applications) and places them into one truck (network connection).
 Receiver side (demultiplexing): At the apartment building, the doorman (transport
layer) checks the mailbox number on each letter and puts it into the correct resident's
mailbox.
Technical Example
Let's say you are using a browser and an email app at the same time.

Application Protocol Port Number


Web Browser HTTP 80
Email Client SMTP 25

Sender Side (Multiplexing):

1. Web browser sends an HTTP request.


2. Email app sends an SMTP email.
3. The transport layer adds headers with destination port numbers:
o HTTP segment → destination port 80
o SMTP segment → destination port 25
4. Both segments are sent to the destination IP.

Receiver Side (Demultiplexing):

1. Destination computer receives both segments.


2. Transport layer checks the destination port number:
o Segment with port 80 → delivered to web server application.
o Segment with port 25 → delivered to mail server application.

Why is This Important?


 Enables concurrent network communication for multiple applications.
 Prevents data from going to the wrong application.
 Uses port numbers to identify applications:
o Well-known ports (0–1023): HTTP (80), FTP (21), DNS (53)
o Ephemeral ports (1024–65535): Temporary ports for client-side apps

Summary
Function Description
Multiplexing Combines data from multiple applications (sender)
Demultiplexing Directs incoming data to correct application (receiver)
Key Mechanism Uses port numbers in transport layer header
Example Web (port 80), Email (port 25), both using same IP
Internal Structure of a Router
A router is a specialized networking device that forwards data packets between computer
networks. Internally, a router consists of control plane and data plane components.

1. Data Plane (Forwarding Plane)

The data plane is responsible for forwarding packets from an incoming interface to the
appropriate outgoing interface.

Key Components:

 Input Ports:
o Receive incoming packets from connected devices/networks.
o Perform basic checks and lookup the destination address.
o Use a forwarding table to determine where the packet should go next.
 Switching Fabric:
o The internal interconnection network that moves packets from input ports to
output ports.
o Can be:
 Bus-based
 Crossbar switch
 Shared memory
 Output Ports:
o Buffer the packets received from the switching fabric.
o Schedule and send them onto the correct outbound link.
o Apply queuing and traffic shaping if needed.

Key Function:

Efficient, fast, and correct forwarding of packets—typically done in hardware (ASICs) for speed.

2. Control Plane

The control plane determines the routing decisions — how the forwarding table is built and
maintained.

Key Components:

 Routing Processor (CPU):


o Runs routing algorithms and protocols (e.g., OSPF, BGP, RIP).
o Maintains and updates the routing table (longest prefix matching).
o Handles management and administrative tasks.
 Routing Table:
o Contains the best paths to all known networks.
o Created dynamically by routing protocols or manually configured (static routes).
 Forwarding Table:
o A simplified, high-speed version of the routing table.
o Used by the data plane to make fast forwarding decisions.

Flow of a Packet through a Router

1. Packet arrives at input port.


2. Input port checks destination IP and looks it up in the forwarding table.
3. Packet is passed through the switching fabric to the appropriate output port.
4. Output port queues and sends the packet to the next hop.

Example

Imagine a router with 4 interfaces:

 Input Port 1 receives a packet destined for [Link].


 Routing processor has a route for [Link]/24 → Interface 3.
 Input Port 1 forwards the packet to Output Port 3 via switching fabric.
 Output Port 3 sends the packet to the next router or device.

Summary of Router Components


Component Function
Input Ports Packet reception, initial processing
Switching Fabric Transfers packets inside the router
Output Ports Queuing and transmission of packets
Routing Processor Runs routing protocols, maintains routing table
Forwarding Table Used for quick packet forwarding decisions

Without Efficient Design

If any of the internal parts (e.g., input buffering, switching speed, output queuing) are inefficient
or overloaded, it can lead to:

 Congestion
 Packet loss
 High latency
Queuing
What is Queuing?

Queuing refers to the process of temporarily storing packets in memory (called queues) when
the outgoing link is busy or congested.

Why is it Important?

 Prevents packet loss when traffic exceeds link capacity.


 Helps manage traffic bursts.
 Determines which packets go out first (scheduling).

Types of Queuing:

1. First-In First-Out (FIFO):


o Packets are served in the order they arrive.
o Simple but doesn't differentiate between packet types.
2. Priority Queuing:
o Assigns priority levels to packets.
o High-priority traffic (e.g., voice) is served before others.
3. Weighted Fair Queuing (WFQ):
o Fairly shares bandwidth among multiple traffic flows.
o Each flow gets a portion based on weight.

Example:

If many packets are trying to leave through one interface at once, a queue builds up. If the queue
fills, additional packets are dropped or delayed.

Traffic Shaping
What is Traffic Shaping?

Traffic shaping is a technique used to control the rate of traffic sent into the network to ensure
smooth and predictable transmission.

Why is it Important?

 Prevents network congestion.


 Ensures compliance with agreed bandwidth limits (e.g., by ISPs).
 Improves QoS (Quality of Service) for time-sensitive applications like video and voice.
How it Works:

 Uses token bucket or leaky bucket algorithms.


 Delays packets to smooth out bursts and maintain a steady data rate.

Example:

A video streaming service sends data at a controlled rate so it doesn’t overload the viewer's
network or compete aggressively with other apps.

Switching Fabrics
What is a Switching Fabric?

Switching fabric is the internal interconnection mechanism in a router or switch that moves
packets from input ports to output ports.

Why is it Important?

 Affects how fast and efficiently packets move through the device.
 A bottleneck in the switching fabric limits overall performance.

Types of Switching Fabrics:

1. Bus-based Switching:
o All ports share a single internal data bus.
o Simple but low throughput.

2. Crossbar Switching:
o Uses a matrix to directly connect input to output ports.
o Supports multiple simultaneous transfers.

3. Shared Memory:
o Packets are written to and read from a shared memory block.
o Efficient for small-scale switches.

Example:

In a high-performance router, the switching fabric must handle multiple packets simultaneously
without delays—just like a busy train station routing passengers from different platforms to their
destinations.

You might also like