Download as pdf or txt
Download as pdf or txt
You are on page 1of 37

TCP/IP Protocol

SIMATIC NET Industrial Ethernet


Siemens AG 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.1 Knowledge for Automation

Contents Page

Development of TCP/IP.................................................................................................................. 2
Internet............................................................................................................................................ 4
Internet TCP/IP Documentation...................................................................................................... 8
TCP/IP Protocol Stack..................................................................................................................... 10
Features of IP................................................................................................................................. 15
IP Header Structure......................................................................................................................... 16
Internet Addresses.......................................................................................................................... 18
Fragmentation of an Internet Datagram........................................................................................... 19
ICMP Protocol................................................................................................................................. 21
ARP Protocol................................................................................................................................... 22
TCP Protocol................................................................................................................................... 23
TCP Addressing.............................................................................................................................. 24
TCP Header.................................................................................................................................... 25
Three-Way Handshake when Establishing a Transport Connection.............................................. 27
The TCP Acknowledgement Principle............................................................................................. 28
Flow Control in TCP........................................................................................................................ 29
Clearing Connections in TCP (Soft Release)................................................................................. 30
UDP Protocol................................................................................................................................... 31
UDP Header format......................................................................................................................... 32
RFC 1006........................................................................................................................................ 33
The Data Flow Problem................................................................................................................... 34
User Interfaces................................................................................................................................ 35
Why TCP with RFC 1006 as User Interface? ................................................................................. 36
RFC 1006 in Use............................................................................................................................. 37

Siemens AG Page 1 TCP/IP Protocol


Training Center
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 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.2 Knowledge for Automation

TCP/IP -
Strictly Speaking
not a “Standard”

Development of The reason for the development of the TCP/IP protocols (Transfer Control
TCP/IP Protocol/Internet Protocol) was that for a long time there were no official
standards for integrating different types of computer into a network. At the
beginning of the seventies, the American Department of Defense (DoD)
instructed its Defense Advanced Research Projects Agency (DARPA) to develop
and define a communications protocol for data links and information interchange
in vendor-independent, heterogeneous computer networks.

The experimental platform for initial trials with the TCP/IP communications
protocol was provided by the packet-oriented ARPAnet wide area network. The
protocol specifications were defined in Requests for Comments (RFCs) and
subsequently published. The RFC documents are not official standards, but
because of their widespread acceptance in the world of data communications,
they have the status of an industrial standard.

On completion of the development work, the American Department of Defense


adopted TCP/IP as its standard communications protocol at the beginning of the
eighties. Many of the RFCs defined by DARPA were accepted unchanged as
military standards.

Since then, TCP/IP has been used as the basis of many public and private
networks.

Siemens AG Page 2 TCP/IP Protocol


Training Center
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 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.3 Knowledge for Automation

One of the institutions involved in the development of TCP/IP was the University
of California, where the UNIX operating system was also developed at almost the
same time. An obvious step, therefore, was to integrate the TCP/IP
communications protocol into UNIX.
The fact that TCP/IP is part of the Berkeley UNIX BSD operating system (from
Version V4.2) and of a number of other UNIX implementations has made a large
contribution to the popularity of TCP/IP.

TCP/IP protocols are now extremely widespread in the world of data processing.
Since TCP/IP implementations for a wide variety of operating systems are now
available from many vendors throughout the world, these protocols are
automatically regarded as a communications standard today. The wide
acceptance and availability of the protocols enable the main communications
services (file transfer, mail services and terminal emulation) to be used in a
heterogeneous, vendor-independent environment between PCs, micros, minis
and mainframes.

TCP/IP is, however, most prominent today in the Net, the worldwide Internet
computer network. TCP/IP is used for handling all data communications in this
network.
The same applies to the new internal company Internets known as Intranets.

Siemens AG Page 3 TCP/IP Protocol


Training Center
Internet (1)
• Network

• Internet interconnection

LAN MAN

WAN Satellite

SIMATIC NET Industrial Ethernet


Siemens AG 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.4 Knowledge for Automation

Network A group of computers that exchange information with one another.

Homogeneous Computer systems of the same type only

Heterogeneous Computer systems of different types


If data transfer via the network is to function properly, the information from the
sender must be transmitted via communication cables and possibly one or more
intermediary computers to the receiver and must arrive there in comprehensible
form.

