CIS 527



Lab 3 - Network Layer

Network Layer

  • Transmit Packets Between Connected Networks
  • Typically uses the Internet Protocol (IP) for Addressing
  • Most Routers Operate at this Layer

IPv4 Packet Structure

Version InfoLength
Packet IDFlags & Offset
Protocol & TTLChecksum
Source IP Address
Destination IP Address
Data...

IPv4 Addresses

  • 32-bit Binary Numbers
  • Unique Identifier on Network
  • Usually Represented in Dot-Decimal Notation

Image Source: Wikipedia

Old - Classful Networks

  • Network Determined by First 4 Bits
    • Class A - 128 Networks, 16m Addresses Each
    • Class B - 16k Networks, 1m Addresses Each
    • Class C - 2m Networks, 256 Addresses Each
    • Class D - Multicast

Image Source: TCP/IP Guide

Image Source: XKCD

New - Classless Inter-Domain Routing (CIDR)

  • Introduces Subnet Masking
  • Subnet Mask Defines Network & Host Portion of Address
  • Much More Flexible & Scalable

Subnet Mask Example


IP:   192.168.  2.130 11000000.00000000.00000010.10000010
Mask: 255.255.255.  0 11111111.11111111.11111111.00000000
Net:  192.168.  2.  0 11000000.00000000.00000010.--------
Host:   0.  0.  0.130 --------.--------.--------.10000010


IP:   192.168.  2.130 11000000.00000000.00000010.10000010
Mask: 255.255.255.192 11111111.11111111.11111111.11000000
Net:  192.168.  2.128 11000000.00000000.00000010.10------
Host:   0.  0.  0.  2 --------.--------.--------.--000010

CIDR Notation

  • IP Followed by Number of Leading 1s in Subnet Mask
  • Example: 192.168.2.0/24
    • Network: 192.168.2.0
    • Subnet Mask: 255.255.255.0

CIDR Routing

Image Source: Wikipedia

Reserved Spaces

  • 10.0.0.0/8 - Class A
  • 172.16.0.0/12 - 16 × Class B
  • 192.168.0.0/16 - 256 × Class C
  • 127.0.0.0/8 - Loopback
  • 169.254.0.0/16 - Link-Local
  • 100.64.0.0/10 - Carrier-Grade NAT

Network Address Translation (NAT)

Image Source: TCP/IP Guide

IPv4 vs. IPv6

IPv4: 32-bit Addresses
232 = 4,294,967,296


IPv6: 128-bit Addresses
2128 = 340,282,366,920,938,463,463,
374,607,431,768,211,456
or 340 Undecillion addresses

IPv6 Packet Structure

Image Source: Wikipedia

IPv6 Addresses

  • 128-bit Binary Numbers
  • 8 Groups of 4 Hexadecimal Digits, Separated By Colons
  • Representation May Be Simplified

IPv6 Address Reduction

  • Omit Leading 0s
  • Combine Consecutive Empty Groups With :: Once Per Address

2001:0db8:85a3:0000:0000:8a2e:0370:7334
2001: db8:85a3:   0:   0:8a2e: 370:7334
2001: db8:85a3    ::     8a2e: 370:7334
2001:db8:85a3::8a2e:370:7334

IPv6 Addressing

  • Method Indicated by Prefix
  • Each Method Uses a Different Format
  • 001 - Global Unicast
  • FE80 - Link-Local
  • FC & FD - Unique-Local
  • Many Reserved Ranges