You are on page 1of 43

TCP/IP Protocol

Development, service

Service specialist Internet


from on the road

Production

Commercial
online service
provider, e.g. aol

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.1 Automatisierungs- und Antriebstechnik
Development of TCP/IP (1)
Original DoD networks
Special military
networks

ARPANET

From 1983 to 1991 Special military


networks

ARPANET MILNET

Defense Data Network

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.2 Automatisierungs- und Antriebstechnik
Development of TCP/IP (2)
 LAN Local Area Network

“UNIX in the neighborhood”

 WAN Wide Area Network

“UNIX at large”

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.3 Automatisierungs- und Antriebstechnik
Internet (1)
• Network

• Internet interconnection

LAN MAN

WAN Satellite

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.4 Automatisierungs- und Antriebstechnik
Internet (2)

Internet as seen by the user Physical structure of the Internet

Internet Internet

physical
net
gateway

Hosts Hosts

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.5 Automatisierungs- und Antriebstechnik
Internet (3)
Services
 E-mail (electronic mail) – "Mailbox to the world of Internet"
 FTP "Internet data transfer"
 Newsgroups "Discussion forums for active communication on the
Internet"
 Telnet "Remote control for Internet databases"
 WorldWideWeb "Internet multimedia"
Known as WWW or W3
The newest, most up-to-date, user-friendly and universal information
service on the Internet
The WWW allows you to travel round the world with a mouse click
("surfing")
 Voice over IP (VoIP) Data, speech, fax and video on a single shared IP
network.
Professional voice/data integration solution
Used in intranets.
 Internet Phone "Cheap rate telephone calls worldwide"

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.6 Automatisierungs- und Antriebstechnik
Internet (4)

 Internet
Worldwide computer network in which the TCP/IP protocol family is used
for communication.
 Intranet
Use of the established Internet technology for a limited set of users, e.g.
the employees of a company in an internal company network.
An intranet can be connected to the Internet - protected or shielded by a
"firewall".
 Extranet
Area of the Internet where access is controlled by a login name and
password, e.g. for customers and field service personnel of a company.

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.7 Automatisierungs- und Antriebstechnik
Internet TCP/IP Documentation
IEN Internet Engineering Note

The original publications of those engaged in the work on Internet,


parallel in some cases to the RFCs which succeeded them.

RFC Request for Comments

Publications of the Internet institutions and participants.

• Protocol specifications
• Articles
• New ideas, suggestions, improvements

Provisional versions of RFCs are also referred to as “Internet


drafts”.
Approx. 2000 RFCs in existence at present

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.8 Automatisierungs- und Antriebstechnik
Internet TCP/IP Documentation (2)

Proposal

Submission to IETF

Experimental or
informal

Proposed Standard

Draft Standard

Full Standard

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.9 Automatisierungs- und Antriebstechnik
TCP/IP Protocol Stack (1)

7 TELNET HTTP SMTP NFS


6 TFTP POP3 MIME
FTP ESMTP SNMP
5 DNS NNTP

4
TCP UDP

3 ICMP
IP
ARP RARP

2
Subnet
1

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.10 Automatisierungs- und Antriebstechnik
TCP/IP Protocol Stack (2)

7 TELNET HTTP SMTP NFS


6 TFTP ESMTP MIME
FTP SNMP
5 DNS NNTP

4
TCP UDP

3 ICMP
IP
ARP RARP

2
Subnet
1

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.11 Automatisierungs- und Antriebstechnik
TCP/IP Protocol Stack (3)

7
rcp rcmd
6 rlogin remsh
rsh
5

4
TCP UDP

3 ICMP
IP
ARP RARP

2
Subnet
1

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.12 Automatisierungs- und Antriebstechnik
TCP/IP Protocol Stack (4)

7
arp netstat rdist rwho
6
finger ping talk
5 ruptime

4
TCP UDP

3 ICMP
IP
ARP RARP

2
Subnet
1

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.13 Automatisierungs- und Antriebstechnik
TCP/IP Protocol Stack (5)

7
TELNET
6
TFTP
5

4
TCP UDP

3 ICMP
IP
ARP RARP
2
Subnet
1

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.14 Automatisierungs- und Antriebstechnik
TCP/IP Protocol Stack (6)

7
TELNET
6
TFTP
5

4
TCP UDP

3 ICMP
IP
ARP RARP

2
Subnet
1

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.15 Automatisierungs- und Antriebstechnik
Workstation
A •Packet switching

Message is distributed in
packets
Network A
•Routing

Message transported
via the nodes

Nodes
Network B

Workstation
B

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.16 Automatisierungs- und Antriebstechnik
IP Header Structure (1)
0 31
Version
Version IHL Type of Service Total Length
Physical Header
Version
Identification Flags Fragment Offset Link Header

Version Network Header


Time to Live Protocol Header Checksum
Transport Header
Version Session Header
Source Address
Presentation Header
Version
Destination Address Application Header

Version Data
Options

Version Trailer
Options Padding

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.17 Automatisierungs- und Antriebstechnik
IP Header Structure (2)

