0% found this document useful (0 votes)
77 views37 pages

CN Material

This document provides an overview of computer networks and the Internet, including key concepts such as LAN, WAN, and IP addressing, as well as the OSI and TCP/IP models. It discusses the network edge and core, network topologies, and the application layer, covering protocols like HTTP, SMTP, and DNS. Additionally, it introduces the transport layer's functions, including reliable data transfer techniques and the differences between TCP and UDP.

Uploaded by

dixifeg781
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)
77 views37 pages

CN Material

This document provides an overview of computer networks and the Internet, including key concepts such as LAN, WAN, and IP addressing, as well as the OSI and TCP/IP models. It discusses the network edge and core, network topologies, and the application layer, covering protocols like HTTP, SMTP, and DNS. Additionally, it introduces the transport layer's functions, including reliable data transfer techniques and the differences between TCP and UDP.

Uploaded by

dixifeg781
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/ 37

Unit:1 Introduction to computer networks and Internet

Understanding of Network and Internet

A network is a collection of interconnected devices that communicate with each other to share resources
and exchange data. The Internet is the largest global network, connecting millions of private, public,
academic, business, and government networks.

Key Concepts:

●​ Local Area Network (LAN): A network within a small geographical area (e.g., home, office).
●​ Wide Area Network (WAN): A network spanning large distances (e.g., the Internet).
●​ Internet Service Providers (ISP): Companies that provide access to the Internet.
●​ IP Addressing: Unique numerical identifiers assigned to each device on a network.

The Network Edge

The network edge consists of devices that interface directly with end-users.

Components:

1.​ End Systems (Hosts): Computers, smartphones, IoT devices.


2.​ Access Networks: Technologies that connect end systems to the Internet (e.g., Wi-Fi, Ethernet,
4G/5G).
3.​ Edge Devices: Modems, routers, switches that manage data flow between networks.

The Network Core

The network core consists of interconnected routers and high-speed links responsible for data
transmission.

Characteristics:

●​ Uses Packet Switching to divide data into small packets and route them dynamically.
●​ Utilizes Routing Algorithms to find the most efficient path.
●​ Employs Circuit Switching in some cases for dedicated connections.
1. Delay

The time taken for a packet to travel from source to destination. It consists of:

●​ Processing Delay: Time to process packet headers.


●​ Queuing Delay: Time waiting in the router’s buffer.
●​ Transmission Delay: Time to push packet onto the link.
●​ Propagation Delay: Time for signal to travel through the medium.

2. Packet Loss

●​ Occurs when network congestion causes routers to drop packets.


●​ Solutions: Retransmission, congestion control mechanisms (TCP/IP).

3. Throughput

●​ The rate at which data is successfully transmitted over a network.


●​ Measured in bits per second (bps).

Protocol Layers and Their Service Model

Computer networks use a layered architecture to simplify communication processes. The most widely
used model is the TCP/IP Model, which consists of:

1.​ Application Layer: Provides network services to applications (e.g., HTTP, FTP, SMTP).
2.​ Transport Layer: Ensures reliable data transfer (e.g., TCP, UDP).
3.​ Network Layer: Handles packet forwarding and addressing (e.g., IP, ICMP).
4.​ Data Link Layer: Manages data framing and error detection (e.g., Ethernet, Wi-Fi).
5.​ Physical Layer: Deals with hardware transmission (e.g., cables, radio signals).

History of Computer Networks

Key Milestones:

●​ 1960s: ARPANET (precursor to the Internet) was developed.


●​ 1970s: Introduction of TCP/IP protocol suite.
●​ 1980s: Expansion of the Internet to academic and commercial use.
●​ 1990s: The rise of the World Wide Web (WWW) and commercial Internet services.
●​ 2000s-Present: Growth of broadband, wireless networks, and cloud computing.

The evolution of computer networks has led to advancements in cybersecurity, IoT, and AI-driven
networking solutions.
3. OSI Model

The OSI (Open Systems Interconnection) Model is a conceptual framework used to standardize
network communication. It consists of seven layers, each with specific functions to ensure seamless data
transmission across networks.

