Loading...
Networking Concepts

Networking

1. What is the OSI Model? Explain each layer.
A) The OSI (Open Systems Interconnection),The OSI model has 7 layers: Physical (bits), Data Link (frames), Network (routing), Transport (TCP/UDP), Session (connection management),
Presentation (encryption/translation), and Application (services like HTTP/FTP). Each layer has a specific role in data communication.

2. What is the difference between TCP and UDP?
A) TCP(Transmission Control Protocol) is connection-oriented, reliable, and ensures packet order; used for HTTP/SSH. UDP(User Datagram Protocol) is connectionless, faster, unreliable, and used for DNS, VoIP, or streaming

3. What is a MAC address?
A) A MAC(Media Access Control) address is a unique hardware identifier for a network interface, used to identify devices on a local network

4. What is an IP address? Differentiate between IPv4 and IPv6
A)

  • IP(Internet Protocol) address uniquely identifies a device on a network. IPv4 is 32-bit with ~4.3 billion addresses;
  • IPv6 is 128-bit with virtually unlimited addresses and built-in security

5. What is subnetting and why is it used?
A) Subnetting = splitting a network into smaller parts for efficiency, performance, and security

6. What is NAT and how does it work?
A) NAT(Network Address Translation) translates private IPs to public IPs for Internet access. Outgoing traffic source IP is replaced by public IP, incoming responses are mapped back. It saves IPs and hides internal networks

7. What is the difference between static and dynamic IP addressing?
A)

  • Static IP is manually assigned and permanent, used for servers.
  • Dynamic IP is automatically assigned by DHCP and can change, used for client devices

8. What is ARP and how does it function?
A) ARP(Address Resolution Protocol) resolves IP addresses to MAC addresses on a local network. A device sends a broadcast ARP request for an IP, the target replies with its MAC, and the sender caches it for communication.

9. What is a default gateway?
A) A default gateway is the router a device uses to send packets to networks outside its local subnet.

10) Types of IP Addresses
IPv4 (Internet Protocol version 4)
• Address Format: 32-bit number (e.g., 192.168.1.1).
• Range: About 4.3 billion unique addresses.
• Notation: Written in dotted-decimal format (four octets separated by dots).
• Example: 8.8.8.8 (Google’s Public DNS server).
• Limitation: Address exhaustion (we’ve almost run out of IPv4 addresses).

IPv6 (Internet Protocol version 6)
• Address Format: 128-bit number (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334).
• Range: Around 340 undecillion (3.4 × 10^38) addresses – practically unlimited.
• Notation: Written in hexadecimal with colons (:).
• Example: 2001:4860:4860::8888 (Google’s Public DNS in IPv6).
• Advantages:
o No shortage of addresses.
o Built-in security features (IPSec).
o Better efficiency for routing and packet handling.

11) Public vs. Private IPs
Private IP: Used inside your home/office network. (e.g., 192.168.0.10, 10.0.0.5). These are not routable on the internet.
• Public IP: Unique across the entire internet (e.g., 142.250.183.206 → belongs to Google).

12) Who Assigns Public IP Addresses?
1. IANA (Internet Assigned Numbers Authority)
o Manages global IP address allocation.

2. RIRs (Regional Internet Registries) – distribute IP blocks:
o ARIN (North America)
o RIPE NCC (Europe, Middle East, Central Asia)
o APNIC (Asia-Pacific)
o LACNIC (Latin America, Caribbean)
o AFRINIC (Africa)

3. ISPs (Internet Service Providers)
o Your ISP leases you a public IP from its assigned block.
o Example: If you’re in Canada using Bell or Rogers, they give you a dynamic public IP when you connect your modem.

Real-Life Examples
• Home Internet:
o You connect your Wi-Fi at home. Your ISP (say Bell Canada) assigns you a public IPv4 like 99.229.45.12.
o Inside your house, your router gives your devices private IPs like 192.168.0.5.

• Company Data Center:
o A bank in Toronto needs static public IPs for its servers. It requests a block of IPv4/IPv6 addresses from its ISP or directly from ARIN.

• Google DNS:
o IPv4: 8.8.8.8
o IPv6: 2001:4860:4860::8888

In short:
• IPv4 = older, limited, still widely used.
• IPv6 = newer, massive address space, slowly being adopted.
• Public IPs are assigned by IANA → RIRs → ISPs → You.

13) How IP addresses are assigned to Router
• A router usually has two interfaces:
1. WAN (Wide Area Network) side → This connects to the ISP. It is usually assigned a public IP (e.g., 99.229.45.12) by your Internet Service Provider.
2. LAN (Local Area Network) side → This connects to your internal devices (PCs, phones, printers). The router assigns itself a private IP (e.g., 192.168.0.1 or 10.0.0.1) to act as the gateway for your network.

