IP Address and ezTCP

1 Overview

1.1 Overview

Nowadays, we use IPv4 using 32bit length. This can make a lot of address but not enough to allow all of the devices to connect through Internet. Because of this, IPv6 system is raised and will be used soon. However, in many points like interfacing with previous system, it’s going to be needed a lot of effort and time. For these reasons, the protocols which assign the dynamic IP address have appeared and it is widely used in the world. These protocols grant IP address to be using devices, or revoke it for effective use of IP address. Most of PC in your home are used this system even if the type may be different. This means the IP address what I am using is not guaranteed tomorrow. The system is definitely needed in point of solution with lack of IP address on the other hand, it will be more complicated for system using IP address like socket communication program.
ezTCP supports two protocols mentioned. This means ezTCP can operate in environment with dynamic IP address. Except this matter, however, it’s possible to be connected to internet or impossible according to types and of IP allocate and kind of IP address. This document let you use ezTCP easily in any kind of situation.

2. IP Address
2.1
Classes of IP Address

Before look up the types of IP address, we should know the class at first. In IPV4, the class is divided into five classes.



Name
Common Bits
First Address
Last address
CIDR Block
A
0
0.0.0.0
127.255.255.255
/8
B
10
128.0.0.0
191.255.255.255
/16
C
110
192.0.0.0
223.255.255.255
/24
D
1110
224.0.0.0
239.255.255.255
-
E
1111
240.0.0.0
255.255.255.255
-

2.1.1 Name
In order to classify the IP address, IPv4 is using five names of A, B, C, D and E.

2.1.2 Common Bits

These are common bits on the same class and located in head of the line expressed by the binary scale. Here is an example of class A.

In case of presenting the first address to the binary scale,

00000000. 00000000. 00000000. 00000000

and presenting the last address,

01111111. 11111111. 11111111. 11111111

As you can see, all the IP addresses in class A are including the common bit of 0, with bold letter in the head of each address.

2.1.3 First address

This is the smallest or first address in the class.

2.1.4 Last address

This is the biggest or last address in the class.

2.1.5 CIDR (Classless Inter-Domain Routing) block

IP address can be divided into network ID and host ID. In each class, the number of the bits is defined for classification of those ID. This is an explanation in class A.
Class A has 8 bits network ID. The bits mean the numbers of network which are able to exist. On the other hand, the rest of the bits, 24 bits, are host ID and mean the numbers of host which can be created. Thus, 256 networks are able to exist and 16,777,216 hosts can be created in class A, because 256 is the 8th power and 16,777,216 is the 24th power of 2.

2.2 Kind of IP address

IP address could be divided into public and private IP as the fact if it is able to be connected with device located in other networks. The public IP address can be connected with other networks, but private IP address can’t. The private IP address is used only a limited network.

2.2.1 Public IP address

A device which has public IP address can make connections at everywhere in the world with environment possible to connect internet. That IP address should be only one throughout the world in same time. Because of this, most server of server / client communication system have used the public IP address. Private IP address might be server. To do that, some technique is needed.

2.2.2 Private IP address

Private IP address is for only limited network like an office. The IP can’t be connected with a device which exists at other network. Ranges of private IP address is defined as table 2.


Class
Range of IP address
The number of addresses
A
10.0.0.0 – 10.255.255.255
16,777,216
B
172.16.0.0 - 172.31.255.255
1,048,576
C
192.168.0.0 - 192.168.255.255
65,536

As you can see in table 2, each class has a range of private IP addresses. Especially, for people who use IP share router may be familiar with the range of 192.168.0.0 ~ 192.168.255.255. Using IP share router, it’s possible to assign IP address automatically to their hosts. Assume that an IP share router, which has 4 ports, is connected with 4 devices. The first device could have 192.168.0.1 and the second have 192.168.0.2. These IP addresses are impossible to connect internet without IP share router. Surly, the router should have a public IP address. In general IP share router, user can configure the external IP address and internal IP addresses. Anything which communicates with the router does not know the internal circumstance of it. In other words, the router represents their hosts for the communication on the internet. This function is called NAT (Network Address Translate). It is allocated a public IP address and assigns private IP addresses to its hosts. In the host side, the router is operated like kind of firewall because any devices in another network have no idea what is the internal network or how many hosts are there.

2.2.3 Static IP address

Classification as public and private IP address is independent from division as static and dynamic. There are two types of classification. The first one is if it is possible to connect outside networks, and second one is if its IP address is changed or not. You may know the one is public and private and the other one is static and dynamic.
Static IP address does not be changed before user makes change that. This has a merit in point of configuring the IP address as user wish.