Problem Cooperation between the hardware and software within the network.

Internet Interlinking of individual networks to form a new overall network. The


interconnection subsidiary networks are all entirely different as regards
• Network technology,
• Size,
• Location,
• Owner.

Internetworking Implementation of an Internet.

Internet An Internet in which the problem of internetworking is solved by a set of


standards known as
TCP/IP protocols.

Internet TCP/IP protocols


-Protocol family
-Protocol group

Siemens AG Page 4 TCP/IP Protocol


Training Center
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 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.5 Knowledge for Automation

Internet Worldwide computer network that interlinks universities, commercial companies,


national institutions and private PC users by global connection of regional
computer networks via international data links.
Seen as the foundation for a future Information Superhighway.

Size Approx. 45000 subnets


Approx. 36.8 million hosts in over 40 countries (June 1998)
The number of Internet users is enormous and it is not possible to give an exact
figure.

Growth Network size: 10% per month


Nodes: The number of "official" hosts is currently increasing by the factor 1.2 to
1.5 every six months
The largest growth is in the domain .com
This is followed by .edu, .net, .jp, .uk, .de
Prediction: 200 million Internet users in the year 2000

Problem "The Net is dying of expansion"


More data, more users, more bandwidth: The Internet is swelling in all directions.
Is humanity surfing its way towards a global traffic jam ?

"Freeway effect"

Siemens AG Page 5 TCP/IP Protocol


Training Center
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 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.6 Knowledge for Automation

• E-Mail
Exchange of messages (from simple ASCII text up to multimedia documents) between individual
users.
• FTP
File copying/file transfer
Ideal for software distribution and online updates
• Newsgroups
Exchange of messages in discussion forums
Mailing Lists: Electronic distribution services, i.e. automatic distribution of e-mails between
discussion participants
Usenet Newsgroups: Discussion contributions and messages on electronic “bulletin boards” on
individual Usenet computers.
• Telnet
Remote control of other computers and use of computing power by opening a session on a remote
computer, usually by typing in a login name and a password (remote login).
• WWW
Originally developed at the CERN nuclear research center in Geneva. The WWW is based on
hypertext. Hypertext is a special method of presenting information. Selected words in a text can be
links leading to further texts, files, graphics or even sounds, which give a more detailed
explanation of the original word. You can repeat the process as often as you like and find out more
and more about a subject. By using hypertext links to move from one document to another you
can "surf" through the network.
To read hypertext you need a Web client or hypertext reader. These are also known as Web
browsers. The best known browsers are "Netscape Navigator", "MS-Internet Explorer" and (at
present) "SPRY Mosaic"
• Voice over IP
A single company network for data, voice and fax transmission
• Internet Phone
Making telephone calls and sending faxes via the Internet.
Currently the most controversial technology in the field of telecommunications

Siemens AG Page 6 TCP/IP Protocol


Training Center
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 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.7 Knowledge for Automation

Siemens AG Page 7 TCP/IP Protocol


Training Center
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 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.8 Knowledge for Automation

RFC Request for Comments


The main source of information about the Internet.
The RFCs explain the technical details, function principles and operation of the
Internet.
The RFCs are numbered consecutively.
They are standards established by a discussion process. The discussion process
itself is also defined in an RFC (RFC 1310 - The Internet Standard).
The discussion is steered by the Internet Engineering Steering Group (IESG).

MIL-STD Some of the Internet protocols have also become US military standards.
These standards must be adhered to for DoD contracts.

Siemens AG Page 8 TCP/IP Protocol


Training Center
Internet TCP/IP Documentation (2)

Proposal

Submission to IETF

Experimental or
informal

Proposed Standard

Draft Standard

Full Standard

SIMATIC NET Industrial Ethernet


Siemens AG 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.9 Knowledge for Automation

• Request to the IETF Internet Engineering Task Force to submit proposals on a topic
The proposals are discussed by the IETF
• The discussion is steered by the IESG Internet Engineering Steering Group.
• A proposal that is to be discussed as a Proposed Standard must be consistent, stable, easy to
understand, and, especially, useful.
The majority of those taking part in the discussion must accept the Proposed Standard.
• If at least two implementations using a Proposed Standard exist, it can advance to a Draft
Standard after 6 months.
• If the Draft Standard is accepted in further discussions and in practical tests, it can become a Full
Standard after a further 6 months.

