National Institute of Technology Kurukshetra
Computer Engineering
Semester - 4
Computer Networks
(CSPC26)
Submitted By : Ashok
Roll No : 12212133
Section : Cs – B (08)
Submitted To : Mr. Abdul
Date of Submission : 1 May 2024
Table of Contents
Contents Page No.
1) Internet and Intranet 1
2) Network Topologies 3
3) OSI Model 7
4) Computer Architectures 9
5) Network Devices 10
6) Networking Commands 12
7) Network Protocols 15
8) Communication using Network Devices 17
9) TCP IP, DNS, Header Files 20
Acknowledgement
I extend my deepest gratitude to Mr. Abdul for their
exceptional guidance, mentorship, and dedication
throughout the completion of this assignment. Their
expertise, encouragement, and constructive feedback
have been invaluable in shaping my understanding
and academic growth in Computer Networks
I am profoundly grateful for the opportunity to
learn from Mr. Abdul and for their unwavering
support, which has inspired me to strive for
excellence in my studies.
Ashok
12212133
1)Explain what is internet, how it is different from intranet
ANS :
Internet
The internet is a global network that connects millions of private, public, academic, business, and
government networks. It is a network of networks, allowing devices worldwide to communicate
and share information. The internet is accessible to anyone with an internet connection and
includes a vast range of information and services such as websites, email, social media, online
gaming, and more. It operates using the Transmission Control Protocol/Internet Protocol (TCP/IP)
suite and provides a decentralized structure with no single point of control.
Intranet
An intranet is a private network designed to support internal communication and information
sharing within an organization, company, or institution. It is typically used to facilitate
collaboration, store and share internal documents, host internal applications, and provide
employees with access to organizational resources. An intranet may use internet protocols and
technologies (like web browsers, servers, and email), but it is restricted to authorized users and
generally isolated from the public internet. Access to an intranet is limited to members of the
organization or those with proper authorization.
Key Differences Between Internet and Intranet
Scope:
The internet is global and accessible to anyone with an internet connection.
An intranet is private and accessible only to authorized users within an organization.
1)Purpose:
The internet provides information and services for public use and communication.
An intranet is designed for internal communication, collaboration, and resource sharing within
an organization.
2)Security:
The internet has varying levels of security and can be accessed by anyone, making it vulnerable
to cyber threats.
An intranet is generally more secure due to access restrictions and firewalls that isolate it from
the public internet.
3)Access:
The internet is accessible to the general public without restrictions.
An intranet is accessible only to users with proper authorization within an organization.
1) what do you mean by network topology, explain various types of network topologies
ANS :
Network topology refers to the arrangement or structure of various elements (nodes, links,
devices, etc.) within a computer network. It describes how different components are
interconnected, either physically or logically, to create a network. Network topologies play a
critical role in determining the network's efficiency, performance, scalability, fault tolerance, and
cost of maintenance.
Types of Network Topologies
There are several types of network topologies, each with its own characteristics, advantages, and
disadvantages. Let's explore the most common ones:
1. Bus Topology
In a bus topology, all network nodes are connected to a single communication cable (the "bus"),
with terminators at each end. Data is sent in both directions along the cable, and each node
checks whether the data is intended for them.
Advantages:
Simple and cost-effective to set up.
Requires less cabling compared to other topologies.
Disadvantages:
Difficult to troubleshoot and maintain.
A failure in the bus cable can bring down the entire network.
Limited scalability.
2. Star Topology
In a star topology, all nodes are connected to a central hub or switch. Communication between
nodes goes through this central device.
Advantages:
Easy to install and troubleshoot.
Centralized control of the network.
A failure of one node does not affect the rest of the network.
Disadvantages:
Requires more cabling compared to bus topology.
Failure of the central hub/switch can bring down the entire network.
3. Ring Topology
In a ring topology, nodes are connected in a circular fashion, forming a closed loop. Data travels
around the ring in one or both directions, with each node passing data along until it reaches the
intended recipient.
Advantages:
Efficient data transmission with minimal data collisions.
Can handle large volumes of traffic.
Disadvantages:
A break in the loop can disrupt the entire network.
Troubleshooting and maintaining can be complex.
4. Mesh Topology
In a mesh topology, nodes are interconnected with multiple pathways. Mesh networks can be
full-mesh (where every node is connected to every other node) or partial-mesh (where some
nodes are connected to multiple nodes).
Advantages:
Highly reliable and robust.
Offers redundancy; failure of one link does not impact the entire network.
Disadvantages:
Expensive due to high cabling and setup costs.
Complex to maintain and troubleshoot.
5. Tree Topology
Tree topology (also known as a hierarchical topology) combines elements of star and bus
topologies. It has a root node (or hub) from which branches extend to other nodes, creating a
hierarchical structure.
Advantages:
Scalable and suitable for large networks.
Easy to segment the network for maintenance.
Disadvantages:
Requires more cabling than other topologies.
3) explain OSI model in detail (this is important so write in detail)
ANS :
The Open Systems Interconnection (OSI) model is a conceptual framework used to describe the
functions of a networking or telecommunications system. It is designed to promote
interoperability between different network devices and systems by defining a standard
architecture. Developed by the International Organization for Standardization (ISO), the OSI
model consists of seven distinct layers, each serving a unique function within the overall
structure of network communication.
Let's explore the seven layers of the OSI model, starting from the bottom layer to the top, along
with their primary roles and responsibilities.
Layer 1: Physical Layer
The Physical Layer is the lowest layer of the OSI model. It defines the hardware aspects of
network communication, including the physical connection between devices and the
transmission of raw data bits.
Functions:
Defines electrical, optical, and mechanical interfaces for data transmission.
Specifies cables, connectors, signal types, data rates, and transmission methods.
Converts data into binary signals for transmission over the physical medium.
Examples:
Ethernet cables, fiber optics, Wi-Fi signals, and physical ports.
Layer 2: Data Link Layer
The Data Link Layer is responsible for error detection, correction, and framing. It ensures reliable
data transfer across the physical layer by organizing raw data into frames.
Functions:
Manages the addressing of devices on a local network (e.g., MAC addresses).
Provides error detection and correction mechanisms.
Handles flow control and frame synchronization.
Examples:
Ethernet, Wi-Fi, MAC addresses, switches, and bridges.
Layer 3: Network Layer
The Network Layer is responsible for routing and forwarding data packets between devices
across different networks. It establishes logical addressing and manages data paths through a
network.
Functions:
Determines the best path for data packets through routing.
Handles logical addressing (e.g., IP addresses).
Supports packet fragmentation and reassembly for efficient transmission.
Examples:
Internet Protocol (IP), routers, logical addresses, and routing tables.
Layer 4: Transport Layer
The Transport Layer manages end-to-end communication and data flow control. It ensures
reliable and ordered delivery of data between applications.
Functions:
Provides connection-oriented and connectionless communication.
Ensures reliable data transmission with error recovery and retransmission.
Supports flow control and segmentation of data into smaller packets.
Examples:
Transmission Control Protocol (TCP), User Datagram Protocol (UDP).
Layer 5: Session Layer
The Session Layer establishes, manages, and terminates communication sessions between
applications. It ensures proper synchronization and coordination during communication.
Functions:
Establishes and manages sessions for continuous communication.
Handles session checkpoints, recovery, and resynchronization.
Supports full-duplex, half-duplex, and simplex communication.
Examples:
Remote Procedure Call (RPC), session management, and session tokens.
Layer 6: Presentation Layer
The Presentation Layer is responsible for data translation, encryption, and compression. It
ensures that data is in a usable format for the application layer and handles data security.
Functions:
Translates data between different data formats and protocols.
Handles data encryption and decryption for security.
Manages data compression and decompression for efficient transmission.
Examples:
Secure Sockets Layer (SSL), Transport Layer Security (TLS), data encryption/decryption, and file
format translation.
Layer 7: Application Layer
The Application Layer is the topmost layer of the OSI model. It provides network services to end-
users and applications, allowing them to interact with the network.
Functions:
Supports application-specific protocols for data communication.
Provides user interfaces for accessing network resources.
Manages communication between network applications.
Examples:
Hypertext Transfer Protocol (HTTP), File Transfer Protocol (FTP), Simple Mail Transfer Protocol
(SMTP), and Domain Name System (DNS).
4)explain computer architecture
a) Client-Server architecture
b) Peer-to-Peer architecture
c) differentiate between client server and peer to peer
ANS : Computer architecture refers to the structure and organization of computing systems,
outlining how components interact and function together to perform computing tasks. Two
common architectures are Client-Server and Peer-to-Peer (P2P). Let's explore both architectures
and then discuss their differences.
Client-Server Architecture
In a Client-Server Architecture, the system is divided into two distinct parts: clients and servers.
Clients are devices or software applications that request services or resources from a server.
Servers are centralized systems or software applications that provide services or resources to
clients.
Characteristics:
Centralized: Servers act as central points for processing, storage, and control.
Resource Sharing: Clients request resources (data, services, etc.) from servers.
Request-Response Model: Clients send requests to servers, which respond with appropriate data
or services.
Scalability: Can scale by adding more servers or improving server hardware.
Examples:
Web servers providing web pages to clients (browsers).
Database servers handling data queries from client applications.
Email servers managing email communications for email clients.
Peer-to-Peer (P2P) Architecture
In a Peer-to-Peer Architecture, each node (peer) in the network has equivalent roles and
responsibilities. There is no centralized server, and peers communicate directly with each other
to share resources and information.
Characteristics:
Decentralized: Each peer can act as both a client and a server, requesting and providing
resources.
Direct Communication: Peers communicate directly without the need for a central server.
Scalability: Generally more scalable, as resources are distributed among many peers.
Fault Tolerance: If one peer fails, the network can continue to operate, thanks to distributed
resources.
Examples:
File-sharing networks (e.g., BitTorrent) where peers share files directly.
Decentralized blockchain networks where each node validates transactions.
Collaborative applications like Skype, where users connect directly.
Differentiating Client-Server and Peer-to-Peer
Here's a summary of the key differences between Client-Server and Peer-to-Peer architectures:
Centralization:
Client-Server is centralized, with dedicated servers controlling resources.
Peer-to-Peer is decentralized, with no central control.
Roles:
Client-Server has distinct roles for clients and servers.
Peer-to-Peer has equivalent roles for all peers, acting as both clients and servers.
Communication:
Client-Server uses a request-response model, with clients sending requests to servers.
Peer-to-Peer has direct communication between peers.
Scalability:
Client-Server may require additional servers or hardware upgrades for scalability.
Peer-to-Peer can scale more easily, as resources are distributed among peers.
Fault Tolerance:
Client-Server can be vulnerable to server failures.
Peer-to-Peer is more fault-tolerant, as there is no central point of failure.
Resource Sharing:
Client-Server involves centralized resource sharing from servers to clients.
Peer-to-Peer involves distributed resource sharing among peers.
5) Explain various network components in detail:
Router,hubs,switches,bridge,gateway,firewall
ANS:
Router
A router is a network device that connects multiple networks and directs data traffic between
them. Routers operate at the Network Layer (Layer 3) of the OSI model and use routing protocols
to determine the best path for data packets to reach their destination.
Function:
Routes data packets between different networks or subnets.
Maintains routing tables to determine optimal paths.
Supports Network Address Translation (NAT) for translating private IP addresses to public ones.
Examples:
Home routers connecting local devices to the internet.
Enterprise routers managing complex network topologies.
Virtual routers in cloud environments.
Hub
A hub is a simple networking device that connects multiple devices in a Local Area Network
(LAN). Hubs operate at the Physical Layer (Layer 1) of the OSI model and do not have intelligence
for data routing or filtering.
Function:
Broadcasts incoming data packets to all connected devices.
Does not distinguish between different devices or data traffic.
Functions as a central connection point for a network.
Examples:
Basic hubs used in small LANs.
USB hubs for expanding USB connectivity.
Switch
A switch is a more intelligent network device than a hub, operating at the Data Link Layer (Layer
2) of the OSI model. Switches use Media Access Control (MAC) addresses to direct data packets
to specific devices.
Function:
Directs data packets to the correct destination based on MAC addresses.
Reduces network congestion by preventing data broadcast to all devices.
Supports full-duplex communication for simultaneous data transmission.
Examples:
Ethernet switches in enterprise networks.
Managed switches with advanced features like VLANs and QoS.
Unmanaged switches for simple network setups.
Bridge
A bridge is a network device that connects two or more network segments, typically within the
same LAN. Bridges operate at the Data Link Layer (Layer 2) of the OSI model and help reduce
network traffic by filtering packets.
Function:
Connects multiple network segments and reduces traffic by filtering data.
Forwards packets based on MAC addresses.
Can be used to extend a network by connecting separate LAN segments.
Examples:
Network bridges connecting different subnets.
Wireless bridges linking wireless and wired networks.
Gateway
A gateway is a network component that acts as a "gate" between different networks or systems,
providing protocol translation and connectivity between disparate environments. Gateways
operate at various layers of the OSI model, depending on their function.
Function:
Connects different networks or systems with different protocols.
Translates data between different formats or protocols.
Acts as an entry/exit point for networks.
Examples:
Internet gateways connecting internal networks to the internet.
Email gateways for filtering and managing email traffic.
VoIP gateways for converting voice signals to digital data.
Firewall
A firewall is a security device that monitors and controls incoming and outgoing network traffic
based on defined security rules. Firewalls operate at multiple layers of the OSI model and are
crucial for protecting networks from unauthorized access and cyber threats.
Function:
Monitors network traffic and enforces security policies.
Blocks or allows traffic based on security rules.
Protects networks from unauthorized access and cyber threats.
Examples:
Hardware firewalls for enterprise networks.
Software firewalls for individual devices.
Next-generation firewalls with advanced threat detection.
6)study and explain the following commands
1)ipconfig
2)ping
3)ping all
4)packetTracing
ANS :
1) ipconfig
ipconfig is a command-line utility used to display and manage network configuration information
on a Windows operating system. It provides details about network interfaces, such as IP
addresses, subnet masks, default gateways, and more.
Usage:
Displays IP address information for all network interfaces.
Can release or renew DHCP-assigned IP addresses.
Provides DNS server and WINS server information.
Common Options:
ipconfig /all: Displays detailed information for all network interfaces, including MAC addresses
and DNS configurations.
ipconfig /release: Releases the DHCP-assigned IP address for a specified interface.
ipconfig /renew: Renews the DHCP-assigned IP address for a specified interface.
ipconfig /flushdns: Clears the DNS cache to resolve DNS-related issues.
2) ping
ping is a network utility that tests connectivity between a source and a target host. It sends
Internet Control Message Protocol (ICMP) echo requests to the target and listens for echo replies
to determine if the target is reachable.
Usage:
Checks if a target host or IP address is reachable on the network.
Measures round-trip time (latency) for packets sent to the target.
Helps diagnose network connectivity issues.
Common Options:
ping <hostname>: Sends ICMP echo requests to the specified hostname or IP address.
ping -n <count> <hostname>: Sends a specified number of echo requests.
ping -t <hostname>: Continuously pings the target until interrupted.
3) ping all
The command ping all doesn't exist as a standard command. However, its meaning could refer to
pinging multiple targets in a network to test connectivity. A script or utility can be used to ping all
devices in a network or a specified list of hosts to ensure they are reachable.
Example:
A script that pings all IP addresses in a specified range to find live hosts on a network.
A utility that pings multiple hosts simultaneously for network monitoring.
4) packetTracing
packetTracing is not a standard command or utility but could refer to a process or tool for tracing
packets through a network. Packet tracing involves capturing and analyzing network packets to
understand data flows, troubleshoot network issues, and identify security threats.
Common Tools:
Wireshark: A popular packet capture and analysis tool used to inspect network traffic.
Tcpdump: A command-line packet capture utility commonly used in UNIX/Linux environments.
Traceroute: A utility that traces the path packets take through a network to reach a destination.
Usage:
Diagnoses network issues by analyzing packet data.
Identifies performance bottlenecks by examining packet delays and routing paths.
Detects security threats by monitoring suspicious network traffic.
Conclusion
ipconfig is used to manage and display network configuration information on Windows.
ping checks if a host is reachable and measures network latency.
ping all could refer to pinging multiple targets to check network connectivity.
packetTracing is a concept involving packet capture and analysis to understand and troubleshoot
network traffic.
7)Explain the folowing protocols--
1) ARP
2) RARP
3) Handshake Protocol
ANS :
1) Address Resolution Protocol (ARP)
Address Resolution Protocol (ARP) is a network protocol used to map an IP address to a
corresponding Media Access Control (MAC) address in a local area network (LAN). It operates at
the Data Link Layer (Layer 2) of the OSI model and is essential for IP-based communication within
a LAN.
Function:
ARP resolves an IP address to a MAC address, allowing network devices to communicate over
Ethernet.
When a device needs to send data to an IP address on the same network, it uses ARP to find the
MAC address associated with that IP address.
How It Works:
When a device (the "requester") needs the MAC address for a specific IP address, it broadcasts
an ARP request packet to all devices on the local network.
The device with the matching IP address (the "responder") sends an ARP reply with its MAC
address.
The requester stores the IP-to-MAC mapping in its ARP cache for future use.
Security Considerations:
ARP spoofing or ARP poisoning is a type of attack where a malicious device sends fake ARP
replies to trick other devices into sending traffic to the wrong MAC address. This can lead to data
interception or network disruption.
2) Reverse Address Resolution Protocol (RARP)
Reverse Address Resolution Protocol (RARP) is a network protocol used to map a MAC address to
a corresponding IP address. It operates at the Data Link Layer (Layer 2) of the OSI model. RARP is
used in environments where devices have a MAC address but do not know their own IP address
(e.g., diskless workstations).
Function:
RARP resolves a MAC address to an IP address, allowing devices to obtain their IP address from a
central server.
It is typically used in older network setups where devices need to boot from a network without
knowing their IP address.
How It Works:
A device sends a RARP request to a central server, providing its MAC address.
The RARP server responds with the corresponding IP address.
The device then uses this IP address for network communication.
Replacement:
RARP has been largely replaced by the Dynamic Host Configuration Protocol (DHCP), which offers
more advanced features and flexibility in assigning IP addresses.
3) Handshake Protocol
The Handshake Protocol is a fundamental concept in secure network communication, particularly
in protocols like Transport Layer Security (TLS) and Secure Sockets Layer (SSL). It is used to
establish a secure and encrypted connection between a client and a server.
Function:
Establishes a secure communication channel by negotiating encryption algorithms, session keys,
and authentication methods.
Ensures data transmitted between client and server is encrypted and secure from eavesdropping
or tampering.
How It Works:
The client initiates the handshake by sending a request to the server to start a secure session.
The server responds with its digital certificate, which contains its public key and identity
information.
The client validates the server's certificate, ensuring it's issued by a trusted certificate authority
(CA).
Both client and server agree on an encryption algorithm and generate a session key to encrypt
communication.
Once the secure session is established, data is transmitted using the agreed-upon encryption and
session key.
Applications:
Handshake protocols are used in secure web communication (HTTPS), secure email (SSL/TLS),
and other secure network protocols.
The handshake establishes trust between client and server, providing authentication and
encryption to ensure secure communication.
8) How commmunication happens between networks using devices
ANS:
Communication between networks involves multiple steps and components to ensure data is
transmitted accurately. Here's a breakdown of the process:
Step 1: Establishing a Connection
When a device on one network wants to communicate with a device on another network, it
needs to establish a connection. This involves several key steps:
Address Resolution: The device initiating the communication needs the IP address of the target
device. It uses protocols like ARP to resolve IP addresses to MAC addresses for communication
within a local network.
Routing: Routers play a crucial role in directing data packets between networks. They maintain
routing tables that contain information about the best paths to reach different networks.
Step 2: Data Transmission
Once the connection is established, data transmission can occur between networks. This process
involves encapsulating data into packets and sending them through various network devices:
Encapsulation: Data is encapsulated into packets, which contain headers with source and
destination addresses, sequence numbers, error-checking information, and more.
Routing: Routers determine the best path for the data packets and forward them accordingly.
This may involve traversing multiple networks and routers to reach the final destination.
Switching: Switches operate within local networks to direct data packets to the correct device
based on MAC addresses. They play a key role in reducing network congestion.
Step 3: Data Reception and Decapsulation
When the data packets reach their destination network, they go through the following steps:
Decapsulation: The receiving device removes the packet headers to extract the original data. This
process involves checking for errors and ensuring data integrity.
Processing: The data is processed according to the application or protocol. For example, a web
server processes HTTP requests, while an email server processes email messages.
Response: If needed, the receiving device generates a response and sends it back to the initiating
device, following the same steps for routing, switching, and transmission.
Communication Protocols and Security
Throughout the communication process, various protocols and security mechanisms are used to
ensure reliable and secure data transmission:
Transport Protocols: TCP and UDP are the primary transport protocols used for data
transmission. TCP provides reliable, connection-oriented communication, while UDP offers faster,
connectionless communication.
Security: Firewalls, encryption protocols (like SSL/TLS), and other security measures are
employed to protect data and prevent unauthorized access.
Network Services: Protocols like DNS (Domain Name System) and DHCP (Dynamic Host
Configuration Protocol) support network communication by resolving domain names to IP
addresses and assigning IP addresses dynamically.
9) explain
a)TCP/IP Model
b)DNS
c)Header files and their details
ANS:
a) TCP/IP Model
The TCP/IP (Transmission Control Protocol/Internet Protocol) Model is a foundational framework
for modern networking and the Internet. It describes a suite of communication protocols used to
connect devices and enable data exchange over networks. Developed by the U.S. Department of
Defense in the 1970s, the TCP/IP model has four layers, each with specific functions in network
communication.
Layer 1: Network Interface Layer
Corresponds to the Physical and Data Link layers of the OSI model.
Manages physical connections and low-level data transmission between network devices.
Includes protocols like Ethernet, Wi-Fi, and other network interface protocols.
Layer 2: Internet Layer
Maps to the Network Layer of the OSI model.
Handles IP addressing, packet routing, and forwarding across different networks.
Internet Protocol (IP) is the core protocol in this layer, providing unique IP addresses for devices
and defining packet routing.
Layer 3: Transport Layer
Aligns with the Transport Layer of the OSI model.
Provides end-to-end communication, data reliability, and flow control.
Transmission Control Protocol (TCP) ensures reliable, connection-oriented communication.
User Datagram Protocol (UDP) offers connectionless, faster communication with reduced
overhead.
Layer 4: Application Layer
Corresponds to the Application, Presentation, and Session layers of the OSI model.
Facilitates network services and user applications.
Includes protocols like HTTP (web), SMTP (email), FTP (file transfer), and DNS (domain name
resolution).
b) DNS (Domain Name System)
Domain Name System (DNS) is a protocol and system that maps human-readable domain names
to IP addresses. It is essential for Internet communication, allowing users to use easily
remembered domain names instead of IP addresses to access websites and online services.
Function:
Resolves domain names to IP addresses, enabling users to connect to websites and online
services.
Maintains a distributed database of domain name mappings across DNS servers.
Supports record types like A (address), CNAME (canonical name), MX (mail exchange), and TXT
(text).
How It Works:
When a user enters a domain name in a browser, a DNS query is made to a DNS server.
The DNS server returns the corresponding IP address for the domain name.
If the server doesn't have the information, it queries other DNS servers in a hierarchical manner
to find the IP address.
Once resolved, the IP address is used to establish a network connection.
Importance:
DNS enables user-friendly domain names and ensures a seamless Internet experience.
It is a critical component of the Internet's infrastructure, ensuring that domain names are
resolved quickly and accurately.
c) Header Files and Their Details
In computer networks, a header is supplemental information at the beginning of a data packet
that contains important data for transmission. Headers help control the flow of data packets so
that they can be transmitted effectively from system to system. Headers typically include:
addressing information, routing information, protocol version, and packet type and size. The data
that follows the header is sometimes called the payload or body. For example, in an IP packet,
the header contains information about the IP version, source IP address, destination IP address,
and time-to-live. The payload is typically a datagram or segment of the higher-level transport
layer protocol. Each layer of OSI or TCP/IP models provides different protocols for communicating
over computer networks, and each protocol has a particular header.