Seven Layers of the OSI Model

1.​ Physical Layer (Layer 1)​

○​ Deals with the physical connection between devices.​

○​ Transmits raw binary data (0s and 1s) over a physical medium (e.g., cables, fiber optics,
radio waves).​

○​ Example: Ethernet cables, Wi-Fi signals, hubs.​

2.​ Data Link Layer (Layer 2)​

○​ Responsible for error detection and correction, and framing of data.​

○​ Uses MAC (Media Access Control) addresses for device identification.


○​ Divided into two sublayers:​

■​ MAC (Media Access Control) Sublayer: Controls who can use the channel.​

■​ LLC (Logical Link Control) Sublayer: Handles error checking.​

○​ Example: Ethernet, Wi-Fi (802.11), MAC addresses, switches.​

3.​ Network Layer (Layer 3)​

○​ Handles routing and logical addressing.​

○​ Uses IP (Internet Protocol) addresses to determine packet paths.​

○​ Manages congestion control and packet forwarding.​

○​ Example: IP, ICMP, routers.​

4.​ Transport Layer (Layer 4)​

○​ Ensures end-to-end communication between devices.​

○​ Provides error detection, flow control, and data segmentation.​

○​ Uses TCP (Transmission Control Protocol) for reliable communication and UDP (User
Datagram Protocol) for fast but unreliable transmission.​

○​ Example: TCP, UDP, port numbers.​

5.​ Session Layer (Layer 5)​

○​ Manages and controls communication sessions between applications.​

○​ Handles authentication and session restoration.​

○​ Example: Remote Procedure Call (RPC), session management in APIs.


6.​ Presentation Layer (Layer 6)​

○​ Ensures data format compatibility between different systems.​

○​ Handles encryption, compression, and translation of data.​

○​ Example: SSL/TLS encryption, JPEG, MP3, GIF.​

7.​ Application Layer (Layer 7)​

○​ Provides network services directly to users and applications.​

○​ Includes protocols for web browsing, email, and file transfer.​

○​ Example: HTTP, FTP, SMTP, DNS.​

Key Features of the OSI Model

●​ Encapsulation: Each layer adds its own header to data before passing it to the next layer.​

●​ Interoperability: Standardized communication between different network devices and vendors.​

●​ Modular Approach: Each layer is independent, allowing updates without affecting others.​

4. Network Topology

Network topology refers to the arrangement of devices (nodes) and connections (links) in a network. It
determines how data flows between devices and affects network performance, scalability, and reliability.
Types of Network Topology

1. Bus Topology

●​ Structure: All devices are connected to a single central cable (backbone).​

●​ Data Flow: Data travels in both directions until it reaches the intended device.​

●​ Advantages:​

○​ Cost-effective (requires less cable).


○​ Easy to install.​

●​ Disadvantages:​

○​ Single point of failure (if the main cable fails, the whole network goes down).
○​ Difficult to troubleshoot.​

●​ Example: Early Ethernet networks.​

2. Star Topology

●​ Structure: All devices connect to a central hub or switch.​


●​ Data Flow: Communication passes through the central hub.​

●​ Advantages:​

○​ Easy to manage and troubleshoot.


○​ Network continues working if one device fails (except if the hub fails).​

●​ Disadvantages:​

○​ Requires more cable than a bus topology.


○​ The central hub is a single point of failure.​

●​ Example: Modern Ethernet networks, Wi-Fi networks.

3. Ring Topology

●​ Structure: Devices are connected in a circular loop. Each device is connected to exactly two
neighbors.​
●​ Data Flow: Data travels in one direction (unidirectional) or both directions (bidirectional).​

●​ Advantages:​

○​ Less collision, efficient data transfer.​

○​ Works well in high-traffic environments.​

●​ Disadvantages:​

○​ If one device fails, the whole network can go down (unless dual ring is used).​

○​ Adding or removing devices can be difficult.​

●​ Example: Fiber Distributed Data Interface (FDDI), Token Ring networks.​


