The Network Simulation project is a Java-based application designed to simulate the behavior of a network of stations sending packets to a server. The simulation models packet arrival, transmission, and delivery times, while also tracking key metrics such as packet loss, average delay, and network throughput.
- Packet Management: Creation and management of packets with attributes like arrival time, transmission time, and delivery time.
- Station Behavior: Simulate station operations including packet queueing, transmission attempts, and handling of buffer overflow.
- Network Metrics: Calculate and display overall average delay, network throughput, and packet loss rate.
-
Attributes:
name: Name of the packetid: Unique identifierarrivalTime: Time slot when the packet arrived at the stationtransmissionTime: Time slot when the packet started transmittingdeliveryTime: Time slot when the packet was delivered to the destinationsourceStation: Source station of the packetdestination: Destination of the packet
-
Methods:
- Getters and setters for each attribute
-
Attributes:
name: Name of the stationid: Unique identifierbuffer: Queue to hold packetswavelength: Wavelength used by the stationtotalDelay: Total delay of all transmitted packetspacketsSent: Total number of successfully sent packetspacketsLost: Total number of lost packets due to buffer overflow
-
Methods:
transmitPackets(int currentTimeSlot): Simulates packet transmission with a 50% success probabilityaddPacket(Packet packet, int arrivalTime): Adds a packet to the buffer if there is space, otherwise increments packet loss counter- Getters and setters for relevant attributes
- Methods:
main(String[] args): Initializes stations, simulates packet arrival and transmission over a specified number of time slots, and calculates network metrics
- Compile the Java files:
javac NetworkSimulation.java Packet.java Station.java