Unit 1: Introduction and Network Models - Subjective Questions
CSE306 — Computer Networks • Practice Questions with Detailed Answers
20 questions
Define a computer network. Explain its major components, objectives, and applications.
A computer network is a collection of interconnected computing devices that communicate and share resources through wired or wireless communication links according to defined protocols.
Major components:
- End devices: Computers, servers, smartphones, printers, and IoT devices.
- Network Interface Card: Connects a device to the network and provides a physical or logical address.
- Transmission media: Twisted-pair cable, coaxial cable, optical fiber, radio waves, or microwaves.
- Interconnecting devices: Hubs, switches, routers, access points, and gateways.
- Network software: Network operating systems, protocol implementations, drivers, and management tools.
- Protocols: Rules such as Ethernet, IP, TCP, UDP, HTTP, and DNS.
Objectives:
- Sharing hardware, software, files, and Internet connections.
- Enabling reliable and rapid communication.
- Supporting distributed processing and centralized administration.
- Improving scalability, availability, and cost efficiency.
Applications:
- E-mail, instant messaging, and video conferencing.
- Web browsing and cloud computing.
- File and printer sharing.
- Online banking, education, entertainment, and e-commerce.
- Remote access, industrial automation, and IoT monitoring.
Classify computer networks as PAN, LAN, MAN, and WAN. Compare them with suitable examples.
Networks can be classified according to their geographical coverage.
- Personal Area Network: A PAN covers a very small area around an individual, usually a few meters. Bluetooth connections between a smartphone, smartwatch, and earbuds are examples.
- Local Area Network: A LAN covers a room, building, office, or campus section. It normally provides high speed and is privately managed. A college laboratory Ethernet network is an example.
- Metropolitan Area Network: A MAN covers a city or metropolitan region. It may connect several organizational LANs. A city-wide cable television or municipal fiber network is an example.
- Wide Area Network: A WAN spans countries or continents and uses links supplied by telecommunication providers. The Internet is the largest example.
Comparison:
| Type | Typical coverage | Ownership | Relative speed | Example |
|---|---|---|---|---|
| PAN | A few meters | Individual | Moderate to high | Bluetooth network |
| LAN | Building or campus | Private organization | High | Office Ethernet |
| MAN | City | Private or service provider | High | City fiber network |
| WAN | Country or world | Multiple providers | Variable | Internet |
As coverage increases, the network generally becomes more complex, depends more on service providers, and experiences greater propagation delay.
Explain client-server and peer-to-peer network architectures. State their advantages, limitations, and suitable uses.
Client-server architecture uses dedicated servers to provide services such as web hosting, authentication, databases, or file storage to client devices.
Advantages:
- Centralized administration, security, and backup.
- Easier enforcement of access-control policies.
- Dedicated servers can provide high performance and availability.
- Suitable for large and structured organizations.
Limitations:
- Server installation and maintenance may be expensive.
- A server failure can interrupt services unless redundancy is provided.
- Skilled administration is required.
Peer-to-peer architecture allows each node to act as both a service requester and a service provider. Peers share resources directly without depending on a permanent central server.
Advantages:
- Simple and inexpensive for small networks.
- No dedicated server is compulsory.
- Resources can be distributed among many peers.
Limitations:
- Security, backup, and administration are difficult to centralize.
- Resource availability depends on individual peers.
- Performance and reliability may decrease as the network grows.
Suitable uses:
- Client-server architecture is appropriate for banking, institutional databases, websites, and enterprise networks.
- Peer-to-peer architecture is suitable for small workgroups and distributed file-sharing systems.
Some modern systems use a hybrid architecture, combining centralized discovery or authentication with direct peer communication.
Describe the major elements of network hardware architecture and distinguish between broadcast and point-to-point communication.
Network hardware architecture describes the physical devices and communication facilities used to construct a network.
Major elements:
- Hosts or end systems: Generate and consume data.
- Network interfaces: Convert host data into signals or frames suitable for transmission.
- Transmission links: Copper cables, optical fiber, radio, satellite, or microwave links.
- Connecting devices: Repeaters, hubs, bridges, switches, routers, gateways, and wireless access points.
- Servers and storage systems: Provide centralized services and data.
Broadcast communication:
- Multiple stations share a common communication channel.
- A transmitted frame may be physically received by every station on the shared medium.
- The destination address determines which station accepts it.
- Traditional shared Ethernet and wireless LANs illustrate broadcast behavior.
Point-to-point communication:
- A link directly joins two endpoints.
- Data travels through one or more intermediate devices to reach the destination.
- Modern switched Ethernet links and leased lines are examples.
Difference: Broadcast systems share the medium among several devices, whereas point-to-point systems use individual links between pairs of devices. Point-to-point links generally provide better isolation and allow simultaneous transmissions on different links.
Explain bus, star, ring, mesh, tree, and hybrid network topologies. Compare their strengths and weaknesses, and derive the number of links required for a full mesh of devices.
A network topology describes the physical or logical arrangement of nodes and communication links.
- Bus topology: Every device is attached to a shared backbone. It is inexpensive but backbone failure can disable the network, and shared access may cause collisions.
- Star topology: Every device has a separate link to a central hub or switch. It is easy to manage and expand, but failure of the central device affects the entire network.
- Ring topology: Each node connects to two neighbors, forming a closed loop. Access can be orderly, but a link or node failure may disrupt a basic single ring.
- Mesh topology: Devices have multiple interconnections. A full mesh provides excellent redundancy and fault tolerance but requires many links and ports.
- Tree topology: Multiple star networks are arranged hierarchically. It is scalable, although failure near the root can affect a large branch.
- Hybrid topology: Two or more topologies are combined to meet practical requirements. It is flexible but can be complex and expensive.
For a full mesh, each of the devices connects to other devices. This initially counts every link twice, once from each endpoint. Therefore, the required number of links is:
Each device requires network ports. For example, a full mesh of five devices requires:
Thus, star and tree topologies are common in LANs, while mesh connections are used where redundancy is more important than cost.
What is a network hub? Explain its operation and limitations.
A hub is a basic Physical-layer networking device used to connect multiple Ethernet devices. It is essentially a multiport repeater.
Operation:
- A hub receives an electrical or optical signal on one port.
- It regenerates the signal.
- It transmits the regenerated signal through all other active ports.
- It does not examine MAC addresses or make forwarding decisions.
Characteristics:
- All connected devices share the available bandwidth.
- All ports belong to one collision domain.
- A hub normally supports half-duplex communication.
- Frames sent through a hub can be observed by every connected station.
- It does not separate broadcast domains.
Limitations:
- Simultaneous transmissions can produce collisions.
- Performance decreases as the number of devices and traffic volume increase.
- Unnecessary traffic is delivered to all ports.
- It offers poor privacy and limited traffic control.
- It cannot learn addresses, create virtual LANs, or filter frames.
Hubs have largely been replaced by Ethernet switches, which provide dedicated bandwidth and intelligent frame forwarding.
Describe how an Ethernet switch learns MAC addresses and forwards, filters, or floods frames.
An Ethernet switch is primarily a Data Link-layer device that forwards frames using destination MAC addresses. It maintains a MAC address table, also called a forwarding table.
Address learning:
- A frame enters a switch port.
- The switch reads the frame's source MAC address.
- It records or updates the association between that source address and the incoming port.
- Learned entries are aged out after a period of inactivity.
Forwarding decisions:
- Known unicast: If the destination MAC address is associated with another port, the frame is forwarded only through that port.
- Filtering: If the destination is known to be on the same port from which the frame arrived, the switch does not forward it.
- Unknown unicast: If the destination address is absent from the table, the frame is flooded through all relevant ports except the incoming port.
- Broadcast: A broadcast frame is flooded within the same broadcast domain or VLAN.
- Multicast: It may be flooded or selectively forwarded when multicast-management features are available.
Each switch port forms a separate collision domain. Full-duplex switched links eliminate ordinary Ethernet collisions and provide dedicated bandwidth. However, a basic Layer 2 switch does not separate broadcast domains unless VLANs are configured.
Explain the functions of a router and describe how it forwards an IP packet.
A router is a Network-layer device that connects different IP networks and forwards packets according to logical addresses.
Major functions:
- Interconnecting LANs, WANs, and different IP subnets.
- Maintaining a routing table.
- Selecting paths using static routes or dynamic routing protocols.
- Separating broadcast domains.
- Decrementing the IPv4 Time to Live or IPv6 Hop Limit.
- Supporting features such as packet filtering, Network Address Translation, and quality of service.
Packet-forwarding process:
- The router receives a link-layer frame and verifies it.
- It removes the incoming frame header and trailer.
- It examines the destination IP address.
- It finds the best route using longest-prefix matching in the routing table.
- It determines the outgoing interface and next-hop address.
- It reduces the packet's Time to Live or Hop Limit. An expired packet is discarded.
- It resolves the next-hop link-layer address when necessary.
- It encapsulates the IP packet in a new frame appropriate for the outgoing network.
- It transmits the new frame.
The IP source and destination addresses normally remain end-to-end, while the link-layer source and destination addresses change at each router hop. Address translation is an important exception.
Differentiate among a hub, switch, and router on the basis of layer, addressing, forwarding behavior, collision domains, and broadcast domains.
Hubs, switches, and routers connect devices, but they operate differently.
| Feature | Hub | Switch | Router |
|---|---|---|---|
| Primary OSI layer | Physical layer | Data Link layer | Network layer |
| Information used | Signals or bits | MAC addresses | IP addresses |
| Forwarding behavior | Repeats to all other ports | Selectively forwards frames | Routes packets between networks |
| Collision domains | One shared domain | One per switch port | One per interface |
| Broadcast domains | One | One per VLAN by default | One per interface |
| Learning or table | None | MAC address table | Routing table |
| Typical duplex | Half-duplex | Full-duplex | Full-duplex links |
Key distinctions:
- A hub does not interpret addresses and merely regenerates signals.
- A switch learns MAC addresses and controls frame delivery within a LAN.
- A router uses IP addresses to connect different networks and prevent link-layer broadcasts from crossing interfaces.
A common network may use access switches to connect local devices and a router to connect the resulting LAN or VLANs to other networks and the Internet.
Explain network software architecture with reference to layers, services, interfaces, and protocols.
Network software is organized into layers to divide a complex communication task into manageable functions. Each layer performs a defined role and cooperates with adjacent layers.
- Layer: A logical level that performs related communication functions. For example, a transport layer can provide process-to-process delivery.
- Service: A capability that one layer offers to the layer immediately above it. A service specifies what is provided, not how it is implemented.
- Interface: The boundary through which an upper layer accesses lower-layer services. It defines permitted operations and parameters.
- Protocol: A set of rules used by peer entities at the same logical layer on different systems. It defines message formats and communication procedures.
Operation:
- The sending application passes data down the protocol stack.
- Each layer uses the service of the layer below and may add control information.
- The physical network carries the resulting signal.
- The receiving stack processes the data upward in reverse order.
Benefits of layering:
- Modularity and reduced design complexity.
- Independent development and replacement of layers.
- Interoperability through standard protocols.
- Easier testing, troubleshooting, and maintenance.
Although peer layers appear to communicate logically, actual data travels down the sender's stack, through the network, and up the receiver's stack.
Define a network protocol. Explain the roles of syntax, semantics, and timing in protocol design.
A network protocol is a formal set of rules governing communication between network entities. It specifies how messages are structured, interpreted, transmitted, and responded to.
Three fundamental elements:
- Syntax: Defines the structure and format of data. It includes field order, field length, encoding, header format, and bit representation.
- Semantics: Defines the meaning of each field and the actions taken when particular values or events occur. For example, a control bit may request acknowledgment or connection termination.
- Timing: Defines when data may be sent, the acceptable transmission rate, sequencing constraints, and timeout behavior.
Example: In a reliable transport protocol, syntax defines the position and size of the sequence-number field. Semantics explains that the number identifies the position of data and supports acknowledgment. Timing determines how long the sender waits before retransmitting an unacknowledged segment.
A useful protocol may also define:
- Addressing and naming.
- Error detection and recovery.
- Flow and congestion control.
- Connection establishment and release.
- Authentication and security procedures.
Standardized protocols allow equipment and software from different manufacturers to interoperate.
Explain encapsulation and decapsulation in a layered network. Identify the protocol data units used at major layers.
Encapsulation is the process by which each lower layer adds its own control information to data received from the layer above. Decapsulation is the reverse process at the destination.
Encapsulation at the sender:
- The application creates a message.
- The transport layer adds a TCP or UDP header, producing a segment or datagram.
- The network layer adds an IP header, producing an IP packet.
- The Data Link layer adds a frame header and usually a trailer, producing a frame.
- The Physical layer represents the frame as bits or signals on the medium.
The relationship can be represented as:
Decapsulation at the receiver:
- The Physical layer reconstructs bits.
- The Data Link layer validates the frame and removes its header and trailer.
- The Network layer examines and removes the IP header.
- The transport layer processes port numbers and transport control information.
- The application receives the original message.
At a router, the incoming frame is decapsulated only far enough to process the IP packet. The packet is then encapsulated in a new frame for the next link.
Describe all seven layers of the OSI reference model and state the principal function of each layer.
The Open Systems Interconnection model divides network communication into seven layers.
- Physical layer: Transmits raw bits through a medium. It defines signaling, connectors, data rates, modulation, and physical media.
- Data Link layer: Provides node-to-node frame delivery. It handles framing, MAC addressing, media access, and link-level error detection.
- Network layer: Provides logical addressing and packet delivery across interconnected networks. Routing and path selection occur here.
- Transport layer: Provides end-to-end or process-to-process delivery. It may perform segmentation, reliability, flow control, multiplexing, and error recovery.
- Session layer: Establishes, manages, synchronizes, and terminates communication sessions between applications.
- Presentation layer: Handles data representation, translation, serialization, compression, encryption, and decryption.
- Application layer: Supplies network services directly to user applications, such as web, e-mail, file-transfer, and naming services.
Data flow: Data moves from Layer 7 to Layer 1 at the sender, crosses the medium, and moves from Layer 1 to Layer 7 at the receiver.
The OSI model is primarily a conceptual framework. It provides common terminology, supports modular design, and helps isolate network faults by layer.
Explain the Physical and Data Link layers of the OSI model. How do their responsibilities differ?
The Physical layer is responsible for transmitting raw bits across a physical medium.
Physical-layer responsibilities:
- Representation of binary values as electrical, optical, or radio signals.
- Data rate, synchronization, modulation, and line coding.
- Cable, connector, frequency, voltage, and distance specifications.
- Physical topology and transmission mode.
- Activation and deactivation of physical links.
The Data Link layer provides delivery of frames across a single link or local network.
Data Link-layer responsibilities:
- Framing a Network-layer packet.
- Physical or MAC addressing.
- Controlling access to a shared medium.
- Detecting transmission errors using methods such as a frame check sequence.
- Supporting link-level flow control where required.
- Forwarding frames through bridges and Layer 2 switches.
Difference:
- The Physical layer is concerned with signals, bits, and transmission media.
- The Data Link layer organizes those bits into frames and controls delivery between directly connected nodes.
A hub mainly operates at the Physical layer, whereas an Ethernet switch mainly operates at the Data Link layer.
Compare the Network and Transport layers of the OSI model, including their addressing and delivery responsibilities.
The Network and Transport layers both support data delivery, but they operate at different scopes.
Network layer:
- Provides host-to-host delivery across multiple interconnected networks.
- Uses logical addresses such as IPv4 or IPv6 addresses.
- Selects routes and forwards packets through routers.
- Handles internetworking and may report delivery problems.
- Its protocol data unit is generally called a packet.
Transport layer:
- Provides process-to-process delivery between applications on end systems.
- Uses port numbers to identify application processes.
- Divides application data into manageable units and reassembles it.
- May provide acknowledgments, retransmission, sequencing, flow control, and congestion control.
- Its protocol data unit is often called a segment for TCP or a datagram for UDP.
Comparison:
| Aspect | Network layer | Transport layer |
|---|---|---|
| Delivery scope | Host to host | Process to process |
| Address | IP address | Port number |
| Typical device | Router | End host |
| Example protocols | IP, ICMP | TCP, UDP |
| Main concern | Routing packets | End-to-end application delivery |
Thus, an IP address identifies the destination host or interface, while a port number identifies the destination application on that host.
Describe the functions of the Session, Presentation, and Application layers of the OSI model with examples.
The upper three OSI layers provide services closest to user applications.
Session layer:
- Establishes, manages, and terminates communication sessions.
- Controls dialog, such as who may transmit and when.
- Provides synchronization points or checkpoints for long exchanges.
- Supports session recovery after an interruption.
Presentation layer:
- Translates data between application and network representations.
- Handles character encoding and data serialization.
- Performs compression and decompression.
- Supports encryption and decryption.
- Ensures that systems using different internal formats can interpret exchanged data.
Application layer:
- Provides network services directly to application programs.
- Supports web access, e-mail, file transfer, remote login, directory services, and name resolution.
- Example protocols include HTTP, SMTP, FTP, SSH, and DNS.
Example: When a user accesses a secure website, the Application layer provides the web service, presentation-related functions represent and protect the data, and session-related functions help maintain the communication dialog. In the practical TCP/IP model, these upper-layer responsibilities are usually implemented together in the Application layer rather than as three separately visible protocol layers.
Explain the layers of the TCP/IP protocol suite and give important protocol examples at each layer.
The TCP/IP protocol suite is the practical architecture used by the Internet. It is commonly represented using four layers.
-
Application layer: Combines application, presentation, and session-related functions. It provides services to user applications. Examples include HTTP and HTTPS for the web, DNS for name resolution, SMTP for e-mail, FTP for file transfer, DHCP for configuration, and SSH for remote access.
-
Transport layer: Provides process-to-process communication.
- TCP provides connection-oriented, reliable, ordered byte-stream delivery with flow and congestion control.
- UDP provides connectionless, low-overhead datagram delivery without guaranteed reliability or ordering.
-
Internet layer: Provides logical addressing and packet routing across networks. Protocols include IPv4, IPv6, and ICMP. Routers mainly process this layer.
-
Network Access layer: Handles framing, media access, link addressing, and physical transmission. Examples include Ethernet, Wi-Fi, Point-to-Point Protocol, and technologies used on physical links.
Some textbooks use a five-layer model by separating the Network Access layer into Data Link and Physical layers.
When application data is transmitted, each lower layer encapsulates it. The receiver removes the corresponding headers and delivers the recovered data to the intended application.
Compare the OSI model and the TCP/IP model. Show the correspondence between their layers.
The OSI and TCP/IP models both use layering, but they differ in origin, structure, and practical use.
Layer correspondence:
| OSI model | TCP/IP model |
|---|---|
| Application | Application |
| Presentation | Application |
| Session | Application |
| Transport | Transport |
| Network | Internet |
| Data Link | Network Access |
| Physical | Network Access |
Similarities:
- Both divide communication into functional layers.
- Both contain application, transport, and internetworking functions.
- Both support encapsulation and peer-layer protocols.
- Both encourage modular implementation and interoperability.
Differences:
- OSI has seven layers, while the common TCP/IP model has four.
- OSI was developed as a general reference model; TCP/IP developed around operational Internet protocols.
- OSI separates Session and Presentation functions, while TCP/IP includes them in the Application layer.
- OSI separates Physical and Data Link layers, while the four-layer TCP/IP model groups them as Network Access.
- OSI more clearly distinguishes services, interfaces, and protocols.
- TCP/IP is widely implemented in real networks, whereas OSI is mainly used for conceptual understanding and troubleshooting.
The models are not exact replacements for one another, but their functional correspondence makes it possible to use OSI terminology when analyzing TCP/IP networks.
Distinguish between TCP and UDP. Explain how an application chooses between them.
TCP and UDP are major Transport-layer protocols in the TCP/IP suite.
| Feature | TCP | UDP |
|---|---|---|
| Connection | Connection-oriented | Connectionless |
| Reliability | Acknowledgments and retransmissions | No built-in delivery guarantee |
| Ordering | Delivers data in order | Datagrams may arrive out of order |
| Data form | Byte stream | Message-oriented datagrams |
| Flow control | Supported | Not built in |
| Congestion control | Supported | Not built in |
| Overhead | Higher | Lower |
| Communication | Unicast | Supports unicast, multicast, and suitable broadcast use |
TCP applications:
- Web transfers where complete content is required.
- E-mail, file transfer, remote login, and database connections.
- Applications that value reliability and ordering over minimum delay.
UDP applications:
- Real-time voice or video where late data may be useless.
- DNS queries, online games, streaming, and simple request-response services.
- Applications that implement their own recovery or can tolerate some loss.
An application chooses TCP when reliable, ordered delivery is essential. It chooses UDP when low latency, message boundaries, multicast capability, or minimal transport overhead is more important. UDP is not inherently faster in every situation; its main advantage is simpler service with less built-in control.
Explain the use of physical addresses, IP addresses, port numbers, and application names in layered communication.
Different layers use different forms of identification to deliver data to the correct network, host, and process.
- Physical or MAC address: Identifies a network interface on a local link. Ethernet switches use MAC addresses to forward frames within a LAN. The source and destination MAC addresses generally change when a packet crosses a router.
- IP address: Logically identifies an interface and its network location. Routers use the destination IP address to deliver a packet across interconnected networks. The IP addresses normally remain unchanged from source to destination unless translation occurs.
- Port number: Identifies an application process or transport endpoint on a host. TCP and UDP use source and destination port numbers. For example, a server may listen on a well-known port while a client uses a temporary port.
- Application name: Provides a human-friendly identifier, such as a domain name. A naming service such as DNS maps the name to an IP address.
Delivery sequence:
- The application resolves a destination name to an IP address.
- The transport layer uses port numbers to identify the communicating processes.
- The Internet layer uses IP addresses for host-to-host routing.
- Each link uses appropriate physical addresses to deliver the frame to the next hop.
Together, these identifiers support application-to-application communication across multiple physical networks.
Define a computer network. Explain its major components, objectives, and applications.
A computer network is a collection of interconnected computing devices that communicate and share resources through wired or wireless communication links according to defined protocols.
Major components:
- End devices: Computers, servers, smartphones, printers, and IoT devices.
- Network Interface Card: Connects a device to the network and provides a physical or logical address.
- Transmission media: Twisted-pair cable, coaxial cable, optical fiber, radio waves, or microwaves.
- Interconnecting devices: Hubs, switches, routers, access points, and gateways.
- Network software: Network operating systems, protocol implementations, drivers, and management tools.
- Protocols: Rules such as Ethernet, IP, TCP, UDP, HTTP, and DNS.
Objectives:
- Sharing hardware, software, files, and Internet connections.
- Enabling reliable and rapid communication.
- Supporting distributed processing and centralized administration.
- Improving scalability, availability, and cost efficiency.
Applications:
- E-mail, instant messaging, and video conferencing.
- Web browsing and cloud computing.
- File and printer sharing.
- Online banking, education, entertainment, and e-commerce.
- Remote access, industrial automation, and IoT monitoring.
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill. The rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it. What it pays for →