Unit1 - Subjective Questions
CSE306 • Practice Questions with Detailed Answers
Define a Computer Network. Discuss the primary advantages of establishing a computer network.
Computer Network:
A computer network is a set of interconnected computers and devices that share resources and data. The connections between nodes are generally established using either cable media or wireless media.
Primary Advantages:
- Resource Sharing: Allows multiple users to share hardware (like printers and hard drives) and software.
- Communication: Facilitates fast and reliable communication through emails, video conferencing, and instant messaging.
- Data Sharing and Management: Centralized databases allow easy data access, updates, and backups.
- Cost Effectiveness: Sharing software and hardware resources significantly reduces the cost of setting up a business infrastructure.
- Reliability: If one computer fails, data can often be recovered or accessed from another computer in the network.
Explain the different types of computer networks (LAN, MAN, WAN) based on their geographical spread.
Computer networks are broadly categorized into three types based on their geographical coverage:
-
LAN (Local Area Network):
- Scope: Covers a small geographical area such as a single room, building, or campus.
- Characteristics: High data transfer rate, low error rate, and usually privately owned.
- Example: A network within an office or a home.
-
MAN (Metropolitan Area Network):
- Scope: Covers a larger area than a LAN, typically spanning a city or a large campus.
- Characteristics: Formed by connecting multiple LANs. Can be owned by a single organization or a public consortium.
- Example: Cable TV network in a city.
-
WAN (Wide Area Network):
- Scope: Covers a large geographical area, such as a country, continent, or the entire globe.
- Characteristics: Lower data transfer rates compared to LANs, higher latency, and uses public telecommunication links.
- Example: The Internet.
Describe the concept of network software architecture. Explain the significance of layers, protocols, and interfaces.
Network Software Architecture:
Network software architecture refers to the highly structured, layered design of network software that dictates how communication occurs between devices. To reduce design complexity, most networks are organized as a stack of layers.
Key Components:
- Layers: The architecture is divided into manageable layers. Each layer provides specific services to the layer above it while hiding the implementation details.
- Protocols: A protocol is a set of rules and conventions that govern how entities in the same layer (peer entities) on different machines communicate with each other.
- Interfaces: An interface defines the primitive operations and services the lower layer makes available to the upper layer. Clear interfaces make it easier to replace the implementation of one layer without affecting others.
Significance:
This modular approach simplifies troubleshooting, standardizes communication, and allows interoperability between different vendors' hardware and software.
What is a network topology? Explain Bus, Star, and Ring topologies with their advantages and disadvantages.
Network Topology:
It refers to the physical or logical layout of a network, defining how different nodes are connected to each other.
1. Bus Topology:
- Description: All devices are connected to a single central cable, called the bus or backbone.
- Advantages: Easy to install; cost-effective for small networks.
- Disadvantages: If the main cable fails, the entire network fails; performance degrades with heavy traffic.
2. Star Topology:
- Description: All devices are connected to a central device (like a Hub or Switch).
- Advantages: Easy to manage and troubleshoot; failure of one cable does not affect the rest of the network.
- Disadvantages: If the central device fails, the whole network goes down; requires more cable than a bus topology.
3. Ring Topology:
- Description: Devices are connected in a closed-loop fashion. Each device is connected to exactly two other devices.
- Advantages: Data flows in one direction, reducing collisions; performs well under heavy load.
- Disadvantages: A break in the ring can disable the entire network; adding or removing devices disrupts the network.
Derive the formula for the number of physical links required in a fully connected Mesh topology. If a network has 6 nodes, how many links are needed?
Derivation:
In a fully connected mesh topology, every node is connected to every other node.
If there are nodes in the network, the first node needs to connect to nodes. The second node needs to connect to nodes, but its connection to the first node is already counted, so it requires new connections.
This forms an arithmetic progression: .
The sum of the first integers is given by the formula:
where is the total number of physical links.
Calculation for 6 nodes:
Given .
Therefore, a fully connected mesh network with 6 nodes requires 15 physical links.
Differentiate between a Hub and a Switch.
Both Hubs and Switches are connecting devices in a network, but they operate differently:
- Layer of Operation: A Hub operates at the Physical layer (Layer 1) of the OSI model, whereas a Switch operates at the Data Link layer (Layer 2).
- Data Transmission: A Hub broadcasts incoming data packets to all connected ports regardless of the destination. A Switch reads the MAC address of the destination and forwards the packet only to the specific port where the destination device is connected.
- Collision Domain: In a Hub, all ports belong to a single collision domain, leading to high packet collisions. In a Switch, every port forms a separate collision domain, drastically reducing collisions.
- Bandwidth: A Hub shares its total bandwidth among all connected devices. A Switch provides dedicated bandwidth to each port.
- Intelligence: A Hub is a "dumb" device; it cannot inspect data. A Switch is "intelligent" as it maintains a MAC address table to make forwarding decisions.
What is the role of a Router in a computer network? How does it differ from a Switch?
Role of a Router:
A Router is a networking device that forwards data packets between different computer networks. It operates at the Network Layer (Layer 3) of the OSI model. Its primary roles are:
- Routing: Determining the best path for data to travel from the source to the destination network using routing algorithms and routing tables.
- Network Interconnection: Connecting different networks together (e.g., a home LAN to the ISP's WAN).
- IP Addressing: Using IP addresses to identify devices and networks to forward packets appropriately.
Difference from a Switch:
- Layer: Router operates at Layer 3 (Network Layer); Switch operates at Layer 2 (Data Link Layer).
- Addresses Used: Router uses logical IP addresses; Switch uses physical MAC addresses.
- Function: A Switch connects devices within a single network (LAN) to create a network. A Router connects multiple networks together to form an internetwork.
- Broadcast Domain: A Router breaks broadcast domains (each interface is a separate broadcast domain), whereas a default Switch operates within a single broadcast domain.
Explain the concept of Packets and Packet Switching in computer networks.
Concept of Packets:
In computer networking, a packet is a formatted unit of data carried by a packet-switched network. Instead of sending a large file as a single continuous stream of bits, the network software divides the data into smaller, manageable chunks called packets. Each packet contains:
- Header: Source/destination addresses, sequence numbers, and protocol information.
- Payload: The actual user data.
- Trailer: Error checking information (like CRC).
Packet Switching:
Packet switching is a method of transmitting data in which messages are divided into packets before they are sent.
- Each packet is routed individually from source to destination.
- Packets belonging to the same message may take different routes depending on network congestion and availability.
- Upon reaching the destination, the packets are reassembled into the original message based on their sequence numbers.
- Advantage: It highly optimizes the use of available channel capacity and increases network robustness, as missing links can be bypassed dynamically.
Compare and contrast IP Address and MAC Address.
Both are unique identifiers used in networking, but they serve different purposes:
MAC Address (Media Access Control Address):
- Nature: It is a physical address embedded into the network interface card (NIC) by the manufacturer.
- Length: It is a 48-bit (6-byte) address, usually represented in hexadecimal format (e.g., 00:1A:2B:3C:4D:5E).
- Layer: Operates at the Data Link Layer (Layer 2) of the OSI model.
- Scope: Used for local identification within the same network segment (LAN).
- Mutability: Generally fixed and permanent (though it can be spoofed in software).
IP Address (Internet Protocol Address):
- Nature: It is a logical address assigned by a network administrator or dynamically via DHCP.
- Length: 32 bits for IPv4 (e.g., 192.168.1.1) and 128 bits for IPv6.
- Layer: Operates at the Network Layer (Layer 3) of the OSI model.
- Scope: Used for global identification and routing across different networks.
- Mutability: Dynamic; changes when a device moves to a different network.
Provide an overview of the OSI Reference Model. List its seven layers in order.
OSI Reference Model Overview:
The Open Systems Interconnection (OSI) model is a conceptual framework created by the International Organization for Standardization (ISO) to standardize the functions of a telecommunication or computing system into seven distinct logical layers. It helps in understanding and designing network architectures by breaking down the complex process of networking into more manageable sub-tasks.
The Seven Layers (From Bottom to Top):
- Physical Layer: Deals with the physical transmission of raw bits over a communication medium.
- Data Link Layer: Provides node-to-node data transfer and handles error correction from the physical layer.
- Network Layer: Handles routing of data packets across different networks using logical addresses (IP).
- Transport Layer: Ensures reliable, transparent transfer of data between end systems (segmentation, error recovery, flow control).
- Session Layer: Establishes, manages, and terminates connections (sessions) between applications.
- Presentation Layer: Translates, encrypts, and compresses data so it can be understood by the application layer.
- Application Layer: Provides network services directly to end-user applications (e.g., HTTP, FTP, SMTP).
Explain the functions of the Physical Layer and Data Link Layer in the OSI model.
1. Physical Layer:
- Function: It is responsible for the actual physical connection between the devices. It transmits individual bits from one node to the next over physical media.
- Responsibilities include:
- Defining hardware specifications (cables, connectors).
- Line coding and bit synchronization.
- Defining network topology (Bus, Star, etc.) physically.
- Devices: Hubs, Repeaters, Cables.
2. Data Link Layer:
- Function: It transforms the physical layer into a reliable link. It makes the physical layer appear error-free to the upper layer.
- Responsibilities include:
- Framing: Divides the stream of bits received from the network layer into manageable data units called frames.
- Physical Addressing: Adds a header containing the MAC addresses of the sender and receiver.
- Error Control: Detects and potentially corrects errors that may have occurred in the physical layer (e.g., using CRC).
- Flow Control: Regulates the amount of data sent to prevent overwhelming the receiver.
- Devices: Switches, Bridges.
Explain the TCP/IP protocol suite. What are its distinct layers?
TCP/IP Protocol Suite:
The Transmission Control Protocol/Internet Protocol (TCP/IP) suite is the foundational communication language or protocol of the Internet. It is a concise, practical model designed to allow diverse computer networks to interconnect and communicate efficiently.
Layers of the TCP/IP Model:
- Network Access Layer (Link Layer):
- Corresponds to the OSI's Physical and Data Link layers.
- Defines how data is physically sent through the network, dealing with MAC addresses, Ethernet, and Wi-Fi protocols.
- Internet Layer:
- Corresponds to the OSI's Network layer.
- Responsible for logical transmission of packets over the entire network. Key protocol is IP (Internet Protocol), handling addressing and routing.
- Transport Layer:
- Corresponds to the OSI's Transport layer.
- Provides end-to-end data delivery services. Key protocols are TCP (reliable, connection-oriented) and UDP (unreliable, connectionless).
- Application Layer:
- Combines the OSI's Session, Presentation, and Application layers.
- Contains high-level protocols used by applications for network communication, such as HTTP, FTP, SMTP, and DNS.
Compare the OSI Model and the TCP/IP Model.
Comparison between OSI and TCP/IP Models:
- Number of Layers:
- OSI has 7 layers (Physical, Data Link, Network, Transport, Session, Presentation, Application).
- TCP/IP has 4 layers (Network Access, Internet, Transport, Application).
- Origin and Concept:
- OSI is a conceptual, theoretical model developed by ISO to standardize network communication. It was defined before the protocols were invented.
- TCP/IP is a practical, protocol-oriented model developed by DARPA. It was defined after the protocols were created, specifically for the Internet.
- Layer Functions:
- In OSI, Session and Presentation layers are distinct.
- In TCP/IP, the functions of Session and Presentation layers are integrated into the Application layer.
- Reliability:
- The OSI network layer supports both connectionless and connection-oriented communication.
- The TCP/IP Internet layer originally only supported connectionless communication (IP), leaving reliability entirely to the Transport layer (TCP).
- Strictness: OSI has strict boundaries between layers, whereas TCP/IP is more flexible.
What are the core functions of the Transport Layer in the OSI model?
The Transport Layer (Layer 4) provides end-to-end communication services for applications. Its core functions include:
- Segmentation and Reassembly: It accepts large chunks of data from the Session layer, breaks them down into smaller pieces called segments, and assigns a sequence number to each. At the destination, it reassembles the segments into the original message.
- Service-Point Addressing (Port Addressing): It uses port numbers to ensure that the data is delivered to the correct specific application process running on the destination computer.
- Connection Control: It can provide connection-oriented services (like TCP, setting up a session before data transfer) or connectionless services (like UDP).
- Flow Control: It ensures that the sender does not overwhelm the receiver with data by regulating the transmission rate end-to-end.
- Error Control: It ensures reliable data delivery by requesting retransmission of lost or damaged segments.
Briefly describe Peer-to-Peer and Client-Server network architectures.
1. Client-Server Architecture:
- Concept: The network consists of dedicated servers and client nodes. Servers are powerful computers that centrally store data and provide resources or services. Clients are user devices that request these services.
- Management: Centralized. Security and data backups are managed at the server level.
- Scalability: Highly scalable. More clients can be easily added without affecting system performance much.
- Example: Web browsing, where a user's PC (client) requests a webpage from a web server.
2. Peer-to-Peer (P2P) Architecture:
- Concept: All computers (nodes) have equal status. There is no central server. Each node acts as both a client and a server, sharing its own resources directly with others.
- Management: Decentralized. Users manage their own computers and shared resources.
- Scalability: Less scalable. As the number of nodes increases, managing the network becomes difficult.
- Example: BitTorrent networks, small home LANs sharing a printer.
Explain the processes of Encapsulation and Decapsulation in network communication.
Encapsulation:
Encapsulation is the process where data moves down the layers of the protocol stack from the sender's application to the physical medium. At each layer, the protocol adds its own control information (headers and sometimes trailers) to the data received from the layer above.
- For example, the Transport layer adds a TCP header to the data to form a segment.
- The Network layer adds an IP header to the segment to form a packet.
- The Data Link layer adds a MAC header and a trailer to form a frame.
Decapsulation:
Decapsulation is the reverse process that occurs at the receiving end. As data moves up the protocol stack, each layer reads and processes the control information in the header/trailer added by its peer layer on the sending side, strips that header off, and passes the remaining data up to the next higher layer. This continues until the raw application data reaches the destination application.
Why is IPv4 being replaced by IPv6? Highlight the main differences in their addressing.
Reason for Replacement:
The primary reason for replacing IPv4 with IPv6 is address exhaustion. With the explosion of Internet-connected devices (smartphones, IoT, computers), the pool of available IPv4 addresses has run out. IPv6 was created to provide a virtually limitless supply of IP addresses.
Main Differences in Addressing:
- Address Length: IPv4 uses a 32-bit address space, allowing for approximately (about 4.3 billion) unique addresses. IPv6 uses a 128-bit address space, allowing for (an astronomically large number) addresses.
- Representation: IPv4 addresses are represented in dotted-decimal format (e.g.,
192.168.1.1). IPv6 addresses are represented in alphanumeric hexadecimal format separated by colons (e.g.,2001:0db8:85a3:0000:0000:8a2e:0370:7334). - Configuration: IPv4 requires manual configuration or DHCP. IPv6 supports SLAAC (Stateless Address Autoconfiguration), allowing devices to automatically generate their own IP address.
What are Unicast, Multicast, and Broadcast messages in the context of network communication?
These terms describe the routing and delivery methods for messages in a network:
-
Unicast (One-to-One):
- A message is sent from a single sender to a single specific receiver.
- Only the device with the exact destination IP/MAC address processes the packet.
- Example: Browsing a website or sending an email.
-
Broadcast (One-to-All):
- A message is sent from a single sender to all devices connected to the same network segment.
- The destination address is a special broadcast address (e.g., MAC address
FF:FF:FF:FF:FF:FF). Every device on the network must process the packet. - Example: ARP (Address Resolution Protocol) requests.
-
Multicast (One-to-Many):
- A message is sent from a single sender to a specific group of receivers who have subscribed to receive it.
- It is more efficient than broadcasting because it only targets interested devices rather than spamming the whole network.
- Example: Live video streaming or online multiplayer gaming.
Define Collision Domain and Broadcast Domain. How do Hubs, Switches, and Routers affect them?
Collision Domain:
A network segment where data packets can collide with one another when being sent simultaneously by different devices.
Broadcast Domain:
A logical division of a computer network where all nodes can reach each other by broadcast at the data link layer. If a device sends a broadcast, all devices in the same broadcast domain receive it.
Effect of Network Devices:
- Hub: Does not segment networks. All devices connected to a hub belong to one large collision domain and one broadcast domain.
- Switch: Breaks up collision domains. Every port on a switch forms its own separate collision domain. However, by default, all ports on a switch belong to the same broadcast domain (unless divided logically using VLANs).
- Router: Breaks up broadcast domains. Every interface/port on a router forms a separate broadcast domain and a separate collision domain. Routers do not forward broadcast frames.
Explain the concept of 'interfaces' and 'protocols' in layered network architecture. How do they interact to ensure successful communication?
In a layered network software architecture, the complex task of communication is divided into discrete layers.
Protocols (Horizontal Communication):
- A protocol is a set of rules governing the communication between peer entities (layers at the same level on different machines).
- For instance, the Transport layer of Machine A talks to the Transport layer of Machine B using Transport Layer Protocols (like TCP). They agree on format, meaning, and error handling.
Interfaces (Vertical Communication):
- An interface sits between adjacent layers on the same machine (e.g., between the Transport layer and the Network layer).
- It defines the services and primitive operations the lower layer provides to the upper layer.
Interaction for Success:
- Data cannot jump directly from Layer N on Machine A to Layer N on Machine B.
- Instead, Layer N uses the interface to pass data down to Layer N-1. This process continues down to the physical medium.
- The data travels to Machine B, where it moves up the interfaces. The protocol ensures that Layer N on Machine B interprets the data exactly as Layer N on Machine A intended. Together, clear vertical interfaces and standardized horizontal protocols ensure interoperable, modular communication.