Unit 4 - Computer Networks - 094520
Unit 4 - Computer Networks - 094520
COMPUTER NETWORKS
Unit 4 – Network Layer
Semester – 6
Group:- Raishav Kumar (20121)
Pari (20119)
Lakshya Anand
INTRODUCTION
1. Routing
• Determines the best path for data to travel across multiple networks.
• Routers use routing tables and protocols (like OSPF, RIP, BGP) to decide paths.
2. Protocols
• Rules that devices follow to communicate.
• Common internetworking protocol: IP (Internet Protocol).
• TCP/IP is the backbone of the internet and most internetworks.
3. Packet Switching
• Internetworks use packet switching where data is broken into small packets.
• Each packet is sent independently and may take different routes.
Examples to Understand Better
Before diving into virtual circuits and datagrams, let's quickly understand
packet switching:
• In packet-switched networks, data is divided into small units called packets.
• These packets are sent independently and may take different routes to the
destination.
• Once all packets arrive, they are reassembled into the original message.
Now, there are two primary approaches to how these packets are transmitted:
1. Virtual Circuits
2. Datagrams
1. Virtual Circuits
A Virtual Circuit is a connection-oriented packet switching method. It simulates a
dedicated connection between sender and receiver.
How It Works
• Phase 1 – Setup: A path is established between the sender and receiver before
any data is sent. This path is called a virtual circuit.
• Phase 2 – Data Transfer: All packets follow the same predefined path in order.
• Phase 3 – Teardown: After data transfer is complete, the circuit is terminated.
Key Features
• Connection-oriented: Like a phone call; connection first, then communication.
• Fixed path: All packets travel through the same path.
• Ordered delivery: Packets arrive in the correct order.
• Resource reservation: Bandwidth and buffers may be reserved along the path.
Advantages & Disadvantages
Advantages
• Reliable and organized data delivery.
• Low variation in delay (good for real-time traffic like voice).
• Easier error control and flow control.
Disadvantages
• Setup time introduces delay.
• Less flexible—if a link fails, the whole virtual circuit fails.
• Not efficient for bursty data.
Examples of Virtual Circuit Networks
• ATM (Asynchronous Transfer Mode)
• Frame Relay
• X.25
2. Datagrams
A Datagram is a connectionless packet switching method, used by the IP
protocol on the internet.
How It Works
• Each packet is treated as an independent unit.
• Packets may take different paths to the destination.
• No need to set up a path in advance.
• Each packet contains the complete destination address.
Key Features
• Connectionless: Like sending letters in mail; each letter is sent separately.
• Dynamic routing: Packets may be routed differently depending on network
conditions.
• No guaranteed order: Packets may arrive out of order or get lost.
• Stateless: Routers don’t keep track of connections.
Advantages & Disadvantages
Advantages
• Fast and flexible.
• No setup delay.
• Efficient use of network resources.
• Scales well for large networks like the Internet.
Disadvantages
• Unreliable by nature—packets can be lost, duplicated, or arrive out of order.
• More complex reassembly at the receiver’s end.
• Requires additional mechanisms for reliability (like TCP).
Examples of Datagram Networks
• Internet (IP protocol)
• UDP (User Datagram Protocol)
Analogy
• Virtual Circuit: Like a phone call – you dial a number, connect, talk in order,
and then hang up.
• Datagram: Like postal mail – you send each letter separately; they may
take different routes and arrive at different times.
Addressing in Network Layer
• Private IP: Used within private networks, not routable on the internet.
• Ranges:
• 10.0.0.0 – 10.255.255.255
• 172.16.0.0 – 172.31.255.255
• 192.168.0.0 – 192.168.255.255
• Public IP: Assigned by ISPs and used to identify your network on the Internet.
Some important points:
Interfaces and Addressing:
• An interface is the boundary between a host/router and the link.
• IP addresses are assigned per interface, not per device.
• A host with multiple interfaces (e.g., WiFi and Ethernet) will have multiple IP
addresses.
Subnets:
• A subnet is a portion of the IP address space where all devices can directly
communicate without routing.
• Devices in the same subnet share a common prefix in their IP addresses.
• Determining subnets involves using subnet masks (e.g., /24 means the first 24 bits
are the subnet)
CIDR (Classless Inter-Domain Routing):
• CIDR allows more flexible division of IP address space.
• Instead of fixed class-based IPs (Class A, B, C), CIDR uses prefix notation
like192.168.1.0/24 .
Subnetting
Subnetting is the process of dividing a large network into smaller, more
manageable subnetworks (subnets). It enhances routing efficiency, security,
and network performance.