←
Computer Science and Electronics for Digital Assistant · Chapter 7

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

TypeFull formArea coveredExample
PANPersonal Area NetworkA few metres around one personBluetooth link of phone and earphones
LANLocal Area NetworkOne room, building or campusOffice computers and a printer
MANMetropolitan Area NetworkA cityCable TV network of a city
WANWide Area NetworkCountry or worldThe 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.

TopologyLayoutMain advantageMain drawback
BusAll nodes on one common cableCheap, little cableCable break stops the whole network
StarEvery node joins a central hub or switchEasy to add nodes; one cable fault affects only one nodeCentral device failure stops all
RingEach node joins two neighbours in a loopOrderly data flowOne break can stop the ring (in simple rings)
MeshNodes joined to many other nodesVery reliableCostly, many links
TreeStar networks joined in a hierarchyEasy to expandDepends 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.

ProtocolJob
IPAddressing and routing of packets
TCPReliable, ordered delivery with error checking
UDPFast delivery without guarantee (streaming, calls)
HTTP / HTTPSWeb pages (HTTPS is the secure version)
FTPFile transfer
SMTPSending email
POP3 / IMAPReceiving email
DNSConverts domain names to IP addresses
DHCPGives IP addresses automatically
Telnet / SSHRemote 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

  1. Which type of network covers a single building or campus?

    1. MAN
    2. PAN
    3. WAN
    4. LAN
    Answer

    D. LAN

    A Local Area Network covers a room, building or campus.

  2. How many layers does the OSI model have?

    1. 4
    2. 5
    3. 7
    4. 6
    Answer

    C. 7

    The OSI model has seven layers from Physical to Application.

  3. How many layers does the TCP/IP model have?

    1. 3
    2. 4
    3. 5
    4. 7
    Answer

    B. 4

    TCP/IP has Application, Transport, Internet and Network Access layers.

  4. Which device sends data only to the intended port using the MAC address?

    1. Switch
    2. Modem
    3. Repeater
    4. Hub
    Answer

    A. Switch

    A switch forwards frames only to the port of the destination MAC address.

  5. Which device joins different networks and selects the path using IP addresses?

    1. Switch
    2. Hub
    3. Repeater
    4. Router
    Answer

    D. Router

    A router forwards packets between networks by IP address.

  6. What does DNS do?

    1. Converts domain names to IP addresses
    2. Gives IP addresses automatically
    3. Sends email
    4. Transfers files
    Answer

    A. Converts domain names to IP addresses

    DNS resolves readable names into IP addresses.

  7. The size of an IPv4 address is

    1. 64 bits
    2. 32 bits
    3. 128 bits
    4. 48 bits
    Answer

    B. 32 bits

    IPv4 uses 32 bits; IPv6 uses 128 bits.

  8. The size of a MAC address is

    1. 128 bits
    2. 64 bits
    3. 32 bits
    4. 48 bits
    Answer

    D. 48 bits

    A MAC address is a 48-bit hardware address.

  9. Which protocol is used to send email from a client to a mail server?

    1. FTP
    2. SMTP
    3. IMAP
    4. POP3
    Answer

    B. SMTP

    SMTP is for sending; POP3 and IMAP are for receiving.

  10. The secure version of HTTP is

    1. HTTPS
    2. Telnet
    3. SMTP
    4. FTP
    Answer

    A. HTTPS

    HTTPS encrypts web traffic.

  11. A fake email that tricks users into revealing passwords is called

    1. Booting
    2. Spooling
    3. Caching
    4. Phishing
    Answer

    D. Phishing

    Phishing uses fake messages or sites to steal credentials.

  12. Which malware locks data and demands payment to unlock it?

    1. Spyware
    2. Ransomware
    3. Adware
    4. Worm
    Answer

    B. Ransomware

    Ransomware encrypts files and asks for a ransom.

  13. Which topology joins every node to a central hub or switch?

    1. Mesh
    2. Bus
    3. Ring
    4. Star
    Answer

    D. Star

    In a star topology all nodes connect to a central device.

  14. The unit used to measure bandwidth is

    1. bits per second
    2. volts per second
    3. bytes per metre
    4. hertz per bit
    Answer

    A. bits per second

    Bandwidth or data rate is given in bps, kbps, Mbps, Gbps.

  15. Which medium carries data as pulses of light?

    1. Microwave link
    2. Twisted pair
    3. Optical fibre
    4. Coaxial cable
    Answer

    C. Optical fibre

    Optical fibre sends light pulses through glass strands.

  16. The default port number of HTTPS is

    1. 443
    2. 80
    3. 21
    4. 25
    Answer

    A. 443

    HTTPS uses port 443; HTTP uses port 80.

  17. Which law is the main Indian act on cyber crime and electronic records?

    1. Right to Information Act, 2005
    2. Copyright Act, 1957
    3. Indian Telegraph Act, 1885
    4. Information Technology Act, 2000
    Answer

    D. Information Technology Act, 2000

    The IT Act, 2000 deals with cyber crime and electronic records.

  18. A full mesh network has 6 nodes. How many links are needed?

    1. 12
    2. 15
    3. 18
    4. 30
    Answer

    B. 15

    n(n - 1)/2 = 6 x 5 / 2 = 15.

  19. A full mesh network has 8 nodes. How many links are needed?

    1. 56
    2. 32
    3. 28
    4. 16
    Answer

    C. 28

    8 x 7 / 2 = 28.

  20. In a bus topology, which fault stops the whole network?

    1. Removal of one printer
    2. Failure of one node
    3. Break in the main cable
    4. 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.

  21. A walkie-talkie, in which both sides can talk but only one at a time, uses which mode?

    1. Simplex
    2. Half duplex
    3. Multiplex
    4. Full duplex
    Answer

    B. Half duplex

    Half duplex allows both directions but not at the same time.

  22. A worm differs from a virus because a worm

    1. only infects hardware
    2. cannot spread over a network
    3. needs a user to run a host program
    4. 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.

  23. A program that appears useful but hides harmful code is called a

    1. Trojan
    2. Firewall
    3. Worm
    4. Patch
    Answer

    A. Trojan

    A Trojan is disguised malware that does not copy itself.

  24. Converting plain text to cipher text using a key is called

    1. Encryption
    2. Compression
    3. Indexing
    4. Formatting
    Answer

    A. Encryption

    Encryption makes data unreadable without the key.

  25. Flooding a server with requests so that real users cannot reach it is a

    1. Spoofing patch
    2. DoS attack
    3. Brute backup
    4. Phishing attack
    Answer

    B. DoS attack

    A Denial of Service attack exhausts the server's capacity.

  26. Which of these is a guided transmission medium?

    1. Microwave
    2. Infrared
    3. Radio wave
    4. Twisted pair cable
    Answer

    D. Twisted pair cable

    Guided media use a physical cable; radio, microwave and infrared are unguided.

  27. A device that joins networks using different protocols is a

    1. Hub
    2. Repeater
    3. Gateway
    4. Switch
    Answer

    C. Gateway

    A gateway translates between different protocols.

  28. Which protocol gives IP addresses to devices automatically?

    1. DNS
    2. DHCP
    3. SMTP
    4. FTP
    Answer

    B. DHCP

    Dynamic Host Configuration Protocol assigns IP addresses.

  29. Which protocol gives reliable, ordered delivery with error checking?

    1. ARP
    2. DNS
    3. TCP
    4. UDP
    Answer

    C. TCP

    TCP is connection-oriented and reliable; UDP is not guaranteed.

  30. Which of the following is the best practice for online payments?

    1. Share the OTP with the bank caller
    2. Use only HTTPS sites and never share the OTP
    3. Use one password everywhere
    4. 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.

  31. Which part of the CIA triad means that only authorised people can read data?

    1. Authentication of users
    2. Availability
    3. Integrity
    4. Confidentiality
    Answer

    D. Confidentiality

    Confidentiality restricts access to authorised users.

  32. 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. 1 only
    2. 2 only
    3. Both 1 and 2
    4. Neither 1 nor 2
    Answer

    C. Both 1 and 2

    Both are correct: hub broadcasts, switch forwards selectively.

  33. Statement 1: IPv6 addresses are 32 bits long. Statement 2: IPv4 addresses are 128 bits long. Which of the statements is/are correct?

    1. 1 only
    2. 2 only
    3. Both 1 and 2
    4. Neither 1 nor 2
    Answer

    D. Neither 1 nor 2

    IPv4 is 32 bits and IPv6 is 128 bits; both statements are wrong.

  34. 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. 1 only
    2. 2 only
    3. Both 1 and 2
    4. Neither 1 nor 2
    Answer

    A. 1 only

    SMTP sends mail; POP3 and IMAP receive it.

  35. 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. 1 only
    2. 2 only
    3. Both 1 and 2
    4. Neither 1 nor 2
    Answer

    A. 1 only

    A router uses IP addresses; a switch uses MAC addresses within one network.

  36. 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. 1 only
    2. 2 only
    3. Both 1 and 2
    4. Neither 1 nor 2
    Answer

    B. 2 only

    TCP is reliable; UDP does not guarantee delivery.

  37. 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. 1 only
    2. 2 only
    3. Both 1 and 2
    4. Neither 1 nor 2
    Answer

    B. 2 only

    An intranet is private; an extranet is shared with selected outsiders.

  38. 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. 1 only
    2. 2 only
    3. Both 1 and 2
    4. Neither 1 nor 2
    Answer

    C. Both 1 and 2

    Both are standard functions.

  39. 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. 1 only
    2. 2 only
    3. Both 1 and 2
    4. Neither 1 nor 2
    Answer

    B. 2 only

    Fibre carries light and is not affected by electrical noise; it has high bandwidth.

  40. 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. 1 only
    2. 2 only
    3. Both 1 and 2
    4. Neither 1 nor 2
    Answer

    C. Both 1 and 2

    Both are true for a star network.

  41. 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. 1 only
    2. 2 only
    3. Both 1 and 2
    4. Neither 1 nor 2
    Answer

    B. 2 only

    Symmetric encryption uses one shared key; asymmetric uses a key pair.

  42. Statement 1: A virus attaches itself to files. Statement 2: Spyware locks files and demands money. Which of the statements is/are correct?

    1. 1 only
    2. 2 only
    3. Both 1 and 2
    4. Neither 1 nor 2
    Answer

    A. 1 only

    Spyware secretly collects information; ransomware is the one that demands money.

  43. 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. 1 only
    2. 2 only
    3. Both 1 and 2
    4. Neither 1 nor 2
    Answer

    B. 2 only

    Circuit switching uses a fixed path; packet switching sends packets by different paths.

  44. 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. 1 only
    2. 2 only
    3. Both 1 and 2
    4. Neither 1 nor 2
    Answer

    B. 2 only

    Application is layer 7 (top); Physical is layer 1 (bottom).

  45. 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. 1 only
    2. 2 only
    3. Both 1 and 2
    4. Neither 1 nor 2
    Answer

    A. 1 only

    Bcc is blind carbon copy and hides receivers; Cc copies are visible.

Page 1 of 1
‹
›