• No results found

ECE 428 Computer Networks and Security

N/A
N/A
Protected

Academic year: 2021

Share "ECE 428 Computer Networks and Security"

Copied!
76
0
0

Loading.... (view fulltext now)

Full text

(1)

ECE 428

(2)

About the Instructor

• Instructor: Sagar Naik

• Office: EIT 4174, ECE Dept.

• Other courses that I teach

– ECE 355: Software Engineering

– ECE 453/CS 447/ SE 465: Software Testing and QA – ECE 454: Distributed and Network-Centric Computing

– ECE 750-4: Protocols, Software, and Issues in Mobile Comp.

• Research interest: Computer networks, mobile computing,

wireless communication, network-based applications

(3)

Course Outline

Objective #1

– Fundamentals of transporting messages from one

process to another process on another computer.

• Important communication protocols to access the Internet

Objective #2

– Fundamentals of network security

Objective #3

(4)

Course Outline

• Objective #1

– To transport messages from a process on one machine to another process on another machine

Client Process

Server Process

IP IP

DLC

(5)

Course Outline: Realize Objective #1

• Physical +

M

edium

A

ccess

C

ontrol (MAC) layers

D

ata

L

ink

C

ontrol (DLC) layer

I

nternet

P

rotocol (IP) layer

T

ransmission

C

ontrol

P

rotocol (TCP) layer

• Application Layer Protocols

(6)

Course Outline

• Objective #2: Achieve

secure

communication

– Security

• User Authentication

• Privacy (Confidentiality)

• Data Authentication (Data Integrity) • Techniques

(7)

Course Outline

• Objective #3

– Advance topics in communication networks

• Cellular communication network

– GSM/ GPRS

• Wireless backbone networks

– WiMAX

(8)

Evaluation

• Two assignments

15%

• Mid-term exam

25%

(9)

Reading Resources

• Text

Computer Networks

, A. S. Tanenbaum, Prentice Hall

– Computer Networking, Kurose and Ross, Addison

Wesley

– TCP/IP Protocol Suite, B. A. Forouzan, McGraw Hill,

3

rd

ed.

– Online notes to be posted

• Course URL

(10)

Teaching Assistants

• Towhidul Islam

(

[email protected]

)

(11)

Teaching Style

• Balanced coverage of

functional

,

non-functional

and

design

aspects of network protocols

– Functional aspect: what the protocols

do

– Non-functional aspect: Quality of Service (QoS)

– Design aspects: choices and parameters

• View this course as a

window

to the larger world

of computer networks.

• Stay close to real protocols with a combination of

(12)

Tutorial Style

• Near exam times

– Exam related questions and answers

• Otherwise

(13)

My assumption about class level

(14)

Physical + MAC layers

C C C

Hub Ethernet cable

C C C

Wireless Access Point

C C C

Wired media

(15)

Physical + MAC layers

• Physical layer

– Actual movement of bits over comm. medium

– Different communication media

• Wire (fiber optics, coaxial cable, telephone line)

• Free space  wireless communication

– Main function

• Bit stream  electrical signal/ electromagnetic waves

• Strive for media efficiency

(16)

Physical + MAC layers

• Media

– Shared: Ethernet, free space

– Dedicated: a dial-up link

• MAC layer

– Uses the services of the underlying PHY layer.

– Tells the PHY layer

WHEN

to transmit.

– Transmission may not be successful: packet loss.

– Mechanisms for reducing packet loss

(17)

Data Link Control layer

• DLC layer

– Runs on top of a MAC layer (unreliable)

– Provides a sense of

reliability

: ACK mechanism

– Synchronize source transmission rate with the sink’s

acceptance rate.

Flow control

– Data multiplexing/ demultiplexing

(18)

IP (Network) layer

• IP layer

– Runs on top of a DLC layer.

Route

packets from one computer to another.

(19)

Transport layer

• TCP layer

– Runs on top of IP layer.

– Provides “end-to-end” communication symantic.

– Packet delivery

• Lossless • In-order

• Single copy (No duplicate) • Confirmation

(20)

Applications

• Internet Directory Service – DNS

• Web Access – HTTP protocol

(21)

Communication Protocols

• Medium Access Control (MAC)

• Lets two nodes communicate directly. • Node: a computer or a router

• Data (Logical) Link Control (DLC/LLC)

