CS331 / Slide Breakdowns
Upgraded Study Guide

Network Layer: Data Transfer

A deeper guide to IP packet delivery: packetizing, packet switching, IPv4 addressing, classful/classless ideas, subnetting, DHCP, ARP, fragmentation, and NAT.

Source focusNetwork Layer Part 1
Exam skillFind network/subnet addresses
Memory hookRoute, forward, address, translate
Best useUse for IPv4 calculations
Duties

Packetizing, Routing, And Forwarding

The network layer is responsible for moving packets across interconnected networks from source host to destination host.

Packetizing

Wrap the payload

The source network layer encapsulates the payload inside an IP packet. The destination network layer decapsulates it. The network layer carries the payload without changing or using its contents.

Routing

Plan the path

Routing finds the best path by running routing protocols and filling a routing table.

Forwarding

Move this packet

Forwarding is the router action performed when a packet arrives. The router checks its table and decides which outgoing interface to use.

Mini summary
  • Packetizing creates IP packets.
  • Routing builds paths.
  • Forwarding sends individual packets.
Switching

Virtual-Circuit And Datagram Packet Switching

Packet switching can be connection-oriented or connectionless. The Internet network layer uses the datagram approach.

Virtual circuit

Connection-oriented packet switching

Packets are related to a virtual connection. Resources such as buffers, lines, and switches are still shared, which is why it is virtual rather than a dedicated physical circuit.

Datagram

Connectionless Internet model

No network-layer handshaking is required. Each packet is sent independently and can take a different path to the destination.

Delay

What affects delivery

Packet networks can experience processing, queuing, transmission, and propagation delays. Datagram networks may deliver packets out of order because paths can differ.

Mini summary
  • Virtual circuits relate packets.
  • Datagrams are independent.
  • The Internet network layer is connectionless.
IPv4

IPv4 Addressing And Classes

IPv4 addresses are 32-bit Internet addresses. The course still uses classful addressing for masks and subnetting examples even though classless addressing is used today.

Address size

32 bits and dotted decimal

IPv4 has 2^32 possible addresses. Dotted decimal writes four 8-bit octets as decimal numbers, such as 192.168.1.10.

Class A/B/C

Default masks

Class A uses default /8, Class B uses /16, and Class C uses /24. The first bits or first decimal octet identify the old class.

Special addresses

Network, host, broadcast

The network address has host bits set to 0. Host addresses identify devices. Broadcast addresses target all nodes in a network. Limited broadcast stays local; directed broadcast targets a specific network.

Concept Meaning Exam clue
Class A 0-127, default /8 Large networks
Class B 128-191, default /16 Medium networks
Class C 192-223, default /24 Small networks
Slash notation /n means n network prefix bits Example: /27
Mini summary
  • IPv4 is 32 bits.
  • Dotted decimal has four octets.
  • Default class masks support exam subnetting problems.
Subnetting

Masks, AND, And Subnet Design

Subnetting divides a network into smaller subnetworks. The mask tells which bits belong to network/subnet and which bits remain for hosts.

Logical AND

How to find subnet address

Write the IP address and mask in binary, then apply AND. A 1 in the mask keeps the address bit. A 0 in the mask turns the result bit into 0.

Counting

Subnets and hosts

Given original classful mask and subnet mask, number of subnets is 2^(subnet mask length - classful mask length). Host count depends on remaining host bits.

Reasons

Why subnet

Subnetting improves organization, security, and routing inside a site while the outside Internet can still see the organization as one larger network.

Mini summary
  • Subnet address = IP AND mask.
  • Borrowed bits create subnets.
  • Remaining bits create host addresses.
Support

DHCP, ARP, Datagram Fields, Fragmentation, NAT

These mechanisms support practical IPv4 delivery: automatic configuration, local address resolution, packet formatting, MTU handling, and address translation.

DHCP

Automatic configuration

DHCP provides host settings: IP address, subnet mask, default gateway/router, and DNS server.

ARP

IP to MAC on a link

ARP translates an IP address to a MAC address for local link delivery. ARP request is broadcast; ARP reply is unicast.

IPv4 datagram

Important fields

Minimum IPv4 header length is 20 bytes without options. Total length includes header and data. Protocol field tells which upper-layer protocol should receive the payload.

Fragmentation

MTU limits

Each link-layer protocol has an MTU. If a datagram is too large, it may be fragmented. Identification, flags, and offset support reassembly.

NAT

Address translation

NAT maps private local addresses to public global addresses so many internal devices can share one public IP address.

Mini summary
  • DHCP configures hosts.
  • ARP finds local MAC addresses.
  • Fragmentation handles MTU.
  • NAT saves IPv4 addresses.
Revise

Final Cheat Sheet

Use this as the last-pass memory page before a quiz or exam.

  • Packetizing Network layer wraps payload in IP packet.
  • Routing Finds best path and fills table.
  • Forwarding Sends a packet out an interface.
  • Datagram Connectionless independent packet.
  • IPv4 32-bit address.
  • Subnet IP AND mask.
  • DHCP IP, mask, gateway, DNS.
  • ARP request Broadcast.
  • ARP reply Unicast.
  • MTU Maximum transfer unit.
  • NAT Private-to-public mapping.
Practice

Practice Questions With Answers

These questions target the facts, comparisons, and calculations that are easiest to test.

What network-layer service does the Internet use?

Answer: Connectionless datagram service.

Explanation: There is no network-layer handshaking and packets are independent.

How do you find a subnet address?

Answer: AND the IP address with the subnet mask.

Explanation: Mask 1 bits keep address bits; mask 0 bits clear them.

What does DHCP provide?

Answer: IP address, subnet mask, gateway router, and DNS server.

Explanation: These are the main host configuration values listed in the slides.

Is an ARP reply broadcast?

Answer: No, it is unicast.

Explanation: The requester is known after the ARP request.

What does NAT save?

Answer: Public IPv4 addresses.

Explanation: Many private hosts can share fewer public addresses.