4. Mesh Topology

●​ Structure: Every device is connected to every other device. Can be full-mesh (all nodes
connected) or partial-mesh (some nodes connected).​

●​ Data Flow: Multiple paths exist for data to travel.​

●​ Advantages:​

○​ Highly reliable (if one connection fails, another can be used).​

○​ No single point of failure.​

●​ Disadvantages:​

○​ Expensive (requires a lot of cabling).​

○​ Complex to install and maintain.​

●​ Example: Military networks, financial systems.​


5. Tree Topology

●​ Structure: A combination of star and bus topologies, with a hierarchical structure.​

●​ Data Flow: Data flows between hierarchical levels.​

●​ Advantages:​

○​ Scalable (can expand easily).


○​ Well-organized structure.​

●​ Disadvantages:​

○​ If the main backbone fails, the entire network can be affected.


○​ Requires a lot of cables.​

●​ Example: Large corporate networks, university campuses.​

6. Hybrid Topology

●​ Structure: A mix of two or more topologies (e.g., star-bus, mesh-star).​


●​ Advantages:​

○​ Flexible and scalable.​

○​ Can optimize performance based on requirements.​

●​ Disadvantages:​

○​ Complex and costly to set up.​

●​ Example: Enterprise-level networks combining different topologies.​


Unit:2 Application Layer

**Principles of Computer Applications**

Computer applications refer to software programs designed to perform specific tasks for users. These
applications are categorized into different types based on their functions:

### Categories of Computer Applications:

1. **Business Applications**: Accounting software, ERP systems.

2. **Educational Applications**: E-learning platforms, virtual classrooms.

3. **Entertainment Applications**: Games, video streaming services.

4. **Communication Applications**: Email, video conferencing tools.

5. **Web Applications**: Online banking, e-commerce sites.

**Web and HTTP**

Key Concepts:

- **HTTP (Hypertext Transfer Protocol)**: The foundation of web communication.

- **HTTPS (Secure HTTP)**: A secure version of HTTP using SSL/TLS encryption.

- **Web Servers**: Store and serve web pages (e.g., Apache, Nginx).

- **Web Browsers**: Client applications for accessing the web (e.g., Chrome, Firefox).

HTTP Request-Response Cycle (Diagram Representation):

1. **Client (Browser)** sends an HTTP request.

2. **Web Server** processes the request.

3. **Web Server** sends an HTTP response (with webpage data).

4. **Browser** renders the page for the user.


**E-mail (Electronic Mail)**

Email is a method of exchanging digital messages over the Internet.

Key Protocols:

- **SMTP (Simple Mail Transfer Protocol)**: Sends emails.

- **IMAP (Internet Message Access Protocol)**: Retrieves emails while keeping them on the server.

- **POP3 (Post Office Protocol 3)**: Downloads emails to a local device.

# Email Communication Process:

1. **User composes an email** → Sent using **SMTP**.

2. **Email is routed** through mail servers.

3. **Recipient retrieves email** via **IMAP/POP3**.

**DNS (Domain Name System)**

DNS translates human-readable domain names (e.g., google.com) into IP addresses.

DNS Components:

- **Root Servers**: Direct queries to TLD (Top-Level Domain) servers.

- **TLD Servers**: Handle domains like `.com`, `.org`, `.net`.

- **Authoritative DNS Servers**: Store specific domain records.

- **Recursive DNS Resolvers**: Help clients find IP addresses.

# DNS Resolution Process:

1. **User enters a domain name** in the browser.

2. **Recursive Resolver** queries the Root Server.

3. **Root Server** directs to a TLD Server.


4. **TLD Server** directs to an Authoritative Server.

5. **Authoritative Server** returns the IP address.

6. **Browser connects** to the web server.

**Socket Programming with TCP and UDP**

Socket programming enables communication between networked computers using **TCP (Transmission
Control Protocol)** and **UDP (User Datagram Protocol)**.

### **TCP (Connection-Oriented)**

- Reliable, ensures ordered data transmission.

