Monthly Archives: August 2022

CS考试辅导 FIT3080 Semester 2, 2022 Informed Search – codehelp代写

FIT3080 Semester 2, 2022 Informed Search
Monash University Faculty of Information Technology FIT3080 Week 4 Lab 3: Informed Search
Exercise 1: Algorithm A
Consider the (full) state space below. Indicate (1) the order in which nodes are expanded, and (2) the nodes remaining in memory after finding the goal, for the following search strategies (assume typical left-to-right operator tie breaking):

Copyright By cscodehelp代写 加微信 aplg6666

(a) Depth-First Iterative Deepening
(b) Greedy Best-First Search
Let’s consider a new strategy called Algorithm A. This algorithm can be described as a best-first search which uses the following expansion priority for a node 𝑛:
𝐟 (𝐧) = 𝐠(𝐧) + 𝐡(𝐧)
As usual, 𝑔(𝑛) denotes the cost-so-far (i.e., from the start node to node 𝑛) and h(𝑛) is an estimate of the cost-to-go (i.e., from node n to the goal node). We can instantiate Algorithm A as using the Graph-search or Tree-search framework, provided the following invariant properties for the 𝑔− and h−value function are true:
𝑔(𝑛) >= 𝑔∗(𝑛) h(𝑛) >= 0
(c) Instantiate Algorithm A (as Graph or Tree- search) to solve the above problem.
(d) Is algorithm A the same algorithm as A*?
(e) How can we modify things (or what can we modify) so that Algorithm A behaves like A*?
(f) After the modification, what nodes are expanded by A*?
Exercise 2: Algorithm 𝐴(∗) – Traveling Salesman Problem
A salesperson must visit each of 𝑛 cities exactly once. Assume that there is a road between
each pair of cities. Starting at city 𝐴, find the route of minimal distance that visits each of the cities only once and returns to city 𝐴.

(a) Propose a state space and action space for this problem, explaining clearly under what state conditions certain actions are allowed.
(b) Propose two (non-zero) h functions for this problem. Is either of these h functions admissible (a lower bound of h∗)?
(c) Apply algorithm A with one of these h functions to the following 5 city problem:
Exercise 3: Algorithm 𝐼𝐷𝐴(∗) – 5-puzzle problem
Consider a problem called the 8-puzzle. The problem has the start and goal state as follows. Throughout the question, when doing a search, give value of 𝑓(𝑛), 𝑔(𝑛) and h(𝑛) at each node 𝑛. The estimated cost function 𝑔(𝑛) is the number of steps from the initial node.
(a) Construct two non-trivial heuristic functions, h1 and h2, that you think may help the algorithm to quickly find a solution. Are these functions admissible? Explain why?
(b) Which heuristic function is more efficient? Explain why?
(c) Useh1todoanIDA*searchtogetfromthestartstatetothegoalstateintheminimum number of steps. Make sure to show all working including value of 𝑓, h, 𝑔 functions in each steps.
(d) (optional/homework) Use h2 to do an IDA* search to get from the start state to the goal state in the minimum number of steps. Make sure to show all working including value of 𝑓, h, 𝑔 functions in each steps.

程序代写 CS代考 加微信: aplg6666 QQ: 2235208643 Email: kyit630461@163.com

CS代写 CS 111 Summer 2022 – cscodehelp代写

CS 111 Summer 2022
Lecture 17 Page 1
Operating System Principles: Distributed Systems
Operating Systems

Copyright By cscodehelp代写 加微信 cscodehelp

• Introduction
• Distributed system paradigms
• Remote procedure calls
• Distributed synchronization and consensus
• Distributed system security
• Accessing remote data
CS 111 Summer 2022
Lecture 17 Page 2

Introduction
Why do we care about distributed systems?
– Because that’s how most modern computing is done
Why is this an OS topic?
– Because it’s definitely a systems issue
– And even the OS on a single computer needs to worry about distributed issues
If you don’t know a bit about distributed
systems, you’re not a modern computer
scientist Summer 2022
Lecture 17 Page 3

Why Distributed Systems?
• Betterscalabilityandperformance
– Apps require more resources than one computer has
– Can we grow system capacity/bandwidth to meet demand?
• Improvedreliabilityandavailability
– 24×7 service despite disk/computer/software failures
• Easeofuse,withreducedoperatingexpenses
– Centralized management of all services and systems – Buy (better) services rather than computer equipment
• Enablingnewcollaborationandbusinessmodels
– Collaborations that span system (or national) boundaries
CS 111 – A global free market for a wide range of new services Summer 2022
Lecture 17 Page 4

A Few Little Problems
Different machines don’t share memory
– Or any peripheral devices
– So one machine can’t easily know the state of
Might this cause synchronization problems?
The only way to interact remotely is to use a
So how can we know what’s going on remotely?
– Usually asynchronous, slow, and error prone
– Usually not controlled by any single machine
Failures of one machine aren’t visible to other
machines Summer 2022
How can our computation be
reliable if pieces fail? Lecture 17 Page 5

Transparency
• Ideally, a distributed system would be just like a single machine system
• But better
– More resources – More reliable – Faster
• Transparent distributed systems look as much like single machine systems as possible
CS 111 Summer 2022
Lecture 17 Page 6

Deutsch’s “Seven Fallacies of Network Computing”
1. The network is reliable
2. There is no latency (instant response time)
3. The available bandwidth is infinite
4. The network is secure
5. The topology of the network does not change
6. There is one administrator for the whole network 7. The cost of transporting additional data is zero Bottom Line: true transparency is not achievable
CS 111 Summer 2022
Lecture 17 Page 7
Here’s an eight: all locations on the network are equivalent.

Distributed System Paradigms
• Parallel processing
– Relying on tightly coupled special hardware
Not widely used, we won’t discuss them.
• Single system images
– Make all the nodes look like one big computer – Somewhere between hard and impossible
• Loosely coupled systems
– Work with difficulties as best as you can
– Typical modern approach to distributed systems
• Cloud computing
CS 111 – A recent variant Summer 2022
Lecture 17 Page 8
So these are also not popular, and we won’t discuss them.

Loosely Coupled Systems
• Characterization:
– A parallel group of independent computers
– Connected by a high speed LAN
– Serving similar but independent requests
– Minimal coordination and cooperation required
• Motivation:
– Scalability and price performance
– Availability – if protocol permits stateless servers – Ease of management, reconfigurable capacity
• Examples:
– Web servers, app servers, cloud computing
CS 111 Summer 2022
Lecture 17 Page 9

Horizontal Scalability
• Each node largely independent
• So you can add capacity just by adding a node “on the side”
• Scalability can be limited by network, instead of hardware or algorithms
– Or, perhaps, by a load balancer • Reliability is high
– Failure of one of N nodes just reduces capacity
CS 111 Summer 2022
Lecture 17 Page 10

Horizontal Scalability Architecture
If I need more web server capacity,
WAN to clients
load balancing switch with fail-over
web server
app server
app server
app server
app server
app server
HA database server
CS 111 Summer 2022
Lecture 17 Page 11
web server
web server
web server
web server
content distribution server

Elements of Loosely Coupled Architecture
• Farmofindependentservers
– Servers run same software, serve different requests – May share a common back-end database
• Front-endswitch
– Distributes incoming requests among available servers
– Can do both load balancing and fail-over
• Serviceprotocol
– Stateless servers and idempotent operations
– Successive requests may be sent to different servers
CS 111 Summer 2022
Lecture 17 Page 12
Same result if you do it once, twice, three times, . . ., n times

Horizontally Scaled Performance • Individualserversareveryinexpensive
– Blade servers may be only $100-$200 each • Scalabilityisexcellent
– 100 servers deliver approximately 100x performance
• Serviceavailabilityisexcellent
– Front-end automatically bypasses failed servers – Stateless servers and client retries fail-over easily
• Thechallengeismanagingthousandsofservers
– Automated installation, global configuration services
– Self monitoring, self-healing systems
– Scaling limited by management, not HW or algorithms
CS 111 Summer 2022
Lecture 17 Page 13

Cloud Computing
• The most recent twist on distributed computing
• Set up a large number of machines all identically configured
• Connect them to a high speed LAN – And to the Internet
• Accept arbitrary jobs from remote users
• Run each job on one or more nodes
• Entire facility probably running mix of single machine and distributed jobs, simultaneously
CS 111 Summer 2022
Lecture 17 Page 14

What Runs in a Cloud? In principle, anything
– But general distributed computing is hard
So much of the work is run using special tools
These tools support particular kinds of parallel/distributed processing
– Either embarrassingly parallel jobs
– Or those using a method like map-reduce or
horizontal scaling
Things where the user need not be a distributed
systems expert Summer 2022
Lecture 17 Page 15

Embarrassingly Parallel Jobs
• Problems where it’s really, really easy to parallelize them
• Probably because the data sets are easily divisible
• And exactly the same things are done on each piece
• So you just parcel them out among the nodes and let each go independently
• Everyone finishes at more or less same time
CS 111 Summer 2022
Lecture 17 Page 16

• Perhaps the most common cloud computing software tool/technique
• A method of dividing large problems into compartmentalized pieces
• Each of which can be performed on a separate node
• With an eventual combined set of results
CS 111 Summer 2022
Lecture 17 Page 17

The Idea Behind MapReduce
• There is a single function you want to perform on a lot of data
– Such as searching it for a particular string
• Divide the data into disjoint pieces
• Perform the function on each piece on a
separate node (map)
• Combine the results to obtain output
CS 111 Summer 2022
Lecture 17 Page 18

An Example
• We have 64 megabytes of text data
• Count how many times each word occurs in the text
• Divide it into 4 chunks of 16 Mbytes
• Assign each chunk to one processor
• Perform the map function of “count words” on each
CS 111 Summer 2022
Lecture 17 Page 19

The Example Continued
Foo Zoo Foo Zoo Foo Zoo Foo Zoo 16712249
CS 111 Summer 2022
Lecture 17 Page 20
Bar 4 Baz 3
Yes 12 Too 5
Bar 3 Baz 9
Yes 17 Too 8
Bar 6 Baz 2
Yes Bar 7 10 Baz 5 Too 4
Yes 3 Too 7
That’s the map stage

On To Reduce
• We might have two more nodes assigned to doing the reduce operation
• They will each receive a share of data from a map node
• The reduce node performs a reduce operation to “combine” the shares
• Outputting its own result
CS 111 Summer 2022
Lecture 17 Page 21

Continuing the Example
Foo Zoo Foo Zoo Foo Zoo Foo Zoo 16712249
Bar 4 Baz 3
Yes 12 Too 5
Bar 3 Baz 9
Yes 17 Too 8
Bar 6 Baz 2
Yes Bar 7 10 Baz 5 Too 4
Yes 3 Too 7
CS 111 Summer 2022
Lecture 17 Page 22

The Reduce Nodes Do Their Job
Write out the results to files And MapReduce is done!
Foo Zoo 14 16 Bar 20 Yes Baz 42 19 Too
CS 111 Summer 2022
Lecture 17 Page 23

But I Wanted A Combined List
• No problem
• Run another (slightly different) MapReduce on the outputs
• Have one reduce node that combines everything
CS 111 Summer 2022
Lecture 17 Page 24

CS 111 Summer 2022
Lecture 17 Page 25
Synchronization in MapReduce
• Each map node produces an output file for each reduce node
• It is produced atomically
• The reduce node can’t work on this data
until the whole file is written
• Forcing a synchronization point between the map and reduce phases

Map Reduce vs. Embarrassing Parallelism
• Embarrassing parallelism is enough if it’s easy to divide a job into pieces
– Of the same size
• And if you don’t worry about failures
• And if you don’t need to combine the results in a non-trivial way
• Map reduce is needed if those things aren’t true
CS 111 Summer 2022
Lecture 17 Page 26

Cloud Computing and Horizontal Scaling
• An excellent match
• Rent some cloud nodes to be your web servers
• If load gets heavy, ask the cloud for another web server node
• As load lightens, release unneeded nodes
• No need to buy new machines
• No need to administer your own machines
CS 111 Summer 2022
Lecture 17 Page 27

Cloud Computing and Sysadmin
• Not quite as painless as it sounds
• The cloud provider will take care of lots of the problem
– Running the hardware
– Fixing broken hardware
– Loading your software onto machines
• But they won’t take care of internal administration
– E.g., updating the version of the web server you’re
running CS 111
Summer 2022
Lecture 17 Page 28
Actually, they will take care of that, too, but at an extra price and with a loss of control.

Remote Procedure Calls
• RPC, for short
• One way of building a distributed program
• Procedure calls are a fundamental paradigm
– Primary unit of computation in most languages
– Unit of information hiding in most methodologies – Primary level of interface specification
• A natural boundary between client and server – Turn procedure calls into message send/receives
• A few limitations
– No implicit parameters/returns (e.g., global variables)
– No call-by-reference parameters
– Much slower than procedure calls (TANSTAAFL)
CS 111 Summer 2022
Lecture 17 Page 29

Remote Procedure Call Concepts • Interface Specification
– Methods, parameter types, return types
• eXternal Data Representation (XDR)
– Machine independent data-type representations – May have optimizations for similar client/server
• Client stub
– Client-side proxy for a method in the API
• Server stub (or skeleton)
– Server-side recipient for API invocations
CS 111 Summer 2022
Lecture 17 Page 30

Key Features of RPC
• Client application links against local procedures
– Calls local procedures, gets results
• All RPC implementation inside those procedures
• Client application does not know about RPC – Does not know about formats of messages
– Does not worry about sends, timeouts, resends
– Does not know about external data representation
• All of this is generated automatically by RPC tools
• The key to the tools is the interface specification
CS 111 Summer 2022
Lecture 17 Page 31

RPC At Work, Step 1
Process_list
… list[0] = 10;
list[1] = 20; list[2] = 17;
max = list_max(list);
CS 111 Summer 2022
list_max() is a remote procedure call!
Lecture 17 Page 32

RPC At Work, Step 2
Process_list
local_max = list_max(list);
. . . list[0] = 10;
list[1] = 20; list[2] = 17;
max = list_max(list);
Format RPC message
Send the message
CS 111 Summer 2022
Extract RPC info
list_max()
Call local procedure
Lecture 17 Page 33
RPC message: list_max(), parameter list

RPC At Work, Step 3
… list[0] = 10;
list[1] = 20;
list[2] = 17;
local_max = list_max(list);
Format RPC response
Send the message
Lecture 17 Page 34
CS 111 Summer 2022
max = list_max(list);
If (max > 10) {
Extract the return value Resume the local program
RPC response: list_max(), return value 20

RPC Is Not a Complete Solution
• Requires client/server binding model
– Expects to be given a live connection
• Threading model implementation
– A single thread services requests one at a time
– So use numerous one-per-request worker threads
• Limited consistency support
– Only between calling client and called server
– What if there are multiple clients and servers working together?
• Limited failure handling
– Client must arrange for timeout and recovery
• Higher level abstractions improve RPC
– e.g. Microsoft DCOM, Java RMI, DRb, Pyro
CS 111 Summer 2022
Lecture 17 Page 35

Distributed Synchronization
• Why is it hard to synchronize distributed systems?
• What tools do we use to synchronize them?
CS 111 Summer 2022
Lecture 17 Page 36

What’s Hard About Distributed Synchronization?
• Spatial separation
– Different processes run on different systems
– No shared memory for (atomic instruction) locks – They are controlled by different operating systems
• Temporal separation
– Can’t “totally order” spatially separated events – Before/simultaneous/after lose their meaning
• Independent modes of failure
CS 111 – One partner can die, while others continue
Summer 2022
Lecture 17 Page 37

Leases – More Robust Locks
• Obtained from resource manager
– Gives client exclusive right to update the file
– Lease “cookie” must be passed to server on update – Lease can be released at end of critical section
• Only valid for a limited period of time – After which the lease cookie expires
• Updates with stale cookies are not permitted – After which new leases can be granted
• Handles a wide range of failures
– Process, client node, server node, network
CS 111 Summer 2022
Lecture 17 Page 38

Lock Breaking and Recovery • Revoking an expired lease is fairly easy
– Lease cookie includes a “good until” time • Based on server’s clock
– Any operation involving a “stale cookie” fails
• This makes it safe to issue a new lease
– Old lease-holder can no longer access object – But was object left in a “reasonable” state?
• Object must be restored to last “good” state – Roll back to state prior to the aborted lease
CS 111 – Implement all-or-none transactions Summer 2022
Lecture 17 Page 39

Distributed Consensus
• Achievingsimultaneous,unanimousagreement
– Even in the presence of node & network failures
– Required: agreement, termination, validity, integrity
– Desired: bounded time
– Provably impossible in fully general case
– But can be done in useful special cases, or if some
requirements are relaxed
• Consensusalgorithmstendtobecomplex
– And may take a long time to converge
• Theytendtobeusedsparingly
– E.g., use consensus to elect a leader
– Who makes all subsequent decisions by fiat
CS 111 Summer 2022
Lecture 17 Page 40

Typical Consensus Algorithm
1. Each interested member broadcasts his nomination.
2. All parties evaluate the received proposals according to a fixed and well known rule.
3. After allowing a reasonable time for proposals, each voter acknowledges the best proposal it has seen.
4. If a proposal has a majority of the votes, the proposing member broadcasts a claim that the question has been resolved.
5. Each party that agrees with the winner’s claim acknowledges the announced resolution.
6. Election is over when a quorum acknowledges the result.
What’s going to happen if someone lies . . . ?
CS 111 Summer 2022
Lecture 17 Page 41

Security for Distributed Systems
• Security is hard in single machines
• It’s even harder in distributed systems • Why?
CS 111 Summer 2022
Lecture 17 Page 42

Why Is Distributed Security Harder?
• Your OS cannot guarantee privacy and integrity – Network activities happen outside of the OS – Should you trust where they happen?
• Authentication is harder
– All possible agents may not be in local password file
• The wire connecting the user to the system is insecure – Eavesdropping, replays, man-in-the-middle attacks
• Even with honest partners, hard to coordinate distributed security
• The Internet is an open network for all
– Many sites on the Internet try to serve all comers
– Core Internet makes no judgments on what’s acceptable
– Even supposedly private systems may be on Internet
CS 111 Summer 2022
Lecture 17 Page 43

Goals of Network Security
• Secure conversations
– Privacy: only you and your partner know what is said – Integrity: nobody can tamper with your messages
• Positive identification of both parties
– Authentication of the identity of message sender
– Assurance that a message is not a replay or forgery – Non-repudiation: he cannot claim “I didn’t say that”
• Availability
– The network and other nodes must be reachable when
they need to be Summer 2022
Lecture 17 Page 44

Elements of Network Security • Cryptography
– Symmetric cryptography for protecting bulk transport of data
– Public key cryptography primarily for authentication
– Cryptographic hashes to detect message alterations
• Digital signatures and public key certificates – Powerful tools to authenticate a message’s sender
• Filtering technologies
– Firewalls and the like
– To keep bad stuff from reaching our machines
CS 111 Summer 2022
Lecture 17 Page 45

Tamper Detection: Cryptographic Hashes
• Check-sums often used to detect data corruption – Add up all bytes in a block, send sum along with data
– Recipient adds up all the received bytes
– If check-sums agree, the data is probably OK
– Check-sum (parity, CRC, ECC) algorithms are weak
• Cryptographic hashes are very strong check-sums
– Unique –two messages vanishingly unlikely to
produce same hash
• Particularly hard to find two messages with the same hash
– One way – cannot infer original input from output
– Well distributed – any change to input changes output
CS 111 Summer 2022
Lecture 17 Page 46

Using Cryptographic Hashes
• Startwithamessageyouwanttoprotect
• Computeacryptographichashforthatmessage
– E.g., using the Secure Hash Algorithm 3 (SHA-3) • Transmitthehashsecurely
• Recipientdoessamecomputationonreceivedtext
– If both hash results agree, the message is intact
– If not, the message has been corrupted/compromised
CS 111 Summer 2022
Lecture 17 Page 47

Secure Hash Transport • Whymustthehashbetransmittedsecurely?
– Cryptographic hashes aren’t keyed, so anyone can produce them (including a bad guy)
• Howtotransmithashsecurely?
– Encrypt it
– Unless secrecy required, cheaper than encrypting entire message
– If you have a secure channel, could transmit it that way
CS 111 Summer 2022
• But if you have secure channel, why not use it for everything?
Lecture 17 Page 48

A Principle of Key Use
• BothsymmetricandPKcryptographyrelyonasecret key for their properties
• Themoreyouuseonekey,thelesssecure – The key stays around in various places longer
– There are more opportunities for an attacker to get it – There is more incentive for attacker to get it
– Brute force attacks may eventually succeed
• Therefore:
– Use a given key as little as possible
– Change them often
– Within the limits of practicality and required performance
CS 111 Summer 2022
Lecture 17 Page 49

Putting It Together: Secure Socket Layer (SSL)
• A general solution for securing network communication
• Built on top of existing socket IPC
• Establishes secure link between two parties
– Privacy – nobody can snoop on conversation – Integrity – nobody can generate fake messages
• Certificate-based authentication of server – Typically, but not necessarily
– Client knows what server he is talking to
• Optional certificate-based authentication of client – If server requires authentication and non-repudiation
• PK used to distribute a symmetric session key – New key for each new socket
• Rest of data transport switches to s

程序代写 CS代考 加微信: cscodehelp QQ: 2235208643 Email: kyit630461@163.com

CS代考 IA32) generations: 8086, 286, 386, 486, Pentium, PentiumIII, Pentium4,… – cscodehelp代写

Introducti
er Architectur
2: Instruction Set
Architecture

Copyright By cscodehelp代写 加微信 cscodehelp

