Unit2 - Subjective Questions
CSE357 • Practice Questions with Detailed Answers
Define a Computer Network and discuss the fundamental goals of networking.
A Computer Network is a set of devices (often referred to as nodes) connected by communication links. A node can be a computer, printer, or any other device capable of sending and/or receiving data generated by other nodes on the network.
Fundamental Goals of Networking:
- Resource Sharing: The primary goal is to make all programs, equipment, and data available to anyone on the network without regard to the physical location of the resource and the user.
- High Reliability: It provides high reliability by having alternative sources of supply. For example, all files can be replicated on two or more machines, so if one of them is unavailable due to a hardware failure, the other copies can be used.
- Cost Saving: Small computers have a much better price/performance ratio than mainframes. Mainframes are roughly ten times faster than microcomputers, but they cost a thousand times more.
- Scalability: The system implies the ability to increase system performance gradually as the workload grows by just adding more processors (nodes).
- Communication Medium: A computer network provides a powerful communication medium among widely separated employees.
Compare and contrast Star Topology and Mesh Topology with respect to reliability, cost, and installation.
1. Star Topology:
In a star topology, each device has a dedicated point-to-point link only to a central controller, usually called a hub or switch.
- Reliability: It is robust. If one link fails, only that link is affected. All other links remain active. However, if the central hub fails, the whole system collapses.
- Cost: It is less expensive than a mesh topology because each device only needs one link and one I/O port.
- Installation: Easy to install and reconfigure. Additions and deletions involve only one connection between that device and the hub.
2. Mesh Topology:
In a mesh topology, every device has a dedicated point-to-point link to every other device.
- Reliability: It provides the highest reliability. If one link becomes unusable, it does not incapacitate the entire system.
- Cost: It is expensive due to the high amount of cabling and I/O ports required.
- Installation: Installation and reconnection are difficult because every device must be connected to every other device.
Explain the principle of Fiber Optic transmission and list its advantages over copper cables.
Principle of Fiber Optics
Fiber optic cable transmits signals in the form of light pulses. It works on the principle of Total Internal Reflection. When light travels from a denser medium (Core) to a rarer medium (Cladding) at an angle greater than the critical angle, the light is reflected back into the denser medium. The core is a glass or plastic strand that carries the light, and the cladding is a protective layer with a lower refractive index.
Advantages over Copper Cables:
- Higher Bandwidth: Fiber optics can support significantly higher data rates compared to twisted pair or coaxial cables.
- Immunity to Electromagnetic Interference (EMI): Since fiber uses light, it is not affected by electromagnetic interference or radio frequency interference.
- Low Attenuation: Signal loss is very low, allowing data to travel longer distances without the need for repeaters.
- Security: It is difficult to tap into a fiber cable without being detected, as it does not radiate electromagnetic energy.
- Lightweight: Fiber cables are much lighter and thinner than copper cables.
Differentiate between Guided Media and Unguided Media with examples.
Guided Media (Wired):
Guided media provide a physical conduit from one device to another. The signal traveling through these media is directed and contained by the physical limits of the medium.
- Characteristics: High reliability, high speed, secure connection.
- Examples:
- Twisted Pair Cable: Used in LANs (Ethernet).
- Coaxial Cable: Used in cable TV networks.
- Fiber Optic Cable: Used for high-speed backbones.
Unguided Media (Wireless):
Unguided media transport electromagnetic waves without using a physical conductor. This type of communication is often referred to as wireless communication. The signals are broadcasted through free space and are available to anyone who has a device capable of receiving them.
- Characteristics: Mobility, supports roaming, susceptible to interference.
- Examples:
- Radio Waves: For AM/FM radio.
- Microwaves: For long-distance telephone communication and cellular phones.
- Infrared: For short-range communication (e.g., TV remotes).
Describe the OSI Model architecture and briefly explain the functions of the Data Link Layer and Network Layer.
The Open Systems Interconnection (OSI) model is a conceptual framework used to describe the functions of a networking system. It characterizes computing functions into a universal set of rules and requirements to support interoperability. It consists of 7 layers.
Functions of Specific Layers:
1. Data Link Layer (Layer 2):
- Framing: Divides the stream of bits received from the network layer into manageable data units called frames.
- Physical Addressing: Adds a header to the frame to define the sender and receiver of the frame (MAC Address).
- Flow Control: Prevents overwhelming the receiver if the sender is faster.
- Error Control: Adds mechanisms to detect and retransmit damaged or lost frames.
2. Network Layer (Layer 3):
- Logical Addressing: Adds a header to the packet coming from the upper layer that includes the logical addresses (IP addresses) of the sender and receiver.
- Routing: Determines the best path for data to travel from the source to the destination across multiple networks.
- Packetizing: Encapsulates segments from the Transport layer into packets.
Compare the OSI Model and the TCP/IP Model.
| Feature | OSI Model | TCP/IP Model |
|---|---|---|
| Definition | Open Systems Interconnection. It is a theoretical reference model. | Transmission Control Protocol/Internet Protocol. It is a practical implementation model. |
| Layers | Has 7 layers: Physical, Data Link, Network, Transport, Session, Presentation, Application. | Has 4 layers: Network Interface, Internet, Transport, Application. |
| Approach | Vertical approach. | Horizontal approach. |
| Protocol Dependence | It is protocol-independent. | It supports specific standard protocols (TCP/IP). |
| Reliability | Strict modularization makes it rigid. | Looser layering makes it more flexible. |
| Service vs Protocol | Clearly distinguishes between services, interfaces, and protocols. | Does not clearly distinguish between services, interfaces, and protocols. |
Distinguish between TCP (Transmission Control Protocol) and UDP (User Datagram Protocol).
TCP (Transmission Control Protocol):
- Connection-Oriented: A connection must be established (3-way handshake) before data transfer.
- Reliability: Guarantees delivery of data. It performs error checking, acknowledgment, and retransmission of lost packets.
- Ordering: Ensures packets arrive in the correct order.
- Speed: Slower due to overhead of error checking and flow control.
- Usage: Web browsing (HTTP), Email (SMTP), File Transfer (FTP).
UDP (User Datagram Protocol):
- Connectionless: No connection is established before sending data.
- Reliability: Best-effort delivery. No guarantee of delivery; packets may be lost or corrupted without notification.
- Ordering: Packets may arrive out of order.
- Speed: Faster and more efficient due to low overhead.
- Usage: Streaming media, VoIP, Online Gaming, DNS lookups.
Explain the concept of Subnetting. A network has the IP address 192.168.10.0 with a subnet mask of 255.255.255.192. Determine the number of subnets, the number of hosts per subnet, and the CIDR notation.
Subnetting is the process of dividing a single large network into smaller, manageable logical networks (subnets). It improves network performance, security, and address management.
Calculation Problem:
Given:
- IP Address: 192.168.10.0 (Class C)
- Default Class C Mask: 255.255.255.0
- Given Subnet Mask: 255.255.255.192
1. CIDR Notation:
Convert the mask 255.255.255.192 to binary.
The number of 1s represents the network bits.
CIDR: /26
2. Number of Subnets:
The number of borrowed bits () from the host portion is 2 (since 192 is 11000000).
3. Number of Hosts per Subnet:
The number of remaining host bits () is 6 (since total bits 32 - 26 = 6).
(We subtract 2 for the Network ID and Broadcast ID).
What is Routing? Differentiate between Static Routing and Dynamic Routing.
Routing is the process of selecting a path for traffic in a network or between or across multiple networks. It is performed by layer 3 devices (routers) to deliver packets from source to destination.
| Feature | Static Routing | Dynamic Routing |
|---|---|---|
| Definition | Routes are manually configured by the network administrator. | Routes are automatically discovered and updated by routing protocols. |
| Update Mechanism | No automatic updates. If a link fails, the admin must manually reroute. | Automatic updates. The router adjusts to topology changes in real-time. |
| Complexity | Simple for small networks. | Complex, requires knowledge of protocols (OSPF, RIP, EIGRP). |
| Bandwidth Usage | Little to no bandwidth usage for routing updates. | Consumes bandwidth for exchanging routing tables/updates. |
| Security | More secure as routes are defined manually. | Less secure; rogue routers can potentially send false updates. |
Explain the working of DNS (Domain Name System) and its hierarchy.
DNS translates human-readable domain names (like www.google.com) into machine-readable IP addresses (like 142.250.183.68).
Working Mechanism:
- Request: The user enters a URL in the browser. The OS checks its local cache.
- Recursive Query: If not in cache, the request goes to the Recursive Resolver (usually ISP's DNS).
- Root Server: If the Resolver doesn't have the IP, it queries a Root Nameserver (
.). - TLD Server: The Root server directs the request to the Top-Level Domain (TLD) server (e.g.,
.comserver). - Authoritative Server: The TLD server directs the request to the Authoritative Nameserver responsible for that specific domain.
- Response: The Authoritative server returns the IP address to the Resolver, which passes it to the browser.
Hierarchy:
- Root Level: The top of the tree, represented by a dot.
- Top Level Domains (TLD): Generic (.com, .org) and Country code (.in, .uk).
- Second Level Domains: The actual domain name (e.g., 'google' in google.com).
- Subdomains: E.g., 'mail' in mail.google.com.
Describe the DHCP (Dynamic Host Configuration Protocol) process using the DORA acronym.
DHCP is a network management protocol used to automatically assign IP addresses and other communication parameters to devices connected to the network.
The DORA Process:
-
D - Discover:
The client (e.g., a laptop just turned on) broadcasts a DHCPDISCOVER message to the local subnet to find available DHCP servers. The source IP is 0.0.0.0 and destination is 255.255.255.255. -
O - Offer:
A DHCP server receives the discovery packet. It reserves an IP address for the client and sends a DHCPOFFER message containing the IP address, subnet mask, and lease duration. -
R - Request:
The client receives the offer (potentially from multiple servers). It selects one and broadcasts a DHCPREQUEST message, formally requesting the offered IP address from the specific server. -
A - Acknowledge:
The server receives the request and sends a DHCPACK packet. This finalizes the process, assigning the IP to the client along with DNS and Gateway information.
Explain the HTTP protocol and how it differs from HTTPS. What is meant by a 'Stateless Protocol'?
HTTP (Hypertext Transfer Protocol) is an application layer protocol used for transmitting hypermedia documents, such as HTML. It functions as a request-response protocol in the client-server computing model.
Difference between HTTP and HTTPS:
- Security: HTTP sends data in plain text. HTTPS (HTTP Secure) encrypts data using SSL/TLS protocols.
- Port: HTTP uses port 80 by default; HTTPS uses port 443.
- Trust: HTTPS requires an SSL certificate from a Certificate Authority (CA) to verify the server's identity.
Stateless Protocol:
HTTP is called a stateless protocol because the server does not keep track of the client's state between two requests. Each request is treated as an independent transaction that is unrelated to any previous request. Cookies are often used to simulate state (sessions) over HTTP.
Discuss the roles of SMTP, POP3, and IMAP in email communication.
1. SMTP (Simple Mail Transfer Protocol):
- Role: It is a Push protocol used to send emails.
- Function: It transfers mail from the sender's client to the sender's mail server, and then from the sender's mail server to the recipient's mail server.
- Port: Defaults are 25 (non-encrypted) or 587 (TLS).
2. POP3 (Post Office Protocol version 3):
- Role: It is a Pull protocol used to retrieve emails.
- Function: It downloads emails from the server to the client's local machine. By default, it deletes the mail from the server after downloading (though this can be configured).
- Use Case: Best when accessing email from only one device.
3. IMAP (Internet Message Access Protocol):
- Role: It is a Pull protocol used to retrieve/access emails.
- Function: It syncs emails between the client and the server. The email remains on the server.
- Use Case: Essential when accessing email from multiple devices (phone, laptop, tablet) as the status (read/unread) syncs across all.
Explain FTP (File Transfer Protocol). What are the two types of connections established in an FTP session?
FTP is a standard network protocol used for the transfer of computer files between a client and server on a computer network. It is built on a client-server model architecture.
FTP Connections:
Unlike HTTP which uses one connection, FTP establishes two separate connections:
-
Control Connection (Port 21):
- Used for sending commands (like 'log in', 'change directory', 'get file') and receiving responses.
- This connection remains open during the entire interactive session.
-
Data Connection (Port 20):
- Used exclusively for transferring the actual file data.
- This connection is opened when a file transfer command is given and closes once the file is transferred.
Note: In Passive Mode FTP, the data port is negotiated rather than being strictly port 20.
What is Circuit Switching vs Packet Switching? Which one is used in the Internet and why?
Circuit Switching:
- A dedicated physical path is established between the sender and receiver for the entire duration of the communication.
- Resources (bandwidth) are reserved.
- Example: Traditional Telephone Networks (PSTN).
Packet Switching:
- Data is broken down into small chunks called packets. Each packet travels independently through the network, possibly taking different routes, and is reassembled at the destination.
- Resources are not reserved (connectionless).
Used in Internet:
The Internet uses Packet Switching.
Why?
- Efficiency: It handles bursty data traffic better. Bandwidth is not wasted during silence/idle periods.
- Resilience: If a router or line fails, packets can be automatically rerouted.
- Cost: It allows multiple users to share the same channel simultaneously.
Differentiate between a Hub, a Switch, and a Router.
| Feature | Hub | Switch | Router |
|---|---|---|---|
| Layer | Physical Layer (Layer 1). | Data Link Layer (Layer 2). | Network Layer (Layer 3). |
| Intelligence | Dumb device; broadcasts data to all ports. | Intelligent; sends data only to the specific MAC address. | Intelligent; routes data based on IP address. |
| Collision Domain | Single collision domain. | Separate collision domain per port. | Separate collision domain per interface. |
| Broadcast Domain | Single broadcast domain. | Single broadcast domain (unless VLANs are used). | Separates broadcast domains. |
| Addressing | Uses no addressing. | Uses MAC Addresses. | Uses IP Addresses. |
| Usage | Connecting devices in a small, non-critical LAN. | Connecting devices in a LAN efficiently. | Connecting different networks (e.g., LAN to WAN). |
Define IP Address. Briefly explain the IPv4 Classful Addressing architecture (Classes A, B, C).
IP Address (Internet Protocol Address): A unique numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. An IPv4 address is 32 bits long.
IPv4 Classful Addressing:
-
Class A:
- Range: 1.0.0.0 to 126.0.0.0
- Structure: Network.Host.Host.Host
- Use: Very large networks (supports 16 million hosts).
-
Class B:
- Range: 128.0.0.0 to 191.255.0.0
- Structure: Network.Network.Host.Host
- Use: Medium to large networks (supports approx 65,000 hosts).
-
Class C:
- Range: 192.0.0.0 to 223.255.255.0
- Structure: Network.Network.Network.Host
- Use: Small local area networks (supports 254 hosts).
(Note: Class D is for Multicast and Class E is for Research)
What is the purpose of a Subnet Mask?
A Subnet Mask is a 32-bit number that masks an IP address and divides the IP address into the Network Address and the Host Address.
- Identification: It allows the TCP/IP protocol to determine whether a host is on the local subnet or on a remote network.
- Operation: It performs a bitwise AND operation with the IP address.
- Bits set to
1in the mask represent the Network portion. - Bits set to
0in the mask represent the Host portion.
- Bits set to
Example:
For IP 192.168.1.5 and Mask 255.255.255.0:
- The first 3 octets (
192.168.1) match the255s, so they are the Network ID. - The last octet (
5) matches the0, so it is the Host ID.
Explain the concept of Encapsulation and Decapsulation in the context of the OSI model.
Encapsulation (Sender Side):
As data moves down the OSI layers from the Application layer to the Physical layer, each layer adds its own control information, known as a Header (and sometimes a Trailer), to the data received from the layer above.
- Application to Transport: Data is converted to Segments.
- Transport to Network: Segments get IP headers -> Packets.
- Network to Data Link: Packets get MAC headers/trailers -> Frames.
- Data Link to Physical: Frames are converted to Bits.
Decapsulation (Receiver Side):
This is the reverse process. As data moves up the layers at the receiving end, each layer removes the header corresponding to that layer, processes the information, and passes the remaining data unit up to the next layer. This ensures that the Application layer receives the raw data sent by the sender.
Discuss the Physical Layer of the OSI model. What are its primary responsibilities?
The Physical Layer is the first layer (Layer 1) of the OSI model. It deals with the physical connection between devices and the transmission of raw binary data (bits) over a communication channel.
Primary Responsibilities:
- Bit Representation: It defines how 0s and 1s are encoded into signals (electrical, optical, or radio waves).
- Data Rate (Transmission Rate): It defines the number of bits sent each second.
- Synchronization: It synchronizes the sender and receiver clocks.
- Physical Topologies: It defines how devices are arranged (Mesh, Star, Bus, etc.).
- Transmission Mode: It defines the direction of transmission (Simplex, Half-duplex, or Full-duplex).
- Interface: It defines the characteristics of the interface between the devices and the transmission medium (e.g., voltage levels, pin configurations).