0% found this document useful (0 votes)
2 views7 pages

Computer Network Notes

Computer network notes for begginers. Detailed explanation of module And quick revision Techniques

Uploaded by

Subham SiNgh
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)
2 views7 pages

Computer Network Notes

Computer network notes for begginers. Detailed explanation of module And quick revision Techniques

Uploaded by

Subham SiNgh
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/ 7

Computer Networks: (Modules 3, 4, & 5)

MODULE 3: THE NETWORK LAYER


Role: Source-to-Destination Delivery (Host-to-Host)

The Network layer is the complex "glue" that connects disparate networks (LANs, WANs) together to
form an internetwork. While the Data Link layer handles node-to-node delivery within a single wire/link,
the Network layer is responsible for routing packets across the entire globe.

1. Introduction and Services


The Network Layer provides the functional and procedural means of transferring variable-length data
sequences.
Packetizing: The encapsulation of data from the Transport Layer into "Packets" or "Datagrams".
This involves adding a header containing the source and destination logical addresses.
Routing: The process of selecting the optimal path for traffic in a network or between or across
multiple networks.
Forwarding: The local action of moving a packet from an input interface of a router to the
appropriate output interface based on the forwarding table.

2. Logical Addressing: IPv4


An IP address is a 32-bit logical address that uniquely identifies a host interface on the network.

Classful Addressing (Legacy Architecture)


Originally, the IP address space was divided into five classes based on the leading bits. This method is
now obsolete due to address wastage but is fundamental to understanding IP history.

Class Leading Network Host Range Default Usage


Bits ID ID Mask

A 0 8 bits 24 0.0.0.0 - /8 Huge networks (governments,


bits 127.255.255.255 early ISPs)

B 10 16 bits 16 128.0.0.0 - /16 Mid-sized universities/corps


bits 191.255.255.255

C 110 24 bits 8 bits 192.0.0.0 - /24 Small LANs


223.255.255.255

D 1110 N/A N/A 224.0.0.0 - N/A Multicast


239.255.255.255

E 1111 N/A N/A 240.0.0.0 - N/A Experimental/Reserved


255.255.255.255
Classless Addressing (CIDR - Classless Inter-Domain Routing)
To solve address exhaustion, CIDR was introduced.
Concept: It eliminates fixed classes. The boundary between the Network ID and Host ID can be at
any bit position.
Slash Notation: Represented as A.B.C.D/n , where n is the prefix length (number of network
bits).
Block Allocation: ISPs interpret addresses as blocks. This allows for Supernetting (Route
Aggregation), where multiple small networks are advertised as one large route to reduce routing
table size on the internet backbone.

Subnetting
Subnetting is the logical division of a network.
Mechanism: It involves borrowing bits from the Host ID portion to create a Subnet ID.
Formula: If we borrow n bits, we create 2n subnets.
Variable Length Subnet Mask (VLSM): Advanced subnetting where different subnets within the
same network can have different mask lengths (e.g., a /30 for a router link and a /24 for a user
LAN). This maximizes address efficiency.

3. Delivery and Forwarding

Direct vs. Indirect Delivery


1. Direct Delivery: The source and destination are on the same physical network (e.g., same Wi-Fi or
Ethernet switch). The sender checks the network mask, realizes the destination is local, uses ARP to
find the destination MAC, and sends the frame directly.
2. Indirect Delivery: The destination is on a different network. The packet is sent to the Default
Gateway (Router). The router then forwards it to the next hop.

Router Structure and Switching Techniques


A router is a specialized computer with four main components:
1. Input Ports: Perform physical layer termination, data link decapsulation, and Lookup (checking the
destination IP against the forwarding table).
2. Switching Fabric: The internal pathway connecting input ports to output ports.
Switching via Memory: The CPU copies the packet from input to memory, then to output
(slow).
Switching via Bus: Input ports access a shared bus to transfer the packet (bandwidth limited
by bus speed).
Switching via Interconnection Network (Crossbar): A matrix of connections allowing multiple
packets to be transferred simultaneously (high performance).
3. Output Ports: Queuing and encapsulation for transmission on the outgoing link.
4. Routing Processor: The "Control Plane" CPU that runs routing protocols (OSPF, BGP) and maintains
the routing table.
4. Network Layer Protocols

