0% found this document useful (0 votes)
5 views

Computer Network Handwritten Notes

The document provides an overview of computer networks, detailing their definitions, uses, types (LAN, WAN, MAN, PAN), and reference models (TCP/IP and OSI). It explains the architecture of the internet, the physical layer, and the data link layer, including error detection, correction, and multiple access protocols. Additionally, it covers the network layer's responsibilities, including routing, addressing, and packet forwarding.
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 views

Computer Network Handwritten Notes

The document provides an overview of computer networks, detailing their definitions, uses, types (LAN, WAN, MAN, PAN), and reference models (TCP/IP and OSI). It explains the architecture of the internet, the physical layer, and the data link layer, including error detection, correction, and multiple access protocols. Additionally, it covers the network layer's responsibilities, including routing, addressing, and packet forwarding.
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
You are on page 1/ 17

UNIT - I: Introduction to Networks and Physical Layer

Introduction to Networks

What is a Network?

A network is a group of computers or devices connected to share information, resources,


or services. For example, when you use the internet or share files between computers,
you're using a network.

• Example: Your home Wi-Fi connects your phone, laptop, and TV to the internet.

Uses of Networks

Networks are used for many purposes, such as:

1. Sharing Resources: Share printers, files, or internet connections.

2. Communication: Send emails, make video calls, or chat.

3. Accessing Information: Browse websites or access cloud storage.

4. Entertainment: Stream movies, play online games.

5. Business Operations: Connect employees, manage databases, or process online


payments.

Types of Networks

Networks can be classified based on their size and purpose:

1. LAN (Local Area Network):

o Covers a small area, like a home, office, or school.

o Example: Wi-Fi in your house.

2. WAN (Wide Area Network):

o Covers a large area, like cities or countries.

o Example: The internet or a company’s global network.

3. MAN (Metropolitan Area Network):

o Covers a city or campus.

o Example: A university’s network connecting multiple buildings.

4. PAN (Personal Area Network):


o Covers a very small area, like your personal devices.

o Example: Bluetooth connection between your phone and earbuds.

Reference Models

TCP/IP Model

The TCP/IP Model is a framework that describes how data is sent and received over the
internet. It has four layers:

1. Application Layer: Handles user applications (e.g., web browsers, email).

o Example: HTTP for websites.

2. Transport Layer: Ensures reliable data delivery (e.g., TCP for reliability, UDP for
speed).

o Example: TCP ensures your email reaches the recipient correctly.

3. Internet Layer: Routes data packets across networks (e.g., IP for addressing).

o Example: IP decides the path for your data to reach a website.

4. Link Layer: Handles physical connections and data transfer between devices.

o Example: Ethernet for wired connections or Wi-Fi.

OSI Model

The OSI Model (Open Systems Interconnection) is a theoretical model with seven layers to
explain how networks work:

1. Application Layer: Provides services for user applications (e.g., email, web
browsing).

2. Presentation Layer: Formats and encrypts data (e.g., converts text to a displayable
format).

3. Session Layer: Manages communication sessions between devices (e.g., keeps a


video call active).

4. Transport Layer: Ensures reliable data transfer (e.g., checks if data is received
correctly).

5. Network Layer: Routes data between networks (e.g., finds the best path for data).
6. Data Link Layer: Handles error-free data transfer between adjacent devices (e.g.,
Ethernet).

7. Physical Layer: Deals with physical connections (e.g., cables, signals).

Comparison of OSI and TCP/IP Models

Feature OSI Model TCP/IP Model

Number of Layers 7 layers 4 layers

Purpose Theoretical, general framework Practical, used in the internet

Complexity More complex (more layers) Simpler (fewer layers)

Usage Used for teaching and reference Used in real-world networking

Examples Describes all networks Used by the internet (e.g., IP, TCP)

• Key Difference: OSI is a detailed, theoretical model, while TCP/IP is a practical


model used in real networks like the internet.

Architecture of the Internet

The internet is a global network of networks that connects billions of devices. Its
architecture is based on:

• Decentralized Design: No single control point; networks are interconnected.

• Protocols: Rules like TCP/IP ensure devices communicate correctly.

• Layers: Uses the TCP/IP model to handle data from applications to physical
connections.

• Components:

o Devices: Computers, phones, servers.

o Routers: Direct data between networks.

o ISPs: Internet Service Providers connect users to the internet.

o Backbone Networks: High-speed networks that form the internet’s core.

Physical Layer

