Mobile Computingcpoellab/teaching/mobicom-backup-material/lecture0… · 9/2/12 1 Mobile Computing...

Post on 20-Jul-2020

0 views 0 download

Transcript of Mobile Computingcpoellab/teaching/mobicom-backup-material/lecture0… · 9/2/12 1 Mobile Computing...

9/2/12  

1  

Mobile Computing CSE  40814/60814  

Fall  2012  

What is a Network? •  A network is a "group of computers and

associated devices that are connected by communications facilities.” –  A network supports communication among users in ways that other

media cannot. E-mail, the most popular form of network communication, provides low-cost, printable correspondence with the capability for forwarding, acknowledgment, storage, retrieval, and attachments.

–  Sharing involves not only information (database records, e-mail, graphics, etc.), but also resources (applications, printers, modems, disk space, scanners, etc.) Through its ability to share, a network promotes collaboration.

1

Types of Networks •  Scope – Local area network (LAN) – Metropolitan area (MAN) – Wide area network (WAN)

•  Ownership – Closed versus open

•  Topology (configuration) – Bus (Ethernet) – Star (wireless networks with central access point) – Ring – Mesh

2

9/2/12  

2  

Network Topologies •  A topology refers to the manner in which the

cable is run to individual workstations on the network. – Star, bus, ring, mesh

3

LAN Technology: Ethernet •  Ethernet is a popular, relatively inexpensive, easy-to-install LAN

architecture with the following characteristics: –  Uses the CSMA/CD media access control. –  Data transmission normally occurs at 100 Mbps (10Mbps in the early forms

and 10Gbps in the most recent forms). •  The Ethernet architecture conforms to most but not all of the IEEE 802.3

specification (the physical layers are identical but the MAC layers are somewhat different).

•  An Ethernet LAN is often described in terms of three parameters: transmission rate, transmission type, and segment distance or cable type. –  "100baseT" means:

•  100 - transmission rate or throughput of 100Mbps •  base - transmission type is baseband rather than broadband network (i.e., the signal

is placed directly on the cable, one signal at a time) •  T – the cable type (e.g., twisted pair)

•  Few types of Ethernet: 10Base2, 10Base5, 10BaseT and 10BaseF, 100BaseT, 100BaseF, etc.

4

ISO/OSI Model •  The International Standards Organization (ISO) Open Systems Interconnect

(OSI) is a standard set of rules describing the transfer of data between each layer in a network operating system. Each layer has a specific function (i.e., the physical layer deals with the electrical and cable specifications).

5

9/2/12  

3  

ISO/OSI Model •  Physical Layer

–  Physical characteristics of network (cable type/length, connectors, etc.). –  Electrical characteristics of signals (voltage levels/durations, etc.). –  Transmits binary data (bits) as electrical or optical signals.

•  Data Link Layer –  Defines when/how medium will be accessed for transmission. –  Works with “frames”. –  Performs error detection and correction. –  Often divided into sublayers (lower: network access; upper: sending/receiving

packets, error checking). –  “MAC” addresses.

•  Network Layer –  Addressing and routing (“IP” addresses). –  IP protocol.

6

ISO/OSI Model •  Transport  Layer  

–  UDP  (User  Datagram  Protocol).  –  TCP  (Transmission  Control  Protocol).  –  Addressing  (“ports”),  error  correcJon,  flow  control,  congesJon  

control.  

•  Session  Layer  –  Management  of  “sessions”.  

•  PresentaJon  Layer  –  Data  translaJon,  formaOng,  encrypJon,  compression.  

•  ApplicaJon  Layer  –  Interface  between  user  applicaJons  and  lower  network  services.  

7

ISO/OSI Model

9/2/12  

4  

ISO/OSI Model

OSI vs. TCP/IP

Medium Access Control (MAC) •  Responsible  for  deciding  when  &  how  to  transmit  frames  over  a  network  (“channel  access  problem”).  

•  Design  and  realizaJon  of  MAC  protocol  is  very  important  for  “quality”  of  communicaJons  (successful  transmissions,  reliable  transmissions,  high  throughput,  low  latency,  fairness,  …).  

11

A   C  B  

9/2/12  

5  

Simultaneous Transmissions

•  Ignore  ongoing  communicaJons  and  just  transmit:  – Large  number  of  “collisions”.  – Low  throughput.  