Siemens AG Page 9 TCP/IP Protocol


Training Center
TCP/IP Protocol Stack (1)

7
TFTP SMTP
6 TELNET
FTP SNMP
5 DNS

4
TCP UDP

3 ICMP
IP
ARP RARP

2
Subnet
1

SIMATIC NET Industrial Ethernet


Siemens AG 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.10 Knowledge for Automation

Standard
Applications

TELNET Virtual terminal protocol (RFC 854 MIL-STD 1782)


Allows establishment of a terminal session with a remote computer. Login at a
remote computer.

TFTP Trivial File Transfer Protocol (RFC 783)


File transfer protocol for minimum requirements and minimum overhead.

FTP File Transfer Protocol (RFC 959 MIL-STD 1780)


File transfer protocol for transmission of data between computers with a
considerably wider range of functions than TFTP.

SMTP Simple Mail Transfer Protocol (RFC 821 MIL-STD 1781)


Enables messages (electronic mail) and text files to be exchanged between
systems or user processes in a network.

DNS Domain Name Service (RFC 1032, RFC 1034, RFC 1035)
Protocol that assigns the names of addressable objects, e.g. host computers, to
addresses throughout a network. This was preceded by the NSP Name Service
Protocol, described in IEN 116.

SNMP Simple Network Management Protocol (RFC 1067, RFC 1157)


The SNMP network management protocol is used for exchanging data between
the SNMP agent (management object) and the network management station.

Siemens AG Page 10 TCP/IP Protocol


Training Center
TCP/IP Protocol Stack (2)

7
rcp remsh
6 rlogin
rsh
5

4
TCP UDP

3 ICMP
IP
ARP RARP

2
Subnet
1

SIMATIC NET Industrial Ethernet


Siemens AG 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.11 Knowledge for Automation

Standard Applications
Berkeley r Utilities

rlogin remote login


Enables a user to log in on a remote system from the local system.

rcp remote copy


Enables files or the contents of whole directories to be copied from local to
remote system and vice versa and from one remote system to another. Like an
extension of the Unix cp command for use in networks.

rsh remote shell


remsh Local users can execute on the remote system all the shell commands they are
entitled to use under the specified user ID. Terminal-oriented programs, e.g.
editors, do not run under rsh or run with only a limited range of functions.

Siemens AG Page 11 TCP/IP Protocol


Training Center
TCP/IP Protocol Stack (3)

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 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.12 Knowledge for Automation

Information and
Test Programs

arp Display or modification of the Internet-to-Ethernet address conversion tables.

finger Display of information on a user, e.g. time last post arrived. No information about
other systems.

netstat Information about the current status of the local TCP/IP system. Important aid for
the network manager.

ping Test of the link to a remote host.

rdist Creation of identical copies of files on several hosts.

ruptime Displays a status line for each computer in the local network. Like an extension of
the UNIX uptime command for use in networks.

rwho Like who, but also displays the registered users of remote computers.

talk Communication with another user at a remote computer or on the local computer.
Terminal lines are copied to the partner.

Siemens AG Page 12 TCP/IP Protocol


Training Center
TCP/IP Protocol Stack (4)

7
TELNET
6
TFTP
5

4
TCP UDP

3 ICMP
IP
ARP RARP
2
Subnet
1

SIMATIC NET Industrial Ethernet


Siemens AG 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.13 Knowledge for Automation

Internet
Protocol Group

TCP Transmission Control Protocol (RFC 793 MIL-STD 1778)


Reliable, connection-oriented, byte stream-oriented end-to-end protocol.

UDP User Datagram Protocol (RFC 768)


Alternative connectionless, simple, low-overhead end-to-end protocol.

IP Internet Protocol (RFC 791 MIL-STD 1777)


Connectionless, datagram-oriented host-to-host protocol, the main function of
which is to route the datagrams from the source host to the destination host, via a
number of other computer systems or computer networks if necessary. This is
the central protocol of the Internet protocol group.

ICMP Internet Control Message Protocol (RFC 792)


Transports error or diagnostics information to those affected or those
responsible.
Errors can be detected by the IP modules.

ARP Address Resolution Protocol (RFC 826)


Protocol that converts 32-bit Internet addresses to 48-bit Ethernet addresses
where necessary.

