Top

Computer Networking

41.

What is FTP and what ports does it use?

Ans:

FTP (File Transfer Protocol) is a standard network protocol used for the transfer of computer files between a client and server on a computer network.

FTP is unique because it uses two separate TCP connections to function:

  • Control Connection (Port 21): This connection is used to send commands (like login credentials, list files, get file) and receive responses. It remains open for the duration of the FTP session.
  • Data Connection (Port 20 in Active Mode): This connection is used for the actual transfer of file data. A new data connection is opened for each file that is transferred.

Because it sends login credentials in plain text, FTP is considered insecure. SFTP (SSH File Transfer Protocol) and FTPS (FTP over SSL) are secure alternatives that encrypt the communication.

42.

What is the loopback address?

Ans:

A loopback address is a special IP address that computers use to refer to themselves. It allows a device to send a network signal to itself, which is useful for testing network software without any physical network interface being involved.

For IPv4, the entire 127.0.0.0/8 address block is reserved for this purpose, but the most commonly used loopback address is 127.0.0.1.

For IPv6, the loopback address is ::1.

Pinging 127.0.0.1 is a common way to test if the TCP/IP stack on a local machine is functioning correctly.

43.

What is TTL?

Ans:

TTL (Time-to-Live) is a mechanism in the Internet Protocol (IP) that limits the lifespan or lifetime of data in a computer or network.

It is an 8-bit field in the IP header. When a packet is created, the sender sets an initial TTL value (e.g., 64 or 128). Each router that forwards the packet must decrement the TTL value by at least one.

If the TTL value reaches zero before the packet reaches its destination, the router that decremented it to zero discards the packet and sends an ICMP 'Time Exceeded' message back to the sender.

The primary purpose of TTL is to prevent data packets from circulating indefinitely in the network in case of a routing loop.

44.

What is full-duplex and half-duplex?

Ans:

These terms describe the directionality of data transmission between two devices.

  • Half-Duplex: Communication can occur in both directions, but not at the same time. Each device can either send or receive, but not simultaneously. Walkie-talkies are a classic example. In networking, old hubs operated in half-duplex.
  • Full-Duplex: Communication can occur in both directions simultaneously. Both devices can send and receive data at the same time. A telephone conversation is an example. Modern switches operate in full-duplex.

There is also Simplex, where data can only flow in one direction, from sender to receiver (e.g., a radio broadcast).

45.

What is CSMA/CD?

Ans:

CSMA/CD (Carrier Sense Multiple Access with Collision Detection) is the media access control method used by early Ethernet networks to handle transmissions on a shared medium.

It works as follows:

  1. Carrier Sense (CS): A device first 'listens' to the network cable to check if it's currently busy. If it's idle, the device can start transmitting.
  2. Multiple Access (MA): Multiple devices are on the same shared network and have equal access to it.
  3. Collision Detection (CD): While transmitting, the device continues to listen. If it detects another signal at the same time (a collision), it immediately stops transmitting, sends a 'jam signal' to notify all other devices of the collision, and then waits for a random amount of time before trying to transmit again (this is called 'backoff').

This method was necessary for hubs, but with modern switched networks where each port is a separate collision domain, CSMA/CD is largely a legacy concept.

46.

What is ICMP?

Ans:

ICMP (Internet Control Message Protocol) is a supporting protocol in the Internet protocol suite. It is used by network devices, like routers, to send error messages and operational information indicating, for example, that a requested service is not available or that a host or router could not be reached.

ICMP is not used for exchanging user data. Its purpose is purely for control, error-reporting, and management of the network.

The most well-known uses of ICMP are the ping utility (which uses ICMP Echo Request and Echo Reply messages) and the traceroute utility (which uses ICMP Time Exceeded messages).

47.

What is a socket in networking?

Ans:

A network socket is an internal endpoint for sending or receiving data within a node on a computer network. It is a software abstraction that represents one end of a two-way communication link between two programs running on the network.

A socket is uniquely identified by the combination of:

  • An IP address
  • A transport protocol (e.g., TCP or UDP)
  • A port number

For example, a connection to a web server might be represented by a socket like (198.51.100.10, TCP, Port 443).

48.

What is encapsulation?

Ans:

Encapsulation is the process of adding protocol information (headers and sometimes trailers) to data as it moves down the protocol stack from one layer to the next.

When an application sends data, it passes it down the OSI or TCP/IP model layers. At each layer, a header is added:

  • The Transport Layer takes the data and adds a TCP or UDP header, creating a segment.
  • The Network Layer takes the segment and adds an IP header, creating a packet.
  • The Data Link Layer takes the packet and adds a frame header and trailer, creating a frame.
  • The Physical Layer then transmits the frame as a stream of bits.

The reverse process, de-encapsulation, occurs at the receiving end as the data moves up the stack.

49.

Explain client-server and peer-to-peer network models.

Ans:

These are two common architectures for network applications.

Client-Server Model:

  • In this model, there are dedicated servers that provide services and resources, and clients that request them.
  • The server is a powerful, centralized machine that is always on, waiting for requests. The clients are the end-user devices (laptops, phones).
  • Examples: Web Browse (your browser is the client, the web server hosts the site), email.
  • Advantages: Centralized management, better security, scalable.
  • Disadvantages: Server can be a single point of failure, can be expensive to set up and maintain.

Peer-to-Peer (P2P) Model:

  • In this model, there are no dedicated servers. Every device (peer) on the network has equal capabilities and can act as both a client and a server.
  • Peers communicate directly with each other to share files and resources.
  • Examples: BitTorrent, some cryptocurrencies.
  • Advantages: Decentralized (no single point of failure), easy to set up, low cost.
  • Disadvantages: Less secure, difficult to manage, performance depends on the number and capability of active peers.

50.

What are Unicast, Multicast, and Broadcast?

Ans:

These are three types of data transmission methods in a network:

  • Unicast: This is a one-to-one transmission. A packet is sent from a single source to a single, specific destination. This is the most common form of transmission on the Internet.
  • Multicast: This is a one-to-many transmission. A packet is sent from a single source to multiple interested destinations simultaneously. It's more efficient than sending multiple unicast packets. Used for applications like IPTV and online stock tickers.
  • Broadcast: This is a one-to-all transmission. A packet is sent from a single source to all other devices on the same network segment (broadcast domain). Used by protocols like ARP and DHCP.

Loading…
Tags: Computer Networking Interview Questions and Answers || Computer Networking Sort Questions and Answers || Computer Networking Detailed Questions and Answers || Computer Networking Tutorial