Top Banner
CSE 30264 Computer Networks Prof. Aaron Striegel Department of Computer Science & Engineering University of Notre Dame Lecture 6 – January 28, 2010
41

CSE 30264 Computer Networks

Feb 25, 2016

Download

Documents

maille

CSE 30264 Computer Networks. Prof. Aaron Striegel Department of Computer Science & Engineering University of Notre Dame Lecture 6 – January 28, 2010. Today’s Lecture. Project 1 Description / Overview Physical Layer Shared Access Chapter 2.6-2.9. Application. Transport. Network. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CSE 30264 Computer Networks

CSE 30264

Computer Networks

Prof. Aaron StriegelDepartment of Computer Science & Engineering

University of Notre Dame

Lecture 6 – January 28, 2010

Page 2: CSE 30264 Computer Networks

CSE 30264 2

Today’s Lecture

• Project 1– Description / Overview

• Physical Layer– Shared Access– Chapter 2.6-2.9

Spring 2010

Physical

Data

Network

Transport

Application

Page 3: CSE 30264 Computer Networks

CSE 30264 3

Project 1

• TCP Client / Server– Pre-built client for testing your server– Remote server for testing your client– Will have debug features to help you out– May use C or C++

• Premise– Build a single-threaded TCP file client / server– Client connects to a specific server IP / port requesting

a specific file– Server responds with the length and binary data

Spring 2010

Page 4: CSE 30264 Computer Networks

CSE 30264 4

Project 1

Spring 2010

0x0009 horns.mp3

LF File Name

filefetch 129.74.153.157 9000 horns.mp3

Length of file name

connect

129.74.153.157, 9000

C S

0x00001001

Binary Data

LBD

Working in binary

Binary Data

Length of binary data

Page 5: CSE 30264 Computer Networks

CSE 30264 5

Project 1

• Important aspects– Working with binary values

• Request file name length 16 bit value (0-65535)– Response file name

• File length 32 bit value• Will need to monitor speed / status

– Update with information as data comes in– Will need to record time / data received– TCP keeps it in order for us

Spring 2010

Page 6: CSE 30264 Computer Networks

CSE 30264 6

Project 1

• Sanity checking– Make sure that you use network byte order– htons, htonl on the numbers– Check to make sure that any numbers are believable

• Can write with multiple calls– Write the size– Write the file name– TCP does the work for us figuring out how to split (or

combine) it for us

Spring 2010

Page 7: CSE 30264 Computer Networks

CSE 30264 7

Project 1

• Fixed server– Connect to 129.74.153.157, port 9000, TCP

• Example client– Test your own server

• Connect to the same machine– Open up two terminals or ssh sessions– IP address = 127.0.0.1 localhost

• Anything in the 127.* range works

Spring 2010

Page 8: CSE 30264 Computer Networks

CSE 30264 8

Project 1

• Two code directories– Client– Server

• Other notes– Create a makefile– Tutorial on web for how to create a makefile

• Stop by during office hours• Two weeks

– Do not save it until the last minute

Spring 2010

Page 9: CSE 30264 Computer Networks

CSE 30264 9

Port Sharing – Project 1

• Cannot share same port to listen to• Pick a random big number

– 10,000 + X– 16896 -> Striegel– Phone number, room number, etc.– When in doubt, check ps –A –f on the machine you log

in to

Spring 2010

Page 10: CSE 30264 Computer Networks

Spring 2010 CS 30264 10

Shared Access Networks

OutlineBus (Ethernet)Token ring (IBM, FDDI, RPR)Wireless (802.11, WiMAX)

Page 11: CSE 30264 Computer Networks

CSE 30264 11

Shared Access Networks

• Challenges– How do I let multiple devices share

the same communication medium?• Control / logic

– When is it my turn?– How long can I talk?

• Physical– Capacitance, resistance, inductance– Signal propagation – latency– Signal vs. noise – SNR– Directionality – half vs. full duplex

Spring 2010

Page 12: CSE 30264 Computer Networks

Spring 2010 CS 30264 12

Ethernet Overview• History

– Developed by Xerox PARC in mid-1970s– Roots in Aloha packet-radio network– Standardized by Xerox, DEC, and Intel in 1978– Evolved into the 802.3 standard– Robert Metcalfe – embraced KISS

Metcalfe’s Law

Value of a network isproportional to the squareof the number of users

Page 13: CSE 30264 Computer Networks

CSE 30264 13

CSMA / CD• CSMA/CD

– Carrier Sense– Multiple Access– Collision Detection

• Frame Format

Spring 2010

Destaddr

64 48 32CRCPreamble Src

addr Type Body1648

HDLC anyone? CSMA / CD style networks Max utilization* ~= 60%

Page 14: CSE 30264 Computer Networks

Spring 2010 CS 30264 14

Ethernet (cont)• Addresses

– Unique• 48-bit unicast address assigned to each adapter• Assigned in blocks to vendors

