Skip to content

Andrew-Bonner/Personal_VLAN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Personal Local Area Network

Overview

This project implements a personal local area network (LAN) entirely in Java by simulating real networking components and protocols. Virtual hosts, switches, and routers communicate across multiple machines to model how data moves through a real network from Layer 2 to Layer 3.

The system integrates multiple core networking algorithms, including the Ethernet Learning Switch algorithm, IP Forwarding, and Distance Vector routing using the Bellman-Ford equation, resulting in a fully functional, distributed virtual network.

For this project, a local area network was constructed by implementing virtual switches, hosts, and routers within Java on three different machines. It also implements several different algorithms (Ethernet Learning Switch algorithm, IP Forwarding algorithm, Bellman-Ford equation) along with distance vector routing.


Objectives

  • Simulate a real-world local area network in software
  • Implement core networking components across multiple machines
  • Demonstrate packet forwarding from Layer 2 through Layer 3
  • Implement distributed routing and route convergence
  • Understand how control-plane and data-plane logic interact

Network Functionality

The virtual network supports end-to-end message delivery across multiple subnets by combining:

  • Ethernet frame switching
  • IP packet forwarding
  • Dynamic route discovery and optimization

Each device communicates using UDP sockets while maintaining virtual MAC and IP addressing, closely modeling real network behavior.


Implemented Algorithms & Protocols

Ethernet Learning Switch Algorithm

  • Dynamically learns MAC address → port mappings
  • Forwards frames selectively when destinations are known
  • Floods frames when destinations are unknown
  • Operates at Layer 2 (Data Link Layer)

IP Forwarding Algorithm

  • Routers inspect destination virtual IP addresses
  • Routing tables determine the correct outgoing port or next hop
  • MAC addresses are rewritten at each hop
  • Enables inter-subnet communication
  • Operates at Layer 3 (Network Layer)

Distance Vector Routing (Bellman-Ford)

  • Routers exchange distance vectors with immediate neighbors
  • All links use a uniform cost of 1
  • Bellman-Ford equation computes shortest paths
  • Routing tables dynamically update and converge
  • Enables automatic route discovery without hardcoding paths

Network Architecture

  • Multiple hosts generate and receive user messages
  • Switches forward Ethernet frames using MAC learning
  • Routers forward IP packets and exchange routing updates
  • Each device runs as an independent Java process
  • Devices communicate across three different machines

Routers distinguish between:

  • User packets (data traffic)
  • Routing packets (distance vector updates)

How It Runs

  1. Each device (host, switch, router) is started as a separate Java process.
  2. Devices read a shared configuration file describing:
    • Physical addresses (IP + port)
    • Virtual MAC and IP addresses
    • Network topology
  3. Switches and routers initialize first.
  4. Hosts send messages using virtual IP addresses.
  5. Packets traverse the network using learned MAC tables and routing tables.
  6. Routers dynamically converge on optimal paths using distance vector routing.

Key Capabilities

  • Multi-hop packet forwarding
  • Dynamic routing convergence
  • MAC address learning and flooding
  • End-to-end message tracing
  • Realistic simulation of layered networking behavior

Technologies Used

  • Java
  • UDP Sockets
  • Ethernet Switching
  • IP Forwarding
  • Distance Vector Routing
  • Bellman-Ford Algorithm

Concepts Demonstrated

  • Layered network design (L2 & L3)
  • Distributed systems
  • Routing convergence
  • Control plane vs data plane logic
  • Protocol-based communication
  • Network simulation and debugging

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages