主要内容

Mobility Models in Wireless Network Simulations

In wireless network simulations, mobility models define how nodes, such as mobile devices or vehicles, move over time. Accurate mobility modeling is essential for evaluating network performance in a wide range of wireless systems, including wireless local area network (WLAN), 5G, Bluetooth, mobile ad hoc networks (MANETs), and vehicular networks. Among the various mobility models, three of most frequently used are random walk, random waypoint, and constant velocity.

  • Random walk — Simulates highly unpredictable, memoryless movement.

  • Random waypoint — Represents the destination-oriented movement with optional pauses typical of human behavior.

  • Constant velocity — Captures steady motion, such as that of vehicles traveling on a highway.

With Wireless Network Toolbox™, you can implement these mobility models using the nodeMobilityRandomWalk, nodeMobilityRandomWaypoint, and nodeMobilityConstantVelocity objects, respectively. The toolbox also supports custom mobility models through the wnet.Mobility base class for advanced or scenario-specific behaviors. This topic explains the concepts underlying these mobility model objects.

Random Walk Mobility Model

Imagine a mobile node beginning its journey at a starting point. It picks a random direction and speed, then moves forward for a fixed distance or a certain period of time. Upon reaching that distance or time, the node instantly picks another random direction and speed, continuing its motion without interruption. In the random walk mobility model, the node keeps moving, constantly changing its direction and speed at each step. Its path features abrupt turns and unpredictable shifts, making it hard to anticipate where the node might go next. This figure shows an example of how a 5G user equipment node travels according to the random walk model.

A mobile node travels according to the random walk model.

Mathematical Representation of Random Walk Mobility Model

Let the position of the node at time t be (x(t),y(t)). If the node moves with speed v in direction θ for a time interval Δt, its position coordinates after that interval are (x(t+Δt),y(t+Δt)), where:

x(t+Δt)x(t)+(v×Δt×cos(θ))

and

y(t+Δt)y(t)+(v×Δt×sin(θ))

Here:

  • v follows a uniform distribution: vU(vmin, vmax).

  • θ follows a uniform distribution: θU(0,2π)

Bounding Mobility Region

In real-world scenarios, nodes typically remain within a bounded area, such as a room, building, or geographic region. To reflect this, simulations often implement the random walk mobility model within a rectangular or circular region. This ensures that node movement remains realistic and constrained, which is important for accurate simulation and analysis.

Bounding Mobility Within Rectangle.  Consider a node moving inside a rectangular region defined by xminxxmax​, yminyymax, as shown in this diagram​.

If the straight-line motion from (x(t),y(t)) to the expected new position goes outside this rectangle, the node must bounce off the boundary. To find where this happens, compute the time at which the line of the moving node intersects each of the sides of the rectangle. The equations for position during the motion step are:

x(t+t)=x(t)+vxt.

y(t+t)y(t)+vyt,

where vxv×cos(θ), vyv×sin(θ), and t′ varies from 0 to Δt.

You can then use these equations to calculate the time at which the node reaches each side of the rectangle.

  • To calculate when the node reaches the right side (x=xmax​) of the rectangle:

    tright(xmaxx(t))vx.

    The corresponding y-coordinate is yrighty(t)+vytright.​

    This intersection is valid if yminyrightymax.​

  • To calculate when the node reaches the left side (y=ymax​) of the rectangle:

    tleft(xminx(t))vx.

    The corresponding y-coordinate is ylefty(t)+vytleft.​

    This intersection is valid if yminyleftymax.

  • To calculate when the node reaches the top side (y=ymax​) of the rectangle:

    ttop(ymaxy(t))vy.

    The corresponding x-coordinate is xtopx(t)+vxttop.

    This intersection is valid if xminxtopxmax.

  • To calculate when the node reaches the bottom side (y=ymin​) of the rectangle:

    tbottom(yminy(t))vy.

    The corresponding x-coordinate is xbottomx(t)+vxtbottom.​

    This intersection is valid if xminxbottomxmax.

If several intersections are valid, the node reaches the one that occurs first in time. Let thit ​ be the smallest positive time among the valid ones. The exact intersection point is then: (xhit,yhit)=(x(t)+vxthit, y(t)+vythit) . If thit <Δt, the node reaches the boundary within the step. The remaining time after the node intersects the boundary is ΔtremΔtthit. The node continues moving inside the rectangle in the reflected direction for the remaining time.

If the node hits a vertical boundary (the left or right side of the rectangle), its horizontal motion reverses: vx′​ = −vx​ and vy′​ = vy.​ If the node hits a horizontal boundary (the top or bottom of the rectangle), its vertical motion reverses: vx′​ = vx​, and vy′​ = −vy.