0 31
Version
Version IHL Type of Service Total Length
Physical Header
Version
Identification Flags Fragment Offset Link Header

Version Network Header


Time to Live Protocol Header Checksum
Transport Header
Version Session Header
Source Address
Presentation Header
Version
Destination Address Application Header

Version Data
Options

Version Trailer
Options Padding

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.18 Automatisierungs- und Antriebstechnik
Internet Addresses
Address type A (Few subnets with a large number of stations
per subnet)
b31 b0
Version
0 Subnet Station address

Address type B (Medium number of subnets and stations)

b31 b0
Version
10 Subnet Station address

Address type C (Large number of subnets with few stations


per subnet)
b31 b0
Version Station
110 Subnet
address

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.19 Automatisierungs- und Antriebstechnik
Internet Addresses (2)
 The 32-bit IP address is represented by 4 decimal numbers separated
by a period:
e.g. 141.73.4.238
 The address is separated into network ID (N) and host ID (H)
 There are different network classes:
 Class A: 0-127.H.H.H approx. 16 million hosts/network
 Class B: 128-191.N.H.H approx. 65,000 hosts/network
 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)
 Addresses must be unique throughout the network
 InterNIC assigns addresses for the INTERNET

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.20 Automatisierungs- und Antriebstechnik
Internet Addresses (3)

129.211
129.10

Router

129.10.0.1 129.10.0.2
129.211.7.16 129.211.29.5

10 192.168.10

10.0.0.37 10.0.0.52 192.168.10.3 192.168.10.5

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.21 Automatisierungs- und Antriebstechnik
Subnets (Subnetting) (1)
Internal processing in PC/workstation

1 Local address 2 Remote address

Local SN mask Local SN mask

Result A (local network) Result B (remote network)

If A=B destination host in same network


If A=B destination host in a different network
Logical AND

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.22 Automatisierungs- und Antriebstechnik
Subnets (Subnetting) (2)

141.73.4.238 141.73.4.239

Subnet 141.73.4 141.73.5.18

Internet
141.73.0.33
141.73.0.41

Subnet 141.73.0 141.73.1.2

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.23 Automatisierungs- und Antriebstechnik
Subnets (Subnetting) (3)

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.24 Automatisierungs- und Antriebstechnik
Fragmentation of an Internet Datagram (1)

Ver = 4 IHL = 5 Type of Service Total Length = 472


Identification = 111 FI = 0 Fragment Offset = 0
Time = 123 Protocol = 6 Header Checksum
Source Address
Destination Address

Data
Data

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.25 Automatisierungs- und Antriebstechnik
Fragmentation of an Internet Datagram (2)
Ver = 4 IHL = 5 Type of Service Total Length = 256
Identification = 111 FI = 1 Fragment Offset = 0
Time = 119 Protocol = 6 Header Checksum
Source Address
Destination Address
Data
Data

+
Ver = 4 IHL = 5 Type of Service Total Length = 216
Identification = 111 FI = 0 Fragment Offset = 32
Time = 119 Protocol = 6 Header Checksum
Source Address
Destination Address

Data
Data

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.26 Automatisierungs- und Antriebstechnik
ICMP Protocol

The ICMP protocol is used for


exchanging management information
and reporting network errors

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.27 Automatisierungs- und Antriebstechnik
ARP Protocol
Finding an address with the ARP protocol
From 1 to All Stations: Who's got Internet address X?

From 5 to 1: I've got Internet address X

From 1 to 5: IP datagram from Internet address A


to Internet address X

Internet address A Internet address X

Local address 1 Local address 5

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.28 Automatisierungs- und Antriebstechnik
TCP Protocol
TCP ...
... stands for Transmission Control Protocol.

... is a Layer 4 transport protocol.

... installs logical (virtual) full duplex connections between two end
stations
(connection-oriented end to end protocol).

... detects and corrects transmission errors (loss, duplication,


mutilation of data) by means of sequence numbers, checksum,
acknowledgement with time monitoring and segment retry,
thereby ensuring accurate data transfer.

... provides flow control mechanisms (sliding window principle).

... allows expedited data transmission.

... offers multiplexing facilities using TCP port numbers

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.29 Automatisierungs- und Antriebstechnik
TCP Addressing
Ports

T C P
Internet
addresses

I P

Socket
=
Port
+
Internet address

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.30 Automatisierungs- und Antriebstechnik
TCP Header (1)

b0 b31
Version
Source Port Destination Port
Physical Header
Version
Link Header
Sequence Number
Network Header
Version
Transport Header
Acknowledgment Number
Session Header
Version U A P R S F Presentation Header
Data
Reserved R C S Y Window
Offset G K H S N I Application Header
N
Version T
Checksum Urgent Pointer Data

Version Trailer
Options Padding

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.31 Automatisierungs- und Antriebstechnik
TCP Header (2)

b0 b31
Version
Source Port Destination Port
Physical Header
Version
Link Header
Sequence Number
Network Header
Version
Transport Header
Acknowledgment Number
Session Header
Version U A P R S F Presentation Header
Data
Reserved R C S Y Window
Offset G K H S N I Application Header
N
Version T
Checksum Urgent Pointer Data