ARP (Address Resolution Protocol)


Function: Maps a known logical address (IP) to an unknown physical address (MAC).
Operation: Broadcasts a "Who has IP X?" packet. The owner of IP X replies with "I have IP X, my
MAC is Y" (Unicast).

RARP (Reverse ARP)


Function: Maps a MAC address to an IP address. Used by diskless workstations to find their own IP
upon booting.
Status: Obsolete; replaced by BOOTP and DHCP.

ICMP (Internet Control Message Protocol)


Role: The "mechanic" of the network. IP is unreliable; ICMP reports errors.
Key Message Types:
Type 3 (Destination Unreachable): Router cannot deliver the packet.
Type 11 (Time Exceeded): TTL dropped to 0 (Used by traceroute ).
Type 0 & 8 (Echo Reply/Request): Used by ping .

5. Routing Protocols

Unicast Routing (One-to-One)


1. RIP (Routing Information Protocol):
Type: Distance Vector.
Metric: Hop Count (Max 15).
Operation: "Routing by rumor." Routers broadcast their full table to neighbors every 30
seconds. Slow convergence; prone to routing loops.
2. OSPF (Open Shortest Path First):
Type: Link State.
Metric: Cost (Bandwidth).
Operation: Uses Dijkstra’s Algorithm. Routers flood Link State Advertisements (LSAs) to build a
complete topology map. Fast convergence; hierarchical design (Areas).
3. BGP (Border Gateway Protocol):
Type: Path Vector (Inter-AS).
Metric: Policy-based (AS-PATH).
Role: The protocol of the Internet backbone. It connects different Autonomous Systems (AS). It
prevents loops by tracking the full path of AS numbers a packet has traversed.

Multicast Routing (One-to-Many)


Goal: Deliver a packet to a group of destinations efficiently (without sending duplicates on the
same link).
Techniques: Source-Based Trees (DVMRP) and Group-Shared Trees (PIM).

MODULE 4: THE TRANSPORT LAYER


Role: Process-to-Process Delivery

While the Network layer gets data to the correct computer, the Transport layer gets data to the correct
application (process) running on that computer.

1. Core Concepts
Process-to-Process Communication: Achieved via Socket Addresses (IP Address + Port Number).
Well-known Ports: 0-1023 (e.g., HTTP 80).
Registered Ports: 1024-49151.
Dynamic/Ephemeral Ports: 49152-65535 (Used by clients).
Encapsulation/Decapsulation: Adding a Transport Header containing Port Numbers, Sequence
Numbers, and Checksums.

2. Services: Connectionless vs. Connection-Oriented


Datagrams (Connectionless): Packets are treated independently. No setup phase. Packets may
take different paths and arrive out of order (UDP).
Virtual Circuits (Connection-Oriented): A logical path is established before data transfer. All
packets follow the same path and arrive in order (TCP).

3. Control Mechanisms

Flow Control
Prevents the sender from overwhelming the receiver.
Mechanism: Sliding Window Protocol. The receiver advertises a "Window Size" (amount of buffer
space available). The sender cannot send more bytes than the window allows.

Error Control
Ensures reliability (Data Integrity).
Tools: Checksum (detection), Acknowledgments (ACKs), Timeouts, and Retransmission.
ARQ (Automatic Repeat Request): The strategy of retransmitting lost data.

Congestion Control
Prevents the sender from overwhelming the network (routers/switches).
Open Loop: Prevention policies (retransmission timers, window policies).
Closed Loop: Removal policies (detection of congestion and reducing rate).

4. Transport Protocols (Theoretical Models)


To understand TCP, we study these foundational ARQ protocols:
1. Simple Protocol: No flow/error control. Assumes ideal channel.
2. Stop-and-Wait: Sender sends one frame, stops, and waits for ACK. Very inefficient line utilization.
3. Go-Back-N (GBN):
Sender window size > 1.
Cumulative ACK: ACK n means "I have received everything up to n , expecting n+1 ".
Flaw: If packet 5 is lost, receiver discards 6, 7, 8. Sender must retransmit 5, 6, 7, 8. High
bandwidth waste.
4. Selective Repeat (SR):
Sender and Receiver both have windows.
Individual ACK: Receiver accepts out-of-order packets and buffers them.
Only the specific lost packet is retransmitted. Complex logic but efficient.

