Establish Connection (CE) instruction

Top  Previous  Next

 

Description (see instruction description format info here)

 

Function:Makes the DS establish the data connection with the network host

 

Parameter (P) cmd format:PCE or PCExxx.xxx.xxx.xxx/ppppp, where

       xxx.xxx.xxx.xxx is the IP-address of the destination host;

       ppppp is the port number on the destination in the 0-65535 range

 

Possible replies:A, C, R

 

Relevance conditions:Current Routing Mode (RM) [setting/ parameter]= 1 (server/client) or 2 (client)

 

First introduced:Earlier than "baseline" V3.14/V3.51

 

See also:Ethernet port and network communications

 


Details

 

Establish Connection instruction makes the DS establish an outgoing connection with the network host. Which transport protocol is used (UDP or TCP) is defined by the current Transport Protocol (TP) [setting/ parameter].

 

This command has two syntax options: with and without destination IP-address and destination port number fields. Both fields must be either supplied or not supplied, it is not possible to have only one of the fields in the command body.

 

When destination IP-address and destination port number fields are supplied they are interpreted exactly as data fields in Destination IP-address (DI) parameter and Destination Port Number (DP) parameter i.e. override the  Destination IP-address (DI) settingand Destination Port Number (DP) setting. This means that sending PCExxx.xxx.xxx.xxx/ppppp command is equivalent to sending PDIxxx.xxx.xxx.xxx, then PDPppppp, followed by the PCE command.

 

When destination fields are not provided the DS will use the following destination IP-address and port number to connect to:

 

If, since the last time the PDI (Destination IP-address (DI) parameter) and PDP (Destination Port Number (DP) parameter) commands were issued the DS hasn't received any incoming connections from other network hosts then the DS will attempt to connect to the destination IP-address and port number defined by these recent PDI and PDP commands;

 

If (since the most recent PDI and PDP commands) the DS has accepted an incoming data connection then the DS will reread the values of Destination IP-address (DI) setting and Destination Port Number (DP) setting and attempt to connect to the destination host defined by these settings.  

 

TCP data connections are established in a normal way by initiating the SYN-SYN-ACK exchange with the network host. UDP data "connections" are established by sending a UDP datagram of zero length.

 

OK (A) reply code is returned if command is accepted. This does not mean that the data connection has been established already, only that the DS has accepted the command. Actual connection status can be verified at any time using the Echo (X) command (see c flag). Actual IP-address and port number of the destination host with which the DS has a data connection can be verified using the Status (U) command.

 

Error (C) reply code is returned if the data supplied in the command is invalid (or only one of the data fields is present). Rejected (R) reply code is returned if:

 

Command is issued while the IP-address of the DS is not properly configured (DHCP (DH) setting is 1 (enabled) and the DS hasn't yet obtained the IP-address from the DHCP server);

 

Current data connection state is not "closed". Close (or shut) the connection first using the Close Connection (CC) instruction or Abort Connection (CA) instruction;

 

Current Routing Mode (RM) [setting/ parameter] is 0 (server), because in this state the DS is not allowed to establish outgoing connections.