IoT Week4 Day1 Lecture
IoT Week4 Day1 Lecture
Acknowledgement
University of Notre Dame
Course Overview
Lecture Lab
Fundamentals of IoT, basic Basic Python programming, meet
Week 1 concepts, applications your Raspberry Pi
Hi
TCP connection
request
Hi
TCP connection
Got the response
time?
2:00 Get http://www.awl.com/kurose-ross
time <file>
Client/Server Model
• Client: “active” (initiates communication)
• Server: “passive” (listens and responds)
Client/Server Model Examples
• HTTP (Hypertext Transfer Protocol)
• SMTP (Simple Mail Transfer Protocol)
• SSH (Secure Shell)
• DNS (Domain Name System)
• NFS/AFS (Network/Andrew File System)
Network Protocols (“Protocol Stack”)
Application Application
Layer Layer
Presentation Presentation
Layer Layer
Session Session
Layer Layer
Transport Transport
Layer Communication Network Layer
Figure 2.6
Network Protocols (Headers/Trailers)
Application A Application B
data
Application Application
Layer data ah Layer
Presentation Presentation
Layer data ph Layer
Session Session
Layer data sh Layer
Transport Transport
Layer data th Layer
Network Network
Layer data nh Layer
Physical Physical
Layer bits Layer
Why A Layered Design?
• An explicit structure for dealing with a
complex system
• Simplifies the design process
• Modularity of layers eases maintenance
and updating of system components
• Accommodates incremental changes
Open System Interconnection (OSI)
Physical Layer (Layer 1)
• Physical/electrical characteristics
• Cable type, length, connectors, voltage levels, signal
durations, ...
• Binary data (bits) as electrical or optical signals
• Frequencies (wireless)
Wireless Characteristics
• VLF = Very Low Frequency UHF = Ultra High Frequency
• LF = Low Frequency SHF = Super High Frequency
• MF = Medium Frequency EHF = Extra High Frequency
• HF = High Frequency UV = Ultraviolet Light
• VHF = Very High Frequency
1 Mm 10 km 100 m 1m 10 mm 100 m 1 m
300 Hz 30 kHz 3 MHz 300 MHz 30 GHz 3 THz 300 THz
• Low Frequencies:
– low data rates
– travel long distances
– follow Earth’s surface
– penetrate objects and water (submarine
communication)
• High Frequencies:
– high data rates
– short distances
– straight lines
– cannot penetrate objects (“Line of Sight” or LOS)
Other Propagation Effects
• Shadowing
• Reflection at large obstacles
• Refraction depending on the density of a medium
• Scattering at small obstacles
• Diffraction at edges
Delay Spread
multipath
LOS pulses pulses
signal at sender
signal at receiver
Digital Modulation
• Amplitude Shift Keying (ASK): 1 0 1
– very simple
– low bandwidth requirements t
– very susceptible to interference
1 0 1
• Frequency Shift Keying (FSK):
– needs larger bandwidth
t
1 0 1
AA BB CC
collision
Example: Ethernet
Don’t
Don’t
transmit
transmit
AA BB CC
Can
Can collisions
collisions still
still occur?
occur?
Access point
Wi-Fi router
Base station
Hotspot
Example: Wi-Fi (802.11)
• CSMA/CA Protocol
– Carrier Sense
– Multiple Access
– Collision Avoidance
• Channel reservations:
– Transmitter sends request-to-send (RTS)
– Receiver sends clear-to-send (CTS)
• Advantages:
– Nodes hearing RTS and/or CTS keep quiet
– If collision, only small RTS or CTS packets are lost
Network Layer (Layer 3)
• Dominant protocol: IP = Internet Protocol
• Addressing and routing (sender & receiver IP address)
• Uses 32 bit hierarchical address space with location
information embedded in the structure
Network ID Host ID
4 bytes
Presentation Presentation
Layer Layer
Session Session
Layer Layer
Transport Transport
Layer Communication Network Layer
Figure 2.6
Routers
• Form backbone of the Internet
• Use IP layer to identify source and destination of packets
• Look up routing tables that determines “next hop”
– Unreliable!
• Packets can get lost; packets can arrive out of order
Transport Layer
• TCP (Transmission Control Protocol)
• Reliable protocol!
• Adds ports (just like UDP), but also provides:
– In-order delivery of packets (using sequence numbers)
– Reliable delivery: using acknowledgment (ACK) packets
Packet
ACK
• UDP:
– can be “faster”
• no flow/congestion control “slowing down” traffic
• no retransmissions
• good for “real-time” traffic
– out-of-order arrival: can also “reorder” at application level
– loss of data: can be acceptable
• missing frames in video/audio stream
Upper Layers (Layers 5-7)
• Session Layer
– Management of “sessions”
• Presentation Layer
– Data translation, formatting, encryption, compression
• Application Layer
– Interface between user applications and lower network services
Example: Web Servers
Request
HTTP HTTP
client server
Response
Example: Web Servers
HTTP HTTP
client server
Ephemeral Port 80
Port # GET 80, #
TCP TCP
#, 80 STATUS
Example: Web Servers
HTTP Request
Header contains
source and Frame
destination physical Ethernet Check
addresses; network Header Sequence
protocol type
BREAK