Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Scheduling & Data Communication and Networking.: Platform Technologies

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 28

SCHEDULING & DATA COMMUNICATION

and NETWORKING.
Platform Technologies

1|Page
Who gets the CPU?

Process Behaviour

a) CPU-bound processes spend most of their time computing


b) I/O bound processes spend most of their time waiting for I/O

MULTIPROGRAMMING
• Overlapping I/O and CPU activities
To increase CPU utilization and job throughput
• Previously covered the mechanisms of
Context switching
Process queues and process states
• But…
• Which process (thread) to run, for how long, etc. – scheduling?

2|Page
SCHEDULING

 Choosing which process to run next, when two or more of them are simultaneously in the ready state
• Deciding which process should occupy the resource (CPU, disk, etc.)
• Done by scheduler using the scheduling algorithm
• Many of the same issues that apply to process scheduling also apply to thread scheduling, although
some are different.
• Jobs - schedulable entities (processes, threads)

When to schedule?

 when a job exits


 when a job blocks on I/O
 when time slice expired
o a hardware clock provides periodic
interrupts
 when a new job is created
o whether to run the parent or the
child
 when an I/O interrupt occurs
o from an I/O device that has now
completed its work for a waiting job

Performance Criteria
• Throughput
• number of jobs completed in unit time
• Turnaround time (elapse time)
• Amount of time to execute a particular process from the time it entered
• Waiting time
• Amount of time process has been waiting in ready queue
• Meeting deadlines
• Avoid bad consequences

Scheduling Objectives

Fair
 Everyone is happy
Priority
 Some are more important
Efficiency
 Make best use of equipment

3|Page
Support heavy load
 Degrade gracefully
Adapt to different environment
 Interactive, real-time, multi-media

CATEGORIES OF SCHEDULING ALGORITHMS

1. BATCH

 Periodic tasks – payroll, bills, interest calculation (at banks)


 No users impatiently waiting
 Possible to run for long time periods for each process without switching

2. INTERACTIVE

 For environments with interactive users – personal computing, servers


 One process cannot be hogging the CPU and denying service to the others

3. REAL-TIME

 Only programs that are intended to further the application at hand


 Processes may not run for long and usually do their work and block quickly
 So, it’s okay to let them finish

PREEMPTIVE VS. NON-PREEMPTIVE

NON-PREEMPTIVE SCHEDULING

 The running process keeps the CPU until it voluntarily gives up the CPU

PREEMPTIVE SCHEDULING

 The running process can be interrupted and must release the CPU

SCHEDULING ALGORITHM GOALS

 ALL SYSTEMS
o Fairness – giving each process a fair share of the CPU
o Policy enforcement – seeing that stated policy is carried out.
o Balance – keeping all parts of the system busy.
 BATCH SYSTEMS
o Throughput – maximize jobs per hour
o Turnaround Time – Minimize time between submission and termination.
o CPU utilization – Keep the CPU busy all the time.

4|Page
 INTERACTIVE SYSTEMS
o Response time – respond to request quickly.
o Proportionality – meets users’ expectation.
 REAL – TIME SYSTEMS
o Meeting Deadlines – avoid losing data.
o Predictability – avoid quality degradation in multimedia systems.

SCHEDULING ALGORITHMS

BATCH SYSTEMS
• First-Come, First-Served (FCFS)
 “Real-world” scheduling of people in lines (e.g., supermarket)
 A single queue of ready jobs
 Jobs are scheduled in order of arrival to ready queue
 Typically non-pre-emptive (no context switching at market)
 Jobs treated equally, no starvation.
 When the running process blocks, the first process on the queue is
run next.
 • When a blocked process becomes ready, like a newly arrived job, it is
put on the end of the queue, behind all waiting processes.

First-Come, First-Served – Example

First-Come, First-Served – Problems

Average waiting time can be large

5|Page
• If small jobs wait behind long ones (high turnaround time)
• Non-preemptive
• You’re stuck behind someone with a cart, when you only have two items
• Solution?
• Express lane (10 items or less)

SHORT JOB FIRST (SJF)

• Choose the job with the smallest expected duration first


 Person with smallest number of items to buy
• Requirement
 the job duration needs to be known in advance
• Used in Batch Systems
• Optimal for Average Waiting Time if all jobs are available simultaneously

SHORTEST JOB FIRST - EXAMPLE

FCFS VS. SJF

6|Page
Shortest Job First – Problems

• Starvation
 a job is waiting forever
• All jobs must be available at start
 Suited for batch systems

SCHEDULING ALGORITHMS

Interactive Systems
 Round-Robin Scheduling
 Priority Scheduling
 Multi-Queue & Multi-Level Feedback

ROUND-ROBIN SCHEDULING

 One of the oldest, simplest,

most commonly used scheduling

algorithm.

 Select process/thread from

ready queue in a round-robin

fashion (take turns)

7|Page
ROUND – ROBIN SCHEDULING - EXAMPLE

ROUND-ROBIN SCHEDULING – PROBLEMS

 Time slice too large


 FIFO behaviour
 Poor response to short interactive requests
 Time slice too small
o Too many context switches (overheads)
o Inefficient CPU utilization
 A quantum around 20–50 msec is often a reasonable compromise.

NOTE: Millisecond can be slow to process if quantum are set to be higher.

PRIORITY SCHEDULING

 Not all processes are equally important


 Need to consider external factors
 Email checking less priority than displaying video

8|Page
MULTIPLE-LEVEL FEEDBACK QUEUES (MLFQ)

Scheduling algorithms can be combined

• Have multiple queues


• Use a different algorithm among queues
• Move processes among queues

Multiple queues representing different job types

 Interactive, CPU-bound, batch, etc.


 Queues have priorities
 Jobs can move among queues based upon execution history

REAL-TIME SYSTEMS

 Earliest Deadline First


Scheduling

Earliest Deadline First (EDF)


o Each job has an arrival
time and a deadline to
finish
 Assignments, exams*
o Always pick the
job with the earliest

9|Page
deadline to run

THREAD SCHEDULING

 Two levels of threads


• User-level threads
• Kernel-level threads
 User-level threads
• Kernel picks the process
• Scheduler inside process picks thread
 Kernel-level threads
• Kernel picks a particular thread to run
• Requires a full context switch

THREAD SCHEDULING

Scheduling Summary

o Scheduler is the module that gets invoked when a context switch needs to happen
o Scheduling algorithm determines which process runs and where processes are placed on
queues

10 | P a g e
o Scheduling algorithms have many goals
 Utilization, throughput, wait time, response time, etc.
o Various algorithms to meet these goals
 FCFS/FIFO, SJF, RR, Priority
o Can combine algorithms
 Multiple-level feedback queues

Data Communication & Networking


Data Communication

 The term telecommunication means communication at a distance.


 The word data refers to information presented in whatever form is agreed upon by the parties
creating and using the data.
 Data communications are the exchange of data between two devices via some form of
transmission medium such as a wire cable.

Data Communication Basics

 It is essential to understand some of the basic communication methods that can be used to
interconnect systems
 Characteristics of communication methods:
• Data Flow - Simplex, Duplex & Semi Duplex
• Data Transfer - Serial vs. Parallel
• Synchronous vs. Asynchronous
• Data Throughput

Data Flow

11 | P a g e
TYPES OF DATA TRANSFER

PARALLEL COMMUNICATION

 Parallel interfaces transfer multiple bits at the same time.


 They usually require buses of data – transmitting across eight, sixteen, or more wires.
 It’s fast, straightforward, and relatively easy to implement.
 But requires many more input/output (I/O) lines.

12 | P a g e
PARALLEL COMMUNICATION

 One-bit data per wire


 Multiple data, control, and possibly power wires
 High data throughput with short distances
 Typically used when connecting devices on same IC or same circuit board
o Bus must be kept short, because long parallel wires result in high capacitance values which
requires more time to charge/discharge, and data misalignment between wires increases as length
increases.
 Higher cost, bulky

SERIAL COMMUNICATION

 Serial communication is the process of sending/receiving data in one bit at a time.


 Serial interfaces stream their data, one single bit at a time.
 These interfaces can operate on as little as one wire, usually never more than four.

SERIAL COMMUNICATION

13 | P a g e
 Words transmitted one bit at a time
 Single data wire, possibly also control and power wires
 Higher data throughput with long distances
o Less average capacitance, so more bits per unit of time
 Cheaper, less bulky
 More complex interfacing logic and communication protocol
o Sender needs to decompose word into bits
o Receiver needs to recompose bits into word
o Control signals often sent on same wire as data increasing protocol complexity

Synchronous vs. Asynchronous Serial Transfer

Advantages of Serial over Parallel

A serial connection requires fewer interconnecting cables and hence occupies less space.

 The extra space allows for better isolation of the channel from its surroundings.
 Crosstalk is not a much significant issue, because there are fewer conductors in proximity

In many cases, serial is a better option because it is cheaper to implement.

 Many devices and sensors relevant to control systems have serial interfaces, as opposed to
parallel ones, so that they have fewer pins and are therefore less expensive.

Serial Communication Protocols

 There are various protocols that can be used with digital control systems for serial communication.

o USB (Universal Serial Bus)


o UART (Universal Asynchronous Receiver/Transmitter)

14 | P a g e
o SPI (Serial Peripheral Interface)
o I2C (Inter-Integrated Circuits)
o CAN (Controller Area Network)
o 1-wire

ADVANCED COMMUNICATION PRINCIPLES


• Layering
 Break complexity of communication protocol into pieces easier to design and understand
• Lower levels provide services to higher level
 Lower level might work with bits while higher level might work with packets of data
• Physical layer
 Lowest level in hierarchy
 Medium to carry data from one actor (device or node) to another

Wireless communication
No physical connection needed for transport at physical layer

NETWORKING

 A network is a set of devices (often referred to as nodes) connected


by communication links.
 A node can be a computer or any other device capable of sending and/or receiving data generated
by other nodes on the network.
 A link can be a cable, air, optical fiber, or any medium which can transport a signal carrying
information.
 Networks are relied on for web applications, IP telephony, video conferencing, interactive gaming,
e-commerce, and much more.

CONNECT TO A NETWORK
Home office devices might connect as follows:

 Laptops and tablets connect wirelessly to a home router.


 A network printer connects using an Ethernet cable to the switch port on the home router
 The home router connects to the Internet service provider cable modem using an
Ethernet cable.
 The cable modem connects to the ISP network.

15 | P a g e
CONNECT TO A NETWORK

Branch site devices might connect as follows:

 Desktop PCs, VoIP phones, and corporate resources such as file servers and printers connect to
Layer 2 switches using Ethernet cables.
 Laptops and smartphones connect wirelessly to wireless access points (WAPs).
 The WAPs connect to switches using Ethernet cables.
 Layer 2 switches connect to an Ethernet interface on the edge router using Ethernet cables.
 The edge router connects to a WAN service provider.

CONNECT TO A NETWORK

• Central site devices might connect as follows:


 Desktop PCs and VoIP phones connect to Layer 2 switches using Ethernet cables.
 Layer 2 switches connect redundantly to multilayer Layer 3 switches using Ethernet fiber -optic
cables.

16 | P a g e
 Layer 3 multilayer switches connect to an Ethernet interface on the edge router using Ethernet
cables.
 The corporate website server connects to the edge router interface.
 The edge router connects to a WAN SP and also to an ISP for backup purposes.

CHARACTERISTICS OF A NETWORK

Characteristics referred to when discussing networks:


 Topology
o Physical topology – arrangement of the cables, network devices, and end systems
o Logical topology –how the network devices appear
connected to network users
 Speed
o measure of the data rate in bits per second (b/s) of a given link
 Cost
o general expense for purchasing of network components as well as installation and maintenance
of the network

 Security
indicates how protected the network is, including the
information that is transmitted over the network

 Availability
refers to the likelihood that the network is available
for use when it is required

 Scalability

17 | P a g e
indicates how easily the network can accommodate
more users and data transmission requirements as
they increase

 Reliability
indicates the dependability of the components that
make up the network including the routers, switches,
PCs, and servers; often measured as MTBF (mean
time between failures)

PHYSICAL STRUCTURES OF NETWORKS

Type of Connection

 Point to Point - single transmitter and receiver


 Multipoint - multiple recipients of single transmission

Physical Topology
 Connection of devices
 Type of transmission - unicast, multicast, broadcast

TYPE OF CONNECTION

Point-to-point networks
 Each node connected to every node
 Simple and reliable
 Costly due to many wires required
Multipoint networks
 Nodes are connected via bus or other topologies
 Less wiring and hence cheaper
 Easily extendable by adding new nodes to network
 Complex network protocol

 NETWORK TOPOLOGY is the description of the arrangement of nodes (e.g. networking switches
and routers) and connections in a network, often represented as a graph.

18 | P a g e
 No matter how identical two organizations are, no two networks are exactly alike. However, many
organizations are relying on well-established network topology models. Network topologies outline
how devices are connected together and how data is transmitted from one node to another.

 A logical network topology is a conceptual representation of how devices operate at particular


layers of abstraction. A physical topology details how devices are physically connected. Logical
and physical topologies can both be represented as visual diagrams.

 A network topology map is a map that allows an administrator to see the physical network layout of
connected devices. Having the map of a network’s topology on hand is very useful for
understanding how devices connect to each other and the best techniques for troubleshooting.

 There are many different types of topologies that enterprise networks have built on today and in the
past. Some of the network topologies we’re going to look at include bus topology, ring topology,
star topology, mesh topology, and hybrid topology.

Physical Topology

Physical Topology

A Star Topology is a topology where every node in the network is connected to one central switch. Every
device in the network is directly connected to the switch and indirectly connected to every other node. The
relationship between these elements is that the central network hub is a server and other devices are
treated as clients. The central node has the responsibility of managing data transmissions across the whole
network and acts as a repeater. With star topologies, computers are connected with a coaxial cable, twisted
pair, or optical fiber cable.

Advantages

19 | P a g e
 Star topologies are most commonly-used because you can manage the entire network from one
location: the central switch. As a consequence, if a node that isn’t the central node goes down then
the network will remain up. This gives star topologies a layer of protection against failures that
aren’t always present with other topology setups. Likewise, you can add new computers without
having to take the network offline like you would have to do with a ring topology.

 In terms of physical network structure, star topologies require fewer cables than other topology
types. This makes them simple to set up and manage over the long-term. The simplicity of the
overall network design makes it much easier for administrators to run troubleshooting when dealing
with network performance faults.

Disadvantages

 Though star topologies may be relatively safe from failure, if the central switch goes down then the
entire network will go down. As such, the administrator needs to manage the health of the central
node closely to make sure that it doesn’t go down. The performance of the network is also tied to
the central node’s configurations and performance. Star topologies are easy to manage in most
ways but they are far from cheap to set up and use.

A fully connected MESH TOPOLOGY A STAR TOPOLOGY connecting four stations


connecting five stations

MESH TOPOLOGY

 A mesh topology is a point-to-point connection where nodes are interconnected. In this form of topology,
data is transmitted via two methods: routing and flooding. Routing is where nodes use routing logic to work
out the shortest distance to the packet’s destination. In contrast, flooding is where data is sent to all nodes
within the network. Flooding doesn’t require any form of routing logic to work.

20 | P a g e
 There are two forms of mesh topology: partial mesh topology and full mesh topology. With partial mesh
topology, most nodes are interconnected but there are a few which are only connected to two or three other
nodes. A full mesh topology is where every node is interconnected.

Advantages

 Mesh topologies are used first and foremost because they are reliable. The interconnectivity of nodes
makes them extremely resistant to failures. There is no single machine failure that could bring down the
entire network. The absence of a single point of failure is one of the reasons why this is a popular topology
choice. This setup is also secure from being compromised.

Disadvantages

 However, mesh topologies are far from perfect. They require an immense amount of configuration once they
are deployed. The topological layout is more complex than many other topologies and this is reflected by
how long it takes to set up. You’ll need to accommodate a whole host of new wiring which can add up to be
quite expensive.

BUS TOPOLOGY

 Bus topology is a network type where every device is connected to a single cable that runs from one end of
the network to the other. This type of network topology is often referred to as line topology. In a bus
topology, data is transmitted in one direction only. If the bus topology has two endpoints then it is referred to
as a linear bus topology.
 Smaller networks with this type of topology use a coaxial or RJ45 cable to link devices together. However,
the bus topology layout is outdated and you’re unlikely to encounter a company using a bus topology today.

Advantages

 Bus topologies were often used in smaller networks. One of the main reasons is that they keep the layout
simple. All devices are connected to a single cable so you don’t need to manage a complex topological
setup.
 The layout also helped make bus topologies cost-effective because they can be run with a single cable. In
the event that more devices need to be added then you could simply join your cable to another cable.

Disadvantages

 However, relying on one cable does mean that bus topologies have a single point of failure. If the cable fails
then the entire network will go down. A cable failure would cost organizations a lot of time while they attempt
to resume service. Further to this, high network traffic would decrease network performance because all the
data travels through one cable.

This limitation makes bus topologies suitable only for smaller networks. The primary reason is that the more network
nodes you have, the slower your transmission speeds are going to be. It is also worth noting that bus topologies are
limited in the sense that they are half-duplex, which means that data can’t be transmitted in two opposite directions
simultaneously.

A Bus Topology connecting to three stations

21 | P a g e
RING TOPOLOGY

 In networks with ring topology, computers are connected to each other in a circular format. Every
device in the network will have two neighbors and no more or no less. Ring topologies were
commonly used in the past but you would be hard-pressed to find an enterprise still using them
today.
 The first node is connected to the last node to link the loop together. As a consequence of being
laid out in this format packets need to travel through all network nodes on the way to their
destination.
 Within this topology, one node is chosen to configure the network and monitor other devices. Ring
