TCP/IP-Ethernet and Web-IO

4 downloads 340 Views 62KB Size Report
Net-overlapping TCP/IP connection ..................................... 31 ..... A simple UDP peer in VB .................................................... 107. Socket programming in Delphi .
W&T

TCP/IP-Ethernet and Web-IO

This booklet has been produced for all those without special knowledge of computer networks who want to put Ethernet terminal units under TCP/IP into operation. It is divided into four parts: •

Understanding TCP/IP-Ethernet Here you will find the most important basic information about TCP/IP.



Further protocols and services In this section you will find out how E-Mail works, what happens when a web page is called up and which important protocols and services you can come across in connection with TCP/IP-Ethernet.



Installing TCP/IP -Ethernet Here the installing of TCP/IP-Ethernet on PCs with the common operating systems is described.



The small ABC of networks Here we explain the most important terms and abbreviations that you can come across in dealing with networks.

All important sequences and interrelationships will be explained clearly. Do not worry: We will not get lost in details. We have deliberately restricted ourselves to things which are really important for an understanding of the technologies described. In the end it is not necessary to know every detail of every protocol to be able to put TCP/IP network components into operation.

1

W&T

Table of Contents

Foreword .................................................................................................. 1 Understanding TCP/IP-Ethernet ....................................................... 7 Computer network requirements ............................................ 8 Basic functions of networks ................................................. 10 Ethernet and FastEthernet ................................................................ 11 10Base2 ......................................................................... 11 10BaseT ......................................................................... 11 10Base 5 ......................................................................... 12 100Base T4 ..................................................................... 12 100BaseTX ...................................................................... 12 TCP/IP – the most important protocols ..................................... 15 IP – Internet protocol ........................................................... 15 IP addresses ....................................................................... 16 Class A: .......................................................................... 16 Class B: ........................................................................... 16 Class C: .......................................................................... 17 IP data packets ................................................................... 18 TCP – Transport Control Protocol ......................................... 19 UDP – User Datagramm Protocol .......................................... 22 TCP/IP-Ethernet .................................................................. 23 ARP – Address Resolution Protocol ...................................... 26 Gateway and Subnet-Mask ................................................... 28 Net-overlapping TCP/IP connection ..................................... 31 DHCP – Dynamic Host Configuration Protocol ...................... 36 Allocation of the IP address from an address pool ............. 37 Allocation of a reserved address ....................................... 38 Exclusion of certain IP addresses ...................................... 40 from the DHCP configuration ........................................... 40 DHCP and routers ............................................................ 40 DNS – the Domain Name System .......................................... 41 Domain names ................................................................ 41 Resolving of names in DNS ............................................... 43 DNS in Embedded Systems ............................................... 44 DHCP and DNS ................................................................ 45

2

W&T

Further protocols and services ...................................................... 47 WWW – World Wide Web ....................................................... 48 URL - Uniform Resource Locator .......................................... 49 HTML – Hypertext Markup Language .................................... 52 Basic construction of an HTML file .................................... 53 Hyperlinks ...................................................................... 54 Depiction of multimedia contents ..................................... 55 HTTP – Hypertext Transfer Protocol ..................................... 59 The most important HTTP commands and parameters ....... 60 The GET command .......................................................... 60 The POST command ........................................................ 62 The HEAD command ........................................................ 63 HTTP versions ................................................................. 63 Interactivity in the WWW .................................................................. 65 Interactivity through programmes that run on the server ....... 65 CGI - Common Gateway Interface ...................................... 65 PHP ................................................................................ 66 Programmes that are run in the browser. ............................... 67 JavaScript ........................................................................ 67 Java Applets .................................................................... 69 E-Mail ....................................................................................................... 71 Construction of an E-Mail .................................................... 72 MIME – Multipurpose Internet Mail Extensions ....................... 74 SMTP – Simple Mail Transfer Protocol .................................... 74 POP3 – Post Office Protocol version 3 .................................. 75 Sending and receiving E-Mail via HTTP .................................. 76 E-Mail and DNS ................................................................... 78 Telnet - Terminal over Network .................................................... 80 The Telnet client ................................................................. 80 The Telnet server ................................................................ 81 The Telnet protocol ............................................................ 81 FTP - File Transfer Protocol ............................................................ 84 Der FTP client ..................................................................... 84 The FTP protocol ................................................................ 85 The FTP server .................................................................... 87 TFTP - Trivial File Transfer Protocol .......................................... 88