- Used for applications like web browsing, email.

- Requires a connection setup (3-way handshake: SYN, SYN-ACK, ACK).

**Basic TCP Server Code (Python Example):**

```python

import socket

server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

server_socket.bind(('localhost', 8080))

server_socket.listen(5)

print("Server is listening...")

while True:

client_socket, addr = server_socket.accept()

print("Connected to", addr)

client_socket.send(b'Hello, Client!')

client_socket.close()
### **UDP (Connectionless)**

- Faster, but no guaranteed delivery.

- Used for real-time applications (VoIP, gaming).

- No handshake, direct message transmission.

**Basic UDP Server Code (Python Example):**

```python

import socket

server_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

server_socket.bind(('localhost', 8080))

print("UDP Server is listening...")

while True:

data, addr = server_socket.recvfrom(1024)

print("Received message:", data.decode())

server_socket.sendto(b'Hello, Client!', addr)


Unit:3 Transport Layer

1. Introduction to Transport Layer and Its Services

The transport layer is the fourth layer in the OSI model and is responsible for end-to-end
communication between applications running on different hosts. In the TCP/IP model, it lies
between the application layer and the network layer.

Functions of the Transport Layer

●​ Segmentation and Reassembly: Breaks large messages into smaller segments and
reassembles them at the destination.​

●​ Process-to-Process Communication: Ensures that data is delivered to the correct


application on the receiving host.​

●​ Error Control: Detects and corrects transmission errors.​

●​ Flow Control: Ensures that a fast sender does not overwhelm a slow receiver.​

●​ Congestion Control: Prevents excessive data transmission that could lead to network
congestion.​

2. Multiplexing and Demultiplexing

Multiplexing and demultiplexing allow multiple applications to communicate over the same
network efficiently.

Multiplexing

●​ The transport layer at the sender side combines data from multiple applications and sends
it to the network layer.​

●​ Uses port numbers to differentiate data from different applications.​

●​ Example: Web browsing and file downloading occurring simultaneously.​

Demultiplexing
●​ The transport layer at the receiver side separates incoming data and delivers it to the
correct application.​

●​ Uses port numbers to determine the correct destination application.​

Diagram of Multiplexing and Demultiplexing:

+-----------------------------------+

| Application Layer (Multiple Apps)|

+-----------------------------------+

| | |

v v v

+-----------------------------------+

| Transport Layer (Uses Port Nos.) |

+-----------------------------------+

+-----------------------------------+

| Network Layer |

+-----------------------------------+
3. Connectionless Transport: User Datagram Protocol (UDP)

UDP is a connectionless and unreliable transport protocol that provides low-latency


communication.

Features of UDP

●​ No connection establishment (no handshaking).​

●​ No reliability (no retransmissions).​

●​ Fast and lightweight (low overhead).​

●​ Used for real-time applications like VoIP, video streaming, and online gaming.​

UDP Header Format

+----------------+----------------+

| Source Port | Destination Port |

+----------------+----------------+

| Length | Checksum |

+----------------+----------------+

| Data Payload (Variable Length) |

+-----------------------------------+

●​ Source & Destination Port: Identifies sender and receiver applications.​

●​ Length: Total length of UDP segment.​

●​ Checksum: Detects errors in the segment.​


4. Principles of Reliable Data Transfer

Reliable data transfer ensures that all transmitted data arrives correctly and in order.

Key Techniques for Reliable Data Transfer

1.​ Acknowledgments (ACKs): Receiver confirms successful receipt.​

2.​ Retransmissions: Sender retransmits lost packets.​

3.​ Sequence Numbers: Used to detect duplicate or missing packets.​

4.​ Timers: Set to detect packet loss (timeout mechanism).​

5.​ Error Detection: Checksum ensures data integrity.​

Stop-and-Wait Protocol (Basic Reliability Mechanism)

●​ The sender transmits one packet at a time and waits for an ACK before sending the next.​

●​ If no ACK is received within a timeout period, the sender retransmits the packet.​

Diagram: Stop-and-Wait Protocol