topologies are half-duplex but can also be made full-duplex. To make ring topologies full-duplex
you would need to have two connections between network nodes to form a Dual Ring Topology.

A ring topology connecting to 6 stations.

22 | P a g e
DUAL RING TOPOLOGY

 As mentioned above, if ring topologies are configured to be bidirectional then they are referred to
as dual ring topologies. Dual ring topologies provide each node with two connections, one in each
direction. Thus, data can flow in a clockwise or counterclockwise direction.

Advantages
o With ring topologies, the risk of packet collisions is very low due to the use of token-based
protocols, which only allow one station to transmit data at a given time. This is
compounded by the fact that data can move through network nodes at high speeds which
can be expanded on when more nodes are added.
o Dual ring topologies provided an extra layer of protection because they were more
resistant to failures. For instance, if a ring goes down within a node then the other ring can
step up and back it up. Ring topologies were also low cost to install.

Disadvantages

o One of the reasons why ring topologies were replaced is because they are very vulnerable
to failure. The failure of one node can take the entire network out of operation. This means
that ring topology networks need to be constantly managed to ensure that all network
nodes are in good health. However, even if the nodes were in good health your network
could still be knocked offline by a transmission line failure!
o Ring topologies also raised scalability concerns. For instance, bandwidth is shared by all
devices within the network. In addition, the more devices that are added to a network the
more communication delay the network experiences. This means that the number of

23 | P a g e
devices added to a network topology needed to be monitored carefully to make sure that
the network resources weren’t stretched beyond their limit.

Making changes to a ring topology was also complicated because you need to shut down the network to
make changes to existing nodes or add new nodes. This is far from ideal as you’ll need to factor in
downtime every time you want to make a change to the topological structure!

HYBRID TOPOLOGY

When a topology is composed of two or more different topologies it is referred to as a hybrid topology.
Hybrid topologies are most-commonly encountered in larger enterprises where individual departments have
network topologies that different from another topology in the organization. Connecting these topologies
together will result in a hybrid topology. As a consequence, the capabilities and vulnerabilities depend on
the types of topology that are tied together.

Advantages

There are many reasons why hybrid topologies are used but they all have one thing in common: flexibility.
There are few constraints on the network structure that a hybrid topology cannot accommodate, and you
can incorporate multiple topologies into one hybrid setup. As a consequence, hybrid topologies are very
scalable. The scalability of hybrid setups makes them well-suited to larger networks.

Disadvantages

Unfortunately, hybrid topologies can be quite complex, depending on the topologies that you decide to use.
Each topology that is part of your hybrid topology will have to be managed according to its unique network
requirements. This makes administrators’ jobs more difficult because they are going to have to attempt to
manage multiple topologies rather than a single one. In addition, setting up a hybrid topology can end up
being quite costly.

A hybrid topology: a star backbone with three bus networks

24 | P a g e
Categories of Networks
• Local Area Network (LAN)
 Short distances
 Designed to provide local interconnectivity
• Wide Area Network (WAN)
 Long distances
 Provide connectivity over large areas
• Personal Area Network (PAN)
 Network organized around an individual person within a single building
• Metropolitan Area Network (MAN)
 Provide connectivity over areas such as a city, a campus

Local Area Network (LAN)

An isolated LAN connecting 12 computers to a hub in a closet

25 | P a g e
Wide Area Network (WAN)

26 | P a g e
The Internet

• The Internet has revolutionized many aspects of our daily lives.


• It has affected the way we do business as well as the way we spend our leisure time.
• The Internet is a communication system that has brought a wealth of information to our fingertips and
organized it for our use.

Which Topology Should I Choose?

There is a range of factors that you need to take into account when choosing which topology to use. Before
choosing a topology, you’ll want to closely consider the following:
 Length of cable needed
 Cable type
 Cost
 Scalability

First, you need to take into account the length of the cable you need to provide service to all your network
devices. A bus topology is the most lightweight in terms of cable needs. In this sense, this would be the
simplest topology to install and buy cables for. This ties into the second factor, you need to consider the
type of cable you’re going to use. Cable types range from twister pairs to coaxial cables and optical fiber
cables.

The cost of installing the topology is also very important. The more complex the topology you choose is, the
more you’ll need to pay in terms of resources and time to create that setup.

The final factor you’ll want to take into account is scalability. If you’re planning to upscale your network
infrastructure in the future you want to make sure that you use a network that is easy to add devices to. A

27 | P a g e
star topology network is ideal for this because you can add network nodes with minimal disruption. This
isn’t as simple within a ring network because you will incur downtime if you add any nodes.

28 | P a g e

You might also like