Version Trailer
Options Padding

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.32 Automatisierungs- und Antriebstechnik
Three-Way Handshake when Establishing a Transport
Connection

(Seq = 100; SYN)

(Seq = 300; Ack = 101; SYN)

(Seq = 101; Ack = 301)

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.33 Automatisierungs- und Antriebstechnik
The TCP Acknowledgement Principle
..
.
(Seq = 101; Ack = 301; 50 bytes)

(Seq = 301; Ack = 151)

(Seq = 301; Ack = 151; 300 bytes)

(Seq = 151; Ack = 601; 200 bytes)

Time
out
(Seq = 151; Ack = 601; 200 bytes)

(Seq = 601; Ack = 351)


Time
out (Seq = 151; Ack = 601; 200 bytes)

(Seq = 601; Ack = 351)


..
.

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.34 Automatisierungs- und Antriebstechnik
Flow Control in TCP
(Seq = 351; Ack = 601; Wnd = 100; 50 bytes)

(Seq = 601; Ack = 401; Wnd = 200)

(Seq = 401; Ack = 601; Wnd = 100; 50 bytes)

(Seq = 601; Ack = 451; Wnd = 150)

(Seq = 451; Ack = 601; Wnd = 100; 50 bytes)

(Seq = 601; Ack = 501; Wnd = 100)

(Seq = 501; Ack = 601; Wnd = 100; 50 bytes)

(Seq = 551; Ack = 601; Wnd = 100; 50 bytes)


Time
out (Seq = 501; Ack = 601; Wnd = 100; 50 bytes)

(Seq = 601; Ack = 601; Wnd = 200)

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.35 Automatisierungs- und Antriebstechnik
Clearing Connections in TCP (Soft Release)

..
.
(Seq = 601; Ack = 676; 50 bytes)

(Seq = 676; Ack = 651; 24 bytes)

(Seq = 651; Ack = 700; FIN)

(Seq = 700; Ack = 652; 100 bytes)

(Seq = 652; Ack = 800)

(Seq = 800; Ack = 652; FIN; 100 bytes)

(Seq = 652; Ack = 901)

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.36 Automatisierungs- und Antriebstechnik
UDP Protocol

 UDP stands for User Datagram Protocol

 Connectionless datagram service

 No flow control, no correction mechanisms

 Message exchange with a minimum of protocol overhead


(8-byte header)

 Process multiplexing using channel numbers (ports)

 Broadcast (message to all stations in the network)

 Multicast (message to several stations in the network)

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.37 Automatisierungs- und Antriebstechnik
UDP Header Format

b0 b31

Source Port Destination Port

Length (of Data) Checksum

Data

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.38 Automatisierungs- und Antriebstechnik
RFC 1006
ISO Transport Service on TCP

 Replaces RFC 983

 Basically identical to ISO 8072/8073 Class 0

 Message-oriented operation using the ISO transport service

 Provides the transport service user with the same interface in a TCP/IP
environment as in an ISO/OSI environment

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.39 Automatisierungs- und Antriebstechnik
The Data Flow Problem .....

100 bytes 50 bytes


100 bytes 200 bytes 200 bytes
200 bytes 220 bytes 50 bytes 100 bytes
50 bytes 130 bytes

RFC 1006 RFC 1006

TCP/IP TCP/IP TCP/IP TCP/IP

Ethernet Ethernet
Input blocks = Input blocks =
Output blocks Output blocks

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.40 Automatisierungs- und Antriebstechnik
User Interfaces

User interfaces Optimized functions


for transparent
access to PLC data

S7 functions

Send / Receive
TCP with RFC 1006:
UDP: For simple For simple, reliable
data transmission RFC1006 data transmission
without via logical links
acknowledgement UDP TCP
IP
Data Link Layer
Physical Layer

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.41 Automatisierungs- und Antriebstechnik
Why TCP with RFC 1006 as User Interface ?

 TCP ensures reliable transmission in the correct sequence


 There is no mechanism for transporting the data via the
virtual link in the form of messages
 The ISO protocol has the EOM identifier, which is lacking in
TCP
 Solution 1: Use of fixed frame lengths (PLC programs ISO 
TCP)
 Solution 2: Use of a mechanism like that in ISO. There is only
one official solution for this: RFC 1006

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.42 Automatisierungs- und Antriebstechnik
RFC 1006 in Use

 Advantages:
 Open standard (IETF STD 35)
 Block transfer in the correct sequence with variable frame
lengths
 Identical interface for ISO/OSI and TCP/IP communication!
(S7 functions and SEND/RECEIVE)
 Identical handling for ISO/OSI and TCP/IP communication,
handling already familiar!

 Requirement:
 There must be an RFC 1006 block at both ends of the
communication link

SIMATIC NET Industrial Ethernet


Siemens AG 2001. All rights reserved.
Date: 01.12.2001 SITRAIN Training für
File No.: 7TC_ip.43 Automatisierungs- und Antriebstechnik

You might also like