– Example: • 8:0:e4:b1:2

– Broadcast: all 1s (multicast first bit is a 1)

Destaddr

64 48 32CRCPreamble Src

addr Type Body1648

Why is dest address first?

Page 15: CSE 30264 Computer Networks

CSE 30264 15

Ethernet (cont)• Variations

– Ethernet – 10 Mb/s– Fast Ethernet – 100 Mb/s

• Usually what people call Ethernet now– Gigabit Ethernet – 1000 Mb/s 1 Gb/s

• Gig E– 10 Gigabit Ethernet

• 10 Gig• Interconnection

– Bus connected by hubs (old school)– Star connected by switches (everything today)

Spring 2010

Page 16: CSE 30264 Computer Networks

CSE 30264 16

Variations

• How do they differ?– Maximum cable length

• Less means faster– Star only vs. bus– Gap between packets

• IFS – Inter-Frame Spacing• Less means faster

– Minimum / maximum packet size• 64 / 1514 bytes (1500 byte payload)• Jumbo frames (8192 bytes)

Spring 2010

Page 17: CSE 30264 Computer Networks

Spring 2009 CS 30264 17

Ethernet

Bridge

Page 18: CSE 30264 Computer Networks

Spring 2009 CS 30264 18

Transmit Algorithm• If line is idle (CS)

– Send immediately– Upper bound message size of 1500 bytes– Must wait 9.6us between back-to-back frames

• IFS

• If line is busy…– Wait until idle and transmit immediately– Called 1-persistent (special case of p-persistent)

MAC – Media Access Control Layer 2

Page 19: CSE 30264 Computer Networks

Spring 2010 CS 30264 19

Algorithm (cont)

• If collision (CD)– Jam for 32 bits, then stop transmitting frame– Minimum frame is 64 bytes (header + 46 bytes of data)– Delay and try again

• 1st time: 0 or 51.2us• 2nd time: 0, 51.2, 102.4, or 153.6us• nth time: k x 51.2us, for randomly selected k=0..2n - 1• Give up after several tries (usually 16)• Exponential backoff

Page 20: CSE 30264 Computer Networks

Spring 2010 CS 30264 20

Collisions

(a)

(b)

(c)

A B

A B

A B

A B

(d)

Page 21: CSE 30264 Computer Networks

Spring 2009 CS 30264 21

Token Ring Overview

• Examples– IEEE 802.5 (based on earlier IBM Token Ring)– Fiber Distributed Data Interface (FDDI)– IEEE 802.17 (Resilient Packet Ring or RPR)

Page 22: CSE 30264 Computer Networks

Spring 2010 CS 30264 22

Token Ring (cont)• Idea

– Frames flow in one direction: upstream to downstream – Special bit pattern (token) rotates around ring– Must capture token before transmitting– Release token after done transmitting

• Immediate release• Delayed release

– Remove your frame when it comes back around– Stations get round-robin service

• Frame Format

Control8 8 8 24

CRCStart offrame

End offrame

Destaddr Body

4848Srcaddr Status

32

Page 23: CSE 30264 Computer Networks

Spring 2009 CS 30264 23

Timed Token Algorithm

• Token Holding Time (THT)– Upper limit on how long a station can hold the token

• Token Rotation Time (TRT)– How long it takes the token to traverse the ring– TRT <= ActiveNodes x THT + RingLatency

Page 24: CSE 30264 Computer Networks

Spring 2009 CS 30264 24

Token Maintenance• Lost Token

– No token when initializing ring– Bit error corrupts token pattern– Node holding token crashes

• Monitoring for a Valid Token– Should periodically see valid transmission (frame or

token)– Timer: NumStations * THT + RingLatency– Set timer and send claim frame if it fires

Page 25: CSE 30264 Computer Networks

Spring 2009 CS 30264 25

FDDI

• Runs on fiber• Consists of dual ring

Page 26: CSE 30264 Computer Networks

Spring 2009 CS 30264 26

Resilient Packet Ring (802.17)• Focus on resiliency, bandwidth efficiency, QoS• 2 counter-rotating optical fiber rings• Both rings used simultaneously (bandwidth)• Receiver removes RPR frame (bandwidth)• No tokens! Instead: buffer insertion• 3 classes supported (QoS):

– class A: low latency, low jitter– class B: predictable latency and jitter– class C: best-effort

• Uses wrapping and steering (resiliency)– wrapping: similar to FDDI– steering: inform other nodes of failure, can use opposite direction

Page 27: CSE 30264 Computer Networks

CSE 30264 27

Which one?

• Unclear– Ethernet dominates in the LAN

• Local Area Network– FDDI / SONET / etc.

• Dominate in the MAN• Metro Area Network

– Why not Ethernet everywhere?• Broadcast scope

Spring 2010

Page 28: CSE 30264 Computer Networks

CSE 30264 28

Wireless