RARP Reverse Address Resolution Protocol (RFC 903)


Converts 48-bit Ethernet addresses to 32-bit Internet addresses.

Siemens AG Page 13 TCP/IP Protocol


Training Center
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 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.14 Knowledge for Automation

Internet
Protocol Group

Subnet Represents the "insignificance" of the transmission medium or physical


arrangement of the computer network.
Ethernet LAN
Token Ring LAN
X.25 network
:
:
SLIP
PPP

Siemens AG Page 14 TCP/IP Protocol


Training Center
Features of IP

SIMATIC NET Industrial Ethernet


Siemens AG 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.15 Knowledge for Automation

The Main Functions - Unambiguous addressing throughout the network


of IP - Routing

Benefits of IP - Datagram-oriented data transfer over a number of networks


Connectionless protocol

- Hosts addressed by a 32-bit Internet IP address

- Data packets fragmented into several small units and reassembled at


the destination host

- Maximum packet size 65535 bytes

- Transfer time monitoring to prevent endless loops during transmission,


i.e. finite packet life

- Correct transmission of packet header verified by generation of a


checksum - a header checksum, not a data checksum

- Protocol fields which are not always required are optional

- “Best Effort” delivery

Note IP does not check for correct data transfer, or provide acknowledgements or error
correction mechanisms.

Siemens AG Page 15 TCP/IP Protocol


Training Center
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 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.16 Knowledge for Automation

Header Structure

Version Version of the IP protocol used


Current version: 4

IHL Internet header length (in 32-bit words)


Minimum length = 5

Type of Service Field structure:


Bits 0-2: Precedence (priority of the datagram);
000 = Lowest priority (standard value)
Bits 3-5: Performance features
000 = Normal delay, normal throughput,
normal reliability (standard values)
Bits 6-7: fixed = 0

Total Length Total length (IP header plus data) of an Internet datagram, in bytes.

Identification Identification number of an Internet datagram; important when fragmenting and


reassembling the datagram.

Flags Bit 0: fixed = 0


Bit 1: 0 = Datagram can be fragmented
1 = Datagram must not be fragmented
Bit 2: 0 = This is the last fragment
1 = More fragments to follow

Fragment Offset When an Internet datagram is fragmented, the position of the fragment within the
datagram is specified here in 8-byte units. The first fragment, or a non-
fragmented datagram has the offset value 0.

Siemens AG Page 16 TCP/IP Protocol


Training Center
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 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.17 Knowledge for Automation

Time to Live Time to Live specifies the maximum length of the life of a datagram in seconds.
Each time the datagram is processed (e.g. in an Internet gateway) this value
must be decremented by at least one.

Protocol The next highest protocol type is specified here.


Examples: H = 01: ICMP; H = 03: GGP; H = 06: TCP;
H = 11: UDP

Header Checksum IP-specific checksum which explicitly ensures the correctness of the Internet
header.

Source Address 32-bit Internet address of the sender of the datagram.

Destination Address 32-bit Internet address of the recipient of the datagram.


Internet addresses are normally structured and are generally specified in the form
of four decimal numbers separated by periods.

Example:
The Internet address 220.255.8.209 corresponds to the hexadecimal sequence
H = DC FF 08 D1.

Options Other optional network information can also be specified in the IP header.
Options are identified by the relevant option ID.
Examples of options:
“Loose Source and Record Route”
“Strict Source and Record Route”
etc.

Padding If the list of options does not end at the end of a 32-bit word, the rest of the IP
header is padded with zeros.

Siemens AG Page 17 TCP/IP Protocol


Training Center
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 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.18 Knowledge for Automation

IP Address Every computer connected to the Internet has an IP address.


The addresses for Germany are issued by the DE-NIC (German Network
Information Center). Users are notified of this address by the Service Provider.
It is normally specified in Dotted Quad Notation or Standard Dot Notation.
Internet addresses are not assigned to a computer, but to the network interfaces
a computer has in different networks. Gateway computers, for example, have
several IP addresses. These computers are referred to as "multi-homing"
computers.

The IP address has three parts:


- Network identifier or class A, B or C
- Network address, netid
- System address or local address, hostid

Type A 127 networks, 24-bit host ID

Type B 16,383 networks, 16-bit host ID

Type C Over 2 million networks, 8-bit host ID