2.2.4 Dynamic IP address

In the head of this document, we talked about the lack of IP address and to solve this problem, DHCP and PPPoE have occurred. Both protocols allowed limited number of IP addresses to assign into larger numbers of hosts. This can be possible because it hardly occur that that all the hosts are connected to the internet in the same time.
In this circumstance, you have an issue needed to be considered. Before data communication, both sides of hosts through the process called connection on TCP. The one who try to connect with others is client, and the other one who wait for the connection is server.
Client request connection to the server and server request it too with an ACK (acknowledgment) message. Then, client sends the ACK to the server. If through this process the connection would be established.
F Socket Communication: In general, Socket use IP address with Port number. Not only TCP but also UDP is socket communication.
To request connection, client has to know the IP address and listening port of the server. If the server’s IP address is changed in every time, client should think about the following. When the IP address is changed, client should configure the destination. Because of this matter, in general, server uses static IP address. If you want to use the dynamic IP address, DDNS (Dynamic Domain Name Service) is needed.

2.3 IP address of ezTCP

2.3.1 What is ezTCP?

ezTCP is a connection module which allow the serial devices to be connected with internet. Any devices want to communicate on the internet have to use the TCP/IP protocol. ezTCP let the devices which couldn’t connect to the internet can make it. There are four types which are serial to Ethernet converter, serial to Wireless converter, serial to PPP (Point to Point Protocol) converter and remote I/O controller. All products need essential parameters like the local IP address and port number in order to be connect with its networks. Local IP address means the product’s IP address.

2.3.2 Obtain an IP address of ezTCP

In above, we mentioned that TCP and UDP are called socket communication protocol. Thus, those are needed to know the IP address and port number. ezTCP surely needs an IP address. There are two ways for obtain IP address. ezTCP can obtain IP address automatically or it is possible to put it manually. In way of get the IP address automatically, users can use DHCP or PPPoE. Registered ID and Passward are needed when using PPPoE.

2.3.3 Configuration of IP address

Most of ezTCP have their own configuration program with LAN or serial port. Each product’s software is listed on the table 3.


Model
Tool
Connection
Condition
EZL-50L
Ethernet
Ethernet connection
EZL-50M
EZL-50A
EZL-50R
EZL-60L
EZL-60M
EZL-60A
EZL-60R
EZL-70
EZL-200L
EZL-220
EZL-200L
EZL-400S
ezCFGmp
Ethernet / WLAN
Ethernet / WLAN connection
EZL-410
Ethernet
Ethernet connection
EZL-80
ezSerialConfig
/ ezConfig
Serial port
/ WLAN
Connection to the serial ports
without WLAN card
/ WLAN connection
EZL-80C
EZL-90
EZL-300L
CSE-M32
Ethernet
/ Serial port
Ethernet / Serial port
connection
CSE-M73
CSE-H20
CSE-H21
CIE-H10
CSW-H80
WLAN
/ Serial port
WLAN
/ Serial port

By using above programs, you can configure the IP address and port number as well as other parameters. It may be restricted to configure all the parameters with unsuitable condition or function which is not supported in distinction of products.
The parameters including IP address is set by ATC mode or Telnet connection to the ezTCP. These ways of configuration allow users to set the options like DHCP and PPPoE. Refer to the each manual or application note for learning how to use it.

2.4 Modes of ezTCP

All of the ezTCP can be operated as TCP server / client or UDP communication mode.

2.4.1 TCP & ezTCP

Both server and client are needed in TCP communication. Client tries to connect to the server, and server waits for the connection request. When the request is coming, server also send it to the client with ACK (acknowledgment). If client receives the request and reply as ACK to the server again, TCP connection will be established. Of course, proper IP address and ports are needed.

2.4.2 ezTCP as a Server

This is the case of T2S mode. Before the server waits for the connection, Local IP address and Local ports have to be configured correctly. Both manually and automatically obtaining IP address are available for ezTCP. The IP address can be public or private also. This is pretty complex matter, but following will help you to understand it easily.


Classification
Static IP
Dynamic IP
Public IP
Static and Public IP
Dynamic and Public IP
Private IP
Static and Private IP
Dynamic and Private IP
Four types of IP addresses are listed on the table 4. Now, let’s look into the each type.
l Static and Public IP
Device which is in this case could be connected to internet in everywhere throughout the world. Two same public IP should not exist in same time. That means the IP address is only one at that time. Static IP means the IP address is not changed before users modify it. In this case, ezTCP can be server or client without any problem. We suggest that the part of server use the address.
l Dynamic and Public IP
In this case, it is also possible to connect with internet. However, the IP address has to chance being changed anytime. In terms of client, this is a problem because it is necessary to modify its destination address. Even if ezTCP is under the condition, there is a solution to be operated server. That is using the DNS and DDNS.