5. Internet Transport Protocols: TCP & UDP

UDP (User Datagram Protocol)


Characteristics: Unreliable, Connectionless, Lightweight.
Header: Source Port, Dest Port, Length, Checksum (8 bytes total).
Use Cases: DNS, VoIP, Video Streaming, Gaming (where speed > reliability).

TCP (Transmission Control Protocol)


Characteristics: Reliable, Connection-oriented, Byte-stream.
Connection Management:
Setup: 3-Way Handshake (SYN → SYN-ACK → ACK). Prevents old duplicate connection
requests from confusing the server.
Teardown: 4-Way Handshake (FIN → ACK → FIN → ACK).
TCP Congestion Control Algorithms:
1. Slow Start: Start with Congestion Window (cwnd) = 1 MSS. Double cwnd every RTT (Exponential
growth) until a threshold (ssthresh).
2. Congestion Avoidance: After ssthresh, increase cwnd by 1 MSS every RTT (Linear growth).
3. Fast Retransmit: If 3 duplicate ACKs are received, retransmit immediately without waiting for
timeout.

MODULE 5: THE APPLICATION LAYER


Role: Providing Services to the User

This layer contains the protocols that software applications use to communicate over the network. It
does not refer to the application itself (like Chrome or Outlook), but the protocols they use (HTTP,
SMTP).
1. Application Architecture

Client-Server Architecture
Server: Always-on host, permanent IP address, massive server farms for scaling.
Client: Communicates with server, may be intermittently connected, dynamic IP addresses, do not
communicate directly with each other.
Interface: Sockets. A socket is an API between the Application and Transport layers.

Peer-to-Peer (P2P) Architecture


Concept: Minimal reliance on dedicated servers. Peers communicate directly.
Scalability: Self-scaling—new peers bring new service capacity (processing/storage), unlike client-
server where new clients just add load.

2. Application Layer Protocols

HTTP (HyperText Transfer Protocol)


Usage: The Web.
Transport: TCP Port 80.
Versions:
Non-Persistent (HTTP/1.0): Opens TCP connection, fetches ONE object, closes connection.
High overhead.
Persistent (HTTP/1.1): Keeps connection open for multiple objects (images, scripts) on a page.
Stateless: Server maintains no information about past client requests (Cookies are used to add
state).

FTP (File Transfer Protocol)


Usage: Transferring files.
Transport: TCP.
Out-of-band Control: Uses two parallel TCP connections:
1. Control Connection (Port 21): Sends commands (USER, PASS, LIST).
2. Data Connection (Port 20): Transfers the actual file data.

Electronic Mail Protocols (SMTP, POP, IMAP)


SMTP (Simple Mail Transfer Protocol):
Role: PUSH protocol. Used to send mail from User Agent to Server, and between Servers.
Transport: TCP Port 25.
Encoding: Requires 7-bit ASCII (MIME is used for non-ASCII data).
POP3 (Post Office Protocol v3):
Role: PULL protocol. Used by user to retrieve mail.
Behavior: "Download and Delete." Not good for multiple devices.
IMAP (Internet Message Access Protocol):
Role: PULL protocol (Access).
Behavior: Keeps mail on server. User organizes folders on server. Synchronizes state across
devices (Read/Unread).

DNS (Domain Name System)


Role: Translates Hostnames (www.google.com) to IP Addresses (142.250.x.x).
Transport: UDP Port 53 (for speed).
Hierarchy:

Shutterstock

1. Root DNS Servers: The top of the tree (13 logical servers worldwide).
2. Top-Level Domain (TLD) Servers: Handle .com , .org , .edu .
3. Authoritative DNS Servers: Hosted by organizations, containing the actual mappings.
Resolution:
It ti "I d 't k b t k thi "

You might also like