Computer Networks and Security
What to remember
- A network links computers to share data and resources. Types by size are PAN, LAN, MAN and WAN; the layout is called topology (bus, star, ring, mesh, tree).
- Models and protocols decide how data moves. The OSI model has 7 layers and the TCP/IP model has 4 layers. IP gives addresses, TCP gives reliable delivery, HTTP/HTTPS carry web pages.
- Security protects data by confidentiality, integrity and availability. Passwords, firewalls, encryption, antivirus and backups are the basic defences.
Basics of a network
A computer network is a group of computers and devices joined by cables or wireless links so that they can share files, printers, internet and applications. Each device on a network is called a node. A computer that gives services is a server. A computer that asks for services is a client.
Benefits: resource sharing, fast communication, central backup, and lower cost. Drawbacks: security risk, dependence on the server, and set-up cost.
Transmission modes:
- Simplex: one direction only (keyboard to computer, radio broadcast).
- Half duplex: both directions, but one at a time (walkie-talkie).
- Full duplex: both directions at the same time (telephone).
Bandwidth is the amount of data a link can carry in a given time. It is measured in bits per second (bps), kbps, Mbps and Gbps. Latency is the delay in delivery.
Types of networks
| Type | Full form | Area covered | Example |
|---|---|---|---|
| PAN | Personal Area Network | A few metres around one person | Bluetooth link of phone and earphones |
| LAN | Local Area Network | One room, building or campus | Office computers and a printer |
| MAN | Metropolitan Area Network | A city | Cable TV network of a city |
| WAN | Wide Area Network | Country or world | The Internet, bank networks |
An intranet is a private network of an organisation that uses internet technology. An extranet lets selected outsiders use part of an intranet. The Internet is the global network of networks.
Topologies
Topology means the physical or logical layout of nodes.
| Topology | Layout | Main advantage | Main drawback |
|---|---|---|---|
| Bus | All nodes on one common cable | Cheap, little cable | Cable break stops the whole network |
| Star | Every node joins a central hub or switch | Easy to add nodes; one cable fault affects only one node | Central device failure stops all |
| Ring | Each node joins two neighbours in a loop | Orderly data flow | One break can stop the ring (in simple rings) |
| Mesh | Nodes joined to many other nodes | Very reliable | Costly, many links |
| Tree | Star networks joined in a hierarchy | Easy to expand | Depends on the root |
For a full mesh of n nodes, the number of links is n(n − 1)/2. Example: 5 nodes need 5 × 4 / 2 = 10 links.
Network devices
- Hub: sends incoming data to all ports. It does not filter.
- Switch: sends data only to the port of the intended device, using the MAC address.
- Router: joins different networks and chooses the path for packets using IP addresses.
- Modem: converts digital signals to analog for the telephone line and back (modulator-demodulator).
- Bridge: joins two LAN segments of the same type.
- Repeater: regenerates a weak signal to extend distance.
- Gateway: joins networks that use different protocols.
- Network Interface Card (NIC): the hardware that connects a computer to the network. It holds the MAC address.
- Access point: gives wireless (Wi-Fi) access to a wired network.
Transmission media: twisted pair, coaxial cable, optical fibre (guided), and radio waves, microwaves, infrared and satellite (unguided). Optical fibre carries light, has very high bandwidth and is not affected by electrical noise.
Models, protocols and addresses
The OSI model has 7 layers. From the top: Application, Presentation, Session, Transport, Network, Data Link, Physical. A memory aid is "All People Seem To Need Data Processing".
The TCP/IP model has 4 layers: Application, Transport, Internet, and Network Access.
| Protocol | Job |
|---|---|
| IP | Addressing and routing of packets |
| TCP | Reliable, ordered delivery with error checking |
| UDP | Fast delivery without guarantee (streaming, calls) |
| HTTP / HTTPS | Web pages (HTTPS is the secure version) |
| FTP | File transfer |
| SMTP | Sending email |
| POP3 / IMAP | Receiving email |
| DNS | Converts domain names to IP addresses |
| DHCP | Gives IP addresses automatically |
| Telnet / SSH | Remote login (SSH is secure) |
IP address: IPv4 is 32 bits written as four decimal numbers from 0 to 255, such as 192.168.1.10. IPv6 is 128 bits. A MAC address is a 48-bit hardware address burned into the NIC. A URL is the full web address, such as https://www.example.com/page. A domain name is the readable name of a site. Common ports: 80 for HTTP and 443 for HTTPS.
Data is sent in small units called packets. Packet switching sends packets by different paths and joins them at the end. Circuit switching keeps one fixed path for the whole call.
Internet and web services
The Internet is the worldwide network. The World Wide Web (WWW) is a service on the Internet that uses hyperlinks and browsers. A web browser (Chrome, Firefox, Edge) shows web pages. A search engine finds pages by keywords. An ISP (Internet Service Provider) gives internet access. Email has To, Cc, Bcc, Subject and attachment fields. Bcc hides the receiver from others. Cloud computing gives storage and software over the Internet on demand. Wi-Fi uses radio waves for a wireless LAN.
For Sachivalayam work, digital services such as online applications, e-office and web portals rely on these networks. The AP government uses state data networks to connect village and ward offices (check the latest official release for names of current systems).
Network security
The three goals are known as the CIA triad: Confidentiality (only allowed people can read), Integrity (data is not changed without permission) and Availability (data can be used when needed).
Threats:
- Virus: a program that attaches to files and spreads when they run.
- Worm: spreads by itself through networks without needing a host file.
- Trojan: looks useful but hides harmful code.
- Ransomware: locks data and asks for money to unlock it.
- Spyware: secretly collects user information.
- Phishing: fake emails or sites that trick users into giving passwords or bank details.
- Spam: unwanted bulk email.
- Hacking: unauthorised access to a system.
- DoS / DDoS: flooding a server so real users cannot reach it.
Defences:
- Firewall: filters incoming and outgoing traffic by rules.
- Antivirus: finds and removes malware.
- Encryption: converts plain text to cipher text using a key. Symmetric encryption uses one key. Asymmetric encryption uses a public and private key pair.
- Authentication: proves identity by password, OTP, fingerprint or card.
- Digital signature: proves who sent a message and that it was not changed.
- Backup: a copy of data kept safely.
- Updates: software patches close known holes.
Good habits: use long unique passwords, do not share OTPs, do not click unknown links, and use only HTTPS sites for payments. In India, the Information Technology Act, 2000 is the main law on cyber crime and electronic records. Citizens can report cyber fraud on the national cyber crime portal and helpline 1930.
Exam traps
- Hub and switch: a hub broadcasts to all; a switch sends only to the target device.
- Router and switch: a router joins networks (IP); a switch joins devices in one network (MAC).
- Virus and worm: a virus needs a host file; a worm spreads alone.
- Virus and trojan: a trojan does not copy itself; it hides inside a useful-looking program.
- IPv4 and IPv6: 32 bits and 128 bits.
- POP3/IMAP and SMTP: SMTP sends, POP3/IMAP receive.
- TCP and UDP: TCP is reliable; UDP is fast but not guaranteed.
- HTTP and HTTPS: HTTPS is encrypted; HTTP is not.
- Intranet and extranet: intranet is private to the organisation; extranet shares part with outsiders.
- Simplex and half duplex: simplex is one way always; half duplex alternates.
One-liners
- 1. A LAN covers a building or campus.
- 2. The Internet is a WAN of networks.
- 3. A switch uses MAC addresses to forward data.
- 4. A router uses IP addresses to forward packets.
- 5. DNS converts domain names to IP addresses.
- 6. IPv4 has 32 bits; IPv6 has 128 bits.
- 7. The OSI model has 7 layers.
- 8. The TCP/IP model has 4 layers.
- 9. A full mesh of n nodes has n(n − 1)/2 links.
- 10. A firewall filters network traffic by rules.
- 11. Phishing tricks users into revealing secrets.
- 12. Optical fibre sends data as light pulses.
Practice questions
Which type of network covers a single building or campus?
- MAN
- PAN
- WAN
- LAN
Answer
D. LAN
A Local Area Network covers a room, building or campus.
How many layers does the OSI model have?
- 4
- 5
- 7
- 6
Answer
C. 7
The OSI model has seven layers from Physical to Application.
How many layers does the TCP/IP model have?
- 3
- 4
- 5
- 7
Answer
B. 4
TCP/IP has Application, Transport, Internet and Network Access layers.
Which device sends data only to the intended port using the MAC address?
- Switch
- Modem
- Repeater
- Hub
Answer
A. Switch
A switch forwards frames only to the port of the destination MAC address.
Which device joins different networks and selects the path using IP addresses?
- Switch
- Hub
- Repeater
- Router
Answer
D. Router
A router forwards packets between networks by IP address.
What does DNS do?
- Converts domain names to IP addresses
- Gives IP addresses automatically
- Sends email
- Transfers files
Answer
A. Converts domain names to IP addresses
DNS resolves readable names into IP addresses.
The size of an IPv4 address is
- 64 bits
- 32 bits
- 128 bits
- 48 bits
Answer
B. 32 bits
IPv4 uses 32 bits; IPv6 uses 128 bits.
The size of a MAC address is
- 128 bits
- 64 bits
- 32 bits
- 48 bits
Answer
D. 48 bits
A MAC address is a 48-bit hardware address.
Which protocol is used to send email from a client to a mail server?
- FTP
- SMTP
- IMAP
- POP3
Answer
B. SMTP
SMTP is for sending; POP3 and IMAP are for receiving.
The secure version of HTTP is
- HTTPS
- Telnet
- SMTP
- FTP
Answer
A. HTTPS
HTTPS encrypts web traffic.
A fake email that tricks users into revealing passwords is called
- Booting
- Spooling
- Caching
- Phishing
Answer
D. Phishing
Phishing uses fake messages or sites to steal credentials.
Which malware locks data and demands payment to unlock it?
- Spyware
- Ransomware
- Adware
- Worm
Answer
B. Ransomware
Ransomware encrypts files and asks for a ransom.
Which topology joins every node to a central hub or switch?
- Mesh
- Bus
- Ring
- Star
Answer
D. Star
In a star topology all nodes connect to a central device.
The unit used to measure bandwidth is
- bits per second
- volts per second
- bytes per metre
- hertz per bit
Answer
A. bits per second
Bandwidth or data rate is given in bps, kbps, Mbps, Gbps.
Which medium carries data as pulses of light?
- Microwave link
- Twisted pair
- Optical fibre
- Coaxial cable
Answer
C. Optical fibre
Optical fibre sends light pulses through glass strands.
The default port number of HTTPS is
- 443
- 80
- 21
- 25
Answer
A. 443
HTTPS uses port 443; HTTP uses port 80.
Which law is the main Indian act on cyber crime and electronic records?
- Right to Information Act, 2005
- Copyright Act, 1957
- Indian Telegraph Act, 1885
- Information Technology Act, 2000
Answer
D. Information Technology Act, 2000
The IT Act, 2000 deals with cyber crime and electronic records.
A full mesh network has 6 nodes. How many links are needed?
- 12
- 15
- 18
- 30
Answer
B. 15
n(n - 1)/2 = 6 x 5 / 2 = 15.
A full mesh network has 8 nodes. How many links are needed?
- 56
- 32
- 28
- 16
Answer
C. 28
8 x 7 / 2 = 28.
In a bus topology, which fault stops the whole network?
- Removal of one printer
- Failure of one node
- Break in the main cable
- Failure of one NIC card
Answer
C. Break in the main cable
The single common cable is shared by all nodes, so a break stops communication.
A walkie-talkie, in which both sides can talk but only one at a time, uses which mode?
- Simplex
- Half duplex
- Multiplex
- Full duplex
Answer
B. Half duplex
Half duplex allows both directions but not at the same time.
A worm differs from a virus because a worm
- only infects hardware
- cannot spread over a network
- needs a user to run a host program
- spreads by itself without needing a host file
Answer
D. spreads by itself without needing a host file
Worms self-replicate across networks; viruses attach to host files.
A program that appears useful but hides harmful code is called a
- Trojan
- Firewall
- Worm
- Patch
Answer
A. Trojan
A Trojan is disguised malware that does not copy itself.
Converting plain text to cipher text using a key is called
- Encryption
- Compression
- Indexing
- Formatting
Answer
A. Encryption
Encryption makes data unreadable without the key.
Flooding a server with requests so that real users cannot reach it is a
- Spoofing patch
- DoS attack
- Brute backup
- Phishing attack
Answer
B. DoS attack
A Denial of Service attack exhausts the server's capacity.
Which of these is a guided transmission medium?
- Microwave
- Infrared
- Radio wave
- Twisted pair cable
Answer
D. Twisted pair cable
Guided media use a physical cable; radio, microwave and infrared are unguided.
A device that joins networks using different protocols is a
- Hub
- Repeater
- Gateway
- Switch
Answer
C. Gateway
A gateway translates between different protocols.
Which protocol gives IP addresses to devices automatically?
- DNS
- DHCP
- SMTP
- FTP
Answer
B. DHCP
Dynamic Host Configuration Protocol assigns IP addresses.
Which protocol gives reliable, ordered delivery with error checking?
- ARP
- DNS
- TCP
- UDP
Answer
C. TCP
TCP is connection-oriented and reliable; UDP is not guaranteed.
Which of the following is the best practice for online payments?
- Share the OTP with the bank caller
- Use only HTTPS sites and never share the OTP
- Use one password everywhere
- Click links in unknown messages
Answer
B. Use only HTTPS sites and never share the OTP
OTP and passwords must be kept secret; HTTPS protects data in transit.
Which part of the CIA triad means that only authorised people can read data?
- Authentication of users
- Availability
- Integrity
- Confidentiality
Answer
D. Confidentiality
Confidentiality restricts access to authorised users.
Statement 1: A hub sends incoming data to all of its ports. Statement 2: A switch sends data only to the port of the intended device. Which of the statements is/are correct?
- 1 only
- 2 only
- Both 1 and 2
- Neither 1 nor 2
Answer
C. Both 1 and 2
Both are correct: hub broadcasts, switch forwards selectively.
Statement 1: IPv6 addresses are 32 bits long. Statement 2: IPv4 addresses are 128 bits long. Which of the statements is/are correct?
- 1 only
- 2 only
- Both 1 and 2
- Neither 1 nor 2
Answer
D. Neither 1 nor 2
IPv4 is 32 bits and IPv6 is 128 bits; both statements are wrong.
Statement 1: POP3 and IMAP are used to receive email. Statement 2: SMTP is used to receive email. Which of the statements is/are correct?
- 1 only
- 2 only
- Both 1 and 2
- Neither 1 nor 2
Answer
A. 1 only
SMTP sends mail; POP3 and IMAP receive it.
Statement 1: A router uses IP addresses to forward packets. Statement 2: A switch uses IP addresses to forward packets between networks. Which of the statements is/are correct?
- 1 only
- 2 only
- Both 1 and 2
- Neither 1 nor 2
Answer
A. 1 only
A router uses IP addresses; a switch uses MAC addresses within one network.
Statement 1: UDP guarantees delivery of every packet. Statement 2: TCP provides error checking and ordered delivery. Which of the statements is/are correct?
- 1 only
- 2 only
- Both 1 and 2
- Neither 1 nor 2
Answer
B. 2 only
TCP is reliable; UDP does not guarantee delivery.
Statement 1: An intranet is open to the general public. Statement 2: An extranet lets selected outsiders use part of an intranet. Which of the statements is/are correct?
- 1 only
- 2 only
- Both 1 and 2
- Neither 1 nor 2
Answer
B. 2 only
An intranet is private; an extranet is shared with selected outsiders.
Statement 1: A firewall can filter incoming and outgoing traffic. Statement 2: An antivirus program can remove malware. Which of the statements is/are correct?
- 1 only
- 2 only
- Both 1 and 2
- Neither 1 nor 2
Answer
C. Both 1 and 2
Both are standard functions.
Statement 1: Optical fibre is affected by electrical noise. Statement 2: Optical fibre has very high bandwidth. Which of the statements is/are correct?
- 1 only
- 2 only
- Both 1 and 2
- Neither 1 nor 2
Answer
B. 2 only
Fibre carries light and is not affected by electrical noise; it has high bandwidth.
Statement 1: In a star topology, failure of one cable affects only one node. Statement 2: In a star topology, failure of the central hub stops all communication. Which of the statements is/are correct?
- 1 only
- 2 only
- Both 1 and 2
- Neither 1 nor 2
Answer
C. Both 1 and 2
Both are true for a star network.
Statement 1: Symmetric encryption uses a public and a private key pair. Statement 2: Asymmetric encryption uses a public and a private key. Which of the statements is/are correct?
- 1 only
- 2 only
- Both 1 and 2
- Neither 1 nor 2
Answer
B. 2 only
Symmetric encryption uses one shared key; asymmetric uses a key pair.
Statement 1: A virus attaches itself to files. Statement 2: Spyware locks files and demands money. Which of the statements is/are correct?
- 1 only
- 2 only
- Both 1 and 2
- Neither 1 nor 2
Answer
A. 1 only
Spyware secretly collects information; ransomware is the one that demands money.
Statement 1: Packet switching keeps one fixed path for the whole call. Statement 2: Circuit switching keeps one fixed path for the whole call. Which of the statements is/are correct?
- 1 only
- 2 only
- Both 1 and 2
- Neither 1 nor 2
Answer
B. 2 only
Circuit switching uses a fixed path; packet switching sends packets by different paths.
Statement 1: In the OSI model, the Physical layer is the top layer. Statement 2: In the OSI model, the Application layer is the top layer. Which of the statements is/are correct?
- 1 only
- 2 only
- Both 1 and 2
- Neither 1 nor 2
Answer
B. 2 only
Application is layer 7 (top); Physical is layer 1 (bottom).
Statement 1: Bcc hides the receiver's address from the other receivers. Statement 2: Cc hides the receiver's address from the other receivers. Which of the statements is/are correct?
- 1 only
- 2 only
- Both 1 and 2
- Neither 1 nor 2
Answer
A. 1 only
Bcc is blind carbon copy and hides receivers; Cc copies are visible.