COMPUTER NETWORKS
What is a network?
A network is a collection of interconnected devices that can exchange data and share resources. These devices, called
nodes, are linked together by a physical medium, or a link, such as cables or wireless connections. Networks enable
communication and resource sharing among computers, servers, printers, and other devices.
What do you mean by network topology, and explain its types?
Network topology refers to the physical or logical arrangement of the nodes and links within a network. The topology
determines how data flows and significantly impacts the network's performance, reliability, and cost.
Types of Network Topologies
Bus Topology: All nodes are connected to a single central cable, or "bus." It's simple and cost-effective but has
a single point of failure; if the bus cable breaks, the entire network goes down.
Ring Topology: Each node is connected to exactly two other nodes, forming a single continuous pathway for
signals. Data travels in one direction, and if one node fails, it can disrupt the entire network.
Star Topology: All nodes connect to a central hub, switch, or server. This is the most common topology today.
A failure in one node or its cable doesn't affect the rest of the network, but the central device is a single point of
failure.
Mesh Topology: Every node is interconnected with every other node. This provides high redundancy and fault
tolerance, as data can take multiple paths, but it's complex and expensive to implement.
Tree Topology: Combines characteristics of bus and star topologies, creating a hierarchical structure. It's an
extension of the star topology, where multiple star networks are connected to a central bus.
Define bandwidth, node, and link.
Bandwidth: The maximum rate of data transfer across a given path, measured in bits per second (Bps). It
represents the capacity of a network connection.
Node: Any device that is connected to a network. This can include computers, printers, routers, or servers.
Link: The physical medium that connects two or more nodes in a network, such as an Ethernet cable, a fiber-
optic cable, or a wireless signal.
Explain the TCP/IP model.
The TCP/IP model is a four-layered protocol suite used for communication over the internet. It was developed by the
US Department of Defense and is a more compressed version of the OSI model. The name comes from its two primary
protocols: Transmission Control Protocol (TCP) and Internet Protocol (IP).
Licensed by Google
The Four Layers:
1. Network Access/Link Layer: This is the lowest layer, responsible for sending and receiving data on the
physical network. It handles the details of the physical medium, like Ethernet or Wi-Fi.
2. Internet Layer: This layer handles addressing and routing. The Internet Protocol (IP) works here to ensure
packets are delivered to the correct destination, potentially across different networks.
3. Transport Layer: This layer provides end-to-end communication between applications. It breaks data into
segments and reassembles them. The two main protocols here are TCP, which is connection-oriented and
reliable, and UDP, which is connectionless and faster.
4. Application Layer: The highest layer, containing all the high-level protocols used by applications. Protocols
like HTTP (for web browsing), SMTP (for email), and DNS (for name resolution) operate at this layer.
Layers of the OSI model.
The OSI (Open Systems Interconnection) model is a conceptual framework that standardizes the functions of a
telecommunication or computing system into seven distinct layers. These layers are:
1. Physical Layer
2. Data Link Layer
3. Network Layer
4. Transport Layer
5. Session Layer
6. Presentation Layer
7. Application Layer
Significance of the Data Link Layer.
The Data Link Layer is the second layer of the OSI model. Its primary purpose is to transfer data between adjacent
network nodes over a physical link. It ensures that data is free of errors from the Physical Layer.
Functions of the Data Link Layer:
Framing: It divides the incoming data from the Network Layer into manageable units called frames.
Physical Addressing: It adds a physical address (like a MAC address) to the frames so that the destination can
be uniquely identified on the local network.
Flow Control: It prevents a fast sender from overwhelming a slow receiver by regulating the data flow.
Error Control: It detects and corrects errors that may have occurred during the transmission on the physical
link.
Link Management: It manages the establishment and termination of the link between the two communicating
nodes.
Define gateway, difference between gateway and router.
A gateway is a network node that connects two dissimilar networks, often operating at different layers of the OSI
model. It acts as a protocol converter, translating data formats to allow communication between different types of
networks. A router, on the other hand, connects two similar networks and forwards data packets based on their IP
addresses. While a router works within one set of protocols, a gateway can connect networks using entirely different
protocols.
What does the ping command do?
The ping command is a network utility used to test the reachability of a host on an IP network. It measures the round-
trip time for messages sent from the originating host to a destination computer. It essentially sends a packet to a target
device's IP address and waits for a reply, helping you determine if a connection exists and how long it takes to
communicate.
What is DNS, DNS forwarder, and NIC?
DNS (Domain Name System): A hierarchical and decentralized naming system for computers, services, or any
resource connected to the internet or a private network. It translates human-friendly domain names (like
[Link]) into numerical IP addresses (like [Link]), which are necessary for locating and
identifying devices.
DNS Forwarder: A DNS server that, when it receives a query it can't resolve, forwards the request to an
external DNS server for resolution instead of performing a recursive lookup itself. This is often used for
security or performance reasons.
NIC (Network Interface Card): A hardware component that connects a computer to a network. Each NIC has
a unique MAC address that identifies it on the network.
What is a MAC address?
A Media Access Control (MAC) address is a unique, physical identifier assigned to a network interface controller
(NIC) for communication within a network segment. It's a 12-digit hexadecimal number (e.g., 00:1A:2B:3C:4D:5E).
Unlike an IP address, which can change, a MAC address is permanently embedded in the hardware by the
manufacturer.
What is an IP address, private IP address, public IP address, and APIPA?
IP Address: A unique numerical label assigned to each device connected to a computer network that uses the
Internet Protocol for communication.
Private IP Address: An address used within a private network (like a home or office LAN). These addresses
are not routable on the public internet and are typically managed by a router.
Public IP Address: An address assigned by an Internet Service Provider (ISP) to a device connected directly
to the public internet. This address is globally unique and allows a device to be accessed from anywhere on the
internet.
APIPA (Automatic Private IP Addressing): A feature in operating systems that automatically assigns a
private IP address from a specific range ([Link] to [Link]) when the computer can't get an
IP address from a DHCP server.
What is the difference between IPv4 and IPv6?
Feature IPv4 IPv6
32-bit numerical address (e.g., 128-bit hexadecimal address (e.g.,
Address Format
[Link]) 2001:0db8:85a3:0000:0000:8a2e:0370:7334)
Number of
Approximately 4.3×109 Approximately 3.4×1038
Addresses
Optional, often used as an add-
IPSec Built-in and mandatory for protocol implementation.
on.
Simple header with a
Header More complex header without a checksum.
checksum.
Limited mobility and requires
Mobility Built-in mobility and neighbor discovery.
extra protocols.
Export to Sheets
What is a subnet?
A subnet is a logical sub-network within a larger network. The process of dividing a network into smaller subnets is
called subnetting. Subnetting improves routing efficiency, enhances network security, and reduces network
congestion by containing local traffic to its respective subnet.
Firewalls.
A firewall is a network security system that monitors and controls incoming and outgoing network traffic based on
predetermined security rules. It acts as a barrier between a trusted internal network and an untrusted external network
(like the internet). A firewall can be a hardware device, software, or a combination of both.
Different types of delays.
In computer networks, delay is the time it takes for a packet to travel from one point to another. The total delay is the
sum of several components:
Transmission Delay: The time it takes to push all the packet's bits onto the transmission medium.
Propagation Delay: The time it takes for a bit to travel from the beginning of the link to the end.
Queuing Delay: The time a packet spends waiting in a queue at a router before being transmitted.
Processing Delay: The time it takes for a router to process a packet header.
3-way handshaking.
The 3-way handshake is the process used by the TCP protocol to establish a connection between a client and a server
before data is sent. It's a three-step process:
1. SYN (Synchronize): The client sends a synchronization packet to the server to initiate the connection.
2. SYN-ACK (Synchronize-Acknowledge): The server receives the SYN packet and responds with its own SYN
packet and an ACK (acknowledgment) of the client's packet.
3. ACK (Acknowledge): The client sends an ACK packet to the server to confirm that the connection has been
established.
Server-side load balancer.
A server-side load balancer is a device or software that distributes incoming network traffic across multiple servers.
It acts as a single point of contact for clients and uses various algorithms (like round-robin or least connections) to
route requests to one of the backend servers. This improves performance and ensures that no single server is
overloaded. AWS Elastic Load Balancing (ELB) is a prime example.
RSA Algorithm.
The RSA algorithm is an asymmetric cryptography algorithm, meaning it uses two different keys: a public key and
a private key. The public key can be shared with anyone, while the private key must be kept secret. Data encrypted
with the public key can only be decrypted with the corresponding private key. This ensures secure communication
because even if a third party intercepts the public key and the encrypted data, they cannot decrypt it.
What are the HTTP and HTTPS protocols?
HTTP (HyperText Transfer Protocol): An application-layer protocol that defines the rules for transmitting
hypertext documents, such as web pages, on the World Wide Web. It's a stateless protocol that operates on port
80.
HTTPS (HyperText Transfer Protocol Secure): A more secure version of HTTP. It uses the SSL/TLS
protocol to encrypt the communication between the browser and the server. This ensures that the data (like
passwords and credit card information) is protected from eavesdropping. HTTPS uses port 443.
What is the SMTP protocol?
SMTP (Simple Mail Transfer Protocol) is an application-layer protocol used for sending electronic mail. It sets the
rules for communication between email servers, allowing mail to be transmitted from a client to a server and from one
server to another. SMTP operates on port 25.
TCP vs. UDP.
Feature TCP (Transmission Control Protocol) UDP (User Datagram Protocol)
Connection
Connection-oriented Connectionless
Type
Highly reliable; provides flow control and error Unreliable; does not guarantee delivery or order of
Reliability
checking with acknowledgments. packets.
Slower due to overhead of establishing a
Speed Faster due to minimal overhead.
connection and ensuring delivery.
Applications requiring high reliability (e.g., file Applications requiring speed over reliability (e.g.,
Use Cases
transfer, web browsing). video streaming, online gaming).
Export to Sheets
What happens when you enter "[Link]" in a browser?
1. Browser Cache Check: The browser first checks its local cache to see if it has a recent copy of the content.
2. DNS Lookup: If not in the cache, the browser requests the IP address for [Link]. The operating system
performs a DNS lookup to find the corresponding IP address.
3. TCP Connection: Once the IP address is found, the browser initiates a 3-way handshake to establish a TCP
connection with the Google server.
4. HTTP Request: The browser sends an HTTP (or HTTPS) request to the Google server.
5. Server Response: The Google server processes the request and sends back an HTTP response containing the
requested data (e.g., the HTML, CSS, and JavaScript for the homepage).
6. Rendering: The browser processes the received data and renders the Google homepage for you to see.
Hub vs. Switch.
Hub: A simple networking device that operates at the Physical Layer. It broadcasts all incoming data to every
other connected port. This creates unnecessary network traffic and can be inefficient.
Switch: A more intelligent networking device that operates at the Data Link Layer. It learns the MAC
addresses of connected devices and only sends data to the specific port of the destination device. This reduces
network congestion and improves performance.
VPN, advantages, and disadvantages.
A VPN (Virtual Private Network) is a technology that creates a secure, encrypted tunnel over a public network, such
as the internet. It allows a user to access a private network remotely and securely, as if they were physically connected.
Advantages of VPNs:
Security: Encrypts your internet traffic, protecting your data from prying eyes.
Privacy: Disguises your IP address, making your online activities harder to trace.
Remote Access: Allows employees to securely connect to a company's internal network from a remote
location.
Cost-Effective: Can be a cheaper alternative to traditional WAN connections for connecting geographically
distant offices.
Disadvantages of VPNs:
Unpredictable Performance: Performance can fluctuate depending on the server load and the distance to the
server.
Complexity: Some VPNs can be difficult to set up and manage, especially in large, complex networks.
Lack of Granular Security: They often provide a "one-size-fits-all" security solution and may not be suitable
for all applications.
LAN.
A Local Area Network (LAN) is a computer network that interconnects devices within a limited physical area, such
as a home, office building, or school. LANs are typically owned and managed by a single organization.