ID
5
Chapter 4: Network Layer (Control Plane)
๐น 1. Network Layer Overview: Core Ideas
โ What is the Network Layer (Data Plane)?
- Responsible for routing packets from source to destination
- Encapsulates transport-layer (e.g., TCP/UDP) segments to form datagrams
- Includes:
- Forwarding: Process of receiving packet and sending it to the right output link
- Routing: Process of determining the path from source to destination
- Addressing: Assigning IP addresses to hosts and routers
- Packet Schedule Data Plane: Buffering, scheduling, queueing
โ ๏ธ No reliability, flow, or congestion control โ functions are primarily at transport layer
๐น 2. Router Architecture / Data Plane Components
โ Key Parts of a Router
Function | Description |
Input Ports | Handle arrival of datagrams from physical link, perform demultiplexing, lookup, queueing |
Switch Fabric | Rapid transfer of packets from input port to output port, networking layer |
Output Ports | Sends datagrams to physical link, performs multiplexing |
Forwarding Table | Router uses this to determine which output link a packet should go to |
Buffer Management | handles queueing, may cause delay or packet loss |
Scheduling | decide which packet to send when โ options: FCFS, Priority, Round Robin, Weighted Fair |
๐ก Data Plane: Execution, Forwarding, Queuing, Scheduling โ Network Layer Logic ๐ก Control Plane: Design โ Routing Algorithms, Forwarding Table, NAT/SDN Implications
๐น 3. Network Layer Protocols & Addressing
โ IP: Internet Protocol
- most important network layer protocol
- Each IP datagram has:
- source IP address
- destination IP address
- header fields (e.g., fragment, TTL, checksum, options)
โ IP is connectionless and stateless โ best-effort, no guarantees
โ Subnetting & CIDR
- CIDR (Classless Inter-Domain Routing): Allow routing by network prefixes
- Subnets:
- Subnet is group of IP addresses
- Same high-order bits (prefix) โ common network portion
- Example:
- IP address
223.1.1.1/24โ subnet223.1.1.0/24
๐ก ่ต prefix determines common routing; host part determines specific destinations
๐น 4. TCP/IP: A Working Example
- Transport (TCP / UDP) โ Network (IP) โ Link (Ethernet/WiFi) โ Physical (copper/radio)
- Internet = layered system of packets + addressing
โ This is the architecture of the Internet: flexible, scalable, layered protocol stacks
๐น 5. Subnets, Addressing, CIDR
โ Subnet Example (10.0.0.0/24)
- Network portion: 10.0.0.0
- Host portion: 0.0.0.0 โ 0.0.0.255
- You can have up to 254 IP addresses in this subnet
โ CIDR: Classless
- CIDR notation: a.b.c.d/x, where x is prefix length
- Example:
200.23.16.0/20 - network portion = 20-bit
- host portion = 12 bits
- max 4096 IPs in this network
๐ More specific route (more details) = more precise, better delegation
๐น 6. NAT: Network Address Translation
โ NAT Overview
- NAT enables all devices in a local network to share a single public IPv4 address
- Uses a NAT table to map:
- LAN IP, port โ WAN IP, port
- Often embedded in router, helps reduce address exhaustion
โ NAT Translation Example
Before NAT | After NAT |
Host A: 10.0.0.1:3345 โ server: 128.119.40.186:80 | NAT: 138.76.29.7:5001 โ server:128.119.40.186:80 |
Router C: 138.76.29.7:5001 (WAN IP) | Nat table: (10.0.0.1:3345 โ 138.76.29.7:5001) |
Server E: 128.119.40.186:80 (WAN IP) | Router C sends to Server E using NAT IP |
Host A: 10.0.0.1 โ via deal with NAT | Host A receives response from Server E using NAT IP |
โ Why NAT? โ IPv4 Address exhaustion (only 4.3 billion address space)
๐น 7. IPv6: The Next Addressing Format
โ Why IPv6?
- 128-bit address space โ 3.4ร10ยณโธ IPs
- Simplified header (40 bytes) vs IPv4 (20+ bytes) โ faster processing
- No checksum โ sends to router
- No fragmentation โ favors optimized routing at network layer
- Enables scalable routing, programmable flow control (e.g., P4, SDN)
โ Address Format in IPv6
- Human-readable format:
aaaa:b000:0000:0000:0000:0000:0000:0001
- Compression:
aaaa::1(leading, trailing zeros can be removed)
โ ๏ธ IPv6 not yet fully adopted โ but it's coming
โ Why is IPv6 being used?
- Long time to deploy โ 25 years!
- IPv4 running out โ NAT ends up being the only solution
- Optimized packets: 40 bytes โ Fast routing, less overhead
๐น 8. Packet Scheduling: Key Concepts
Scheduling | Type | Description |
FCFS | First Come, First Served | Packets send in order of arrival |
Priority | High โ Low | Data is send to highest priority first |
Round Robin | Cyclic | Each class sends one packet per cycle |
Weighted Fair | Modify โ Eq. | Class with higher weight gets more |
Drop Policy | Identifies which datagram to drop when links are full. | ใ
ค |
ECN (Explicit Congestion Notification) | Marks packet โ sender can adjust sending rate. Part of IPv4 and IPv6 | ใ
ค |
๐ง Key Insight: Scheduling and buffering determine network performance.
๐น 9. Congestion, Packet Loss, and Pack Buffering
โ Understanding the "packet loss" problem
- Buffer overflow at router links โ packets are dropped
- Multihop steps:
- Input queueing at one router
- Output queueing at next hop
- Both types can increase delay and cause loss
โ Buffer Size Rule of Thumb
- Use RTT ร link capacity (e.g., if R = 10 Gbps (10 billion bits/sec), RTT = 0.25 sec) โ buffer โ 2.5 Gbit
๐น 10. Buffer Management: Real Life Implications
Buffering at Router | Impact on Network |
Too small โ delay, loss | Too large โ higher delay |
Must be ยซjust fullยป but no fuller | Helps TCP congestion control to work properly |
๐ก Fixed QoS vs Dynamic BufferingSlot Allocation helps Slow, fast, or apply adaptive buffer sizes
๐น 11. Routing & Forwarding Fundamentals
โ The 2 Key Processes
Process | Function | Example |
Forwarding | Move packet from input port to output port (one router) | Can be done by hardware (e.g., switch) |
Routing | Determine path from source to destination (via network) | Done by router control-plane (e.g., OSPF, BGP, SDN controller) |
โ Forwarding โ Routing โ Forwarding is local, routing is global
๐น 12. Generalized Forwarding: Match + Action
โ Core Idea
- Use header fields to match incoming packet โ then act
- Can be done at any layer (Link, Network, Transport)
Match | Action |
MAC Address | Forward, drop, or flood |
IP Address | Forward or drop |
Port | Forward, block, or change |
Link Layer (e.g., Ethernet type) | Forward or drop based on protocol |
Controller | Match+action โ send to central control plane |
๐ง Match + Action allows programmable network infrastructure โ centralization + flexibility!
๐น 13. SDN: Software-Defined Networking
โ What is SDN?
- Centralized control plane
- Row-based routing, flow-based forwarding
- Flow tables in switches โ SDN controller manages them remotely
โ SDN Advantages
- Easier control โ policy across network easily enacted
- Modern flexibility โ programmable network
- Future-oriented โ matching OpenFlow, new P4, GFLOW tech
๐ก SDN is the future โ network programmability at scale
๐น 14. Routing Protocols: BGP, OSPF
โ Need to know:
- BGP (Border Gateway Protocol) โ inter-AS (networks of different ISP)
- OSPF (Open Shortest Path First) โ intra-AS, uses link-state โ Dijkstra
- RIP (Routing Information Protocol) โ distance vector, not covered
๐ BGP: coordination between ISPs, IXPs ๐ OSPF: internal medium/high-speed routing amid many devices
๐น 15. NAT: Network Address Translation (cont'd)
โ NAT simplifies addressing
- List of IP addr. inside your home โ only one public address to the Internet
- Example: Home has 10 devices โ 1 public IP
- NLRA (Network Layer Routing Architecture) is not affected by NAT
โ NAT Issues
- End-to-End Principle: NAT violates this
- Contributes to network complexity
- Traversability: Hard for some Internet apps (e.g., WebRTC, VoIP)
- Status: Still widely used, particularly in home / ISP / mobile networks
๐น 16. Flow Tables: Match + Action Extensibility
โ Fields in Flow Table
Match | Action |
MAC, IP, TCP/UDP port | Drop, forward, change, or mark |
Link-layer info (e.g., Ethernet, WiFi type) | Forward or drop |
IP headers (e.g., ToS, Fragments, Flow Label) | Separate packets, send to controller |
Priority | High, Medium, or Low |
โ Flow table = router logic = monetary traffic handling at scale!
๐น 17. Middleboxes and OpenFlow
โ Middleboxes vs Routers
Feature | Router | Middlebox |
Function | Forwarding only | Handles more features |
Access | Always available | Runs software only |
Operations | IP, routing | May include: |
- NAT
- Firewall
- Cache
- Load Balancer
โ OpenFlow for Middleboxes
Match | Action |
MAC, IP, TCP port | Forward, drop |
Link-layer datagram type | Forward, drop |
Caching | Encapsulate, forward |
Firewall | Drop, forward, modify |
Load Balancer | Forward to different servers |
โ OpenFlow is NAT, Firewall, Cache, Load Balancer in one!
๐น 18. Buffering & Large Packets: Considerations
โ Why Fragment?
- Mainly due to MTU (Maximum Transfer Unit) of the network interface
- If IP datagram exceeds MTU, it is fragmented into smaller datagrams
- Only reassembled at the destination โ no intermediate reassembly
โ Fragments: Identification
Header Field | Purpose |
ID | Identifies fragments of the same datagram |
Offset | Gives fragment offset in bytes |
Flags | Indicate if fragment can be last or more fragments exist |
โ ๏ธ Fragments are expensive โ reassembly inefficient
๐น 19. OpenFlow and P4: Enabling Programmable Networks
โ OpenFlow:
- Packet match โ controller notification
- Can forward, drop, modify, or send to controller
- Integrated with SDN, Middleboxes, Firewalls, Caches
- Flow table allows:
- Per-packet decisions
- Rate shaping for traffic
- Direct link to central controller
โ P4 (Programming Protocol-independent Data Plane)
- P4 is a language for programmable networking
- Allows you to program what actions the router takes
- Flow tables from OpenFlow can use P4 for instance-level control
โ Why both? Let the hardware know network rules via P4 code โ OpenFlow reapplies
๐น 20. Mid-Box: A Practical Overview
Category | Example | Key Function |
Firewall | IP, port filtering | Secures network from external attacks |
Cache | CDN, edge server | Reduces load on origin server |
Load Balancer | configures to route packets to appropriate server | ใ
ค |
NAT | home, cell, institutional | Replaces IP address with shared one |
Content-bit filter | Video streaming | Decodes measured traffic, disposes of bad debris |
Simple Trace | sleep, ping, ping6, iperf, ping | ใ
ค |
๐ก Install iPerf + Wireshark โ measure network bandwidth, simulate congestion
๐น 21. Addressing & Routing in Real Networks (Summary)
โ Addressing & Routing Assembly
Description | Assignment |
Obtain IP address via DHCP | Random/assigned |
Centralized control plane in SDN | ๆฏๅฆ๏ผMicrosoft Azure, Cisco gear, Segment Routing |
use CIDR to handle subnet route delegation | Not IP only, but network layer, firewall, etc talk to controller |
Track number of routes in your router | Bob expects to see 2โ4 entries, e.g.,: 223.1.1.0/24 accepted, 223.1.1.1 allowed, 223.1.1.2 dropped |
โ Mandatory: Address manufacturing !
๐น 22. TCP/IP Protocol Suite: Architecture & Layering
- IP is the core of the network
- No guarantee for delivery, timing, or ordering
- Transport layer (TCP, UDP) manages reliability, flow, ordering
- Network layer deals with route selection, fragmentation, packet routing
- Link layer (Ethernet, WiFi, etc.) sends bit stream over physical connections
- Application layer (HTTP, SMTP, DNS) uses network layer (IP) to send packets to others
๐ง IP = network layer โ data plane core of Internet
๐น 23. MAC vs IP: Routing Context
Overview:
- MAC address is 128-bit, used for link layer (e.g., Ethernet, WiFi)
- IP address is 32-bit (for IPv4), 128-bit (for IPv6) โ used for network layer
- MAC addresses are used internally, while IP addresses are used externally
๐น Key Transitions
โข Link layer (MAC) โ Network layer (IP) โข Network layer (IP) โ Transport (TCP / UDP) โข Transport โ Application (DNS, HTTP)
โ Network layer can store packet in buffer, queue, schedule or drop
๐น 24. Exam Checklist (Chapter 4)
Topic | Must Know? |
IP address, subnetting, CIDR | โ๏ธโ๏ธโ๏ธ |
DHCP: request, offer, ack, and their timing | โ๏ธ |
NAT: translation, table, public IP vs private IP | โ๏ธ |
IPv6: address format, advantages, buffer size | โ๏ธ |
Generalized forwarding: match + action | โ๏ธ |
OpenFlow: match fields, action, flow tables | โ๏ธ |
SDN: centralized control plane, flow tables | โ๏ธ |
IP fragmentation: ID, offset, flags | โ๏ธ |
Scheduling: FCFS, priority, RR, WFQ | โ๏ธ |
Buffer management: practical implications | โ๏ธ |
Control vs. data plane | โ๏ธ |
SCS: Source Routing, Quality of Service | โ๏ธ |
๐น 25. Introduction to P4 (Software-Defined Networks)
โ Key Idea: P4 = Language for the network
- Complements OpenFlow โ code the flow table
- P4 is language for the hardware โ controller manages code
- Programmable datagram processing at network interface level โ controls forwarding and queueing
โ P4 is the main programming tool for SDN networks.
๐น 26. Final Notes on Chapter 4
๐ง This is the core of the network layer โ buffering, addressing, routing, fragments, and flow control
๐ก Key differentiator of the Internet: simple, consistent data-plane ๐ก TCP uses TCP ACKs and duration-based timeouts for delivery ๐ก IP handles Flow (responsible for packet management)
๐งฉ Move up to Chapter 5: Running Networked Applications ๐ Build understanding of routing protocols with BGP, OSPF ๐ Explore Internet layer with IP, NAT, IPv6 ๐งญ Traffic Engineering = Type of routing algorithm to maximize network efficiency
๐ Practice Tools for Chapter 4
- Wireshark: Capture TCP/IP packets, analyze header fields
- ipconfig, ifconfig: check current IP address, subnet, DHCP status
- traceroute, tracert: see network path, witness subnets and router transitions
- iperf: measure network bandwidth, simulate congestion
๐งโ๐คโโ๏ธ Pro Tip for Exams
Describe the network layer as:
- Abstraction between transport & link
- Focus on packets, not messages
- Many packet fields, some buffers, some queues, some scheduling
- Movement from input interface to output interface based on forwarding table
- IP is 32-bit, no guarantee, newer versions are 128-bit
Suggestะฐั: Given these questions, craft your answer around packet flows, NAT, CIDR, and IPv6, and tools like Wireshark to validate!
โ Summary Table โ Network Layer Overview
Layer | Function | Protocol |
Network Layer (Data Plane) | Forwarding, Routing, Addressing | IP, OpenFlow, P4, SDN |
Transport | Reliable, ordered, flow-controlled | TCP, UDP |
Application | Networks apps (HTTP, SMTP) | HTTP, SMTP, DNS, etc. |
Link Layer | Data frame forwarding | Ethernet, WiFi (802.11) |
Physical Layer | Wire carrying bits | Copper, Fiber, Radio |
โ Exam Must-Know Checklist (Chapter 4)
Theme | Must Know? |
Buffering & Latency | โ๏ธ |
NAT: Private vs Public IP | โ๏ธ |
Fragmentation & Reassembly | โ๏ธ |
Routers & Link-Layer Handling | โ๏ธ |
SDN Implemented via OpenFlow / P4 | โ๏ธ |
Match + Action | โ๏ธ |
CIDR & Subnetting | โ๏ธ |
๐ Where to Go Next?
- Chapter 5: Running Networked Applications, Go-Back-N, TCP Flow & Congestion Control
- Chapter 6: Link-Layer, Ethernet, WiFi
- Chapter 7: Routing Protocols (BGP, OSPF), Flows, and IP address allocation by ISP
๐ง Your understanding of the data-plane is now solid Prepare for Extended Assignments that build on real-world packet processing!
Good luck on your exams! ๐ฅ
This chapter 4 summary covers all the key factors, design assumptions, and core concepts you need to perform well on your Networks and Security course.