Note The network with the number 127 cannot be used (loopback interface of the IP
implementation).
Host IDs with all the bits set to 0 or 1 are reserved for special functions, e.g.
broadcasting, and must not be used.

Siemens AG Page 18 TCP/IP Protocol


Training Center
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 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.19 Knowledge for Automation

Fragmentation

What is the Purpose In some cases, an Internet datagram may be too big to transmit on a subnet.
of Fragmentation?
It must therefore be fragmented, i.e. split into smaller units, before it can be
transmitted any further.

Fragmentation of a datagram can be expressly forbidden by the sender (see IP


Header: Flags!). In this case, the datagram is destroyed and the sender is
informed by an ICMP message.

Reassembly The receiver of datagram fragments puts them back together to make one whole
datagram (reassembly).

The entry in the Identification field indicates which fragments belong to which
datagram.
The entry in the Fragment Offset field ensures that the fragments are put
together in the correct order.

Siemens AG Page 19 TCP/IP Protocol


Training Center
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 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.20 Knowledge for Automation

Siemens AG Page 20 TCP/IP Protocol


Training Center
ICMP Protocol

The ICMP protocol is used for


exchanging management information
and reporting network errors

SIMATIC NET Industrial Ethernet


Siemens AG 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.21 Knowledge for Automation

Internet Control In every network errors occur now and again that need to be reported to
Message Protocol those affected or those responsible. This task is performed by ICMP.
(ICMP) ICMP is part of every IP implementation.

Examples of - Destination unreachable


ICMP Messages
- Time exceeded for a datagram

- Processing of datagram not possible, e.g. protocol error

- Processing of datagram not possible, e.g. buffer bottleneck

- Echo datagram, with timestamp option (Echo Reply)


(Timestamp Request)
(Timestamp Reply)

Siemens AG Page 21 TCP/IP Protocol


Training Center
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 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.22 Knowledge for Automation

ARP With ARP a system-internal table containing the assignment of the physical
addresses (Ethernet addresses) to the IP addresses is dynamically created.
An entry is made in the table with the enquiry above when a communication
request is issued to a partner system for which there is no entry in the ARP table.
To keep the address assignments dynamic, the entries are normally deleted after
a certain length of time.

RARP In addition to ARP there is also RARP (Reverse Address Resolution Protocol),
which, for example, enables a computer with no hard disk of its own, which has
to load its operating system via the network, to find out the IP address for its
Ethernet address.

Siemens AG Page 22 TCP/IP Protocol


Training Center
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 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.23 Knowledge for Automation

TCP Function Scope

Transmission TCP is a communications protocol with functions belonging to ISO-OSI


Control Protocol Layer 4 (Transport Layer).
(TCP)
TCP makes accurate data exchange between two stations in a network possible.

Transport Data communication between the end stations is always connection-


Connections oriented. This means that a connection establishment phase has to take place
before the actual data transfer phase can go ahead.

When establishing a transport connection it is necessary to:

- ensure that the logical partner is present,

- exchange initialization information,

- make any special arrangements for the data transfer phase.

Once established, TCP transport connections always operate in full duplex mode.
Each station at the end of a connection is in principle entitled to send data at any
time.

Flow control and error detection and correction mechanisms ensure optimum,
accurate data transport.

No data is lost when connections are cleared.

Siemens AG Page 23 TCP/IP Protocol


Training Center
TCP Addressing
Ports

T C P
Internet
addresses

I P

Socket
=
Port
+
Internet address

SIMATIC NET Industrial Ethernet


Siemens AG 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.24 Knowledge for Automation

Addressing Concept

Addressing TCP supports the addressing of different applications in the local system.

Applications are:
- Standard services such as file transfer (e.g.: FTP), electronic mail
(e.g.: SMTP), etc.
- Vendor-specific applications (e.g.: NFS from SUN)
- Other user programs

Port The various applications are addressed using ports. Ports are unique local 16-bit
addresses.
It has become the accepted practice to use the same port number in every
system for certain standard applications (“Well Known Ports”):

Port number (decimal) Protocol


5 RJE
7 ECHO
11 USERS
13 DAYTIME
21 FTP
23 TELNET
25 SMTP
43 WHOIS
49 LOGIN
69 TFTP
79 FINGER

