490 likes | 673 Views
NETW 707 Modeling and Simulation Amr El Mougy Maggie Mashaly. Lecture (6) Traffic Modeling and Simulation. Why is it Needed?. Router design relies heavily on traffic modeling Quality of service support can be significantly improved if the traffic can be predicted
E N D
NETW 707 Modeling and Simulation Amr El Mougy Maggie Mashaly
Lecture(6) Traffic Modeling and Simulation
Why is it Needed? • Router design relies heavily on traffic modeling • Quality of service support can be significantly improved if the traffic can be predicted • Congestion control can be optimized by learning about traffic • Realistic simulations need realistic traffic Traffic intensity La/R < 1
Traffic Modeling • Objective: to simulate network traffic • What is the purpose of the simulation? Which layer is of interest Application Transport Network Data Link PHY
Traffic at the PHY Layer 01000110101010101011000100111100101011 • Sequence of bits • The bits are either there or not (ON/OFF) • Simulations at the PHY layer are usually concerned with BER and channel quality • Often simulations at the PHY layer assume constant stream of bits
Traffic at the MAC Layer • Starting at the MAC layer, packets are seen as black boxes • If medium access is to be investigated, then interference may need to be modeled • What is the MAC protocol used (ACKs, NACKs, GoBackN, Selective Repeat, etc.) • Is random access employed (are collisions possible)
Traffic at the Network Layer • IP traffic can also be modeled as an ON/OFF process • What is the routing protocol used
initiate TCP connection RTT request file time to transmit file RTT file received time time Traffic at the Transport Layer • A packet is usually followed by an ACK in the other direction, typically after one half RTT
peer-peer client/server Traffic at the Application Layer • Application layer protocols have different characteristics • Client-server or peer-to-peer architectures
HTTP • Web browsing • Uses TCP • persistent or non-persistent connections request line (GET, POST, HEAD commands) status line (protocol, status code, status phrase) HTTP/1.1 200 OK Connection close Date: Thu, 06 Aug 1998 12:00:15 GMT Server: Apache/1.3.0 (Unix) Last-Modified: Mon, 22 Jun 1998 …... Content-Length: 6821 Content-Type: text/html data datadatadatadata ... GET /somedir/page.html HTTP/1.1 Host: www.someschool.edu User-agent: Mozilla/4.0 Connection: close Accept-language:fr (extra carriage return, line feed) header lines header lines Carriage return, line feed indicates end of message data, e.g., requested HTML file
SMTP • SMTP uses TCP connections S: 220 smtp.example.com C: HELO relay.example.org S: 250 Hello relay.example.org, I am glad to meet you C: MAIL FROM:<bob@example.org> S: 250 Ok C: RCPT TO:<alice@example.com> S: 250 Ok C: RCPT TO:<theboss@example.com> S: 250 Ok C: DATA S: 354 End data with <CR><LF>.<CR><LF> C: From: "Bob Example" bob@example.org C: To: "Alice Example" <alice@example.com> C: Cc: theboss@example.com C: Date: Tue, 15 January 2008 16:02:43 -0500 C: Subject: Test message C: C: Hello Alice. C: This is a test message with 5 header fields and 4 lines in the message body. C: Your friend, C: Bob C: . S: 250 Ok: queued as 12345 C: QUIT S: 221 Bye {The server closes the connection}
Other Applications YouTube • Uses HTTP for pages and RTMP for streaming videos • May use TCP or UDP • Can be an example of Constant Bit Rate (CBR) traffic • Skype • Uses TCP and UDP • Proprietary protocols • Can be an example of Variable Bit Rate (VBR) traffic
Parameters for Traffic Modeling • Two parameters are needed to model traffic of any type • Packet size • Inter-arrival times • Packet size is easy to model. May be subject to protocol restrictions • Inter-arrival times are more challenging
Classic Traffic Modeling: The Poisson Distribution • Used originally to model arrivals of calls in a telephone network • The distribution is memoryless. Assumes arrivals are independent • Very simple and easy to use • Can be seen as a counting process. Inter-arrival times follow an exponential distribution • Has a single parameter, λ • Mean and variance also equal to λ
Properties of the Poisson Distribution The superposition of independent Poisson processes results in a new Poisson process with a rate equal to the sum of the rates of the independent processes Aggregate Arrivals
Trouble with Poisson Does not show traffic burstiness (self-similarity) over extended time scales
Compound Poisson Traffic • The model is extended to deliverbatchesof traffic at once. • The inter-batch arrival times are exponentially distributed, while the batch sizes are geometric. • The model has two parameters: • The mean inter-batch arrival time 1/λ • The batch parameters ρ (between 0 and 1) • Thus, mean packet arrival over time period t is tλ/ρ • Disadvantages: • Back to back packet arrivals may not be realistic (although now it is more likely) • The model is still essentially Poisson, which is memoryless
ON/OFF and the Interrupted Poisson Process • Two-state systems used to model the channel • Packet arrivals occur during the ON state according to a Poisson distribution • The time the channel spends in each state is called the transition time
Markov Modulated Poisson Traffic Model • Motivated by the need to generate packet arrivals at different rates • A continuous-time Markov chain varies the arrival rate of a Poisson model • Each state in the Markov chain has an associated arrival rate • For example, a two state MC has four parameters (λ1, λ2, r1, r2). • To determine these parameters, real traffic traces must be used • The model is designed to fit the real trace based on metrics such as: mean packet arrival rate, variance-to-mean ratio of the number of arrivals over a short period, or long-term variance-to-mean ratio of the number of arrivals r1 λ1 λ2 1-r2 1-r1 r2
The Packet Train Model • Recognizes the fact that address locality applies to routing decisions, i.e. packets generated by the same source with small inter-arrival times are probably bound to the same destination and thus will probably follow the same route • Packet trains are characterized by tandem trailers: a group of packets going in one direction, followed by one or more packets in the other direction • Characterized by 4 parameters: inter-train arrival time, inter-car arrival time, mean train size, mean car size • Does not make any decisions about the protocols and their nature
Self-Similarity in Networks • With all Poisson-based models, traffic smoothens over large scales • With TCP, congestion control is deployed. Flows are no longer independent as they react to the same triggers • Conditions for the presence of self-similarity: • Large-scale aggregation of network traffic • Significant impact of long-range dependency. Poisson works fine for small scales • Self-similarity should be present at all scales despite any network controls
Self-similar Models: Chaotic Maps • TCP congestion control has severe impact on self-similarity, but only on a small scale (within a few RTTs) • Two chaotic maps are typically used: one for the window size of the TCP connection, and one for the ON/OFF sources • For the ON/OFF chaotic map, a trigger is defined that differentiates between the ON and OFF states • The model resembles continuous Markov chains • It generates traffic that highly resemble TCP
Self-similar Models: Pareto Distribution • The distribution is not self-similar but exhibits long-range dependency • α and β are called location parameters
Conclusions • Self-similarity exists on large scales in networks • Poisson models can be sufficient over small scales • Connection arrivals can sometimes be modeled using Poisson: • FTP and SMTP can be modeled using Poisson but only for 10 minute intervals • HTTP connections spawn other connections during a continuous browsing session. Thus, Poisson cannot be used • All data traffic cannot be modeled using Poisson due to burstiness
Lecture(7) Mobility Modeling
Mobility in Wireless Networks • In mobile networks, users are free to move around • Mobility models are used to describe these movement patterns • Movement patterns depend on the type of network • Trace-based mobility models are always an accurate way for producing movement patterns. However, they are not always available
Random Models • Nodes move freely • No restrictions in speed, direction, or destination. No correlation with other nodes • Models are simple but may not be realistic
Random Waypoint Model • Benchmark mobility model • Simple implementation: • Each node randomly selects a location in the field as its destination • The node travels to its destination at a speed chosen uniformly from 0, • Each node choses its velocity and direction independently of other nodes • Upon reaching the destination, each node pauses for a random pause time • The process is repeated • determine the dynamicity of the topology
Random Walk Model • Motivated by the observation that some nodes often move in an unexpected way • As with random waypoint, movement is totally random • The pause time is equal to zero, i.e. • Time intervals are defined, and nodes change their speed and direction at every interval • Every interval, nodes choose a new direction from (0, 2π] and a new speed from 0, • Uniform or Gaussian distributions are typically used • When nodes reach the border, they bounce back with the same or opposite angle • Changes in every time interval are memoryless
Random Direction Model • A problem with the random waypoint and random walk models is that they result in non-uniform node distribution • Nodes tend to converge towards the center, diverge away, then converge again, creating density fluctuations • Random direction chooses a direction so that the node will reach the boundary. Then another direction is chosen towards another boundary and the process is repeated • Less fluctuations in node density
Limitations of Random Models • Lack of temporal dependence of velocity: sudden stops or movements, increases in speed, are not captured • Lack of spatial dependence of velocity: nodes move independently of other nodes. Not true for example in battlefields • Lack of geographic restrictions on movement: obstacles, streets, freeways are not represented
Mobility Models with Temporal Dependency • In reality, mobility may be constrained by physical laws of acceleration, velocity, and rate of change in direction • Thus, current mobility patterns of a node may depend on past patterns • Random models are memoryless and cannot capture such dependency
Gauss-Markov Mobility Model • Mobility has a “memory” that is captured by a Gauss-Markov Process • Velocity is defined over the x and ydirections as: • Velocity at time t is given by , and at t-1 it is , • αis called the memory level, is the mean and is the variance • is a Gaussian process with mean 0 and variance
Gauss-Markov Mobility Model • When α= 0, the model reduces to random walk, i.e. no memory • When α= 1, the current velocity is the same as the previous one • When α is between 0 and 1, the current velocity partially depend on the previous velocity and partially on the random Gaussian value
Smooth Random Mobility • Suggests changing speed and direction incrementally and gradually • Nodes often move in preferred speeds rather than uniform distribution over • Speeds within the preferred set have high probability, while the rest are uniformly distributed • For example, for the preferred set
Smooth Random Mobility • Frequency of speed change follows a Poisson process • Upon a speed change event, a new speed is chosen according to the aforementioned probability distribution • The speed is changed to the new one smoothly using uniformly distributed variables from [0, amax], [amin,0] according to: • Thus, the new speed is calculated as
Smooth Random Mobility • If a(t) is small then change in speed is gradual and temporal correlation is strong • Change in direction is assumed to be uniform over [0, 2π] • The frequency of direction change follows an exponential distribution • The difference between the old direction and the new one is given by • If the change in direction is too large, it is divided into small slots
Mobility Models with Spatial Dependency • In certain situations, the velocities of nodes are correlated in space • Ex: speed of a vehicle is bounded by the vehicle ahead of it, Soldiers on a battlefield move in units • Random and temporal models do not capture this effect
Reference Point Group Mobility Model • Each group is composed of a leader and members. The mobility of the group is defined by its leader • The motion of the group leader, and thus the motion trend of the group is defined by the vector • The motion of each member deviates from by some degree • The final motion vector of member i is deviated from using • + • has length uniformly distributed in [0, and angle uniformly distributed in [0, 2π]
Pursue Mobility Model • Models situations where several nodes attempt to capture a single node • The target node (being pursued) moves using the random waypoint model • The remaining nodes move using • May be generated by the reference point group mobility model
Mobility Models with Geographical Restrictions • Mobility of nodes is bounded by the environment • Used to model movements along freeways, streets, around obstacles, etc. • Nodes move in pseudo-random or predefined pathways
Pathway Mobility Model • A predefined map is first created either randomly or based on a real city • The map is a graph where vertices represent buildings and edges represent streets between buildings • The movement of nodes resemble the random waypoint model, but bounded by the map • Nodes choose a destination, travel using a constant speed, pause for and repeat the process
Obstacle Mobility Model • Obstacles are modeled as rectangular objects randomly placed in a field • Nodes must change their trajectory upon reaching an obstacle • Wireless signals are assumed to be blocked by the obstacles • Could be used to model conferences, disaster relief or event coverage scenarios