• Lets us have a reliable link between two adjacent nodes.

• Internet Protocol (IP)

• Routes packets from one computer to another. • Uses the services of BGP, OSPF, and RIP

• Transmission Control Protocol (TCP)

(22)

Media/Physical Layer

• Computers are “physically” connected by a medium

• Wired medium (Ex.: Ethernet  Local Area Network)

• Wireless medium (Ex.: Free space WLAN, Cellular network)

Physical layer

• A layer of protocol controlling the hardware system that

actually moves bits from one computer to another • Abstraction: Transmitter and Receiver

Node 1 Node 2

Tx Rx

Rx Medium Tx

(23)

Medium Access Control (MAC)

Protocols for LAN and WLAN

(24)

Some Basic Ideas

• Concept of layering

• Segment/ Packet/ Frame

• Packet Header

• Five Basic Assumptions

• Aloha Protocols

(25)

Concept of Layering

MAC1 DLC1 IP TCP MAC1 DLC1 IP MAC2 DLC2 MAC2 DLC2 IP TCP App. App. LAN1 LAN2

PHY PHY PHY PHY

Note: Protocols are executed in

(26)

Concepts of segment/packet/frame, and header

DLC1 IP TCP

App. User Data

User Data User Data

User Data DLC1

IP TCP App. User Data User Data User Data User Data

Packet:

A

formatted

stream of bits with the following info.

-

Type:

The receiver knows what to do with this.

-

Addresses: Destination

and source

-

Control information:

Layer related

-

Data: optional

H E A D E R

(27)

MAC Protocols

• Function: Send

packets

from one node to another

sharing

the same medium

• Sharing => Nodes

compete

for transmission

• Key problem to resolve

– Each node

finds a good time

for transmission with

the hope that it will not collide with another.

– The decision must be made largely

independently

• Ignore what others are doing

• Look for possible Tx from others (sense carrier) • Take permission from the receiver

(28)

MAC Protocols (5 key assumptions)

Station Model

– Nodes are independent. When a node generates a packet for Tx, subsequent packets are queued up for Tx.

Single channel model

only one can Tx at a time

Collision assumption

– Two packets are transmitted at the same time => signal is potentially garbled (collision occurs) at the receiver.

– Collision occurs at receivers.  NOTE

– Transmitter needs to know the occurrence of collision

• A Tx can’t actually detect a collision • A Tx can sometimes infer a collision

(29)

MAC Protocols (5 key assumptions)

Time model

Continuous:

A packet Tx can begin at any instant

Slotted:

Packets are transmitted at well-known instants

defined by slots.

Carrier sense

– No carrier sense: Don’t try to detect an on-going Tx

– Carrier sense

• Mechanism to sense carrier • Utilize its absence

(30)

MAC Protocols

• We will study

– Aloha protocols

– CSMA/CD (Carrier Sense Multiple Access/

Collision Detection)

(31)

Aloha Protocol

• Developed in the 1970s at U of Hawaii

• To interconnect terminals with mainframes

• LAN/ WLAN: Possible, but not used

• GSM: Phones use this protocol to

request a

channel

from the base stations

• Two types

– Pure Aloha (Continuous time)

– Slotted Aloha

(32)

Pure Aloha

Start: i = 0

Start a timer

T = 2*Tp + Δ

ACK received Cancel timer Timeout i++ Transmit Frame

i > Kmax

R = Random(0,2i-1)

Wait

TB = R*Tp

No

(33)

(Pure Aloha: Performance Measure)

Throughput:

A commonly used performance metric.

Input/ Output System I/O System Input Output Input rate O ut put r at e Throughput:

(34)

Pure Aloha: Performance Measure

• Throughput

– Throughput =

• Total input rate (G) * Prob. of successful packet transmission

• G*e-2G

– Throughput peaks at G = 0.5 units of packet/X sec,

where X is the packet transmission time.

– Max throughput = 0.184 packets/X sec.

• Oblivious to collision while transmitting

(35)

Slotted Aloha Protocol

• Similar to pure Aloha

• Difference

– Time is slotted

– A terminal

transmits

a packet at the beginning of a

slot.

– Throughput

• G*e-G

(36)

Carrier Sense Multiple Access

with Collision Detection

(37)

CSMA/CD

Concepts of

