Download presentation
Presentation is loading. Please wait.
Published byRichard Lambert Modified over 8 years ago
1
Ch 1: Simulation of Computer Networks
2
1.1 Computer Networks and the Layering Concept 1.1.1 Layering Concept Service Interface Protocol
3
1.1.2 OSI and TCP/IP Reference Models OSI (Open Systems Interconnection) by ISO (International Standards Organization) The TCP (Transmission Control Protocol)/IP (Internet Protocol) ARPANET five layers physical, data link, network, transport, and application application layer can be considered as the combination of session, presentation, and application layers of the OSI model.
4
Application Layer supports several higher-level protocols HTTP (Hypertext Transfer Protocol) for WWW SMTP (Simple Mail Transfer Protocol) for electronic mail, TELNET for remote virtual terminal, DNS (Domain Name Service) FTP (File Transfer Protocol) for file transfer.
5
Transport Layer to transport the messages from the application layer of the source host to that of the destination host. fragmentation is usually performed to break a long message into segments. two well-known protocols, TCP a reliable and connection-oriented communication flow control and error control UDP (User Datagram Protocol) unreliable connectionless transport.
6
Network Layer provides routing services to the transport layer. deliver the data units, usually called packets Link Layer Node to node delivery across each of the communication links. three main responsibilities. flow control Error control flow multiplexing/demultiplexing Ethernet, Point-to-Point Protocol (PPP), IEEE 802.11 (i.e., WiFi), and Asynchronous Transfer Mode (ATM).
7
Physical Layer transmission of data bits across a communication link. transmission parameters (e.g., transmission power, modulation scheme) are set appropriately to achieve the required transmission performance (e.g., to achieve the target bit error rate performance).
8
1.2 System Modeling System modeling : important in system design and development two modeling approaches: Analytical Approach describe a system mathematically queuing and probability theories, cost-effective if system is simple and relatively small Not accurate if too many assumption Simulation Approach fewer simplifying assumptions Suitable for large and complex systems
9
1.3 Basics of Computer Network Simulation Simulation: The Formal Definition the process of designing a model of a real system and conducting experiments with this model Purpose understanding the behavior of the system and/ evaluating various strategies for the operation of the system.” For computer networks: a dynamic model of a real dynamic system.
10
1.3.2 Elements of Simulation Entities are objects which interact with one another For a computer network: computer nodes, packets, flows of packets, or non-physical objects such as simulation clocks. To distinguish the different entities unique attributes are assigned to each of them. Ex: a packet packet length, sequence number, priority, header.
11
1.3.2 Elements of Simulation Resources (limited) network resources shared among the network entities. Ex: bandwidth, air time, the number of servers, Activities and Events entities engage in some activities. Creates events / triggers stage change Ex: delay and queuing. send a packet but the medium is busy wait the packet is said to be engaged in a waiting activity.
12
1.3.2 Elements of Simulation Scheduler A scheduler maintains the list of events and their execution time. Global Variables Ex: the length of the packet queue in a single-server network, the total busy air time of the wireless network, or the total number of packets transmitted.
13
1.3.2 Elements of Simulation Random Number Generator (RNG) to introduce randomness in a simulation model. Pick up values from a deterministic sequence of psudo- random number In practice, an RNG needs to start picking numbers from different location (i.e., seed) Ex: a packet arrival process, waiting process, and service process Basic uniform distribution exponential, Gaussian, Poisson, Binomial distribution functions
14
1.3.2 Elements of Simulation Statistics Gatherer to collect data generated by the simulation so that meaningful inferences can be drawn from such data
15
1.4 Time-Dependent Simulation Two types time-driven induces and executes events for every fixed time interval. event-driven induces events at arbitrary time
16
1.4.1 Time-Driven Simulation the simulation clock is advanced exactly by a fixed interval of Δ time units. looks for events that may have occurred during this fixed interval. If so, such events are treated as if they occurred at the end of this interval a,b,c are events.
17
1.4.1 Time-Driven Simulation disadvantage events b and c are considered to occur exactly at the end of the interval not real Possible solution narrow down a simulation time interval Not recommended for the case where events occurs at random time.
18
Example 1.1. Program 1.1 Skeleton of the event-processing loop in a time-driven simulation. 1 initialize {system states} 2 SimClock := startTime; 3 while {SimClock < stopTime} 4 collect statistics from current state; 5 execute all events that occurred during 6 [SimClock, SimClock + step]; 7 SimClock := SimClock + step; 8 end while
19
1.4.2 Event-Driven Simulation is initiated and run by a set of events (schedule list). The time gap between two events is not fixed The simulation advance from one event to another Event may induce one or more events new event is usually inserted into the chain (i.e., list) gathering information right after every event execution.
20
Example 1.2. Program 1.2 Skeleton of the event-processing loop in an event-driven simulation. 1 initialize {system states} 2 initialize {list of events} 3 while {state != finalState} % or while {this.event != Null} 4 expunge the previous event from list of events; 5 set SimClock := time of current event; 6 execute this.event 7 end while
21
1.5 A Simulation Example: A Single- Channel Queuing System point-to-point wired communication link only a one-way communication from node A to node B Inter-arrival time: random Packet length: random Service time also random
22
22 Traffic arrival We can model traffic arrival pattern for an application as I is const and L is a random variable L is const and I is a random variable L and I are two random variables time L I
23
Single queue system: FIFO C in out C: outgoing link speed For wireless network, C is not a const To Node B time Node A Node B channel Service time
24
Entities Server (medium availability) with idle and busy attributes, Packets with arrival time and service time attributes, Queue with empty and non-empty attributes. Resource the only resource in this example is the transmission time in the channel.
25
System State Variables and Events Two system state variables: num_system : the number of packets in the system channel_free : the status of the channel (server) which is either idle or busy. Two events: pkt_arrival: a packet arrival event. pkt_complete: a successful packet transmission event.
26
Two other important elements simulation clock An event list: packet arrival and successful packet transmission the simulation executes an event after another down the event list, and updates the simulation clock based on the time specified in the executed event.
27
Simulation Performance Measures Mean waiting time the average time that a packet spends in the queue. a global variable for total waiting time At the end of the simulation, we divide this value by the total number of packets Mean packet transmission latency average time that a packet spends in the system. Mean server utilization percentage time where the server is busy we measure the time where the server is busy. At the end of the simulation, we divide this busy time by the total simulation time
28
Program 1.3 Simulation skeleton of a single-channel queuing system. 1 % Initialize system states 2 channel_free = true; %Channel is idle 3 num_queue = 0; %Number of packets in queue 4 num_system = 0; %Number of packets in system 5 SimClock = 0; %Current time of simulation 6 %Generate packets and schedule their arrivals 7 event_list = create_list(); 8 % Main loop 9 while {event_list != empty} & {SimClock < stopTime} 10 expunge the previous event from event list; 11 set SimClock := time of current event; 12 call current event; 13 end while 14 %Define events 15 pkt_arrival(){ 16 if(channel_free) 17 channel_free = false; 18 num_system = num_system + 1; 19 % Update "event_list": Put "successful packet tx event" 20 % into "event_list," T is random service time. 21 schedule event "pkt_complete" at SimClock + T; 22 else 23 num_queue = num_queue + 1; %Place packet in queue 24 num_system = num_queue + 1; 25 } 26 pkt_complete(){ 27 num_system = num_system - 1; 28 num_queue = num_queue - 1; 29 if(num_queue > 0) 30 schedule event "pkt_complete" at SimClock + T; 31 else 32 channel_free = true; 33 num_system = 0; 34 num_queue = 0; 35 }
29
create_list() automatically generates packets and associates each packet with the random inter-arrival and service times. event_list data structure event type (arrival or completion) associated timestamp (inter-arrival time or service time). Initially, only the arrival events are put into the event_list. Arrival event call pkt_arrival() Completion event call pkt_complete()
31
1.0
32
the mean server utilization = the ratio of the time where the server is in use and the simulation time, which is 14/16 = 0.875 in this case.
33
Remark It is important to note that all the above measures are the average values taken over time, implying that the longer the simulation, the more accurate the statistics.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.