Unit 2
Unit 2
Networks differ in their scale, functionality, topology, and the protocols they use to ensure
communication. Broadly, networks can be classified into:
1. LAN (Local Area Network): A network that covers a small geographical area, like a
home, office, or school. It is typically faster and more reliable, with less complexity in
managing devices.
o Example: An office network where computers, printers, and other devices are
connected within the same building.
2. WAN (Wide Area Network): A network that spans a large geographical area, often
interconnecting multiple LANs. WANs use leased lines, satellite links, or the internet
for connectivity.
o Example: The internet itself is a vast WAN connecting millions of smaller
LANs worldwide.
3. MAN (Metropolitan Area Network): This network typically spans a city or a large
campus, larger than a LAN but smaller than a WAN.
o Example: A university’s campus network connecting various buildings within
a city.
4. PAN (Personal Area Network): A small network designed for personal devices,
usually within a range of a few meters.
o Example: Connecting devices like smartphones, laptops, and wireless printers
using Bluetooth or Wi-Fi.
1. Routers: A router connects different networks (e.g., LAN to WAN). It forwards data
packets between networks and determines the best path for data transmission.
o Example: A home router connects your local network (LAN) to the internet
(WAN).
2. Switches: A switch connects multiple devices within the same network and forwards
data based on MAC addresses, ensuring efficient communication within a LAN.
o Example: A network switch in an office connecting several computers.
3. Bridges: A bridge connects two LANs, ensuring that data can be transmitted between
different network segments.
oExample: A wireless bridge connecting a wired LAN to a wireless LAN in an
office.
4. Gateways: A gateway connects networks using different protocols and can translate
between them.
o Example: A protocol gateway connects a company's internal network to an
external service like an online payment system.
Internetworking
Example: When a user sends an email from a computer in one country to a recipient
in another, their devices are part of different networks connected through
internetworking devices like routers.
Tunneling
Tunneling is a technique used to encapsulate data packets in a way that they can traverse a
network that would otherwise be unable to support the type of traffic. This is often used in
VPNs (Virtual Private Networks) to securely send private data over the public internet.
1. Process: Tunneling wraps data in an encrypted packet that can be securely sent across
the internet.
2. Example: When you connect to a VPN, your data is tunneled to a server, which
decrypts it and forwards it to the internet, masking your real IP address.
The network layer is responsible for routing packets across networks, ensuring that data can
travel from the source to the destination. It handles logical addressing, packet forwarding, and
path determination. In the context of the Internet, the IP (Internet Protocol) operates at the
network layer.
IPV4 Protocol
IPv4 (Internet Protocol version 4) is the fourth version of the Internet Protocol and is the
most widely used protocol for addressing and routing data packets across the internet. IPv4
uses a 32-bit address system, providing a theoretical address space of about 4.3 billion
unique IP addresses.
Format:
IPv4 addresses are represented in dotted decimal notation (e.g., 192.168.0.1), with
four octets, each ranging from 0 to 255.
Example: A typical IPv4 address 192.168.1.1 could represent a private network address in a
home or small office network.
IP Addresses
An IP address is a unique identifier assigned to devices in a network. It ensures that data sent
over the network reaches the correct destination. IPv4 addresses are 32-bits long, and IPv6
addresses are 128-bits long.
Types of IP addresses:
Subnets
Subnetting is the process of dividing a larger network into smaller sub-networks (subnets). It
allows for more efficient use of IP addresses and improved security and performance.
Subnets are identified by the subnet mask, which defines which portion of the IP address
identifies the network and which part identifies the host.
Example: In a 192.168.1.0/24 network, the /24 subnet mask indicates that the first 24 bits
represent the network address, and the remaining 8 bits represent the host portion of the
address.
CIDR is a method of allocating IP addresses and routing that replaces the traditional classful
network structure (Class A, B, C). It allows for more flexible and efficient use of IP address
space by using variable-length subnet masks (VLSM).
Example: A 192.168.0.0/22 address range allows for more hosts than a 192.168.0.0/24
network, making CIDR more efficient for large networks.
Classful and Special Addressing
In classful addressing, the IP address space was divided into classes (A, B, C, D, E), each
with different network and host address lengths.
Special Addresses:
Loopback address: 127.0.0.1 is used to test the local machine's network stack.
Private IP addresses: Ranges like 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 are
reserved for private use.
Example: A home router with NAT allows devices like smartphones and laptops (with
private IPs) to access the internet using the same public IP address provided by the ISP.
Types of NAT:
IPv6 is the successor to IPv4 and uses 128-bit addresses, which provides an address space of
about 340 undecillion addresses (3.4 × 10^38). IPv6 was designed to solve the limitations of
IPv4, particularly the exhaustion of IP addresses.
Structure:
Address Types:
IPv6 Advantages
Larger address space: IPv6 provides a vastly larger address pool, ensuring no
shortages of IP addresses for the foreseeable future.
Simplified header format: IPv6 has a simplified packet header, which improves
routing efficiency.
Better security: IPv6 was designed with security in mind, integrating IPsec (Internet
Protocol Security) into the protocol.
Better Quality of Service (QoS): IPv6 includes features like flow labeling for
handling real-time traffic better.
Simplified NAT: With the large address space, IPv6 doesn't require NAT,
simplifying network configurations and improving security.
The IPv6 packet format is simpler than IPv4, with a fixed-size header of 40 bytes. The IPv6
header contains:
Extension Headers: IPv6 allows for extension headers to be added between the IPv6 header
and the payload. These headers are used for routing, security, and fragmentation.
The transition from IPv4 to IPv6 is happening gradually, and several techniques help ensure
compatibility during this period:
1. ICMP (Internet Control Message Protocol): ICMP is used for diagnostic functions
and error reporting. For example, the ping command uses ICMP to check connectivity
between devices.
o Example: Sending a ping to an IP address uses ICMP to check if the host is
reachable.
2. ARP (Address Resolution Protocol): ARP is used to map a device's IP address to its
MAC (Media Access Control) address. It is essential for communication within a
local network.
o Example: A device with IP address 192.168.1.1 wants to send data to another
device with the same IP. ARP is used to find the MAC address of the
destination device.
3. DHCP (Dynamic Host Configuration Protocol): DHCP automatically assigns IP
addresses to devices on a network.
o Example: When a new device joins a network, it requests an IP address via
DHCP, and the router assigns an unused address from a pool.