Big Picture Lab 3

advertisement
Big Picture: Lab 3
Networks (OSI-view)
application
presentation
session
transport
network
data link
physical
IP
network
data link
physical
application
presentation
session
transport
network
data link
physical
ECE 354 Copyright ECE Department, some slides modified from W. Wolf, Computers as Components, Morgan Kaufmann, 2005
Networking for Embedded Systems
 Why we use networks.
 Network abstractions, OSI.
 Embedded Networks and TCP/IP.
ECE 354
Copyright ECE Department, some slides modified from W. Wolf, Computers as Components, Morgan Kaufmann, 2005
2
Metcalfe’s Rule
 Metcalfe: the “value” of a network is proportional
to the square of the number of nodes
• adding a node benefits existing nodes
• the larger the network the larger the benefit
ECE 354
Copyright ECE Department, some slides modified from W. Wolf, Computers as Components, Morgan Kaufmann, 2005
3
Networks in embedded systems
 Internet-enabled embedded system: any
embedded system that includes an Internet
interface (e.g., burglar alarm system).
 Internet appliance: embedded system designed
for a particular Internet task (e.g. email).
• UMASS ECE SDP Internet-connected Refrigerator
 Laser printer.
 Home automation system.
ECE 354
Copyright ECE Department, some slides modified from W. Wolf, Computers as Components, Morgan Kaufmann, 2005
4
Network abstractions
 International Standards Organization (ISO)
developed the Open Systems Interconnection
(OSI) model to describe networks:
• 7-layer model.
 Provides a standard way to classify network
components and operations.
 It is a conceptual model only.
ECE 354
Copyright ECE Department, some slides modified from W. Wolf, Computers as Components, Morgan Kaufmann, 2005
5
OSI model
application
end-user interface
presentation
data format
session
ECE 354
application dialog control
transport
connections
network
end-to-end service
data link
reliable data transport
physical
mechanical, electrical
Copyright ECE Department, some slides modified from W. Wolf, Computers as Components, Morgan Kaufmann, 2005
6
Hardware network architectures
Many different types of networks based on
• topology;
• scheduling of communication; and
• routing.
ECE 354
Copyright ECE Department, some slides modified from W. Wolf, Computers as Components, Morgan Kaufmann, 2005
7
Point-to-point networks
One source, one or more destinations:
PE 1
PE 2
link 1
ECE 354
PE 3
link 2
Copyright ECE Department, some slides modified from W. Wolf, Computers as Components, Morgan Kaufmann, 2005
8
Bus networks
Common physical connection:
PE 1
header
ECE 354
PE 2
address
PE 3
data
PE 4
ECC
packet format
Copyright ECE Department, some slides modified from W. Wolf, Computers as Components, Morgan Kaufmann, 2005
9
Ethernet – a Physical Layer
 Dominant non-telephone LAN.
 Versions: 10 Mb/s, 100 Mb/s, 1 Gb/s, 10 Gb/s,
100Gb/s.
 Goal: reliable communication over an unreliable
medium.
ECE 354
Copyright ECE Department, some slides modified from W. Wolf, Computers as Components, Morgan Kaufmann, 2005
10
Ethernet topology
Bus-based system
A
ECE 354
B
C
Copyright ECE Department, some slides modified from W. Wolf, Computers as Components, Morgan Kaufmann, 2005
11
Ethernet performance
 Carrier sense multiple access with collision
detection (CSMA-CD)
• sense collisions;
• exponentially back off in time;
• retransmit.
 Quality-of-service tends to non-linearly decrease
at high load levels.
 Can’t guarantee real-time deadlines. However,
may provide very good service at proper load
levels.
ECE 354
Copyright ECE Department, some slides modified from W. Wolf, Computers as Components, Morgan Kaufmann, 2005
12
Internet Protocol – a Network Layer
 Internet Protocol (IP) is basis for Internet.
 Provides an internetworking standard: between two
Ethernets, Ethernet and token ring, etc.
 Higher-level services are built on top of IP.
ECE 354
Copyright ECE Department, some slides modified from W. Wolf, Computers as Components, Morgan Kaufmann, 2005
13
IP in communication
application
application
presentation
presentation
session
session
ECE 354
transport
IP
transport
network
network
network
data link
data link
data link
physical
physical
physical
node A
router
node B
Copyright ECE Department, some slides modified from W. Wolf, Computers as Components, Morgan Kaufmann, 2005
14
IP packet
 Includes:
•
•
•
•
version, service type, length
time to live, protocol
source and destination address (IP addresses)
data payload
 Maximum data payload is 65,535 bytes.
ECE 354
Copyright ECE Department, some slides modified from W. Wolf, Computers as Components, Morgan Kaufmann, 2005
15
IP addresses
 32 bits in early IP, 128 bits in IPv6.
 Typically written in form xxx.xx.xx.xx.
 Names (foo.baz.com) translated to IP address by
domain name server (DNS).
ECE 354
Copyright ECE Department, some slides modified from W. Wolf, Computers as Components, Morgan Kaufmann, 2005
16
TCP/IP Basics : Data Encapsulation
Application Data
App Header
Application Data
TCP Header App Header
Application Data
IP Header
TCP Header App Header
Application Data
Ethernet Header IP Header
TCP Header App Header
Application Data
ECE 354
Ethernet Trailer
Copyright ECE Department, some slides modified from W. Wolf, Computers as Components, Morgan Kaufmann, 2005
17
Software Abstractions - Message-based
 Transport layer provides message-based
programming interface:
• send_msg(adrs,data1);
 Data must be broken into packets at source,
reassembled at destination.
ECE 354
Copyright ECE Department, some slides modified from W. Wolf, Computers as Components, Morgan Kaufmann, 2005
18
What’s next ?
 Lab 3 details
ECE 354
Copyright ECE Department, some slides modified from W. Wolf, Computers as Components, Morgan Kaufmann, 2005
19
Backup
ECE 354
Copyright ECE Department, some slides modified from W. Wolf, Computers as Components, Morgan Kaufmann, 2005
20
Ethernet packet format
preamble
ECE 354
start
frame
source
adrs
dest
data
length
padding CRC
adrs
payload
Copyright ECE Department, some slides modified from W. Wolf, Computers as Components, Morgan Kaufmann, 2005
21
Embedding TCP/IP – The Advantages
Provides a universal,
flexible, User Interface
for the Device
•
UI can be exposed using
a standard browser
•
Internet
•
Opens possibilities of
remote diagnostics and
software upgrade
•
ECE 354
Copyright ECE Department, some slides modified from W. Wolf, Computers as Components, Morgan Kaufmann, 2005
22
Embedding TCP/IP – The issues
•Resource Limitations
– Code Size
– Data Size
– CPU Processing capacity
•Operating System Services
– Timer Services
– Memory Management
– Network Drivers
•Processing Latency
– Layer to layer buffering
ECE 354
Copyright ECE Department, some slides modified from W. Wolf, Computers as Components, Morgan Kaufmann, 2005
23
Bus arbitration
Fixed: Same order of resolution every time.
Fair: every PE has same access over long periods.
• round-robin: rotate top priority among PEs.
fixed
A
B
C
A
B
C
round-robin
A
B
C
B
C
A
A,B,C
ECE 354
A,B,C
Copyright ECE Department, some slides modified from W. Wolf, Computers as Components, Morgan Kaufmann, 2005
24
To Sum Up
 TCP/IP is close to 20 years old, but it has outlasted
more modern protocols and has become the de - facto
standard for the internet
 Proliferation of internet enabled devices is predicted in
the next wave of the internet
 As developers try to get their embedded devices on the
net, they face the issue of the networking problem may
exceed the application problem
 Practical solutions are currently available to connect
embedded devices to the internet
ECE 354
Copyright ECE Department, some slides modified from W. Wolf, Computers as Components, Morgan Kaufmann, 2005
25
Download