F DNS (Domain Name Service): An IP address consists of 32bit. Because it is hard to remember, domain name has been using these days. Name server stores matching table of IP address and domain name. By using this, when receiving a query from a host, it matches the domain name with stored IP address.
F DDNS (Dynamic Domain Name Service): When communicating data on internet, a server uses DDNS to update its changed IP address. Assume that a server uses dynamic IP address and DDNS. Clients who try to make connection with their server use DNS because DDNS has changed IP address of the server.
l Static and Private IP
With private IP address, any device located in local network can’t be connected with internet. This means, it is for only limited local network. However, by using IP share router, devices which are using private IP can be connected with other networks. It’s needed to be assigned public IP address in the router.
IP share router can assign private IP address to its connected devices. If ezTCP is connected with the router, it is possible to internet communication with technique called port forwarding. In above, share router is operated like a firewall. So, just let the ports which you want to use for communication (ex. TCP 1470) and used by configuration program (UDP 50005, 50006) opened. Details of the technique may be found at each share router’s manual or the producer’s web site.

2. Static & Public IP on the router

l Dynamic and Private IP
This is the same as previous case. User can manually configure the address of device, but most of routers have the option as DHCP server.

l Dynamic IP address on IP share router
When using IP share router, it’s not important that type of IP address on ezTCP. Type of router’s IP address is a matter of concern. If the router uses dynamic IP address, DDNS is needed. In case of router who doesn’t support the function, ezTCP connected with the router can’t be used as TCP server. Details of how to use the option can be described each router’s manual. You should remember that the peer IP address of ezTCP is set to the routers domain name.







2.4.3 ezTCP as a Client

When set ezTCP to COD mode, it is operated as TCP client. Peer IP address and port are necessary to making TCP connection. Own IP address is also should be set. Like the case of TCP server, there are four parts as you see in the table 4.
l Static and Public IP
In this case, there could be no problem to connect internet. It is the best way to communicate on TCP that server and client are use this IP address, if it is possible.
l DynamicPublic IP
When ezTCP is in the client mode and use public IP, it doesn’t care if its IP address is dynamic or static. This is a difference from server. So, this address is suitable for the internet connection.
l Static and Private IP
If ezTCP has this IP address, IP share router is needed. Fundamentally, when using private IP address, ezTCP needs router to connect the internet. Port forwarding has to be set too.
l Dynamic and Private IP
This is the same as above ‘Static and Private IP’ case

4. Static and Public IP address on the TCP server


l Dynamic IP address on IP share router
An IP share router can communicate with devices through the internet directly. In perspective of device located in outer network, if ezTCP is connected to the router and have been made connection each other, the device may not recognize whether it is an ezTCP. As we looked in above, the fact if their IP address is static or dynamic is not important to a client. According this, this case will have no trouble with connection to the server on the internet. A client has to know their counterparts IP address but own IP address does not important.







2.5 Summary

2.5.1 Cases of IP address



Classification
Client
Public
Private
Static
Dynamic
Static(R)
Dynamic(R)
Server
Public
Static
A
A
B
B
Dynamic
C
C
D
D
Private
Static(R)
E
E
F
F
Dynamic(R)
G
G
H
H
F In table 5, mark of (R) means IP share router’s IP address because this case should use the router. Remember that it is not present the IP address of ezTCP.

2.5.2 Conditions of Internet Communication of each case



ID
Condition
Server
Client
A
-
-
B
-
Using Port Forwarding
C
Using DDNS
-
D
Using DDNS
Using Port Forwading
E
Using Port Forwading
-
F
Using Port Forwading
Using Port Forwading
G
Using Port Forwading and DDNS
-
H
Using Port Forwading and DDNS
Using Port Forwading
F Some of ezTCP is not support the DNS and DDNS functions. If you need this option, please check the specification before deciding to buy it. CSE-M32, CSE-M73, CSE-H20, CSE-H21, CIE-H10 and CSW-H80 have these functions as of today. (April 27, 2009)

Table 6. Conditions of Internet connection

Table 5. Cases of IP address

Fig 5. Dynamic Public IP address on the TCP server

User image

User image

Fig

Fig 3. Dynamic IP address on the router

User image

User image

Fig


1. DDNS
User image
Fig

Table 4. Kind of IP address

Table 3 Tools for each ezTCP



Table 2 Range of Private IP address

Table 1 Classes of IP address