80 likes | 216 Views
ECE 358: Computer Networks Project #1. Project #1: The context. 4. :. 3. 1. 2. Packet Forwarding module. Network Layer. Packets forwarded. Input q ueue. Output q ueue. Link Layer. Link Layer. Link Layer. Link Layer. Packet Server. PHY 1. PHY 4. PHY 3. PHY 2. Packets
E N D
ECE 358: Computer Networks Project #1
Project #1: The context 4 : 3 1 2 Packet Forwarding module Network Layer Packets forwarded Input queue Output queue Link Layer Link Layer Link Layer Link Layer Packet Server PHY 1 PHY 4 PHY 3 PHY 2 Packets arrive Packets leave the system IP packets
One Queue Arrival rate (packets/sec) Service time: How long does it take to service one data packet? Queue Packet Generator Packet Server Passive entity (Linked List: add, delete, queue_size, …) Active, independent entity Active, independent entity
How to time everything… Use the concept of tick ….. 1 tick is 1 time unit….. 1 ns, 100 ns, 1 ms, ….. You give it a meaning…. Tick is system independent ….. independent of what else is executing. You generate events (packets) based on ticks …… Ticks do NOT occur in real-time … You service packets based on ticks …. Time passes in terms of ticks ……. You measure delay in terms of ticks…..
How to implement ticks? Packet Generation Generate a packet (GP) Calculate Next Packet Generation Time (NPGT) Generate a packet (GP) Calculate Next Packet Generation Time (NPGT) ……….. How to calculate the value of TICKS? : for( i = 0; i < TICKS; i++) { } Assume that you want to simulate the network behavior for 20 minutes. Call packet_generator(...) Assume that 1 tick = 1 ms TICKS = 20 mins./1 ms = 20 x 103ms/1ms = 2 x 104
Packet Servicing Assume constant service time Generate a packet (GP) Calculate Next Packet Generation Time (NPGT) Generate a packet (GP) Calculate Next Packet Generation Time (NPGT) ……….. : for( i = 0; i < TICKS; i++) { } Call packet_generator(...) Server is busy Call server( …)
Performance Evaluation During simulation, record the events and states of the system ….. in terms of their tick numbers … When simulation ends, compute performance ….. Packet delay …… server busy time…. server idle time, …