Carrier Sense and Collision

Detection

Tx Rx

Data

Compare Carrier?

Collision?

Medium MAC/

(38)

IEEE 802.3: PHY

• 10Base5

• Thick co-ax (10 mm diameter) • 500 m segment

• Bus

• 10BaseT

• Twisted pair • 100 m

(39)

CSMA/CD

• Assumption

(40)

CSMA/CD

Start: i = 0

Send jamming Signal +

Abort

i++

Sense medium

i > Kmax

R = Random(0,2i-1)

Wait

TB = R*Tp

No

Busy Y Wait

N No collision Collision Transmit frame WHILE detecting collsion

(41)

CSMA/CD

– Time for collision detection

– 2 * Tp (where Tp is max propagation time between two nodes)

– Propagation time

• Includes transceiver delay + physical propagation time • Of the order of 25 microseconds

– Minimum packet length

• Frame transmission time is Tf

• Tf = 2* Tp

(42)

Aloha vs. CSMA/CD

• No carrier sense

• ACK

• Oblivious to collision

• No jamming signal

• Low throughput

• Carrier sense

• No ACK

• Collision => Abort

• Jamming signal

– Let all hear the collision

(43)

Wireless LAN

(44)

Note

• Reminder

CSMA/CD Assumption

• Signal from one node can reach all nodes.

– The assumption may not hold in WLAN

– Collision detection is out of question (Use CA)

– Two nodes may not be able to comm. directly

(45)

WLAN View

Router

Access Point

To the rest of the network

C

C C: Computer, AP: Access Point

Radio range of the AP

IEEE 802.11 protocol

Other AP

Basic Service Set (BSS): BSSID = MAC address of AP Independent BSS (IBSS)= BSS - AP

(46)

IEEE 802.11/a/b/g Family

IEEE Technique Band Rate

Mbps

802.11 DSSS

FHSS

2.4 GHz 2.4 GHz

1 and 2 1 and 2

802.11a OFDM 5.725 GHz 6--54

802.11b DSSS 2.4 GHz 5.5 and 11

(47)

Different Modes of Operation of

MAC in IEEE 802.11

Modes of IEEE 802.11 MAC

Point Coordination Function (PCF) mode Distributed Coordination

Function (DCF) mode

(48)

PCF Mode: Optional

• The AP

• Acts as the central controller for all nodes within its range.

• Decides who transmits and when.

• Can follow a round-robin policy to allocate slots.

Note: There is no contention for medium access.

• This mode

• Can support real-time traffic due to periodic scheduling.

• Leads to waste of bandwidth if a scheduled node has no traffic. • Is optional <= Spec.

(49)

DCF Mode: Mandatory

• An AP

– Not necessarily to be used.

• Computers can communicate among themselves <= Ad hoc.

– Is used to provide connectivity to the Internet.

• In DCF

– All nodes, including the AP, compete for medium access.

– The AP does not act as a central controller.

– Contention => No guarantee of bandwidth

(50)

Alternative use of PCF and DCF

• The WLAN operates

• In the PCF mode for T1 seconds

– Bandwidth guarantee for some nodes

• In the DCF mode for T2 seconds

– Nodes with additional traffic can contend for a share of the bandwidth

PCF DCF PCF DCF PCF DCF

(51)

DCF with

hand-shake

• A sender obtains

permission

from the receiver

before transmitting a data frame.

• Hand-shake mechanism

• Sender transmits a Request To Send (RTS) frame

• Receiver gives permission by sending back a Clear To Send

(CTS) frame

• Used to increase the probability of successful Tx when

– Traffic is high

– Packet length is long. ( dotRTSThreshold holds the value.)

• Incurs additional cost

(52)

DCF

with

and

without

hand-shake

• The two modes are not mutually exclusive.

• A node decides what mode to use on a frame/frame basis. • The MAC management database contains a variable

– dotRTSThreshold: integer in bytes

– Length of a data frame >= dotRTSThreshold

» Use hand-shake

– Length of a data frame < dotRTSThreshold

» Do not use hand-shake

PCF PCF

DCF

PCF

(53)

DCF

without hand-shake

• A sender

does not

obtain

permission

from the

receiver before transmitting a data frame.

• RTS/CTS mechanism is

NOT

used.

• There is no prior coordination between sender and receiver