• Devices in your home (like your laptop) get private IPs (e.g., 192.168.0.10) via DHCP from the router.

• The router then uses NAT (Network Address Translation) to translate all your devices’ private
IPs into its single public IP when communicating with the internet.

Example in Real Life
• You have Bell Canada internet:
o Router WAN side: 142.250.183.206 (public IP given by ISP).
o Router LAN side: 192.168.0.1 (private IP — your devices use this as the gateway).
o Your laptop: 192.168.0.5 (private IP assigned by the router).

When your laptop goes to youtube.com, the router translates your laptop’s private IP → its own public IP
→ sends it out.

Special Case
• In large enterprise networks, sometimes both WAN and LAN sides can use private IPs if they’re behind another layer of firewalls or NAT.
• Example: A company network may connect to an ISP using 10.x.x.x private addressing, and only at the edge firewall does it get mapped to a public IP.

So yes: a router almost always has a private IP on the LAN side, and sometimes on the WAN side too (if NAT is used by the ISP).

14) Let’s take it from the basics — IP Classes, then move to how you, as a beginner, can set IP
scope and assign them in a real-world scenario.

IP Address Classes (IPv4)
IPv4 addresses are divided into classes to define how many networks and hosts they can support.
1. Class A
• Range: 1.0.0.0 → 126.255.255.255
• Default Subnet Mask: 255.0.0.0 (/8)
• Number of Hosts: ~16 million per network
• Example: 10.0.0.1 (often used in private networks)

2. Class B
• Range: 128.0.0.0 → 191.255.255.255
• Default Subnet Mask: 255.255.0.0 (/16)
• Number of Hosts: ~65,000 per network
• Example: 172.16.0.1

3. Class C
• Range: 192.0.0.0 → 223.255.255.255
• Default Subnet Mask: 255.255.255.0 (/24)
• Number of Hosts: 254 per network
• Example: 192.168.1.1

4. Class D (Multicast)
• Range: 224.0.0.0 → 239.255.255.255
• Used for streaming, multicast groups.
• Example: IPTV broadcasts.

5. Class E (Experimental / Research)
• Range: 240.0.0.0 → 255.255.255.255
• Rarely used in real life.

Reserved Private IP Ranges
For internal networks (non-routable on internet):
• Class A: 10.0.0.0 → 10.255.255.255
• Class B: 172.16.0.0 → 172.31.255.255
• Class C: 192.168.0.0 → 192.168.255.255

15) Setting IP Scope
“Scope” means deciding the range of IPs you will allow in your local network.
Example: Home Network
• Suppose your router LAN IP is 192.168.1.1.
• You can set a DHCP Scope on the router:
o Start IP: 192.168.1.100
o End IP: 192.168.1.200
o Subnet Mask: 255.255.255.0
o Gateway: 192.168.1.1
o DNS: 8.8.8.8 (Google DNS)

This means your devices (laptop, phone, printer) will automatically get IPs in the range 192.168.1.100 →
192.168.1.200.

16) How to Assign IPs in Real Life
1. Automatic Assignment (DHCP – Most Common)
• The router automatically gives IPs from the defined scope.
• Example: You connect your phone → router assigns it 192.168.1.105.

2. Manual Assignment (Static IPs)
• You go to your device’s network settings and set:
o IP Address: 192.168.1.50
o Subnet Mask: 255.255.255.0
o Gateway: 192.168.1.1
o DNS: 8.8.8.8

Used when:
• You want a server (like a file server or printer) to always keep the same IP.
• Example: Assign your printer 192.168.1.250.

Real-Life Example (Step by Step)
Scenario: Setting up Wi-Fi at home
1. ISP gives router a public IP (say 99.229.45.12).
2. Router LAN IP = 192.168.1.1 (Private).
3. Set DHCP scope: 192.168.1.100 – 192.168.1.200.
4. Laptop connects → gets 192.168.1.101.
5. Printer → set static IP = 192.168.1.250.
6. All devices use Gateway (192.168.1.1) to reach the internet.

Summary for you as a novice:
• Use Class C (192.168.x.x) for small home/office networks.
• Let your router’s DHCP handle most devices.
• Assign static IPs only to special devices (like servers, printers, NAS).

17) Subnet Mask
A subnet mask defines which part of an IP address is the “network” portion and which is the “host”portion.
• It’s used to figure out which devices are on the same local network.
Example
• IP Address: 192.168.1.10
• Subnet Mask: 255.255.255.0
Here’s what it means:
• 255.255.255 → Fixed (network portion)
• .0 → Flexible (host portion, devices can vary from 1 to 254)
So, devices from 192.168.1.1 → 192.168.1.254 are on the same network.If your computer has 192.168.1.10 and your printer has 192.168.1.50, they can talk directlybecause they’re in the same subnet.