• Unique set of challenges vs. wired– BER++– Implicitly a broadcast

• Omni antenna• Directed antenna

– Heavy environmental effects• No real “shielding”

– Faraday cage• Frequency up

– More power– Inanimate objects bad

Spring 2010

Page 29: CSE 30264 Computer Networks

Spring 2009 CS 30264 29

Wireless

• Bluetooth:– 10m, 2.1Mbps (shared), peripheral devices to computer

• Wi-Fi 802.11:– 100m, 54Mbps (shared), computer to base stations

• WiMAX 802.16:– 10km, 70Mbps (shared), link buildings and towers

• 3G Cellular:– Tens of km, 384+ Kbps (not shared), cell phone to

tower

Page 30: CSE 30264 Computer Networks

Spring 2009 CS 30264 30

Modes of Communication

Managed Ad hoc

Page 31: CSE 30264 Computer Networks

Spring 2009 CS 30264 31

Bluetooth (802.15.1)

• 2.45GHz band, range of 10m• Version 2.0: 2.1Mbps, low power consumption• Piconet: master-slave

Page 32: CSE 30264 Computer Networks

Spring 2010 CS 30264 32

Wi-Fi

• IEEE 802.11: 2.4 GHz band, 1 Mb/s• IEEE 802.11b: 2.4GHz band, 11Mb/s• IEEE 802.11a: 5GHz band, 54Mb/s• IEEE 802.11g: 2.4GHz band, 54Mb/s• IEEE 802.11n: Dual band (2.4, 5), 270 Mb/s

MIMO Block Ack

Page 33: CSE 30264 Computer Networks

Spring 2009 CS 30264 33

Spread Spectrum

• Idea– Spread signal over wider frequency band than required– Originally designed to thwart jamming

• Frequency Hopping– Transmit over random sequence of frequencies– Sender and receiver share…

• Pseudorandom number generator• Seed

– 802.11 uses 79 x 1MHz-wide frequency bands

Page 34: CSE 30264 Computer Networks

Spring 2009 CS 30264 34

Spread Spectrum (cont)• Direct Sequence

– For each bit, send XOR of that bit and n random bits– Random sequence known to both sender and receiver – Called n-bit chipping code – 802.11 defines an 11-bit chipping code

Random sequence: 0100101101011001

Data stream: 1010

XOR of the two: 1011101110101001

0

0

0

1

1

1

Page 35: CSE 30264 Computer Networks

Spring 2009 CS 30264 35

Collisions Avoidance

• Similar to Ethernet• Problem: hidden and exposed nodes

Page 36: CSE 30264 Computer Networks

Spring 2009 CS 30264 36

MACA• Multiple Access with Collision Avoidance• Sender transmits RequestToSend (RTS) frame• Receiver replies with ClearToSend (CTS) frame• Neighbors…

– see CTS: keep quiet– see RTS but not CTS: ok to transmit

• Receiver sends ACK when has frame– neighbors silent until see ACK

• Collisions– no collision detection– known when CTS not received– exponential backoff In general,

bad, bad, bad

Page 37: CSE 30264 Computer Networks

Spring 2009 CS 30264 37

Supporting Mobility• Case 1: ad hoc networking• Case 2: access points (AP)

– Tethered– Each mobile node associates with an AP

BH

AF

G

D

AP-2AP-3AP-1

C E

Distribution system

Page 38: CSE 30264 Computer Networks

Spring 2009 CS 30264 38

Mobility (cont)

• Scanning (selecting an AP)– Node sends Probe frame– All AP’s w/in reach reply with ProbeResponse frame– Node selects one AP; sends it AssociateRequest

frame– AP replies with AssociationResponse frame– New AP informs old AP via tethered network

• When– Active: when join or move– Passive: AP periodically sends Beacon frame

Page 39: CSE 30264 Computer Networks

Spring 2009 CS 30264 39

802.11

• Up to 2312 bytes of data• 32-bit CRC• 4 addresses, usage depends on mode:

– Addr1 is target, Addr2 is source– Addr1 is ultimate target, Addr2: immediate sender,

Addr3 is intermediate target, Addr4: original source

Page 40: CSE 30264 Computer Networks

Spring 2009 CS 30264 40

WiMAX

• Worldwide Interoperability for Microwave Access• Standardized by WiMAX Forum, IEEE 802.16• Typical distance: 1-6miles, up to 30miles• “subscriber stations” (e.g., antenna on roof)• Up to 70Mbps• Time Division Duplexing (TDD)• Frequency Division Duplexing (FDD)

Page 41: CSE 30264 Computer Networks

Spring 2009 CS 30264 41

Cell Phone Technologies

• Uses base stations, area served called “cell”• 1G: analog• 2G, 2.5G (e.g., GSM): digital• GPRS: General Packet Radio Service (typically

30-70Kbps)• 3G:

– UMTS (Universal Mobile Telecommunications System)