After reflection, the node moves inside the rectangle again during the remaining time Δtrem.

Bounding Mobility Within Circle.  Consider a wireless node traveling in a 2-D region defined by a circle, as shown in this figure.

Let the circle have a center C=(cx, cy) and a radius R. When the point moves, it might reach or go beyond the circular boundary.

Given the position p of the node, let the next position of the node be pnext and the velocity before reflection v be (vx, vy). The intended next position without considering the boundary is:

pnext=p+vΔt.

The distance from the next point to the center is d=pnextC. If dR, the point is still inside the circle. If d>R, the point has crossed the boundary.

To place the point exactly on the circular boundary, project it radially inward:

pprojC+R(pnextC)pnextC.

For a circle, the normal vector always points radially outward. At the boundary point pproj, the outward unit normal is

n=(pnextC)pnextC=(1R)(pnextC).

You can then compute the reflected velocity as:

v=v2(vn)n

In this equation, (vn) extracts the normal component of the velocity.

Random Waypoint Mobility Model

In the random waypoint model, mobile nodes simulate movement by alternating between travel and pause periods. A node begins by remaining stationary for a brief duration, known as the pause time. After the pause, the node randomly selects a new destination and moves toward it at a randomly chosen speed, which lies between a predefined minimum and maximum. Once it reaches the destination, the node pauses again before repeating the process, selecting a new target location and speed and continuing its journey. This cycle continues throughout the simulation. This figure shows an example of how a 5G user equipment node moves according to the random waypoint model.

Random waypoint

Mathematical Representation of Random Waypoint Mobility Model

Consider at any simulation time t, the position of the node is p(t)=[x(t),y(t),z(t)] and its velocity is vector v(t)=[vx(t),vy(t),vz(t)]. Consider motion that is only in the horizontal plane. The vertical coordinate z remains constant throughout the simulation. The node also has a current waypoint, pwp, which defines the destination for the ongoing movement phase.

The simulation region can be rectangular or circular. For a rectangular region defined by a center (xc,yc), width W, and height H, the lower-left lies at

(xcW2,ycW2).

The simulation selects a waypoint uniformly within this region by generating two independent random variables U1 and U2 , each uniformly distributed over [ 0, 1] and computing

x=xcW2+WU1, y=ycH2+HU2.

For a circular region defined by the center (xc,yc) and radius R, the simulation selects the waypoint using polar coordinates. It generates two independent uniform random variables U1 ​ and U2 and computes

r=RU1, θ=2πU2,

which yield the waypoint coordinates

x=xc+rcos(θ), y=yc+rsin(θ).

After selecting a waypoint, the simulation computes the straight-line distance between the current position p0 and the waypoint pwp using the Euclidean norm,

D=pwpp0.

This distance determines both the direction of motion and the time required to reach the waypoint.

The simulation selects the node speed from a predefined range, [vmin,vmax]. When the limits differ, it draws the speed uniformly from this interval according to

v=vmin+(vmaxvmin)U,

where the random variable U is uniformly distributed over [0, 1]. When the limits are equal, the node moves at a constant speed equal to that value. The simulation then computes the velocity vector to align with the direction toward the waypoint,

v=vD(pwpp0),

ensuring straight-line motion at constant speed.

The time required to reach the waypoint is

Treach=Dv.

During the movement phase, the node follows uniform linear motion. For any time increment Δt, the node updates its position as

p(t+Δt)=p(t)+vΔt,

and accumulates the traveled distance as

d(t+Δt)=d(t)+vΔt.

The node does not accelerate. The velocity remains constant during movement.

Upon reaching the waypoint, the node enters a pause phase of fixed duration. During this interval, the node remains at the waypoint,

p(t)=pwp,​

and its velocity becomes zero,

v(t)=0.

After the pause ends, the simulation selects a new waypoint and the node resumes movement.

Constant Velocity Mobility Model

The constant velocity mobility model describes a scenario where mobile nodes move continuously in a fixed direction at a constant speed. Once a node begins moving, it maintains its velocity, both speed and direction, without pausing or changing direction, as shown in this figure.

Constant Velocity Mobility Model

Custom Mobility Model

A custom mobility model is a user-defined way to simulate the movement of wireless nodes, such as vehicles or mobile devices. For instance, if you want to study how vehicular mobility impacts the performance of vehicle-to-vehicle (V2V) communication, you can develop a tailored vehicular mobility model. You can use the wnet.Mobility base class from Wireless Network Toolbox to define your custom mobility model. For more information about how to create a custom mobility model and add it to a wireless node, see Create and Add Custom Mobility Model to Wireless Nodes.

See Also

Objects

Classes