What is the Physical Layer?


The Physical Layer is the lowest layer of the OSI model (or Link Layer in TCP/IP). It deals
with the physical connection between devices, including cables, signals, and hardware.

• Role: Transmits raw bits (0s and 1s) over a medium (like cables or wireless signals).

• Example: Sending a signal through a Wi-Fi antenna or an Ethernet cable.

Guided Transmission Media

Guided transmission media are physical cables that carry signals. Common types
include:

1. Twisted Pair Cable:

o Two wires twisted together to reduce interference.

o Example: Used in Ethernet cables (e.g., Cat5, Cat6) for LANs.

o Pros: Cheap, widely used.

o Cons: Limited distance, prone to interference.

2. Coaxial Cable:

o A central conductor surrounded by a shield.

o Example: Used for cable TV and internet.

o Pros: Better shielding, longer distances.

o Cons: Bulky, more expensive.

3. Fiber Optic Cable:

o Uses light to transmit data through glass or plastic fibers.

o Example: Used for high-speed internet and long-distance connections.

o Pros: Very fast, long distances, immune to electromagnetic interference.

o Cons: Expensive, harder to install.

Wireless Transmission Media

Wireless transmission media use electromagnetic waves to send data without cables.
Common types include:

1. Radio Waves:

o Used for Wi-Fi, Bluetooth, and mobile networks (e.g., 4G, 5G).
o Example: Your phone connects to Wi-Fi using radio waves.

o Pros: Wide coverage, easy to use.

o Cons: Can be blocked by walls, interference from other devices.

2. Microwaves:

o Used for point-to-point communication (e.g., satellite links).

o Example: Satellite TV uses microwaves.

o Pros: Long-distance, high bandwidth.

o Cons: Needs line-of-sight, affected by weather.

3. Infrared:

o Used for short-range communication (e.g., TV remotes).

o Example: Your remote sends signals to your TV.

o Pros: Simple, low power.

o Cons: Short range, blocked by obstacles.

Switching

Switching is the process of directing data from one device to another in a network. It
happens at the Physical or Data Link Layer. Common types include:

1. Circuit Switching:

o Creates a dedicated path between two devices for the entire


communication.

o Example: Traditional telephone calls.

o Pros: Reliable, no delays once connected.

o Cons: Inefficient for short or bursty data.

2. Packet Switching:

o Breaks data into small packets and sends them independently, reassembling
at the destination.

o Example: The internet uses packet switching.

o Pros: Efficient, flexible, handles many connections.


o Cons: Possible delays or packet loss.

3. Message Switching:

o Sends entire messages as a single unit, storing and forwarding them.

o Example: Rarely used today but was used in early telegraph systems.

o Pros: No need for a dedicated path.

o Cons: Slow, not suitable for real-time data.

UNIT - II: Data Link Layer and Multiple Access Protocols

Data Link Layer

What is the Data Link Layer?

The Data Link Layer is the second layer in the OSI model (or part of the Link Layer in
TCP/IP). It ensures reliable data transfer between two directly connected devices (e.g., two
computers on the same network).

• Role: Takes raw bits from the Physical Layer, organizes them into frames (data
packets), and handles errors, flow control, and access to the shared medium.

• Example: When your laptop sends data over Wi-Fi to a router, the Data Link Layer
makes sure the data arrives correctly.

Design Issues

The Data Link Layer addresses several challenges:

1. Framing:

o Groups bits into frames (like packets) with a start and end marker.

o Example: Adds headers and trailers to data to mark the frame’s boundaries.

2. Error Detection and Correction:

o Checks for errors in received frames and fixes them if possible.

o Example: Detects if bits were flipped during transmission.


3. Flow Control:

o Prevents a fast sender from overwhelming a slow receiver.

o Example: Slows down data if the receiver’s buffer is full.

4. Access Control:

o Decides which device can use a shared medium (like a Wi-Fi network) when
multiple devices want to send data.

5. Reliable Delivery:

o Ensures frames are delivered correctly, often by resending lost or corrupted


frames.

Error Detection and Correction

Errors can occur during transmission (e.g., due to noise). The Data Link Layer detects and
sometimes corrects these errors:

1. Error Detection:

o Parity Check: Adds a parity bit to make the number of 1s even or odd. If the
count is wrong, an error is detected.

▪ Example: 1011 with even parity gets a 0 (total 1s = 4, even).

o Checksum: Calculates a value based on the data and sends it with the
frame. The receiver recalculates to check for errors.

