以太网通信
A&D CS2 FA
以太网介绍
可能的通信方式
Send/Receive
通信
2
Service & Support
Automation and Drives
2
S7-通信
以太网介绍
历史历史
1968: Hawaii大学进行了无线电载波试验。诞生了被称为“ALOHANET”的无线电网络。
多路访问( multiple access )的方法逐步出现,成为Ethernet的基本原理。
1972: 第一界国际计算机通讯大会上, ARPANET 首次面世。同时创立了InterNetwork
Working Group (INWG) ,该组织从事公共传输
的开发工作,TCP/IP协议逐渐诞
生并完备。
1976:Metcalfe和Boggs发
了题为《以太网:局域网的分布型信息包交换》的著名论
文。
1979:DEC(Digital Equipment Corp.)、Intel和施乐共同将此网络
化,正式将该网
络定名为以太网。
First Drawing by Bob
Metcalfe
以太网介绍
可能的通信方式
Send/Receive
通信
3
Service & Support
Automation and Drives
3
S7-通信
7 Application Layer应用层7 Application Layer应用层
6 Representation Layer
表示层
6 Representation Layer
表示层
5 Session Layer5 Session Layer
4 Transport Layer4 Transport Layer
3 Network-Layer3 Network-Layer
2 Link Layer2 Link Layer 访问传输介质, 保证数据报文的安全性
访问传输介质,
保证数据报文的安全性
application
oriented
layers
应用层
application
oriented
layers
应用层
transport
oriented
layer
传输层
transport
oriented
layer
传输层
应用软件应用软件
1 Physical Layer1 Physical Layer 收发数据报文产生电信号
收发数据报文
产生电信号
格式化数据信息格式化数据信息
同步
控制通讯
同步
控制通讯
连接通讯站点,可靠数据通信连接通讯站点,可靠数据通信
数据打包
选择网络路径
数据打包
选择网络路径
ISO / OSI ISO / OSI 参考模型参考模型
物理层
数据链路层
网络层
传输层
会话层
以太网介绍
以太网介绍
可能的通信方式
Send/Receive
通信
4
Service & Support
Automation and Drives
4
S7-通信
以太网介绍
ISO / OSI ISO / OSI 参考模型参考模型
Layer 7
Layer 6
Layer 5
Layer 4
Layer 3
Layer 2
Layer 1
Application
Presentation
Session
Transport
Network
Data Link
Physical
The Ethernet specification encompasses
Layers 1 and 2 of the reference model:
Data Link Layer(数据链路层):
2b) Logical Link Control (LLC)
连接高层子网
数据通讯的安全性
提供逻辑通道
2a)Media Access Control MAC)
数据分组 (into frames)格式化,创建帧
错误校验 (CRC)
CSMA/CD
Physical Layer(物理层):
定义电流,电压
频率
半双工/全双工
物理特性 (电缆,
连接器等)
以太网介绍
可能的通信方式
Send/Receive
通信
5
Service & Support
Automation and Drives
5
S7-通信
Methods of operation according to the ISO/OSI modelMethods of operation according to the ISO/OSI model
ASAP
PSAP
SSAP
TSAP
NSAP
LSAP
PHSAP
MAU
Application process
Medium
(1) - Instance
(2) - Instance
(3) - Instance
(4) - Instance
(5) - Instance
(6) - Instance
(7) - Instance
PHYSICAL LAYER
LINK LAYER
NETWORK LAYER
TRANSPORT LAYER
SESSION LAYER
PRESENTATION LAYER
APPLICATION LAYER
以太网介绍
ISO协议中每层
之间的访问是通
过“SAP”号来寻
址的。
以太网介绍
可能的通信方式
Send/Receive
通信
6
Service & Support
Automation and Drives
6
S7-通信
以太网介绍
TCP/IP TCP/IP 基础基础
TCP/IP是20世纪70年代中期,美国国防部为ARPANET开发的网络体系。
目的为了将大学和研究所连接起来。
由于卫星,无线电等的出现,需要新体系网络结构来解决无缝连接。
7 Application Layer应用层7 Application Layer应用层
6 Representation Layer
表示层
6 Representation Layer
表示层
5 Session Layer5 Session Layer
4 Transport Layer4 Transport Layer
3 Network-Layer3 Network-Layer
2 Link Layer2 Link Layer
1 Physical Layer1 Physical Layer 物理层
数据链路层
网络层
传输层
会话层
网络接口层
以太网,ATM,X2.5
网络接口层
以太网,ATM,X2.5
互连网层 IP互连网层 IP
传输层TCP,UDP传输层TCP,UDP
使用物理地址
使用IP地址
OS外部空间
OS内部空间
应用层FTP,SMTP应用层FTP,SMTP
以太网介绍
可能的通信方式
Send/Receive
通信
7
Service & Support
Automation and Drives
7
S7-通信
以太网介绍
TCP/IP TCP/IP 基础基础
RFC Request for Comments
通过国际互联网组织发布,用于
• 描述 network 和 TCP/IP protocol 标准
• 用于对已存在的协议进行小的补充,回答疑问以及提出建
议
早期的RFC被称为“Internet drafts” ,目前已有的RFC已经超过
6000
例如: TCP 是由RFC 793定义的,RFC 1006 也被Siemens 用来
进行通讯服务
以太网介绍
可能的通信方式
Send/Receive
通信
8
Service & Support
Automation and Drives
8
S7-通信
以太网介绍
ISOISO--ONON--TCPTCP
以太网介绍
可能的通信方式
Send/Receive
通信
9
Service & Support
Automation and Drives
9
S7-通信
以太网介绍
TCP/IP ArchitectureTCP/IP Architecture
7
6
5
4
3
2
1
E
q
u
i
v
a
l
e
n
t
t
o
I
S
O
-
L
e
v
e
l
s
A
pp
lic
at
io
n
or
ie
nt
ed
Le
ve
l(s
)
Tr
an
sp
or
t
o r
i e
nt
ed
Le
ve
l s
Subnet
TCP UDP
IP
ICMP
ARP RARP
TELNET
TFTP
FTP
SMTP
DNS SNMP
HTTP DHCP
NTP
以太网介绍
可能的通信方式
Send/Receive
通信
10
Service & Support
Automation and Drives
10
S7-通信
以太网介绍
Important AddressesImportant Addresses
NIC InterfaceMAC AddressSubnet
HostIP-AddressIP
ApplicationPort NumbersTCP/UDP
Identification ofAddressLevel
Tr
an
sp
or
t
o r
i e
nt
ed
Le
ve
l s
以太网介绍
可能的通信方式
Send/Receive
通信
11
Service & Support
Automation and Drives
11
S7-通信
以太网介绍
Port numberPort number
TCP协议中,运行在系统中单独的应用(以及它们的协议)通过端口Port来寻址,有些
端口是自由的,任何人都可以在自己的应用中使用它们,还有一些端口就是被系统保
留,有着特定的应用。这点是与ISO协议有区别的。
Telnet SMTP FTP RLOGIN
Further
well-known
Ports SNMP
Type/LLC SAP
Protocol Nr.
Port Nr.
TCP UDP
IP
RFC1006
102
Port 20 = FTP
Port 21 = FTP
Port 23 = Telnet
Port 25 = SMTP
Port 53 = DNS
Port 68 = BootP/DHCP
Port 69 = TFTP
Port 80 = HTTP
Port 102= RFC 1006
Port 135 = PROFINET
Port 161 = SNMP
Port 162 = SNMP
以太网介绍
可能的通信方式
Send/Receive
通信
12
Service & Support
Automation and Drives
12
S7-通信
以太网介绍
IPIP--AddressAddress
在TCP/IP网络中,每一台电脑都会有的一个唯一的数字的地址。IP地址由两
部分组成:网络号和主机号。
IP 地址由NIC (Network Information Center )统一分配和管理,由ISP
( Internet Service Provider )提供给用户。
IPv4 (IP Version 4) - size of the IP address: 4 Byte
IPv6 (IP Version 6) - size of the IP address: 16 Byte
Class A: 0-127.H.H.H about 16 Mio hosts/network
Class B: 128-191.N.H.H about 65000 hosts/networks
Class C: 192-223.N.N.H 254 hosts/network
Class D: 224-239.M.M.M (Multicast)
Class E: 240-255.R.R.R (Reserved)
以太网介绍
可能的通信方式
Send/Receive
通信
13
Service & Support
Automation and Drives
13
S7-通信
以太网介绍
RoutingRouting
当把数据从局域网(LAN)传到公网
(WAN)时,路由器(Router)是必须的
设备。
路由器(Router)连接两个网段,因而
具有两个IP地址。
通过路由表,路由器检测如何将一个数
据包发送到指定的地址设备。
主机一旦分辨出路由器,则会向它发
报文,将地址信息传递给路由器。
LAN
LAN
LAN
142.20.10.1
142.20.10.2
192.20.30.7
192.20.30.12
134.218.30.7
134.218.30.16
Router
Router
以太网介绍
可能的通信方式
Send/Receive
通信
14
Service & Support
Automation and Drives
14
S7-通信
以太网介绍
Transfer mediaTransfer media(传输介质)(传输介质)
一般来讲,网络传输介质有3种:
z 同轴电缆(Coaxial cable = asymmetric cable)
z 双绞线 (Twisted Pair= symmetric cable)
z 光纤 Glass fibre (Fibre Optic)
无线传输
以太网介绍
可能的通信方式
Send/Receive
通信
15
Service & Support
Automation and Drives
15
S7-通信
以太网介绍
光纤分类光纤分类
Fibre longitudinal section
with typical steel propagation
Refractive index
profileFibre cross section
50um
125um
250um
280um
125um
9um
Mono mode fibre
Multimode-
fibre with
“gradient” profile
单模光纤
Multimode-
fibre with
“step” profile
多模光纤
以太网介绍
可能的通信方式
Send/Receive
通信
16
Service & Support
Automation and Drives
16
S7-通信
以太网介绍
典型的光纤连接头典型的光纤连接头
ST-Connector
Straight
Tip
FDDI- Connector
Fibre
Distributed
Data
Interface
BFOC
for OSM
Previously used with
SINEC H1-Star coupler
SC-Connector
Duplex version
also available
FSMA- Connector
Field
Installable
Subminiature
Assembly
以太网介绍
可能的通信方式
Send/Receive
通信
17
Service & Support
Automation and Drives
17
S7-通信
Connection typesConnection types
Point-to-Point 连接 (PtP)
Multi-point 连接 (MP)
•connectionless (cl)
Broadcast
Multicast
•connection oriented (co)
•connectionless (cl)
以太网介绍
以太网介绍
可能的通信方式
Send/Receive
通信
18
Service & Support
Automation and Drives
18
S7-通信
使用以太网通信处理器 Ethernet-CPs可能的连接方式
PG/OP通信
S7 通信
S5 兼容通信
PROFINET 通信
通过 Web 浏览器
HTML 对过程进行控制
FTP数据管理
协议
- ISO
- TCP/IP (RFC 1006)
使用 Send/Receive 接口:
- ISO-传输
- ISO-on-TCP (TCP/IP with RFC 1006)
- TCP and UDP
- E-Mail
使用 FETCH/WRITE :
- ISO-传输
- ISO-on-TCP (TCP/IP with RFC 1006)
- TCP
协议
- TCP
协议
- HTML / IP-协议
协议
- FTP/ IP-协议
以太网介绍
可能的通信方式
Send/Receive
通信
19
Service & Support
Automation and Drives
19
S7-通信 S7- 400
S7- 300
S7- 400S7- 300 S5-115 to 155U/H PC-Station
PG/OP 通信
S7 通信
Send/Receive
HTML-访问
PROFINET
FTP-Service
OPC-Server
PG/OP-通信
S7-通信
Send/Receive
HTML-访问
PROFINET
FTP-Dienst
OPC-Server
Send/Receive
Fetch/Write
Send/Receive
Fetch/Write
S7-通信
Send/Receive
FTP-服务
PROFINET
S7-通信
Send/Receive
FTP-服务
PROFINET
S7-通信
Send/Receive
FTP-服务
PROFINET
S7-通信
Send/Receive
FTP-服务
PROFINET
节点间可能的通信方式
以太网介绍
可能的通信方式
Send/Receive
通信
20
Service & Support
Automation and Drives
20
S7-通信
ISO/OSI 模型内的Send/Receive 和S7 通信
S7-通信
Send/Receive
通信
以太网介绍
可能的通信方式
Send/Receive
通信
21
Service & Support
Automation and Drives
21
S7-通信
Siemens IE Siemens IE 通讯通讯
Siemens IE 通讯
功能块 通讯连接
BSEND/BRCV(FB12/
FB13)
USEND/URCV(FB8/F
B9)
PG/OP STEP 7/WinCC
S7 connection
AG-SEND/AG-
RCV(FC5/FC6)
ISO connection
ISO-on-TCP
connection
TCP connection
UDP connection
通讯服务 通讯协议
PG/OP服务
S7 communication ISO
ISO-on-TCP
S5-Compatible
communication
ISO
ISO-on-TCP
TCP
UDP
以太网介绍
可能的通信方式
Send/Receive
通信
22
Service & Support
Automation and Drives
22
S7-通信
Siemens IE Siemens IE 通讯服务通讯服务
• S5-compatible communication service
SEND/RECEIVE interface 源于SIMATIC S5 ,而在SIMATIC C7中为“S5-
compatible communication ”的一部分。通过SEND/RECEIVE interface 可以实
现一个 SIMATIC S7 站与 SIMATIC S7 站、 SIMATIC S5 站、PG/PC 以及其他
站点之间的通讯。
由于SEND/RECEIVE interface 基于ISO模型1~4层所有的协议,因而也被认为
是一种开放式的通讯(open communication)。
通讯数据量可以达到8K bytes。
Siemens IE 通讯
以太网介绍
可能的通信方式
Send/Receive
通信
23
Service & Support
Automation and Drives
23
S7-通信
• ISO-Communication
ISO 传输服务通过组态连接提供
SEND/RECEIVE interface服务在以
太网上传输数据。组态的连接自动的
被ISP传输服务所监视。最大传输数
据量为8K 字节。
数据自动重发功能和基于第2层的
CRC校验保证了数据传输的完整性和
可靠性,通讯方可以进行接收数据的
确认。
选择建立ISO连接只需要在Netpro下
新建连接,类型选择为“ISO transport
connection”即可。此时该服务使用的
协议为ISO协议。
ISO通讯速度较快,可是不能实现网
络路由,只能用于局域网通讯。
Send/Receive: ISO-传输 连接
以太网介绍
可能的通信方式
Send/Receive
通信
24
Service & Support
Automation and Drives
24
S7-通信
•ISO- on- TCP
RFC1006 标准用于将数据打包,同
时实现将ISO协议映射到TCP协议
上,从而使网络连接突破了局域网
的限制 ,可以路由到公网上去。
同样,数据自动重发功能和基于第2
层的CRC校验保证了数据传输的完整
性和可靠性,通讯方可以进行接收
数据的确认。 数据的最大传输量为
8K字节。
选择建立ISO-on-TCP连接只需要在
Netpro下新建连接,类型选择为
“ISO-on-TCP connection”即可。
此时该服务使用的协议为ISO-on-
TCP 协议。
Send/Receive: ISO-On-TCP连接
以太网介绍
可能的通信方式
Send/Receive
通信
25
Service & Support
Automation and Drives
25
S7-通信
• TCP/IP communication
TCP/IP 提供面向连接的数据通讯,
数据并不会被打包因而并没有数据
包确认位,再者TCP服务提供了统
一的socket 接口到每一个终端,因
而数据块(最大8K字节)可以整体
发送,这和ISO-on-TCP 不同,因
为ISO-on-TCP在这里要花费较多的
时间。
选择建立TCP连接只需要在Netpro
下新建连接,类型选择为“TCP
connection”即可。可以看到此时的
通讯通过IP地址和PORT号来收发
数据,此时该服务使用的协议为
TCP协议。
Send/Receive: TCP 连接
以太网介绍
可能的通信方式
Send/Receive
通信
26
Service & Support
Automation and Drives
26
S7-通信
• UDP communication
UDP提供简单数据传输,无需确
认,与TCP同属第4层协议。通过IP
地址进行寻址,最大发送数据量为
2K字节。同TCP相比,UDP属于无
连接的协议,数据报文无需确认
选择建立UDP连接只需要在Netpro
下新建连接,类型选择为“UDP”即
可。可以看到此时的通讯通过IP地
址和PORT号来收发数据, 此时该服
务使用的协议为UDP协议。
Send/Receive: UDP 连接
以太网介绍
可能的通信方式
Send/Receive
通信
27
Service & Support
Automation and Drives
27
S7-通信
什么是S7-通信?
S7 协议是SIMATIC S7 家族的标准通信协议
SIMATIC S7 家族使用S7-应用接口的通信不依赖特定的总线
系统 (Ethernet, PROFIBUS, MPI).
通信接口位于 ISO-OSI-参考模型的第 7 层
S7- 通信分为以下两种关系
客户机-服务器关系 (单边):
PUT / GET
客户机-客户机关系 (双边) :
USEND / URCV
BSEND / BRCV
以太网介绍
可能的通信方式
Send/Receive
通信
28
Service & Support
Automation and Drives
28
S7-通信
Siemens IE Siemens IE 通讯服务通讯服务
• S7-Communication
Siemens Industrial Ethernet
我们可以通过建立S7的连接在
工业以太网上使用S7通讯服
务。而S7通讯服务使用的是通
过ISO通讯协议和ISO-On-TCP
通讯协议来实现的。
这就意味着,我们在选择CP模
板时,该模板必须支持ISO协
议,否则无法建立S7的连接。
PN接口虽已不支持ISO协议,
但依旧可以建立S7的连接,因
为它支持ISO-on-TCP。
如图,我们在NetPro下新建连
接,连接类型为“S7 connection”
以太网介绍
可能的通信方式
Send/Receive
通信
29
Service & Support
Automation and Drives
29
S7-通信
Siemens IE Siemens IE 通讯服务通讯服务
• S7-Communication
Siemens Industrial Ethernet
不选择
“TCP/IP”,则通
过MAC地址来寻
址建立连接。继
续选择“Address
Details ”,可以
看到该连接是通
过“TSAP”号来传
输数据的,此时
S7服务是利用
ISO协议来完成
的。
以太网介绍
可能的通信方式
Send/Receive
通信
30
Service & Support
Automation and Drives
30
S7-通信
Siemens IE Siemens IE 通讯服务通讯服务
•S7-Communication
Siemens Industrial Ethernet
选择
“TCP/IP”,则
通过IP地址来
寻址建立连
接。继续选择
“Address
Details ”,可
以看到该连接
仍然是通过
“TSAP”号来传
输数据的,此
时S7服务是利
用ISO-on-
TCP协议来完
成的。
以太网通信
以太网介绍
以太网介绍
以太网介绍
以太网介绍
以太网介绍
以太网介绍
以太网介绍
以太网介绍
以太网介绍
以太网介绍
以太网介绍
以太网介绍
以太网介绍
以太网介绍
以太网介绍
以太网介绍
使用以太网通信处理器 Ethernet-CPs 可能的连接方式
ISO/OSI 模型内的 Send/Receive 和 S7 通信
Siemens IE 通讯
Siemens IE 通讯
Send/Receive: ISO-传输 连接
Send/Receive: ISO-On-TCP 连接
Send/Receive: TCP 连接
Send/Receive: UDP 连接
什么是 S7-通信?
Siemens Industrial Ethernet
Siemens Industrial Ethernet
Siemens Industrial Ethernet