• A sender transmits a frame

– when some

medium sensing

conditions are satisfied.

• To follow …

• When traffic is low OR data frames are short

(54)

Problems in WLAN

• Hidden Terminal Problem

• Exposed Terminal Problem

• Inability to detect collision (at the receiver)

Assumption

– All nodes have identical radio range

• how far away their signal can be received

• Note

(55)

Hidden Terminal Problem

A B C

Tx

Problem

- C is transmitting a frame to B. - A is unaware of C’s Tx.

- Now, if A transmits, A’s Tx will collide with C’s at B

• The above problem is due to C being hidden from A.

(56)

Exposed Terminal Problem

A B C

Tx

Problem

- A is transmitting a frame to D. - B is aware of the ongoing Tx.

- If B transmits a frame to C, no harm is caused.

- However, B does not transmit because it is unaware of D’s location. D

(57)

No collision detection

• Fact: Collision occurs at receivers.

• In a wired LAN

– Collision is

indirectly

detected by the sender by

enforcing the following

assumption

:

• Signal from one node can reach all nodes.

• In a WLAN

– The assumption does

not

hold.

Evidence: The hidden terminal problem …

(58)

WLAN MAC: CSMA/CA

• In CSMA/CA, collision is avoided using

PHY-level carrier sensing

: Done by receiver hardware

Virtual carrier sensing

: Done by

• Processing all frame headers (RTS, CTS, DATA)

• A duration field in frame headers indicates

– for how long the sender of the frame may use the medium.

• A Network Allocation Vector is managed using duration fields

– Each node has a NAV – essentially an integer

– NAV > 0: A node had announced its intention to use the medium now. – NAV = 0: Nobody had announced its intention to use the medium now.

(59)

NAV Update Mechanism

• Each node has its own NAV.

• NAV represents the length of time for which the medium is likely to remain busy

• Initially:

NAV = 0

.

• With each passing

μ

s

NAV = NAV – 1

• Decrementing stops if NAV = 0.

• NAV is updated using the

duration

field in a

received frame

(60)

RTS and CTS Frames

• Frame format

Frame

Control Duration RA TA FCS

RTS

Frame

Control Duration RA FCS

CTS/ ACK

2 2 6 6 4 bytes

(61)

DATA Frame

• Frame format

Frame Control

Duration/

ID A1 A2 A3 A4 Seq.

Control Frame Body FCS

(62)

Timing Intervals

• The IEEE 802.11 MAC defines 4 timing intervals

– 2 at the PHY level

• SIFS: Short InterFrame Space • aSlot

– 2 at the MAC level

• PIFS: Priority (in PCF) IFS • DIFS: Distributed IFS

(63)

Hand-shake using RTS/CTS

RTS CTS SIFS SIFS DATA SIFS ACK

Value of “duration” in RTS

Value of “duration” in CTS A

B

C

D

Value of NAV of C

Value of NAV of D

Time

(64)

DCF with Hand-shake: Tx

F: a new data frame to be transmitted

i = 0, CW = CWmin

NAV =0?

Idle medium for DIFS interval?

Send an RTS Start a timer

Cancel timer Send DATA (F) Start a timer

Cancel timer Wait for a random interval

i = i+1

CW = CWmin*2i