Socket The combination of port + Internet address is called a Socket. Each socket is
therefore unique within a network.

Siemens AG Page 24 TCP/IP Protocol


Training Center
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 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.25 Knowledge for Automation

Header Structure

Source Port 16-bit address


Destination Port 16-bit address
Ports are the end points of transport connections (virtual, logical
connections). A port plus the Internet address defines a socket. No more
than one transport connection can be established between two sockets.

Sequence Number In TCP each byte to be sent is given a number. The Sequence Number is
normally the number of the first data byte in the TCP segment after the TCP
header.
Caution: The SYN and FIN bits count as bytes if they are set.

Acknowledgement This field contains the next sequence number expected from the partner.
Number

Data Offset Length of the TCP header in 32-bit words.

Reserved Bits reserved for future use. These must be zero.

Siemens AG Page 25 TCP/IP Protocol


Training Center
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 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.26 Knowledge for Automation

Control Bits URG: Urgent Pointer is significant


ACK: Acknowledgment field is significant
PSH: Push function
RST: Reset connection
SYN: Synchronization of sequence numbers
(= connection establishment)
FIN: No more data from sender
(= connection clearing; soft release)

Window This field contains the maximum number of bytes the partner can still send.

Checksum Checksum explicitly ensuring the correctness of the TCP header.

Urgent Pointer When sending expedited data, it must immediately follow the TCP header.

Siemens AG Page 26 TCP/IP Protocol


Training Center
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 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.27 Knowledge for Automation

Siemens AG Page 27 TCP/IP Protocol


Training Center
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 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.28 Knowledge for Automation

Siemens AG Page 28 TCP/IP Protocol


Training Center
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 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.29 Knowledge for Automation

Siemens AG Page 29 TCP/IP Protocol


Training Center
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 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.30 Knowledge for Automation

Siemens AG Page 30 TCP/IP Protocol


Training Center
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 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.31 Knowledge for Automation

UDP Unlike TCP, operation with UDP is connectionless and without integrity
precautions or flow control. UDP does, however, provide the multiplexing
function, like TCP, with port numbers assigned to user processes.
UDP is simple and its protocol overhead is minimal, which makes it highly
suitable for applications where speed is of the essence, e.g. NFS (Network File
System).

The only features UDP offers in addition to those of IP are the port numbers and
a data checksum.

Siemens AG Page 31 TCP/IP Protocol


Training Center
UDP Header Format

b0 b31

Source Port Destination Port

Length (of Data) Checksum

Data

SIMATIC NET Industrial Ethernet


Siemens AG 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.32 Knowledge for Automation

Source Port References to the transport protocol users.


Destination Port These allow multiplexing/demultiplexing between the user processes.
Completely independent of the TCP ports

Length Length of the datagram in bytes


Consists of the UDP header plus data field.
Minimum length therefore 8

Checksum Checksum for protocol header and data.


If this field contains the value 0, the sender has not entered a checksum and no
check is made at the receiving end either.

Siemens AG Page 32 TCP/IP Protocol


Training Center
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 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.33 Knowledge for Automation

Model

TS user TS user

TSAP interface TSAP interface


ISO 8072 ISO 8072

ISO transport service on


Client TCP/IP Server

TCP interface TCP interface


RFC 793 RFC 793

Siemens AG Page 33 TCP/IP Protocol


Training Center
The Data Flow Problem .....

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

RFC
RFC1006
1006 RFC
RFC1006
1006

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

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

SIMATIC NET Industrial Ethernet


Siemens AG 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.34 Knowledge for Automation

Siemens AG Page 34 TCP/IP Protocol


Training Center
User Interfaces

User
Userinterfaces
interfaces Optimized functions
for transparent
access to PLC data

S7
S7functions
functions

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

IP
Data Link Layer
Physical Layer

SIMATIC NET Industrial Ethernet


Siemens AG 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.35 Knowledge for Automation

Siemens AG Page 35 TCP/IP Protocol


Training Center
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 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.36 Knowledge for Automation

Siemens AG Page 36 TCP/IP Protocol


Training Center
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 1999. All rights reserved.
Date: 01.03.1999
Information and Training Center
Information
Knowledgeandfor
Training Center
Automation
File No.: 7TC_ip.37 Knowledge for Automation

Siemens AG Page 37 TCP/IP Protocol


Training Center

You might also like