Sender Receiver

|-------- Data 1 ------>|

|<------- ACK 1 -------|

|-------- Data 2 ------>|

|<------- ACK 2 -------|


Sliding Window Protocol (Go-Back-N and Selective Repeat)

1.​ Go-Back-N (GBN): If a packet is lost, all subsequent packets are retransmitted.​

2.​ Selective Repeat (SR): Only the lost packet is retransmitted, improving efficiency.​

5. Connection-Oriented Transport: Transmission Control Protocol (TCP)

TCP is a connection-oriented, reliable transport protocol used for critical data transfers.

Features of TCP

●​ Three-way handshake (for connection establishment).​

●​ Reliable data transfer (using ACKs and retransmissions).​

●​ Flow control (ensures receiver is not overwhelmed).​

●​ Congestion control (prevents excessive traffic).​

TCP Header Format

+----------------+----------------+

| Source Port | Destination Port |

+----------------+----------------+

| Sequence No. | Acknowledgment No. |

+----------------+----------------+

| Flags | Window Size |

+----------------+----------------+

| Checksum | Urgent Pointer |

+----------------+----------------+

| Data Payload (Variable Length) |


+-----------------------------------+

●​ Sequence & Acknowledgment Numbers: Ensure correct packet order.​

●​ Flags: Controls TCP behavior (SYN, ACK, FIN, etc.).​

●​ Window Size: Manages flow control.​

TCP Connection Establishment (Three-Way Handshake)

1. Client → Server: SYN

2. Server → Client: SYN + ACK

3. Client → Server: ACK

6. Congestion Control

Congestion occurs when too much data is sent too quickly, causing network overload.

TCP Congestion Control Mechanisms

1.​ Slow Start: Increases transmission rate exponentially until a threshold.​

2.​ Congestion Avoidance: Gradual increase in sending rate.​

3.​ Fast Retransmit: If three duplicate ACKs are received, lost packet is retransmitted.​

4.​ Fast Recovery: Instead of starting from scratch, TCP resumes from a reduced rate.​
TCP Congestion Window Growth

Time -->

| Slow Start (Exponential Growth)

| _______

|/ \

|/ \ Congestion Avoidance (Linear Growth)

| \________
Unit: 4 Network Layer

1. Introduction to Forwarding and Routing

The network layer in the OSI model is responsible for moving packets from the source to the destination
across multiple networks.

Key Functions of the Network Layer

●​ Forwarding: Moving packets from an incoming link to an outgoing link within a router.​

●​ Routing: Determining the best path for packets to take from the source to the destination.

Difference Between Forwarding and Routing

Diagram: Forwarding vs Routing

Routing: Determines the path

(S) ---> [R1] ---> [R2] ---> [R3] ---> (D)

Forwarding: Moves packets within a router

[R] Incoming Packet ---> Routing Table Lookup ---> Forward to Correct Output Port
2. Network Service Models

A network service model defines how data is transferred over the network.

Types of Network Service Models

1.​ Best-Effort Service (Used by IP)​

○​ No guarantees on delivery, delay, or order.​

○​ Used in the Internet today.​

2.​ Guaranteed Service​

○​ Ensures a certain bandwidth and delay.​

○​ Used in real-time applications.​

3.​ Virtual Circuit Service (Like Telephone Networks)​

○​ Establishes a pre-defined path before sending data.​

○​ Provides connection-oriented service.​

4.​ Datagram Service (Used by the Internet)​

○​ Connectionless service (each packet treated independently).​

○​ Used in packet-switched networks.​


3. Virtual and Datagram Networks

The network layer can provide either a virtual circuit or a datagram network service.

Virtual Circuit Networks (VC)

●​ Connection-oriented​

●​ Each packet follows a pre-established route​

●​ Used in ATM (Asynchronous Transfer Mode) networks​

Diagram of Virtual Circuit:

S ---> [Router 1] ---> [Router 2] ---> [Router 3] ---> D

|------------ Pre-established Path -------------|

Datagram Networks

●​ Connectionless service (like postal mail)​

