Network Layer Flashcards
What is network layer?
This is the third layer in the OSI model. It is responsible for routing data from one device to another across networks. It ensures that packets reach the correct destination using IP addresses. It also manages congestion and handles errors.
- When you send an email, your message is broken into packets, which are routed through the internet and reassembled at the receiver’s end.
What is a OSI model?
Open Systems Interconnection
Is a framework that describes how data moves through a network. It has 7 layers, each with a specific function:
Physical – Wires, cables, and signals (how data is physically transmitted).
Data Link – Manages direct connections between devices (MAC addresses, error detection).
Network – Finds the best path for data (IP addresses, routing).
Transport – Ensures reliable data delivery (TCP, UDP).
Session – Manages communication sessions (start, maintain, and end connections).
Presentation – Translates and encrypts data (formatting, compression, encryption).
Application – Interfaces for user applications (web browsers, email, etc.).
- When you send a WhatsApp message, the data moves through all 7 layers, from converting text into bits to routing it across networks until it reaches your friend. 📱➡️🌍➡️📱
What is Routing?
Routing decides the best path for packets to take from the source to the destination. Routers use routing tables and protocols to find the most efficient way.
Think of Google Maps choosing the best route for your car trip. If one road is blocked, it finds another alternative route—just like a router does with data!
What is forwarding?
Forwarding is the process of moving packets from one router to the next until they reach their final destination.
Imagine sorting letters in a post office. Each letter has an address, and workers put it in the correct delivery truck. Similarly, routers sort and forward packets.
What is Router architecture?
A router has different parts:
- Input Ports – Receive incoming packets
- Switching Fabric – Moves packets inside the router
- Output Ports – Send packets to the next hop
- Routing Processor – Decides where packets should go
Think of a train station. Passengers (packets) enter from different gates (input ports), move through the station (switching fabric), and exit to their train (output ports).
What is Control plane vs data plane?
Control Plane: Decides where packets should go (brain of the router).
Data Plane: Forwards packets at high speed (muscle of the router).
A traffic light system represents the control plane (decides when cars go), while the cars driving represent the data plane (moving based on the decision).
What is Decentralized Switching
Each router processes packets locally, without depending on a central controller. It uses preloaded forwarding tables to quickly determine output interfaces for packets.
A router in an ISP backbone network does not wait for external instructions; instead, it consults its own forwarding table to forward packets.
What is Destination-Based Forwarding
Destination-Based Forwarding is when a router or switch sends packets based only on the destination address.
Forwarding decisions are made only based on the destination IP address. The router does not consider other fields like source address or protocol type.
A router receives a packet with destination IP 192.168.1.100 and checks its forwarding table to send it to the appropriate next-hop router.
What is Generalized Forwarding
Packets can be forwarded based on multiple header fields, not just the destination address. This allows for policy-based routing or quality of service (QoS) enforcement.
A firewall router forwards packets only if they match specific protocol types or port numbers (e.g., allowing only HTTP (port 80) traffic).
What is Switcing fabrics?
- The switching fabric moves packets from input ports to output ports inside a router. Different methods include memory-based, bus-based, or interconnection networks.
- A high-speed router uses an interconnection network to prevent congestion when handling multiple parallel data streams.
What is First Come First Serve (FCFS)
- Packets are transmitted in the order they arrive, without priority. It is also known as FIFO (First-In-First-Out) scheduling.
A router handling low-priority traffic (e.g., bulk data transfers) uses FCFS, ensuring fairness but not prioritization.
What is Priority Scheduling
- Packets with higher priority are sent before lower-priority packets. It is commonly used for latency-sensitive traffic.
A VoIP (voice-over-IP) packet is sent before an email download packet to maintain real-time voice quality.
What is Round Robin Scheduling
The router cycles through queues, sending one packet from each queue in turn.
A Wi-Fi router serving multiple devices ensures equal bandwidth allocation by sending one packet per device per cycle.
What is Internet Protocol (IP)
IP is a connectionless protocol that assigns unique addresses to devices and ensures packets are routed correctly.
A packet from 192.168.1.1 to 8.8.8.8 (Google DNS) is routed across multiple networks using IP
What is Weighted Fair Queueing (WFQ)
Packets are allocated bandwidth based on priority weights assigned to different traffic classes.
A video streaming packet gets more bandwidth than a regular web page request.
IPv4 Datagram Format
The IPv4 datagram contains:
- Source & Destination IP addresses
- TTL (Time-to-Live) to prevent infinite loops
- Checksum for error detection
An IPv4 packet has a 20-byte header followed by the payload (e.g., a TCP segment carrying a webpage request).
CIDR (Classless Inter-Domain Routing)
CIDR allows variable-length subnet masks instead of fixed classes (A, B, C), making IP address allocation more efficient.
A network with 192.168.1.0/24 can be divided into smaller subnets, such as 192.168.1.0/26 and 192.168.1.64/26.
IPv6
IPv6 uses 128-bit addresses, solving the address exhaustion problem of IPv4. It includes auto-configuration and better security.
A new IoT device automatically assigns itself an IPv6 address using stateless address autoconfiguration (SLAAC).
Tunneling
IPv6 packets can be encapsulated inside IPv4 packets to allow IPv6 traffic over IPv4-only
A 6to4 tunnel lets IPv6-enabled hosts communicate over an IPv4 backbone.
VPN (Virtual Private Network)
A VPN encrypts traffic between two endpoints over an untrusted network (e.g., the internet).
A remote employee connects to a corporate network securely using a VPN tunnel.
IPsec
IPsec provides encryption, authentication, and integrity for IP traffic.
An IPsec tunnel secures communication between two branch offices over the internet.