o Cyclic Redundancy Check (CRC): Uses a polynomial to generate a


checksum. More reliable than parity or simple checksums.

▪ Example: Divides data by a polynomial to detect errors.

2. Error Correction:

o Hamming Code: Adds extra bits to detect and correct single-bit errors.

▪ Example: Places check bits at positions like 1, 2, 4 to pinpoint errors.

o Retransmission: If errors are detected but not corrected, the sender resends
the frame (used in protocols like ARQ).

Elementary Data Link Layer Protocols

These are simple protocols to transfer data between two devices:


1. Unrestricted Simplex Protocol:

o One-way data transfer, no errors, no flow control.

o Example: A device sends data, and the receiver is always ready.

2. Stop-and-Wait Protocol:

o Sender sends one frame and waits for an acknowledgment (ACK) before
sending the next.

o Example: Like texting one message and waiting for a reply before sending
another.

o Pros: Simple, reliable.

o Cons: Slow, as the sender waits for each ACK.

3. Automatic Repeat Request (ARQ):

o Extends Stop-and-Wait by handling errors. If a frame is lost or corrupted, the


receiver asks for retransmission.

o Example: If the receiver gets a bad frame, it sends a NAK (negative


acknowledgment).

Sliding Window Protocols

Sliding Window Protocols improve efficiency by allowing multiple frames to be sent


before receiving an ACK. They use a window (a range of frames) to track sent and
acknowledged frames.

1. Go-Back-N (GBN):

o Sender sends multiple frames within a window.

o If an error occurs (e.g., frame 3 is lost), the receiver discards frame 3 and all
later frames, and the sender resends from frame 3.

o Example: Like mailing 5 letters but resending all from the 3rd if one is lost.

o Pros: Simple to implement.

o Cons: Wastes bandwidth by resending correct frames.

2. Selective Repeat:

o Only the lost or corrupted frame is resent, not the entire window.
o Example: If frame 3 is lost, only frame 3 is resent, and the receiver keeps
frames 4 and 5.

o Pros: More efficient than Go-Back-N.

o Cons: More complex (receiver needs to store out-of-order frames).

Multiple Access Protocols

What are Multiple Access Protocols?

When multiple devices share the same network medium (like a Wi-Fi channel), Multiple
Access Protocols decide who can send data to avoid collisions (when two devices send at
the same time).

ALOHA

• Pure ALOHA:

o Devices send data whenever they want.

o If a collision occurs, they wait a random time and retry.

o Example: Like shouting in a crowded room—collisions happen often.

o Pros: Simple.

o Cons: Many collisions, low efficiency.

• Slotted ALOHA:

o Time is divided into slots, and devices only send at the start of a slot.

o Example: Like taking turns speaking at fixed intervals.

o Pros: Fewer collisions than Pure ALOHA.

o Cons: Still less efficient than other protocols.

CSMA (Carrier Sense Multiple Access)

• Devices listen to the medium before sending to check if it’s free.

• If the medium is busy, they wait and try again.

• Example: Like checking if someone is talking before speaking.

• Pros: Reduces collisions compared to ALOHA.

• Cons: Collisions can still happen if two devices start sending at the same time.
CSMA/CD (Carrier Sense Multiple Access with Collision Detection)

• Used in Ethernet networks.

• Devices listen before sending and keep listening while sending.

• If a collision is detected, they stop, wait a random time, and retry.

• Example: Like stopping mid-sentence if someone else starts talking.

• Pros: Quickly detects and resolves collisions.

• Cons: Only works in wired networks (e.g., Ethernet).

CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance)

• Used in Wi-Fi networks.

• Devices listen before sending and use a handshake (Request to Send/Clear to Send)
to avoid collisions.

• Example: Like asking for permission to speak in a noisy room.

• Pros: Reduces collisions in wireless networks.

• Cons: Slower due to extra handshake steps.

Collision-Free Protocols

UNIT - III: Network Layer

Introduction to the Network Layer

What is the Network Layer?

The Network Layer is the third layer in the OSI model (or Internet Layer in TCP/IP). It is
responsible for moving data packets from one device to another across different networks,
like from your computer to a server on the internet.

• Role: Finds the best path for data to travel, handles addressing, and ensures
packets reach their destination.

• Example: When you visit a website, the Network Layer routes data packets from
your device to the website’s server.

Network Layer Design Issues


The Network Layer addresses several challenges:

1. Routing: Deciding the best path for packets to travel across networks.

2. Addressing: Assigning unique addresses (like IP addresses) to devices.

3. Packet Forwarding: Moving packets from one router to the next until they reach the
destination.

4. Congestion Control: Managing network traffic to prevent overload.

5. Fragmentation: Breaking large packets into smaller pieces if needed.

6. Interoperability: Ensuring different networks (e.g., Wi-Fi, Ethernet) work together.

Store and Forward Packet Switching

• Store and Forward: Routers receive a packet, store it in memory, check for errors,
and then forward it to the next router or destination.

• Example: Like a post office sorting and forwarding a letter to the next office until it
reaches the recipient.

• Pros: Reliable, checks for errors before forwarding.

• Cons: Adds delay since the entire packet is stored.

Connectionless vs. Connection-Oriented Networks

1. Connectionless Networks:

o Packets are sent independently without setting up a connection.

o Each packet may take a different path.

o Example: The internet (uses IP, which is connectionless).

o Pros: Flexible, no setup overhead.

o Cons: Packets may arrive out of order or get lost.

2. Connection-Oriented Networks:

o A connection is established before sending data, and all packets follow the
same path.

o Example: Telephone calls or ATM networks.

o Pros: Reliable, packets arrive in order.


o Cons: Setup takes time, less flexible.

Routing Algorithms

Routing algorithms determine the best path for packets to travel from source to
destination. They aim to be efficient, fast, and adaptable to network changes.

Optimality Principle

• States that if a router J is on the optimal path from router I to router K, then the path
from J to K is also optimal.

• Example: If the best route from A to C goes through B, then B to C is also the best
route.

• Helps simplify routing decisions.

Shortest Path Routing

• Finds the path with the least cost (e.g., shortest distance, lowest delay).

• Uses Dijkstra’s Algorithm to calculate the shortest path.

• Example: If router A can reach C via B (cost 5) or D (cost 10), it chooses B.

• Pros: Efficient, widely used.

• Cons: Needs up-to-date network information.

Flooding

• Sends a packet to all neighboring routers, which then send it to their neighbors, and
so on.

• Example: Like shouting a message to everyone in a room, who then shout it to


others.

• Pros: Guaranteed delivery, finds all possible paths.

• Cons: Wastes bandwidth, can overload the network (uses techniques like sequence
numbers to avoid loops).

Distance Vector Routing

• Each router maintains a table listing the distance (cost) to every destination and the
next hop.

• Routers share their tables with neighbors to update paths.


• Example: Router A tells Router B, “I can reach C in 5 hops,” and B updates its table.

• Pros: Simple, works well for small networks.

• Cons: Slow to adapt to changes, prone to the Count to Infinity Problem.

Count to Infinity Problem

• A problem in Distance Vector Routing where routers keep increasing the distance to
a failed destination, taking a long time to realize it’s unreachable.

• Example: If a link to Router C breaks, Router A and B may keep updating each other
with higher distances (e.g., 3, 4, 5…) before realizing C is down.

• Solution: Use techniques like split horizon (don’t send routes back to the neighbor
you learned them from) or poison reverse (advertise failed routes as infinite).

Link State Routing

• Each router:

1. Discovers its neighbors and measures the cost to reach them.

2. Broadcasts this information to all routers in the network.

3. Uses Dijkstra’s Algorithm to compute the shortest path to every destination.

• Example: Router A sends, “I’m connected to B (cost 2) and C (cost 5),” and all
routers build a map of the network.

• Pros: Fast convergence, avoids Count to Infinity.

• Cons: More complex, needs more memory and processing.

Path Vector Routing

• Similar to Distance Vector, but instead of distances, routers share the full path to a
destination.

• Example: Router A says, “To reach C, go through A-B-C,” instead of just “C is 3 hops
away.”

• Used in BGP (Border Gateway Protocol) for internet routing.

• Pros: Avoids loops, good for large networks like the internet.

• Cons: Larger routing tables, more complex.

Hierarchical Routing
• Divides the network into regions or areas, and routers only know detailed routes
within their region.

• Example: A router in New York knows all routes in New York but only major routes to
California.

• Pros: Reduces routing table size, scalable for large networks.

• Cons: May not always find the absolute shortest path.

Congestion Control Algorithms

Congestion happens when too many packets overload the network, causing delays or
packet loss. Congestion control algorithms manage traffic to keep the network running
smoothly:

1. Leaky Bucket Algorithm:

o Limits the rate at which packets are sent, like water dripping from a bucket.

o Example: A router sends packets at a steady rate, even if data arrives in


bursts.

o Pros: Smooths traffic.

o Cons: May delay packets unnecessarily.

2. Token Bucket Algorithm:

o Allows bursts of packets if “tokens” are available, up to a limit.

o Example: A router can send a burst of data if it has enough tokens, then
waits for more.

o Pros: Flexible, allows bursts.

o Cons: Needs careful tuning.

3. Choke Packets:

o When congestion occurs, routers send choke packets to the source to slow
down.

o Example: Like telling a sender, “Stop sending so fast!”

o Pros: Quick response to congestion.

o Cons: Adds overhead.


4. Load Shedding:

o Drops less important packets when the network is overloaded.

o Example: Drop video packets but keep critical data packets.

o Pros: Keeps critical data moving.

o Cons: Loss of some data.

IP Addresses

An IP address is a unique number assigned to a device on a network, like a phone number


for your computer.

CIDR (Classless Inter-Domain Routing)

• Replaces old IP address classes (A, B, C) with a flexible system.

• Uses a prefix length (e.g., /24) to specify how many bits are for the network part.

• Example: 192.168.1.0/24 means the first 24 bits are the network, and the rest are
for hosts.

• Pros: Efficient use of IP addresses, reduces routing table size.

Subnetting

• Divides a large network into smaller subnetworks (subnets) for better management.

• Example: A network 192.168.1.0/24 is split into two subnets: 192.168.1.0/25 (128


addresses) and 192.168.1.128/25 (128 addresses).

• Pros: Organizes networks, reduces congestion.

• Cons: Requires planning, reduces available addresses per subnet.

SuperNetting

• Combines multiple smaller networks into a larger one.

• Example: Merge 192.168.1.0/24 and 192.168.2.0/24 into 192.168.0.0/23.

• Pros: Simplifies routing, uses addresses efficiently.

• Cons: Less common, needs compatible networks.

IPv4
• IPv4 uses 32-bit addresses (e.g., 192.168.1.1), written as four numbers (0–255)
separated by dots.

• Supports about 4.3 billion addresses.

• Pros: Widely used, simple.

• Cons: Running out of addresses, limited features.

Packet Fragmentation

• If a packet is too large for a network’s maximum size (MTU), it’s broken into smaller
fragments.

• Each fragment has a header with an offset to reassemble at the destination.

• Example: A 4000-byte packet is split into two 2000-byte fragments.

• Pros: Allows large packets to travel across networks.

• Cons: Reassembly can fail if fragments are lost.

IPv6 Protocol

• IPv6 uses 128-bit addresses (e.g., 2001:0db8::1), written as eight groups of


hexadecimal digits.

• Supports trillions of addresses, designed to replace IPv4.

• Features:

o Larger address space.

o Simplified header for faster routing.

o Built-in security and mobility features.

• Pros: Solves address shortage, modern features.

• Cons: Not fully adopted, needs transition from IPv4.

Transition from IPv4 to IPv6

Since IPv4 and IPv6 are not directly compatible, transitioning requires special methods:

1. Dual Stack:

o Devices run both IPv4 and IPv6 at the same time.

o Example: A router handles both IPv4 and IPv6 traffic.


2. Tunneling:

o Encapsulates IPv6 packets in IPv4 packets to travel over IPv4 networks.

o Example: Sends IPv6 data through an IPv4-only network.

3. Translation:

o Converts IPv6 packets to IPv4 (or vice versa) at gateways.

o Example: A server translates IPv6 requests to IPv4 for an older network.

• Challenge: Slow adoption due to cost and compatibility issues.

ARP (Address Resolution Protocol)

• Maps an IP address to a MAC address for communication on the same network.

• How It Works:

o A device broadcasts, “Who has IP 192.168.1.5?”

o The device with that IP responds with its MAC address.

• Example: Your computer uses ARP to find the MAC address of your router.

• Pros: Essential for local communication.

• Cons: Can be exploited for attacks (e.g., ARP spoofing).

RARP (Reverse Address Resolution Protocol)

• Maps a MAC address to an IP address.

• Used by devices (e.g., diskless workstations) that know their MAC but need an IP.

• Example: A device boots and asks, “What’s my IP for MAC 00:1A:2B:3C:4D:5E?”

• Pros: Useful for simple devices.

• Cons: Obsolete, replaced by BOOTP and DHCP.

You might also like