●​ Each packet takes its own independent route​

●​ Used in the Internet (IP networks)​

Diagram of Datagram Network:

S ---> [R1] ---> [R2] ---> [R5] ---> D

S ---> [R1] ---> [R3] ---> [R4] ---> D

(Different paths for different packets)


4. Study of Routers

A router is a network device that forwards packets based on their destination address.

Components of a Router

1.​ Input Ports: Receives packets and performs lookup.​

2.​ Switching Fabric: Transfers packets from input to output.​

3.​ Output Ports: Queues packets and transmits them.​

4.​ Routing Processor: Computes the best routes.​

Router Architecture Diagram

+---------------------+

| Routing Processor |

+---------------------+

-------------------------------------------------

| Input Ports | Switching Fabric | Output Ports |

-------------------------------------------------

5. IP Protocol and Addressing in the Internet

The Internet Protocol (IP) is the principal communication protocol for relaying packets across networks.

IP Addressing

●​ IPv4 (32-bit Address): Example: 192.168.1.1​

●​ IPv6 (128-bit Address): Example: 2001:db8::1​


IP Header Format

+---------------------+

| Version | IHL | TOS |

+---------------------+

| Total Length |

+---------------------+

| Identification |

+---------------------+

| Flags | Fragment Offset |

+---------------------+

| TTL | Protocol | Checksum |

+---------------------+

| Source IP Address |

+---------------------+

| Destination IP Address |

+---------------------+

●​ TTL (Time to Live): Prevents infinite loops.​

●​ Protocol: Identifies upper-layer protocol (e.g., TCP/UDP).​

●​ Source & Destination IPs: Identify sender and receiver.​


6. Routing Algorithms

Routing algorithms determine the best path for data transmission.

Types of Routing Algorithms

1.​ Link-State Routing (Dijkstra's Algorithm)​

○​ Each router knows the full network topology.​

○​ Computes shortest path using Dijkstra’s Algorithm.​

2.​ Distance Vector Routing (Bellman-Ford Algorithm)​

○​ Each router shares its routing table with neighbors.​

○​ Computes paths using Bellman-Ford Algorithm.​

3.​ Hybrid Routing (e.g., OSPF, EIGRP)​

○​ Combines both link-state and distance vector methods.​

Example of Dijkstra’s Algorithm (Link-State)

Graph Representation of Network:

A ---1--- B

| |

4 2

| |

C ---3--- D
Step 1: Start at A

Step 2: Choose shortest path (A -> B, cost 1)

Step 3: Continue until destination is reached.

7. Broadcast and Multicast Routing

Routing can be unicast, broadcast, or multicast.

Broadcast Routing

●​ Sends packets to all nodes in the network.​

●​ Techniques:​

○​ Flooding: Send to all neighbors.​

○​ Controlled Flooding: Limits duplicate packets.​

○​ Multicast Trees: Optimized paths for delivery.​

Example: Flooding in Broadcast

S ---> [R1] ---> [R2]

\ \

---> [R3] ---> [R4]

(Every node receives the packet)


Multicast Routing

●​ Sends packets to a specific group of nodes.​

●​ Used for live streaming, conferencing.​

Multicast Routing Example

S ---> [R1] ---> {R2, R3} ---> {R4, R5}

(Targeted delivery instead of sending to all)


Unit: 5 The Link layer and Local area networks:

Introduction to Link Layer Services

The Link Layer (also known as the Data Link Layer) is the second layer of the OSI model and is
responsible for node-to-node communication over a physical link.

Functions of the Link Layer

●​ Framing: Encapsulates network layer packets into frames.​

●​ Addressing: Uses MAC (Media Access Control) addresses to identify source and
destination devices.​

●​ Error Detection and Correction: Identifies and corrects errors in transmission.​

●​ Flow Control: Regulates data transmission between sender and receiver.​

●​ Media Access Control: Determines how multiple devices share the same communication
medium.

Error Detection and Correction Techniques

Errors in data transmission occur due to noise, interference, or signal degradation. The link layer
provides mechanisms to detect and correct errors.

1. Error Detection Techniques

Error detection methods ensure that a corrupted frame is identified but do not correct it.

a) Parity Check