3

W&T

SNMP - Simple Network Management Protocol ........................ 92 Modbus-TCP .......................................................................................... 93 Socket programming ......................................................................... 94 TCP client, TCP server or UDP peer? ...................................... 95 TCP ................................................................................ 95 TCP client ....................................................................... 96 TCP server ...................................................................... 96 UDP ................................................................................ 97 Socket programming in Visual Basic .......................................... 98 A TCP client in VB ............................................................... 98 A TCP server in VB ............................................................ 103 A simple UDP peer in VB .................................................... 107 Socket programming in Delphi .................................................. 109 A TCP client in Delphi ....................................................... 109 A TCP server in Delphi ....................................................... 114 INSTALLING TCP/IP -Ethernet ...................................................... 121 Installing and configuring TCP/IP under Windows 9x .......... 122 Installing and configuring TCP/IP under Windows NT .......... 126 Installing and configuring TCP/IP under Win 2000 .............. 129 TCP/IP-Ethernet with simultaneous data-comms Internet access .......................................................................... 131

A Small ABC of Networks ............................................. 134 Numbering systems ........................................................................ 149 Serial equipment right on the network .................................... 150 Com-server mini and industry ............................................ 150 Com-server display ........................................................... 151 OEM boards ..................................................................... 151 Web-IO - The Terminal right at the Network ..................... 152 IO-Mailer .......................................................................... 152 Web-Thermometer ............................................................ 153 Universal digital Web-IO .................................................... 153 Fieldbus gateways ............................................................ 153

4

W&T

TCP/IP-Ethernet

TCP/IP is a purely logical protocol and always requires a physical base. As already mentioned at the beginning, Ethernet today enjoys the widest use of the physical network topologies. Ethernet is also found as the physical base in most TCP/IP networks. TCP/IP and Ethernet are brought together by embedding every TCP/IP packet in the user data area of an Ethernet packet.

Setup of a TCP/IP Ethernet data packet TCP HEADER (Port)

IP HEADER (IP address)

ETHERNET HEADER (Ethernet addressen)

TCP user data area

IP user data area

Ethernet user data area

FCS

On the way from the application on the PC to the network the user data passes by several driver layers: •

• •



The application programme decides to which other network users the data should be sent and passes on the IP address and TCP port to the TCP/IP driver (also often called TCP/IP stack). The TCP/IP driver coordinates the setup of the TCP connection. The user data passed over from the application programme are divided by the TCP driver, according to size, into smaller transmittable blocks. Every data block is first of all packed by the TCP driver in a TCP packet.

23

W&T

from Port 1025

TCP to Port 8000

• •

The TCP driver passes on the TCP packet and the IP address of the receiver to the IP driver. The IP driver puts the TCP packet in an IP packet. TCP fromt 1025 Por

an t 8000 Por

from 172.16.232.49

IP

to 172.16.232.23



The IP driver searches in the so-called ARP table (Address Resolution Protocol) for the Ethernet address of the receiver indicated by the IP address (more about this later) and passes on the IP packet together with the Ethernet address identified to the Ethernet card driver.



The Ethernet card driver puts the IP packet in an Ethernet packet and passes on this packet via the network card to the network. IP 2.49 from .16.23 172 2.23 an .16.23 172 from Ethernet 00-34-17-B8-71-55

to 00-C0-3D-00-23-A4

The procedure is carried in the reverse order at the receiver:

24

W&T



The Ethernet card recognises from the Destination-Ethernet Address that the packet is meant for the network user and passes it on to the Ethernet driver.



The Ethernet driver isolates the IP packet and passes it on to the IP driver.



The IP driver isolates the TCP packet and passes it on to the TCP driver.



The TCP driver checks the contents of the TCP packet for correctness and passes on the data, with the aid of the port number, to the correct application.

At first glance this multilayered transmission process seems enormously complicated. But only the strict separation of logical protocol (TCP/IP) and physical protocol (Ethernet) makes it possible to exchange net-overlapping and hardware-independent data.

25