(At some point, CW Timeout Timeout Random Backoff No Yes

CTS is received

ACK is received

End of backoff

i: Retry count, CW: Contention Window

CWmin: Minimum value of CW (typical value is 32) CWmax: Maximum value of CW (typical value is 256) DIFS: Distributed Interframe Space

SIFS < DIFS Important note

Wait for fairness to others

(65)

Backoff Mechanism

• Backoff Time Counter (BTC) = Random(0,CW)

• The time unit of BTC is

aSlotTime

aSlotTime:

propagation + transceiver switching time

• BTC is decremented as follows:

– Medium is idle for aSlotTime: BTC = BTC – 1

– Medium is busy: Stop decrementing

– Resume decrementing BTC after finding the medium to

be idle for DIFS interval.

– Subsequent decrementing is done for every aSlotTime

of idleness of the medium.

(66)

Backoff Mechanism

Ch. Busy (A) Ch. Busy (C)

DIFS DIFS

X X X X

BTC = 5 4 3 2 2 2 1 0

X = aSlotTime If the channel is idle for at least DIFS interval, it has to remain idle for aSlotTime interval for BTC to be decremented by 1. If the channel is busy, it has to remain idle for DIFS interval

for BTC to be decremented by 1.

Time

(67)

DCF with Hand-shake: Rx

Receive an RTS

NAV = 0?

Send a CTS Channel is idle for SIFS and the computer is ready to receive? No Yes No Yes Remain silent.

Receive a DATA frame

Ch. idle for SIFS?

Send an ACK

Note:The above two fragments of flow-charts can be easily merged. No

(68)

DCF Mode

without

Hand-shake

• A special case of DCF with hand-shake

– RTS/CTS frames are not exchanged

• The idea of NAV is still used in this mode

– All stations process the received RTS/CTS of others

• NOTE: A node may

broadcast

a DATA frame to

all

– Done in DCF without hand-shake

(69)

PCF Mode of Operation

• An AP acts as the controller of a BSS as follows

– AP alternates between PCF and DCF modes

– AP assumes the role of a

controller

as follows

• AP senses the medium at the start of a CF (Contention-Free) period for a PIFS (Priority IFS) interval.

– SIFS < PIFS < DIFS

– PIFS = SIFS + aSlotTime – DIFS = SIFS + 2*aSlotTime

• If the medium is idle for PIFS, transmit a beacon frame

– Beacon contains a CFPMaxDuration field

– (Nodes receiving a beacon update their NAV to CFPMaxDuration)

(70)

PCF Mode of Operation (Contd.)

– After

transmitting a beacon

, AP waits for SIFS before

transmitting one of the following

• DATA frame • CF Poll frame

• DATA+CF Poll frame • ACK frame

(71)

PCF Mode of Operation (Contd.)

CF Poll frame

AP User 1 User 2 AP User 1

CF Poll CF Poll

DATA DATA

ACK ACK

The polled user sends data to another user.

The polled user sends data to the AP. SIFS

SIFS

SIFS

(72)

PCF Mode of Operation (Contd.)

DATA + CF Poll frame

AP User 1 User 2 DATA+

CF Poll

DATA

ACK

The polled user receives data from the AP and sends data to another user.

SIFS

SIFS ACK

(73)

PCF Mode of Operation (Contd.)

• DATA frame

– Contains user data from AP to a specific station.

– The receiver sends back an ACK after SIFS interval.

– AP does not receive an ACK

• Retransmit the DATA after a PIFS interval

– AP can

broadcast

a DATA frame

(74)

PCF Mode of Operation (Contd.)

• CF Poll frame

– AP grants permission to another node to transmit DATA

to the AP or to a third node.

– Receiver of DATA frame sends an ACK to the sender.

– If the polled node has no data to send, it sends a

null

DATA frame.

– If the polled station does not receive an ACK, it can not

retransmit its data frame until it is polled again.

(75)

PCF Mode of Operation (Contd.)

• CF End frame

– Identifies the end of CF period

– Sent by an AP under two conditions

• An AP has no data to send and no node to poll

– Can happen before the pre-announced CFPMaxDuration

– Receivers of CF End reset their NAV to 0.

• Normal end of CF period

– (Initially: CFPDurRemaining = CFPMaxDuration)

(76)

A node joining a WLAN with an AP

• (No need for such a procedure in a wired LAN)

• Two ways for a node to join a WLAN

– Passive scanning

• Scan a channel for a Beacon frame

• If a Beacon frame is received

– Negotiate Authentication and Association processes

– Active Scanning

• Transmit a Probe frame

References

Related documents

• Suitable for indoor/ outdoor water feature • 650 litres per hour • Adjustable flow rate. • 8m outdoor cable • Low

[r]

Encouraging results from real data processing shows that it is feasible to use the MUSIC-Capon processing in active sonar signals and its performance is better than the

The crucial question of this paper is how one can reproduce the results of section 3 inferred by the canonical quantization procedure using the effective action formalism and

Such statements include, but are not limited to, statements about the continued demand for our product, the potential benefits resulting from the sale of ExpressJet, including

The manufacturing systems of the future will be based on relations with the various components of a virtual network that enable the company to design a specifi c supply chain

Fast grown biofilms show a higher detachment rate than slowly grown biofilms if stressed simi- larly since high growth rates cause a weaker EPS-matrix and thus unstable