●​ Single-bit parity: Adds an extra bit to ensure an even or odd number of 1s.​

●​ Example:​

○​ Original Data: 1010110​


○​ Even Parity Bit: 10101100​

b) Checksum

●​ Sender adds all data segments and appends the sum as the checksum.​

●​ Receiver verifies integrity by recomputing the checksum.​

c) Cyclic Redundancy Check (CRC)

●​ Uses a polynomial division algorithm to detect errors.​

●​ Example: If the remainder is zero, data is correct.​

2. Error Correction Techniques

Error correction methods detect and fix errors without retransmission.

a) Hamming Code

●​ Uses extra parity bits for error correction.​

●​ Can detect and correct single-bit errors.​

Example: Hamming Code (7,4)

Data Bits: 1011

Hamming Encoded: 1011010 (includes parity bits)


Multiple Access Protocols

When multiple devices share a communication channel, protocols define how they avoid
collisions and transmit data efficiently.

Types of Multiple Access Protocols

1.​ Channel Partitioning​

○​ Time-Division Multiple Access (TDMA): Divides time into slots.​

○​ Frequency-Division Multiple Access (FDMA): Divides bandwidth into frequency


bands.​

2.​ Random Access (Collision-Based)​

○​ ALOHA: Devices transmit freely; retransmit if a collision occurs.​

○​ CSMA/CD (Carrier Sense Multiple Access with Collision Detection): Used in


Ethernet to detect and resolve collisions.​

3.​ Controlled Access​

○​ Polling: Central device controls transmission order.​

○​ Token Passing: Devices pass a token to control transmission.​

Addressing in the Link Layer


The Link Layer uses MAC (Media Access Control) addresses to identify devices.
MAC Address

●​ 48-bit address (e.g., 00:1A:2B:3C:4D:5E).​

●​ Assigned to network interface cards (NICs).​

●​ Uniquely identifies a device in a local network.​

MAC Address Structure

+------------------------+------------------------+

| Manufacturer (24 bits)| Device Identifier (24 bits) |

+------------------------+------------------------+

Comparison of IP and MAC Address


Ethernet
Ethernet is the most widely used wired LAN technology that operates at the Link Layer.

Ethernet Features

●​ Uses CSMA/CD for collision detection.​

●​ Supports speeds from 10 Mbps to 100 Gbps.​

●​ Uses frames to encapsulate data.​

Ethernet Frame Format

+--------+--------+------+--------+-----------+-------+

| Preamble | Dest MAC | Src MAC | Type | Payload | CRC |

+--------+--------+------+--------+-----------+-------+

●​ Preamble: Synchronization pattern.​

●​ Destination & Source MAC: Identifies sender and receiver.​

●​ Type: Identifies network layer protocol (e.g., IPv4, IPv6).​

●​ CRC: Checks for errors.​

Ethernet Types
Switches
A network switch is an intelligent device that forwards Ethernet frames based on MAC
addresses.

How a Switch Works

1.​ Learns MAC addresses from incoming frames.​

2.​ Stores MAC addresses in a MAC address table.​

3.​ Forwards frames to the correct destination instead of broadcasting.​

Switch vs. Hub

Switch-Based Network Diagram

[PC1]----| |----[PC2]

[PC3]----| Switch |----[PC4]

[PC5]----| |----[PC6]

VLAN (Virtual Local Area Network)

VLANs allow networks to be segmented logically instead of physically.

Benefits of VLANs

●​ Improves security by isolating devices.​

●​ Reduces congestion by limiting broadcast domains.​


●​ Enhances management by grouping devices logically.​

VLAN Configuration Example

VLAN 10: Marketing VLAN 20: Sales

[PC1]---| |---[PC3]

[PC2]---| Switch |---[PC4]

| Trunk Link |

●​ Devices in VLAN 10 cannot communicate with VLAN 20 without a router.​

You might also like