12

A   C  B  

collision  

“Smarter” Approach

•  Listen  before  you  talk!  •  Carrier  Sense  MulJple  Access  (CSMA).  –  “Sense”  (listen)  carrier.  –  If  “busy”  wait;  if  “idle”  transmit.  

13

A   C  B  

Don’t �transmit �

Can  collisions  sJll  occur?  

Collisions in CSMA •  Collisions  sJll  do  occur:  – Non-­‐zero  propagaJon  delays.  

– ParJal  collision:  enJre  packet  lost.  

14

9/2/12  

6  

CSMA/CD •  CD  =  Collision  DetecJon.  •  How?  Keep  listening  to  channel!  

•  If  transmiged  signal  and  sensed  signal  differ:  – Collision  detected.  – Abort  transmission.  –  (Jam  channel).  

15

CSMA/CD •  AssumpJon:  the  received  and  transmiged  signal  are  idenJcal  (non-­‐dispersive).    

•  AssumpJon:  receiver  “sees”  the  same  signals  as  transmigers  on  channel.  

•  Problem:  both  not  true  in  wireless  networks!  •  Transmiger  does  not  know  what  the  receiver  “sees”  and  therefore  does  not  know  if  transmission  was  successful.  

16

Wireless Transmissions

17

A   B  C   D  

Distance  

Signal  power  

9/2/12  

7  

Collision Detection

•  Signal  received  depends  on  “signal  to  interference  plus  noise  raJo”  (SINR  =  P/(I+N)).  

18

A C D B

Hidden Terminal/Exposed Terminal

•  Hidden  terminal:  C  does  not  hear  A  (and  A  cannot  hear  C),  but  it  can  interfere  with  A  at  B.  – Node  SHOULD  NOT  transmit!  

•  Exposed  terminal:  X  hears  A  and  wants  to  transmit  to  Y.  It  cannot  interfere  with  A  at  B.  – Node  SHOULD  transmit!    

19

A   B  C   D  X  

X  is  the  exposed  terminal  to  A  Y  

C  is  the  hidden  terminal  to  A  

IEEE 802.11

20

CTS = Clear To Send

RTS = Request To Send

D

Y

S

M

K

RTS

CTS

X

9/2/12  

8  

21

D

Y

S

X

M

K silenced

silenced

silenced

silenced Data

ACK

IEEE 802.11

IEEE 802.11 •  All  backlogged  nodes  choose  a  random  number  

–  R  =  rand  (0,  CW_min)  

•  Each  node  counts  down  R  –  ConJnue  carrier  sensing  while  counJng  down  –  Once  carrier  busy,  freeze  countdown  

•  Whoever  reaches  ZERO  transmits  RTS  –  Neighbors  freeze  countdown,  decode  RTS  –  RTS  contains  (CTS  +  DATA  +  ACK)  duraJon  =  T_comm  –  Neighbors  set  NAV  =  T_comm  

•  Remains  silent  for  NAV  Jme  

22

IEEE 802.11 •  Receiver  replies  with  CTS  

–  Also  contains  (DATA  +  ACK)  duraJon.  –  Neighbors  update  NAV  again  

•  Tx  sends  DATA,  Rx  acknowledges  with  ACK  –  Ater  ACK,  everyone  iniJates  remaining  countdown  –  Tx  chooses  new  R  =  rand  (0,  CW_min)  

•  If  RTS  or  DATA  collides  (i.e.,  no  CTS/ACK  returns)  –  Indicates  collision  –  RTS  chooses  new  random  no.  R1  =  rand  (0,  2*CW_min)  –  Note  ExponenJal  Backoff  Ri  =  rand  (0,  2^i  *  CW_min)  –  Once  successful  transmission,  reset  to  rand(0,  CW_min)  

23

9/2/12  

9  

Recap •  CSMA/CD:  works  good  in  wired  networks;  but  doesn’t  work  in  wireless  networks.  

•  CMSA/CA  (“collision  avoidance”):  goal  is  to  reduce  the  occurrences  of  collisions  instead  of  detecJng  and  handling  them.  

24

Summary •  Today:  concept  of  MAC,  basic  idea  behind  MAC  &  IEEE  802.11.  

•  Coming  up:  more  details  about  MAC,  bit  about  PHY  layer,  more  about  IEEE  802.11  standard.  

25