1 (Martin/Roth)
: Instruction Set Architectures
• Chapter 2 • Further r
pendix C (RISC)
Available from web page
• The Evolution
and Appendix D
chnology at IBM
Much of this chapter will be “on your own reading”
• Hard to talk about ISA features without knowing what they do
1 (Martin/Roth)
many of these issu
: Instruction Set Architectures
Instruction Set
1 (Martin/Roth)
Gates & Transistors
: Instruction Set Architectures
Architecture (ISA)
What is a goo
pects of ISAs
• RISC vs.
• Implementing CISC:
1 (Martin/Roth)
(instruction s
• A well-define hardw
guarantees rega
perations are
• The “contract” between software and hardware • Functional definition of operations, modes,
locations supported by hardware Precise description of how
are implemented
perations take more power
: Instruction Set Architectures
are/software interface
fast and whic
invoke, and access
and storage

guage Analogy
• Allows commu • Language:
• Many common aspects
Part of spe Common o
ISA: hardware to soft
• Need to speak
• Many different languages/ISAs
Different structure
• Both evolve over
ey differences: ISAs
1 (Martin/Roth)
person to person
e same lan
ech: verbs, nouns, adjectives, adverbs, etc. perations: calculation, control/branch, memory
explicitly engine
: Instruction Set Architectures
, many similarities,
ered and extend
unambiguous
many differences
• Easy to exp
1 (Martin/Roth)
Programmability
y to design hi
• More recently
Compatibility
ress programs effic
gh-performan
design low-power implementations? design high-reliability implementations?
design low-cost implementations
: Instruction Set Architectures
• Easy to maintain programmability (imp and programs (technology) evolves?
• x86 (IA32) generations: 8086, 286, 386, 486, Pentium, PentiumIII, Pentium4,…
lementability)
PentiumII,
vs CISC Foresh
ecall perfor
• (instructi
C (Complex Instru
ons/progra
y for assembly-level progra
“cycles/instru
• Increases “instruction/progr • Help from smart compiler
• Perhaps improve
1 (Martin/Roth)
(cycles/instruction)
ction” with
cycle time
essive implementation allowed by s
: Instruction Set Architectures
Computing)
“instructions/program” with “complex” instructions
Computing)
* (seconds/cycle)
many single-cycle instru
but hopefu
(seconds/cycle)
not as much
impler instruc
Programmability
• Easy to express programs efficiently? • For whom?
• Before 1985: human
• Compilers were terrible, most code was hand-assembled • Want high-level coarse-grain instructions
• As similar to high-level language as possible
• After 1985: compiler
• Optimizing compilers generate much better code that you or I • Want low-level fine-grain instructions
• Compiler can’t tell if two high-level idioms match exactly or not
CIS 501 (Martin/Roth): Instruction Set Architectures 8

• Proximity to a high-level language (HLL) • Closing the “semantic gap”
• Semantically heavy
Example: SPARC save/restore
Bad example: x86 rep movsb (copy Ridiculous example: VAX insque (ins
• “Semantic
tranger than fiction
• People once thought compu
• Fortunately, never materialized (but
1 (Martin/Roth)
: Instruction Set Architectures
(CISC-like)
human to program in?
insns that
“loop”, “procedure
you have many hig
ters would
string) ert-into-
mplete idio
evel languages?
language directly
keeps coming back around)
day’s Semantic
• Today’s ISAs are targeted to one language… • Just so happens that this language is very low
e C programming language
Will ISAs be different when Java/C# become dominant? • Object-oriented? Probably not
• Support for
• Support for
1 (Martin/Roth)
garbage collection? Maybe
Smart compilers instructions
Any benefit of tailo
: Instruction Set Architectures
is likely sm
guages to simple
1 (Martin/Roth)
• Low level primitives
• Wulf: “primitives
• Requires
gularity: “princi
Orthogonality One-vs.-all
from which solutio not solutions”
good at breaking complex
Not so good at combining sim
: Instruction Set Architectures
• Requires search, pattern matching (why AI is hard) Easier to synthesize complex insns than to compare them
f least astonishment”
mposability
to program in?
can be syn
uctures to simple ones
ple structures into complex
Implementability
• Every ISA can be implemented
• Not every ISA can be implemented efficiently
• Classic high-performance implementation techniques
• Pipelining, parallel execution, out-of-order execution (more later)
• Certain ISA features make these difficult
– Variable instruction lengths/formats: complicate decoding – Implicit state: complicates dynamic scheduling
– Variable latencies: complicates scheduling
– Difficult to interrupt instructions: complicate many things
CIS 501 (Martin/Roth): Instruction Set Architectures 12

mpatibility
• Very imp
1 (Martin/Roth)
M’s 360/37
Backward compatibility
• New processors must support old
ardware… if it requires new software
• Intel was the first company to realize this
• ISA ust remain compatible, no matter what
the worst designed ISAs EVER, but survives
pward) com
processors must support new New processors redefine only
e to detect
rocessors emulate new inst
: Instruction Set Architectures
0 (the first
(can’t drop
programs (with software help) previously-illegal opcodes
r specific n
instructions
low-level soft
ompatibility’s
mpatibility
• Trap:instructionmakeslow-level“functioncall”toOShandler • Nop: “no operation” – instructions with no functional semantics
• Handle rare
ly used but hard
implement “legacy” opc
ine to trap in new implementation and emulate in software Rid yourself of some ISA mistakes of the past
• Add ISA hints
1 (Martin/Roth)
: performance suffers
compatibility
• Reserve sets of trap & nop opcodes (don’ • Add ISA functionality by overloading traps
firmware patch to “add”
: Instruction Set Architectures
erloading nop
old implementation
mpatibility
asy compatibility r
• Temptation: use • Frequent outcom
1 (Martin/Roth)
equires forethought
some ISA extension for 5% performance gain e: gain diminishes, disappears, or turns to loss
continue to support gadget fo
• Example: register windows (SPARC)
Adds difficulty to out-of- Details shortly
: Instruction Set Architectures
implementations of SPARC
Aspects of ISAs
• VonNeumannmodel
• Implicit structure of all modern ISAs
• Length and encoding
• Operand model
• Where (other than memory) are operands stored?
• Datatypes and operations
• Overview only
• Read about the rest in the book and appendices
CIS 501 (Martin/Roth): Instruction Set Architectures 16

Write Output
Sequential Model
Basic • Def
called VonNeum
Value flows from insn
all modern
as output,
an, but in ENIAC befo
s A as inpu
feature: the program counter (PC) ines total order on dynamic instruction Next PC is PC++ unless insn says otherwise
Read Inputs
define computation
1 (Martin/Roth)
: Instruction Set Architectures
d Y after X
Processor logically executes loop at
• Instruction execution assumed atomic
• Instruction X finishes before insn X+1 starts
been proposed…
Example: M

• 3 formats, sim
• Q: how many instru
1 (Martin/Roth)
IPS Format
ple encoding
ctions can
Rs(5) Rt(5)
Rs(5 Rt(5)
: Instruction Set Architectures
encoded? A: 127
Rd(5) Sh(5)
• Fixed len • Most
1 (Martin/Roth)
common is 32 bits
Simple implementatio
• Variable length
– Complex impl
density: 32 bits
• Compromise: two leng
: Instruction Set Architectures
can do this in one 8-bit instruction
ementation
ute next PC usin
y decoder impleme
egister by 1?
Operand Model: Memory Only
• Where (other than memory) can operands come from? • And how are they specified?
• Example:A=B+C
• Several options
• Memory only
add B,C,A mem[A] = mem[B] + mem[C]
MEM CIS 501 (Martin/Roth): Instruction Set Architectures 20

load B add C
1 (Martin/Roth)
Accumulator: implicit single ele
: Instruction Set Architectures
ACC = mem[B]
ACC = A mem[A]
CC + mem[C] = ACC

store R1,A
oad-store: GPR and only l
store R1,A
1 (Martin/Roth)
add R1,R2,R1
: Instruction Set Architectures
er: multiple e
R1 = mem[B]
R1 = R1 + mem[C] mem[A] = R1
oads/stores access me
R1 = mem[B] R2 = mem[C]
R1 = R1 + R2
mem[A] = R1
it accumula
Stack: TOS
1 (Martin/Roth)
implicit in instru
: Instruction Set Architectures
stk[TOS++]
stk[TOS++] stk[TOS++]
em[A] = stk[–TOS]
= mem[C] = stk[–TO
+ stk[–TO
Operand Model Pros and Cons
• Metric I: static code size
• Number of instructions needed to represent program, size of each • Want many implicit operands, high level instructions
• Good ! bad: memory, accumulator, stack, load-store
• Metric II: data memory traffic
• Number of bytes move to and from memory
• Want as many long-lived operands in on-chip storage • Good ! bad: load-store, stack, accumulator, memory
• Metric III: cycles per instruction
• Want short (1 cycle?), little variability, few nearby dependences • Good ! bad: load-store, stack, accumulator, memory
• Upshot: most new ISAs are load-store or hybrids
CIS 501 (Martin/Roth): Instruction Set Architectures 24

How Many Registers?
• One reason
• Small is • Another is t
– More reg
• Upshot: trend • 64-bit x86
1 (Martin/Roth)
s faster tha
Fewer registe
es, arrays,
registers are faster is th fast (hardware truism)
hat they are directly addressed (
rs per instr
hough compilers are getting better
means more savi
have as many as possible?
r specifiers
uction or indirect addressin
put in registers
ng/restoring
to more registers: 8 (x86)!32 (MIPS) !128 (IA32) has 16 64-bit integer and 16 128-bit FP registers
: Instruction Set Architectures
putting more
1 (Martin/Roth)
• Support me
Address Size
• Alternative (wrong)
• Most critical, inescapable
processor?
irtual address size
• Determines size of addressable (usa
size of 2n
Will limit the
uire nasty hacks
• x86 evolution:
• 4-bit (4004), 8-bit (8008), 16-bit (8086),
• 32-bit + protected memory (80386)
• 64-bit (AMD’s Opteron & Intel’s EM64T Pen
: Instruction Set Architectures
32-bit or 64-bit address spaces
e of calculation operations
ble) memory
t already at) 64 bits
ISA design decision
(E.g., x86 segments)
Global regi
• Sun SPARC om the RISC I) • 32 integer registers divided
• Explicitsave/restoreinst
hardware activation
into: 8 global, 8 ructions
restore: locals zeroed, inputs ! outputs, inputs “popped” Hardware stack provides few (4) on-chip register frames
d-to/filled-from me
omatic param
– Hidden memory operations (some restores fast, o – A nightmare for register renaming (more later)
1 (Martin/Roth)
: Instruction Set Architectures
caller-saved registers
traffic on shallow (<4 deep) call graphs 8 input, 8 locals zeroed Memory Addressing • Addressing mode: way of specifying address • Used in memory-memory or load/store instructions in register ISA • Examples • Register-Indirect: R1=mem[R2] • Displacement: R1=mem[R2+immed] • Index-base: R1=mem[R2+R3] • Memory-indirect: R1=mem[mem[R2]] • Auto-increment: R1=mem[R2], R2= R2+1 • Auto-indexing:R1=mem[R2+immed],R2=R2+immed • Scaled: R1=mem[R2+R3*immed1+immed2] • PC-relative: R1=mem[PC+imm] • What high-level program idioms are these used for? CIS 501 (Martin/Roth): Instruction Set Architectures 28 Example: M I-type instructions: • Is 16-bits enough? IPS Addressing plements only displacement • Why? Experiment on VAX (I • Disp: 61%, reg-ind: 19% small displacem SA with every mode) found , scaled: 11%, mem-ind: 5%, ent or registe • Yes? VAX experiment showed 1% accesses use displacem r indirect (displacement 0) distribution other: 4% 1 (Martin/Roth) Rs(5) Rt(5) Reg+Reg mode : Instruction Set Architectures ntrol Instructi One issue: testing • Option I: compare and branch insns branch-less-than R1,10,target 1 (Martin/Roth) • Option II: implicit condition branch-neg ndition codes • Option III: condition for conditio wo ALUs: one for c set-less-than R2,R1,10 branch-not-equal-zero R2,target ditional instru : Instruction Set Architectures ctions, + o registers, separate ondition, one sets “negative” ALU per, + explicit for target address branch insns e is tricky dependence ccess alig address % si • Aligned: loa • Unaligned load-half @XX • Question: (uncommon case)? Support in hardware? M akes all accesses slow Trap to software routine? Possibility • Load, shift , load, shift, MIPS? ISA support: unaligned access using two instructio lwl @XXXX10; lwr • Big-endian: sensibl rder (e.g., MIPS, PowerPC) integer: “00000000 00000000 00000010 00000011 • Little-e integer: “00000011 00000010 00000000 00000000 • Why little endian? To different? To be annoying? Nobody knows 1 (Martin/Roth) : Instruction Set Architectures Example: MIPS Conditional Branches • MIPS uses combination of options II/III • Compare2registersandbranch:beq,bne • Equality and inequality only + Don’t need an adder for comparison • Compare1registertozeroandbranch:bgtz,bgez,bltz,blez • Greater/less than comparisons + Don’t need adder for comparison • Setexplicitconditionregisters:slt,sltu,slti,sltiu,etc. • More than 80% of branches are (in)equalities or comparisons to 0 • OK to take two insns to do remaining branches (MCCF) CIS 501 (Martin/Roth): Instruction Set Architectures 32 ntrol Instructi • Option I: PC-relative • Used for branches • Option II: Absolute • Position independent outside procedure • Used for procedure calls • Option III: Indir • Howfardo 1 (Martin/Roth) computing targets on-independe within proced ect (target found in regi for jumping to dynamic targets for returns ally not so far within a procedure (t er from one procedure to another : Instruction Set Architectures ic procedure calls, switches hey don’t get ntrol Instructi • Implicit r • Link (remember) • Directjump-and-link:jal • Indirectjump-and-link:jal 1 (Martin/Roth) support for address register is : Instruction Set Architectures calling insn + 4 程序代写 CS代考 加微信: cscodehelp QQ: 2235208643 Email: kyit630461@163.com

CS代考 COMM1822 Consultation – cscodehelp代写

Week 5 SQL Joins: Joining Data from Multiple Tables
Lecturer-in-Charge: Kam-Fung (Henry) : Tutors:
PASS Leader:

Copyright By cscodehelp代写 加微信 cscodehelp

Term 2 2022

Week 5 Welcome Video

• There are some file-sharing websites that specialise in buying and selling academic work to and from university students.
• If you upload your original work to these websites, and if another student downloads
and presents it as their own either wholly or partially, you might be found guilty of collusion — even years after graduation.
• These file-sharing websites may also accept purchase of course materials, such as copies of lecture slides and tutorial handouts. By law, the copyright on course materials, developed by UNSW staff in the course of their employment, belongs to UNSW. It constitutes copyright infringement, if not academic misconduct, to trade these materials.

UNSW Business School acknowledges the Bidjigal (Kensington campus) and Gadigal (City campus) the traditional custodians of the lands where each campus is located.
We acknowledge all Aboriginal and Islander Elders, past and present and their communities who have shared and practiced their teachings over thousands of years including business practices.
We recognise Aboriginal and Islander people’s ongoing leadership and contributions, including to business, education and industry.
UNSW Business School. (2022, May 7). Acknowledgement of Country [online video]. Retrieved from https://vimeo.com/369229957/d995d8087f

❑ Housekeeping
❑ Discussion of SQL Joins ❑ Week 5 Demo Script
❑ Week 5 Sandbox Activity

COMM1822 Consultation
Consultation with the LiC
Kam-Fung (Henry)
10.00 – 11.00 am (AEST)
Send an email to book a time:

COMM1822 PASS Class
PASS Class

10:00 – 11:00 am (AEST)
Online via
https://au.bbcollab.com/guest/734c9 39b0ddf42d2868fc2304b801d82

Assignment Group SQL Accounts
❑ A separate Oracle SQL account will be provided to each assignment group (Each assignment group will have 1 account)
❑ Complete the assignment SQL activities using the group account instead of your personal student SQL account (for part B only)
❑ Do NOT change your group SQL account login password

Thank you for all who provided the feedback in week 4. We are still collecting feedback
This is your chance to provide us with early feedback
Please do not ignore
https://forms.office.com/Pages/ResponsePage.aspx?id=pM_2PxXn20i44Qhnufn7o0KszAg PgNBAjB8ETnYCVsdUQkRGVEJTOVBEM0dDTkJGQ1hFU1RaNE5ZQS4u

❑ Housekeeping
❑ Discussion of SQL Joins ❑ Week 5 Demo Script
❑ Week 5 Sandbox Activity

Week 5 Lab Manual Discussion
1. What is the purpose of the queries and how might they be useful?
2. What new concept has been introduced?
3. What are the different types of joins?
4. In what scenarios might each type of join be useful?
5. What new clauses have been introduced?

❑ Housekeeping
❑ Discussion of SQL Joins ❑ Week 5 Demo Script
❑ Week 5 Sandbox Activity

Week 5 Demo Script
Open Week 5 Demo Script (Oracle Demo) from Moodle:
– Query 1-11
– Query 12-20

Week 5 Demo Script
Open Week 5 Demo Script (Query 1-11)

▪ Rest Breaks: https://safety.unsw.edu.au/office-safety-toolkit/rest-breaks
▪ WorkRave at UNSW: https://safety.unsw.edu.au/sites/default/files/documents/UNSW_WorkRa ve_V1.0.pdf
▪ Setting up you Workstation : https://safety.unsw.edu.au/setting-your- workstation-video
▪ Online Safety and Wellbeing Tutorial: https://student.unsw.edu.au/safety
▪ SafeWork 6 Simple stretches: https://www.safework.nsw.gov.au/resource-library/six-simple-stretches

Take a 5 minute break

Week 5 Demo Script
Open Week 5 Demo Script (Query 12-20)

❑ Housekeeping
❑ Discussion of SQL Joins ❑ Week 5 Demo Script
❑ Week 5 Sandbox Activity

Week 5 Sandbox Activity
1. Create a list that displays each dish_name and the name of the chef that cooked it. Sort the output by dish_name in descending order.
2. Produce a list of all customers who have ordered the dish “Beef Inside Skirt” after 20th March 2021. Include the customer’s name and the date of their order in the output.
3. Display a list of every drink which has been ordered by customers. Include the name of the company that supplied it, the name of the customer who ordered it, and the date when they ordered the drink.
4. Provide a list of all customers (ID + Name) who did NOT receive a discount on their order (i.e. there is no discount value).

Week 5 Sandbox Activity
1. Create a list that displays each dish_name and the name of the chef that cooked it. Sort the output by dish_name in descending order.
SELECT f.dish_name, c.name “Cooked By” FROM FOOD f
INNER JOIN COOKS ck
USING (food_ID)
INNER JOIN chef c
USING (staff_ID)
ORDER BY f.dish_name DESC;

Week 5 Sandbox Activity
2. Produce a list of all customers who have ordered the dish “Beef Inside Skirt” after 20th March 2021. Include the customer’s name and the date of their order in the output.
SELECT c.Name “Customer Name”, o.order_date “Order Date” FROM customer c
INNER JOIN orders o
USING (customer_ID)
INNER JOIN food f
USING (food_ID)
WHERE f.dish_name = ‘Beef Inside Skirt’ AND o.order_date >= ’20-MAR-21′;

Week 5 Sandbox Activity
3. Display a list of every drink which has been ordered by customers. Include the name of the company that supplied it, the name of the customer who ordered it, and the date when they ordered the drink.
SELECT d.Drink_Name, s.supplier_name, c.name “CUSTOMER_NAME”, o.order_date FROM Drinks d
INNER JOIN orders o
USING (drink_ID)
INNER JOIN customer c
USING (customer_ID)
INNER JOIN supplier s USING (supplier_ID);

Week 5 Sandbox Activity
4. Provide a list of all customers (ID + Name) who did NOT receive a discount on their order (i.e. there is no discount value).
SELECT c.customer_id “ID”, c.name “Name” FROM customer c
LEFT JOIN orders o
on c.customer_id = o.customer_id
WHERE o.Discount_ID IS NULL;

▪ No classes next week (week 6), classes resume in week 7.
▪ Start working on your Part B assignment.
▪ Any group conflicts (unequal contribution) must be raised ASAP with the LiC and the tutor.

程序代写 CS代考 加微信: cscodehelp QQ: 2235208643 Email: kyit630461@163.com

代写代考 BUS 216 Online via MS Teams – cscodehelp代写

Introduction to Databases for Business Analytics
Week 2 Entity Relationship (ER) Modelling Part 2
Term 2 2022
Lecturer-in-Charge: Kam-Fung (Henry) : Tutors:

Copyright By cscodehelp代写 加微信 cscodehelp

PASS Leader:

(Tutor-in-Charge) Liam Li

Week 2 Welcome Video (Online Class Manner)

• There are some file-sharing websites that specialise in buying and selling academic work to and from university students.
• If you upload your original work to these websites, and if another student downloads
and presents it as their own either wholly or partially, you might be found guilty of collusion — even years after graduation.
• These file-sharing websites may also accept purchase of course materials, such as copies of lecture slides and tutorial handouts. By law, the copyright on course materials, developed by UNSW staff in the course of their employment, belongs to UNSW. It constitutes copyright infringement, if not academic misconduct, to trade these materials.

Acknowledgement of Country
UNSW Business School acknowledges the Bidjigal (Kensington campus) and Gadigal (City campus) the traditional custodians of the lands where each campus is located.
We acknowledge all Aboriginal and Islander Elders, past and present and their communities who have shared and practiced their teachings over thousands of years including business practices.
We recognise Aboriginal and Islander people’s ongoing leadership and contributions, including to business, education and industry.
UNSW Business School. (2022, May 7). Acknowledgement of Country [online video]. Retrieved from https://vimeo.com/369229957/d995d8087f

❑ Exercises ❑Group forming

PASS Class
Friday 10 – 11 am

On-campus BUS 216 Online via MS Teams
Starts this week! (Week 2)

❑Groups must be formed by the end of this session.
❑ At the end of this session you need to fill-in and sign the form (on Moodle under Team Assignment Section) and only the Team Leader (of each group) should email the form to your tutor. If you do not send the form, we will assume that you do not have a group and we will assign you to a group.
❑ We will start SQL in Week 3 Tutorial.
❑You will receive an email with your login details and how to access it in UNSW myAccess (or install SQL Developer on your device for Windows 64-bit OS).

❑ Exercises ❑Group forming

ER Modelling Guideline (Lecture Recap)
Draw ERD in an iterative way (draft, review, revise, review…,finalise).
Even experienced designers may need 5-7 drafts before finalising the solution.

Exercise 1
Create the ER diagram (entities, relationship, and key attributes) appropriate to the following description of a university program structure:
Business Rules:
❑ A program contains many courses.
❑ A course can be part of many programs. ❑Students enrol in many courses.
❑Students may enrol in more than one program.
Do NOT use composite entities for now.

Exercise 2
Now, break the ternary relationship from Exercise 1 up by using composite entities.

Break ❑Online Safety
▪ Rest Breaks: https://safety.unsw.edu.au/office-safety-toolkit/office-workstations/rest- breaks
▪ WorkRave at UNSW: https://safety.unsw.edu.au/sites/default/files/documents/UNSW_WorkRave_V1.0.pdf
▪ Guide to Office Workstation Set-up https://safety.unsw.edu.au/sites/default/files/documents/HS705_Guide_to_setting_up_ your_workstation_0.pdf
▪ Online Safety and Wellbeing Tutorial: https://student.unsw.edu.au/safety
▪ SafeWork 6 Simple stretches: https://www.safework.nsw.gov.au/resource-library/six- simple-stretches

Exercise 3
The entity type PERSON has three subtypes: CAMPER, BIKER and RUNNER. Draw a separate ER diagram segment for each of the following situations:
a) A person must be exactly one of these subtypes.
b) A person may or may not be one of these subtypes. A person who is one of these subtypes cannot at the same time be one of the other subtypes.
c) A person may or may not be one of these subtypes. A person could be any two (or even three) of these subtypes at the same time.
d) A person must be at least one of these subtypes.

Exercise 4
Create an ER diagram for the following entities:
❑ REGULAR_PHONE_CALL (Source_No, Destination_No, Time_Of_Day, Duration, Customer_ID)
❑ LONG_DISTANCE_CALL (Source_No, Destination_No, Time_Of_Day, Duration, Long_Distance_Carrier, Customer_ID)
❑ CELL_PHONE_CALL (Source_No, Destination_No, Time_Of_Day, Land_time, Air_time, Customer_ID) ❑ CUSTOMER (Customer_ID, Name, Address)
Indicating foreign key
Indicating PK

Group Forming

Assignment Groups
➢ Form your groups
➢ Fill in the form
➢ The Team Leader should email the form to the tutor ➢ The First name on the from will be the Team Leader
➢ Each group will be allocated a Group-ID by the tutor.
e.g. T10A-99 T10A is the tutorial session, and 99 for group number.

To do for Week 3
❑Week 3 Course Preparation
❑You will receive an email with your login details and how to access it in UNSW myAccess (or install SQL Developer on your device for Windows 64-bit OS).
❑ SQL credentials are NOT the same as UNSW credentials

程序代写 CS代考 加微信: cscodehelp QQ: 2235208643 Email: kyit630461@163.com

代写代考 CIS-200 700 – cscodehelp代写

Introduction to Databases for Business Analytics
Week 2 Entity Relationship (ER) Modelling Part 2
Term 2 2022
Lecturer-in-Charge: Kam-Fung (Henry) : Tutors:

Copyright By cscodehelp代写 加微信 cscodehelp

PASS Leader:

(Tutor-in-Charge) Liam Li

• There are some file-sharing websites that specialise in buying and selling academic work to and from university students.
• If you upload your original work to these websites, and if another student downloads
and presents it as their own either wholly or partially, you might be found guilty of collusion — even years after graduation.
• These file-sharing websites may also accept purchase of course materials, such as copies of lecture slides and tutorial handouts. By law, the copyright on course materials, developed by UNSW staff in the course of their employment, belongs to UNSW. It constitutes copyright infringement, if not academic misconduct, to trade these materials.

Acknowledgement of Country
UNSW Business School acknowledges the Bidjigal (Kensington campus) and Gadigal (City campus) the traditional custodians of the lands where each campus is located.
We acknowledge all Aboriginal and Islander Elders, past and present and their communities who have shared and practiced their teachings over thousands of years including business practices.
We recognise Aboriginal and Islander people’s ongoing leadership and contributions, including to business, education and industry.
UNSW Business School. (2022, May 7). Acknowledgement of Country [online video]. Retrieved from https://vimeo.com/369229957/d995d8087f

Entity Relationship Modelling (from week 1)
 Weak Entity
Advanced Entity Relationship Modelling
 Supertype  Subtype
Convert from an Entity Relationship Model to a Relational Model

Recap: ER Modelling 1
❑ Data Modelling:
 Data model as a (relatively) simple abstraction of the complex real-world.
 One modelling technique to design a database: Entity Relationship Modelling.
❑ Entity Relationship Modelling components:  Entity Types and Entity Instances
 Attributes and Values
 Relationships
 Connectivity and Cardinality

Recap: ER Modelling 1
Foreign key (FK)
Multivalued attribute
Derived attribute
A1 E1 1 r1 M E2
Primary key (PK)
Binary relationship
1 (1,1) (1,1) 1
Unary relationship
• Entity and PK
• Attribute
• Relationship
• Connectivity
• Cardinality
Ternary relationship

Connectivity and Cardinality
(0, 3) (1, 1)
Cardinality
One-to-Many Relationship
Cardinality
Many-to-Many Relationship
How to read this?
• A professor teaches (0, 3) classes. A class is taught by (1, 1) professors.
• A student enrolls in (1, 6) classes. A class has enrolled in it (0, 30) students.

Existence Dependence and Independence

Existence Dependence and Independence
Existence dependence: Entity exists in the database only when it is associated with another related entity occurrence
e.g., parents & children
Existence independence: Entity exists apart from all of its related entities, and referred to as a strong entity or regular entity
e.g., customer & product in a supermarket

Weak (Non-identifying) Relationship
Primary key of the related entity does not contain a primary key component of the parent entity.
CRS_CODE is a primary key of Course table, and CRS_CODE is a foreign key of Class table.
CRS_CODE is a foreign key, but it is not part of the primary key of Class table.

Strong (Identifying) Relationship
Primary key of the related entity
contains a primary key component of the parent entity.
CRS_CODE is a primary key of Course table, and CRS_CODE is a foreign key of Class table.
CRS_CODE is also part of the primary key of Class table. CRS_CODE is part of the composite primary key for Class table.

Weak Entity

Weak Entity
Weak entity is an entity that relies on the existence of another (strong or independent) entity. It has a primary key (PK) that is partially or totally derived from the parent entity in the relationship.
e.g., parents & children
Weak entity meets two conditions:
Existence-dependent: Cannot exist without entity with which it has a relationship.
Has primary key that is partially or totally derived from the parent entity in the relationship.
Database designer usually determines whether an entity can be described as weak based on the business rules.

Example of a Weak Entity in an ERD
Symbol to indicate
Weak Entity
Weak Entity: DEPENDENT
As for fulling the conditions:
a. Existence-dependent: Cannot exist without entity with which it
has a relationship – in this case it is the DEPENDENT entity. A child must exist with one of his/her parents.
b. Has primary key that is
partially or totally derived from the parent entity in the relationship – in this case, EMP_NUM in DEPENDENT entity is associated with EMP_NUM of the EMPLOYEE table.
Why (1, 1)?
• A child must have one parent working in the company.
• If both parents work in the company, you only have to connect to one. E.g., UNSW childcare: it is connected to the parent who will pay childcare fees 🙂

Example of a Weak Entity (with Attributes)
Composite PK
Weak Entity
Existent-Dependent Relationship between EMPLOYEE & DEPENDENT
Strong Entity
FName LName
Other attributes

Example of a Weak Entity

Desirable Primary Key Characteristics
Unique value Cannot be null
Non intelligent Should not have embedded semantic meaning, e.g., use zID as PK
rather than name
No change over time Name, marital status may change
Remember a PK can be someone’s foreign key, multiple attributes make it hard to link tables
Preferably single-attribute
Preferably numeric To avoid typing errors; Can use auto-increment, e.g., zID
Security-compliant
Using Social Security Number (SSN) as a SID is a bad idea.

Candidate Key and Primary Key
Candidate Keys:
• PassportNum
• DriverLicenceNum
PassportNum
DriverLicenceNum

Plan: ER Modelling 2
❑Enhanced Entity Relationship Modelling ▪Composite entity (bridge entity) ▪Supertype and subtype
▪Generalisation and specialisation
▪ Constraints (completeness, disjointness) ❑ Exercise

Database Design Process Modelling
Develop Convert to
Apply normalisation
Conceptual Model
Relational Model
Logical Model
Implement DBS

Composite Entity

Composite Entity
A composite entity (bridge entity, associative entity) is an entity type that associates the instances of one or more entity types. It contains attributes that are peculiar (singular) to the relationship between those entity instances.
❑ The composite entity builds a bridge between the original entities.
❑ The composite entity is composed of the PKs of the original entities. ❑ The composite entity may contain additional attributes.
e.g., enrolment grades
STUDENT M STUDENT 1 M
N CLASS N 1 CLASS
A regular M:N Relationship
A composite entity dealing with M:N Relationship

Composite Entity
❑ M:N relationships (many-to-many relationships) should be avoided.
❑ Relational databases can only handle 1:M relationships (one-to-many relationships).
❑ M:N relationships should be decomposed (broken down) to 1:M relationships by creating a composite entity.
❑ The composite entity builds a bridge between the original entities.
❑ The composite entity is composed of the PKs of the original entities.
❑ The composite entity is existence-dependent on the original entities.
❑ The composite entity may contain additional attributes.

Composite Entity
 Relational databases can only handle 1:N relationships (one-to-many
relationships) or 1:1 relationships.
 M:N relationships (many-to-many relationships) should be avoided (via
building composite entity).
 A M:N relationship should be decomposed (broken down) to two 1:M
relationships by creating a composite entity.
STUDENT M ENROLL STUDENT 1 M
N CLASS N 1 CLASS
A regular M:N Relationship
A composite entity dealing with M:N Relationship

Without Composite Entity (Original)
CLASS_CODE
CLASS_TIME
CLASS_SECTION
Connectivity
Cardinality
Enroll Grade

With Composite Entity
CLASS_CODE
CLASS_TIME
M1 M1 (1, N) (1, 1) (1, 1) (0, N)
CLASS_SECTION
STU_NUM CLASS_CODE
Enroll Grade

Inappropriate Approach
STU_NUM STU_LNAME
CLASS_CODE
1602, 1603 1602, 2603 5992
5992, 5993
CLASS_CODE CRS_CODE PROF_NUM
1602 CIS-200 700
1603 CIS-300 510
2603 SAD-100 240
5992 GM-200 350
5993 ADB-300 120

STU_NUM STU_LNAME
Correct Approach
001 1602 001 1603 002 1602 002 2603 003 5992 004 5992 004 5993
CLASS_CODE
CLASS_CODE ClassName PROF_NUM
1602 CIS-200 700
1603 CIS-300 510
2603 SAD-100 240
5992 GM-200 350
5993 ADB-300 100

Ternary Relationship Without Composite Entity

Ternary Relationship With Composite Entity
✓ A guest can be included in many schedule records;
✓ A schedule record includes only one guest;
✓ A room can be included in many schedule records;
✓ A schedule record includes only one room;
✓ An event can have many schedule records;
✓ A schedule record is only for one event.

Advanced Data Modeling
5-1 to 5-3

Supertype and Subtype

Supertype and Subtype
“A supertype is a more generic entity type compared to its subtypes.”
“A subtype is a more specific entity type compared to its supertype.”
 A subtype entity inherits all attributes of the supertype.
 A subtype has additional, specific attributes.
 An instance (occurrence) of a subtype is also an instance (occurrence) of the supertype.
(The other way around, an instance of the supertype may or may not be an instance of one or more subtypes.)

Supertype and Subtype
Relationships in which all instances participate
Attributes shared by all entities
General entity type
and so forth
Specialised versions of supertype
Relationships in which only specialised versions participate
Attributes unique to subtype 1
Attributes unique to subtype 2

Example of Supertype and Subtype
Explain later

Generalisation and Specialisation

Generalisation and Specialisation
 Generalisation: The process of defining a general entity type from a set of specialised entity types. It is a bottom-up process from subtypes to supertypes.
 Specialisation: The process of defining one or more subtypes of the supertype. It is a top-down process from supertypes to subtypes.

Generalisation
Question: How to generalise the listed two entity types: CAR and TRUCK?

Generalisation
 What are the common attributes?
• Vehicle_ID
• Vehicle_Name (Make, Model)
• Engine Displacement
 What are the specific attributes for Car?
• No_of_Passengers
 Whatarethespecific attributes for Truck?
• Capacity
• Cab_Type

Specialisation
How to specialise the entity type PART??

Specialisation

Specialisation
How to specialise the entity type Staff?

Specialisation

Constraints

Constraints
❑ The Completeness Constraint describes whether an instance of a
supertype must also be an instance of at least one subtype.
❑ The Disjointness Constraint describes whether an instance of a supertype may simultaneously be a member of two (or more) subtypes.

Constraints
 A staff must be either an academic staff or admin staff (total specialisation rule): double line.
 An academic staff may also be an admin staff (overlap rule): o.

Constraints
Common sense tells us:
 A vehicle may be a car or truck or something else (partial specialisation): single line.
 A car must not (CANNOT) a be truck (disjoint rule): d.

Constraints
▪A part must be purchased or manufactured (total specialisation rule): double line.
▪A manufactured part may also be a purchased part (overlap rule): o.

Completeness Constraint
❑ Specifies whether each supertype occurrence must also be a member of at least one subtype
• Partial completeness: Not every supertype occurrence is a member of a
VEHICLE – Car, Truck or something else such as Bus (which is not listed out)
• Total completeness: Every supertype occurrence must be a member of any
STAFF – Academic Staff & Admin Staff

Disjoint and Overlapping Constraints
❑ Disjoint subtypes: Contain a unique subset of the supertype entity
• Known as nonoverlapping subtypes
• Implementation is based on the value of the subtype discriminator attribute in the supertype
❑ Overlapping subtypes: Contain nonunique subsets of the
VEHICLE – Car vs Truck
supertype entity set
STAFF – Academic Staff & Admin Staff
• Implementation requires the use of one discriminator attribute for each subtype

Subtype Discriminator(s)
 Subtype discriminator(s) are the attribute(s) of the supertype that determine (code, note, identify) the target subtype.
 Disjoint Constraint Rule: One attribute.
 Overlapping Constraint Rule: Composite attribute/several attributes.
A simple attribute (Vehicle_Type) with different possible values indicates the subtype (disjoint rule).
Vehicle_Type
The VEHICLE is a CAR.
The VEHICLE is a TRUCK.
The VEHICLE is neither a CAR nor a TRUCK.

Acomposite attribute (Staff_Type) with sub- attributes (with “Yes”/“No” values) indicates the subtype (overlap rule).
Staff_Type
Academic Staff
Admin Staff
The Staff is a member of the Academic Staff subtype.
The Staff is a member of the Admin Staff subtype.
The Staff is both an Academic Staff and an Admin Staff.
How about No / No?

Specialisation Hierarchy Constraint Scenarios

A simple attribute (Employee_Type) with different possible values indicates the subtype (disjoint rule).
Can the Empolyee_Type be null?

ER Modelling Guideline
❑ The data items should be put into an entity (logical group).
❑ For each entity, there should be a Primary key that uniquely identifies individual members of entity type.
❑ There should be no redundant data in the model.
❑Ask yourself the following questions:
• What are the relevant entities here?
• What are the relevant relationships here?
• Can I generalise some entities?
❑Document your assumptions as you go.
❑Leave connectivity and cardinalities until the end.

Source: canningtonvet.com.au

Public Holiday Arrangement in Week 3 ❑No lecture on Queen’s Birthday 13 June (Monday)!
❑ A lecture recording of Week 3 will be uploaded on 14 June by 12 pm.
❑Tutorials will go as usual!!

Draw an ER diagram for this situation (state any assumptions that you make). Based on the ER diagram, draw the relevant relational model.
• The firm has a number of sales offices in several states. Attributes of sales office include
Office_number (identifier) and Location.
• Each sales office is assigned one or more employees. Attributes of employee include Employee_ID
(identifier) and Employee_Name. An employee must be assigned one only one sales office.
• For each sales office, there is always one employee assigned to manage that office. An employee
may manage only the sales office to which he or she is assigned.
• The firm lists property for sale. Attributes of property include Property_ID (identifier) and Location.
Components of Location include Address, City, State, and Zip_Code.
• Each unit of property must be listed with one (and only one) of the sales offices. A sales office may
have any number of properties listed or may have no properties listed.
• Each unit property has one or more owners. Attributes of owners are Owner_ID (identifier) and
Owner_Name. An owner may own one or more units of property. An attribute of the relationship between property and owner is Percent_Owned.

程序代写 CS代考 加微信: cscodehelp QQ: 2235208643 Email: kyit630461@163.com

CS代考 IEEE 802.15 projects, Bluetooth Special Interest Group (SIG), Bluetooth Ver – cscodehelp代写

Bluetooth Classic
Bluetooth Low Energy (BLE) BLE Advanced
Bluetooth 4 Bluetooth 5

Copyright By cscodehelp代写 加微信 cscodehelp

1. Bluetooth History: Wireless Personal Area Networks (WPANs) and IEEE 802.15 projects, Bluetooth Special Interest Group (SIG), Bluetooth Versions
2. Bluetooth Markets and Applications
3. Bluetooth Classic: Network Topology, Channel Structure, Modulation and Data Rates, Frequency Hopping, Packet Format, Operating States, Power Saving, Protocol Stack, Application Profiles
4. Bluetooth Low Energy (BLE): Channel Structure, Frequency Hopping, PHY, MAC
5. Bluetooth 5: PHY, Advertising, and Frequency Hopping Extensions

Wireless Personal Area Networks (WPANs)
q 10m or less 802.16e
Wide Area Network (WAN)
802.20 802.21 802.22 2G, 2.5G, 3G
Mobile Handoff WRAN Metropolitan Area Network (MAN)
802.16/WiMAX Fixed Wireless MAN
Local Area Network (LAN) 802.11 Wi-Fi
Personal Area Network (PAN)
802.15.1 802.15.4 802.15.6 Bluetooth ZigBee Body Area Networks

WPAN: Design Challenges
q Battery powered: Maximize battery life. A few hours to a few years on a coin cell.
q Dynamic topologies: Short duration connections and then device is turned off or goes to sleep
q No infrastructure: No access point or base station
q Avoid Interference due to larger powered LAN devices
q Simple and Extreme Interoperability: Billions of devices. More variety than LAN or MAN
q Low-cost: A few dollars

IEEE 802.15 Projects
q IEEE 802.15.1-2005: Bluetooth 1.2
q IEEE 802.15.4-2011: Low Rate (250kbps) WPAN – ZigBee
q IEEE 802.15.4f-2012: PHY for Active RFID
q IEEE 802.15.6-2012: Body Area Networking. Medical and entertainment. Low power
q IEEE 802.15.7-2011: Visible Light Communications

Bluetooth SIGàIEEE 802.15.1àBluetooth SIG q Started with Ericsson’s Bluetooth Project in 1994 for radio-
communication between cell phones over short distances
q Named after Danish king ̊tand (=Bluetooth) (AD 940-981) who was fond of blueberries
q Intel, IBM, Nokia, Toshiba, and Ericsson formed Bluetooth SIG in May 1998
q Version 1.0A of the specification came out in late 1999.
q IEEE 802.15.1 approved in early 2002 is based on Bluetooth
Later versions handled by Bluetooth SIG directly
q Key Features:
Ø Lower Power: 10 mA in standby, 50 mA while transmitting Ø Cheap: $5 per device
Ø Small: 9 mm2 single chips

Example of a Bluetooth Chipset

Bluetooth Versions
q Bluetooth 1.1: IEEE 802.15.1-2002
q Bluetooth 1.2: IEEE 802.15.1-2005. Adaptive frequency hopping
(avoid frequencies with interference).
q Bluetooth 2.0 + Enhanced Data Rate (EDR) (Nov 2004): 3 Mbps using DPSK. For video applications. Reduced power due to reduced duty cycle
q Bluetooth 4.0 (June 2010): Low energy. Smaller devices requiring longer battery life (several years). New incompatible PHY. Bluetooth Smart or BLE
q Bluetooth 5.0 (December 2016): Make BLE go faster and further.

The Rise of Bluetooth
Source: Bluetooth SIG

The Bluetooth Impact

Bluetooth Classic

Bluetooth Network Topology: Piconet
master slave
scatternet
q Piconet is formed by a master and many slaves (typically 1) Ø Up to 7 active slaves. Slaves can only transmit when requested
Ø Up to 255 parked slaves
q Active slaves are polled by master for transmission
q Any device can become a master (initiator becomes master)
q Each station gets an 8-bit parked address Þ 255 parked slaves/piconet
q A parked station can join in 2ms. Other stations can join in more time.
q Slaves can only transmit/receive to/from master. Slaves cannot talk to another slave in the piconet
q Scatter net: A device can participate in multiple Pico nets Þ Timeshare and must synchronize to the master of the current piconet. Active in one piconet, parked in another.
q Routing protocol not defined (a node can only talk to another node if within Bluetooth range of 10m)
Ref: P. Bhagwat, “Bluetooth Technology for short range wireless Apps,” IEEE Internet Computing, May-June 2001, pp. 96-103, ©2020

Bluetooth Operating Spectrum

Bluetooth Channels
fc =(2402+k)MHz; k=0,1,…,78
k: channel index (79 1-MHz wide channels)

Modulation and Data Rate
q Basic rate (BR):
Ø Binary Gaussian FSK (GFSK): 1 bit/symbol Ø Symbol duration = 1 μs: 1 Msps
Ø Data rate: 1 Mbps
q Enhanced data rate (EDR):
Ø Symbol duration is still 1 μs (1 Msps), but Ø μ/4-DQPSK; 2 bits/symbol; 2 Mbps
Ø 8DPSK: 3 bits/symbol; 3 Mbps
Time Time FSK GFSK

Frequency Hopping (1)
q Unlike WiFi, Bluetooth constantly switches channel within the same connection to avoid collisions with other nearby Bluetooth communications
q No two packets are transmitted on the same channel/frequency, but frequency is never switched in the middle of a packet transmission
q Such frequency switching is known as frequency hopping BT 1

Frequency Hopping (2)
q Bluetooth connections are slotted: packet transmission can start only at the beginning of a time slot
q 625 μs slots using a 312.5 μs (3200Hz) clock (1 slot = 2 clock ticks) q Time-division duplex (TDD)
Þ Downstream (master-to-slave) and upstream (slave-to-master) alternate q Master starts in even numbered slots only.
q Slaves start in odd numbered slots only
q Slaves can transmit right after receiving a packet from master
q Packets = 1 slot, 3 slot, or 5 slots long
q Enables master to start in even and slave in odd slots
q The frequency hop is skipped during a packet; frequency is hopped only at slot boundaries; at the beginning of the next slot after packet transmission/reception is complete; packet lengths may not align with slot boundaries

Frequency Hopping Illustrated
M=master, S = slave

Frequency Hopping Rate
1 frequency hop per packet: a packet can be 1,3, or 5 slot long (no hop in the middle of the packet); maximum FH rate = 1600Hz, minimum FH rate = 320Hz

q Consider a Bluetooth link where the master always transmits 3-slot packets. The transmission from the master is always followed up by a single-slot transmission from a slave. Assuming 625 μs slots, what is the effective frequency hopping rate (# of hopping per second)?
Answer: Given that frequency hopping cannot occur in the middle of a packet transmission, we only have 2 hops per 4 slots, or 1 hop per 2 slots.
The effective hopping rate = 1/(2x625x10-6) = 800 hops/s = 800Hz

Bluetooth Packet Format:
Basic Rate (BR)
q Packets can be up to five slots long. 5 slots =625×5=3125 μs.
Ø Maximum packet size = 72+54+2745 = 2871 μs Ø Some residual slot-time cannot be used (2871 < 3125) q Access codes: Ø Channel access code identifies the piconet Ø Device access code for paging requests and response Ø Inquiry access code to discover units q Header: member address (3b)+type code (4b)+flow control (1b)+ack/nack (1b)+sequence number (1b)+header error check (8b)=18b, which is encoded using 1/3 rate FEC resulting in 54b q How many slots are needed to transmit a Bluetooth Basic Rate packet if the payload is (a) 400 bits, (b) 512 bits, and (c) 2400 bits. Assume that the non- payload portions do not change. Ø Bluetooth transmissions are 1, 3, or 5 slots (2, 4, 6, etc. not allowed) Ø Non-payload bits (max) = 54+72 = 126 bits Ø Each slot can carry 625 bits at most Ø (a) 400b payloadà400+126 = 526b packetà1 slot Ø (b) 512b payloadà512+126 = 638b packetà2 slots would be sufficient, but will have to be padded for a 3-slot transmission (2-slot packets not allowed) Ø (c) 2400b payloadà2400+126 = 2526b packetà5 slots ©2020 Bluetooth Packet Format: Enhanced Data Rate (EDR) q Modulation changes within the packet; facilitated by a guard interval lasting between 4.75 μs and 5.25 μs q GFSK for Access Code and Header q μ/4-DQPSK (2Mbps) or 8DPSK (3Mbps) after guard interval q EDR payload can accommodate more data than BR, but still fits within maximum 5-slot due to higher data rates Bluetooth Address Format q The Bluetooth device address is a unique 48-bit address sent in the access code field of the packet header. q The first (most significant) 24 bits represent the OUI (Organization Unique Identifier) or the Company ID q The main purpose of the Bluetooth address is for identification and authentication, but q The address is also used to seed the frequency hopping pseudorandom generator, to synchronize master and slave clocks, and to pair devices. 000666 = Roving Networks Frequency Hopping with Pseudorandom Number Generator q In Bluetooth Classic, FH is defined by a pseudorandom generating algorithm seeded with the following values Ø UAP and LAP of the master device address, and Ø Bits 1-26 of the 28-bit Bluetooth clock q The pseudorandom pattern would repeat itself after 227 hops Ø Would take 23.3 to repeat! Ø In practice the pseudorandom sequence is never repeated Bluetooth is both Time and Frequency Synchronised Illustration of Pseudorandom FH Collision with : fixed (non adaptive) hopping Collision Avoidance via • Mark interfering channels as bad channels • Avoid bad channels; hop between good channels only • Minimum available (good) channels to hop = 20 (max. 79-20=59 channels can be marked as bad) • AFH available only during Connected state (i.e., when two devices are exchanging data) Adaptive FH (AFH) AFH Illustration: hopping only between good channels Channel assessment: RSSI/SNR, PER (left to chipset vendor; not specifid in standard) q Black: used (by another piconet) q White: available (good to use) q Yellow: Bad Channel Map Master updates the map dynamically and sends it to slaves Bluetooth Operational States Disconnected Connecting Active Low Power Inquiry Transmit Page Connected Sniff Hold q 8 distinct states grouped under 4 high-level states q Standby: Initial state q Inquiry: Master broadcasts an inquiry packet. Slaves scan for inquiries and respond with their address and clock after a random delay (CSMA/CA) Bluetooth Operational States (Cont) q Page: Master in page state invites a slave device to join the piconet. Slave enters page response state and sends page response to the master. q Master informs slave about its clock and address so that slave can participate in piconet. q Connected: A short 3-bit logical address (member address within control header field) is assigned for the slave q Transmit: station is transmitting or receiving a packet Standby Inquiry Transmit Park Page Connected Bluetooth Connection Establishment Procedure Inquiry and Paging Flow Diagram IAC = inquiry access code FHS = frequency hopping synchronization Connection Established Master (initiator) Slave (remote device) Inquiry Response (ADDR, CLK) Page Response Inquiry Broadcast (IAC) FHS (ADDR, CLK) POLL (3-bit ADDR) Bluetooth Connection Establishment Procedure Inquiry and Paging Frequency Hopping q Inquiry/page hopping sequence Ø Hop over 32 subset of 79 channels/frequencies (to speedup) Ø 32 is divided into two 16-channel trains Ø For inquiry, each train is repeated 256 times before switching to the other train; must have 3 train switches (1st à 2nd à 1st à 2nd): each train effectively repeated 256 x 2 times Ø Master sends two inquiry/page packets using 2 different frequencies per slot (hops in the middle of the slot; hops frequency in 312.5μs!), and listens for responses (both frequencies) in the following slots (to speed up)àeventually 2 frequencies covered in 2 slots q Connection establish time Ø 16 x 625 μs = 10 ms for completing a train once Ø Inquiry time (maximum) = 256 x 4 x 10 ms = 10.24 s Ø There is an additional paging time Power Saving Modes in Bluetooth Three inactive (power-saving) states: 1. Hold: Go inactive for a single short period and become active after that 2. Sniff: Low-power mode. Slave listens periodically after fixed sniff intervals. 3. Park: Very Low-power mode. Gives up its 3-bit active member address and gets an 8-bit parked member address. Wake up periodically and listen to beacons. Master broadcasts a train of beacons periodically Bluetooth Protocol Stack Application Middleware q RF: Gaussian Frequency Shift Keying (GFSK) modulation q Baseband: Frequency hop selection, connection, MAC Time Time FSK GFSK Applications (Profiles) Host Controller Interface Link Manager Baseband Layer q Each device has a 48-bit IEEE MAC address q 3 parts: Ø Lower address part (LAP) – 24 bits Ø Upper address part (UAP) – 8 bits Ø Non-significant address part (NAP) - 16 bits q UAP+NAP = Organizationally Unique Identifier (OUI) from IEEE q LAP is used in identifying the piconet and other operations q Clock runs at 3200 cycles/sec or 312.5 μs (twice the hop rate) 8b 16b 24b Upper Address Part Non-sig. Address Part Lower Address Part Bluetooth Protocol Stack (Cont) q Link Manager: Negotiate parameters, Set up connections q Logical Link Control and Adaptation Protocol (L2CAP): Ø Protocol multiplexing Ø Segmentation and reassembly Ø Controls peak bandwidth, latency, and delay variation q Host Controller Interface: Chip independent interface to Bluetooth chip. Allows same software to run on all chips. q RFCOMM Layer: Presents a virtual serial port Ø Sets up a connection to another RFCOMM q Service Discovery Protocol (SDP): Devices can discover the services offered and their parameters Ø E.g., Bluetooth keyboard, Ø Bluetooth mouse Ø Bluetooth headset Applications (Profiles) Host Controller Interface Link Manager Bluetooth Protocol Stack (Cont) q Bluetooth Network Encapsulation Protocol (BNEP): To transport Ethernet/IP packets over Bluetooth q IrDA Interoperability protocols: Allow existing IrDA applications to work w/o changes. IrDA object Exchange (IrOBEX) and Infrared Mobile Communication (IrMC) for synchronization q Audio is carried over 64 kbps over SCO links over baseband q Telephony control specification binary (TCS-BIN): Call control including group management (multiple extensions, call forwarding, and group calls) Ø Telephony has both audio and control Ø Bluetooth telephone very popular in cars q Application Profiles: Set of algorithms, options, and parameters Ø To support specific applications ©2020 Applications (Profiles) Host Controller Interface Link Manager Application Profile Examples q Headset Profile q Global Navigation Satellite System Profile q Hands-Free Profile q Phone Book Access Profile q SIM Access Profile q Synchronization Profile q Video Distribution Profile q Blood Pressure Profile q Cycling Power Profile q Find Me Profile q Heart Rate Profile q Basic Printing Profile q Dial-Up Networking Profile q File Transfer Profile With IoT, the list is expected to grow rapidly over the coming years Ref: Bluetooth SIGn, “Adopted Bluetooth Profiles, Services, Protocols and Transports,” https://www.bluetooth.org/en-us/specification/adopted-specifications Connecting a wireless keyboard with HID Bluetooth profile Bluetooth Low Energy (BLE) Bluetooth 4 Bluetooth LE or BLE q Low Energy: 1% to 50% of Bluetooth classic q For short broadcast: Your body temperature, Heart rate, Wearables, sensors, automotive, industrial. Not for voice/video, file transfers, ... q Small messages: 1Mbps data rate but throughput not critical. q Battery life: In years from coin cells q Simple: Star topology. No scatter nets, mesh, ... q Lower cost than Bluetooth classic q New protocol design based on Nokia’s WiBree technology Shares the same 2.4GHz radio as Bluetooth Þ Dual mode chips q Most smartphones (iPhone, Android, ...) have dual-mode chips ©2020 BLE Channels q 40 2MHz-wide channels: 3 (37,38,39) for advertising and 37 (0-36) for data q Advertising channels specially selected to avoid interference with popular default WiFi channels (1,6,11) BLE Advertising Channels Avoiding Popular BLE Modulation and Data rate q Binary GFSK over 2MHz channel: More significant frequency separations for ‘0’ and ‘1’ allows longer range with low power Ø Note that with Bluetooth Classic, channel bandwidth is only 1MHz, so frequency separations are smaller q 1 million symbols per secondà1 Mbps data rate Benefit of Advertising Channels q BLE simplifies discovery and broadcasting by using only three advertising channels (instead of 32 channels for inquiry/paging in BT Classic) q A BLE device can broadcast advertising beacons on these 3 channels giving information about the device, so other devices can connect, but can also broadcast some sensor data q Data channels are used to exchange data bidirectionally between two devices Connection Events and Connection Intervals q In BLE connections, devices wake up periodically after every connection interval (CI) time; transmit some data (connection event) and then go back to sleep until the next connection event q Send a short blank packet if no data to send during a connection event q More than one packet can be sent during a connection event q Connection interval time can vary from 7.5ms to 4s and is negotiated during connection set up q Hop frequency (switch to different data channel) at each event ... fk+n Sleep Sleep Time Data Transfer BLE Frequency Hopping Algorithm Ø Where h (hop increment) is a fixed value negotiated during connection setup Ø Note: Data channels range from 0-36 q Example hopping sequence for h=10: 0à10à20à30à3à13 q Adaptive FH: If the hopping lands on a bad channel, the channel is remapped to a good channel using a channel remapping algorithm q Fixed hopping instead of pseudorandom qfk+1=(fk +h)mod37 Algorithm #1 Bluetooth Smart Protocol Stack Applications Generic Access Profile Generic Attribute Profile Attribute Protocol Security Manager Logical Link Control and Adaptation Protocol Host Controller Interface Link Layer Direct Test Mode Physical Layer Controller Generic Attribute (GATT) Profile q Defines data formats and interfaces with the Attribute Protocol Ø Define attributes instead of applications (a major difference from Bluetooth Classic); temperature, pressure, heart rates are examples of attributes Ø New applications can be supported by using appropriate attributes q Type-Length-Value (TLV) encoding is used q Each attribute has a 16-bit Universally Unique ID (UUID) standardized by Bluetooth SIG Ø 216=65 thousand unique attributes can be defined! q 128-bit UUID if assigned by a manufacturer Ø Manufacturers can define their own attributes and still interoperate q Allows any 程序代写 CS代考 加微信: cscodehelp QQ: 2235208643 Email: kyit630461@163.com

留学生代考 HAX2017]. The preamble, which uses a series of upchirps followed by a few – cscodehelp代写

Chapter 11
LoRa and LoRaWAN
Pervasive IoT deployments demand low-power wide area networking (LPWAN) solutions that can connect hundreds of thousands of sensors and ‘things’ over a large area with minimal infrastructure cost. The low-power solution is needed to ensure that the battery-powered sensors can last for many years with a tiny battery. While Bluetooth is certainly low-powered, it works only for short ranges. Cellular networks are designed for wide area coverage, but they consume too much power which requires large batteries and frequent battery recharging for the end nodes. Consequently, there is a significant momentum in standardizing new networking solutions for LPWAN. New developments are emerging from both cellular and WiFi standard bodies, i.e., from the 3GPP and IEEE/WiFi-alliance, respectively, to fill this gap, but there is a third momentum that is proving very successful. It is called LoRa Alliance (LoRa stands for long range), which is a industry alliance committed to accelerate the development and deployment of LPWAN networks. In this chapter, we shall study the details of the LoRa technology.
LoRa is a proprietary and patented PHY technology originally developed by a small company called Cycleo in France [SEMTECH-BLOG]. Later it was acquired by Semtech corporation, which formed the LoRa Alliance [LORA-ALLIANCE]. Now LoRa Alliance has 500+ members. The first version was LoRa was released to public in July 2015. Since then it enjoyed rapid adoption with many different types of products selling fast. For long range IoT, this is at the moment the major choice in the market currently implemented in over 100 million devices.

Copyright By cscodehelp代写 加微信 cscodehelp

The main advantage of LoRa is the support for extremely long-range connectivity. It supports communications up to five kilometers in urban areas depending on how deep within indoor the sensors are located, and up to 15 kilometers or more in rural areas with line of sight [LORA-SEMTECH]. Such long distances are supported with extremely low power and low cost. These advantages are gained by trading off the data rate. LoRa supports very low rates, on the order of only a few kbps. However, these rates are sufficient for the targeted IoT applications which only need to upload a small message once in a while.
11.2 LoRa frequencies
Like 802.11ah, LoRa also uses sub-GHz ISM license-exempt bands to reach long distances at low power. Different regions have different restrictions on the use of LoRa frequencies. The following bands are specified in LoRa developers guide from SEMTECH [LORA-SEMTECH]:
© 2022 [Wireless and Mobile Networking, CRC Press 2022] 1

• 915 MHz MHz in US. Power limit. No duty cycle limit.
• 868/433 MHz in Europe. 1% and 10% duty cycle limit
• 430 MHz in Asia
Note that there is a power limit in the US, but no duty cycle. It means devices can be awake all the time and transmit as often as they like. However, in Europe, devices have to implement 10% duty cycle, which means they can be up only 10% of the time on average. Limiting the duty cycle enables more devices to be connected to the LoRa network with minimum infrastructure at the expense of slightly higher latency.
LoRa uses channels with significantly smaller bandwidth compared to Bluetooth, WiFi, or cellular networks. Specifically, LoRa channels are either 125kHz or 500kHz wide [LORA-SEMTECH]. For example, in the US, 125kHz channels can be used only for the uplink (end device to gateway) whereas 500kHz can be used for both uplink and downlink.
11.3 LoRa modulation: chirp spread spectrum
Supporting long range communication with low power is challenging because the receiver will be required to demodulate a signal that can be very weak and even below the noise floor, i.e., demodulation with negative signal-to-noise ratio (SNR) would be required. To achieve this objective, LoRa adopts a specific form of chirp spread spectrum that spreads the signal power to all frequencies over the entire channel bandwidth by continuously increasing or decreasing the frequency during the symbol transmission. This which allows the receiver to combine samples from many frequencies to reconstruct the signal despite low signal power. The chirp phenomenon with linear frequency increasing or decreasing rates is illustrated in Figure 11.1.
Figure 11.1 Frequency domain representation of a linearly increasing chirp symbol. The power is spread over the entire channel bandwidth and the received signal power is below the noise floor.
Chirps with increasing frequency are called up-chirps and the ones with decreasing frequency are called down-chirps. In time-frequency graphs, these up-chirps and down-chirps are shown as straight lines with positive and negative slopes, respectively, as shown in Figure 11.2.
Symbol Duration
Frequency Bandwidth
Received Signal
© 2022 [Wireless and Mobile Networking, CRC Press 2022] 2

Frequency fmax fmax
fmin fmin Sweep Duration Time
Down-chirp
Sweep Duration Time
Figure 11.2 Up-chirps and down-chirps.
As we can see in Figure 11.2, the chirps sweep the entire bandwidth, from the minimum frequency to the maximum frequency, within a specified chirp sweep duration. The sweeping speed, k, is thus obtained as:
𝑘 = 𝐵 𝐻𝑧/𝑠𝑒𝑐 (11.1)
Where B is the bandwidth in Hz and TS is the chirp sweeping duration in second.
So, how does LoRa encode information with chirps? Clearly, these chirps need to be modulated in some ways to convey data. In LoRa, data bits are encoded with either up-chirps or down-chirps depending on the direction of communication, i.e., uplink vs. downlink. Each chirp represents one symbol, which means that the symbol duration is equivalent to the chirp duration, TS.
LoRa shifts the starting frequency of the chirp to produce different symbol patterns [LORA-SYMBOL]. The amount of frequency shift is then used to code the symbol, which represents the data bits carried by that symbol. Figure 11.3 illustrates an example of 4-ary modulation that uses 4 possible frequency shifts, including zero shift, to create 4 different symbol patterns. Note that for the non-zero shifts, the chirp is `broken’ into two pieces because it reaches the maximum (for upchirp) or minimum (for downchirp) frequency sooner than the symbol duration. The second piece of the chirp then starts from the minimum (for upchirp) or maximum (for downchirp) frequency and continues the frequency sweep until the end of the symbol duration.
Example 11.1
A LoRa transmitter configured with SF=8 can send how many bits per symbol? Solution:
8 bits. SF=8 means there are 28 different symbol patterns, thus each symbol can be coded with an 8-bit pattern.
© 2022 [Wireless and Mobile Networking, CRC Press 2022] 3

A striking difference between LoRa and the conventional wireless networks is that the symbol duration in LoRa is not fixed but is a function of the modulation order. The larger the modulation order, the longer the symbol duration, and vice versa. Both the modulation order and the symbol duration are controlled by the parameter called, spreading factor (SF). For M-ary modulation, SF=log2(M) and Ts=2SF/B seconds, where B is in Hz. This means that by increasing SF by 1 would not only double the modulation order (increase bits per symbol by 1), but also double the symbol duration. The relationship between SF, modulation order, and the symbol duration is illustrated in Figure 11.4 for upchirps.
Example 11.2
A LoRa transmitter configured with SF=10 would take how long to transmit one symbol over a 125kHz channel?
Ts = 2SF/B = 210/125 ms = 8.192 ms
LoRa increases the symbol duration to increase the communication range, as longer symbols help decode the signal at the receiver despite weak receptions. Hence SF is adaptively adjusted based on the received signal strength. By choosing to exponentially increase both the modulation order and the symbol duration, LoRa seeks to achieve orthogonality between signals of different SF. Thus, two signals from two transmitters would not interfere or collide at the receiver even if they are transmitted on the same channel at the same time if they use different SFs [LORA- SEMTECH].
00 01 10 11
(a) Upchirps
00 01 10 11
(b) Downchirps
Figure 11.3 LoRa symbol patterns for 4-ary modulation.
© 2022 [Wireless and Mobile Networking, CRC Press 2022] 4

A major consequence of exponentially increasing the symbol duration with increase in SF is that the symbol rate, i.e., the number of symbols per second, is reduced exponentially as well. This means that instead of increasing the data rate with increasing modulation order, the data rate is actually reduced with increasing SF. This can be clearly seen in the following universal equation that derives data rate as a function of the modulation rate (bits per symbol), symbol rate, and the coding rate (CR) that reflects the forward error correction (FEC) overhead:
𝐷𝑎𝑡𝑎 𝑟𝑎𝑡𝑒 = 𝑏𝑖𝑡𝑠 𝑝𝑒𝑟 𝑠𝑦𝑚𝑏𝑜𝑙 𝑥 𝑠𝑦𝑚𝑏𝑜𝑙 𝑟𝑎𝑡𝑒 𝑥 𝑐𝑜𝑑𝑖𝑛𝑔 𝑟𝑎𝑡𝑒
= 𝑆𝐹𝑥 𝐵 𝑥𝐶𝑅𝑏𝑝𝑠. (11.2) 2″#
Where B is in Hz and CR is the FEC ratio between actual data bits and the total encoded bits. In LoRa, CR can technically take values from 4/5, 4/6, 4/7, and 4/8, although the default value of 4/5 is often used. As can be seen from Eq. (11.2), data rate would be reduced nearly exponentially by increasing the SF. Thus, SF is the main control knob used by LoRa to trade-off between data rate and range. A total of six spreading factors, SF=7 to SF=12, are supported by LoRa [LORA-SEMTECH].
Example 11.3
A LoRa sensor is allocated a 125kHz uplink channel. What would be its effective data rate if it is forced to use a spreading factor of 10 and 50% redundancy for forward error correction?
SF=10; 2SF=1024; CR=0.5
Symbol rate = B/2SF sym/s = 125,000/1024 sym/s Effective data rate = 10 x 125000/1024 x 0.5 = ~610 bps
© 2022 [Wireless and Mobile Networking, CRC Press 2022] 5

4-ary modulation
902.125 MHz
2SF/B = 32μs
2SF/B = 64μs
8-ary modulation
Figure 11.4 Relationship between SF, modulation order, and symbol duration.
Energy is another important parameter affected by the choice of SF. For a given message, the total energy consumed is proportional to the airtime of the message, i.e., the amount of time the LoRa module needs to be active and consume power. The higher the data rate, the shorter is the airtime, and vice-versa. Thus, shorter SF would reduce the energy consumption, and vice versa. That is why LoRa implements adaptive data rate (ADR), which tries to select the minimum possible SF. For example, devices closer to the gateway would be using shorter SF (due to good quality link) and enjoy longer battery life compared to the ones located further from the gateway.
11.4 LoRa networking with LoRaWAN
LoRa actually refers to only the PHY layer of the LoRa network protocol stack as shown in Figure 11.5. The PHY is available for all frequency bands available in different regions of the world. The MAC layer is called LoRaWAN, which is an open standard. The MAC supports connecting LoRa end devices to the LoRa gateways, which in turn are connected to the network servers in the backbone. The end-to-end LoRa network system is illustrated in Figure 11.6.
Figure 11.5 LoRa network protocol stack
Application
868/433 (EU) 915 (US) 430 (AS)
Class A (basic) Class B (beacon) Class C (continuous)
MAC (LoRaWAN)
PHY (LoRa)
© 2022 [Wireless and Mobile Networking, CRC Press 2022] 6

The gateways are like the base stations in cellular networks. Many gateways are controlled by a central network server. However, unlike cellular networks, LoRa end devices do not associate with a single gateway; instead all gateways within range receive and process the messages transmitted by all end devices. The gateways work only at the PHY layer. They only check data integrity if CRC is present. The message is dropped if CRC is incorrect. They pass the LoRa message to the network server only if the CRC is correct along with some metadata such as received signal strength (RSSI) and timestamp. The network server actually runs the MAC and makes all networking decisions. It assigns each device a frequency, spreading code, eliminates duplicate receptions, and schedules acknowledgements. If requested by the end device, the network server also implements the adaptive data rate (ADR) for that device by dynamically controlling its transmitters parameters such as its SF, bandwidth, and transmit power.
LoRa supports scalable and flexible deployment of networks by provisioning for cost- optimized gateways. For small networks, very simple gateways made from can be used with limited number of channels. For carrier-grade networks run by city municipalities, more heavy-duty gateways with large number of channels (up to 64 channels in the US) can be used, which can be deployed on the rooftop of high-rise buildings, cellular towers, etc.
LoRa supports bidirectional communications. This allows the sensors (LoRa end devices) to upload data to the server and the server to send acknowledgements or update software/firmware on the sensors. Gateways listen to multiple transmissions on multiple channel and all gateway listen to all transmissions, which provides antenna diversity and improved reliability for the simple aloha protocol. For example, if one gateway could not receive it because of collision, another gateway may receive it and forward it to the server. The server selects one gateway for the downlink ACK to the device.
Figure 11.6 End-to-end LoRa network system [LORA-SEMTECH].
LoRa frame format is shown in Figure 11.7 [HAX2017]. The preamble, which uses a series of upchirps followed by a few downchirps, is used to synchronize the
Join Server
Network Server Application Server
End devices (sensors/actuators) Gateways
© 2022 [Wireless and Mobile Networking, CRC Press 2022] 7

transmitter and receiver clocks. An optional header is used before the payload to automate the configuration of several important parameters, namely the payload length, coding rate, and the use of CRC. When the header is not used (to save transmission energy), these parameters must be configured manually before the start of the session. Finally, the payload is optionally followed by a CRC field to detect errors in the payload.
Figure 11.7 Lora packet format.
Application servers are ultimately responsible for processing and interpreting the received LoRa payload data. They also generate the appropriate payload for the downlink messages.
Join servers are used to facilitate over-the-air activation of LoRa end devices. A join server contains the necessary to process an uplink join-request message from an end device and a downlink join-accept message. It also informs the network server about the application server a particular end-device should be connected to. Thus, with join servers in place, users can connect their LoRa sensors and actuators by simply turning them on.
11.5 LoRa device classes
LoRaWAN supports three classes of devices, A, B, and C [LORA-SEMTECH. Class A is the most basic mode of operation, which must be supported by any device. Class B devices must also support Class A option. Finally, Class C devices must have the option to operate in either of the three classes. Let us have a look at the operational features of each of these classes.
Class A: These are the lowest power and lowest traffic LoRa devices mostly sleeping and waking up once in a while to transmit data if a monitoring event is detected. For each uplink (end device to gateway) transmission, the device will be allowed to receive up to two 2 short downlink (gateway to end device) transmissions. One may be for ACK, but another can be used for other kind of information, such as an actuation signal triggered by the application based on the uplink information. Example of these devices include various environmental sensors and monitors with limited actuation capabilities.
The device cannot receive anything else until it transmits again. When it does, again it gets two credits for downlink communication. This cycle repeats. Class A devices are very simple and they use Pure Aloha for channel access, which is basically contention-based. Pure Aloha performs well under light traffic, but will struggle under heavy load. Its performance under sustained heavy load approaches 1/2e or approximately 18.4%.
Payload Length
CRC Present
© 2022 [Wireless and Mobile Networking, CRC Press 2022] 8

Class B: This is basically Class A plus extra receive window at scheduled time following the periodic beacons from Gateway. That is the beacon contains reserved slots for the stations. This class is for stations which need to receive more frequent traffic from the network or server. All gateways transmit beacons every 2n seconds (n=0..7), which provides plenty of opportunity for the network to synchronize with Class B end devices. All gateways are synchronized using GPS so they all can align to the exact beacon timing.
Class C: These are the most powerful stations typically connected to mains power and almost always awake. They can receive anytime, unless transmitting. As such, the server enjoys the lowest latency in reaching a Class C device compared to the other classes. Class C devices include things such as streetlights, electrical meters, etc., which can be constantly monitored and controlled by a server. Figure 11.8 illustrates and compares the operations of the three classes.
Random Fixed Fixed
Tx Rx Rx ClassA
Beacon Beacon Interval Interval
Tx Rx Tx Rx Tx ClassC Transmit at random intervals
Figure 11.8 Operations of Class A vs. Class B vs. Class C.
11.6 Chapter Summary
The main aspects of LoRa can be summarized as follows:
1. LoRa is designed to work with narrow bandwidth channels, long symbols, and low data rates; data rate is sacrificed for longer range.
2. LoRa modulation is a variation of chirp spread spectrum where the modulation order as well as the frequency sweeping speed of the chirp is modulated by an integer variable called spreading factor (SF).
3. For a given bandwidth B Hz and spreading factor SF, modulation order = 2SF and symbol duration = 2SF/B sec. As a result, contrary to typical wireless communications, increasing the modulation order actually decreases the data rate in LoRa.
4. For a given bandwidth, the larger the SF, the longer the symbol duration and longer the range at the expense of reduced data rates.
5. Orthogonality of the SF enables transmission of multiple LoRa chirps at the same frequency channel and at the same time slot.
© 2022 [Wireless and Mobile Networking, CRC Press 2022] 9

6. There are 6 valid SF values in LoRa: 7 to 12.
7. LoRa data contains either all upchirps or all downchirps depending on the
direction of communication (uplink vs. downlink); upchirps and downchirps
are never mixed within the same LoRa packet except for the preamble field.
8. LoRa end devices broadcast to all gateways within range. The gateway with
the best connectivity replies back.
9. LoRa gateways are only PHY-layer devices; all MAC processing is done at
the network server.
10. LoRa supports 3 classes of devices. Class A devices can sleep most of the time
to conserve energy but allow most restricted access from the network. Class B devices can be accessed more frequently by the network at the expense of higher energy consumption. Class C devices are usually powered by the mains; they never sleep and hence can be reached by the network at any time without delay.
References
[LORA-SEMTECH] “LoRa and LoRaWAN: A Technical Overview

程序代写 CS代考 加微信: cscodehelp QQ: 2235208643 Email: kyit630461@163.com

程序代写 IEEE 802.11a/b/g/n/ac/ax/be – cscodehelp代写

Wireless LAN II
Mainstream IEEE 802.11a/b/g/n/ac/ax/be

1. IEEE 802.11 Amendments

Copyright By cscodehelp代写 加微信 cscodehelp

2. 802.11a/b/g
3. 802.11e: Enhanced DCF, Multiple Queues, Frame Bursting
4. 802.11n [WiFi 4]: Bonding, Aggregation
5. 802.11ac [WiFi 5]: Beamforming, Multi-User MIMO
6. 802.11ax [WiFi 6]: High efficiency
7. 802.11be [WiFi 7]: Extremely high throughput

Mainstream 802.11 Amendments
802.11 Amendment
Key Enhancements
Max. Data Rate
802.11-1997
Legacy WiFi in 2.4GHz (now extinct!)
802.11b-1999
Higher speed modulation in 2.4GHz
802.11a-1999
Higher speed PHY (OFDM) in 5GHz
802.11g-2003
Higher speed PHY (OFDM) in 2.4GHz
802.11n-2009
Higher throughput in 2.4/5GHz
802.11ac-2013
Very high throughput in 5GHz
802.11ax-2020
High efficiency in 2.4/5GHz
802.11be-2024 (expected)
Extremely high throughput in 2.4/5/6GHz

IEEE 802.11b
q Direct Sequence Spread Spectrum:
Signal 01001011011011010010
q Complementary Code Keying (CCK):
Multi-bit symbols with appropriate code to minimize errors
q IEEE 802.11-1997: 1⁄2 rate binary convolution encoder, 2 bit/symbol, 11 chips/symbol, DQPSK = 1⁄2 ×22 × 1/11 × 2 = 2 Mb/s using 22 MHz
q IEEE 802.11b-1999: 1⁄2 rate binary convolution encoder, 8 bit/symbol, 8 chips/symbol, CCK = 1⁄2 ×22 × 1/8 × 8 = 11 Mb/s using 22 MHz
Ref: P. Roshan and J. Leary, “802.11 Wireless LAN Fundamentals,” Cisco Press, 2003, ISBN:1587050773, Safari book
Data Bits Time
Chips = Code bits Time

q A WLAN standard is employing a spread spectrum coding with only 1⁄2 rate, which produces chips at a rate of 1⁄2 chips per Hz. It uses 8 chips to code a symbol and 16 QAM modulation to modulate the symbol stream. What would be the data rate for 22 MHz channels?
Chip rate = 1⁄2 x 22 = 11 Mcps
Symbol rate = 11/8 = 1.375 Msps
Bits per symbol = log2(16) = 4 [16 QAM produces 4 bits per symbol] Data rate = 1.375 x 4 = 5.5 Mbps

IEEE802.11a
q To increase the data rate, 802.11a uses OFDM.
q 20 MHz divided into 64 subcarriers. 6 subcarriers at each side are used as
guards and 4 as pilot, which leaves 48 for data.
q Each OFDM symbol is carried over 48 subcarriers in parallel. q OFDM has a symbol length of 4 μsà0.25 M symbols/s
Ø 3200ns (data pulse) + 800ns (guard interval) = 4000ns = 4μs
q With a binary modulation (e.g., BPSK) , there will be 1 coded bit per subcarrier for each OFDM symbol, or 48 coded bits per OFDM symbol in total (over 48 subcarriers)
q Data rate depends on the combination of modulation and coding
q 802.11a supports 8 different data rates, 6 Mbps up to 54 Mbps, by selecting
a combination of modulation and coding
q 802.11a supports three coding rates, 1⁄2, 2/3, and 3⁄4 (the ratio indicates the ratio
of data bits over all coded bits transmitted).
Ø E.g., 1⁄2 indicates that only half of the total transmitted bits contain data.

IEEE802.11a
1999 Data Rates
Modulation
Coding Rate
Coded bits per subcarrier
Coded bits per symbol
Data bits per symbol
Data Rate (Mbps)

IEEE 802.11g
q OFDM – Same as 802.11a Þ 54 Mbps
q 2.4 GHz band Þ Cheaper than 5 GHz 802.11a q Fall back to 802.11b CCK

IEEE 802.11e
1. Hybrid Coordination Function (HCF) w two components
a. Contention Free Access: Polling
b. Contention-based Access: Enhanced DCF (EDCF)
1. Multiple Priority levels with multiple FIFO queues
2. Frame bursting and Group Acknowledge
3. Direct link
2005 (Enhanced QoS)

Enhanced DCF
q Up to 4 queues. Each Q gets a different set of four Parameters: Ø CWmin/CWmax
Ø Arbitrated Inter-Frame Spacing (AIFS) = DIFS
Ø Transmit Opportunity (TXOP) duration
q DIFS replaced by Arbitrated Inter-frame Spacing (AIFS)
Multiple Queues
Cwmin[2] Cwmax[2] AIFS[2] TXOP[2] BO[2]
Cwmin[3] Cwmax[3] AIFS[3] TXOP[3] BO[3]
Cwmin[4] Cwmax[4] AIFS[4] TXOP[4] BO[4]
Cwmin[1] Cwmax[1] AIFS[1] TXOP[1] BO[1]

q EDCF allows multiple frame transmission Ø Both individual and group ACK allowed
q Max time = Transmission Opportunity (TXOP) Ø Covers total time including multiple data frames
q Voice/gaming has high priority but small burst size q Video/audio has lower priority but large burst size
Frame Bursting

Direct Link in 802.11e
q Direct Link is another feature introduced by 802.11e
q Direct link allows two WiFi devices to communicate directly without going through
the AP, which reduces latency (great for delay-sensitive applications)

IEEE 802.11n
1. First WLAN to use MIMO (Multi-input Multi-Output)
2. MIMO (Multi-input Multi-Output) Multiplexing: n×m:k Þ n transmitters, m receivers, k streams k = degrees of freedom = min(n,m)
Þ k times more throughput
E.g., 2×2:2, 2×3:2, 3×2:2, 4×4:4, 8×4:4
3. MIMO Beamforming: Focus the beam directly on the target
antenna for increased coverage and signal strength
4. MIMO Power Save: Use multiple antennas only when needed

IEEE 802.11n
5. Frame Aggregation: Pack multiple input frames inside a frame Þ Less overhead Þ More throughput
6. Lower FEC Overhead: 5/6 instead of 3⁄4
7. Reduced Guard Interval: 400 ns instead of 800 ns
8. Reduced Inter-Frame Spacing (SIFS=2 μs, instead of 10 μs)
9. : Optionally eliminate support for a/b/g
(shorter and higher rate preamble)
10. Dual Band: 2.4 and 5 GHz
11. Space-Time Block Code
12. Channel Bonding: Use two adjacent 20 MHz channels
13. More subcarriers: 52+4 instead of 48+4 with 20 MHz, 108+6 with 40MHz
2009 (Cont)

Guard Interval
GI GI GI GI GI GI GI GI GI GI GI
q Rule of Thumb: Guard Interval = 4 × Multi-path delay spread q Initial 802.11a design assumed 200ns delay spread
Þ800 ns GI + 3200 ns data Þ20% overhead
q Most indoor environment have smaller 50-75 ns
q So if both sides agree, 400 ns can be used in 802.11n Þ400 ns GI + 3200 ns data Þ11% overhead
Ref: M. Gast, “802.11n: A Survival Guide,” O’Reilly, 2012, ISBN:978-1449312046, Safari Book

q Compared to 802.11a/g, 802.11n has higher coding rate, wider channel bandwidth, lower coding overhead, and reduced guard interval. On top of
this, 802.11n uses MIMO multiplexing to further boost the data rate. Given that 802.11a/g has a data rate of 54 Mbps, can you estimate the data rate for 802.11n that uses 4 MIMO streams (assume 64 QAM for both of them, i.e., there is no improvement in modulation)?
54 Mbps is achieved with 3⁄4 coding for 3200 Data+800 GI for a/g, which basically uses a single stream (no MIMO).
802.11n has the following improvement factors:
Ø Streaming factor = 4
Ø Coding factor = (5/6)/(3/4) = 1.11
Ø OFDM subcarrier (plus wider bandwidth) factor = (108/48) = 2.25 Ø Guard interval factor = (3200+800)/(3200+400) = 1.11
Ø Total improvement factor = 4×1.11×2.25×1.11 = 11.1 Improved data rate for 802.11n =
4×[(5/6)/(3/4)]×(108/48)×[(3200+800)/(3200+400)]×54 Þ 600 Mbps ©2021

802.11n Channel Bonding
q Two adjacent 20 MHz channels used
q OFDM: 52+4 instead of 48+4 with 20 MHz,
108+6 with 40MHz (No guard subcarriers between two bands)
q Primary 20 MHz channel: Used with stations not capable of channel bonding
q Channel bonding is achieved by combining a secondary 20 MHz channel. q Secondary 20 MHz channel: Just below or just above the primary channel
(indicated by the primary channel number and up/down indicator)
Ø E.g., in 5 GHz band, 36+ would indicate that channel bonding is achieved by combining 36 and 40 (both 36 and 40 are 20 MHz channels)

Modulation, Coding, Data Rates of 802.11n: Single Stream

Example: 802.11n
Question: 802.11n can use either 20 MHz channels or 40 MHz channels with channel bonding. For 40 MHz bandwidth, data rate can be improved by what factor if channel bonding is used?
Solution: Data rate is proportional to the number of OFDM subcarriers used for data.
# of subcarriers for 20 MHz channels (no channel bonding) = 52 # of subcarriers for 40 MHz channels with channel bonding = 108
Channel bonding improvement over 40 MHz bandwidth = 108/(52+52) = 1.04 or 4%

Frame Aggregation
q Frame Bursting: Transmit multiple PDUs together q Frame Aggregation: Multiple SDUs in one PDU
All SDUs must have the same transmitter and receiver address

802.11n Frame Aggregation
IP Datagram 1
IP Datagram 2
IP Datagram 3

MAC Header
MSDU Subframe 1
MSDU Subframe 2
MSDU Subframe n
MPDU Delimiter
PHY Header
MPDU Subframe 1
MPDU Subframe 2
MPDU Subframe m
PSDU = A-MPDU PPDU
Ref: D. Skordoulis, et al., “IEEE 802.11n MAC Frame Aggregation Mechanisms for Next-Generation High-Throughput WLANs,”
IEEE Wireless Magazine, February 2008, http://tinyurl.com/k2gvl2g ©2021

802.11n MAC Frame
CSI Feedback Opportunity
Frame Control
Duration/ ID
Seq Control
High Thr CTL
Info <7955B 16b 16b 48b 48b 48b 16b 48b 16b 32b 32b Link Adaptation Control Calibration Pos | Seq 1b 1b 4b 3b 2b 2b 2b 2b 1b 5b 1b 1b q 802.11n introduced a “High Throughput Control” field to exchange channel state information (CSI) q Receivers can derive CSI from the pilots embedded in the transmissions (e.g., OFDM pilot subcarriers), but the transmitters cannot learn it unless receivers explicitly feedback this information. This new field in 802.11n provides this opportunity IEEE 802.11ac q Supports 80 MHz and 80+80 (channel bonding) MHz channels q 5 GHz only. No 2.4 GHz. q 256-QAM 3/4 and 5/6: 8/6 times 64-QAM Þ 1.33X (of 11n) q 8 Spatial streams: 2X (of 11n) q Multi-User MIMO q Less pilots/more data subcarriers: 52+4 (20 MHz), 108+6 (40 MHz), 234+8 (80 MHz), 468+16 (160 MHz) Ref: M. Gast, “802.11ac: A Survival Guide,” O’Reilly, July 2013, ISBN:978-1449343149, Safari Book Bandwidth and Subcarriers of 802.11ac # of Data Subcarriers # of Pilot Subcarriers Modulation, Coding, Data Rates of 802.11ac: Single Stream Beamforming q Direct energy towards the receiver q Requires an antenna array to alter direction per frame Þ A.k.a. Smart Antenna q Implicit: Channel estimation using packet loss q Explicit: Transmitter and receiver collaborate for channel estimation q 802.11ac supports a more “standard” beamforming so multi-vendor products can cooperate easily q MIMO: Multiple uncorrelated spatial beams Multiple antenna’s separated by l/4 or l/2 (absolute minimum) Ø Cannot put too many antennas on a small device; also cost increases with number of antennas q MU-MIMO: Two single-antenna users can act as one multi- antenna device. The users do not really need to know each other. They do not even know that their antennas are used in a MU-MIMO system! Beamforming with Multi q Single User MIMO: Colors represent transmission signals not frequency. has 4 antennas has 1 antenna has 1 antenna q Multi User MIMO: 802.11n vs. 802.11ac https://www.cisco.com/c/en/us/products/collateral/wireless/aironet-3600-series/white_paper_c11-713103.html Goal of 802.11ax: Efficiency vs. Speed q Up until 802.11ac, pushing the data rates had been the main goal Ø 3500X increase from 2Mbps in 1997 to 7Gbps in 2013 Ø 802.11ac increased data rates by ~11X compared to its immediate predecessor, 802.11n q Instead of speed, 802.11ax seeks to solve two efficiency problems: Ø Efficient WiFi in densely deployed scenarios (urban areas) Ø Efficient communications for machines (IoT) q 802.11ax has a modest data rate increase of only 37% against its immediate predecessor, 802.11ac Parameters of 802.11ax q Band: 802.11ax supports both 2.4GHz and 5GHz bands. q Coding rate: There is no change for the coding rate; 5/6 remains the maximum allowed coding rate. q Channel width: There is also no change for the allowed channel width, i.e. 40MHz and 160MHz remain the maximum for 2.4GHz and 5GHz bands, respectively. q MIMO streams: Like its predecessor, 802.11ax maintains the maximum number of MIMO streams to 8 only. q Modulation: 802.11ax supports an increased modulation rate of up to 1024 QAM. q Symbol interval: 802.11ax uses increased symbol intervals to address longer delay spread in challenging outdoor environments. Symbol data interval is increased to 12.8μs (vs. 3.2μs in 11a/g/n/ac) while the guard interval is also increased to 0.8μs, 1.6μs, or 3.2μs (3 options). q OFDM subcarrier: subcarrier spacing is reduced to 78.125 kHz (vs. 312.5kHz in 11a/g/n/ac), which yields a total number of subcarriers as follows: 256 for 20MHz, 512 for 40MHz, 1024 for 80MHz, and 2048 for 160MHz, which includes two new types of subcarriers, DC and null subcarriers, in addition to the conventional data, pilot, and guard subcarriers used in previous WiFi versions. The number of data carriers available are as follows: 234 for 20MHz, 468 for 40MHz, 980 for 80MHz, and 1960 for 160MHz. Modulation, Coding, Data Rates of 802.11ax: Single Stream Multiple Access in 802.11ax: OFDMA q Up until 802.11ac, CSMA had been used for channel access q OFDMA had been used in cellular networks for many years, but for WiFi it was introduced for the first time in 802.11ax Ø OFDMA is available as an option q 802.11ax OFDMA Ø Centrally allocate channel resources using fine-grained time-frequency resource units (Rus) Ø Subcarriers are called tones Ø Each tone = single subcarrier of 78.125 kHz bandwidth Ø The tones are then grouped into 6 different sizes of resource units (RUs): 26, 52, 106, 242, 484, or 996 tones Ø 26 tones = ~2MHz (26x78.125kHz = 2031.25kHz) Ø 996 tones = ~80MHz (996x78.125kHz = 77812.5kHz) Ø A WiFi client can be allocated a maximum of 2 996 tones = ~160 MHz 802.11ax Resource Units 160(80+80)MHz where +n means ‘plus n 26-tone RUs`. For example, to allocate ~20MHz, the access point would allocate 4 52-tone RUs plus 1 26-tone, which results in a total of 4x52+26=234 subcarriers allocated to the station. Example 802.11ax Question: A single antenna 802.11ax client receives a 26-tone RU allocation from the AP when trying to transmit a 147-byte data frame. What could be the minimum possible time required to transmit the frame assuming at least 2 non-data subcarriers? Single antenna means single stream Number of data subcarriers = 26-2 = 24 Symbol length = data-interval+guard = 12.8+0.8 = 13.6μs Maximum data rate for single-stream 26-tone 0.8μs GI ) = symbol-rate x (bits/symbol) x coding-rate = (1/13.6) x (10x24) x (5/6) = 14.7Mbps Data frame length in bits: 147x8 bits Minimum frame transmission time: (147x8)/14.7μs = 80μs 802.11be: Next Generation q 802.11ax is perfectly capable of serving today’s needs, but q Work on next generation WiFi must continue to keep WiFi future q 802.11be is the next generation WiFi Ø work has already begun; expected to release in 2024 q Data rates will be increased by enhancing several parameters Ø Increase bandwidth from 160MHz to 360MHz (6GHz band) Ø Increase number of bits per symbol (4096 QAM) Ø Increase MIMO streams to 16 Ø Multi-band communications (better throughput and reliability) Ø Multi-AP coordination (better spectral efficiency and quality of experience) 802.11be vs. previous generations Table 5.10 Comparison of 802.11be with previous amendments 2.4/5/6GHz Max. Channel Bandwidth Max Modulation 16 streams Max. Data Rate Example 802.11be Question: Calculate the maximum data rate of 802.11be. Solution: Enhancements against 802.11ax: Channel bandwidth factor: 320MHz/160MHz = 2 Modulation factor: 12 bits/symbol (log21024=10)/10 bits/symbol (log24096=12) = 1.2 MIMO factor = 16 streams/8 streams = 2 Therefore 802.11be is expected to achieve a 4.8X (2x1.2x2 = 4.8) improvement against 802.11ax. Given that 802.11ax has a maximum data rate of 9.6Gbps, 802.11be is expected to achieve a maximum data rate of 4.8x9.6 = 46.08Gbps. 802.11be Multi band Communications 2.4GHz 5GHz 2.4GHz 5GHz Top: Improving throughput by allocating data from one traffic stream to multiple bands; Bottom: Improving reliability by sending duplicate data from one traffic stream over multiple bands; 802.11be Multi AP Coordination Example Downlink is handled by AP1, while AP2 handles the uplink. 1. 802.11a/g use OFDM with 64 subcarriers in 20 MHz, which includes 48 Data, 4 Pilot, 12 guard subcarriers. 2. 802.11e introduces 4 queues with different AIFS and TXOP durations and a QoS field in frames to provide enhanced support for QoS. 3. 802.11n adds MIMO, aggregation, dual band, and channel bonding. 4. IEEE 802.11ac supports multi-user MIMO with 80+80 MHz channels with 256-QAM and 8 streams to give 6.9 Gbps 5. IEEE 802.11ax supports 1024QAM, reduces OFDM carrier spacing to 78.125kHz and increases data symbol interval to 12.8μs. It introduced OFDMA. 6. 802.11be expects to increase data rates up to 46Gbps by using 4096 QAM, 320MHz channel bandwidth, and 16 MIMO streams. It uses 6GHz band along with 2.4GHz and 5GHz. 程序代写 CS代考 加微信: cscodehelp QQ: 2235208643 Email: kyit630461@163.com