18) Gateway
A default gateway is the device (usually your router) that connects your local network to the outside world (internet).
• If two devices are in the same subnet → they talk directly.
• If a device wants to talk outside its subnet (like a website) → it sends the request to the gateway.
Example
• Laptop IP: 192.168.1.10
• Subnet Mask: 255.255.255.0
• Gateway: 192.168.1.1 (router’s IP)
When you go to youtube.com:
1. Your laptop sees YouTube’s server isn’t in 192.168.1.x.
2. It sends the request to 192.168.1.1 (gateway).
3. The router forwards it to the internet using your public IP.

Real-Life Analogy
• Subnet mask = defines your “neighborhood” (who lives on the same street as you).
• Gateway = the “exit door” from your neighborhood to reach other neighborhoods (internet).

Quick Example Setup
• Router LAN IP (Gateway): 192.168.1.1
• Subnet Mask: 255.255.255.0
• Laptop IP: 192.168.1.10
• Phone IP: 192.168.1.20
Both devices can chat directly (same subnet). When they need internet, they go through 192.168.1.1 (gateway).

In short:
• Subnet mask tells devices who’s “local.”
• Gateway is the router that connects your local network to everything else.

19) Static vs Dynamic IP addresses.

Static IP Address
A static IP is an IP address that doesn’t change. It is manually assigned to a device and stays the same until you change it.
Characteristics
• Permanent (fixed address).
• Easier to find a device on the network.
• Often used for servers, printers, or security cameras.
Example
• Your office server might always be 192.168.1.50.
• Your company website server could have a public static IP: 142.250.190.14.
If you type that IP in your browser, you’ll always reach the same server.

Dynamic IP Address
A dynamic IP is automatically assigned by a DHCP server (usually your router or ISP). It can change whenever you reconnect or after a set period. Characteristics
• Temporary (changes over time).
• Saves IP address space.
• More secure for home users (harder for hackers to target).
Example
• At home, your ISP gives your router a dynamic public IP. Today it could be 99.229.45.12, tomorrow 99.229.45.89.
• Your laptop inside Wi-Fi might get 192.168.1.101 today, but if you disconnect/reconnect, it could
become 192.168.1.110.

Real-Life Analogy
• Static IP = Owning a house with a permanent address (easy for friends to find you anytime).
• Dynamic IP = Living in a hotel where the room number changes each time you check in (your friends call the reception first).
When to Use Each
• Static IP
o Hosting a website.
o Running a VPN server.
o Setting up a network printer.
o Remote access to CCTV.
• Dynamic IP
o Normal home internet use (browsing, streaming, gaming).
o Everyday laptops, phones, tablets.

In short:
• Static IP = fixed, best for servers.
• Dynamic IP = changes, best for regular users.

20)  What is APIPA?
APIPA stands for Automatic Private IP Addressing.
• It is a fallback mechanism used by Windows (and some other OSes) when a device can’t get an IP address from a DHCP server.

• The system automatically assigns itself an IP in a special reserved range.

APIPA Range
• Range: 169.254.0.1 → 169.254.255.254
• Subnet Mask: 255.255.0.0
• Gateway: None (since it can’t reach outside the local network).
When Does It Happen?
1. Your device is set to “Obtain IP Automatically” (DHCP).
2. The DHCP server is unavailable (router down, cable unplugged, server crash).
3. Windows assigns an APIPA address so the device can still talk to other devices in the same
subnet, but not the internet.
Real-Life Example
• You connect your laptop to Wi-Fi, but the router’s DHCP server is broken.
• Your laptop tries to get an IP… fails… so Windows assigns:
o IP Address: 169.254.23.45
o Subnet Mask: 255.255.0.0
o Gateway: (blank)

You can share files or print with another device on the same APIPA range, but you can’t access the internet.
How to Recognize It
• Run ipconfig on Windows.
• If you see an address starting with 169.254, it means DHCP failed → APIPA assigned.

Analogy
Think of APIPA like this:
• You walk into a hotel (network) expecting the receptionist (DHCP server) to give you a room key (IP).
• The receptionist is missing.
• So you pick a temporary room in a “default” hallway (169.254.x.x) — but you can’t leave the hotel (no internet).
In short:
APIPA = A self-assigned IP address in the 169.254.x.x range when DHCP fails. Good for local communication, but no internet access.

Leave a Reply

Your email address will not be published. Required fields are marked *