ECM1413 - Computers and the Internet - Internet Layer (TCP/IP Internet Layer) IPv4

Flow Control in TCP Data Transfer

  • Flow control in TCP data transfer is used to prevent the receiver from being overwhelmed by incoming data.

TCP Operation

  • In the context of a TCP session, line 1 likely indicates session establishment.

TCP Session Establishment

  • When Host1 initiates a TCP session with Host2 by sending a SYN message, Host2 responds by sending a segment with the ACK flag = 1 and SYN flag = 1 to Host1.

Socket Pair

  • If a host with IP address 10.1.1.10 requests web services from a server at 10.1.1.254, the correct socket pair would be:
    • 10.1.1.10:1099, 10.1.1.254:80

Internet Layer Objectives

  • The objectives of the Internet Layer include:
    • IPv4
    • IPv4 classful and classless addressing
    • Private and Public IPv4 addresses
    • ICMP (Internet Control Message Protocol)

Internet Layer - OSI L3

  • The Internet Layer corresponds to OSI Layer 3.
  • Functions:
    • Routed (IP)
    • Routing (RIP, OSPF)
    • Supporting (ICMP)

Internet Layer - Key Tasks

  • Key tasks of the Internet Layer include:
    • Encapsulation
    • Addressing
    • Routing
    • Decapsulation

IPv4 Packet Header

  • The IPv4 packet header contains the following information:
    • IP version
    • Size of packet header
    • Packet size: header + data
    • Priority (Quality of Service, or QoS)
    • Remaining "life" of the packet (Time To Live, or TTL)
    • Type of data payload the packet is carrying (e.g., 01 for ICMP, 06 for TCP, 17 for UDP)
    • Source and destination IPs

IPv4 Address

  • An IPv4 address is a 32-bit address that uniquely identifies a device on an IP network.
  • It is represented in dotted decimal notation, with four octets separated by periods.
  • Each octet represents 8 bits of the address.
  • The value of each octet ranges from 0 to 255.
  • Example: 192.168.19.31 can be broken down as:
    • 11000000.10101000.00010011.00011111
    • Octet 1: 128 + 64 = 192
    • Octet 2: 128 + 32 + 8 = 168
    • Octet 3: 16 + 2 + 1 = 19
    • Octet 4: 16 + 8 + 4 + 2 + 1 = 31

Invalid IPv4 Addresses

  • Examples of invalid IPv4 addresses:
    • 234.0.367.1 (octet value exceeds 255)
    • 192.168.30.12.1 (too many octets)

IPv4 Hierarchical Structure

  • An IPv4 address has a hierarchical structure, consisting of a network portion and a host portion.
  • Example: 192.168.1.1
    • Network Portion (24 bits): 192.168.1
    • Host Portion (8 bits): 1
  • Prefix Length: The number of bits representing the network portion, e.g., 192.168.1.1/24.
  • Subnet Mask: 1s represent the network portion, and 0s represent the host portion, e.g., 255.255.255.0.
  • Binary representation of the subnet mask: 11111111.11111111.11111111.00000000

Addresses in an IPv4 Network Range

  • Network Address: All host portion bits are 0s.
    • Example: 192.168.19.0
  • Broadcast Address: All host portion bits are 1s.
    • Example: 192.168.19.255
  • Host Address: Any address between the network and broadcast addresses.
    • Example: 192.168.19.1 to 192.168.19.254

IPv4 Address Example

  • Given the IP address 200.100.50.31/24, determine:
    • Network address
    • Broadcast address
    • Range of valid host addresses

Legacy Classful Addressing

  • Legacy classful addressing divides IPv4 addresses into classes based on the first octet.
  • Class A:
    • Network(N) and Host(H) structure: N.H.H.H
    • Mask/Prefix length: 255.0.0.0 /8
    • First octet range: 1-127 (0 and 127 are reserved)
    • Number of hosts: 2^{24} - 2 = 16,777,214
  • Class B:
    • Network(N) and Host(H) structure: N.N.H.H
    • Mask/Prefix length: 255.255.0.0 /16
    • First octet range: 128-191
    • Number of hosts: 2^{16} - 2 = 65,534
  • Class C:
    • Network(N) and Host(H) structure: N.N.N.H
    • Mask/Prefix length: 255.255.255.0 /24
    • First octet range: 192-223
    • Number of hosts: 2^8 - 2 = 254
  • Class D (multicast) and E (experimental) are also defined.
  • Classful addressing limitations:
    • Waste of address space
    • Security, management, and performance issues
  • Classless Inter-Domain Routing (CIDR) overcomes classful addressing limitations.

Subnetting

  • Subnetting: Dividing a single address block into multiple logical networks.
  • Example: 192.168.1.0/24
    • Host (8 bits), Network (24 bits)
  • Borrowing 1 bit (21 = 2 Subnets):
    • Network 27-2 = 126 hosts/subnet
    • 192.168.1.0/25
    • 192.168.1.128/25
  • Subnet Mask: What is the subnet mask?

Subnetting - Borrowing 2 Bits

  • Borrowing 2 bits => 2^2 = 4 Subnets
  • 26-2 = 62 hosts/subnet
    • 192.168.1.0 /26
    • 192.168.1.64 /26
    • 192.168.1.128 /26
    • 192.168.1.192 /26

Subnetting - Borrowing 3 Bits

  • Number of Subnets [2^b] - borrowing 3 bits => 2^3 = 8 Subnets
  • Host portion bits (h): (32-27) = 5
  • Add 2^h (e.g. 2^5 = 32) to find the network ID of the following subnet
  • 192.168.1.0 /27
  • 192.168.1.32 /27
  • 192.168.1.64 /27
  • 192.168.1.96 /27
  • 192.168.1.128/27
  • 192.168.1.160/27
  • 192.168.1.192/27
  • 192.168.1.224/27

VLSM

  • Variable Length Subnet Masking.
  • Allows for more efficient use of IP addresses by varying the subnet mask for different subnets.
  • 1st Subnet: 192.168.1.128/29
  • 2nd Subnet: 192.168.1.136/29
  • 3rd Subnet: 192.168.1.144/29
  • 4th Subnet: 192.168.1.152/29

Public and Private Addresses

  • Public addresses are used in networks accessible on the Internet.
  • Private addresses are used in internal networks and are not routable on the Internet.
  • Private Address Space:
    • 10.0.0.0 /8 -- 10.0.0.0 to 10.255.255.255
    • 172.16.0.0 /12 -- 172.16.0.0 to 172.31.255.255
    • 192.168.0.0 /16 -- 192.168.0.0 to 192.168.255.255
  • RFC 1918: https://datatracker.ietf.org/doc/html/rfc1918

NAT on the Perimeter Device

  • NAT (Network Address Translation) translates a private IPv4 address to a public address.
  • Resources:
    • https://www.whatismyip.com/
    • https://whatismyipaddress.com/

ICMP

  • ICMP (Internet Control Message Protocol) is a L3 supporting protocol.
  • Messaging protocol used for sending messages and operational information.
  • Used for error reporting and diagnosing network issues.
  • Common uses:
    • Testing connectivity (ping)
    • Observing the path (tracert)
  • Loopback: 127.0.0.0 /8. Hosts use loopback to direct traffic to themselves.
  • Example: tracert google.com

Device Configurations

  • Gateways enable communications between networks.
  • IP address: 192.168.2.30
  • Subnet mask: 255.255.255.0
  • Default gateway: 192.168.2.1
  • Preferred DNS server:
  • Alternative DNS server: